From f2edf3b178fc50ba3625fa8db3045703f0e339f4 Mon Sep 17 00:00:00 2001 From: ypriverol Date: Sat, 23 Dec 2023 09:01:40 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20bigbio/q?= =?UTF-8?q?uantms.org@ce9406c6d9f5098c7f599451023512d485d24f66=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- css/{874.227f6936.css => 145.a97369a0.css} | 2 +- index.html | 2 +- js/{874.d34650df.js => 145.354ab71d.js} | 6 +++--- js/{874.d34650df.js.map => 145.354ab71d.js.map} | 2 +- js/{app.80e10092.js => app.17c3c801.js} | 4 ++-- js/{app.80e10092.js.map => app.17c3c801.js.map} | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) rename css/{874.227f6936.css => 145.a97369a0.css} (99%) rename js/{874.d34650df.js => 145.354ab71d.js} (98%) rename js/{874.d34650df.js.map => 145.354ab71d.js.map} (57%) rename js/{app.80e10092.js => app.17c3c801.js} (79%) rename js/{app.80e10092.js.map => app.17c3c801.js.map} (97%) diff --git a/404.html b/404.html index f5cc318..53fee31 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -quantms.org
\ No newline at end of file +quantms.org
\ No newline at end of file diff --git a/css/874.227f6936.css b/css/145.a97369a0.css similarity index 99% rename from css/874.227f6936.css rename to css/145.a97369a0.css index 64524ec..0566c61 100644 --- a/css/874.227f6936.css +++ b/css/145.a97369a0.css @@ -1 +1 @@ -@charset "UTF-8";:root{--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:0.3s;--el-transition-duration-fast:0.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(0.645,0.045,0.355,1);--el-transition-function-fast-bezier:cubic-bezier(0.23,1,0.32,1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px;color-scheme:light;--el-color-white:#fff;--el-color-black:#000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#fff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#fff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#fff;--el-box-shadow:0px 12px 32px 4px rgba(0,0,0,.04),0px 8px 20px rgba(0,0,0,.08);--el-box-shadow-light:0px 0px 12px rgba(0,0,0,.12);--el-box-shadow-lighter:0px 0px 6px rgba(0,0,0,.12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0,0,0,.08),0px 12px 32px rgba(0,0,0,.12),0px 8px 16px -8px rgba(0,0,0,.16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0,0,0,.8);--el-overlay-color-light:rgba(0,0,0,.7);--el-overlay-color-lighter:rgba(0,0,0,.5);--el-mask-color:hsla(0,0%,100%,.9);--el-mask-color-extra-light:hsla(0,0%,100%,.3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color,var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary,20px);position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .btt,.el-drawer .ltr,.el-drawer .rtl,.el-drawer .ttb{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translateX(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translateX(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active,.el-tabs__item:hover{color:var(--el-color-primary)}.el-tabs__item:hover{cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;animation:slideInLeft-leave var(--el-transition-duration)}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translateX(100%)}to{opacity:1;transform-origin:0 0;transform:translateX(0)}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translateX(0);opacity:1}to{transform-origin:0 0;transform:translateX(100%);opacity:0}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translateX(-100%)}to{opacity:1;transform-origin:0 0;transform:translateX(0)}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translateX(0);opacity:1}to{transform-origin:0 0;transform:translateX(-100%);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__error,.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translateX(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{left:40px}.el-image-viewer__next,.el-image-viewer__prev{top:50%;transform:translateY(-50%);width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{right:40px;text-indent:2px}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{animation:viewer-fade-out var(--el-transition-duration)}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular);align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text.is-line-clamp{display:-webkit-inline-box;-webkit-box-orient:vertical;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px;--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info,.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color);display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.content-box[data-v-6e4bc48a]{width:100%}.info[data-v-6e4bc48a]{text-align:left;margin:20px 0;margin-left:2px;display:flex;justify-content:space-between}.info h1[data-v-6e4bc48a]{font-size:14px;margin:5px 0;font-weight:inherit;font-weight:500}.info span[data-v-6e4bc48a]{font-weight:700}.history-info[data-v-6e4bc48a]:hover{color:#000;cursor:pointer} \ No newline at end of file +@charset "UTF-8";:root{--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:0.3s;--el-transition-duration-fast:0.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(0.645,0.045,0.355,1);--el-transition-function-fast-bezier:cubic-bezier(0.23,1,0.32,1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px;color-scheme:light;--el-color-white:#fff;--el-color-black:#000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#fff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#fff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#fff;--el-box-shadow:0px 12px 32px 4px rgba(0,0,0,.04),0px 8px 20px rgba(0,0,0,.08);--el-box-shadow-light:0px 0px 12px rgba(0,0,0,.12);--el-box-shadow-lighter:0px 0px 6px rgba(0,0,0,.12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0,0,0,.08),0px 12px 32px rgba(0,0,0,.12),0px 8px 16px -8px rgba(0,0,0,.16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0,0,0,.8);--el-overlay-color-light:rgba(0,0,0,.7);--el-overlay-color-lighter:rgba(0,0,0,.5);--el-mask-color:hsla(0,0%,100%,.9);--el-mask-color-extra-light:hsla(0,0%,100%,.3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color,var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary,20px);position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .btt,.el-drawer .ltr,.el-drawer .rtl,.el-drawer .ttb{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translateX(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translateX(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active,.el-tabs__item:hover{color:var(--el-color-primary)}.el-tabs__item:hover{cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;animation:slideInLeft-leave var(--el-transition-duration)}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translateX(100%)}to{opacity:1;transform-origin:0 0;transform:translateX(0)}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translateX(0);opacity:1}to{transform-origin:0 0;transform:translateX(100%);opacity:0}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translateX(-100%)}to{opacity:1;transform-origin:0 0;transform:translateX(0)}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translateX(0);opacity:1}to{transform-origin:0 0;transform:translateX(-100%);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__error,.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translateX(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{left:40px}.el-image-viewer__next,.el-image-viewer__prev{top:50%;transform:translateY(-50%);width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{right:40px;text-indent:2px}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{animation:viewer-fade-out var(--el-transition-duration)}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular);align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text.is-line-clamp{display:-webkit-inline-box;-webkit-box-orient:vertical;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px;--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info,.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color);display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.content-box[data-v-609a8e64]{width:100%}.info[data-v-609a8e64]{text-align:left;margin:20px 0;margin-left:2px;display:flex;justify-content:space-between}.info h1[data-v-609a8e64]{font-size:14px;margin:5px 0;font-weight:inherit;font-weight:500}.info span[data-v-609a8e64]{font-weight:700}.history-info[data-v-609a8e64]:hover{color:#000;cursor:pointer} \ No newline at end of file diff --git a/index.html b/index.html index f5cc318..53fee31 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -quantms.org
\ No newline at end of file +quantms.org
\ No newline at end of file diff --git a/js/874.d34650df.js b/js/145.354ab71d.js similarity index 98% rename from js/874.d34650df.js rename to js/145.354ab71d.js index ccda1ee..a9d3d01 100644 --- a/js/874.d34650df.js +++ b/js/145.354ab71d.js @@ -1,4 +1,4 @@ -"use strict";(self["webpackChunkquantms_org"]=self["webpackChunkquantms_org"]||[]).push([[874],{7848:(t,e,n)=>{n.r(e),n.d(e,{default:()=>Rtt});var i={};n.r(i),n.d(i,{Arc:()=>UI,BezierCurve:()=>GI,BoundingRect:()=>Gu,Circle:()=>tI,CompoundPath:()=>YI,Ellipse:()=>iI,Group:()=>Ip,Image:()=>Jv,IncrementalDisplayable:()=>sC,Line:()=>EI,LinearGradient:()=>KI,OrientedBoundingRect:()=>rC,Path:()=>Uv,Point:()=>Lu,Polygon:()=>DI,Polyline:()=>PI,RadialGradient:()=>JI,Rect:()=>sy,Ring:()=>MI,Sector:()=>bI,Text:()=>Iy,applyTransform:()=>IC,clipPointsByRect:()=>kC,clipRectByRect:()=>LC,createIcon:()=>PC,extendPath:()=>pC,extendShape:()=>cC,getShapeClass:()=>gC,getTransform:()=>MC,groupTransition:()=>DC,initProps:()=>Ym,isElementRemoved:()=>Xm,lineLineIntersect:()=>OC,linePolygonIntersect:()=>RC,makeImage:()=>yC,makePath:()=>vC,mergePath:()=>_C,registerShape:()=>fC,removeElement:()=>jm,removeElementWithFadeOut:()=>Km,resizePath:()=>xC,setTooltipConfig:()=>zC,subPixelOptimize:()=>SC,subPixelOptimizeLine:()=>bC,subPixelOptimizeRect:()=>wC,transformDirection:()=>CC,traverseElements:()=>VC,updateProps:()=>Zm});var r=n(6252),o=n(2262),a=n(9963),s=n(3577),l=n(5781),u=n(5027),h=n(9143);const c=t=>{if(!t)return{onClick:s.dG,onMousedown:s.dG,onMouseup:s.dG};let e=!1,n=!1;const i=i=>{e&&n&&t(i),e=n=!1},r=t=>{e=t.target===t.currentTarget},o=t=>{n=t.target===t.currentTarget};return{onClick:i,onMousedown:r,onMouseup:o}};var d=(t=>(t[t["TEXT"]=1]="TEXT",t[t["CLASS"]=2]="CLASS",t[t["STYLE"]=4]="STYLE",t[t["PROPS"]=8]="PROPS",t[t["FULL_PROPS"]=16]="FULL_PROPS",t[t["HYDRATE_EVENTS"]=32]="HYDRATE_EVENTS",t[t["STABLE_FRAGMENT"]=64]="STABLE_FRAGMENT",t[t["KEYED_FRAGMENT"]=128]="KEYED_FRAGMENT",t[t["UNKEYED_FRAGMENT"]=256]="UNKEYED_FRAGMENT",t[t["NEED_PATCH"]=512]="NEED_PATCH",t[t["DYNAMIC_SLOTS"]=1024]="DYNAMIC_SLOTS",t[t["HOISTED"]=-1]="HOISTED",t[t["BAIL"]=-2]="BAIL",t))(d||{});const p=t=>{const e=(0,s.kJ)(t)?t:[t],n=[];return e.forEach((t=>{var e;(0,s.kJ)(t)?n.push(...p(t)):(0,r.lA)(t)&&(0,s.kJ)(t.children)?n.push(...p(t.children)):(n.push(t),(0,r.lA)(t)&&(null==(e=t.component)?void 0:e.subTree)&&n.push(...p(t.component.subTree)))})),n},f=(0,u.o8)({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:(0,u.Cq)([String,Array,Object])},zIndex:{type:(0,u.Cq)([String,Number])}}),g={click:t=>t instanceof MouseEvent},v="overlay";var y=(0,r.aZ)({name:"ElOverlay",props:f,emits:g,setup(t,{slots:e,emit:n}){const i=(0,h.s3)(v),o=t=>{n("click",t)},{onClick:a,onMousedown:s,onMouseup:l}=c(t.customMaskEvent?void 0:o);return()=>t.mask?(0,r.Wm)("div",{class:[i.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:a,onMousedown:s,onMouseup:l},[(0,r.WI)(e,"default")],d.STYLE|d.CLASS|d.PROPS,["onClick","onMouseup","onMousedown"]):(0,r.h)("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[(0,r.WI)(e,"default")])}});const m=y;var _=n(4181),x=n(9809);const b=(0,u.o8)({center:Boolean,alignCenter:Boolean,closeIcon:{type:x.AA},customClass:{type:String,default:""},draggable:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}});var w=n(9460),S=n(5162);const M=(0,u.o8)({...b,appendToBody:Boolean,appendTo:{type:(0,u.Cq)(String),default:"body"},beforeClose:{type:(0,u.Cq)(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1},headerAriaLevel:{type:String,default:"2"}}),I={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[w.f_]:t=>(0,S.jn)(t),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},C=(0,u.o8)({...M,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),T=I;var A=n(1446),D=n(531),k=n(9379),L=n(7774),P=n(7675),R=n(3299),O=n(9360),N=n(4568),E=n(2259),z=n(6502),B=n(4721),V=n(7647);const F=(t,e={})=>{(0,o.dq)(t)||(0,B._)("[useLockscreen]","You need to pass a ref param to this function");const n=e.ns||(0,h.s3)("popup"),i=(0,o.Fl)((()=>n.bm("parent","hidden")));if(!R.C5||(0,P.pv)(document.body,i.value))return;let a=0,s=!1,l="0";const u=()=>{setTimeout((()=>{(0,P.IV)(null==document?void 0:document.body,i.value),s&&document&&(document.body.style.width=l)}),200)};(0,r.YP)(t,(t=>{if(!t)return void u();s=!(0,P.pv)(document.body,i.value),s&&(l=document.body.style.width),a=(0,V.Iz)(n.namespace.value);const e=document.documentElement.clientHeight0&&(e||"scroll"===r)&&s&&(document.body.style.width=`calc(100% - ${a}px)`),(0,P.cn)(document.body,i.value)})),(0,o.EB)((()=>u()))},G=(t,e)=>{var n;const i=(0,r.FN)(),a=i.emit,{nextZIndex:s}=(0,N.Cn)();let l="";const u=(0,E.Me)(),c=(0,E.Me)(),d=(0,o.iH)(!1),p=(0,o.iH)(!1),f=(0,o.iH)(!1),g=(0,o.iH)(null!=(n=t.zIndex)?n:s());let v,y;const m=(0,z.WS)("namespace",h.tL),_=(0,r.Fl)((()=>{const e={},n=`--${m.value}-dialog`;return t.fullscreen||(t.top&&(e[`${n}-margin-top`]=t.top),t.width&&(e[`${n}-width`]=(0,P.Nn)(t.width))),e})),x=(0,r.Fl)((()=>t.alignCenter?{display:"flex"}:{}));function b(){a("opened")}function S(){a("closed"),a(w.f_,!1),t.destroyOnClose&&(f.value=!1)}function M(){a("close")}function I(){null==y||y(),null==v||v(),t.openDelay&&t.openDelay>0?({stop:v}=(0,R.eM)((()=>D()),t.openDelay)):D()}function C(){null==v||v(),null==y||y(),t.closeDelay&&t.closeDelay>0?({stop:y}=(0,R.eM)((()=>k()),t.closeDelay)):k()}function T(){function e(t){t||(p.value=!0,d.value=!1)}t.beforeClose?t.beforeClose(e):C()}function A(){t.closeOnClickModal&&T()}function D(){R.C5&&(d.value=!0)}function k(){d.value=!1}function L(){a("openAutoFocus")}function B(){a("closeAutoFocus")}function V(t){var e;"pointer"===(null==(e=t.detail)?void 0:e.focusReason)&&t.preventDefault()}function G(){t.closeOnPressEscape&&T()}return t.lockScroll&&F(d),(0,r.YP)((()=>t.modelValue),(n=>{n?(p.value=!1,I(),f.value=!0,g.value=(0,O.Z)(t.zIndex)?s():g.value++,(0,r.Y3)((()=>{a("open"),e.value&&(e.value.scrollTop=0)}))):d.value&&C()})),(0,r.YP)((()=>t.fullscreen),(t=>{e.value&&(t?(l=e.value.style.transform,e.value.style.transform=""):e.value.style.transform=l)})),(0,r.bv)((()=>{t.modelValue&&(d.value=!0,f.value=!0,I())})),{afterEnter:b,afterLeave:S,beforeLeave:M,handleClose:T,onModalClick:A,close:C,doClose:k,onOpenAutoFocus:L,onCloseAutoFocus:B,onCloseRequested:G,onFocusoutPrevented:V,titleId:u,bodyId:c,closed:p,style:_,overlayDialogStyle:x,rendered:f,visible:d,zIndex:g}},H=(0,r.aZ)({name:"ElDrawer",components:{ElOverlay:m,ElFocusTrap:D.Z,ElIcon:_.gn,Close:l.Close},inheritAttrs:!1,props:C,emits:T,setup(t,{slots:e}){(0,k.A)({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},(0,r.Fl)((()=>!!e.title))),(0,k.A)({scope:"el-drawer",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/drawer.html#attributes",type:"Attribute"},(0,r.Fl)((()=>!!t.customClass)));const n=(0,o.iH)(),i=(0,o.iH)(),a=(0,h.s3)("drawer"),{t:s}=(0,L.bU)(),l=(0,r.Fl)((()=>"rtl"===t.direction||"ltr"===t.direction)),u=(0,r.Fl)((()=>(0,P.Nn)(t.size)));return{...G(t,n),drawerRef:n,focusStartRef:i,isHorizontal:l,drawerSize:u,ns:a,t:s}}}),W=["aria-label","aria-labelledby","aria-describedby"],U=["id","aria-level"],Z=["aria-label"],Y=["id"];function X(t,e,n,i,o,l){const u=(0,r.up)("close"),h=(0,r.up)("el-icon"),c=(0,r.up)("el-focus-trap"),d=(0,r.up)("el-overlay");return(0,r.wg)(),(0,r.j4)(r.lR,{to:"body",disabled:!t.appendToBody},[(0,r.Wm)(a.uT,{name:t.ns.b("fade"),onAfterEnter:t.afterEnter,onAfterLeave:t.afterLeave,onBeforeLeave:t.beforeLeave,persisted:""},{default:(0,r.w5)((()=>[(0,r.wy)((0,r.Wm)(d,{mask:t.modal,"overlay-class":t.modalClass,"z-index":t.zIndex,onClick:t.onModalClick},{default:(0,r.w5)((()=>[(0,r.Wm)(c,{loop:"",trapped:t.visible,"focus-trap-el":t.drawerRef,"focus-start-el":t.focusStartRef,onReleaseRequested:t.onCloseRequested},{default:(0,r.w5)((()=>[(0,r._)("div",(0,r.dG)({ref:"drawerRef","aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:t.titleId,"aria-describedby":t.bodyId},t.$attrs,{class:[t.ns.b(),t.direction,t.visible&&"open",t.customClass],style:t.isHorizontal?"width: "+t.drawerSize:"height: "+t.drawerSize,role:"dialog",onClick:e[1]||(e[1]=(0,a.iM)((()=>{}),["stop"]))}),[(0,r._)("span",{ref:"focusStartRef",class:(0,s.C_)(t.ns.e("sr-focus")),tabindex:"-1"},null,2),t.withHeader?((0,r.wg)(),(0,r.iD)("header",{key:0,class:(0,s.C_)(t.ns.e("header"))},[t.$slots.title?(0,r.WI)(t.$slots,"title",{key:1},(()=>[(0,r.kq)(" DEPRECATED SLOT ")])):(0,r.WI)(t.$slots,"header",{key:0,close:t.handleClose,titleId:t.titleId,titleClass:t.ns.e("title")},(()=>[t.$slots.title?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:0,id:t.titleId,role:"heading","aria-level":t.headerAriaLevel,class:(0,s.C_)(t.ns.e("title"))},(0,s.zw)(t.title),11,U))])),t.showClose?((0,r.wg)(),(0,r.iD)("button",{key:2,"aria-label":t.t("el.drawer.close"),class:(0,s.C_)(t.ns.e("close-btn")),type:"button",onClick:e[0]||(e[0]=(...e)=>t.handleClose&&t.handleClose(...e))},[(0,r.Wm)(h,{class:(0,s.C_)(t.ns.e("close"))},{default:(0,r.w5)((()=>[(0,r.Wm)(u)])),_:1},8,["class"])],10,Z)):(0,r.kq)("v-if",!0)],2)):(0,r.kq)("v-if",!0),t.rendered?((0,r.wg)(),(0,r.iD)("div",{key:1,id:t.bodyId,class:(0,s.C_)(t.ns.e("body"))},[(0,r.WI)(t.$slots,"default")],10,Y)):(0,r.kq)("v-if",!0),t.$slots.footer?((0,r.wg)(),(0,r.iD)("div",{key:2,class:(0,s.C_)(t.ns.e("footer"))},[(0,r.WI)(t.$slots,"footer")],2)):(0,r.kq)("v-if",!0)],16,W)])),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])])),_:3},8,["mask","overlay-class","z-index","onClick"]),[[a.F8,t.visible]])])),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var j=(0,A.Z)(H,[["render",X],["__file","drawer.vue"]]),q=n(2123);const K=(0,q.nz)(j);n(3241);const $=Symbol("tabsRootContextKey");var J=n(6309),Q=n(5450);const tt=(0,u.o8)({tabs:{type:(0,u.Cq)(Array),default:()=>(0,Q.N)([])}});var et=n(3650);const nt="ElTabBar",it=(0,r.aZ)({name:nt}),rt=(0,r.aZ)({...it,props:tt,setup(t,{expose:e}){const n=t,i=(0,r.FN)(),a=(0,r.f3)($);a||(0,B._)(nt,"");const l=(0,h.s3)("tabs"),u=(0,o.iH)(),c=(0,o.iH)(),d=()=>{let t=0,e=0;const r=["top","bottom"].includes(a.props.tabPosition)?"width":"height",o="width"===r?"x":"y",s="x"===o?"left":"top";return n.tabs.every((o=>{var a,l;const u=null==(l=null==(a=i.parent)?void 0:a.refs)?void 0:l[`tab-${o.uid}`];if(!u)return!1;if(!o.active)return!0;t=u[`offset${(0,et.kC)(s)}`],e=u[`client${(0,et.kC)(r)}`];const h=window.getComputedStyle(u);return"width"===r&&(n.tabs.length>1&&(e-=Number.parseFloat(h.paddingLeft)+Number.parseFloat(h.paddingRight)),t+=Number.parseFloat(h.paddingLeft)),!1})),{[r]:`${e}px`,transform:`translate${(0,et.kC)(o)}(${t}px)`}},p=()=>c.value=d();return(0,r.YP)((()=>n.tabs),(async()=>{await(0,r.Y3)(),p()}),{immediate:!0}),(0,J.yU7)(u,(()=>p())),e({ref:u,update:p}),(t,e)=>((0,r.wg)(),(0,r.iD)("div",{ref_key:"barRef",ref:u,class:(0,s.C_)([(0,o.SU)(l).e("active-bar"),(0,o.SU)(l).is((0,o.SU)(a).props.tabPosition)]),style:(0,s.j5)(c.value)},null,6))}});var ot=(0,A.Z)(rt,[["__file","tab-bar.vue"]]),at=n(4309);const st=(0,u.o8)({panes:{type:(0,u.Cq)(Array),default:()=>(0,Q.N)([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),lt={tabClick:(t,e,n)=>n instanceof Event,tabRemove:(t,e)=>e instanceof Event},ut="ElTabNav",ht=(0,r.aZ)({name:ut,props:st,emits:lt,setup(t,{expose:e,emit:n}){const i=(0,r.FN)(),a=(0,r.f3)($);a||(0,B._)(ut,"");const s=(0,h.s3)("tabs"),u=(0,J.xKQ)(),c=(0,J.vou)(),d=(0,o.iH)(),p=(0,o.iH)(),f=(0,o.iH)(),g=(0,o.iH)(),v=(0,o.iH)(!1),y=(0,o.iH)(0),m=(0,o.iH)(!1),x=(0,o.iH)(!0),b=(0,r.Fl)((()=>["top","bottom"].includes(a.props.tabPosition)?"width":"height")),w=(0,r.Fl)((()=>{const t="width"===b.value?"X":"Y";return{transform:`translate${t}(-${y.value}px)`}})),S=()=>{if(!d.value)return;const t=d.value[`offset${(0,et.kC)(b.value)}`],e=y.value;if(!e)return;const n=e>t?e-t:0;y.value=n},M=()=>{if(!d.value||!p.value)return;const t=p.value[`offset${(0,et.kC)(b.value)}`],e=d.value[`offset${(0,et.kC)(b.value)}`],n=y.value;if(t-n<=e)return;const i=t-n>2*e?n+e:t-e;y.value=i},I=async()=>{const t=p.value;if(!v.value||!f.value||!d.value||!t)return;await(0,r.Y3)();const e=f.value.querySelector(".is-active");if(!e)return;const n=d.value,i=["top","bottom"].includes(a.props.tabPosition),o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),l=i?t.offsetWidth-s.width:t.offsetHeight-s.height,u=y.value;let h=u;i?(o.lefts.right&&(h=u+o.right-s.right)):(o.tops.bottom&&(h=u+(o.bottom-s.bottom))),h=Math.max(h,0),y.value=Math.min(h,l)},C=()=>{var e;if(!p.value||!d.value)return;t.stretch&&(null==(e=g.value)||e.update());const n=p.value[`offset${(0,et.kC)(b.value)}`],i=d.value[`offset${(0,et.kC)(b.value)}`],r=y.value;i0&&(y.value=0))},T=t=>{const e=t.code,{up:n,down:i,left:r,right:o}=at.EVENT_CODE;if(![n,i,r,o].includes(e))return;const a=Array.from(t.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),s=a.indexOf(t.target);let l;l=e===r||e===n?0===s?a.length-1:s-1:s{x.value&&(m.value=!0)},D=()=>m.value=!1;return(0,r.YP)(u,(t=>{"hidden"===t?x.value=!1:"visible"===t&&setTimeout((()=>x.value=!0),50)})),(0,r.YP)(c,(t=>{t?setTimeout((()=>x.value=!0),50):x.value=!1})),(0,J.yU7)(f,C),(0,r.bv)((()=>setTimeout((()=>I()),0))),(0,r.ic)((()=>C())),e({scrollToActiveTab:I,removeFocus:D}),(0,r.YP)((()=>t.panes),(()=>i.update()),{flush:"post",deep:!0}),()=>{const e=v.value?[(0,r.Wm)("span",{class:[s.e("nav-prev"),s.is("disabled",!v.value.prev)],onClick:S},[(0,r.Wm)(_.gn,null,{default:()=>[(0,r.Wm)(l.ArrowLeft,null,null)]})]),(0,r.Wm)("span",{class:[s.e("nav-next"),s.is("disabled",!v.value.next)],onClick:M},[(0,r.Wm)(_.gn,null,{default:()=>[(0,r.Wm)(l.ArrowRight,null,null)]})])]:null,i=t.panes.map(((e,i)=>{var o,u,h,c;const d=e.uid,p=e.props.disabled,f=null!=(u=null!=(o=e.props.name)?o:e.index)?u:`${i}`,g=!p&&(e.isClosable||t.editable);e.index=`${i}`;const v=g?(0,r.Wm)(_.gn,{class:"is-icon-close",onClick:t=>n("tabRemove",e,t)},{default:()=>[(0,r.Wm)(l.Close,null,null)]}):null,y=(null==(c=(h=e.slots).label)?void 0:c.call(h))||e.props.label,x=!p&&e.active?0:-1;return(0,r.Wm)("div",{ref:`tab-${d}`,class:[s.e("item"),s.is(a.props.tabPosition),s.is("active",e.active),s.is("disabled",p),s.is("closable",g),s.is("focus",m.value)],id:`tab-${f}`,key:`tab-${d}`,"aria-controls":`pane-${f}`,role:"tab","aria-selected":e.active,tabindex:x,onFocus:()=>A(),onBlur:()=>D(),onClick:t=>{D(),n("tabClick",e,f,t)},onKeydown:t=>{!g||t.code!==at.EVENT_CODE.delete&&t.code!==at.EVENT_CODE.backspace||n("tabRemove",e,t)}},[y,v])}));return(0,r.Wm)("div",{ref:f,class:[s.e("nav-wrap"),s.is("scrollable",!!v.value),s.is(a.props.tabPosition)]},[e,(0,r.Wm)("div",{class:s.e("nav-scroll"),ref:d},[(0,r.Wm)("div",{class:[s.e("nav"),s.is(a.props.tabPosition),s.is("stretch",t.stretch&&["top","bottom"].includes(a.props.tabPosition))],ref:p,style:w.value,role:"tablist",onKeydown:T},[t.type?null:(0,r.Wm)(ot,{ref:g,tabs:[...t.panes]},null),i])])])}}}),ct=(t,e,n)=>{const i=p(t.subTree).filter((t=>{var n;return(0,r.lA)(t)&&(null==(n=t.type)?void 0:n.name)===e&&!!t.component})),o=i.map((t=>t.component.uid));return o.map((t=>n[t])).filter((t=>!!t))},dt=(t,e)=>{const n={},i=(0,o.XI)([]),r=r=>{n[r.uid]=r,i.value=ct(t,e,n)},a=t=>{delete n[t],i.value=i.value.filter((e=>e.uid!==t))};return{children:i,addChild:r,removeChild:a}},pt=(0,u.o8)({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:(0,u.Cq)(Function),default:()=>!0},stretch:Boolean}),ft=t=>(0,s.HD)(t)||(0,S.hj)(t),gt={[w.f_]:t=>ft(t),tabClick:(t,e)=>e instanceof Event,tabChange:t=>ft(t),edit:(t,e)=>["remove","add"].includes(e),tabRemove:t=>ft(t),tabAdd:()=>!0},vt=(0,r.aZ)({name:"ElTabs",props:pt,emits:gt,setup(t,{emit:e,slots:n,expose:i}){var a,s;const u=(0,h.s3)("tabs"),{children:c,addChild:d,removeChild:p}=dt((0,r.FN)(),"ElTabPane"),f=(0,o.iH)(),g=(0,o.iH)(null!=(s=null!=(a=t.modelValue)?a:t.activeName)?s:"0"),v=async(n,i=!1)=>{var r,o,a;if(g.value!==n&&!(0,S.o8)(n))try{const s=await(null==(r=t.beforeLeave)?void 0:r.call(t,n,g.value));!1!==s&&(g.value=n,i&&(e(w.f_,n),e("tabChange",n)),null==(a=null==(o=f.value)?void 0:o.removeFocus)||a.call(o))}catch(fI){}},y=(t,n,i)=>{t.props.disabled||(v(n,!0),e("tabClick",t,i))},m=(t,n)=>{t.props.disabled||(0,S.o8)(t.props.name)||(n.stopPropagation(),e("edit",t.props.name,"remove"),e("tabRemove",t.props.name))},x=()=>{e("edit",void 0,"add"),e("tabAdd")};return(0,k.A)({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},(0,r.Fl)((()=>!!t.activeName))),(0,r.YP)((()=>t.activeName),(t=>v(t))),(0,r.YP)((()=>t.modelValue),(t=>v(t))),(0,r.YP)(g,(async()=>{var t;await(0,r.Y3)(),null==(t=f.value)||t.scrollToActiveTab()})),(0,r.JJ)($,{props:t,currentName:g,registerPane:d,unregisterPane:p}),i({currentName:g}),()=>{const e=n.addIcon,i=t.editable||t.addable?(0,r.Wm)("span",{class:u.e("new-tab"),tabindex:"0",onClick:x,onKeydown:t=>{t.code===at.EVENT_CODE.enter&&x()}},[e?(0,r.WI)(n,"addIcon"):(0,r.Wm)(_.gn,{class:u.is("icon-plus")},{default:()=>[(0,r.Wm)(l.Plus,null,null)]})]):null,o=(0,r.Wm)("div",{class:[u.e("header"),u.is(t.tabPosition)]},[i,(0,r.Wm)(ht,{ref:f,currentName:g.value,editable:t.editable,type:t.type,panes:c.value,stretch:t.stretch,onTabClick:y,onTabRemove:m},null)]),a=(0,r.Wm)("div",{class:u.e("content")},[(0,r.WI)(n,"default")]);return(0,r.Wm)("div",{class:[u.b(),u.m(t.tabPosition),{[u.m("card")]:"card"===t.type,[u.m("border-card")]:"border-card"===t.type}]},[..."bottom"!==t.tabPosition?[o,a]:[a,o]])}}}),yt=(0,u.o8)({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),mt=["id","aria-hidden","aria-labelledby"],_t="ElTabPane",xt=(0,r.aZ)({name:_t}),bt=(0,r.aZ)({...xt,props:yt,setup(t){const e=t,n=(0,r.FN)(),i=(0,r.Rr)(),l=(0,r.f3)($);l||(0,B._)(_t,"usage: ");const u=(0,h.s3)("tab-pane"),c=(0,o.iH)(),d=(0,r.Fl)((()=>e.closable||l.props.closable)),p=(0,R.Rc)((()=>{var t;return l.currentName.value===(null!=(t=e.name)?t:c.value)})),f=(0,o.iH)(p.value),g=(0,r.Fl)((()=>{var t;return null!=(t=e.name)?t:c.value})),v=(0,R.Rc)((()=>!e.lazy||f.value||p.value));(0,r.YP)(p,(t=>{t&&(f.value=!0)}));const y=(0,o.qj)({uid:n.uid,slots:i,props:e,paneName:g,active:p,index:c,isClosable:d});return(0,r.bv)((()=>{l.registerPane(y)})),(0,r.Ah)((()=>{l.unregisterPane(y.uid)})),(t,e)=>(0,o.SU)(v)?(0,r.wy)(((0,r.wg)(),(0,r.iD)("div",{key:0,id:`pane-${(0,o.SU)(g)}`,class:(0,s.C_)((0,o.SU)(u).b()),role:"tabpanel","aria-hidden":!(0,o.SU)(p),"aria-labelledby":`tab-${(0,o.SU)(g)}`},[(0,r.WI)(t.$slots,"default")],10,mt)),[[a.F8,(0,o.SU)(p)]]):(0,r.kq)("v-if",!0)}});var wt=(0,A.Z)(bt,[["__file","tab-pane.vue"]]);const St=(0,q.nz)(vt,{TabPane:wt});(0,q.dp)(wt);var Mt=n(8600),It=(n(9414),n(6398)),Ct=(n(9448),n(7534)),Tt=(n(2471),n(2111));const At=(0,u.o8)({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,validator:Tt.P},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},inactiveActionIcon:{type:x.AA},activeActionIcon:{type:x.AA},activeIcon:{type:x.AA},inactiveIcon:{type:x.AA},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:(0,u.Cq)(Function)},id:String,tabindex:{type:[String,Number]},value:{type:[Boolean,String,Number],default:!1},label:{type:String,default:void 0}}),Dt={[w.f_]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t),[w.O7]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t),[w.e_]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t)};var kt=n(5620),Lt=n(1069);const Pt=["onClick"],Rt=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"],Ot=["aria-hidden"],Nt=["aria-hidden"],Et=["aria-hidden"],zt="ElSwitch",Bt=(0,r.aZ)({name:zt}),Vt=(0,r.aZ)({...Bt,props:At,emits:Dt,setup(t,{expose:e,emit:n}){const i=t,u=(0,r.FN)(),{formItem:c}=(0,kt.A)(),d=(0,Lt.Cd)(),p=(0,h.s3)("switch"),f=t=>{t.forEach((t=>{(0,k.A)({from:t[0],replacement:t[1],scope:zt,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},(0,r.Fl)((()=>{var e;return!!(null==(e=u.vnode.props)?void 0:e[t[2]])})))}))};f([['"value"','"model-value" or "v-model"',"value"],['"active-color"',"CSS var `--el-switch-on-color`","activeColor"],['"inactive-color"',"CSS var `--el-switch-off-color`","inactiveColor"],['"border-color"',"CSS var `--el-switch-border-color`","borderColor"]]);const{inputId:g}=(0,kt.p)(i,{formItemContext:c}),v=(0,Lt.DT)((0,r.Fl)((()=>i.loading))),y=(0,o.iH)(!1!==i.modelValue),m=(0,o.iH)(),x=(0,o.iH)(),b=(0,r.Fl)((()=>[p.b(),p.m(d.value),p.is("disabled",v.value),p.is("checked",A.value)])),M=(0,r.Fl)((()=>[p.e("label"),p.em("label","left"),p.is("active",!A.value)])),I=(0,r.Fl)((()=>[p.e("label"),p.em("label","right"),p.is("active",A.value)])),C=(0,r.Fl)((()=>({width:(0,P.Nn)(i.width)})));(0,r.YP)((()=>i.modelValue),(()=>{y.value=!0})),(0,r.YP)((()=>i.value),(()=>{y.value=!1}));const T=(0,r.Fl)((()=>y.value?i.modelValue:i.value)),A=(0,r.Fl)((()=>T.value===i.activeValue));[i.activeValue,i.inactiveValue].includes(T.value)||(n(w.f_,i.inactiveValue),n(w.O7,i.inactiveValue),n(w.e_,i.inactiveValue)),(0,r.YP)(A,(t=>{var e;m.value.checked=t,i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"change").catch((t=>(0,B.N)(t))))}));const D=()=>{const t=A.value?i.inactiveValue:i.activeValue;n(w.f_,t),n(w.O7,t),n(w.e_,t),(0,r.Y3)((()=>{m.value.checked=A.value}))},L=()=>{if(v.value)return;const{beforeChange:t}=i;if(!t)return void D();const e=t(),n=[(0,s.tI)(e),(0,S.jn)(e)].includes(!0);n||(0,B._)(zt,"beforeChange must return type `Promise` or `boolean`"),(0,s.tI)(e)?e.then((t=>{t&&D()})).catch((t=>{(0,B.N)(zt,`some error occurred: ${t}`)})):e&&D()},R=(0,r.Fl)((()=>p.cssVarBlock({...i.activeColor?{"on-color":i.activeColor}:null,...i.inactiveColor?{"off-color":i.inactiveColor}:null,...i.borderColor?{"border-color":i.borderColor}:null}))),O=()=>{var t,e;null==(e=null==(t=m.value)?void 0:t.focus)||e.call(t)};return(0,r.bv)((()=>{m.value.checked=A.value})),e({focus:O,checked:A}),(t,e)=>((0,r.wg)(),(0,r.iD)("div",{class:(0,s.C_)((0,o.SU)(b)),style:(0,s.j5)((0,o.SU)(R)),onClick:(0,a.iM)(L,["prevent"])},[(0,r._)("input",{id:(0,o.SU)(g),ref_key:"input",ref:m,class:(0,s.C_)((0,o.SU)(p).e("input")),type:"checkbox",role:"switch","aria-checked":(0,o.SU)(A),"aria-disabled":(0,o.SU)(v),"aria-label":t.label,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:(0,o.SU)(v),tabindex:t.tabindex,onChange:D,onKeydown:(0,a.D2)(L,["enter"])},null,42,Rt),t.inlinePrompt||!t.inactiveIcon&&!t.inactiveText?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:0,class:(0,s.C_)((0,o.SU)(M))},[t.inactiveIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.inactiveIcon)))])),_:1})):(0,r.kq)("v-if",!0),!t.inactiveIcon&&t.inactiveText?((0,r.wg)(),(0,r.iD)("span",{key:1,"aria-hidden":(0,o.SU)(A)},(0,s.zw)(t.inactiveText),9,Ot)):(0,r.kq)("v-if",!0)],2)),(0,r._)("span",{ref_key:"core",ref:x,class:(0,s.C_)((0,o.SU)(p).e("core")),style:(0,s.j5)((0,o.SU)(C))},[t.inlinePrompt?((0,r.wg)(),(0,r.iD)("div",{key:0,class:(0,s.C_)((0,o.SU)(p).e("inner"))},[t.activeIcon||t.inactiveIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0,class:(0,s.C_)((0,o.SU)(p).is("icon"))},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)((0,o.SU)(A)?t.activeIcon:t.inactiveIcon)))])),_:1},8,["class"])):t.activeText||t.inactiveText?((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,s.C_)((0,o.SU)(p).is("text")),"aria-hidden":!(0,o.SU)(A)},(0,s.zw)((0,o.SU)(A)?t.activeText:t.inactiveText),11,Nt)):(0,r.kq)("v-if",!0)],2)):(0,r.kq)("v-if",!0),(0,r._)("div",{class:(0,s.C_)((0,o.SU)(p).e("action"))},[t.loading?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0,class:(0,s.C_)((0,o.SU)(p).is("loading"))},{default:(0,r.w5)((()=>[(0,r.Wm)((0,o.SU)(l.Loading))])),_:1},8,["class"])):(0,o.SU)(A)?(0,r.WI)(t.$slots,"active-action",{key:1},(()=>[t.activeActionIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.activeActionIcon)))])),_:1})):(0,r.kq)("v-if",!0)])):(0,o.SU)(A)?(0,r.kq)("v-if",!0):(0,r.WI)(t.$slots,"inactive-action",{key:2},(()=>[t.inactiveActionIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.inactiveActionIcon)))])),_:1})):(0,r.kq)("v-if",!0)]))],2)],6),t.inlinePrompt||!t.activeIcon&&!t.activeText?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,s.C_)((0,o.SU)(I))},[t.activeIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.activeIcon)))])),_:1})):(0,r.kq)("v-if",!0),!t.activeIcon&&t.activeText?((0,r.wg)(),(0,r.iD)("span",{key:1,"aria-hidden":!(0,o.SU)(A)},(0,s.zw)(t.activeText),9,Et)):(0,r.kq)("v-if",!0)],2))],14,Pt))}});var Ft=(0,A.Z)(Vt,[["__file","switch.vue"]]);const Gt=(0,q.nz)(Ft);var Ht=n(63);const Wt=()=>(0,Ht.Z)({method:"get",url:"/data/proteinTable.json.gz",responseType:"arraybuffer"}),Ut=()=>(0,Ht.Z)({method:"get",url:"/data/Cell_lines_IBAQ.json.gz",responseType:"arraybuffer"}),Zt=4,Yt=0,Xt=1,jt=2;function qt(t){let e=t.length;while(--e>=0)t[e]=0}const Kt=0,$t=1,Jt=2,Qt=3,te=258,ee=29,ne=256,ie=ne+1+ee,re=30,oe=19,ae=2*ie+1,se=15,le=16,ue=7,he=256,ce=16,de=17,pe=18,fe=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ge=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ve=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),me=512,_e=new Array(2*(ie+2));qt(_e);const xe=new Array(2*re);qt(xe);const be=new Array(me);qt(be);const we=new Array(te-Qt+1);qt(we);const Se=new Array(ee);qt(Se);const Me=new Array(re);function Ie(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let Ce,Te,Ae;function De(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}qt(Me);const ke=t=>t<256?be[t]:be[256+(t>>>7)],Le=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Pe=(t,e,n)=>{t.bi_valid>le-n?(t.bi_buf|=e<>le-t.bi_valid,t.bi_valid+=n-le):(t.bi_buf|=e<{Pe(t,n[2*e],n[2*e+1])},Oe=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},Ne=t=>{16===t.bi_valid?(Le(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)},Ee=(t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,h,c,d,p,f,g=0;for(d=0;d<=se;d++)t.bl_count[d]=0;for(n[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;ul&&(d=l,g++),n[2*h+1]=d,h>i||(t.bl_count[d]++,p=0,h>=s&&(p=a[h-s]),f=n[2*h],t.opt_len+=f*(d+p),o&&(t.static_len+=f*(r[2*h+1]+p)));if(0!==g){do{d=l-1;while(0===t.bl_count[d])d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;0!==d;d--){h=t.bl_count[d];while(0!==h)c=t.heap[--u],c>i||(n[2*c+1]!==d&&(t.opt_len+=(d-n[2*c+1])*n[2*c],n[2*c+1]=d),h--)}}},ze=(t,e,n)=>{const i=new Array(se+1);let r,o,a=0;for(r=1;r<=se;r++)a=a+n[r-1]<<1,i[r]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=Oe(i[e]++,e))}},Be=()=>{let t,e,n,i,r;const o=new Array(se+1);for(n=0,i=0;i>=7;i{let e;for(e=0;e{t.bi_valid>8?Le(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Ge=(t,e,n,i)=>{const r=2*e,o=2*n;return t[r]{const i=t.heap[n];let r=n<<1;while(r<=t.heap_len){if(r{let i,r,o,a,s=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+s++],i+=(255&t.pending_buf[t.sym_buf+s++])<<8,r=t.pending_buf[t.sym_buf+s++],0===i?Re(t,r,e):(o=we[r],Re(t,o+ne+1,e),a=fe[o],0!==a&&(r-=Se[o],Pe(t,r,a)),i--,o=ke(i),Re(t,o,n),a=ge[o],0!==a&&(i-=Me[o],Pe(t,i,a)))}while(s{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,s,l,u=-1;for(t.heap_len=0,t.heap_max=ae,a=0;a>1;a>=1;a--)He(t,n,a);l=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],He(t,n,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,n[2*l]=n[2*a]+n[2*s],t.depth[l]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,n[2*a+1]=n[2*s+1]=l,t.heap[1]=l++,He(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Ee(t,e),ze(n,u,t.bl_count)},Ze=(t,e,n)=>{let i,r,o=-1,a=e[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=a,a=e[2*(i+1)+1],++s{let i,r,o=-1,a=e[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),i=0;i<=n;i++)if(r=a,a=e[2*(i+1)+1],!(++s{let e;for(Ze(t,t.dyn_ltree,t.l_desc.max_code),Ze(t,t.dyn_dtree,t.d_desc.max_code),Ue(t,t.bl_desc),e=oe-1;e>=3;e--)if(0!==t.bl_tree[2*ye[e]+1])break;return t.opt_len+=3*(e+1)+5+5+4,e},je=(t,e,n,i)=>{let r;for(Pe(t,e-257,5),Pe(t,n-1,5),Pe(t,i-4,4),r=0;r{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return Yt;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return Xt;for(e=32;e{Ke||(Be(),Ke=!0),t.l_desc=new De(t.dyn_ltree,Ce),t.d_desc=new De(t.dyn_dtree,Te),t.bl_desc=new De(t.bl_tree,Ae),t.bi_buf=0,t.bi_valid=0,Ve(t)},Je=(t,e,n,i)=>{Pe(t,(Kt<<1)+(i?1:0),3),Fe(t),Le(t,n),Le(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},Qe=t=>{Pe(t,$t<<1,3),Re(t,he,_e),Ne(t)},tn=(t,e,n,i)=>{let r,o,a=0;t.level>0?(t.strm.data_type===jt&&(t.strm.data_type=qe(t)),Ue(t,t.l_desc),Ue(t,t.d_desc),a=Xe(t),r=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==e?Je(t,e,n,i):t.strategy===Zt||o===r?(Pe(t,($t<<1)+(i?1:0),3),We(t,_e,xe)):(Pe(t,(Jt<<1)+(i?1:0),3),je(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),We(t,t.dyn_ltree,t.dyn_dtree)),Ve(t),i&&Fe(t)},en=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(we[n]+ne+1)]++,t.dyn_dtree[2*ke(e)]++),t.sym_next===t.sym_end);var nn=$e,rn=Je,on=tn,an=en,sn=Qe,ln={_tr_init:nn,_tr_stored_block:rn,_tr_flush_block:on,_tr_tally:an,_tr_align:sn};const un=(t,e,n,i)=>{let r=65535&t|0,o=t>>>16&65535|0,a=0;while(0!==n){a=n>2e3?2e3:n,n-=a;do{r=r+e[i++]|0,o=o+r|0}while(--a);r%=65521,o%=65521}return r|o<<16|0};var hn=un;const cn=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e},dn=new Uint32Array(cn()),pn=(t,e,n,i)=>{const r=dn,o=i+n;t^=-1;for(let a=i;a>>8^r[255&(t^e[a])];return-1^t};var fn=pn,gn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},vn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:yn,_tr_stored_block:mn,_tr_flush_block:_n,_tr_tally:xn,_tr_align:bn}=ln,{Z_NO_FLUSH:wn,Z_PARTIAL_FLUSH:Sn,Z_FULL_FLUSH:Mn,Z_FINISH:In,Z_BLOCK:Cn,Z_OK:Tn,Z_STREAM_END:An,Z_STREAM_ERROR:Dn,Z_DATA_ERROR:kn,Z_BUF_ERROR:Ln,Z_DEFAULT_COMPRESSION:Pn,Z_FILTERED:Rn,Z_HUFFMAN_ONLY:On,Z_RLE:Nn,Z_FIXED:En,Z_DEFAULT_STRATEGY:zn,Z_UNKNOWN:Bn,Z_DEFLATED:Vn}=vn,Fn=9,Gn=15,Hn=8,Wn=29,Un=256,Zn=Un+1+Wn,Yn=30,Xn=19,jn=2*Zn+1,qn=15,Kn=3,$n=258,Jn=$n+Kn+1,Qn=32,ti=42,ei=57,ni=69,ii=73,ri=91,oi=103,ai=113,si=666,li=1,ui=2,hi=3,ci=4,di=3,pi=(t,e)=>(t.msg=gn[e],e),fi=t=>2*t-(t>4?9:0),gi=t=>{let e=t.length;while(--e>=0)t[e]=0},vi=t=>{let e,n,i,r=t.w_size;e=t.hash_size,i=e;do{n=t.head[--i],t.head[i]=n>=r?n-r:0}while(--e);e=r,i=e;do{n=t.prev[--i],t.prev[i]=n>=r?n-r:0}while(--e)};let yi=(t,e,n)=>(e<{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},xi=(t,e)=>{_n(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,_i(t.strm)},bi=(t,e)=>{t.pending_buf[t.pending++]=e},wi=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Si=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),1===t.state.wrap?t.adler=hn(t.adler,e,r,n):2===t.state.wrap&&(t.adler=fn(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},Mi=(t,e)=>{let n,i,r=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match;const l=t.strstart>t.w_size-Jn?t.strstart-(t.w_size-Jn):0,u=t.window,h=t.w_mask,c=t.prev,d=t.strstart+$n;let p=u[o+a-1],f=u[o+a];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(n=e,u[n+a]===f&&u[n+a-1]===p&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&oa){if(t.match_start=e,a=i,i>=s)break;p=u[o+a-1],f=u[o+a]}}}while((e=c[e&h])>l&&0!==--r);return a<=t.lookahead?a:t.lookahead},Ii=t=>{const e=t.w_size;let n,i,r;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Jn)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),vi(t),i+=e),0===t.strm.avail_in)break;if(n=Si(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=Kn){r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=mi(t,t.ins_h,t.window[r+1]);while(t.insert)if(t.ins_h=mi(t,t.ins_h,t.window[r+Kn-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,t.lookahead+t.insert{let n,i,r,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,s=t.strm.avail_in;do{if(n=65535,r=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(n=i+t.strm.avail_in),n>r&&(n=r),n>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,_i(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Si(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===a);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_waterr&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,r+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),r>t.strm.avail_in&&(r=t.strm.avail_in),r&&(Si(t.strm,t.window,t.strstart,r),t.strstart+=r,t.insert+=r>t.w_size-t.insert?t.w_size-t.insert:r),t.high_water>3,r=t.pending_buf_size-r>65535?65535:t.pending_buf_size-r,o=r>t.w_size?t.w_size:r,i=t.strstart-t.block_start,(i>=o||(i||e===In)&&e!==wn&&0===t.strm.avail_in&&i<=r)&&(n=i>r?r:i,a=e===In&&0===t.strm.avail_in&&n===i?1:0,mn(t,t.block_start,n,a),t.block_start+=n,_i(t.strm)),a?hi:li)},Ti=(t,e)=>{let n,i;for(;;){if(t.lookahead=Kn&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Jn&&(t.match_length=Mi(t,n)),t.match_length>=Kn)if(i=xn(t,t.strstart-t.match_start,t.match_length-Kn),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Kn){t.match_length--;do{t.strstart++,t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=mi(t,t.ins_h,t.window[t.strstart+1]);else i=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=t.strstart{let n,i,r;for(;;){if(t.lookahead=Kn&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Kn-1,0!==n&&t.prev_length4096)&&(t.match_length=Kn-1)),t.prev_length>=Kn&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-Kn,i=xn(t,t.strstart-1-t.prev_match,t.prev_length-Kn),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=Kn-1,t.strstart++,i&&(xi(t,!1),0===t.strm.avail_out))return li}else if(t.match_available){if(i=xn(t,0,t.window[t.strstart-1]),i&&xi(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return li}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=xn(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let n,i,r,o;const a=t.window;for(;;){if(t.lookahead<=$n){if(Ii(t),t.lookahead<=$n&&e===wn)return li;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=Kn&&t.strstart>0&&(r=t.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){o=t.strstart+$n;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Kn?(n=xn(t,1,t.match_length-Kn),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=0,e===In?(xi(t,!0),0===t.strm.avail_out?hi:ci):t.sym_next&&(xi(t,!1),0===t.strm.avail_out)?li:ui},ki=(t,e)=>{let n;for(;;){if(0===t.lookahead&&(Ii(t),0===t.lookahead)){if(e===wn)return li;break}if(t.match_length=0,n=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=0,e===In?(xi(t,!0),0===t.strm.avail_out?hi:ci):t.sym_next&&(xi(t,!1),0===t.strm.avail_out)?li:ui};function Li(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const Pi=[new Li(0,0,0,0,Ci),new Li(4,4,8,4,Ti),new Li(4,5,16,8,Ti),new Li(4,6,32,32,Ti),new Li(4,4,16,16,Ai),new Li(8,16,32,32,Ai),new Li(8,16,128,128,Ai),new Li(8,32,128,256,Ai),new Li(32,128,258,1024,Ai),new Li(32,258,258,4096,Ai)],Ri=t=>{t.window_size=2*t.w_size,gi(t.head),t.max_lazy_match=Pi[t.level].max_lazy,t.good_match=Pi[t.level].good_length,t.nice_match=Pi[t.level].nice_length,t.max_chain_length=Pi[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Kn-1,t.match_available=0,t.ins_h=0};function Oi(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Vn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*jn),this.dyn_dtree=new Uint16Array(2*(2*Yn+1)),this.bl_tree=new Uint16Array(2*(2*Xn+1)),gi(this.dyn_ltree),gi(this.dyn_dtree),gi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(qn+1),this.heap=new Uint16Array(2*Zn+1),gi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Zn+1),gi(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ni=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ti&&e.status!==ei&&e.status!==ni&&e.status!==ii&&e.status!==ri&&e.status!==oi&&e.status!==ai&&e.status!==si?1:0},Ei=t=>{if(Ni(t))return pi(t,Dn);t.total_in=t.total_out=0,t.data_type=Bn;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?ei:e.wrap?ti:ai,t.adler=2===e.wrap?0:1,e.last_flush=-2,yn(e),Tn},zi=t=>{const e=Ei(t);return e===Tn&&Ri(t.state),e},Bi=(t,e)=>Ni(t)||2!==t.state.wrap?Dn:(t.state.gzhead=e,Tn),Vi=(t,e,n,i,r,o)=>{if(!t)return Dn;let a=1;if(e===Pn&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>Fn||n!==Vn||i<8||i>15||e<0||e>9||o<0||o>En||8===i&&1!==a)return pi(t,Dn);8===i&&(i=9);const s=new Oi;return t.state=s,s.strm=t,s.status=ti,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<Vi(t,e,Vn,Gn,Hn,zn),Gi=(t,e)=>{if(Ni(t)||e>Cn||e<0)return t?pi(t,Dn):Dn;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===si&&e!==In)return pi(t,0===t.avail_out?Ln:Dn);const i=n.last_flush;if(n.last_flush=e,0!==n.pending){if(_i(t),0===t.avail_out)return n.last_flush=-1,Tn}else if(0===t.avail_in&&fi(e)<=fi(i)&&e!==In)return pi(t,Ln);if(n.status===si&&0!==t.avail_in)return pi(t,Ln);if(n.status===ti&&0===n.wrap&&(n.status=ai),n.status===ti){let e=Vn+(n.w_bits-8<<4)<<8,i=-1;if(i=n.strategy>=On||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=i<<6,0!==n.strstart&&(e|=Qn),e+=31-e%31,wi(n,e),0!==n.strstart&&(wi(n,t.adler>>>16),wi(n,65535&t.adler)),t.adler=1,n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn}if(n.status===ei)if(t.adler=0,bi(n,31),bi(n,139),bi(n,8),n.gzhead)bi(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),bi(n,255&n.gzhead.time),bi(n,n.gzhead.time>>8&255),bi(n,n.gzhead.time>>16&255),bi(n,n.gzhead.time>>24&255),bi(n,9===n.level?2:n.strategy>=On||n.level<2?4:0),bi(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(bi(n,255&n.gzhead.extra.length),bi(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=fn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ni;else if(bi(n,0),bi(n,0),bi(n,0),bi(n,0),bi(n,0),bi(n,9===n.level?2:n.strategy>=On||n.level<2?4:0),bi(n,di),n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn;if(n.status===ni){if(n.gzhead.extra){let e=n.pending,i=(65535&n.gzhead.extra.length)-n.gzindex;while(n.pending+i>n.pending_buf_size){let r=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=fn(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=r,_i(t),0!==n.pending)return n.last_flush=-1,Tn;e=0,i-=r}let r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>e&&(t.adler=fn(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=ii}if(n.status===ii){if(n.gzhead.name){let e,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),_i(t),0!==n.pending)return n.last_flush=-1,Tn;i=0}e=n.gzindexi&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=ri}if(n.status===ri){if(n.gzhead.comment){let e,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),_i(t),0!==n.pending)return n.last_flush=-1,Tn;i=0}e=n.gzindexi&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i))}n.status=oi}if(n.status===oi){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(_i(t),0!==n.pending))return n.last_flush=-1,Tn;bi(n,255&t.adler),bi(n,t.adler>>8&255),t.adler=0}if(n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn}if(0!==t.avail_in||0!==n.lookahead||e!==wn&&n.status!==si){let i=0===n.level?Ci(n,e):n.strategy===On?ki(n,e):n.strategy===Nn?Di(n,e):Pi[n.level].func(n,e);if(i!==hi&&i!==ci||(n.status=si),i===li||i===hi)return 0===t.avail_out&&(n.last_flush=-1),Tn;if(i===ui&&(e===Sn?bn(n):e!==Cn&&(mn(n,0,0,!1),e===Mn&&(gi(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),_i(t),0===t.avail_out))return n.last_flush=-1,Tn}return e!==In?Tn:n.wrap<=0?An:(2===n.wrap?(bi(n,255&t.adler),bi(n,t.adler>>8&255),bi(n,t.adler>>16&255),bi(n,t.adler>>24&255),bi(n,255&t.total_in),bi(n,t.total_in>>8&255),bi(n,t.total_in>>16&255),bi(n,t.total_in>>24&255)):(wi(n,t.adler>>>16),wi(n,65535&t.adler)),_i(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Tn:An)},Hi=t=>{if(Ni(t))return Dn;const e=t.state.status;return t.state=null,e===ai?pi(t,kn):Tn},Wi=(t,e)=>{let n=e.length;if(Ni(t))return Dn;const i=t.state,r=i.wrap;if(2===r||1===r&&i.status!==ti||i.lookahead)return Dn;if(1===r&&(t.adler=hn(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){0===r&&(gi(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(n-i.w_size,n),0),e=t,n=i.w_size}const o=t.avail_in,a=t.next_in,s=t.input;t.avail_in=n,t.next_in=0,t.input=e,Ii(i);while(i.lookahead>=Kn){let t=i.strstart,e=i.lookahead-(Kn-1);do{i.ins_h=mi(i,i.ins_h,i.window[t+Kn-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=Kn-1,Ii(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Kn-1,i.match_available=0,t.next_in=a,t.input=s,t.avail_in=o,i.wrap=r,Tn};var Ui=Fi,Zi=Vi,Yi=zi,Xi=Ei,ji=Bi,qi=Gi,Ki=Hi,$i=Wi,Ji="pako deflate (from Nodeca project)",Qi={deflateInit:Ui,deflateInit2:Zi,deflateReset:Yi,deflateResetKeep:Xi,deflateSetHeader:ji,deflate:qi,deflateEnd:Ki,deflateSetDictionary:$i,deflateInfo:Ji};const tr=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var er=function(t){const e=Array.prototype.slice.call(arguments,1);while(e.length){const n=e.shift();if(n){if("object"!==typeof n)throw new TypeError(n+"must be non-object");for(const e in n)tr(n,e)&&(t[e]=n[e])}}return t},nr=t=>{let e=0;for(let i=0,r=t.length;i=252?6:wx>=248?5:wx>=240?4:wx>=224?3:wx>=192?2:1;or[254]=or[254]=1;var ar=t=>{if("function"===typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,i,r,o,a=t.length,s=0;for(r=0;r>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e};const sr=(t,e)=>{if(e<65534&&t.subarray&&rr)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i{const n=e||t.length;if("function"===typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,r;const o=new Array(2*n);for(r=0,i=0;i4)o[r++]=65533,i+=a-1;else{e&=2===a?31:3===a?15:7;while(a>1&&i1?o[r++]=65533:e<65536?o[r++]=e:(e-=65536,o[r++]=55296|e>>10&1023,o[r++]=56320|1023&e)}}return sr(o,r)},ur=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;while(n>=0&&128===(192&t[n]))n--;return n<0||0===n?e:n+or[t[n]]>e?n:e},hr={string2buf:ar,buf2string:lr,utf8border:ur};function cr(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var dr=cr;const pr=Object.prototype.toString,{Z_NO_FLUSH:fr,Z_SYNC_FLUSH:gr,Z_FULL_FLUSH:vr,Z_FINISH:yr,Z_OK:mr,Z_STREAM_END:_r,Z_DEFAULT_COMPRESSION:xr,Z_DEFAULT_STRATEGY:br,Z_DEFLATED:wr}=vn;function Sr(t){this.options=ir.assign({level:xr,method:wr,chunkSize:16384,windowBits:15,memLevel:8,strategy:br},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dr,this.strm.avail_out=0;let n=Qi.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==mr)throw new Error(gn[n]);if(e.header&&Qi.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"===typeof e.dictionary?hr.string2buf(e.dictionary):"[object ArrayBuffer]"===pr.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=Qi.deflateSetDictionary(this.strm,t),n!==mr)throw new Error(gn[n]);this._dict_set=!0}}function Mr(t,e){const n=new Sr(e);if(n.push(t,!0),n.err)throw n.msg||gn[n.err];return n.result}function Ir(t,e){return e=e||{},e.raw=!0,Mr(t,e)}function Cr(t,e){return e=e||{},e.gzip=!0,Mr(t,e)}Sr.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?yr:fr,"string"===typeof t?n.input=hr.string2buf(t):"[object ArrayBuffer]"===pr.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(o===gr||o===vr)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=Qi.deflate(n,o),r===_r)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Qi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===mr;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Sr.prototype.onData=function(t){this.chunks.push(t)},Sr.prototype.onEnd=function(t){t===mr&&(this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Tr=Sr,Ar=Mr,Dr=Ir,kr=Cr,Lr=vn,Pr={Deflate:Tr,deflate:Ar,deflateRaw:Dr,gzip:kr,constants:Lr};const Rr=16209,Or=16191;var Nr=function(t,e){let n,i,r,o,a,s,l,u,h,c,d,p,f,g,v,y,m,_,x,b,w,S,M,I;const C=t.state;n=t.next_in,M=t.input,i=n+(t.avail_in-5),r=t.next_out,I=t.output,o=r-(e-t.avail_out),a=r+(t.avail_out-257),s=C.dmax,l=C.wsize,u=C.whave,h=C.wnext,c=C.window,d=C.hold,p=C.bits,f=C.lencode,g=C.distcode,v=(1<>>24,d>>>=_,p-=_,_=m>>>16&255,0===_)I[r++]=65535&m;else{if(!(16&_)){if(0===(64&_)){m=f[(65535&m)+(d&(1<<_)-1)];continue e}if(32&_){C.mode=Or;break t}t.msg="invalid literal/length code",C.mode=Rr;break t}x=65535&m,_&=15,_&&(p<_&&(d+=M[n++]<>>=_,p-=_),p<15&&(d+=M[n++]<>>24,d>>>=_,p-=_,_=m>>>16&255,!(16&_)){if(0===(64&_)){m=g[(65535&m)+(d&(1<<_)-1)];continue n}t.msg="invalid distance code",C.mode=Rr;break t}if(b=65535&m,_&=15,p<_&&(d+=M[n++]<s){t.msg="invalid distance too far back",C.mode=Rr;break t}if(d>>>=_,p-=_,_=r-o,b>_){if(_=b-_,_>u&&C.sane){t.msg="invalid distance too far back",C.mode=Rr;break t}if(w=0,S=c,0===h){if(w+=l-_,_2)I[r++]=S[w++],I[r++]=S[w++],I[r++]=S[w++],x-=3;x&&(I[r++]=S[w++],x>1&&(I[r++]=S[w++]))}else{w=r-b;do{I[r++]=I[w++],I[r++]=I[w++],I[r++]=I[w++],x-=3}while(x>2);x&&(I[r++]=I[w++],x>1&&(I[r++]=I[w++]))}break}}break}}while(n>3,n-=x,p-=x<<3,d&=(1<{const l=s.bits;let u,h,c,d,p,f,g=0,v=0,y=0,m=0,_=0,x=0,b=0,w=0,S=0,M=0,I=null;const C=new Uint16Array(Er+1),T=new Uint16Array(Er+1);let A,D,k,L=null;for(g=0;g<=Er;g++)C[g]=0;for(v=0;v=1;m--)if(0!==C[m])break;if(_>m&&(_=m),0===m)return r[o++]=20971520,r[o++]=20971520,s.bits=1,0;for(y=1;y0&&(t===Vr||1!==m))return-1;for(T[1]=0,g=1;gzr||t===Gr&&S>Br)return 1;for(;;){A=g-b,a[v]+1=f?(D=L[a[v]-f],k=I[a[v]-f]):(D=96,k=0),u=1<>b)+h]=A<<24|D<<16|k|0}while(0!==h);u=1<>=1;if(0!==u?(M&=u-1,M+=u):M=0,v++,0===--C[g]){if(g===m)break;g=e[n+a[v]]}if(g>_&&(M&d)!==c){0===b&&(b=_),p+=y,x=g-b,w=1<zr||t===Gr&&S>Br)return 1;c=M&d,r[c]=_<<24|x<<16|p-o|0}}return 0!==M&&(r[p+M]=g-b<<24|64<<16|0),s.bits=_,0};var Xr=Yr;const jr=0,qr=1,Kr=2,{Z_FINISH:$r,Z_BLOCK:Jr,Z_TREES:Qr,Z_OK:to,Z_STREAM_END:eo,Z_NEED_DICT:no,Z_STREAM_ERROR:io,Z_DATA_ERROR:ro,Z_MEM_ERROR:oo,Z_BUF_ERROR:ao,Z_DEFLATED:so}=vn,lo=16180,uo=16181,ho=16182,co=16183,po=16184,fo=16185,go=16186,vo=16187,yo=16188,mo=16189,_o=16190,xo=16191,bo=16192,wo=16193,So=16194,Mo=16195,Io=16196,Co=16197,To=16198,Ao=16199,Do=16200,ko=16201,Lo=16202,Po=16203,Ro=16204,Oo=16205,No=16206,Eo=16207,zo=16208,Bo=16209,Vo=16210,Fo=16211,Go=852,Ho=592,Wo=15,Uo=Wo,Zo=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Yo(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Xo=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.modeFo?1:0},jo=t=>{if(Xo(t))return io;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=lo,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Go),e.distcode=e.distdyn=new Int32Array(Ho),e.sane=1,e.back=-1,to},qo=t=>{if(Xo(t))return io;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,jo(t)},Ko=(t,e)=>{let n;if(Xo(t))return io;const i=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?io:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,qo(t))},$o=(t,e)=>{if(!t)return io;const n=new Yo;t.state=n,n.strm=t,n.window=null,n.mode=lo;const i=Ko(t,e);return i!==to&&(t.state=null),i},Jo=t=>$o(t,Uo);let Qo,ta,ea=!0;const na=t=>{if(ea){Qo=new Int32Array(512),ta=new Int32Array(32);let e=0;while(e<144)t.lens[e++]=8;while(e<256)t.lens[e++]=9;while(e<280)t.lens[e++]=7;while(e<288)t.lens[e++]=8;Xr(qr,t.lens,0,288,Qo,0,t.work,{bits:9}),e=0;while(e<32)t.lens[e++]=5;Xr(Kr,t.lens,0,32,ta,0,t.work,{bits:5}),ea=!1}t.lencode=Qo,t.lenbits=9,t.distcode=ta,t.distbits=5},ia=(t,e,n,i)=>{let r;const o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(e.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),o.window.set(e.subarray(n-i,n-i+r),o.wnext),i-=r,i?(o.window.set(e.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,i,r,o,a,s,l,u,h,c,d,p,f,g,v,y,m,_,x,b,w,S,M=0;const I=new Uint8Array(4);let C,T;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xo(t)||!t.output||!t.input&&0!==t.avail_in)return io;n=t.state,n.mode===xo&&(n.mode=bo),a=t.next_out,r=t.output,l=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,u=n.hold,h=n.bits,c=s,d=l,S=to;t:for(;;)switch(n.mode){case lo:if(0===n.wrap){n.mode=bo;break}while(h<16){if(0===s)break t;s--,u+=i[o++]<>>8&255,n.check=fn(n.check,I,2,0),u=0,h=0,n.mode=uo;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=Bo;break}if((15&u)!==so){t.msg="unknown compression method",n.mode=Bo;break}if(u>>>=4,h-=4,w=8+(15&u),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){t.msg="invalid window size",n.mode=Bo;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(I[0]=255&u,I[1]=u>>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0,n.mode=ho;case ho:while(h<32){if(0===s)break t;s--,u+=i[o++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,n.check=fn(n.check,I,4,0)),u=0,h=0,n.mode=co;case co:while(h<16){if(0===s)break t;s--,u+=i[o++]<>8),512&n.flags&&4&n.wrap&&(I[0]=255&u,I[1]=u>>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0,n.mode=po;case po:if(1024&n.flags){while(h<16){if(0===s)break t;s--,u+=i[o++]<>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0}else n.head&&(n.head.extra=null);n.mode=fo;case fo:if(1024&n.flags&&(p=n.length,p>s&&(p=s),p&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+p),w)),512&n.flags&&4&n.wrap&&(n.check=fn(n.check,i,p,o)),s-=p,o+=p,n.length-=p),n.length))break t;n.length=0,n.mode=go;case go:if(2048&n.flags){if(0===s)break t;p=0;do{w=i[o+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&p>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=xo;break;case mo:while(h<32){if(0===s)break t;s--,u+=i[o++]<>>=7&h,h-=7&h,n.mode=No;break}while(h<3){if(0===s)break t;s--,u+=i[o++]<>>=1,h-=1,3&u){case 0:n.mode=wo;break;case 1:if(na(n),n.mode=Ao,e===Qr){u>>>=2,h-=2;break t}break;case 2:n.mode=Io;break;case 3:t.msg="invalid block type",n.mode=Bo}u>>>=2,h-=2;break;case wo:u>>>=7&h,h-=7&h;while(h<32){if(0===s)break t;s--,u+=i[o++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=Bo;break}if(n.length=65535&u,u=0,h=0,n.mode=So,e===Qr)break t;case So:n.mode=Mo;case Mo:if(p=n.length,p){if(p>s&&(p=s),p>l&&(p=l),0===p)break t;r.set(i.subarray(o,o+p),a),s-=p,o+=p,l-=p,a+=p,n.length-=p;break}n.mode=xo;break;case Io:while(h<14){if(0===s)break t;s--,u+=i[o++]<>>=5,h-=5,n.ndist=1+(31&u),u>>>=5,h-=5,n.ncode=4+(15&u),u>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Bo;break}n.have=0,n.mode=Co;case Co:while(n.have>>=3,h-=3}while(n.have<19)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},S=Xr(jr,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,S){t.msg="invalid code lengths set",n.mode=Bo;break}n.have=0,n.mode=To;case To:while(n.have>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=v,h-=v,n.lens[n.have++]=m;else{if(16===m){T=v+2;while(h>>=v,h-=v,0===n.have){t.msg="invalid bit length repeat",n.mode=Bo;break}w=n.lens[n.have-1],p=3+(3&u),u>>>=2,h-=2}else if(17===m){T=v+3;while(h>>=v,h-=v,w=0,p=3+(7&u),u>>>=3,h-=3}else{T=v+7;while(h>>=v,h-=v,w=0,p=11+(127&u),u>>>=7,h-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Bo;break}while(p--)n.lens[n.have++]=w}}if(n.mode===Bo)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=Bo;break}if(n.lenbits=9,C={bits:n.lenbits},S=Xr(qr,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,S){t.msg="invalid literal/lengths set",n.mode=Bo;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},S=Xr(Kr,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,S){t.msg="invalid distances set",n.mode=Bo;break}if(n.mode=Ao,e===Qr)break t;case Ao:n.mode=Do;case Do:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,n.hold=u,n.bits=h,Nr(t,d),a=t.next_out,r=t.output,l=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,u=n.hold,h=n.bits,n.mode===xo&&(n.back=-1);break}for(n.back=0;;){if(M=n.lencode[u&(1<>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>_)],v=M>>>24,y=M>>>16&255,m=65535&M,_+v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=_,h-=_,n.back+=_}if(u>>>=v,h-=v,n.back+=v,n.length=m,0===y){n.mode=Oo;break}if(32&y){n.back=-1,n.mode=xo;break}if(64&y){t.msg="invalid literal/length code",n.mode=Bo;break}n.extra=15&y,n.mode=ko;case ko:if(n.extra){T=n.extra;while(h>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Lo;case Lo:for(;;){if(M=n.distcode[u&(1<>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>_)],v=M>>>24,y=M>>>16&255,m=65535&M,_+v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=_,h-=_,n.back+=_}if(u>>>=v,h-=v,n.back+=v,64&y){t.msg="invalid distance code",n.mode=Bo;break}n.offset=m,n.extra=15&y,n.mode=Po;case Po:if(n.extra){T=n.extra;while(h>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Bo;break}n.mode=Ro;case Ro:if(0===l)break t;if(p=d-l,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Bo;break}p>n.wnext?(p-=n.wnext,f=n.wsize-p):f=n.wnext-p,p>n.length&&(p=n.length),g=n.window}else g=r,f=a-n.offset,p=n.length;p>l&&(p=l),l-=p,n.length-=p;do{r[a++]=g[f++]}while(--p);0===n.length&&(n.mode=Do);break;case Oo:if(0===l)break t;r[a++]=n.length,l--,n.mode=Do;break;case No:if(n.wrap){while(h<32){if(0===s)break t;s--,u|=i[o++]<{if(Xo(t))return io;let e=t.state;return e.window&&(e.window=null),t.state=null,to},aa=(t,e)=>{if(Xo(t))return io;const n=t.state;return 0===(2&n.wrap)?io:(n.head=e,e.done=!1,to)},sa=(t,e)=>{const n=e.length;let i,r,o;return Xo(t)?io:(i=t.state,0!==i.wrap&&i.mode!==_o?io:i.mode===_o&&(r=1,r=hn(r,e,n,0),r!==i.check)?ro:(o=ia(t,e,n,n),o?(i.mode=Vo,oo):(i.havedict=1,to)))};var la=qo,ua=Ko,ha=jo,ca=Jo,da=$o,pa=ra,fa=oa,ga=aa,va=sa,ya="pako inflate (from Nodeca project)",ma={inflateReset:la,inflateReset2:ua,inflateResetKeep:ha,inflateInit:ca,inflateInit2:da,inflate:pa,inflateEnd:fa,inflateGetHeader:ga,inflateSetDictionary:va,inflateInfo:ya};function _a(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var xa=_a;const ba=Object.prototype.toString,{Z_NO_FLUSH:wa,Z_FINISH:Sa,Z_OK:Ma,Z_STREAM_END:Ia,Z_NEED_DICT:Ca,Z_STREAM_ERROR:Ta,Z_DATA_ERROR:Aa,Z_MEM_ERROR:Da}=vn;function ka(t){this.options=ir.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dr,this.strm.avail_out=0;let n=ma.inflateInit2(this.strm,e.windowBits);if(n!==Ma)throw new Error(gn[n]);if(this.header=new xa,ma.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"===typeof e.dictionary?e.dictionary=hr.string2buf(e.dictionary):"[object ArrayBuffer]"===ba.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=ma.inflateSetDictionary(this.strm,e.dictionary),n!==Ma)))throw new Error(gn[n])}function La(t,e){const n=new ka(e);if(n.push(t),n.err)throw n.msg||gn[n.err];return n.result}function Pa(t,e){return e=e||{},e.raw=!0,La(t,e)}ka.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Sa:wa,"[object ArrayBuffer]"===ba.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),o=ma.inflate(n,a),o===Ca&&r&&(o=ma.inflateSetDictionary(n,r),o===Ma?o=ma.inflate(n,a):o===Aa&&(o=Ca));while(n.avail_in>0&&o===Ia&&n.state.wrap>0&&0!==t[n.next_in])ma.inflateReset(n),o=ma.inflate(n,a);switch(o){case Ta:case Aa:case Ca:case Da:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===Ia))if("string"===this.options.to){let t=hr.utf8border(n.output,n.next_out),e=n.next_out-t,r=hr.buf2string(n.output,t);n.next_out=e,n.avail_out=i-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==Ma||0!==s){if(o===Ia)return o=ma.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ka.prototype.onData=function(t){this.chunks.push(t)},ka.prototype.onEnd=function(t){t===Ma&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ra=ka,Oa=La,Na=Pa,Ea=La,za=vn,Ba={Inflate:Ra,inflate:Oa,inflateRaw:Na,ungzip:Ea,constants:za};const{Deflate:Va,deflate:Fa,deflateRaw:Ga,gzip:Ha}=Pr,{Inflate:Wa,inflate:Ua,inflateRaw:Za,ungzip:Ya}=Ba;var Xa=Ua,ja=function(t,e){return ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ja(t,e)};function qa(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ja(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;Object.create;var Ka=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),$a=function(){function t(){this.browser=new Ka,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!==typeof window}return t}(),Ja=new $a;function Qa(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!==typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!==typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}"object"===typeof wx&&"function"===typeof wx.getSystemInfoSync?(Ja.wxa=!0,Ja.touchEventsSupported=!0):"undefined"===typeof document&&"undefined"!==typeof self?Ja.worker=!0:"undefined"===typeof navigator?(Ja.node=!0,Ja.svgSupported=!0):Qa(navigator.userAgent,Ja);const ts=Ja;var es=12,ns="sans-serif",is=es+"px "+ns,rs=20,os=100,as="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function ss(t){var e={};if("undefined"===typeof JSON)return e;for(var n=0;n=0)s=a*n.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}function tu(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&o&&d===o[c]&&p===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?jl(s,a):jl(a,s))}function eu(t){return"CANVAS"===t.nodeName.toUpperCase()}var nu=/([&<>"'])/g,iu={"&":"&","<":"<",">":">",'"':""","'":"'"};function ru(t){return null==t?"":(t+"").replace(nu,(function(t,e){return iu[e]}))}var ou=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,au=[],su=ts.browser.firefox&&+ts.browser.version.split(".")[0]<39;function lu(t,e,n,i){return n=n||{},i?uu(t,e,n):su&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):uu(t,e,n),n}function uu(t,e,n){if(ts.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(eu(t)){var o=t.getBoundingClientRect();return n.zrX=i-o.left,void(n.zrY=r-o.top)}if(Jl(au,t,i,r))return n.zrX=au[0],void(n.zrY=au[1])}n.zrX=n.zrY=0}function hu(t){return t||window.event}function cu(t,e,n){if(e=hu(e),null!=e.zrX)return e;var i=e.type,r=i&&i.indexOf("touch")>=0;if(r){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&lu(t,o,e,n)}else{lu(t,e,e,n);var a=du(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return null==e.which&&void 0!==s&&ou.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function du(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;var r=0!==i?Math.abs(i):Math.abs(n),o=i>0?-1:i<0?1:n>0?-1:1;return 3*r*o}function pu(t,e,n,i){t.addEventListener(e,n,i)}function fu(t,e,n,i){t.removeEventListener(e,n,i)}var gu=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function vu(t){return 2===t.which||3===t.which}var yu=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o1&&i&&i.length>1){var o=mu(i)/mu(r);!isFinite(o)&&(o=1),e.pinchScale=o;var a=_u(i);return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}};function bu(){return[1,0,0,1,0,0]}function wu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Su(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}function Mu(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function Iu(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Cu(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+a*u,t[1]=-i*u+a*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*o+u*l,t[5]=h*l-u*o,t}function Tu(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Au(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function Du(t){var e=bu();return Su(e,t),e}var ku=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}();const Lu=ku;var Pu=Math.min,Ru=Math.max,Ou=new Lu,Nu=new Lu,Eu=new Lu,zu=new Lu,Bu=new Lu,Vu=new Lu,Fu=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=Pu(t.x,this.x),n=Pu(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ru(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ru(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=bu();return Iu(r,r,[-e.x,-e.y]),Tu(r,r,[n,i]),Iu(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,d=!(of&&(f=_,gf&&(f=x,y=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}Ou.x=Eu.x=n.x,Ou.y=zu.y=n.y,Nu.x=zu.x=n.x+n.width,Nu.y=Eu.y=n.y+n.height,Ou.transform(i),zu.transform(i),Nu.transform(i),Eu.transform(i),e.x=Pu(Ou.x,Nu.x,Eu.x,zu.x),e.y=Pu(Ou.y,Nu.y,Eu.y,zu.y);var l=Ru(Ou.x,Nu.x,Eu.x,zu.x),u=Ru(Ou.y,Nu.y,Eu.y,zu.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}();const Gu=Fu;var Hu="silent";function Wu(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Uu}}function Uu(){gu(this.event)}var Zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return qa(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Zl),Yu=function(){function t(t,e){this.x=t,this.y=e}return t}(),Xu=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ju=new Gu(0,0,0,0),qu=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new Yu(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new Zu,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Wl(a),a}return qa(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(Rs(Xu,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=Ju(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(r=this.findHover(r.x,r.y),o=r.target);var a=this._hovered=i?new Yu(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Yu(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){t=t||{};var i=t.target;if(!i||!i.silent){var r="on"+e,o=Wu(e,t,n);while(i)if(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,o.cancelBubble)break;o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"===typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new Yu(t,e);if($u(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Gu(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(ju.copy(h.getBoundingRect()),h.transform&&ju.applyTransform(h.transform),ju.intersect(l)&&o.push(h))}if(o.length)for(var c=4,d=Math.PI/12,p=2*Math.PI,f=0;f=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=Ku(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==Hu)){e.target=a;break}}}function Ju(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}Rs(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){qu.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=Ju(this,r,o);if("mouseup"===t&&a||(n=this.findHover(r,o),i=n.target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Ol(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));const Qu=qu;var th=32,eh=7;function nh(t){var e=0;while(t>=th)e|=1&t,t>>=1;return t+e}function ih(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){while(r=0)r++;return r-e}function rh(t,e,n){n--;while(e>>1,r(a,t[o])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:while(u>0)t[s+u]=t[s+u-1],u--}t[s]=a}}function ah(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){s=i-r;while(l0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{s=r+1;while(ls&&(l=s);var u=a;a=r-l,l=r-u}a++;while(a>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function sh(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){s=r+1;while(ls&&(l=s);var u=a;a=r-l,l=r-u}else{s=i-r;while(l=0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}a++;while(a>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function lh(t,e){var n,i,r=eh,o=0,a=0;o=t.length;var s=[];function l(t,e){n[a]=t,i[a]=e,a+=1}function u(){while(a>1){var t=a-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;c(t)}}function h(){while(a>1){var t=a-2;t>0&&i[t-1]=eh||p>=eh);if(f)break;g<0&&(g=0),g+=2}if(r=g,r<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(v=a-ah(t[u],s,0,a,a-1,e),0!==v){for(c-=v,h-=v,a-=v,p=c+1,d=h+1,l=0;l=eh||v>=eh);if(y)break;f<0&&(f=0),f+=2}if(r=f,r<1&&(r=1),1===a){for(c-=i,u-=i,p=c+1,d=u+1,l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;ls&&(l=s),oh(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}var hh=1,ch=2,dh=4,ph=!1;function fh(){ph||(ph=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function gh(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var vh=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=gh}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(fh(),u.z=0),isNaN(u.z2)&&(fh(),u.z2=0),isNaN(u.zlevel)&&(fh(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const yh=vh;var mh;mh=ts.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};const _h=mh;var xh={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},elasticOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xh.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xh.bounceIn(2*t):.5*xh.bounceOut(2*t-1)+.5}};const bh=xh;var wh=Math.pow,Sh=Math.sqrt,Mh=1e-8,Ih=1e-4,Ch=Sh(3),Th=1/3,Ah=wl(),Dh=wl(),kh=wl();function Lh(t){return t>-Mh&&tMh||t<-Mh}function Rh(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function Oh(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function Nh(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Lh(h)&&Lh(c))if(Lh(s))o[0]=0;else{var f=-l/s;f>=0&&f<=1&&(o[p++]=f)}else{var g=c*c-4*h*d;if(Lh(g)){var v=c/h,y=(f=-s/a+v,-v/2);f>=0&&f<=1&&(o[p++]=f),y>=0&&y<=1&&(o[p++]=y)}else if(g>0){var m=Sh(g),_=h*s+1.5*a*(-c+m),x=h*s+1.5*a*(-c-m);_=_<0?-wh(-_,Th):wh(_,Th),x=x<0?-wh(-x,Th):wh(x,Th);f=(-s-(_+x))/(3*a);f>=0&&f<=1&&(o[p++]=f)}else{var b=(2*h*s-3*a*c)/(2*Sh(h*h*h)),w=Math.acos(b)/3,S=Sh(h),M=Math.cos(w),I=(f=(-s-2*S*M)/(3*a),y=(-s+S*(M+Ch*Math.sin(w)))/(3*a),(-s+S*(M-Ch*Math.sin(w)))/(3*a));f>=0&&f<=1&&(o[p++]=f),y>=0&&y<=1&&(o[p++]=y),I>=0&&I<=1&&(o[p++]=I)}}return p}function Eh(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Lh(a)){if(Ph(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var h=o*o-4*a*s;if(Lh(h))r[0]=-o/(2*a);else if(h>0){var c=Sh(h),d=(u=(-o+c)/(2*a),(-o-c)/(2*a));u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function zh(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,h=(l-s)*r+s,c=(h-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=i}function Bh(t,e,n,i,r,o,a,s,l,u,h){var c,d,p,f,g,v=.005,y=1/0;Ah[0]=l,Ah[1]=u;for(var m=0;m<1;m+=.05)Dh[0]=Rh(t,n,r,a,m),Dh[1]=Rh(e,i,o,s,m),f=El(Ah,Dh),f=0&&f=0&&u<=1&&(r[l++]=u)}}else{var h=a*a-4*o*s;if(Lh(h)){u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(h>0){var c=Sh(h),d=(u=(-a+c)/(2*o),(-a-c)/(2*o));u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function Wh(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Uh(t,e,n,i,r){var o=(e-t)*i+t,a=(n-e)*i+e,s=(a-o)*i+o;r[0]=t,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}function Zh(t,e,n,i,r,o,a,s,l){var u,h=.005,c=1/0;Ah[0]=a,Ah[1]=s;for(var d=0;d<1;d+=.05){Dh[0]=Fh(t,n,r,d),Dh[1]=Fh(e,i,o,d);var p=El(Ah,Dh);p=0&&p=1?1:Nh(0,i,o,1,t,s)&&Rh(0,r,a,1,s[0])}}}var qh=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||xl,this.ondestroy=t.ondestroy||xl,this.onrestart=t.onrestart||xl,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Ws(t)?t:bh[t]||jh(t)},t}();const Kh=qh;var $h=function(){function t(t){this.value=t}return t}(),Jh=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new $h(t);return this.insertEntry(e),e},t.prototype.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Qh=function(){function t(t){this._list=new Jh,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new $h(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const tc=Qh;var ec={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 nc(t){return t=Math.round(t),t<0?0:t>255?255:t}function ic(t){return t=Math.round(t),t<0?0:t>360?360:t}function rc(t){return t<0?0:t>1?1:t}function oc(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?nc(parseFloat(e)/100*255):nc(parseInt(e,10))}function ac(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?rc(parseFloat(e)/100):rc(parseFloat(e))}function sc(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function lc(t,e,n){return t+(e-t)*n}function uc(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function hc(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var cc=new tc(20),dc=null;function pc(t,e){dc&&hc(dc,e),dc=cc.put(t,dc||e.slice())}function fc(t,e){if(t){e=e||[];var n=cc.get(t);if(n)return hc(e,n);t+="";var i=t.replace(/ /g,"").toLowerCase();if(i in ec)return hc(e,ec[i]),pc(t,e),e;var r=i.length;if("#"!==i.charAt(0)){var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===r){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return 3===l.length?uc(e,+l[0],+l[1],+l[2],1):uc(e,0,0,0,1);u=ac(l.pop());case"rgb":return l.length>=3?(uc(e,oc(l[0]),oc(l[1]),oc(l[2]),3===l.length?u:ac(l[3])),pc(t,e),e):void uc(e,0,0,0,1);case"hsla":return 4!==l.length?void uc(e,0,0,0,1):(l[3]=ac(l[3]),gc(l,e),pc(t,e),e);case"hsl":return 3!==l.length?void uc(e,0,0,0,1):(gc(l,e),pc(t,e),e);default:return}}uc(e,0,0,0,1)}else{if(4===r||5===r){var h=parseInt(i.slice(1,4),16);return h>=0&&h<=4095?(uc(e,(3840&h)>>4|(3840&h)>>8,240&h|(240&h)>>4,15&h|(15&h)<<4,5===r?parseInt(i.slice(4),16)/15:1),pc(t,e),e):void uc(e,0,0,0,1)}if(7===r||9===r){h=parseInt(i.slice(1,7),16);return h>=0&&h<=16777215?(uc(e,(16711680&h)>>16,(65280&h)>>8,255&h,9===r?parseInt(i.slice(7),16)/255:1),pc(t,e),e):void uc(e,0,0,0,1)}}}}function gc(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=ac(t[1]),r=ac(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return e=e||[],uc(e,nc(255*sc(a,o,n+1/3)),nc(255*sc(a,o,n)),nc(255*sc(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function vc(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-c:r===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}function yc(t,e){var n=fc(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return wc(n,4===n.length?"rgba":"rgb")}}function mc(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=nc(lc(a[0],s[0],l)),n[1]=nc(lc(a[1],s[1],l)),n[2]=nc(lc(a[2],s[2],l)),n[3]=rc(lc(a[3],s[3],l)),n}}function _c(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=fc(e[r]),s=fc(e[o]),l=i-r,u=wc([nc(lc(a[0],s[0],l)),nc(lc(a[1],s[1],l)),nc(lc(a[2],s[2],l)),rc(lc(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}function xc(t,e,n,i){var r=fc(t);if(t)return r=vc(r),null!=e&&(r[0]=ic(e)),null!=n&&(r[1]=ac(n)),null!=i&&(r[2]=ac(i)),wc(gc(r),"rgba")}function bc(t,e){var n=fc(t);if(n&&null!=e)return n[3]=rc(e),wc(n,"rgba")}function wc(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Sc(t,e){var n=fc(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var Mc=Math.round;function Ic(t){var e;if(t&&"transparent"!==t){if("string"===typeof t&&t.indexOf("rgba")>-1){var n=fc(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var Cc=1e-4;function Tc(t){return t-Cc}function Ac(t){return Mc(1e3*t)/1e3}function Dc(t){return Mc(1e4*t)/1e4}function kc(t){return"matrix("+Ac(t[0])+","+Ac(t[1])+","+Ac(t[2])+","+Ac(t[3])+","+Dc(t[4])+","+Dc(t[5])+")"}var Lc={left:"start",right:"end",center:"middle",middle:"middle"};function Pc(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}function Rc(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function Oc(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}function Nc(t){return t&&!!t.image}function Ec(t){return t&&!!t.svgElement}function zc(t){return Nc(t)||Ec(t)}function Bc(t){return"linear"===t.type}function Vc(t){return"radial"===t.type}function Fc(t){return t&&("linear"===t.type||"radial"===t.type)}function Gc(t){return"url(#"+t+")"}function Hc(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Wc(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*bl,r=nl(t.scaleX,1),o=nl(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+Mc(a*bl)+"deg, "+Mc(s*bl)+"deg)"),l.join(" ")}var Uc=function(){return ts.hasGlobalWindow&&Ws(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!==typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}}(),Zc=Array.prototype.slice;function Yc(t,e,n){return(e-t)*n+t}function Xc(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa;if(s)i.length=a;else for(var l=o;l=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=ld,s=e;if(Ps(e)){var l=ed(e);a=l,(1===l&&!Ys(e[0])||2===l&&!Ys(e[0][0]))&&(o=!0)}else if(Ys(e)&&!tl(e))a=nd;else if(Us(e))if(isNaN(+e)){var u=fc(e);u&&(s=u,a=od)}else a=nd;else if($s(e)){var h=Ts({},s);h.colorStops=Os(e.colorStops,(function(t){return{offset:t.offset,color:fc(t.color)}})),Bc(e)?a=ad:Vc(e)&&(a=sd),s=h}0===r?this.valType=a:a===this.valType&&a!==ld||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=Ws(n)?n:bh[n]||jh(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=hd(i),l=ud(i),u=0;u=0;n--)if(l[n].percent<=e)break;n=p(n,u-2)}else{for(n=d;ne)break;n=p(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var g=r.percent-i.percent,v=0===g?1:p((e-i.percent)/g,1);r.easingFunc&&(v=r.easingFunc(v));var y=o?this._additiveValue:c?cd:t[h];if(!hd(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=v<1?i.rawValue:r.rawValue;else if(hd(s))s===id?Xc(y,i[a],r[a],v):jc(y,i[a],r[a],v);else if(ud(s)){var m=i[a],_=r[a],x=s===ad;t[h]={type:x?"linear":"radial",x:Yc(m.x,_.x,v),y:Yc(m.y,_.y,v),colorStops:Os(m.colorStops,(function(t,e){var n=_.colorStops[e];return{offset:Yc(t.offset,n.offset,v),color:td(Xc([],t.color,n.color,v))}})),global:_.global},x?(t[h].x2=Yc(m.x2,_.x2,v),t[h].y2=Yc(m.y2,_.y2,v)):t[h].r=Yc(m.r,_.r,v)}else if(c)Xc(y,i[a],r[a],v),o||(t[h]=td(y));else{var b=Yc(i[a],r[a],v);o?this._additiveValue=b:t[h]=b}o&&this._addToTarget(t)}}},t.prototype._addToTarget=function(t){var e=this.valType,n=this.propName,i=this._additiveValue;e===nd?t[n]=t[n]+i:e===od?(fc(t[n],cd),qc(cd,cd,i,1),t[n]=td(cd)):e===id?qc(t[n],t[n],i,1):e===rd&&Kc(t[n],t[n],i,1)},t}(),pd=function(){function t(t,e,n,i){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&i?Ss("Can' use additive animation on looped animation."):(this._additiveAnimators=i,this._allowDiscrete=n)}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e,n){return this.whenWithKeys(t,e,Bs(e),n)},t.prototype.whenWithKeys=function(t,e,n,i){for(var r=this._tracks,o=0;o0&&s.addKeyframe(0,Qc(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Qc(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();const fd=pd;function gd(){return(new Date).getTime()}var vd=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return qa(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){var e=gd()-this._pausedTime,n=e-this._time,i=this._head;while(i){var r=i.next,o=i.step(e,n);o?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;function e(){t._running&&(_h(e),!t._paused&&t.update())}this._running=!0,_h(e)},e.prototype.start=function(){this._running||(this._time=gd(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=gd(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=gd()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){var t=this._head;while(t){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new fd(t,e.loop);return this.addAnimator(n),n},e}(Zl);const yd=vd;var md=300,_d=ts.domSupported,xd=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=Os(t,(function(t){var e=t.replace("mouse","pointer");return n.hasOwnProperty(e)?e:t}));return{mouse:t,touch:e,pointer:i}}(),bd={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wd=!1;function Sd(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Md(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}function Id(t){t&&(t.zrByTouch=!0)}function Cd(t,e){return cu(t.dom,new Ad(t,e),!0)}function Td(t,e){var n=e,i=!1;while(n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot))n=n.parentNode;return i}var Ad=function(){function t(t,e){this.stopPropagation=xl,this.stopImmediatePropagation=xl,this.preventDefault=xl,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return t}(),Dd={mousedown:function(t){t=cu(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=cu(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=cu(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=cu(this.dom,t);var e=t.toElement||t.relatedTarget;Td(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){wd=!0,t=cu(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){wd||(t=cu(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=cu(this.dom,t),Id(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Dd.mousemove.call(this,t),Dd.mousedown.call(this,t)},touchmove:function(t){t=cu(this.dom,t),Id(t),this.handler.processGesture(t,"change"),Dd.mousemove.call(this,t)},touchend:function(t){t=cu(this.dom,t),Id(t),this.handler.processGesture(t,"end"),Dd.mouseup.call(this,t),+new Date-+this.__lastTouchMomentZd||t<-Zd}var Xd=[],jd=[],qd=bu(),Kd=Math.abs,$d=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Yd(this.rotation)||Yd(this.x)||Yd(this.y)||Yd(this.scaleX-1)||Yd(this.scaleY-1)||Yd(this.skewX)||Yd(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||bu(),e?this.getLocalTransform(n):Ud(n),t&&(e?Mu(n,t,n):Su(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(Ud(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Xd);var n=Xd[0]<0?-1:1,i=Xd[1]<0?-1:1,r=((Xd[0]-n)*e+n)/Xd[0]||0,o=((Xd[1]-i)*e+i)/Xd[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||bu(),Au(this.invTransform,t)},t.prototype.getComputedTransform=function(){var t=this,e=[];while(t)e.push(t),t=t.parent;while(t=e.pop())t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Mu(jd,t.invTransform,e),e=jd);var n=this.originX,i=this.originY;(n||i)&&(qd[4]=n,qd[5]=i,Mu(jd,e,qd),jd[4]-=n,jd[5]-=i,e=jd),this.setLocalTransform(e)}},t.prototype.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)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&Bl(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&Bl(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&Kd(t[0]-1)>1e-10&&Kd(t[3]-1)>1e-10?Math.sqrt(Kd(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Qd(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*r-c*f*o,e[5]=-f*o-d*p*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=d*r,e[2]=c*o,l&&Cu(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),Jd=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Qd(t,e){for(var n=0;n=0?parseFloat(t)/100*e:parseFloat(t):t}function up(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=lp(i[0],n.width),u+=lp(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+a,u+=s,c="middle";break;case"top":l+=a/2,u-=r,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+r,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=a-r,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=r,h="center";break;case"insideBottom":l+=a/2,u+=o-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=o-r,c="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,h="right",c="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var hp="__zr_normal__",cp=Jd.concat(["ignore"]),dp=Ns(Jd,(function(t,e){return t[e]=!0,t}),{ignore:!1}),pp={},fp=new Gu(0,0,0,0),gp=function(){function t(t){this.id=ws(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var u=fp;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(pp,n,u):up(pp,n,u),r.x=pp.x,r.y=pp.y,o=pp.align,a=pp.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,d=void 0;"center"===h?(c=.5*u.width,d=.5*u.height):(c=lp(h[0],u.width),d=lp(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+d+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var p=n.offset;p&&(r.x+=p[0],r.y+=p[1],l||(r.originX=-p[0],r.originY=-p[1]));var f=null==n.inside?"string"===typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,m=void 0;f&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,null!=v&&"auto"!==v||(v=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(v),m=!0)):(v=n.outsideFill,y=n.outsideStroke,null!=v&&"auto"!==v||(v=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(v),m=!0)),v=v||"#000",v===g.fill&&y===g.stroke&&m===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=v,g.stroke=y,g.autoStroke=m,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=hh,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Hd:Gd},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"===typeof e&&fc(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,wc(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},Ts(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"===typeof t)this.attrKV(t,e);else if(Xs(t))for(var n=t,i=Bs(n),r=0;r0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(hp,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===hp,o=this.hasState();if(o||!r){var a=this.currentStates,s=this.stateTransition;if(!(Ds(a,t)>=0)||!e&&1!==a.length){var l;if(this.stateProxy&&!r&&(l=this.stateProxy(t)),l||(l=this.states&&this.states[t]),l||r){r||this.saveCurrentToNormalState(l);var u=!!(l&&l.hoverLayer||i);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,l,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var h=this._textContent,c=this._textGuide;return h&&h.useState(t,e,n,u),c&&c.useState(t,e,n,u),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hh),l}Ss("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hh)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=Ds(i,t),o=Ds(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var d=0;d0||r.force&&!a.length){var M=void 0,I=void 0,C=void 0;if(s){I={},d&&(M={});for(x=0;x<_;x++){y=g[x];I[y]=n[y],d?M[y]=i[y]:n[y]=i[y]}}else if(d){C={};for(x=0;x<_;x++){y=g[x];C[y]=Qc(n[y]),_p(n,i,y)}}b=new fd(n,!1,!1,c?Es(f,(function(t){return t.targetName===e})):null);b.targetName=e,r.scope&&(b.scope=r.scope),d&&M&&b.whenWithKeys(0,M,g),C&&b.whenWithKeys(0,C,g),b.whenWithKeys(null==u?500:u,s?I:i,g).delay(h||0),t.addAnimator(b,e),a.push(b)}}Ls(gp,Zl),Ls(gp,tp);const Sp=gp;var Mp=function(t){function e(e){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(e),n}return qa(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,n=0;n=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=Ds(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=Ds(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n{n.r(e),n.d(e,{default:()=>Rtt});var i={};n.r(i),n.d(i,{Arc:()=>UI,BezierCurve:()=>GI,BoundingRect:()=>Gu,Circle:()=>tI,CompoundPath:()=>YI,Ellipse:()=>iI,Group:()=>Ip,Image:()=>Jv,IncrementalDisplayable:()=>sC,Line:()=>EI,LinearGradient:()=>KI,OrientedBoundingRect:()=>rC,Path:()=>Uv,Point:()=>Lu,Polygon:()=>DI,Polyline:()=>PI,RadialGradient:()=>JI,Rect:()=>sy,Ring:()=>MI,Sector:()=>bI,Text:()=>Iy,applyTransform:()=>IC,clipPointsByRect:()=>kC,clipRectByRect:()=>LC,createIcon:()=>PC,extendPath:()=>pC,extendShape:()=>cC,getShapeClass:()=>gC,getTransform:()=>MC,groupTransition:()=>DC,initProps:()=>Ym,isElementRemoved:()=>Xm,lineLineIntersect:()=>OC,linePolygonIntersect:()=>RC,makeImage:()=>yC,makePath:()=>vC,mergePath:()=>_C,registerShape:()=>fC,removeElement:()=>jm,removeElementWithFadeOut:()=>Km,resizePath:()=>xC,setTooltipConfig:()=>zC,subPixelOptimize:()=>SC,subPixelOptimizeLine:()=>bC,subPixelOptimizeRect:()=>wC,transformDirection:()=>CC,traverseElements:()=>VC,updateProps:()=>Zm});var r=n(6252),o=n(2262),a=n(9963),s=n(3577),l=n(5781),u=n(5027),h=n(9143);const c=t=>{if(!t)return{onClick:s.dG,onMousedown:s.dG,onMouseup:s.dG};let e=!1,n=!1;const i=i=>{e&&n&&t(i),e=n=!1},r=t=>{e=t.target===t.currentTarget},o=t=>{n=t.target===t.currentTarget};return{onClick:i,onMousedown:r,onMouseup:o}};var d=(t=>(t[t["TEXT"]=1]="TEXT",t[t["CLASS"]=2]="CLASS",t[t["STYLE"]=4]="STYLE",t[t["PROPS"]=8]="PROPS",t[t["FULL_PROPS"]=16]="FULL_PROPS",t[t["HYDRATE_EVENTS"]=32]="HYDRATE_EVENTS",t[t["STABLE_FRAGMENT"]=64]="STABLE_FRAGMENT",t[t["KEYED_FRAGMENT"]=128]="KEYED_FRAGMENT",t[t["UNKEYED_FRAGMENT"]=256]="UNKEYED_FRAGMENT",t[t["NEED_PATCH"]=512]="NEED_PATCH",t[t["DYNAMIC_SLOTS"]=1024]="DYNAMIC_SLOTS",t[t["HOISTED"]=-1]="HOISTED",t[t["BAIL"]=-2]="BAIL",t))(d||{});const p=t=>{const e=(0,s.kJ)(t)?t:[t],n=[];return e.forEach((t=>{var e;(0,s.kJ)(t)?n.push(...p(t)):(0,r.lA)(t)&&(0,s.kJ)(t.children)?n.push(...p(t.children)):(n.push(t),(0,r.lA)(t)&&(null==(e=t.component)?void 0:e.subTree)&&n.push(...p(t.component.subTree)))})),n},f=(0,u.o8)({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:(0,u.Cq)([String,Array,Object])},zIndex:{type:(0,u.Cq)([String,Number])}}),g={click:t=>t instanceof MouseEvent},v="overlay";var y=(0,r.aZ)({name:"ElOverlay",props:f,emits:g,setup(t,{slots:e,emit:n}){const i=(0,h.s3)(v),o=t=>{n("click",t)},{onClick:a,onMousedown:s,onMouseup:l}=c(t.customMaskEvent?void 0:o);return()=>t.mask?(0,r.Wm)("div",{class:[i.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:a,onMousedown:s,onMouseup:l},[(0,r.WI)(e,"default")],d.STYLE|d.CLASS|d.PROPS,["onClick","onMouseup","onMousedown"]):(0,r.h)("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[(0,r.WI)(e,"default")])}});const m=y;var _=n(4181),x=n(9809);const b=(0,u.o8)({center:Boolean,alignCenter:Boolean,closeIcon:{type:x.AA},customClass:{type:String,default:""},draggable:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}});var w=n(9460),S=n(5162);const M=(0,u.o8)({...b,appendToBody:Boolean,appendTo:{type:(0,u.Cq)(String),default:"body"},beforeClose:{type:(0,u.Cq)(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1},headerAriaLevel:{type:String,default:"2"}}),I={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[w.f_]:t=>(0,S.jn)(t),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},C=(0,u.o8)({...M,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),T=I;var A=n(1446),D=n(531),k=n(9379),L=n(7774),P=n(7675),R=n(3299),O=n(9360),N=n(4568),E=n(2259),z=n(6502),B=n(4721),V=n(7647);const F=(t,e={})=>{(0,o.dq)(t)||(0,B._)("[useLockscreen]","You need to pass a ref param to this function");const n=e.ns||(0,h.s3)("popup"),i=(0,o.Fl)((()=>n.bm("parent","hidden")));if(!R.C5||(0,P.pv)(document.body,i.value))return;let a=0,s=!1,l="0";const u=()=>{setTimeout((()=>{(0,P.IV)(null==document?void 0:document.body,i.value),s&&document&&(document.body.style.width=l)}),200)};(0,r.YP)(t,(t=>{if(!t)return void u();s=!(0,P.pv)(document.body,i.value),s&&(l=document.body.style.width),a=(0,V.Iz)(n.namespace.value);const e=document.documentElement.clientHeight0&&(e||"scroll"===r)&&s&&(document.body.style.width=`calc(100% - ${a}px)`),(0,P.cn)(document.body,i.value)})),(0,o.EB)((()=>u()))},G=(t,e)=>{var n;const i=(0,r.FN)(),a=i.emit,{nextZIndex:s}=(0,N.Cn)();let l="";const u=(0,E.Me)(),c=(0,E.Me)(),d=(0,o.iH)(!1),p=(0,o.iH)(!1),f=(0,o.iH)(!1),g=(0,o.iH)(null!=(n=t.zIndex)?n:s());let v,y;const m=(0,z.WS)("namespace",h.tL),_=(0,r.Fl)((()=>{const e={},n=`--${m.value}-dialog`;return t.fullscreen||(t.top&&(e[`${n}-margin-top`]=t.top),t.width&&(e[`${n}-width`]=(0,P.Nn)(t.width))),e})),x=(0,r.Fl)((()=>t.alignCenter?{display:"flex"}:{}));function b(){a("opened")}function S(){a("closed"),a(w.f_,!1),t.destroyOnClose&&(f.value=!1)}function M(){a("close")}function I(){null==y||y(),null==v||v(),t.openDelay&&t.openDelay>0?({stop:v}=(0,R.eM)((()=>D()),t.openDelay)):D()}function C(){null==v||v(),null==y||y(),t.closeDelay&&t.closeDelay>0?({stop:y}=(0,R.eM)((()=>k()),t.closeDelay)):k()}function T(){function e(t){t||(p.value=!0,d.value=!1)}t.beforeClose?t.beforeClose(e):C()}function A(){t.closeOnClickModal&&T()}function D(){R.C5&&(d.value=!0)}function k(){d.value=!1}function L(){a("openAutoFocus")}function B(){a("closeAutoFocus")}function V(t){var e;"pointer"===(null==(e=t.detail)?void 0:e.focusReason)&&t.preventDefault()}function G(){t.closeOnPressEscape&&T()}return t.lockScroll&&F(d),(0,r.YP)((()=>t.modelValue),(n=>{n?(p.value=!1,I(),f.value=!0,g.value=(0,O.Z)(t.zIndex)?s():g.value++,(0,r.Y3)((()=>{a("open"),e.value&&(e.value.scrollTop=0)}))):d.value&&C()})),(0,r.YP)((()=>t.fullscreen),(t=>{e.value&&(t?(l=e.value.style.transform,e.value.style.transform=""):e.value.style.transform=l)})),(0,r.bv)((()=>{t.modelValue&&(d.value=!0,f.value=!0,I())})),{afterEnter:b,afterLeave:S,beforeLeave:M,handleClose:T,onModalClick:A,close:C,doClose:k,onOpenAutoFocus:L,onCloseAutoFocus:B,onCloseRequested:G,onFocusoutPrevented:V,titleId:u,bodyId:c,closed:p,style:_,overlayDialogStyle:x,rendered:f,visible:d,zIndex:g}},H=(0,r.aZ)({name:"ElDrawer",components:{ElOverlay:m,ElFocusTrap:D.Z,ElIcon:_.gn,Close:l.Close},inheritAttrs:!1,props:C,emits:T,setup(t,{slots:e}){(0,k.A)({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},(0,r.Fl)((()=>!!e.title))),(0,k.A)({scope:"el-drawer",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/drawer.html#attributes",type:"Attribute"},(0,r.Fl)((()=>!!t.customClass)));const n=(0,o.iH)(),i=(0,o.iH)(),a=(0,h.s3)("drawer"),{t:s}=(0,L.bU)(),l=(0,r.Fl)((()=>"rtl"===t.direction||"ltr"===t.direction)),u=(0,r.Fl)((()=>(0,P.Nn)(t.size)));return{...G(t,n),drawerRef:n,focusStartRef:i,isHorizontal:l,drawerSize:u,ns:a,t:s}}}),W=["aria-label","aria-labelledby","aria-describedby"],U=["id","aria-level"],Z=["aria-label"],Y=["id"];function X(t,e,n,i,o,l){const u=(0,r.up)("close"),h=(0,r.up)("el-icon"),c=(0,r.up)("el-focus-trap"),d=(0,r.up)("el-overlay");return(0,r.wg)(),(0,r.j4)(r.lR,{to:"body",disabled:!t.appendToBody},[(0,r.Wm)(a.uT,{name:t.ns.b("fade"),onAfterEnter:t.afterEnter,onAfterLeave:t.afterLeave,onBeforeLeave:t.beforeLeave,persisted:""},{default:(0,r.w5)((()=>[(0,r.wy)((0,r.Wm)(d,{mask:t.modal,"overlay-class":t.modalClass,"z-index":t.zIndex,onClick:t.onModalClick},{default:(0,r.w5)((()=>[(0,r.Wm)(c,{loop:"",trapped:t.visible,"focus-trap-el":t.drawerRef,"focus-start-el":t.focusStartRef,onReleaseRequested:t.onCloseRequested},{default:(0,r.w5)((()=>[(0,r._)("div",(0,r.dG)({ref:"drawerRef","aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:t.titleId,"aria-describedby":t.bodyId},t.$attrs,{class:[t.ns.b(),t.direction,t.visible&&"open",t.customClass],style:t.isHorizontal?"width: "+t.drawerSize:"height: "+t.drawerSize,role:"dialog",onClick:e[1]||(e[1]=(0,a.iM)((()=>{}),["stop"]))}),[(0,r._)("span",{ref:"focusStartRef",class:(0,s.C_)(t.ns.e("sr-focus")),tabindex:"-1"},null,2),t.withHeader?((0,r.wg)(),(0,r.iD)("header",{key:0,class:(0,s.C_)(t.ns.e("header"))},[t.$slots.title?(0,r.WI)(t.$slots,"title",{key:1},(()=>[(0,r.kq)(" DEPRECATED SLOT ")])):(0,r.WI)(t.$slots,"header",{key:0,close:t.handleClose,titleId:t.titleId,titleClass:t.ns.e("title")},(()=>[t.$slots.title?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:0,id:t.titleId,role:"heading","aria-level":t.headerAriaLevel,class:(0,s.C_)(t.ns.e("title"))},(0,s.zw)(t.title),11,U))])),t.showClose?((0,r.wg)(),(0,r.iD)("button",{key:2,"aria-label":t.t("el.drawer.close"),class:(0,s.C_)(t.ns.e("close-btn")),type:"button",onClick:e[0]||(e[0]=(...e)=>t.handleClose&&t.handleClose(...e))},[(0,r.Wm)(h,{class:(0,s.C_)(t.ns.e("close"))},{default:(0,r.w5)((()=>[(0,r.Wm)(u)])),_:1},8,["class"])],10,Z)):(0,r.kq)("v-if",!0)],2)):(0,r.kq)("v-if",!0),t.rendered?((0,r.wg)(),(0,r.iD)("div",{key:1,id:t.bodyId,class:(0,s.C_)(t.ns.e("body"))},[(0,r.WI)(t.$slots,"default")],10,Y)):(0,r.kq)("v-if",!0),t.$slots.footer?((0,r.wg)(),(0,r.iD)("div",{key:2,class:(0,s.C_)(t.ns.e("footer"))},[(0,r.WI)(t.$slots,"footer")],2)):(0,r.kq)("v-if",!0)],16,W)])),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])])),_:3},8,["mask","overlay-class","z-index","onClick"]),[[a.F8,t.visible]])])),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var j=(0,A.Z)(H,[["render",X],["__file","drawer.vue"]]),q=n(2123);const K=(0,q.nz)(j);n(3241);const $=Symbol("tabsRootContextKey");var J=n(6309),Q=n(5450);const tt=(0,u.o8)({tabs:{type:(0,u.Cq)(Array),default:()=>(0,Q.N)([])}});var et=n(3650);const nt="ElTabBar",it=(0,r.aZ)({name:nt}),rt=(0,r.aZ)({...it,props:tt,setup(t,{expose:e}){const n=t,i=(0,r.FN)(),a=(0,r.f3)($);a||(0,B._)(nt,"");const l=(0,h.s3)("tabs"),u=(0,o.iH)(),c=(0,o.iH)(),d=()=>{let t=0,e=0;const r=["top","bottom"].includes(a.props.tabPosition)?"width":"height",o="width"===r?"x":"y",s="x"===o?"left":"top";return n.tabs.every((o=>{var a,l;const u=null==(l=null==(a=i.parent)?void 0:a.refs)?void 0:l[`tab-${o.uid}`];if(!u)return!1;if(!o.active)return!0;t=u[`offset${(0,et.kC)(s)}`],e=u[`client${(0,et.kC)(r)}`];const h=window.getComputedStyle(u);return"width"===r&&(n.tabs.length>1&&(e-=Number.parseFloat(h.paddingLeft)+Number.parseFloat(h.paddingRight)),t+=Number.parseFloat(h.paddingLeft)),!1})),{[r]:`${e}px`,transform:`translate${(0,et.kC)(o)}(${t}px)`}},p=()=>c.value=d();return(0,r.YP)((()=>n.tabs),(async()=>{await(0,r.Y3)(),p()}),{immediate:!0}),(0,J.yU7)(u,(()=>p())),e({ref:u,update:p}),(t,e)=>((0,r.wg)(),(0,r.iD)("div",{ref_key:"barRef",ref:u,class:(0,s.C_)([(0,o.SU)(l).e("active-bar"),(0,o.SU)(l).is((0,o.SU)(a).props.tabPosition)]),style:(0,s.j5)(c.value)},null,6))}});var ot=(0,A.Z)(rt,[["__file","tab-bar.vue"]]),at=n(4309);const st=(0,u.o8)({panes:{type:(0,u.Cq)(Array),default:()=>(0,Q.N)([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),lt={tabClick:(t,e,n)=>n instanceof Event,tabRemove:(t,e)=>e instanceof Event},ut="ElTabNav",ht=(0,r.aZ)({name:ut,props:st,emits:lt,setup(t,{expose:e,emit:n}){const i=(0,r.FN)(),a=(0,r.f3)($);a||(0,B._)(ut,"");const s=(0,h.s3)("tabs"),u=(0,J.xKQ)(),c=(0,J.vou)(),d=(0,o.iH)(),p=(0,o.iH)(),f=(0,o.iH)(),g=(0,o.iH)(),v=(0,o.iH)(!1),y=(0,o.iH)(0),m=(0,o.iH)(!1),x=(0,o.iH)(!0),b=(0,r.Fl)((()=>["top","bottom"].includes(a.props.tabPosition)?"width":"height")),w=(0,r.Fl)((()=>{const t="width"===b.value?"X":"Y";return{transform:`translate${t}(-${y.value}px)`}})),S=()=>{if(!d.value)return;const t=d.value[`offset${(0,et.kC)(b.value)}`],e=y.value;if(!e)return;const n=e>t?e-t:0;y.value=n},M=()=>{if(!d.value||!p.value)return;const t=p.value[`offset${(0,et.kC)(b.value)}`],e=d.value[`offset${(0,et.kC)(b.value)}`],n=y.value;if(t-n<=e)return;const i=t-n>2*e?n+e:t-e;y.value=i},I=async()=>{const t=p.value;if(!v.value||!f.value||!d.value||!t)return;await(0,r.Y3)();const e=f.value.querySelector(".is-active");if(!e)return;const n=d.value,i=["top","bottom"].includes(a.props.tabPosition),o=e.getBoundingClientRect(),s=n.getBoundingClientRect(),l=i?t.offsetWidth-s.width:t.offsetHeight-s.height,u=y.value;let h=u;i?(o.lefts.right&&(h=u+o.right-s.right)):(o.tops.bottom&&(h=u+(o.bottom-s.bottom))),h=Math.max(h,0),y.value=Math.min(h,l)},C=()=>{var e;if(!p.value||!d.value)return;t.stretch&&(null==(e=g.value)||e.update());const n=p.value[`offset${(0,et.kC)(b.value)}`],i=d.value[`offset${(0,et.kC)(b.value)}`],r=y.value;i0&&(y.value=0))},T=t=>{const e=t.code,{up:n,down:i,left:r,right:o}=at.EVENT_CODE;if(![n,i,r,o].includes(e))return;const a=Array.from(t.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),s=a.indexOf(t.target);let l;l=e===r||e===n?0===s?a.length-1:s-1:s{x.value&&(m.value=!0)},D=()=>m.value=!1;return(0,r.YP)(u,(t=>{"hidden"===t?x.value=!1:"visible"===t&&setTimeout((()=>x.value=!0),50)})),(0,r.YP)(c,(t=>{t?setTimeout((()=>x.value=!0),50):x.value=!1})),(0,J.yU7)(f,C),(0,r.bv)((()=>setTimeout((()=>I()),0))),(0,r.ic)((()=>C())),e({scrollToActiveTab:I,removeFocus:D}),(0,r.YP)((()=>t.panes),(()=>i.update()),{flush:"post",deep:!0}),()=>{const e=v.value?[(0,r.Wm)("span",{class:[s.e("nav-prev"),s.is("disabled",!v.value.prev)],onClick:S},[(0,r.Wm)(_.gn,null,{default:()=>[(0,r.Wm)(l.ArrowLeft,null,null)]})]),(0,r.Wm)("span",{class:[s.e("nav-next"),s.is("disabled",!v.value.next)],onClick:M},[(0,r.Wm)(_.gn,null,{default:()=>[(0,r.Wm)(l.ArrowRight,null,null)]})])]:null,i=t.panes.map(((e,i)=>{var o,u,h,c;const d=e.uid,p=e.props.disabled,f=null!=(u=null!=(o=e.props.name)?o:e.index)?u:`${i}`,g=!p&&(e.isClosable||t.editable);e.index=`${i}`;const v=g?(0,r.Wm)(_.gn,{class:"is-icon-close",onClick:t=>n("tabRemove",e,t)},{default:()=>[(0,r.Wm)(l.Close,null,null)]}):null,y=(null==(c=(h=e.slots).label)?void 0:c.call(h))||e.props.label,x=!p&&e.active?0:-1;return(0,r.Wm)("div",{ref:`tab-${d}`,class:[s.e("item"),s.is(a.props.tabPosition),s.is("active",e.active),s.is("disabled",p),s.is("closable",g),s.is("focus",m.value)],id:`tab-${f}`,key:`tab-${d}`,"aria-controls":`pane-${f}`,role:"tab","aria-selected":e.active,tabindex:x,onFocus:()=>A(),onBlur:()=>D(),onClick:t=>{D(),n("tabClick",e,f,t)},onKeydown:t=>{!g||t.code!==at.EVENT_CODE.delete&&t.code!==at.EVENT_CODE.backspace||n("tabRemove",e,t)}},[y,v])}));return(0,r.Wm)("div",{ref:f,class:[s.e("nav-wrap"),s.is("scrollable",!!v.value),s.is(a.props.tabPosition)]},[e,(0,r.Wm)("div",{class:s.e("nav-scroll"),ref:d},[(0,r.Wm)("div",{class:[s.e("nav"),s.is(a.props.tabPosition),s.is("stretch",t.stretch&&["top","bottom"].includes(a.props.tabPosition))],ref:p,style:w.value,role:"tablist",onKeydown:T},[t.type?null:(0,r.Wm)(ot,{ref:g,tabs:[...t.panes]},null),i])])])}}}),ct=(t,e,n)=>{const i=p(t.subTree).filter((t=>{var n;return(0,r.lA)(t)&&(null==(n=t.type)?void 0:n.name)===e&&!!t.component})),o=i.map((t=>t.component.uid));return o.map((t=>n[t])).filter((t=>!!t))},dt=(t,e)=>{const n={},i=(0,o.XI)([]),r=r=>{n[r.uid]=r,i.value=ct(t,e,n)},a=t=>{delete n[t],i.value=i.value.filter((e=>e.uid!==t))};return{children:i,addChild:r,removeChild:a}},pt=(0,u.o8)({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:(0,u.Cq)(Function),default:()=>!0},stretch:Boolean}),ft=t=>(0,s.HD)(t)||(0,S.hj)(t),gt={[w.f_]:t=>ft(t),tabClick:(t,e)=>e instanceof Event,tabChange:t=>ft(t),edit:(t,e)=>["remove","add"].includes(e),tabRemove:t=>ft(t),tabAdd:()=>!0},vt=(0,r.aZ)({name:"ElTabs",props:pt,emits:gt,setup(t,{emit:e,slots:n,expose:i}){var a,s;const u=(0,h.s3)("tabs"),{children:c,addChild:d,removeChild:p}=dt((0,r.FN)(),"ElTabPane"),f=(0,o.iH)(),g=(0,o.iH)(null!=(s=null!=(a=t.modelValue)?a:t.activeName)?s:"0"),v=async(n,i=!1)=>{var r,o,a;if(g.value!==n&&!(0,S.o8)(n))try{const s=await(null==(r=t.beforeLeave)?void 0:r.call(t,n,g.value));!1!==s&&(g.value=n,i&&(e(w.f_,n),e("tabChange",n)),null==(a=null==(o=f.value)?void 0:o.removeFocus)||a.call(o))}catch(fI){}},y=(t,n,i)=>{t.props.disabled||(v(n,!0),e("tabClick",t,i))},m=(t,n)=>{t.props.disabled||(0,S.o8)(t.props.name)||(n.stopPropagation(),e("edit",t.props.name,"remove"),e("tabRemove",t.props.name))},x=()=>{e("edit",void 0,"add"),e("tabAdd")};return(0,k.A)({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},(0,r.Fl)((()=>!!t.activeName))),(0,r.YP)((()=>t.activeName),(t=>v(t))),(0,r.YP)((()=>t.modelValue),(t=>v(t))),(0,r.YP)(g,(async()=>{var t;await(0,r.Y3)(),null==(t=f.value)||t.scrollToActiveTab()})),(0,r.JJ)($,{props:t,currentName:g,registerPane:d,unregisterPane:p}),i({currentName:g}),()=>{const e=n.addIcon,i=t.editable||t.addable?(0,r.Wm)("span",{class:u.e("new-tab"),tabindex:"0",onClick:x,onKeydown:t=>{t.code===at.EVENT_CODE.enter&&x()}},[e?(0,r.WI)(n,"addIcon"):(0,r.Wm)(_.gn,{class:u.is("icon-plus")},{default:()=>[(0,r.Wm)(l.Plus,null,null)]})]):null,o=(0,r.Wm)("div",{class:[u.e("header"),u.is(t.tabPosition)]},[i,(0,r.Wm)(ht,{ref:f,currentName:g.value,editable:t.editable,type:t.type,panes:c.value,stretch:t.stretch,onTabClick:y,onTabRemove:m},null)]),a=(0,r.Wm)("div",{class:u.e("content")},[(0,r.WI)(n,"default")]);return(0,r.Wm)("div",{class:[u.b(),u.m(t.tabPosition),{[u.m("card")]:"card"===t.type,[u.m("border-card")]:"border-card"===t.type}]},[..."bottom"!==t.tabPosition?[o,a]:[a,o]])}}}),yt=(0,u.o8)({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),mt=["id","aria-hidden","aria-labelledby"],_t="ElTabPane",xt=(0,r.aZ)({name:_t}),bt=(0,r.aZ)({...xt,props:yt,setup(t){const e=t,n=(0,r.FN)(),i=(0,r.Rr)(),l=(0,r.f3)($);l||(0,B._)(_t,"usage: ");const u=(0,h.s3)("tab-pane"),c=(0,o.iH)(),d=(0,r.Fl)((()=>e.closable||l.props.closable)),p=(0,R.Rc)((()=>{var t;return l.currentName.value===(null!=(t=e.name)?t:c.value)})),f=(0,o.iH)(p.value),g=(0,r.Fl)((()=>{var t;return null!=(t=e.name)?t:c.value})),v=(0,R.Rc)((()=>!e.lazy||f.value||p.value));(0,r.YP)(p,(t=>{t&&(f.value=!0)}));const y=(0,o.qj)({uid:n.uid,slots:i,props:e,paneName:g,active:p,index:c,isClosable:d});return(0,r.bv)((()=>{l.registerPane(y)})),(0,r.Ah)((()=>{l.unregisterPane(y.uid)})),(t,e)=>(0,o.SU)(v)?(0,r.wy)(((0,r.wg)(),(0,r.iD)("div",{key:0,id:`pane-${(0,o.SU)(g)}`,class:(0,s.C_)((0,o.SU)(u).b()),role:"tabpanel","aria-hidden":!(0,o.SU)(p),"aria-labelledby":`tab-${(0,o.SU)(g)}`},[(0,r.WI)(t.$slots,"default")],10,mt)),[[a.F8,(0,o.SU)(p)]]):(0,r.kq)("v-if",!0)}});var wt=(0,A.Z)(bt,[["__file","tab-pane.vue"]]);const St=(0,q.nz)(vt,{TabPane:wt});(0,q.dp)(wt);var Mt=n(8600),It=(n(9414),n(6398)),Ct=(n(9448),n(7534)),Tt=(n(2471),n(2111));const At=(0,u.o8)({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{type:String,validator:Tt.P},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},inactiveActionIcon:{type:x.AA},activeActionIcon:{type:x.AA},activeIcon:{type:x.AA},inactiveIcon:{type:x.AA},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:(0,u.Cq)(Function)},id:String,tabindex:{type:[String,Number]},value:{type:[Boolean,String,Number],default:!1},label:{type:String,default:void 0}}),Dt={[w.f_]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t),[w.O7]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t),[w.e_]:t=>(0,S.jn)(t)||(0,s.HD)(t)||(0,S.hj)(t)};var kt=n(5620),Lt=n(1069);const Pt=["onClick"],Rt=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"],Ot=["aria-hidden"],Nt=["aria-hidden"],Et=["aria-hidden"],zt="ElSwitch",Bt=(0,r.aZ)({name:zt}),Vt=(0,r.aZ)({...Bt,props:At,emits:Dt,setup(t,{expose:e,emit:n}){const i=t,u=(0,r.FN)(),{formItem:c}=(0,kt.A)(),d=(0,Lt.Cd)(),p=(0,h.s3)("switch"),f=t=>{t.forEach((t=>{(0,k.A)({from:t[0],replacement:t[1],scope:zt,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},(0,r.Fl)((()=>{var e;return!!(null==(e=u.vnode.props)?void 0:e[t[2]])})))}))};f([['"value"','"model-value" or "v-model"',"value"],['"active-color"',"CSS var `--el-switch-on-color`","activeColor"],['"inactive-color"',"CSS var `--el-switch-off-color`","inactiveColor"],['"border-color"',"CSS var `--el-switch-border-color`","borderColor"]]);const{inputId:g}=(0,kt.p)(i,{formItemContext:c}),v=(0,Lt.DT)((0,r.Fl)((()=>i.loading))),y=(0,o.iH)(!1!==i.modelValue),m=(0,o.iH)(),x=(0,o.iH)(),b=(0,r.Fl)((()=>[p.b(),p.m(d.value),p.is("disabled",v.value),p.is("checked",A.value)])),M=(0,r.Fl)((()=>[p.e("label"),p.em("label","left"),p.is("active",!A.value)])),I=(0,r.Fl)((()=>[p.e("label"),p.em("label","right"),p.is("active",A.value)])),C=(0,r.Fl)((()=>({width:(0,P.Nn)(i.width)})));(0,r.YP)((()=>i.modelValue),(()=>{y.value=!0})),(0,r.YP)((()=>i.value),(()=>{y.value=!1}));const T=(0,r.Fl)((()=>y.value?i.modelValue:i.value)),A=(0,r.Fl)((()=>T.value===i.activeValue));[i.activeValue,i.inactiveValue].includes(T.value)||(n(w.f_,i.inactiveValue),n(w.O7,i.inactiveValue),n(w.e_,i.inactiveValue)),(0,r.YP)(A,(t=>{var e;m.value.checked=t,i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"change").catch((t=>(0,B.N)(t))))}));const D=()=>{const t=A.value?i.inactiveValue:i.activeValue;n(w.f_,t),n(w.O7,t),n(w.e_,t),(0,r.Y3)((()=>{m.value.checked=A.value}))},L=()=>{if(v.value)return;const{beforeChange:t}=i;if(!t)return void D();const e=t(),n=[(0,s.tI)(e),(0,S.jn)(e)].includes(!0);n||(0,B._)(zt,"beforeChange must return type `Promise` or `boolean`"),(0,s.tI)(e)?e.then((t=>{t&&D()})).catch((t=>{(0,B.N)(zt,`some error occurred: ${t}`)})):e&&D()},R=(0,r.Fl)((()=>p.cssVarBlock({...i.activeColor?{"on-color":i.activeColor}:null,...i.inactiveColor?{"off-color":i.inactiveColor}:null,...i.borderColor?{"border-color":i.borderColor}:null}))),O=()=>{var t,e;null==(e=null==(t=m.value)?void 0:t.focus)||e.call(t)};return(0,r.bv)((()=>{m.value.checked=A.value})),e({focus:O,checked:A}),(t,e)=>((0,r.wg)(),(0,r.iD)("div",{class:(0,s.C_)((0,o.SU)(b)),style:(0,s.j5)((0,o.SU)(R)),onClick:(0,a.iM)(L,["prevent"])},[(0,r._)("input",{id:(0,o.SU)(g),ref_key:"input",ref:m,class:(0,s.C_)((0,o.SU)(p).e("input")),type:"checkbox",role:"switch","aria-checked":(0,o.SU)(A),"aria-disabled":(0,o.SU)(v),"aria-label":t.label,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:(0,o.SU)(v),tabindex:t.tabindex,onChange:D,onKeydown:(0,a.D2)(L,["enter"])},null,42,Rt),t.inlinePrompt||!t.inactiveIcon&&!t.inactiveText?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:0,class:(0,s.C_)((0,o.SU)(M))},[t.inactiveIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.inactiveIcon)))])),_:1})):(0,r.kq)("v-if",!0),!t.inactiveIcon&&t.inactiveText?((0,r.wg)(),(0,r.iD)("span",{key:1,"aria-hidden":(0,o.SU)(A)},(0,s.zw)(t.inactiveText),9,Ot)):(0,r.kq)("v-if",!0)],2)),(0,r._)("span",{ref_key:"core",ref:x,class:(0,s.C_)((0,o.SU)(p).e("core")),style:(0,s.j5)((0,o.SU)(C))},[t.inlinePrompt?((0,r.wg)(),(0,r.iD)("div",{key:0,class:(0,s.C_)((0,o.SU)(p).e("inner"))},[t.activeIcon||t.inactiveIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0,class:(0,s.C_)((0,o.SU)(p).is("icon"))},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)((0,o.SU)(A)?t.activeIcon:t.inactiveIcon)))])),_:1},8,["class"])):t.activeText||t.inactiveText?((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,s.C_)((0,o.SU)(p).is("text")),"aria-hidden":!(0,o.SU)(A)},(0,s.zw)((0,o.SU)(A)?t.activeText:t.inactiveText),11,Nt)):(0,r.kq)("v-if",!0)],2)):(0,r.kq)("v-if",!0),(0,r._)("div",{class:(0,s.C_)((0,o.SU)(p).e("action"))},[t.loading?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0,class:(0,s.C_)((0,o.SU)(p).is("loading"))},{default:(0,r.w5)((()=>[(0,r.Wm)((0,o.SU)(l.Loading))])),_:1},8,["class"])):(0,o.SU)(A)?(0,r.WI)(t.$slots,"active-action",{key:1},(()=>[t.activeActionIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.activeActionIcon)))])),_:1})):(0,r.kq)("v-if",!0)])):(0,o.SU)(A)?(0,r.kq)("v-if",!0):(0,r.WI)(t.$slots,"inactive-action",{key:2},(()=>[t.inactiveActionIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.inactiveActionIcon)))])),_:1})):(0,r.kq)("v-if",!0)]))],2)],6),t.inlinePrompt||!t.activeIcon&&!t.activeText?(0,r.kq)("v-if",!0):((0,r.wg)(),(0,r.iD)("span",{key:1,class:(0,s.C_)((0,o.SU)(I))},[t.activeIcon?((0,r.wg)(),(0,r.j4)((0,o.SU)(_.gn),{key:0},{default:(0,r.w5)((()=>[((0,r.wg)(),(0,r.j4)((0,r.LL)(t.activeIcon)))])),_:1})):(0,r.kq)("v-if",!0),!t.activeIcon&&t.activeText?((0,r.wg)(),(0,r.iD)("span",{key:1,"aria-hidden":!(0,o.SU)(A)},(0,s.zw)(t.activeText),9,Et)):(0,r.kq)("v-if",!0)],2))],14,Pt))}});var Ft=(0,A.Z)(Vt,[["__file","switch.vue"]]);const Gt=(0,q.nz)(Ft);var Ht=n(63);const Wt=()=>(0,Ht.Z)({method:"get",url:"/data/proteinTable.json.gz",responseType:"arraybuffer"}),Ut=()=>(0,Ht.Z)({method:"get",url:"/data/Cell_lines_IBAQ.json.gz",responseType:"arraybuffer"}),Zt=4,Yt=0,Xt=1,jt=2;function qt(t){let e=t.length;while(--e>=0)t[e]=0}const Kt=0,$t=1,Jt=2,Qt=3,te=258,ee=29,ne=256,ie=ne+1+ee,re=30,oe=19,ae=2*ie+1,se=15,le=16,ue=7,he=256,ce=16,de=17,pe=18,fe=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ge=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ve=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),me=512,_e=new Array(2*(ie+2));qt(_e);const xe=new Array(2*re);qt(xe);const be=new Array(me);qt(be);const we=new Array(te-Qt+1);qt(we);const Se=new Array(ee);qt(Se);const Me=new Array(re);function Ie(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}let Ce,Te,Ae;function De(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}qt(Me);const ke=t=>t<256?be[t]:be[256+(t>>>7)],Le=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Pe=(t,e,n)=>{t.bi_valid>le-n?(t.bi_buf|=e<>le-t.bi_valid,t.bi_valid+=n-le):(t.bi_buf|=e<{Pe(t,n[2*e],n[2*e+1])},Oe=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},Ne=t=>{16===t.bi_valid?(Le(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)},Ee=(t,e)=>{const n=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,h,c,d,p,f,g=0;for(d=0;d<=se;d++)t.bl_count[d]=0;for(n[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;ul&&(d=l,g++),n[2*h+1]=d,h>i||(t.bl_count[d]++,p=0,h>=s&&(p=a[h-s]),f=n[2*h],t.opt_len+=f*(d+p),o&&(t.static_len+=f*(r[2*h+1]+p)));if(0!==g){do{d=l-1;while(0===t.bl_count[d])d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;0!==d;d--){h=t.bl_count[d];while(0!==h)c=t.heap[--u],c>i||(n[2*c+1]!==d&&(t.opt_len+=(d-n[2*c+1])*n[2*c],n[2*c+1]=d),h--)}}},ze=(t,e,n)=>{const i=new Array(se+1);let r,o,a=0;for(r=1;r<=se;r++)a=a+n[r-1]<<1,i[r]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=Oe(i[e]++,e))}},Be=()=>{let t,e,n,i,r;const o=new Array(se+1);for(n=0,i=0;i>=7;i{let e;for(e=0;e{t.bi_valid>8?Le(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Ge=(t,e,n,i)=>{const r=2*e,o=2*n;return t[r]{const i=t.heap[n];let r=n<<1;while(r<=t.heap_len){if(r{let i,r,o,a,s=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+s++],i+=(255&t.pending_buf[t.sym_buf+s++])<<8,r=t.pending_buf[t.sym_buf+s++],0===i?Re(t,r,e):(o=we[r],Re(t,o+ne+1,e),a=fe[o],0!==a&&(r-=Se[o],Pe(t,r,a)),i--,o=ke(i),Re(t,o,n),a=ge[o],0!==a&&(i-=Me[o],Pe(t,i,a)))}while(s{const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,s,l,u=-1;for(t.heap_len=0,t.heap_max=ae,a=0;a>1;a>=1;a--)He(t,n,a);l=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],He(t,n,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,n[2*l]=n[2*a]+n[2*s],t.depth[l]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,n[2*a+1]=n[2*s+1]=l,t.heap[1]=l++,He(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Ee(t,e),ze(n,u,t.bl_count)},Ze=(t,e,n)=>{let i,r,o=-1,a=e[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=a,a=e[2*(i+1)+1],++s{let i,r,o=-1,a=e[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),i=0;i<=n;i++)if(r=a,a=e[2*(i+1)+1],!(++s{let e;for(Ze(t,t.dyn_ltree,t.l_desc.max_code),Ze(t,t.dyn_dtree,t.d_desc.max_code),Ue(t,t.bl_desc),e=oe-1;e>=3;e--)if(0!==t.bl_tree[2*ye[e]+1])break;return t.opt_len+=3*(e+1)+5+5+4,e},je=(t,e,n,i)=>{let r;for(Pe(t,e-257,5),Pe(t,n-1,5),Pe(t,i-4,4),r=0;r{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return Yt;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return Xt;for(e=32;e{Ke||(Be(),Ke=!0),t.l_desc=new De(t.dyn_ltree,Ce),t.d_desc=new De(t.dyn_dtree,Te),t.bl_desc=new De(t.bl_tree,Ae),t.bi_buf=0,t.bi_valid=0,Ve(t)},Je=(t,e,n,i)=>{Pe(t,(Kt<<1)+(i?1:0),3),Fe(t),Le(t,n),Le(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n},Qe=t=>{Pe(t,$t<<1,3),Re(t,he,_e),Ne(t)},tn=(t,e,n,i)=>{let r,o,a=0;t.level>0?(t.strm.data_type===jt&&(t.strm.data_type=qe(t)),Ue(t,t.l_desc),Ue(t,t.d_desc),a=Xe(t),r=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==e?Je(t,e,n,i):t.strategy===Zt||o===r?(Pe(t,($t<<1)+(i?1:0),3),We(t,_e,xe)):(Pe(t,(Jt<<1)+(i?1:0),3),je(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),We(t,t.dyn_ltree,t.dyn_dtree)),Ve(t),i&&Fe(t)},en=(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(we[n]+ne+1)]++,t.dyn_dtree[2*ke(e)]++),t.sym_next===t.sym_end);var nn=$e,rn=Je,on=tn,an=en,sn=Qe,ln={_tr_init:nn,_tr_stored_block:rn,_tr_flush_block:on,_tr_tally:an,_tr_align:sn};const un=(t,e,n,i)=>{let r=65535&t|0,o=t>>>16&65535|0,a=0;while(0!==n){a=n>2e3?2e3:n,n-=a;do{r=r+e[i++]|0,o=o+r|0}while(--a);r%=65521,o%=65521}return r|o<<16|0};var hn=un;const cn=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e},dn=new Uint32Array(cn()),pn=(t,e,n,i)=>{const r=dn,o=i+n;t^=-1;for(let a=i;a>>8^r[255&(t^e[a])];return-1^t};var fn=pn,gn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},vn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:yn,_tr_stored_block:mn,_tr_flush_block:_n,_tr_tally:xn,_tr_align:bn}=ln,{Z_NO_FLUSH:wn,Z_PARTIAL_FLUSH:Sn,Z_FULL_FLUSH:Mn,Z_FINISH:In,Z_BLOCK:Cn,Z_OK:Tn,Z_STREAM_END:An,Z_STREAM_ERROR:Dn,Z_DATA_ERROR:kn,Z_BUF_ERROR:Ln,Z_DEFAULT_COMPRESSION:Pn,Z_FILTERED:Rn,Z_HUFFMAN_ONLY:On,Z_RLE:Nn,Z_FIXED:En,Z_DEFAULT_STRATEGY:zn,Z_UNKNOWN:Bn,Z_DEFLATED:Vn}=vn,Fn=9,Gn=15,Hn=8,Wn=29,Un=256,Zn=Un+1+Wn,Yn=30,Xn=19,jn=2*Zn+1,qn=15,Kn=3,$n=258,Jn=$n+Kn+1,Qn=32,ti=42,ei=57,ni=69,ii=73,ri=91,oi=103,ai=113,si=666,li=1,ui=2,hi=3,ci=4,di=3,pi=(t,e)=>(t.msg=gn[e],e),fi=t=>2*t-(t>4?9:0),gi=t=>{let e=t.length;while(--e>=0)t[e]=0},vi=t=>{let e,n,i,r=t.w_size;e=t.hash_size,i=e;do{n=t.head[--i],t.head[i]=n>=r?n-r:0}while(--e);e=r,i=e;do{n=t.prev[--i],t.prev[i]=n>=r?n-r:0}while(--e)};let yi=(t,e,n)=>(e<{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},xi=(t,e)=>{_n(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,_i(t.strm)},bi=(t,e)=>{t.pending_buf[t.pending++]=e},wi=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Si=(t,e,n,i)=>{let r=t.avail_in;return r>i&&(r=i),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),n),1===t.state.wrap?t.adler=hn(t.adler,e,r,n):2===t.state.wrap&&(t.adler=fn(t.adler,e,r,n)),t.next_in+=r,t.total_in+=r,r)},Mi=(t,e)=>{let n,i,r=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match;const l=t.strstart>t.w_size-Jn?t.strstart-(t.w_size-Jn):0,u=t.window,h=t.w_mask,c=t.prev,d=t.strstart+$n;let p=u[o+a-1],f=u[o+a];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(n=e,u[n+a]===f&&u[n+a-1]===p&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&oa){if(t.match_start=e,a=i,i>=s)break;p=u[o+a-1],f=u[o+a]}}}while((e=c[e&h])>l&&0!==--r);return a<=t.lookahead?a:t.lookahead},Ii=t=>{const e=t.w_size;let n,i,r;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Jn)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),vi(t),i+=e),0===t.strm.avail_in)break;if(n=Si(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=Kn){r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=mi(t,t.ins_h,t.window[r+1]);while(t.insert)if(t.ins_h=mi(t,t.ins_h,t.window[r+Kn-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,t.lookahead+t.insert{let n,i,r,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,s=t.strm.avail_in;do{if(n=65535,r=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(n=i+t.strm.avail_in),n>r&&(n=r),n>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,_i(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Si(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===a);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_waterr&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,r+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),r>t.strm.avail_in&&(r=t.strm.avail_in),r&&(Si(t.strm,t.window,t.strstart,r),t.strstart+=r,t.insert+=r>t.w_size-t.insert?t.w_size-t.insert:r),t.high_water>3,r=t.pending_buf_size-r>65535?65535:t.pending_buf_size-r,o=r>t.w_size?t.w_size:r,i=t.strstart-t.block_start,(i>=o||(i||e===In)&&e!==wn&&0===t.strm.avail_in&&i<=r)&&(n=i>r?r:i,a=e===In&&0===t.strm.avail_in&&n===i?1:0,mn(t,t.block_start,n,a),t.block_start+=n,_i(t.strm)),a?hi:li)},Ti=(t,e)=>{let n,i;for(;;){if(t.lookahead=Kn&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Jn&&(t.match_length=Mi(t,n)),t.match_length>=Kn)if(i=xn(t,t.strstart-t.match_start,t.match_length-Kn),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Kn){t.match_length--;do{t.strstart++,t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=mi(t,t.ins_h,t.window[t.strstart+1]);else i=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=t.strstart{let n,i,r;for(;;){if(t.lookahead=Kn&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Kn-1,0!==n&&t.prev_length4096)&&(t.match_length=Kn-1)),t.prev_length>=Kn&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-Kn,i=xn(t,t.strstart-1-t.prev_match,t.prev_length-Kn),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=mi(t,t.ins_h,t.window[t.strstart+Kn-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=Kn-1,t.strstart++,i&&(xi(t,!1),0===t.strm.avail_out))return li}else if(t.match_available){if(i=xn(t,0,t.window[t.strstart-1]),i&&xi(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return li}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=xn(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart{let n,i,r,o;const a=t.window;for(;;){if(t.lookahead<=$n){if(Ii(t),t.lookahead<=$n&&e===wn)return li;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=Kn&&t.strstart>0&&(r=t.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){o=t.strstart+$n;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Kn?(n=xn(t,1,t.match_length-Kn),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=0,e===In?(xi(t,!0),0===t.strm.avail_out?hi:ci):t.sym_next&&(xi(t,!1),0===t.strm.avail_out)?li:ui},ki=(t,e)=>{let n;for(;;){if(0===t.lookahead&&(Ii(t),0===t.lookahead)){if(e===wn)return li;break}if(t.match_length=0,n=xn(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(xi(t,!1),0===t.strm.avail_out))return li}return t.insert=0,e===In?(xi(t,!0),0===t.strm.avail_out?hi:ci):t.sym_next&&(xi(t,!1),0===t.strm.avail_out)?li:ui};function Li(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}const Pi=[new Li(0,0,0,0,Ci),new Li(4,4,8,4,Ti),new Li(4,5,16,8,Ti),new Li(4,6,32,32,Ti),new Li(4,4,16,16,Ai),new Li(8,16,32,32,Ai),new Li(8,16,128,128,Ai),new Li(8,32,128,256,Ai),new Li(32,128,258,1024,Ai),new Li(32,258,258,4096,Ai)],Ri=t=>{t.window_size=2*t.w_size,gi(t.head),t.max_lazy_match=Pi[t.level].max_lazy,t.good_match=Pi[t.level].good_length,t.nice_match=Pi[t.level].nice_length,t.max_chain_length=Pi[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Kn-1,t.match_available=0,t.ins_h=0};function Oi(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Vn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*jn),this.dyn_dtree=new Uint16Array(2*(2*Yn+1)),this.bl_tree=new Uint16Array(2*(2*Xn+1)),gi(this.dyn_ltree),gi(this.dyn_dtree),gi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(qn+1),this.heap=new Uint16Array(2*Zn+1),gi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Zn+1),gi(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ni=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==ti&&e.status!==ei&&e.status!==ni&&e.status!==ii&&e.status!==ri&&e.status!==oi&&e.status!==ai&&e.status!==si?1:0},Ei=t=>{if(Ni(t))return pi(t,Dn);t.total_in=t.total_out=0,t.data_type=Bn;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?ei:e.wrap?ti:ai,t.adler=2===e.wrap?0:1,e.last_flush=-2,yn(e),Tn},zi=t=>{const e=Ei(t);return e===Tn&&Ri(t.state),e},Bi=(t,e)=>Ni(t)||2!==t.state.wrap?Dn:(t.state.gzhead=e,Tn),Vi=(t,e,n,i,r,o)=>{if(!t)return Dn;let a=1;if(e===Pn&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>Fn||n!==Vn||i<8||i>15||e<0||e>9||o<0||o>En||8===i&&1!==a)return pi(t,Dn);8===i&&(i=9);const s=new Oi;return t.state=s,s.strm=t,s.status=ti,s.wrap=a,s.gzhead=null,s.w_bits=i,s.w_size=1<Vi(t,e,Vn,Gn,Hn,zn),Gi=(t,e)=>{if(Ni(t)||e>Cn||e<0)return t?pi(t,Dn):Dn;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===si&&e!==In)return pi(t,0===t.avail_out?Ln:Dn);const i=n.last_flush;if(n.last_flush=e,0!==n.pending){if(_i(t),0===t.avail_out)return n.last_flush=-1,Tn}else if(0===t.avail_in&&fi(e)<=fi(i)&&e!==In)return pi(t,Ln);if(n.status===si&&0!==t.avail_in)return pi(t,Ln);if(n.status===ti&&0===n.wrap&&(n.status=ai),n.status===ti){let e=Vn+(n.w_bits-8<<4)<<8,i=-1;if(i=n.strategy>=On||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=i<<6,0!==n.strstart&&(e|=Qn),e+=31-e%31,wi(n,e),0!==n.strstart&&(wi(n,t.adler>>>16),wi(n,65535&t.adler)),t.adler=1,n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn}if(n.status===ei)if(t.adler=0,bi(n,31),bi(n,139),bi(n,8),n.gzhead)bi(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),bi(n,255&n.gzhead.time),bi(n,n.gzhead.time>>8&255),bi(n,n.gzhead.time>>16&255),bi(n,n.gzhead.time>>24&255),bi(n,9===n.level?2:n.strategy>=On||n.level<2?4:0),bi(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(bi(n,255&n.gzhead.extra.length),bi(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=fn(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ni;else if(bi(n,0),bi(n,0),bi(n,0),bi(n,0),bi(n,0),bi(n,9===n.level?2:n.strategy>=On||n.level<2?4:0),bi(n,di),n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn;if(n.status===ni){if(n.gzhead.extra){let e=n.pending,i=(65535&n.gzhead.extra.length)-n.gzindex;while(n.pending+i>n.pending_buf_size){let r=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=fn(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=r,_i(t),0!==n.pending)return n.last_flush=-1,Tn;e=0,i-=r}let r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>e&&(t.adler=fn(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=ii}if(n.status===ii){if(n.gzhead.name){let e,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),_i(t),0!==n.pending)return n.last_flush=-1,Tn;i=0}e=n.gzindexi&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=ri}if(n.status===ri){if(n.gzhead.comment){let e,i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i)),_i(t),0!==n.pending)return n.last_flush=-1,Tn;i=0}e=n.gzindexi&&(t.adler=fn(t.adler,n.pending_buf,n.pending-i,i))}n.status=oi}if(n.status===oi){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(_i(t),0!==n.pending))return n.last_flush=-1,Tn;bi(n,255&t.adler),bi(n,t.adler>>8&255),t.adler=0}if(n.status=ai,_i(t),0!==n.pending)return n.last_flush=-1,Tn}if(0!==t.avail_in||0!==n.lookahead||e!==wn&&n.status!==si){let i=0===n.level?Ci(n,e):n.strategy===On?ki(n,e):n.strategy===Nn?Di(n,e):Pi[n.level].func(n,e);if(i!==hi&&i!==ci||(n.status=si),i===li||i===hi)return 0===t.avail_out&&(n.last_flush=-1),Tn;if(i===ui&&(e===Sn?bn(n):e!==Cn&&(mn(n,0,0,!1),e===Mn&&(gi(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),_i(t),0===t.avail_out))return n.last_flush=-1,Tn}return e!==In?Tn:n.wrap<=0?An:(2===n.wrap?(bi(n,255&t.adler),bi(n,t.adler>>8&255),bi(n,t.adler>>16&255),bi(n,t.adler>>24&255),bi(n,255&t.total_in),bi(n,t.total_in>>8&255),bi(n,t.total_in>>16&255),bi(n,t.total_in>>24&255)):(wi(n,t.adler>>>16),wi(n,65535&t.adler)),_i(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Tn:An)},Hi=t=>{if(Ni(t))return Dn;const e=t.state.status;return t.state=null,e===ai?pi(t,kn):Tn},Wi=(t,e)=>{let n=e.length;if(Ni(t))return Dn;const i=t.state,r=i.wrap;if(2===r||1===r&&i.status!==ti||i.lookahead)return Dn;if(1===r&&(t.adler=hn(t.adler,e,n,0)),i.wrap=0,n>=i.w_size){0===r&&(gi(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(n-i.w_size,n),0),e=t,n=i.w_size}const o=t.avail_in,a=t.next_in,s=t.input;t.avail_in=n,t.next_in=0,t.input=e,Ii(i);while(i.lookahead>=Kn){let t=i.strstart,e=i.lookahead-(Kn-1);do{i.ins_h=mi(i,i.ins_h,i.window[t+Kn-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=Kn-1,Ii(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Kn-1,i.match_available=0,t.next_in=a,t.input=s,t.avail_in=o,i.wrap=r,Tn};var Ui=Fi,Zi=Vi,Yi=zi,Xi=Ei,ji=Bi,qi=Gi,Ki=Hi,$i=Wi,Ji="pako deflate (from Nodeca project)",Qi={deflateInit:Ui,deflateInit2:Zi,deflateReset:Yi,deflateResetKeep:Xi,deflateSetHeader:ji,deflate:qi,deflateEnd:Ki,deflateSetDictionary:$i,deflateInfo:Ji};const tr=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var er=function(t){const e=Array.prototype.slice.call(arguments,1);while(e.length){const n=e.shift();if(n){if("object"!==typeof n)throw new TypeError(n+"must be non-object");for(const e in n)tr(n,e)&&(t[e]=n[e])}}return t},nr=t=>{let e=0;for(let i=0,r=t.length;i=252?6:wx>=248?5:wx>=240?4:wx>=224?3:wx>=192?2:1;or[254]=or[254]=1;var ar=t=>{if("function"===typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,i,r,o,a=t.length,s=0;for(r=0;r>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e};const sr=(t,e)=>{if(e<65534&&t.subarray&&rr)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let i=0;i{const n=e||t.length;if("function"===typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,r;const o=new Array(2*n);for(r=0,i=0;i4)o[r++]=65533,i+=a-1;else{e&=2===a?31:3===a?15:7;while(a>1&&i1?o[r++]=65533:e<65536?o[r++]=e:(e-=65536,o[r++]=55296|e>>10&1023,o[r++]=56320|1023&e)}}return sr(o,r)},ur=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;while(n>=0&&128===(192&t[n]))n--;return n<0||0===n?e:n+or[t[n]]>e?n:e},hr={string2buf:ar,buf2string:lr,utf8border:ur};function cr(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var dr=cr;const pr=Object.prototype.toString,{Z_NO_FLUSH:fr,Z_SYNC_FLUSH:gr,Z_FULL_FLUSH:vr,Z_FINISH:yr,Z_OK:mr,Z_STREAM_END:_r,Z_DEFAULT_COMPRESSION:xr,Z_DEFAULT_STRATEGY:br,Z_DEFLATED:wr}=vn;function Sr(t){this.options=ir.assign({level:xr,method:wr,chunkSize:16384,windowBits:15,memLevel:8,strategy:br},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dr,this.strm.avail_out=0;let n=Qi.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==mr)throw new Error(gn[n]);if(e.header&&Qi.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"===typeof e.dictionary?hr.string2buf(e.dictionary):"[object ArrayBuffer]"===pr.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=Qi.deflateSetDictionary(this.strm,t),n!==mr)throw new Error(gn[n]);this._dict_set=!0}}function Mr(t,e){const n=new Sr(e);if(n.push(t,!0),n.err)throw n.msg||gn[n.err];return n.result}function Ir(t,e){return e=e||{},e.raw=!0,Mr(t,e)}function Cr(t,e){return e=e||{},e.gzip=!0,Mr(t,e)}Sr.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize;let r,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?yr:fr,"string"===typeof t?n.input=hr.string2buf(t):"[object ArrayBuffer]"===pr.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(o===gr||o===vr)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=Qi.deflate(n,o),r===_r)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Qi.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===mr;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Sr.prototype.onData=function(t){this.chunks.push(t)},Sr.prototype.onEnd=function(t){t===mr&&(this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Tr=Sr,Ar=Mr,Dr=Ir,kr=Cr,Lr=vn,Pr={Deflate:Tr,deflate:Ar,deflateRaw:Dr,gzip:kr,constants:Lr};const Rr=16209,Or=16191;var Nr=function(t,e){let n,i,r,o,a,s,l,u,h,c,d,p,f,g,v,y,m,_,x,b,w,S,M,I;const C=t.state;n=t.next_in,M=t.input,i=n+(t.avail_in-5),r=t.next_out,I=t.output,o=r-(e-t.avail_out),a=r+(t.avail_out-257),s=C.dmax,l=C.wsize,u=C.whave,h=C.wnext,c=C.window,d=C.hold,p=C.bits,f=C.lencode,g=C.distcode,v=(1<>>24,d>>>=_,p-=_,_=m>>>16&255,0===_)I[r++]=65535&m;else{if(!(16&_)){if(0===(64&_)){m=f[(65535&m)+(d&(1<<_)-1)];continue e}if(32&_){C.mode=Or;break t}t.msg="invalid literal/length code",C.mode=Rr;break t}x=65535&m,_&=15,_&&(p<_&&(d+=M[n++]<>>=_,p-=_),p<15&&(d+=M[n++]<>>24,d>>>=_,p-=_,_=m>>>16&255,!(16&_)){if(0===(64&_)){m=g[(65535&m)+(d&(1<<_)-1)];continue n}t.msg="invalid distance code",C.mode=Rr;break t}if(b=65535&m,_&=15,p<_&&(d+=M[n++]<s){t.msg="invalid distance too far back",C.mode=Rr;break t}if(d>>>=_,p-=_,_=r-o,b>_){if(_=b-_,_>u&&C.sane){t.msg="invalid distance too far back",C.mode=Rr;break t}if(w=0,S=c,0===h){if(w+=l-_,_2)I[r++]=S[w++],I[r++]=S[w++],I[r++]=S[w++],x-=3;x&&(I[r++]=S[w++],x>1&&(I[r++]=S[w++]))}else{w=r-b;do{I[r++]=I[w++],I[r++]=I[w++],I[r++]=I[w++],x-=3}while(x>2);x&&(I[r++]=I[w++],x>1&&(I[r++]=I[w++]))}break}}break}}while(n>3,n-=x,p-=x<<3,d&=(1<{const l=s.bits;let u,h,c,d,p,f,g=0,v=0,y=0,m=0,_=0,x=0,b=0,w=0,S=0,M=0,I=null;const C=new Uint16Array(Er+1),T=new Uint16Array(Er+1);let A,D,k,L=null;for(g=0;g<=Er;g++)C[g]=0;for(v=0;v=1;m--)if(0!==C[m])break;if(_>m&&(_=m),0===m)return r[o++]=20971520,r[o++]=20971520,s.bits=1,0;for(y=1;y0&&(t===Vr||1!==m))return-1;for(T[1]=0,g=1;gzr||t===Gr&&S>Br)return 1;for(;;){A=g-b,a[v]+1=f?(D=L[a[v]-f],k=I[a[v]-f]):(D=96,k=0),u=1<>b)+h]=A<<24|D<<16|k|0}while(0!==h);u=1<>=1;if(0!==u?(M&=u-1,M+=u):M=0,v++,0===--C[g]){if(g===m)break;g=e[n+a[v]]}if(g>_&&(M&d)!==c){0===b&&(b=_),p+=y,x=g-b,w=1<zr||t===Gr&&S>Br)return 1;c=M&d,r[c]=_<<24|x<<16|p-o|0}}return 0!==M&&(r[p+M]=g-b<<24|64<<16|0),s.bits=_,0};var Xr=Yr;const jr=0,qr=1,Kr=2,{Z_FINISH:$r,Z_BLOCK:Jr,Z_TREES:Qr,Z_OK:to,Z_STREAM_END:eo,Z_NEED_DICT:no,Z_STREAM_ERROR:io,Z_DATA_ERROR:ro,Z_MEM_ERROR:oo,Z_BUF_ERROR:ao,Z_DEFLATED:so}=vn,lo=16180,uo=16181,ho=16182,co=16183,po=16184,fo=16185,go=16186,vo=16187,yo=16188,mo=16189,_o=16190,xo=16191,bo=16192,wo=16193,So=16194,Mo=16195,Io=16196,Co=16197,To=16198,Ao=16199,Do=16200,ko=16201,Lo=16202,Po=16203,Ro=16204,Oo=16205,No=16206,Eo=16207,zo=16208,Bo=16209,Vo=16210,Fo=16211,Go=852,Ho=592,Wo=15,Uo=Wo,Zo=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Yo(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Xo=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.modeFo?1:0},jo=t=>{if(Xo(t))return io;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=lo,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Go),e.distcode=e.distdyn=new Int32Array(Ho),e.sane=1,e.back=-1,to},qo=t=>{if(Xo(t))return io;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,jo(t)},Ko=(t,e)=>{let n;if(Xo(t))return io;const i=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?io:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,qo(t))},$o=(t,e)=>{if(!t)return io;const n=new Yo;t.state=n,n.strm=t,n.window=null,n.mode=lo;const i=Ko(t,e);return i!==to&&(t.state=null),i},Jo=t=>$o(t,Uo);let Qo,ta,ea=!0;const na=t=>{if(ea){Qo=new Int32Array(512),ta=new Int32Array(32);let e=0;while(e<144)t.lens[e++]=8;while(e<256)t.lens[e++]=9;while(e<280)t.lens[e++]=7;while(e<288)t.lens[e++]=8;Xr(qr,t.lens,0,288,Qo,0,t.work,{bits:9}),e=0;while(e<32)t.lens[e++]=5;Xr(Kr,t.lens,0,32,ta,0,t.work,{bits:5}),ea=!1}t.lencode=Qo,t.lenbits=9,t.distcode=ta,t.distbits=5},ia=(t,e,n,i)=>{let r;const o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(e.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>i&&(r=i),o.window.set(e.subarray(n-i,n-i+r),o.wnext),i-=r,i?(o.window.set(e.subarray(n-i,n),0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,i,r,o,a,s,l,u,h,c,d,p,f,g,v,y,m,_,x,b,w,S,M=0;const I=new Uint8Array(4);let C,T;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xo(t)||!t.output||!t.input&&0!==t.avail_in)return io;n=t.state,n.mode===xo&&(n.mode=bo),a=t.next_out,r=t.output,l=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,u=n.hold,h=n.bits,c=s,d=l,S=to;t:for(;;)switch(n.mode){case lo:if(0===n.wrap){n.mode=bo;break}while(h<16){if(0===s)break t;s--,u+=i[o++]<>>8&255,n.check=fn(n.check,I,2,0),u=0,h=0,n.mode=uo;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=Bo;break}if((15&u)!==so){t.msg="unknown compression method",n.mode=Bo;break}if(u>>>=4,h-=4,w=8+(15&u),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){t.msg="invalid window size",n.mode=Bo;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(I[0]=255&u,I[1]=u>>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0,n.mode=ho;case ho:while(h<32){if(0===s)break t;s--,u+=i[o++]<>>8&255,I[2]=u>>>16&255,I[3]=u>>>24&255,n.check=fn(n.check,I,4,0)),u=0,h=0,n.mode=co;case co:while(h<16){if(0===s)break t;s--,u+=i[o++]<>8),512&n.flags&&4&n.wrap&&(I[0]=255&u,I[1]=u>>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0,n.mode=po;case po:if(1024&n.flags){while(h<16){if(0===s)break t;s--,u+=i[o++]<>>8&255,n.check=fn(n.check,I,2,0)),u=0,h=0}else n.head&&(n.head.extra=null);n.mode=fo;case fo:if(1024&n.flags&&(p=n.length,p>s&&(p=s),p&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(o,o+p),w)),512&n.flags&&4&n.wrap&&(n.check=fn(n.check,i,p,o)),s-=p,o+=p,n.length-=p),n.length))break t;n.length=0,n.mode=go;case go:if(2048&n.flags){if(0===s)break t;p=0;do{w=i[o+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&p>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=xo;break;case mo:while(h<32){if(0===s)break t;s--,u+=i[o++]<>>=7&h,h-=7&h,n.mode=No;break}while(h<3){if(0===s)break t;s--,u+=i[o++]<>>=1,h-=1,3&u){case 0:n.mode=wo;break;case 1:if(na(n),n.mode=Ao,e===Qr){u>>>=2,h-=2;break t}break;case 2:n.mode=Io;break;case 3:t.msg="invalid block type",n.mode=Bo}u>>>=2,h-=2;break;case wo:u>>>=7&h,h-=7&h;while(h<32){if(0===s)break t;s--,u+=i[o++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=Bo;break}if(n.length=65535&u,u=0,h=0,n.mode=So,e===Qr)break t;case So:n.mode=Mo;case Mo:if(p=n.length,p){if(p>s&&(p=s),p>l&&(p=l),0===p)break t;r.set(i.subarray(o,o+p),a),s-=p,o+=p,l-=p,a+=p,n.length-=p;break}n.mode=xo;break;case Io:while(h<14){if(0===s)break t;s--,u+=i[o++]<>>=5,h-=5,n.ndist=1+(31&u),u>>>=5,h-=5,n.ncode=4+(15&u),u>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Bo;break}n.have=0,n.mode=Co;case Co:while(n.have>>=3,h-=3}while(n.have<19)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},S=Xr(jr,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,S){t.msg="invalid code lengths set",n.mode=Bo;break}n.have=0,n.mode=To;case To:while(n.have>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=v,h-=v,n.lens[n.have++]=m;else{if(16===m){T=v+2;while(h>>=v,h-=v,0===n.have){t.msg="invalid bit length repeat",n.mode=Bo;break}w=n.lens[n.have-1],p=3+(3&u),u>>>=2,h-=2}else if(17===m){T=v+3;while(h>>=v,h-=v,w=0,p=3+(7&u),u>>>=3,h-=3}else{T=v+7;while(h>>=v,h-=v,w=0,p=11+(127&u),u>>>=7,h-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Bo;break}while(p--)n.lens[n.have++]=w}}if(n.mode===Bo)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=Bo;break}if(n.lenbits=9,C={bits:n.lenbits},S=Xr(qr,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,S){t.msg="invalid literal/lengths set",n.mode=Bo;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},S=Xr(Kr,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,S){t.msg="invalid distances set",n.mode=Bo;break}if(n.mode=Ao,e===Qr)break t;case Ao:n.mode=Do;case Do:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,n.hold=u,n.bits=h,Nr(t,d),a=t.next_out,r=t.output,l=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,u=n.hold,h=n.bits,n.mode===xo&&(n.back=-1);break}for(n.back=0;;){if(M=n.lencode[u&(1<>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>_)],v=M>>>24,y=M>>>16&255,m=65535&M,_+v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=_,h-=_,n.back+=_}if(u>>>=v,h-=v,n.back+=v,n.length=m,0===y){n.mode=Oo;break}if(32&y){n.back=-1,n.mode=xo;break}if(64&y){t.msg="invalid literal/length code",n.mode=Bo;break}n.extra=15&y,n.mode=ko;case ko:if(n.extra){T=n.extra;while(h>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Lo;case Lo:for(;;){if(M=n.distcode[u&(1<>>24,y=M>>>16&255,m=65535&M,v<=h)break;if(0===s)break t;s--,u+=i[o++]<>_)],v=M>>>24,y=M>>>16&255,m=65535&M,_+v<=h)break;if(0===s)break t;s--,u+=i[o++]<>>=_,h-=_,n.back+=_}if(u>>>=v,h-=v,n.back+=v,64&y){t.msg="invalid distance code",n.mode=Bo;break}n.offset=m,n.extra=15&y,n.mode=Po;case Po:if(n.extra){T=n.extra;while(h>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Bo;break}n.mode=Ro;case Ro:if(0===l)break t;if(p=d-l,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Bo;break}p>n.wnext?(p-=n.wnext,f=n.wsize-p):f=n.wnext-p,p>n.length&&(p=n.length),g=n.window}else g=r,f=a-n.offset,p=n.length;p>l&&(p=l),l-=p,n.length-=p;do{r[a++]=g[f++]}while(--p);0===n.length&&(n.mode=Do);break;case Oo:if(0===l)break t;r[a++]=n.length,l--,n.mode=Do;break;case No:if(n.wrap){while(h<32){if(0===s)break t;s--,u|=i[o++]<{if(Xo(t))return io;let e=t.state;return e.window&&(e.window=null),t.state=null,to},aa=(t,e)=>{if(Xo(t))return io;const n=t.state;return 0===(2&n.wrap)?io:(n.head=e,e.done=!1,to)},sa=(t,e)=>{const n=e.length;let i,r,o;return Xo(t)?io:(i=t.state,0!==i.wrap&&i.mode!==_o?io:i.mode===_o&&(r=1,r=hn(r,e,n,0),r!==i.check)?ro:(o=ia(t,e,n,n),o?(i.mode=Vo,oo):(i.havedict=1,to)))};var la=qo,ua=Ko,ha=jo,ca=Jo,da=$o,pa=ra,fa=oa,ga=aa,va=sa,ya="pako inflate (from Nodeca project)",ma={inflateReset:la,inflateReset2:ua,inflateResetKeep:ha,inflateInit:ca,inflateInit2:da,inflate:pa,inflateEnd:fa,inflateGetHeader:ga,inflateSetDictionary:va,inflateInfo:ya};function _a(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var xa=_a;const ba=Object.prototype.toString,{Z_NO_FLUSH:wa,Z_FINISH:Sa,Z_OK:Ma,Z_STREAM_END:Ia,Z_NEED_DICT:Ca,Z_STREAM_ERROR:Ta,Z_DATA_ERROR:Aa,Z_MEM_ERROR:Da}=vn;function ka(t){this.options=ir.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dr,this.strm.avail_out=0;let n=ma.inflateInit2(this.strm,e.windowBits);if(n!==Ma)throw new Error(gn[n]);if(this.header=new xa,ma.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"===typeof e.dictionary?e.dictionary=hr.string2buf(e.dictionary):"[object ArrayBuffer]"===ba.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=ma.inflateSetDictionary(this.strm,e.dictionary),n!==Ma)))throw new Error(gn[n])}function La(t,e){const n=new ka(e);if(n.push(t),n.err)throw n.msg||gn[n.err];return n.result}function Pa(t,e){return e=e||{},e.raw=!0,La(t,e)}ka.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=e===~~e?e:!0===e?Sa:wa,"[object ArrayBuffer]"===ba.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),o=ma.inflate(n,a),o===Ca&&r&&(o=ma.inflateSetDictionary(n,r),o===Ma?o=ma.inflate(n,a):o===Aa&&(o=Ca));while(n.avail_in>0&&o===Ia&&n.state.wrap>0&&0!==t[n.next_in])ma.inflateReset(n),o=ma.inflate(n,a);switch(o){case Ta:case Aa:case Ca:case Da:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||o===Ia))if("string"===this.options.to){let t=hr.utf8border(n.output,n.next_out),e=n.next_out-t,r=hr.buf2string(n.output,t);n.next_out=e,n.avail_out=i-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==Ma||0!==s){if(o===Ia)return o=ma.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ka.prototype.onData=function(t){this.chunks.push(t)},ka.prototype.onEnd=function(t){t===Ma&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ir.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ra=ka,Oa=La,Na=Pa,Ea=La,za=vn,Ba={Inflate:Ra,inflate:Oa,inflateRaw:Na,ungzip:Ea,constants:za};const{Deflate:Va,deflate:Fa,deflateRaw:Ga,gzip:Ha}=Pr,{Inflate:Wa,inflate:Ua,inflateRaw:Za,ungzip:Ya}=Ba;var Xa=Ua,ja=function(t,e){return ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},ja(t,e)};function qa(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}ja(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;Object.create;var Ka=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),$a=function(){function t(){this.browser=new Ka,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!==typeof window}return t}(),Ja=new $a;function Qa(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!==typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!==typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}"object"===typeof wx&&"function"===typeof wx.getSystemInfoSync?(Ja.wxa=!0,Ja.touchEventsSupported=!0):"undefined"===typeof document&&"undefined"!==typeof self?Ja.worker=!0:"undefined"===typeof navigator?(Ja.node=!0,Ja.svgSupported=!0):Qa(navigator.userAgent,Ja);const ts=Ja;var es=12,ns="sans-serif",is=es+"px "+ns,rs=20,os=100,as="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function ss(t){var e={};if("undefined"===typeof JSON)return e;for(var n=0;n=0)s=a*n.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}function tu(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&o&&d===o[c]&&p===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?jl(s,a):jl(a,s))}function eu(t){return"CANVAS"===t.nodeName.toUpperCase()}var nu=/([&<>"'])/g,iu={"&":"&","<":"<",">":">",'"':""","'":"'"};function ru(t){return null==t?"":(t+"").replace(nu,(function(t,e){return iu[e]}))}var ou=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,au=[],su=ts.browser.firefox&&+ts.browser.version.split(".")[0]<39;function lu(t,e,n,i){return n=n||{},i?uu(t,e,n):su&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):uu(t,e,n),n}function uu(t,e,n){if(ts.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(eu(t)){var o=t.getBoundingClientRect();return n.zrX=i-o.left,void(n.zrY=r-o.top)}if(Jl(au,t,i,r))return n.zrX=au[0],void(n.zrY=au[1])}n.zrX=n.zrY=0}function hu(t){return t||window.event}function cu(t,e,n){if(e=hu(e),null!=e.zrX)return e;var i=e.type,r=i&&i.indexOf("touch")>=0;if(r){var o="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];o&&lu(t,o,e,n)}else{lu(t,e,e,n);var a=du(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return null==e.which&&void 0!==s&&ou.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function du(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;if(null==n||null==i)return e;var r=0!==i?Math.abs(i):Math.abs(n),o=i>0?-1:i<0?1:n>0?-1:1;return 3*r*o}function pu(t,e,n,i){t.addEventListener(e,n,i)}function fu(t,e,n,i){t.removeEventListener(e,n,i)}var gu=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function vu(t){return 2===t.which||3===t.which}var yu=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o1&&i&&i.length>1){var o=mu(i)/mu(r);!isFinite(o)&&(o=1),e.pinchScale=o;var a=_u(i);return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}};function bu(){return[1,0,0,1,0,0]}function wu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Su(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}function Mu(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function Iu(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Cu(t,e,n){var i=e[0],r=e[2],o=e[4],a=e[1],s=e[3],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=i*h+a*u,t[1]=-i*u+a*h,t[2]=r*h+s*u,t[3]=-r*u+h*s,t[4]=h*o+u*l,t[5]=h*l-u*o,t}function Tu(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Au(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function Du(t){var e=bu();return Su(e,t),e}var ku=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}();const Lu=ku;var Pu=Math.min,Ru=Math.max,Ou=new Lu,Nu=new Lu,Eu=new Lu,zu=new Lu,Bu=new Lu,Vu=new Lu,Fu=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=Pu(t.x,this.x),n=Pu(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ru(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ru(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=bu();return Iu(r,r,[-e.x,-e.y]),Tu(r,r,[n,i]),Iu(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,u=e.x+e.width,h=e.y,c=e.y+e.height,d=!(of&&(f=_,gf&&(f=x,y=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}Ou.x=Eu.x=n.x,Ou.y=zu.y=n.y,Nu.x=zu.x=n.x+n.width,Nu.y=Eu.y=n.y+n.height,Ou.transform(i),zu.transform(i),Nu.transform(i),Eu.transform(i),e.x=Pu(Ou.x,Nu.x,Eu.x,zu.x),e.y=Pu(Ou.y,Nu.y,Eu.y,zu.y);var l=Ru(Ou.x,Nu.x,Eu.x,zu.x),u=Ru(Ou.y,Nu.y,Eu.y,zu.y);e.width=l-e.x,e.height=u-e.y}else e!==n&&t.copy(e,n)},t}();const Gu=Fu;var Hu="silent";function Wu(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Uu}}function Uu(){gu(this.event)}var Zu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return qa(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Zl),Yu=function(){function t(t,e){this.x=t,this.y=e}return t}(),Xu=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ju=new Gu(0,0,0,0),qu=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new Yu(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new Zu,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Wl(a),a}return qa(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(Rs(Xu,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=Ju(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(r=this.findHover(r.x,r.y),o=r.target);var a=this._hovered=i?new Yu(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Yu(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){t=t||{};var i=t.target;if(!i||!i.silent){var r="on"+e,o=Wu(e,t,n);while(i)if(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,o.cancelBubble)break;o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"===typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new Yu(t,e);if($u(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Gu(t-s,e-s,a,a),u=i.length-1;u>=0;u--){var h=i[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(ju.copy(h.getBoundingRect()),h.transform&&ju.applyTransform(h.transform),ju.intersect(l)&&o.push(h))}if(o.length)for(var c=4,d=Math.PI/12,p=2*Math.PI,f=0;f=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=Ku(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==Hu)){e.target=a;break}}}function Ju(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}Rs(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){qu.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=Ju(this,r,o);if("mouseup"===t&&a||(n=this.findHover(r,o),i=n.target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Ol(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));const Qu=qu;var th=32,eh=7;function nh(t){var e=0;while(t>=th)e|=1&t,t>>=1;return t+e}function ih(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){while(r=0)r++;return r-e}function rh(t,e,n){n--;while(e>>1,r(a,t[o])<0?l=o:s=o+1;var u=i-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:while(u>0)t[s+u]=t[s+u-1],u--}t[s]=a}}function ah(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){s=i-r;while(l0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{s=r+1;while(ls&&(l=s);var u=a;a=r-l,l=r-u}a++;while(a>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function sh(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){s=r+1;while(ls&&(l=s);var u=a;a=r-l,l=r-u}else{s=i-r;while(l=0)a=l,l=1+(l<<1),l<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}a++;while(a>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function lh(t,e){var n,i,r=eh,o=0,a=0;o=t.length;var s=[];function l(t,e){n[a]=t,i[a]=e,a+=1}function u(){while(a>1){var t=a-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;c(t)}}function h(){while(a>1){var t=a-2;t>0&&i[t-1]=eh||p>=eh);if(f)break;g<0&&(g=0),g+=2}if(r=g,r<1&&(r=1),1===i){for(l=0;l=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[c--]=s[h--],1===--a){y=!0;break}if(v=a-ah(t[u],s,0,a,a-1,e),0!==v){for(c-=v,h-=v,a-=v,p=c+1,d=h+1,l=0;l=eh||v>=eh);if(y)break;f<0&&(f=0),f+=2}if(r=f,r<1&&(r=1),1===a){for(c-=i,u-=i,p=c+1,d=u+1,l=i-1;l>=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else{if(0===a)throw new Error;for(d=c-(a-1),l=0;l=0;l--)t[p+l]=t[d+l];t[c]=s[h]}else for(d=c-(a-1),l=0;ls&&(l=s),oh(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}var hh=1,ch=2,dh=4,ph=!1;function fh(){ph||(ph=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function gh(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var vh=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=gh}return t.prototype.traverse=function(t,e){for(var n=0;n0&&(u.__clipPaths=[]),isNaN(u.z)&&(fh(),u.z=0),isNaN(u.z2)&&(fh(),u.z2=0),isNaN(u.zlevel)&&(fh(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var h=t.getDecalElement&&t.getDecalElement();h&&this._updateAndAddDisplayable(h,e,n);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,n);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const yh=vh;var mh;mh=ts.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};const _h=mh;var xh={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},elasticOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=i/4):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-xh.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*xh.bounceIn(2*t):.5*xh.bounceOut(2*t-1)+.5}};const bh=xh;var wh=Math.pow,Sh=Math.sqrt,Mh=1e-8,Ih=1e-4,Ch=Sh(3),Th=1/3,Ah=wl(),Dh=wl(),kh=wl();function Lh(t){return t>-Mh&&tMh||t<-Mh}function Rh(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function Oh(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function Nh(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Lh(h)&&Lh(c))if(Lh(s))o[0]=0;else{var f=-l/s;f>=0&&f<=1&&(o[p++]=f)}else{var g=c*c-4*h*d;if(Lh(g)){var v=c/h,y=(f=-s/a+v,-v/2);f>=0&&f<=1&&(o[p++]=f),y>=0&&y<=1&&(o[p++]=y)}else if(g>0){var m=Sh(g),_=h*s+1.5*a*(-c+m),x=h*s+1.5*a*(-c-m);_=_<0?-wh(-_,Th):wh(_,Th),x=x<0?-wh(-x,Th):wh(x,Th);f=(-s-(_+x))/(3*a);f>=0&&f<=1&&(o[p++]=f)}else{var b=(2*h*s-3*a*c)/(2*Sh(h*h*h)),w=Math.acos(b)/3,S=Sh(h),M=Math.cos(w),I=(f=(-s-2*S*M)/(3*a),y=(-s+S*(M+Ch*Math.sin(w)))/(3*a),(-s+S*(M-Ch*Math.sin(w)))/(3*a));f>=0&&f<=1&&(o[p++]=f),y>=0&&y<=1&&(o[p++]=y),I>=0&&I<=1&&(o[p++]=I)}}return p}function Eh(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Lh(a)){if(Ph(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var h=o*o-4*a*s;if(Lh(h))r[0]=-o/(2*a);else if(h>0){var c=Sh(h),d=(u=(-o+c)/(2*a),(-o-c)/(2*a));u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function zh(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,u=(s-a)*r+a,h=(l-s)*r+s,c=(h-u)*r+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=i}function Bh(t,e,n,i,r,o,a,s,l,u,h){var c,d,p,f,g,v=.005,y=1/0;Ah[0]=l,Ah[1]=u;for(var m=0;m<1;m+=.05)Dh[0]=Rh(t,n,r,a,m),Dh[1]=Rh(e,i,o,s,m),f=El(Ah,Dh),f=0&&f=0&&u<=1&&(r[l++]=u)}}else{var h=a*a-4*o*s;if(Lh(h)){u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(h>0){var c=Sh(h),d=(u=(-a+c)/(2*o),(-a-c)/(2*o));u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function Wh(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function Uh(t,e,n,i,r){var o=(e-t)*i+t,a=(n-e)*i+e,s=(a-o)*i+o;r[0]=t,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}function Zh(t,e,n,i,r,o,a,s,l){var u,h=.005,c=1/0;Ah[0]=a,Ah[1]=s;for(var d=0;d<1;d+=.05){Dh[0]=Fh(t,n,r,d),Dh[1]=Fh(e,i,o,d);var p=El(Ah,Dh);p=0&&p=1?1:Nh(0,i,o,1,t,s)&&Rh(0,r,a,1,s[0])}}}var qh=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||xl,this.ondestroy=t.ondestroy||xl,this.onrestart=t.onrestart||xl,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Ws(t)?t:bh[t]||jh(t)},t}();const Kh=qh;var $h=function(){function t(t){this.value=t}return t}(),Jh=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new $h(t);return this.insertEntry(e),e},t.prototype.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++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Qh=function(){function t(t){this._list=new Jh,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new $h(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const tc=Qh;var ec={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 nc(t){return t=Math.round(t),t<0?0:t>255?255:t}function ic(t){return t=Math.round(t),t<0?0:t>360?360:t}function rc(t){return t<0?0:t>1?1:t}function oc(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?nc(parseFloat(e)/100*255):nc(parseInt(e,10))}function ac(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?rc(parseFloat(e)/100):rc(parseFloat(e))}function sc(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function lc(t,e,n){return t+(e-t)*n}function uc(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function hc(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var cc=new tc(20),dc=null;function pc(t,e){dc&&hc(dc,e),dc=cc.put(t,dc||e.slice())}function fc(t,e){if(t){e=e||[];var n=cc.get(t);if(n)return hc(e,n);t+="";var i=t.replace(/ /g,"").toLowerCase();if(i in ec)return hc(e,ec[i]),pc(t,e),e;var r=i.length;if("#"!==i.charAt(0)){var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===r){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return 3===l.length?uc(e,+l[0],+l[1],+l[2],1):uc(e,0,0,0,1);u=ac(l.pop());case"rgb":return l.length>=3?(uc(e,oc(l[0]),oc(l[1]),oc(l[2]),3===l.length?u:ac(l[3])),pc(t,e),e):void uc(e,0,0,0,1);case"hsla":return 4!==l.length?void uc(e,0,0,0,1):(l[3]=ac(l[3]),gc(l,e),pc(t,e),e);case"hsl":return 3!==l.length?void uc(e,0,0,0,1):(gc(l,e),pc(t,e),e);default:return}}uc(e,0,0,0,1)}else{if(4===r||5===r){var h=parseInt(i.slice(1,4),16);return h>=0&&h<=4095?(uc(e,(3840&h)>>4|(3840&h)>>8,240&h|(240&h)>>4,15&h|(15&h)<<4,5===r?parseInt(i.slice(4),16)/15:1),pc(t,e),e):void uc(e,0,0,0,1)}if(7===r||9===r){h=parseInt(i.slice(1,7),16);return h>=0&&h<=16777215?(uc(e,(16711680&h)>>16,(65280&h)>>8,255&h,9===r?parseInt(i.slice(7),16)/255:1),pc(t,e),e):void uc(e,0,0,0,1)}}}}function gc(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=ac(t[1]),r=ac(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return e=e||[],uc(e,nc(255*sc(a,o,n+1/3)),nc(255*sc(a,o,n)),nc(255*sc(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function vc(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-i)/6+l/2)/l,c=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-c:r===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}function yc(t,e){var n=fc(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return wc(n,4===n.length?"rgba":"rgb")}}function mc(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=nc(lc(a[0],s[0],l)),n[1]=nc(lc(a[1],s[1],l)),n[2]=nc(lc(a[2],s[2],l)),n[3]=rc(lc(a[3],s[3],l)),n}}function _c(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=fc(e[r]),s=fc(e[o]),l=i-r,u=wc([nc(lc(a[0],s[0],l)),nc(lc(a[1],s[1],l)),nc(lc(a[2],s[2],l)),rc(lc(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:r,rightIndex:o,value:i}:u}}function xc(t,e,n,i){var r=fc(t);if(t)return r=vc(r),null!=e&&(r[0]=ic(e)),null!=n&&(r[1]=ac(n)),null!=i&&(r[2]=ac(i)),wc(gc(r),"rgba")}function bc(t,e){var n=fc(t);if(n&&null!=e)return n[3]=rc(e),wc(n,"rgba")}function wc(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Sc(t,e){var n=fc(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var Mc=Math.round;function Ic(t){var e;if(t&&"transparent"!==t){if("string"===typeof t&&t.indexOf("rgba")>-1){var n=fc(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var Cc=1e-4;function Tc(t){return t-Cc}function Ac(t){return Mc(1e3*t)/1e3}function Dc(t){return Mc(1e4*t)/1e4}function kc(t){return"matrix("+Ac(t[0])+","+Ac(t[1])+","+Ac(t[2])+","+Ac(t[3])+","+Dc(t[4])+","+Dc(t[5])+")"}var Lc={left:"start",right:"end",center:"middle",middle:"middle"};function Pc(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}function Rc(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function Oc(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}function Nc(t){return t&&!!t.image}function Ec(t){return t&&!!t.svgElement}function zc(t){return Nc(t)||Ec(t)}function Bc(t){return"linear"===t.type}function Vc(t){return"radial"===t.type}function Fc(t){return t&&("linear"===t.type||"radial"===t.type)}function Gc(t){return"url(#"+t+")"}function Hc(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Wc(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*bl,r=nl(t.scaleX,1),o=nl(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+Mc(a*bl)+"deg, "+Mc(s*bl)+"deg)"),l.join(" ")}var Uc=function(){return ts.hasGlobalWindow&&Ws(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!==typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}}(),Zc=Array.prototype.slice;function Yc(t,e,n){return(e-t)*n+t}function Xc(t,e,n,i){for(var r=e.length,o=0;oi?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;sa;if(s)i.length=a;else for(var l=o;l=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=ld,s=e;if(Ps(e)){var l=ed(e);a=l,(1===l&&!Ys(e[0])||2===l&&!Ys(e[0][0]))&&(o=!0)}else if(Ys(e)&&!tl(e))a=nd;else if(Us(e))if(isNaN(+e)){var u=fc(e);u&&(s=u,a=od)}else a=nd;else if($s(e)){var h=Ts({},s);h.colorStops=Os(e.colorStops,(function(t){return{offset:t.offset,color:fc(t.color)}})),Bc(e)?a=ad:Vc(e)&&(a=sd),s=h}0===r?this.valType=a:a===this.valType&&a!==ld||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=Ws(n)?n:bh[n]||jh(n)),i.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=hd(i),l=ud(i),u=0;u=0;n--)if(l[n].percent<=e)break;n=p(n,u-2)}else{for(n=d;ne)break;n=p(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var g=r.percent-i.percent,v=0===g?1:p((e-i.percent)/g,1);r.easingFunc&&(v=r.easingFunc(v));var y=o?this._additiveValue:c?cd:t[h];if(!hd(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[h]=v<1?i.rawValue:r.rawValue;else if(hd(s))s===id?Xc(y,i[a],r[a],v):jc(y,i[a],r[a],v);else if(ud(s)){var m=i[a],_=r[a],x=s===ad;t[h]={type:x?"linear":"radial",x:Yc(m.x,_.x,v),y:Yc(m.y,_.y,v),colorStops:Os(m.colorStops,(function(t,e){var n=_.colorStops[e];return{offset:Yc(t.offset,n.offset,v),color:td(Xc([],t.color,n.color,v))}})),global:_.global},x?(t[h].x2=Yc(m.x2,_.x2,v),t[h].y2=Yc(m.y2,_.y2,v)):t[h].r=Yc(m.r,_.r,v)}else if(c)Xc(y,i[a],r[a],v),o||(t[h]=td(y));else{var b=Yc(i[a],r[a],v);o?this._additiveValue=b:t[h]=b}o&&this._addToTarget(t)}}},t.prototype._addToTarget=function(t){var e=this.valType,n=this.propName,i=this._additiveValue;e===nd?t[n]=t[n]+i:e===od?(fc(t[n],cd),qc(cd,cd,i,1),t[n]=td(cd)):e===id?qc(t[n],t[n],i,1):e===rd&&Kc(t[n],t[n],i,1)},t}(),pd=function(){function t(t,e,n,i){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&i?Ss("Can' use additive animation on looped animation."):(this._additiveAnimators=i,this._allowDiscrete=n)}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e,n){return this.whenWithKeys(t,e,Bs(e),n)},t.prototype.whenWithKeys=function(t,e,n,i){for(var r=this._tracks,o=0;o0&&s.addKeyframe(0,Qc(l),i),this._trackKeys.push(a)}s.addKeyframe(t,Qc(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();const fd=pd;function gd(){return(new Date).getTime()}var vd=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return qa(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){var e=gd()-this._pausedTime,n=e-this._time,i=this._head;while(i){var r=i.next,o=i.step(e,n);o?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;function e(){t._running&&(_h(e),!t._paused&&t.update())}this._running=!0,_h(e)},e.prototype.start=function(){this._running||(this._time=gd(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=gd(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=gd()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){var t=this._head;while(t){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new fd(t,e.loop);return this.addAnimator(n),n},e}(Zl);const yd=vd;var md=300,_d=ts.domSupported,xd=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=Os(t,(function(t){var e=t.replace("mouse","pointer");return n.hasOwnProperty(e)?e:t}));return{mouse:t,touch:e,pointer:i}}(),bd={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},wd=!1;function Sd(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Md(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}function Id(t){t&&(t.zrByTouch=!0)}function Cd(t,e){return cu(t.dom,new Ad(t,e),!0)}function Td(t,e){var n=e,i=!1;while(n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot))n=n.parentNode;return i}var Ad=function(){function t(t,e){this.stopPropagation=xl,this.stopImmediatePropagation=xl,this.preventDefault=xl,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return t}(),Dd={mousedown:function(t){t=cu(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=cu(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=cu(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=cu(this.dom,t);var e=t.toElement||t.relatedTarget;Td(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){wd=!0,t=cu(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){wd||(t=cu(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=cu(this.dom,t),Id(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Dd.mousemove.call(this,t),Dd.mousedown.call(this,t)},touchmove:function(t){t=cu(this.dom,t),Id(t),this.handler.processGesture(t,"change"),Dd.mousemove.call(this,t)},touchend:function(t){t=cu(this.dom,t),Id(t),this.handler.processGesture(t,"end"),Dd.mouseup.call(this,t),+new Date-+this.__lastTouchMomentZd||t<-Zd}var Xd=[],jd=[],qd=bu(),Kd=Math.abs,$d=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Yd(this.rotation)||Yd(this.x)||Yd(this.y)||Yd(this.scaleX-1)||Yd(this.scaleY-1)||Yd(this.skewX)||Yd(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||bu(),e?this.getLocalTransform(n):Ud(n),t&&(e?Mu(n,t,n):Su(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(Ud(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Xd);var n=Xd[0]<0?-1:1,i=Xd[1]<0?-1:1,r=((Xd[0]-n)*e+n)/Xd[0]||0,o=((Xd[1]-i)*e+i)/Xd[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||bu(),Au(this.invTransform,t)},t.prototype.getComputedTransform=function(){var t=this,e=[];while(t)e.push(t),t=t.parent;while(t=e.pop())t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Mu(jd,t.invTransform,e),e=jd);var n=this.originX,i=this.originY;(n||i)&&(qd[4]=n,qd[5]=i,Mu(jd,e,qd),jd[4]-=n,jd[5]-=i,e=jd),this.setLocalTransform(e)}},t.prototype.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)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&Bl(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&Bl(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&Kd(t[0]-1)>1e-10&&Kd(t[3]-1)>1e-10?Math.sqrt(Kd(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Qd(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*r-c*f*o,e[5]=-f*o-d*p*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=d*r,e[2]=c*o,l&&Cu(e,e,l),e[4]+=n+u,e[5]+=i+h,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),Jd=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Qd(t,e){for(var n=0;n=0?parseFloat(t)/100*e:parseFloat(t):t}function up(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(i instanceof Array)l+=lp(i[0],n.width),u+=lp(i[1],n.height),h=null,c=null;else switch(i){case"left":l-=r,u+=s,h="right",c="middle";break;case"right":l+=r+a,u+=s,c="middle";break;case"top":l+=a/2,u-=r,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+r,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=r,u+=s,c="middle";break;case"insideRight":l+=a-r,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=r,h="center";break;case"insideBottom":l+=a/2,u+=o-r,h="center",c="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,h="right";break;case"insideBottomLeft":l+=r,u+=o-r,c="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,h="right",c="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var hp="__zr_normal__",cp=Jd.concat(["ignore"]),dp=Ns(Jd,(function(t,e){return t[e]=!0,t}),{ignore:!1}),pp={},fp=new Gu(0,0,0,0),gp=function(){function t(t){this.id=ws(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var u=fp;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),i||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(pp,n,u):up(pp,n,u),r.x=pp.x,r.y=pp.y,o=pp.align,a=pp.verticalAlign;var h=n.origin;if(h&&null!=n.rotation){var c=void 0,d=void 0;"center"===h?(c=.5*u.width,d=.5*u.height):(c=lp(h[0],u.width),d=lp(h[1],u.height)),l=!0,r.originX=-r.x+c+(i?0:u.x),r.originY=-r.y+d+(i?0:u.y)}}null!=n.rotation&&(r.rotation=n.rotation);var p=n.offset;p&&(r.x+=p[0],r.y+=p[1],l||(r.originX=-p[0],r.originY=-p[1]));var f=null==n.inside?"string"===typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,m=void 0;f&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,null!=v&&"auto"!==v||(v=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(v),m=!0)):(v=n.outsideFill,y=n.outsideStroke,null!=v&&"auto"!==v||(v=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(v),m=!0)),v=v||"#000",v===g.fill&&y===g.stroke&&m===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=v,g.stroke=y,g.autoStroke=m,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=hh,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Hd:Gd},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"===typeof e&&fc(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,wc(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},Ts(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"===typeof t)this.attrKV(t,e);else if(Xs(t))for(var n=t,i=Bs(n),r=0;r0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(hp,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===hp,o=this.hasState();if(o||!r){var a=this.currentStates,s=this.stateTransition;if(!(Ds(a,t)>=0)||!e&&1!==a.length){var l;if(this.stateProxy&&!r&&(l=this.stateProxy(t)),l||(l=this.states&&this.states[t]),l||r){r||this.saveCurrentToNormalState(l);var u=!!(l&&l.hoverLayer||i);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,l,this._normalState,e,!n&&!this.__inHover&&s&&s.duration>0,s);var h=this._textContent,c=this._textGuide;return h&&h.useState(t,e,n,u),c&&c.useState(t,e,n,u),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hh),l}Ss("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,c),g&&g.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~hh)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=Ds(i,t),o=Ds(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i=0&&e.splice(n,1)})),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o0&&n.during&&o[0].during((function(t,e){n.during(e)}));for(var d=0;d0||r.force&&!a.length){var M=void 0,I=void 0,C=void 0;if(s){I={},d&&(M={});for(x=0;x<_;x++){y=g[x];I[y]=n[y],d?M[y]=i[y]:n[y]=i[y]}}else if(d){C={};for(x=0;x<_;x++){y=g[x];C[y]=Qc(n[y]),_p(n,i,y)}}b=new fd(n,!1,!1,c?Es(f,(function(t){return t.targetName===e})):null);b.targetName=e,r.scope&&(b.scope=r.scope),d&&M&&b.whenWithKeys(0,M,g),C&&b.whenWithKeys(0,C,g),b.whenWithKeys(null==u?500:u,s?I:i,g).delay(h||0),t.addAnimator(b,e),a.push(b)}}Ls(gp,Zl),Ls(gp,tp);const Sp=gp;var Mp=function(t){function e(e){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(e),n}return qa(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,n=0;n=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=Ds(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=Ds(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*u+a}function zp(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return Us(t)?Np(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Bp(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),Op),t=(+t).toFixed(e),n?t:+t}function Vp(t){return t.sort((function(t,e){return t-e})),t}function Fp(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return Gp(t)}function Gp(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Hp(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Wp(t,e){var n=Ns(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===n)return[];var i=Math.pow(10,e),r=Os(t,(function(t){return(isNaN(t)?0:t)/n*i*100})),o=100*i,a=Os(r,(function(t){return Math.floor(t)})),s=Ns(a,(function(t,e){return t+e}),0),l=Os(r,(function(t,e){return t-a[e]}));while(su&&(u=l[c],h=c);++a[h],l[h]=0,++s}return Os(a,(function(t){return t/i}))}function Up(t,e){var n=Math.max(Fp(t),Fp(e)),i=t+e;return n>Op?i:Bp(i,n)}var Zp=9007199254740991;function Yp(t){var e=2*Math.PI;return(t%e+e)%e}function Xp(t){return t>-Rp&&t=10&&e++,e}function Jp(t,e){var n,i=$p(t),r=Math.pow(10,i),o=t/r;return n=e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10,t=n*r,i>=-20?+t.toFixed(i<0?-i:0):t}function Qp(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function tf(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0||r&&Ds(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var og=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],ag=rg(og),sg=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ag(this,t,e)},t}(),lg=new tc(50);function ug(t){if("string"===typeof t){var e=lg.get(t);return e&&e.image}return t}function hg(t,e,n,i,r){if(t){if("string"===typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=lg.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?(e=o.image,!dg(e)&&o.pending.push(a)):(e=us.loadImage(t,cg,cg),e.__zrImageSrc=t,lg.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function cg(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=np(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function vg(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var o=np(t,i);if(o<=n)return t;for(var a=0;;a++){if(o<=r||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?yg(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;t=t.substr(0,s),o=np(t,i)}return""===t&&(t=e.placeholder),t}function yg(t,e,n,i){for(var r=0,o=0,a=t.length;op&&h){var f=Math.floor(p/l);n=n.slice(0,f)}if(t&&a&&null!=c)for(var g=gg(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v=0;vl&&Sg(n,t.substring(l,u),e,s),Sg(n,i[2],e,s,i[1]),l=pg.lastIndex}lo){b>0?(m.tokens=m.tokens.slice(0,b),v(m,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break t}var A=S.width,D=null==A||"auto"===A;if("string"===typeof A&&"%"===A.charAt(A.length-1))w.percentWidth=A,h.push(w),w.contentWidth=np(w.text,C);else{if(D){var k=S.backgroundColor,L=k&&k.image;L&&(L=ug(L),dg(L)&&(w.width=Math.max(w.width,L.width*T/L.height)))}var P=f&&null!=r?r-x:null;null!=P&&P0&&f+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=f}else{var g=Tg(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var v=0;v=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Ig=Ns(",&?/;] ".split(""),(function(t,e){return t[e]=!0,t}),{});function Cg(t){return!Mg(t)||!!Ig[t]}function Tg(t,e,n,i,r){for(var o=[],a=[],s="",l="",u=0,h=0,c=0;cn:r+h+p>n)?h?(s||l)&&(f?(s||(s=l,l="",u=0,h=u),o.push(s),a.push(h-u),l+=d,u+=p,s="",h=u):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=d,h=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p)):(h+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=r),{accumWidth:h,lines:o,linesWidths:a}}var Ag="__zr_style_"+Math.round(10*Math.random()),Dg={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},kg={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Dg[Ag]=!0;var Lg=["z","z2","invisible"],Pg=["invisible"],Rg=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype._init=function(e){for(var n=Bs(e),i=0;i1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(Wg[0]=Gg(r)*n+t,Wg[1]=Fg(r)*i+e,Ug[0]=Gg(o)*n+t,Ug[1]=Fg(o)*i+e,u(s,Wg,Ug),h(l,Wg,Ug),r%=Hg,r<0&&(r+=Hg),o%=Hg,o<0&&(o+=Hg),r>o&&!a?o+=Hg:rr&&(Zg[0]=Gg(p)*n+t,Zg[1]=Fg(p)*i+e,u(s,Zg,s),h(l,Zg,l))}var Qg={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tv=[],ev=[],nv=[],iv=[],rv=[],ov=[],av=Math.min,sv=Math.max,lv=Math.cos,uv=Math.sin,hv=Math.abs,cv=Math.PI,dv=2*cv,pv="undefined"!==typeof Float32Array,fv=[];function gv(t){var e=Math.round(t/cv*1e8)/1e8;return e%2*cv}function vv(t,e){var n=gv(t[0]);n<0&&(n+=dv);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=dv?r=n+dv:e&&n-r>=dv?r=n-dv:!e&&n>r?r=n+(dv-gv(n-r)):e&&n0&&(this._ux=hv(n/Vd/t)||0,this._uy=hv(n/Vd/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Qg.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=hv(t-this._xi),i=hv(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Qg.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Qg.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Qg.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),fv[0]=i,fv[1]=r,vv(fv,o),i=fv[0],r=fv[1];var a=r-i;return this.addData(Qg.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=lv(r)*n+t,this._yi=uv(r)*n+e,this},t.prototype.arcTo=function(t,e,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},t.prototype.rect=function(t,e,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Qg.R,t,e,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Qg.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&t.closePath(),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!pv||(this.data=new Float32Array(e));for(var n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){nv[0]=nv[1]=rv[0]=rv[1]=Number.MAX_VALUE,iv[0]=iv[1]=ov[0]=ov[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;tn||hv(m)>i||c===e-1)&&(f=Math.sqrt(y*y+m*m),r=g,o=v);break;case Qg.C:var _=t[c++],x=t[c++],b=(g=t[c++],v=t[c++],t[c++]),w=t[c++];f=Vh(r,o,_,x,g,v,b,w,10),r=b,o=w;break;case Qg.Q:_=t[c++],x=t[c++],g=t[c++],v=t[c++];f=Yh(r,o,_,x,g,v,10),r=g,o=v;break;case Qg.A:var S=t[c++],M=t[c++],I=t[c++],C=t[c++],T=t[c++],A=t[c++],D=A+T;c+=1;t[c++];p&&(a=lv(T)*I+S,s=uv(T)*C+M),f=sv(I,C)*av(dv,Math.abs(A)),r=lv(D)*I+S,o=uv(D)*C+M;break;case Qg.R:a=r=t[c++],s=o=t[c++];var k=t[c++],L=t[c++];f=2*k+2*L;break;case Qg.Z:y=a-r,m=s-o;f=Math.sqrt(y*y+m*m),r=a,o=s;break}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h,c,d,p=this.data,f=this._ux,g=this._uy,v=this._len,y=e<1,m=0,_=0,x=0;if(!y||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=this._pathLen,h=e*u,h))t:for(var b=0;b0&&(t.lineTo(c,d),x=0),w){case Qg.M:n=r=p[b++],i=o=p[b++],t.moveTo(r,o);break;case Qg.L:a=p[b++],s=p[b++];var M=hv(a-r),I=hv(s-o);if(M>f||I>g){if(y){var C=l[_++];if(m+C>h){var T=(h-m)/C;t.lineTo(r*(1-T)+a*T,o*(1-T)+s*T);break t}m+=C}t.lineTo(a,s),r=a,o=s,x=0}else{var A=M*M+I*I;A>x&&(c=a,d=s,x=A)}break;case Qg.C:var D=p[b++],k=p[b++],L=p[b++],P=p[b++],R=p[b++],O=p[b++];if(y){C=l[_++];if(m+C>h){T=(h-m)/C;zh(r,D,L,R,T,tv),zh(o,k,P,O,T,ev),t.bezierCurveTo(tv[1],ev[1],tv[2],ev[2],tv[3],ev[3]);break t}m+=C}t.bezierCurveTo(D,k,L,P,R,O),r=R,o=O;break;case Qg.Q:D=p[b++],k=p[b++],L=p[b++],P=p[b++];if(y){C=l[_++];if(m+C>h){T=(h-m)/C;Uh(r,D,L,T,tv),Uh(o,k,P,T,ev),t.quadraticCurveTo(tv[1],ev[1],tv[2],ev[2]);break t}m+=C}t.quadraticCurveTo(D,k,L,P),r=L,o=P;break;case Qg.A:var N=p[b++],E=p[b++],z=p[b++],B=p[b++],V=p[b++],F=p[b++],G=p[b++],H=!p[b++],W=z>B?z:B,U=hv(z-B)>.001,Z=V+F,Y=!1;if(y){C=l[_++];m+C>h&&(Z=V+F*(h-m)/C,Y=!0),m+=C}if(U&&t.ellipse?t.ellipse(N,E,z,B,G,V,Z,H):t.arc(N,E,W,V,Z,H),Y)break t;S&&(n=lv(V)*z+N,i=uv(V)*B+E),r=lv(Z)*z+N,o=uv(Z)*B+E;break;case Qg.R:n=r=p[b],i=o=p[b+1],a=p[b++],s=p[b++];var X=p[b++],j=p[b++];if(y){C=l[_++];if(m+C>h){var q=h-m;t.moveTo(a,s),t.lineTo(a+av(q,X),s),q-=X,q>0&&t.lineTo(a+X,s+av(q,j)),q-=j,q>0&&t.lineTo(a+sv(X-q,0),s+j),q-=X,q>0&&t.lineTo(a,s+sv(j-q,0));break t}m+=C}t.rect(a,s,X,j);break;case Qg.Z:if(y){C=l[_++];if(m+C>h){T=(h-m)/C;t.lineTo(r*(1-T)+n*T,o*(1-T)+i*T);break t}m+=C}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Qg,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();const mv=yv;function _v(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0,u=t;if(a>e+s&&a>i+s||at+s&&o>n+s||oe+c&&h>i+c&&h>o+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>a+c||ue+u&&l>i+u&&l>o+u||lt+u&&s>n+u&&s>r+u||sn||h+ur&&(r+=Mv);var d=Math.atan2(l,s);return d<0&&(d+=Mv),d>=i&&d<=r||d+Mv>=i&&d+Mv<=r}function Cv(t,e,n,i,r,o){if(o>e&&o>i||or?s:0}var Tv=mv.CMD,Av=2*Math.PI,Dv=1e-4;function kv(t,e){return Math.abs(t-e)e&&u>i&&u>o&&u>s||u1&&Rv(),p=Rh(e,i,o,s,Pv[0]),d>1&&(f=Rh(e,i,o,s,Pv[1]))),2===d?ve&&s>i&&s>o||s=0&&u<=1){for(var h=0,c=Fh(e,i,o,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Lv[0]=-l,Lv[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=Av-1e-4){i=0,r=Av;var h=o?1:-1;return a>=Lv[0]+t&&a<=Lv[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=Av,r+=Av);for(var d=0,p=0;p<2;p++){var f=Lv[p];if(f+t>a){var g=Math.atan2(s,f);h=o?1:-1;g<0&&(g=Av+g),(g>=i&&g<=r||g+Av>=i&&g+Av<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function zv(t,e,n,i,r){for(var o,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=Cv(h,c,d,p,i,r))),v&&(h=s[f],c=s[f+1],d=h,p=c),g){case Tv.M:d=s[f++],p=s[f++],h=d,c=p;break;case Tv.L:if(n){if(_v(h,c,s[f],s[f+1],e,i,r))return!0}else u+=Cv(h,c,s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.C:if(n){if(xv(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else u+=Ov(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.Q:if(n){if(bv(h,c,s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else u+=Nv(h,c,s[f++],s[f++],s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.A:var y=s[f++],m=s[f++],_=s[f++],x=s[f++],b=s[f++],w=s[f++];f+=1;var S=!!(1-s[f++]);o=Math.cos(b)*_+y,a=Math.sin(b)*x+m,v?(d=o,p=a):u+=Cv(h,c,o,a,i,r);var M=(i-y)*x/_+y;if(n){if(Iv(y,m,x,b,b+w,S,e,M,r))return!0}else u+=Ev(y,m,x,b,b+w,S,M,r);h=Math.cos(b+w)*_+y,c=Math.sin(b+w)*x+m;break;case Tv.R:d=h=s[f++],p=c=s[f++];var I=s[f++],C=s[f++];if(o=d+I,a=p+C,n){if(_v(d,p,o,p,e,i,r)||_v(o,p,o,a,e,i,r)||_v(o,a,d,a,e,i,r)||_v(d,a,d,p,e,i,r))return!0}else u+=Cv(o,p,o,a,i,r),u+=Cv(d,a,d,p,i,r);break;case Tv.Z:if(n){if(_v(h,c,d,p,e,i,r))return!0}else u+=Cv(h,c,d,p,i,r);h=d,c=p;break}}return n||kv(c,p)||(u+=Cv(h,c,d,p,i,r)||0),0!==u}function Bv(t,e,n){return zv(t,0,!1,e,n)}function Vv(t,e,n,i){return zv(t,e,!0,n,i)}var Fv=As({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Dg),Gv={style:As({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},kg.style)},Hv=Jd.concat(["invisible","culling","z","z2","zlevel","parent"]),Wv=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Gd:e>.2?Wd:Hd}if(t)return Hd}return Gd},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(Us(e)){var n=this.__zr,i=!(!n||!n.isDarkMode()),r=Sc(t,0)0))},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||this.__dirty&dh)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),Vv(o,a/s,t,e)))return!0}if(this.hasFill())return Bv(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=dh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"===typeof t?n[t]=e:Ts(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&dh)},e.prototype.createStyle=function(t){return yl(Fv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=Ts({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=Ts({},i.shape),Ts(s,n.shape)):(s=Ts({},r?this.shape:i.shape),Ts(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=Ts({},this.shape);for(var u={},h=Bs(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.createStyle=function(t){return yl(Zv,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=rp(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(zg);Yv.prototype.type="tspan";const Xv=Yv;var jv=As({x:0,y:0},Dg),qv={style:As({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},kg.style)};function Kv(t){return!!(t&&"string"!==typeof t&&t.width&&t.height)}var $v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.createStyle=function(t){return yl(jv,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i=Kv(e.image)?e.image:this.__image;if(!i)return 0;var r="width"===t?"height":"width",o=e[r];return null==o?i[t]:i[t]/i[r]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return qv},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Gu(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(zg);$v.prototype.type="image";const Jv=$v;function Qv(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"===typeof c?n=i=r=o=c:c instanceof Array?1===c.length?n=i=r=o=c[0]:2===c.length?(n=r=c[0],i=o=c[1]):3===c.length?(n=c[0],i=o=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],o=c[3]):n=i=r=o=0,n+i>u&&(a=n+i,n*=u/a,i*=u/a),r+o>u&&(a=r+o,r*=u/a,o*=u/a),i+r>h&&(a=i+r,i*=h/a,r*=h/a),n+o>h&&(a=n+o,n*=h/a,o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}var ty=Math.round;function ey(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(ty(2*i)===ty(2*r)&&(t.x1=t.x2=iy(i,s,!0)),ty(2*o)===ty(2*a)&&(t.y1=t.y2=iy(o,s,!0)),t):t}}function ny(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=iy(i,s,!0),t.y=iy(r,s,!0),t.width=Math.max(iy(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(iy(r+a,s,!1)-t.y,0===a?0:1),t):t}}function iy(t,e,n){if(!e)return t;var i=ty(2*t);return(i+ty(e))%2===0?i/2:(i+(n?1:-1))/2}var ry=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),oy={},ay=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new ry},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=ny(oy,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?Qv(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Uv);ay.prototype.type="rect";const sy=ay;var ly={fill:"#000"},uy=2,hy={style:As({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},kg.style)},cy=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ly,n.attr(e),n}return qa(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),T=r.calculatedLineHeight,A=0;A=0&&(A=x[T],"right"===A.align))this._placeToken(A,t,w,g,C,"right",y),S-=A.width,C-=A.width,T--;I+=(i-(I-f)-(v-C)-S)/2;while(M<=T)A=x[M],this._placeToken(A,t,w,g,I+A.width/2,"center",y),I+=A.width,M++;g+=w}},e.prototype._placeToken=function(t,e,n,i,r,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2);var h=!t.isLineHolder&&My(s);h&&this._renderBackground(s,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,u-t.height/2,t.width,t.height);var c=!!s.backgroundColor,d=t.textPadding;d&&(r=wy(r,o,d),u-=t.height/2-d[0]-t.innerHeight/2);var p=this._getOrCreateChild(Xv),f=p.createStyle();p.useStyle(f);var g=this._defaultStyle,v=!1,y=0,m=by("fill"in s?s.fill:"fill"in e?e.fill:(v=!0,g.fill)),_=xy("stroke"in s?s.stroke:"stroke"in e?e.stroke:c||a||g.autoStroke&&!v?null:(y=uy,g.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=u,x&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||is,f.opacity=il(s.opacity,e.opacity,1),vy(f,s),_&&(f.lineWidth=il(s.lineWidth,e.lineWidth,y),f.lineDash=nl(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=_),m&&(f.fill=m);var b=t.contentWidth,w=t.contentHeight;p.setBoundingRect(new Gu(op(f.x,b,f.textAlign),ap(f.y,w,f.textBaseline),b,w))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l=t.backgroundColor,u=t.borderWidth,h=t.borderColor,c=l&&l.image,d=l&&!c,p=t.borderRadius,f=this;if(d||t.lineHeight||u&&h){a=this._getOrCreateChild(sy),a.useStyle(a.createStyle()),a.style.fill=null;var g=a.shape;g.x=n,g.y=i,g.width=r,g.height=o,g.r=p,a.dirtyShape()}if(d){var v=a.style;v.fill=l||null,v.fillOpacity=nl(t.fillOpacity,1)}else if(c){s=this._getOrCreateChild(Jv),s.onload=function(){f.dirtyStyle()};var y=s.style;y.image=l.image,y.x=n,y.y=i,y.width=r,y.height=o}if(u&&h){v=a.style;v.lineWidth=u,v.stroke=h,v.strokeOpacity=nl(t.strokeOpacity,1),v.lineDash=t.borderDash,v.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(v.strokeFirst=!0,v.lineWidth*=2)}var m=(a||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=il(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return yy(t)&&(e=[t.fontStyle,t.fontWeight,gy(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&sl(e)||t.textFont||t.font},e}(zg),dy={left:!0,right:1,center:1},py={top:1,bottom:1,middle:1},fy=["fontStyle","fontWeight","fontSize","fontFamily"];function gy(t){return"string"!==typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?es+"px":t+"px":t}function vy(t,e){for(var n=0;n=0,o=!1;if(t instanceof Uv){var a=ky(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(Uy(s)||Uy(l)){i=i||{};var u=i.style||{};"inherit"===u.fill?(o=!0,i=Ts({},i),u=Ts({},u),u.fill=s):!Uy(u.fill)&&Uy(s)?(o=!0,i=Ts({},i),u=Ts({},u),u.fill=Yy(s)):!Uy(u.stroke)&&Uy(l)&&(o||(i=Ts({},i),u=Ts({},u)),u.stroke=Yy(l)),i.style=u}}if(i&&null==i.z2){o||(i=Ts({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:zy)}return i}function om(t,e,n){if(n&&null==n.z2){n=Ts({},n);var i=t.z2SelectLift;n.z2=t.z2+(null!=i?i:By)}return n}function am(t,e,n){var i=Ds(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:im(t,["opacity"],e,{opacity:1});n=n||{};var a=n.style||{};return null==a.opacity&&(n=Ts({},n),a=Ts({opacity:i?r:.1*o.opacity},a),n.style=a),n}function sm(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return rm(this,t,e,n);if("blur"===t)return am(this,t,n);if("select"===t)return om(this,t,n)}return n}function lm(t){t.stateProxy=sm;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=sm),n&&(n.stateProxy=sm)}function um(t,e){!ym(t,e)&&!t.__highByOuter&&em(t,jy)}function hm(t,e){!ym(t,e)&&!t.__highByOuter&&em(t,qy)}function cm(t,e){t.__highByOuter|=1<<(e||0),em(t,jy)}function dm(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&em(t,qy)}function pm(t){em(t,Ky)}function fm(t){em(t,$y)}function gm(t){em(t,Jy)}function vm(t){em(t,Qy)}function ym(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function mm(t){var e=t.getModel(),n=[],i=[];e.eachComponent((function(e,r){var o=Ly(r),a="series"===e,s=a?t.getViewOfSeriesModel(r):t.getViewOfComponentModel(r);!a&&i.push(s),o.isBlured&&(s.group.traverse((function(t){$y(t)})),a&&n.push(r)),o.isBlured=!1})),Rs(i,(function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)}))}function _m(t,e,n,i){var r=i.getModel();function o(t,e){for(var n=0;n0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}}))})),e}function Am(t,e,n){Nm(t,!0),em(t,lm),Lm(t,e,n)}function Dm(t){Nm(t,!1)}function km(t,e,n,i){i?Dm(t):Am(t,e,n)}function Lm(t,e,n){var i=Cy(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var Pm=["emphasis","blur","select"],Rm={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Om(t,e,n,i){n=n||"itemStyle";for(var r=0;r0){var c=h.duration,d=h.delay,p=h.easing,f={duration:c,delay:d||0,easing:p,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,f):e.animateTo(n,f)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Zm(t,e,n,i,r,o){Um("update",t,e,n,i,r,o)}function Ym(t,e,n,i,r,o){Um("enter",t,e,n,i,r,o)}function Xm(t){if(!t.__zr)return!0;for(var e=0;e=0&&n.push(t)})),n}t.topologicalTravel=function(t,e,i,r){if(t.length){var o=n(e),a=o.graph,s=o.noEntryList,l={};Rs(t,(function(t){l[t]=!0}));while(s.length){var u=s.pop(),h=a[u],c=!!l[u];c&&(i.call(r,u,h.originalDeps.slice()),delete l[u]),Rs(h.successor,c?p:d)}Rs(l,(function(){var t="";throw new Error(t)}))}function d(t){a[t].entryCount--,0===a[t].entryCount&&s.push(t)}function p(t){l[t]=!0,d(t)}}}function R_(t,e){return Is(Is({},t,!0),e,!0)}const O_={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},N_={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},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:""}}}};var E_="ZH",z_="EN",B_=z_,V_={},F_={},G_=ts.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(E_)>-1?E_:B_}():B_;function H_(t,e){t=t.toUpperCase(),F_[t]=new A_(e),V_[t]=e}function W_(t){if(Us(t)){var e=V_[t.toUpperCase()]||{};return t===E_||t===z_?Ms(e):Is(Ms(e),Ms(V_[B_]),!1)}return Is(Ms(t),Ms(V_[B_]),!1)}function U_(t){return F_[t]}function Z_(){return F_[B_]}H_(z_,O_),H_(E_,N_);var Y_=1e3,X_=60*Y_,j_=60*X_,q_=24*j_,K_=365*q_,$_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},J_="{yyyy}-{MM}-{dd}",Q_={year:"{yyyy}",month:"{yyyy}-{MM}",day:J_,hour:J_+" "+$_.hour,minute:J_+" "+$_.minute,second:J_+" "+$_.second,millisecond:$_.none},tx=["year","month","day","hour","minute","second","millisecond"],ex=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function nx(t,e){return t+="","0000".substr(0,e-t.length)+t}function ix(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function rx(t){return t===ix(t)}function ox(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function ax(t,e,n,i){var r=qp(t),o=r[hx(n)](),a=r[cx(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[dx(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[px(n)](),c=(h-1)%12+1,d=r[fx(n)](),p=r[gx(n)](),f=r[vx(n)](),g=i instanceof A_?i:U_(i||G_)||Z_(),v=g.getModel("time"),y=v.get("month"),m=v.get("monthAbbr"),_=v.get("dayOfWeek"),x=v.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,nx(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,m[a-1]).replace(/{MM}/g,nx(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,nx(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,nx(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,nx(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,nx(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,nx(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,nx(f,3)).replace(/{S}/g,f+"")}function sx(t,e,n,i,r){var o=null;if(Us(n))o=n;else if(Ws(n))o=n(t.value,e,{level:t.level});else{var a=Ts({},$_);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(Hs(o)){var c=null==t.level?0:t.level>=0?t.level:o.length+t.level;c=Math.min(c,o.length-1),o=o[c]}}return ax(new Date(t.value),o,r,i)}function lx(t,e){var n=qp(t),i=n[cx(e)]()+1,r=n[dx(e)](),o=n[px(e)](),a=n[fx(e)](),s=n[gx(e)](),l=n[vx(e)](),u=0===l,h=u&&0===s,c=h&&0===a,d=c&&0===o,p=d&&1===r,f=p&&1===i;return f?"year":p?"month":d?"day":c?"hour":h?"minute":u?"second":"millisecond"}function ux(t,e,n){var i=Ys(t)?qp(t):t;switch(e=e||lx(t,n),e){case"year":return i[hx(n)]();case"half-year":return i[cx(n)]()>=6?1:0;case"quarter":return Math.floor((i[cx(n)]()+1)/4);case"month":return i[cx(n)]();case"day":return i[dx(n)]();case"half-day":return i[px(n)]()/24;case"hour":return i[px(n)]();case"minute":return i[fx(n)]();case"second":return i[gx(n)]();case"millisecond":return i[vx(n)]()}}function hx(t){return t?"getUTCFullYear":"getFullYear"}function cx(t){return t?"getUTCMonth":"getMonth"}function dx(t){return t?"getUTCDate":"getDate"}function px(t){return t?"getUTCHours":"getHours"}function fx(t){return t?"getUTCMinutes":"getMinutes"}function gx(t){return t?"getUTCSeconds":"getSeconds"}function vx(t){return t?"getUTCMilliseconds":"getMilliseconds"}function yx(t){return t?"setUTCFullYear":"setFullYear"}function mx(t){return t?"setUTCMonth":"setMonth"}function _x(t){return t?"setUTCDate":"setDate"}function xx(t){return t?"setUTCHours":"setHours"}function bx(t){return t?"setUTCMinutes":"setMinutes"}function Sx(t){return t?"setUTCSeconds":"setSeconds"}function Mx(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Ix(t){if(!nf(t))return Us(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Cx(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var Tx=ol;function Ax(t,e,n){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function r(t){return t&&sl(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var a="time"===e,s=t instanceof Date;if(a||s){var l=a?qp(t):t;if(!isNaN(+l))return ax(l,i,n);if(s)return"-"}if("ordinal"===e)return Zs(t)?r(t):Ys(t)&&o(t)?t+"":"-";var u=ef(t);return o(u)?Ix(u):Zs(t)?r(t):"boolean"===typeof t?t+"":"-"}var Dx=["a","b","c","d","e","f","g"],kx=function(t,e){return"{"+t+(null==e?"":e)+"}"};function Lx(t,e,n){Hs(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'';var a=n.markerId||"markerX";return{renderMode:o,content:"{"+a+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Ox(t,e){return e=e||"transparent",Us(t)?t:Xs(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Nx(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Ex=Rs,zx=["left","right","top","bottom","width","height"],Bx=[["width","left","right"],["height","top","bottom"]];function Vx(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var h,c,d=l.getBoundingRect(),p=e.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=d.width+(f?-f.x+d.x:0);h=o+g,h>i||l.newline?(o=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var v=d.height+(f?-f.y+d.y:0);c=a+v,c>r||l.newline?(o+=s+n,a=0,c=v,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)}))}var Fx=Vx;Gs(Vx,"vertical"),Gs(Vx,"horizontal");function Gx(t,e,n){var i=e.width,r=e.height,o=zp(t.left,i),a=zp(t.top,r),s=zp(t.right,i),l=zp(t.bottom,r);return(isNaN(o)||isNaN(parseFloat(t.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.right)))&&(s=i),(isNaN(a)||isNaN(parseFloat(t.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(t.bottom)))&&(l=r),n=Tx(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}function Hx(t,e,n){n=Tx(n||0);var i=e.width,r=e.height,o=zp(t.left,i),a=zp(t.top,r),s=zp(t.right,i),l=zp(t.bottom,r),u=zp(t.width,i),h=zp(t.height,r),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(h)&&(h=r-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-h-c),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d;break}switch(t.top||t.bottom){case"middle":case"center":a=r/2-h/2-n[0];break;case"bottom":a=r-h-c;break}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(h)&&(h=r-c-a-(l||0));var f=new Gu(o+n[3],a+n[0],u,h);return f.margin=n,f}function Wx(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if(o=o||t,o.x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Gu(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();a=a.clone(),a.applyTransform(h)}var c=Hx(As({width:a.width,height:a.height},e),n,i),d=s?c.x-a.x:0,p=l?c.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===t&&t.markRedraw(),!0}function Ux(t,e){return null!=t[Bx[e][0]]||null!=t[Bx[e][1]]&&null!=t[Bx[e][2]]}function Zx(t){var e=t.layoutMode||t.constructor.layoutMode;return Xs(e)?e:e?{type:e}:null}function Yx(t,e,n){var i=n&&n.ignoreSize;!Hs(i)&&(i=[i,i]);var r=a(Bx[0],0),o=a(Bx[1],1);function a(n,r){var o={},a=0,u={},h=0,c=2;if(Ex(n,(function(e){u[e]=t[e]})),Ex(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(h!==c&&a){if(a>=c)return o;for(var d=0;d=0;a--)o=Is(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Bf(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(A_);function $x(t){var e=[];return Rs(Kx.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=Os(e,(function(t){return Xf(t).main})),"dataset"!==t&&Ds(e,"dataset")<=0&&e.unshift("dataset"),e}Jf(Kx,A_),ig(Kx),L_(Kx),P_(Kx,$x);const Jx=Kx;var Qx="";"undefined"!==typeof navigator&&(Qx=navigator.platform||"");var tb="rgba(0, 0, 0, 0.2)";const eb={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:tb,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:tb,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:tb,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:tb,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:tb,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:tb,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Qx.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var nb=gl(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),ib="original",rb="arrayRows",ob="objectRows",ab="keyedColumns",sb="typedArray",lb="unknown",ub="column",hb="row",cb={Must:1,Might:2,Not:3},db=Pf();function pb(t){db(t).datasetMap=gl()}function fb(t,e,n){var i={},r=vb(e);if(!r||!t)return i;var o,a,s=[],l=[],u=e.ecModel,h=db(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;t=t.slice(),Rs(t,(function(e,n){var r=Xs(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=f(r)),i[r.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function p(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}function Lb(t,e,n,i,r,o,a){o=o||t;var s=e(o),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var h=null!=a&&i?kb(i,a):n;if(h=h||n,h&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}function Pb(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var Rb="\0_ec_inner",Ob=1;var Nb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new A_(i),this._locale=new A_(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=Fb(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Fb(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):Ib(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&Rs(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=gl(),s=e&&e.replaceMergeMainTypeMap;function l(e){var o=wb(this,e,hf(t[e])),a=i.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=gf(a,o,l);Af(u,e,Jx),n[e]=null,i.set(e,null),r.set(e,0);var h,c=[],d=[],p=0;Rs(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=Jx.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(h)return void 0;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=Ts({componentIndex:n},t.keyInfo);i=new a(r,this,this,s),Ts(i,s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),d.push(i),p++):(c.push(void 0),d.push(void 0))}),this),n[e]=c,i.set(e,d),r.set(e,p),"series"===e&&Sb(this)}pb(this),Rs(t,(function(t,e){null!=t&&(Jx.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?Ms(t):Is(n[e],t,!0))})),s&&s.each((function(t,e){Jx.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),Jx.topologicalTravel(o,Jx.getAllClassMainTypes(),l,this),this._seriesIndices||Sb(this)},e.prototype.getOption=function(){var t=Ms(this.option);return Rs(t,(function(e,n){if(Jx.hasClass(n)){for(var i=hf(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!Cf(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}})),delete t[Rb],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e}function Qb(t,e){return t.join(",")===e.join(",")}const tw=qb;var ew=Rs,nw=Xs,iw=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function rw(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=iw.length;n=0;g--){var v=t[g];if(s||(d=v.data.rawIndexOf(v.stackedByDimension,c)),d>=0){var y=v.data.getByRawIndex(v.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=Up(p,y),f=y;break}}}return i[0]=p,i[1]=f,i}))}))}var Tw,Aw,Dw,kw,Lw,Pw=function(){function t(t){this.data=t.data||(t.sourceFormat===ab?{}:[]),this.sourceFormat=t.sourceFormat||lb,this.seriesLayoutBy=t.seriesLayoutBy||ub,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=p)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}))}},t.prototype.getRawValue=function(t,e){return tS(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function iS(t){var e,n;return Xs(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function rS(t){return new oS(t)}var oS=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(o||d1&&i>0?s:a}};return o;function a(){return e=t?null:oe},gte:function(t,e){return t>=e}},pS=function(){function t(t,e){if(!Ys(e)){var n="";0,lS(n)}this._opFn=dS[t],this._rvalFloat=ef(e)}return t.prototype.evaluate=function(t){return Ys(t)?this._opFn(t,this._rvalFloat):this._opFn(ef(t),this._rvalFloat)},t}(),fS=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=Ys(t)?t:ef(t),i=Ys(e)?e:ef(e),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=Us(t),s=Us(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}(),gS=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=ef(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=ef(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function vS(t,e){return"eq"===t||"ne"===t?new gS("eq"===t,e):_l(dS,t)?new pS(t,e):null}var yS=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return uS(t,e)},t}();function mS(t,e){var n=new yS,i=t.data,r=n.sourceFormat=t.sourceFormat,o=t.startIndex,a="";t.seriesLayoutBy!==ub&&lS(a);var s=[],l={},u=t.dimensionsDefine;if(u)Rs(u,(function(t,e){var n=t.name,i={index:e,name:n,displayName:t.displayName};if(s.push(i),null!=n){var r="";_l(l,n)&&lS(r),l[n]=i}}));else for(var h=0;h65535?kS:LS}function ES(){return[1/0,-1/0]}function zS(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function BS(t,e,n,i,r){var o=OS[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;ug[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=Os(o,(function(t){return t.property})),u=0;uv[1]&&(v[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks,r=i[t],o=[];if(!r)return o;null==n&&(n=1/0);for(var a=1/0,s=-1,l=0,u=0,h=this.count();u=0&&s<0)&&(a=p,s=d,l=0),d===s&&(o[l++]=u))}return o.length=l,o},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=h&&y<=c||isNaN(y))&&(s[l++]=f),f++}p=!0}else if(2===r){g=d[i[0]];var m=d[i[1]],_=t[i[1]][0],x=t[i[1]][1];for(v=0;v=h&&y<=c||isNaN(y))&&(b>=_&&b<=x||isNaN(b))&&(s[l++]=f),f++}p=!0}}if(!p)if(1===r)for(v=0;v=h&&y<=c||isNaN(y))&&(s[l++]=w)}else for(v=0;vt[I][1])&&(S=!1)}S&&(s[l++]=e.getRawIndex(v))}return lv[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks,s=a[t],l=this.count(),u=0,h=Math.floor(1/e),c=this.getRawIndex(0),d=new(NS(this._rawCount))(Math.min(2*(Math.ceil(l/h)+2),l));d[u++]=c;for(var p=1;pn&&(n=i,r=_))}C>0&&Cu-p&&(s=u-p,a.length=s);for(var f=0;fh[1]&&(h[1]=v),c[d++]=y}return r._count=d,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();rs&&(s=h)}return i=[a,s],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return uS(t[i],this._dimensions[i])}AS={arrayRows:t,objectRows:function(t,e,n,i){return uS(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return uS(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const FS=VS;var GS=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(WS(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),l=u.getSource(),a=l.data,s=l.sourceFormat,e=[u._getVersionSign()]}else a=o.get("data",!0),s=qs(a)?sb:ib,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=nl(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=nl(h.sourceHeader,c.sourceHeader),f=nl(h.dimensions,c.dimensions),g=d!==c.seriesLayoutBy||!!p!==!!c.sourceHeader||f;t=g?[Ow(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var v=n;if(r){var y=this._applyTransform(i);t=y.sourceList,e=y.upstreamSignList}else{var m=v.get("source",!0);t=[Ow(m,this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var o="";1!==t.length&&US(o)}var a=[],s=[];return Rs(t,(function(t){t.prepareSource();var e=t.getSource(r||0),n="";null==r||e||US(n),a.push(e),s.push(t._getVersionSign())})),i?e=IS(i,a,{datasetIndex:n.componentIndex}):null!=r&&(e=[Ew(a[0])]),{sourceList:e,upstreamSignList:s}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||n>0&&!t.noHeader;return Rs(t.blocks,(function(t){var n=JS(t);n>=e&&(e=n+ +(i&&(!n||KS(t)&&!t.noHeader)))})),e}return 0}function QS(t,e,n,i){var r=e.noHeader,o=nM(JS(e)),a=[],s=e.blocks||[];al(!s||Hs(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(_l(u,l)){var h=new fS(u[l],null);s.sort((function(t,e){return h.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===l&&s.reverse()}Rs(s,(function(n,r){var s=e.valueFormatter,l=$S(n)(s?Ts(Ts({},t),{valueFormatter:s}):t,n,r>0?o.html:0,i);null!=l&&a.push(l)}));var c="richText"===t.renderMode?a.join(o.richText):iM(a.join(""),r?n:o.html);if(r)return c;var d=Ax(e.header,"ordinal",t.useUTC),p=YS(i,t.renderMode).nameStyle;return"richText"===t.renderMode?aM(t,d,p)+o.richText+c:iM('
'+ru(d)+"
"+c,n)}function tM(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return t=Hs(t)?t:[t],Os(t,(function(t,e){return Ax(t,Hs(p)?p[e]:p,u)}))};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),d=o?"":Ax(l,"ordinal",u),p=e.valueType,f=a?[]:h(e.value),g=!s||!o,v=!s&&o,y=YS(i,r),m=y.nameStyle,_=y.valueStyle;return"richText"===r?(s?"":c)+(o?"":aM(t,d,m))+(a?"":sM(t,f,g,v,_)):iM((s?"":c)+(o?"":rM(d,!s,m))+(a?"":oM(f,g,v,_)),n)}}function eM(t,e,n,i,r,o){if(t){var a=$S(t),s={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return a(s,t,0,o)}}function nM(t){return{html:XS[t],richText:jS[t]}}function iM(t,e){var n='
',i="margin: "+e+"px 0 0";return'
'+t+n+"
"}function rM(t,e,n){var i=e?"margin-left:2px":"";return''+ru(t)+""}function oM(t,e,n,i){var r=n?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=Hs(t)?t:[t],''+Os(t,(function(t){return ru(t)})).join("  ")+""}function aM(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function sM(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(Hs(e)?e.join(" "):e,o)}function lM(t,e){var n=t.getData().getItemVisual(e,"style"),i=n[t.visualDrawType];return Ox(i)}function uM(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var hM=function(){function t(){this.richTextStyles={},this._nextStyleNameId=rf()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=Rx({color:e,type:t,renderMode:n,markerId:i});return Us(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};Hs(e)?Rs(e,(function(t){return Ts(n,t)})):Ts(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function cM(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),d=Hs(c),p=lM(o,a);if(h>1||d&&!h){var f=dM(c,o,a,u,p);e=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=tS(l,a,u[0]),n=g.type}else r=e=d?c[0]:c;var v=If(o),y=v&&o.name||"",m=l.getName(a),_=s?y:m;return qS("section",{header:y,noHeader:s||!v,sortParam:r,blocks:[qS("nameValue",{markerType:"item",markerColor:p,name:_,noName:!sl(_),value:e,valueType:n})].concat(i||[])})}function dM(t,e,n,i,r){var o=e.getData(),a=Ns(t,(function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(qS("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?Rs(i,(function(t){h(tS(o,n,t),t)})):Rs(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}var pM=Pf();function fM(t,e){return t.getName(e)||t.getId(e)}var gM="__universalTransitionEnabled",vM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return qa(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=rS({count:_M,reset:xM}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var i=pM(this).sourceManager=new GS(this);i.prepareSource();var r=this.getInitialData(t,n);wM(r,this),this.dataTask.context.data=r,pM(this).dataBeforeProcessed=r,yM(this),this._initSelectedMapFromData(r)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Zx(this),i=n?Xx(t):{},r=this.subType;Jx.hasClass(r)&&(r+="Series"),Is(t,e.getTheme().get(this.subType)),Is(t,this.getDefaultOption()),cf(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Yx(t,i,n)},e.prototype.mergeOption=function(t,e){t=Is(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Zx(this);n&&Yx(this.option,t,n);var i=pM(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);wM(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,pM(this).dataBeforeProcessed=r,yM(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!qs(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=Ab.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[fM(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[gM])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){Xs(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Jx.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Jx);function yM(t){var e=t.name;If(t)||(t.name=mM(t)||e)}function mM(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return Rs(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}function _M(t){return t.model.getRawData().count()}function xM(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),bM}function bM(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function wM(t,e){Rs(vl(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,Gs(SM,e))}))}function SM(t,e){var n=MM(t);return n&&n.setOutputEnd((e||this).count()),e}function MM(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}Ls(vM,nS),Ls(vM,Ab),Jf(vM,Jx);const IM=vM;var CM=function(){function t(){this.group=new Ip,this.uid=k_("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Kf(CM),ig(CM);const TM=CM;function AM(){var t=Pf();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}var DM=mv.CMD,kM=[[],[],[]],LM=Math.sqrt,PM=Math.atan2;function RM(t,e){if(e){var n,i,r,o,a,s,l=t.data,u=t.len(),h=DM.M,c=DM.C,d=DM.L,p=DM.R,f=DM.A,g=DM.Q;for(r=0,o=0;r1&&(a*=OM(f),s*=OM(f));var g=(r===o?-1:1)*OM((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,v=g*a*p/s,y=g*-s*d/a,m=(t+n)/2+EM(c)*v-NM(c)*y,_=(e+i)/2+NM(c)*v+EM(c)*y,x=FM([1,0],[(d-v)/a,(p-y)/s]),b=[(d-v)/a,(p-y)/s],w=[(-1*d-v)/a,(-1*p-y)/s],S=FM(b,w);if(VM(b,w)<=-1&&(S=zM),VM(b,w)>=1&&(S=0),S<0){var M=Math.round(S/zM*1e6)/1e6;S=2*zM+M%2*zM}h.addData(u,m,_,a,s,x,S,c,o)}var HM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,WM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function UM(t){var e=new mv;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=mv.CMD,l=t.match(HM);if(!l)return e;for(var u=0;uk*k+L*L&&(M=C,I=T),{cx:M,cy:I,x0:-h,y0:-c,x1:M*(r/b-1),y1:I*(r/b-1)}}function yI(t){var e;if(Hs(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}function mI(t,e){var n,i=dI(e.r,0),r=dI(e.r0||0,0),o=i>0,a=r>0;if(o||a){if(o||(i=r,r=0),r>i){var s=i;i=r,r=s}var l=e.startAngle,u=e.endAngle;if(!isNaN(l)&&!isNaN(u)){var h=e.cx,c=e.cy,d=!!e.clockwise,p=hI(u-l),f=p>oI&&p%oI;if(f>fI&&(p=f),i>fI)if(p>oI-fI)t.moveTo(h+i*sI(l),c+i*aI(l)),t.arc(h,c,i,l,u,!d),r>fI&&(t.moveTo(h+r*sI(u),c+r*aI(u)),t.arc(h,c,r,u,l,d));else{var g=void 0,v=void 0,y=void 0,m=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,M=void 0,I=void 0,C=void 0,T=void 0,A=void 0,D=void 0,k=void 0,L=i*sI(l),P=i*aI(l),R=r*sI(u),O=r*aI(u),N=p>fI;if(N){var E=e.cornerRadius;E&&(n=yI(E),g=n[0],v=n[1],y=n[2],m=n[3]);var z=hI(i-r)/2;if(_=pI(z,y),x=pI(z,m),b=pI(z,g),w=pI(z,v),I=S=dI(_,x),C=M=dI(b,w),(S>fI||M>fI)&&(T=i*sI(u),A=i*aI(u),D=r*sI(l),k=r*aI(l),pfI){var Z=pI(y,I),Y=pI(m,I),X=vI(D,k,L,P,i,Z,d),j=vI(T,A,R,O,i,Y,d);t.moveTo(h+X.cx+X.x0,c+X.cy+X.y0),I0&&t.arc(h+X.cx,c+X.cy,Z,uI(X.y0,X.x0),uI(X.y1,X.x1),!d),t.arc(h,c,i,uI(X.cy+X.y1,X.cx+X.x1),uI(j.cy+j.y1,j.cx+j.x1),!d),Y>0&&t.arc(h+j.cx,c+j.cy,Y,uI(j.y1,j.x1),uI(j.y0,j.x0),!d))}else t.moveTo(h+L,c+P),t.arc(h,c,i,l,u,!d);else t.moveTo(h+L,c+P);if(r>fI&&N)if(C>fI){Z=pI(g,C),Y=pI(v,C),X=vI(R,O,T,A,r,-Y,d),j=vI(L,P,D,k,r,-Z,d);t.lineTo(h+X.cx+X.x0,c+X.cy+X.y0),C0&&t.arc(h+X.cx,c+X.cy,Y,uI(X.y0,X.x0),uI(X.y1,X.x1),!d),t.arc(h,c,r,uI(X.cy+X.y1,X.cx+X.x1),uI(j.cy+j.y1,j.cx+j.x1),d),Z>0&&t.arc(h+j.cx,c+j.cy,Z,uI(j.y1,j.x1),uI(j.y0,j.x0),!d))}else t.lineTo(h+R,c+O),t.arc(h,c,r,u,l,d);else t.lineTo(h+R,c+O)}else t.moveTo(h,c);t.closePath()}}}var _I=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0}return t}(),xI=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new _I},e.prototype.buildPath=function(t,e){mI(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Uv);xI.prototype.type="sector";const bI=xI;var wI=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),SI=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new wI},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(Uv);SI.prototype.type="ring";const MI=SI;function II(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d=2){if(i){var o=II(r,i,n,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],h=r[(s+1)%a];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{t.moveTo(r[0][0],r[0][1]);s=1;for(var c=r.length;stC[1]){if(a=!1,r)return a;var u=Math.abs(tC[0]-QI[1]),h=Math.abs(QI[0]-tC[1]);Math.min(u,h)>i.len()&&(uMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function TC(t){return!t.isGroup}function AC(t){return null!=t.shape}function DC(t,e,n){if(t&&e){var i=r(t);e.traverse((function(t){if(TC(t)&&t.anid){var e=i[t.anid];if(e){var r=o(t);t.attr(o(e)),Zm(t,r,n,Cy(t).dataIndex)}}}))}function r(t){var e={};return t.traverse((function(t){TC(t)&&t.anid&&(e[t.anid]=t)})),e}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return AC(t)&&(e.shape=Ts({},t.shape)),e}}function kC(t,e){return Os(t,(function(t){var n=t[0];n=lC(n,e.x),n=uC(n,e.x+e.width);var i=t[1];return i=lC(i,e.y),i=uC(i,e.y+e.height),[n,i]}))}function LC(t,e){var n=lC(t.x,e.x),i=uC(t.x+t.width,e.x+e.width),r=lC(t.y,e.y),o=uC(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function PC(t,e,n){var i=Ts({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),As(r,n),new Jv(i)):vC(t.replace("path://",""),i,n,"center")}function RC(t,e,n,i,r){for(var o=0,a=r[r.length-1];o1)return!1;var v=NC(p,f,h,c)/d;return!(v<0||v>1)}function NC(t,e,n,i){return t*i-n*e}function EC(t){return t<=1e-6&&t>=-1e-6}function zC(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=Us(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&Rs(Bs(l),(function(t){_l(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=Cy(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:As({content:i,formatterParams:s},r)}}function BC(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function VC(t,e){if(t)if(Hs(t))for(var n=0;n=0?c():h=setTimeout(c,-r),l=i};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){s=t},d}function QC(t,e,n,i){var r=t[e];if(r){var o=r[qC]||r,a=r[$C],s=r[KC];if(s!==n||a!==i){if(null==n||!i)return t[e]=o;r=t[e]=JC(o,n,"debounce"===i),r[qC]=o,r[$C]=i,r[KC]=n}return r}}function tT(t,e){var n=t[e];n&&n[qC]&&(n.clear&&n.clear(),t[e]=n[qC])}var eT=Pf(),nT={itemStyle:rg(M_,!0),lineStyle:rg(b_,!0)},iT={lineStyle:"stroke",itemStyle:"fill"};function rT(t,e){var n=t.visualStyleMapper||nT[e];return n||(console.warn("Unknown style type '"+e+"'."),nT.itemStyle)}function oT(t,e){var n=t.visualDrawType||iT[e];return n||(console.warn("Unknown style type '"+e+"'."),"fill")}var aT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=rT(t,i),a=o(r),s=r.getShallow("decal");s&&(n.setVisual("decal",s),s.dirty=!0);var l=oT(t,i),u=a[l],h=Ws(u)?u:null,c="auto"===a.fill||"auto"===a.stroke;if(!a[l]||h||c){var d=t.getColorFromPalette(t.name,null,e.getSeriesCount());a[l]||(a[l]=d,n.setVisual("colorFromPalette",!0)),a.fill="auto"===a.fill||Ws(a.fill)?d:a.fill,a.stroke="auto"===a.stroke||Ws(a.stroke)?d:a.stroke}if(n.setVisual("style",a),n.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=Ts({},a);r[l]=h(i),e.setItemVisual(n,"style",r)}}}},sT=new A_,lT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=rT(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){sT.option=n[i];var a=r(sT),s=t.ensureUniqueItemVisual(e,"style");Ts(s,a),sT.option.decal&&(t.setItemVisual(e,"decal",sT.option.decal),sT.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},uT={performRawSeries:!0,overallReset:function(t){var e=gl();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),eT(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=eT(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=oT(e,a);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var a=i[t],l=r.getItemVisual(a,"colorFromPalette");if(l){var u=r.ensureUniqueItemVisual(a,"style"),h=n.getName(t)||t+"",c=n.count();u[s]=e.getColorFromPalette(h,o,c)}}))}}))}},hT=Math.PI;function cT(t,e){e=e||{},As(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ip,i=new sy({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new Iy({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new sy({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&(r=new UI({shape:{startAngle:-hT/2,endAngle:-hT/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),r.animateShape(!0).when(1e3,{endAngle:3*hT/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*hT/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}var dT=function(){function t(t,e,n,i){this._stageTaskMap=gl(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=r?n.step:null,a=i&&i.modDataCount,s=null!=a?Math.ceil(a/o):null;return{step:o,modBy:s,modDataCount:a}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData(),r=i.count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,a=t.get("large")&&r>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?r:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:s,large:a}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=gl();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;Rs(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{}),o="";al(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}Rs(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(t){a(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),o.updatePayload(h,n);var p=o.getPerformArgs(h,i.block);d.each((function(t){t.perform(p)})),h.perform(p)&&(r=!0)}else u&&u.each((function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=gl(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||rS({plan:yT,reset:mT,count:bT}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||rS({reset:pT});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=gl(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,d="";function p(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,rS({reset:fT,onDirty:vT})));n.context={model:t,overallProgress:h},n.agent=o,n.__block=h,r._pipe(t,n)}al(!t.createOnAllSeries,d),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,Rs(n.getSeries(),p)),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return Ws(t)&&(t={overallReset:t,seriesType:wT(t)}),t.uid=k_("stageHandler"),e&&(t.visualType=e),t},t}();function pT(t){t.overallReset(t.ecModel,t.api,t.payload)}function fT(t){return t.overallProgress&&gT}function gT(){this.agent.dirty(),this.getDownstream().dirty()}function vT(){this.agent&&this.agent.dirty()}function yT(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function mT(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=hf(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?Os(e,(function(t,e){return xT(e)})):_T}var _T=xT(0);function xT(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),zT=["symbol","symbolSize","symbolRotate","symbolOffset"],BT=zT.concat(["symbolKeepAspect"]),VT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a=0&&hA(l)?l:.5;var u=t.createRadialGradient(a,s,0,a,s,l);return u}function pA(t,e,n){for(var i="radial"===e.type?dA(t,e,n):cA(t,e,n),r=e.colorStops,o=0;o0?"dashed"===t?[4*e,2*e]:"dotted"===t?[e]:Ys(t)?[t]:Hs(t)?t:null:null}function mA(t){var e=t.style,n=e.lineDash&&e.lineWidth>0&&yA(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(n){var r=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;r&&1!==r&&(n=Os(n,(function(t){return t/r})),i/=r)}return[n,i]}var _A=new mv(!0);function xA(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function bA(t){return"string"===typeof t&&"none"!==t}function wA(t){var e=t.fill;return null!=e&&"none"!==e}function SA(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function MA(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function IA(t,e,n){var i=hg(e.image,e.__image,n);if(dg(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"===typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*bl),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}function CA(t,e,n,i){var r,o=xA(n),a=wA(n),s=n.strokePercent,l=s<1,u=!e.path;e.silent&&!l||!u||e.createPathProxy();var h=e.path||_A,c=e.__dirty;if(!i){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,v=a&&!!d.image,y=o&&!!p.image,m=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=e.getBoundingRect()),f&&(m=c?pA(t,d,w):e.__canvasFillGradient,e.__canvasFillGradient=m),g&&(_=c?pA(t,p,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),v&&(x=c||!e.__canvasFillPattern?IA(t,d,e):e.__canvasFillPattern,e.__canvasFillPattern=x),y&&(b=c||!e.__canvasStrokePattern?IA(t,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),f?t.fillStyle=m:v&&(x?t.fillStyle=x:a=!1),g?t.strokeStyle=_:y&&(b?t.strokeStyle=b:o=!1)}var S,M,I=e.getGlobalScale();h.setScale(I[0],I[1],e.segmentIgnoreThreshold),t.setLineDash&&n.lineDash&&(r=mA(e),S=r[0],M=r[1]);var C=!0;(u||c&dh)&&(h.setDPR(t.dpr),l?h.setContext(null):(h.setContext(t),C=!1),h.reset(),e.buildPath(h,e.shape,i),h.toStatic(),e.pathUpdated()),C&&h.rebuildPath(t,l?s:1),S&&(t.setLineDash(S),t.lineDashOffset=M),i||(n.strokeFirst?(o&&MA(t,n),a&&SA(t,n)):(a&&SA(t,n),o&&MA(t,n))),S&&t.setLineDash([])}function TA(t,e,n){var i=e.__image=hg(n.image,e.__image,e,e.onload);if(i&&dg(i)){var r=n.x||0,o=n.y||0,a=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,h=n.sy||0;t.drawImage(i,u,h,n.sWidth,n.sHeight,r,o,a,s)}else if(n.sx&&n.sy){u=n.sx,h=n.sy;var c=a-u,d=s-h;t.drawImage(i,u,h,c,d,r,o,a,s)}else t.drawImage(i,r,o,a,s)}}function AA(t,e,n){var i,r=n.text;if(null!=r&&(r+=""),r){t.font=n.font||is,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var o=void 0,a=void 0;t.setLineDash&&n.lineDash&&(i=mA(e),o=i[0],a=i[1]),o&&(t.setLineDash(o),t.lineDashOffset=a),n.strokeFirst?(xA(n)&&t.strokeText(r,n.x,n.y),wA(n)&&t.fillText(r,n.x,n.y)):(wA(n)&&t.fillText(r,n.x,n.y),xA(n)&&t.strokeText(r,n.x,n.y)),o&&t.setLineDash([])}}var DA=["shadowBlur","shadowOffsetX","shadowOffsetY"],kA=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function LA(t,e,n,i,r){var o=!1;if(!i&&(n=n||{},e===n))return!1;if(i||e.opacity!==n.opacity){HA(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?Dg.opacity:a}(i||e.blend!==n.blend)&&(o||(HA(t,r),o=!0),t.globalCompositeOperation=e.blend||Dg.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this[ID])if(this._disposed)ok(this.id);else{var i,r,o;if(Xs(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[ID]=!0,!this._model||e){var a=new tw(this._api),s=this._theme,l=this._model=new Gb;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},uk);var u={seriesTransition:o,optionChanged:!0};if(n)this[CD]={silent:i,updateParams:u},this[ID]=!1,this.getZr().wakeUp();else{try{ED(this),VD.update.call(this,null,u)}catch(fI){throw this[CD]=null,this[ID]=!1,fI}this._ssr||this._zr.flush(),this[CD]=null,this[ID]=!1,WD.call(this,i),UD.call(this,i)}}},e.prototype.setTheme=function(){sS("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ts.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;return e.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(ts.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return Rs(e,(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){t=t||{};var e=t.excludeComponents,n=this._model,i=[],r=this;Rs(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Rs(i,(function(t){t.group.ignore=!1})),o}ok(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(fk[n]){var a=o,s=o,l=-o,u=-o,h=[],c=t&&t.pixelRatio||this.getDevicePixelRatio();Rs(pk,(function(o,c){if(o.group===n){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(Ms(t)),p=o.getDom().getBoundingClientRect();a=i(p.left,a),s=i(p.top,s),l=r(p.right,l),u=r(p.bottom,u),h.push({dom:d,left:p.left,top:p.top})}})),a*=c,s*=c,l*=c,u*=c;var d=l-a,p=u-s,f=us.createCanvas(),g=Lp(f,{renderer:e?"svg":"canvas"});if(g.resize({width:d,height:p}),e){var v="";return Rs(h,(function(t){var e=t.left-a,n=t.top-s;v+=''+t.dom+""})),g.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new sy({shape:{x:0,y:0,width:d,height:p},style:{fill:t.connectedBackgroundColor}})),Rs(h,(function(t){var e=new Jv({style:{x:t.left*c-a,y:t.top*c-s,image:t.dom}});g.add(e)})),g.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}ok(this.id)},e.prototype.convertToPixel=function(t,e){return FD(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return FD(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){if(!this._disposed){var n,i=this._model,r=Of(i,t);return Rs(r,(function(t,i){i.indexOf("Models")>=0&&Rs(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n}ok(this.id)},e.prototype.getVisual=function(t,e){var n=this._model,i=Of(n,t,{defaultMainType:"series"}),r=i.seriesModel;var o=r.getData(),a=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?o.indexOfRawIndex(i.dataIndex):null;return null!=a?GT(o,a,e):HT(o,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;Rs(rk,(function(e){var n=function(n){var i,r=t.getModel(),o=n.target,a="globalout"===e;if(a?i={}:o&&XT(o,(function(t){var e=Cy(t);if(e&&null!=e.dataIndex){var n=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return i=Ts({},e.eventData),!0}),!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)})),Rs(sk,(function(e,n){t._messageCenter.on(n,(function(t){this.trigger(n,t)}),t)})),Rs(["selectchanged"],(function(e){t._messageCenter.on(e,(function(t){this.trigger(e,t)}),t)})),YT(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?ok(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)ok(this.id);else{this._disposed=!0;var t=this.getDom();t&&Vf(this.getDom(),vk,"");var e=this,n=e._api,i=e._model;Rs(e._componentsViews,(function(t){t.dispose(i,n)})),Rs(e._chartsViews,(function(t){t.dispose(i,n)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete pk[e.id]}},e.prototype.resize=function(t){if(!this[ID])if(this._disposed)ok(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[CD]&&(null==i&&(i=this[CD].silent),n=!0,this[CD]=null),this[ID]=!0;try{n&&ED(this),VD.update.call(this,{type:"resize",animation:Ts({duration:0},t&&t.animation)})}catch(fI){throw this[ID]=!1,fI}this[ID]=!1,WD.call(this,i),UD.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)ok(this.id);else if(Xs(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),dk[t]){var n=dk[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?ok(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=Ts({},t);return e.type=sk[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)ok(this.id);else if(Xs(e)||(e={silent:!!e}),ak[t.type]&&this._model)if(this[ID])this._pendingActions.push(t);else{var n=e.silent;HD.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&ts.browser.weChat&&this._throttledZrFlush(),WD.call(this,n),UD.call(this,n)}},e.prototype.updateLabelLayout=function(){rD.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)ok(this.id);else{var e=t.seriesIndex,n=this.getModel(),i=n.getSeriesByIndex(e);0,i.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){var e=[],n=[],i=!1;if(t.eachComponent((function(t,r){var o=r.get("zlevel")||0,a=r.get("z")||0,s=r.getZLevelKey();i=i||!!s,("series"===t?n:e).push({zlevel:o,z:a,idx:r.componentIndex,type:t,key:s})})),i){var r,o,a=e.concat(n);uh(a,(function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel})),Rs(a,(function(e){var n=t.getComponent(e.type,e.idx),i=e.zlevel,a=e.key;null!=r&&(i=Math.max(r,i)),a?(i===r&&a!==o&&i++,o=a):o&&(i===r&&i++,o=""),r=i,n.setZLevel(i)}))}}function n(t){for(var e=[],n=t.currentStates,i=0;ie.get("hoverLayerThreshold")&&!ts.node&&!ts.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}function r(t,e){var n=t.get("blendMode")||null;e.eachRendered((function(t){t.isGroup||(t.style.blend=n)}))}function o(t,e){if(!t.preventAutoZ){var n=t.get("z")||0,i=t.get("zlevel")||0;e.eachRendered((function(t){return a(t,n,i,-1/0),!0}))}}function a(t,e,n,i){var r=t.getTextContent(),o=t.getTextGuideLine(),s=t.isGroup;if(s)for(var l=t.childrenRef(),u=0;u0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered((function(t){if(t.states&&t.states.emphasis){if(Xm(t))return;if(t instanceof Uv&&Gm(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&n(t)}}))}ED=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),zD(t,!0),zD(t,!1),e.plan()},zD=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l=0)){Dk.push(n);var o=TT.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function Lk(t,e){dk[t]=e}function Pk(t,e,n){var i=sD("registerMap");i&&i(t,e,n)}var Rk=MS;Ak(vD,aT),Ak(_D,lT),Ak(_D,uT),Ak(vD,VT),Ak(_D,FT),Ak(SD,nD),xk(Mw),bk(hD,Iw),Lk("default",cT),Ik({type:Vy,event:Vy,update:Vy},xl),Ik({type:Fy,event:Fy,update:Fy},xl),Ik({type:Gy,event:Gy,update:Gy},xl),Ik({type:Hy,event:Hy,update:Hy},xl),Ik({type:Wy,event:Wy,update:Wy},xl),_k("light",DT),_k("dark",NT);var Ok=[],Nk={registerPreprocessor:xk,registerProcessor:bk,registerPostInit:wk,registerPostUpdate:Sk,registerUpdateLifecycle:Mk,registerAction:Ik,registerCoordinateSystem:Ck,registerLayout:Tk,registerVisual:Ak,registerTransform:Rk,registerLoading:Lk,registerMap:Pk,registerImpl:aD,PRIORITY:MD,ComponentModel:Jx,ComponentView:TM,SeriesModel:IM,ChartView:jC,registerComponentModel:function(t){Jx.registerClass(t)},registerComponentView:function(t){TM.registerClass(t)},registerSeriesModel:function(t){IM.registerClass(t)},registerChartView:function(t){jC.registerClass(t)},registerSubTypeDefaulter:function(t,e){Jx.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Pp(t,e)}};function Ek(t){Hs(t)?Rs(t,(function(t){Ek(t)})):Ds(Ok,t)>=0||(Ok.push(t),Ws(t)&&(t={install:t}),t.install(Nk))}var zk=2*Math.PI,Bk=mv.CMD,Vk=["top","right","bottom","left"];function Fk(t,e,n,i,r){var o=n.width,a=n.height;switch(t){case"top":i.set(n.x+o/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+o/2,n.y+a+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),r.set(-1,0);break;case"right":i.set(n.x+o+e,n.y+a/2),r.set(1,0);break}}function Gk(t,e,n,i,r,o,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s);a/=u,s/=u;var h=a*n+t,c=s*n+e;if(Math.abs(i-r)%zk<1e-4)return l[0]=h,l[1]=c,u-n;if(o){var d=i;i=Sv(r),r=Sv(d)}else i=Sv(i),r=Sv(r);i>r&&(r+=zk);var p=Math.atan2(s,a);if(p<0&&(p+=zk),p>=i&&p<=r||p+zk>=i&&p+zk<=r)return l[0]=h,l[1]=c,u-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,v=n*Math.cos(r)+t,y=n*Math.sin(r)+e,m=(f-a)*(f-a)+(g-s)*(g-s),_=(v-a)*(v-a)+(y-s)*(y-s);return m<_?(l[0]=f,l[1]=g,Math.sqrt(m)):(l[0]=v,l[1]=y,Math.sqrt(_))}function Hk(t,e,n,i,r,o,a,s){var l=r-t,u=o-e,h=n-t,c=i-e,d=Math.sqrt(h*h+c*c);h/=d,c/=d;var p=l*h+u*c,f=p/d;s&&(f=Math.min(Math.max(f,0),1)),f*=d;var g=a[0]=t+f*h,v=a[1]=e+f*c;return Math.sqrt((g-r)*(g-r)+(v-o)*(v-o))}function Wk(t,e,n,i,r,o,a){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,u=a[0]=Math.min(Math.max(r,t),s),h=a[1]=Math.min(Math.max(o,e),l);return Math.sqrt((u-r)*(u-r)+(h-o)*(h-o))}var Uk=[];function Zk(t,e,n){var i=Wk(e.x,e.y,e.width,e.height,t.x,t.y,Uk);return n.set(Uk[0],Uk[1]),i}function Yk(t,e,n){for(var i,r,o=0,a=0,s=0,l=0,u=1/0,h=e.data,c=t.x,d=t.y,p=0;p0){e=e/180*Math.PI,Xk.fromArray(t[0]),jk.fromArray(t[1]),qk.fromArray(t[2]),Lu.sub(Kk,Xk,jk),Lu.sub($k,qk,jk);var n=Kk.len(),i=$k.len();if(!(n<.001||i<.001)){Kk.scale(1/n),$k.scale(1/i);var r=Kk.dot($k),o=Math.cos(e);if(o1&&Lu.copy(tL,qk),tL.toArray(t[1])}}}}function nL(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,Xk.fromArray(t[0]),jk.fromArray(t[1]),qk.fromArray(t[2]),Lu.sub(Kk,jk,Xk),Lu.sub($k,qk,jk);var i=Kk.len(),r=$k.len();if(!(i<.001||r<.001)){Kk.scale(1/i),$k.scale(1/r);var o=Kk.dot(e),a=Math.cos(n);if(o=l)Lu.copy(tL,qk);else{tL.scaleAndAdd($k,s/Math.tan(Math.PI/2-h));var c=qk.x!==jk.x?(tL.x-jk.x)/(qk.x-jk.x):(tL.y-jk.y)/(qk.y-jk.y);if(isNaN(c))return;c<0?Lu.copy(tL,jk):c>1&&Lu.copy(tL,qk)}tL.toArray(t[1])}}}}function iL(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function rL(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=Ol(i[0],i[1]),o=Ol(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=zl([],i[1],i[0],a/r),l=zl([],i[1],i[2],a/o),u=zl([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&o&&w(-c/a,0,a);var v,y,m=t[0],_=t[a-1];return x(),v<0&&S(-v,.8),y<0&&S(y,.8),x(),b(v,y,1),b(y,v,-1),x(),v<0&&M(-v),y<0&&M(y),u}function x(){v=m.rect[e]-i,y=r-_.rect[e]-_.rect[n]}function b(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){w(i*n,0,a);var r=i+t;r<0&&S(-r*n,1)}else S(-t*n,1)}}function w(n,i,r){0!==n&&(u=!0);for(var o=i;o0)for(l=0;l0;l--){d=o[l-1]*c;w(-d,l,a)}}}function M(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i0?w(n,0,i+1):w(-n,a-i-1,a),t-=n,t<=0)return}}function uL(t,e,n,i){return lL(t,"x","width",e,n,i)}function hL(t,e,n,i){return lL(t,"y","height",e,n,i)}function cL(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new Gu(0,0,0,0);function i(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r=0&&n.attr(r.oldLayoutSelect),Ds(h,"emphasis")>=0&&n.attr(r.oldLayoutEmphasis)),Zm(n,l,e,s)}else if(n.attr(l),!p_(n).valueAnimation){var c=nl(n.style.opacity,1);n.style.opacity=0,Ym(n,{style:{opacity:c}},e,s)}if(r.oldLayout=l,n.states.select){var d=r.oldLayoutSelect={};mL(d,l,_L),mL(d,n.states.select,_L)}if(n.states.emphasis){var p=r.oldLayoutEmphasis={};mL(p,l,_L),mL(p,n.states.emphasis,_L)}g_(n,s,u,e,e)}if(i&&!i.ignore&&!i.invisible){r=yL(i),o=r.oldLayout;var f={points:i.shape.points};o?(i.attr({shape:o}),Zm(i,{shape:f},e)):(i.setShape(f),i.style.strokePercent=0,Ym(i,{style:{strokePercent:1}},e)),r.oldLayout=f}},t}();const bL=xL;var wL=Pf();function SL(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){var i=wL(e).labelManager;i||(i=wL(e).labelManager=new bL),i.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var i=wL(e).labelManager;n.updatedSeries.forEach((function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()}))}function ML(t,e,n){var i=us.createCanvas(),r=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=o*n,i}Ek(SL);var IL=function(t){function e(e,n,i){var r,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,i=i||Vd,"string"===typeof e?r=ML(e,n,i):Xs(e)&&(r=e,e=r.id),o.id=e,o.dom=r;var a=r.style;return a&&(ml(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return qa(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=ML("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],a=this.maxRepaintRectCount,s=!1,l=new Gu(0,0,0,0);function u(t){if(t.isFinite()&&!t.isZero())if(0===o.length){var e=new Gu(0,0,0,0);e.copy(t),o.push(e)}else{for(var n=!1,i=1/0,r=0,u=0;u=a)}}for(var h=this.__startIndex;h15)break}}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=d.dpr,b=0;b0&&t>i[0]){for(s=0;st)break;a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?DL:0),this._needsManuallyCompositing),u.__builtin__||Ss("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==o&&(u.__dirty=!0),u.__startIndex=o,u.incremental?u.__drawIndex=-1:u.__drawIndex=o,e(o),a=u),i.__dirty&hh&&!i.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=o))}e(o),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,Rs(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?Is(n[t],e,!0):n[t]=e;for(var i=0;i=VL:-l>=VL),d=l>0?l%VL:l%VL+VL,p=!1;p=!!c||!Tc(h)&&d>=BL===!!u;var f=t+n*zL(o),g=e+i*EL(o);this._start&&this._add("M",f,g);var v=Math.round(r*FL);if(c){var y=1/this._p,m=(u?1:-1)*(VL-y);this._add("A",n,i,v,1,+u,t+n*zL(o+m),e+i*EL(o+m)),y>.01&&this._add("A",n,i,v,0,+u,f,g)}else{var _=t+n*zL(a),x=e+i*EL(a);this._add("A",n,i,v,+p,+u,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var u=[],h=this._p,c=1;c"}function iP(t){return""}function rP(t,e){e=e||{};var n=e.newline?"\n":"";function i(t){var e=t.children,r=t.tag,o=t.attrs,a=t.text;return nP(r,o)+("style"!==r?ru(a):a||"")+(e?""+n+Os(e,(function(t){return i(t)})).join(n)+n:"")+iP(r)}return i(t)}function oP(t,e,n){n=n||{};var i=n.newline?"\n":"",r=" {"+i,o=i+"}",a=Os(Bs(t),(function(e){return e+r+Os(Bs(t[e]),(function(n){return n+":"+t[e][n]+";"})).join(i)+o})).join(i),s=Os(Bs(e),(function(t){return"@keyframes "+t+r+Os(Bs(e[t]),(function(n){return n+r+Os(Bs(e[t][n]),(function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"})).join(i)+o})).join(i)+o})).join(i);return a||s?[""].join(i):""}function aP(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function sP(t,e,n,i){return eP("svg","root",{width:t,height:e,xmlns:KL,"xmlns:xlink":$L,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var lP={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},uP="transform-origin";function hP(t,e,n){var i=Ts({},t.shape);Ts(i,e),t.buildPath(n,i);var r=new HL;return r.reset(Hc(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function cP(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[uP]=n+"px "+i+"px")}var dP={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function pP(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function fP(t,e,n){var i,r,o=t.shape.paths,a={};if(Rs(o,(function(t){var e=aP(n.zrId);e.animation=!0,vP(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=Bs(o),u=l.length;if(u){r=l[u-1];var h=o[r];for(var c in h){var d=h[c];a[c]=a[c]||{d:""},a[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(r)>=0&&(i=f)}}})),i){e.d=!1;var s=pP(a,n);return i.replace(r,s)}}function gP(t){return Us(t)?lP[t]?"cubic-bezier("+lP[t]+")":jh(t)?t:"":""}function vP(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof YI){var s=fP(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u0})).length){var D=pP(h,n);return D+" "+r[0]+" both"}}for(var v in l){s=g(l[v]);s&&a.push(s)}if(a.length){var y=n.zrId+"-cls-"+n.cssClassIdx++;n.cssNodes["."+y]={animation:a.join(",")},e["class"]=y}}var yP=Math.round;function mP(t){return t&&Us(t.src)}function _P(t){return t&&Ws(t.toDataURL)}function xP(t,e,n,i){qL((function(r,o){var a="fill"===r||"stroke"===r;a&&Fc(o)?OP(e,t,r,i):a&&zc(o)?NP(n,t,r,i):t[r]=o}),e,n,!1),RP(n,t,i)}function bP(t){return Tc(t[0]-1)&&Tc(t[1])&&Tc(t[2])&&Tc(t[3]-1)}function wP(t){return Tc(t[4])&&Tc(t[5])}function SP(t,e,n){if(e&&(!wP(e)||!bP(e))){var i=n?10:1e4;t.transform=bP(e)?"translate("+yP(e[4]*i)/i+" "+yP(e[5]*i)/i+")":kc(e)}}function MP(t,e,n){for(var i=t.points,r=[],o=0;ou?(a=null==n[d+1]?null:n[d+1].elm,JP(t,a,n,l,d)):QP(t,e,s,u))}function nR(t,e){var n=e.elm=t.elm,i=t.children,r=e.children;t!==e&&(tR(t,e),XP(e.text)?jP(i)&&jP(r)?i!==r&&eR(n,i,r):jP(r)?(jP(t.text)&&WP(n,""),JP(n,null,r,0,r.length-1)):jP(i)?QP(n,i,0,i.length-1):jP(t.text)&&WP(n,""):t.text!==e.text&&(jP(i)&&QP(n,i,0,i.length-1),WP(n,e.text)))}function iR(t,e){if(KP(t,e))nR(t,e);else{var n=t.elm,i=GP(n);$P(e),null!==i&&(BP(i,e.elm,HP(n)),QP(i,[t],0,0))}return e}var rR=0,oR=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=aR("refreshHover"),this.configLayer=aR("configLayer"),this.storage=e,this._opts=n=Ts({},n),this.root=t,this._id="zr"+rR++,this._oldVNode=sP(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=tP("svg");tR(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",iR(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return PP(t,aP(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,i=this._height,r=aP(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress;var o=[],a=this._bgVNode=sR(n,i,this._backgroundColor,r);a&&o.push(a);var s=t.compress?null:this._mainVNode=eP("g","main",{},[]);this._paintList(e,r,s?s.children:o),s&&o.push(s);var l=Os(Bs(r.defs),(function(t){return r.defs[t]}));if(l.length&&o.push(eP("defs","defs",{},l)),t.animation){var u=oP(r.cssNodes,r.cssAnims,{newline:!0});if(u){var h=eP("style","stl",{},[],u);o.push(h)}}return sP(n,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},rP(this.renderToVNode({animation:nl(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:nl(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,u=0;u=0;f--)if(c&&r&&c[f]===r[f])break;for(var g=p-1;g>f;g--)s--,i=a[s-1];for(var v=f+1;v1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(h>1)for(var d=0;d1)for(var a=0;a30}var AR,DR,kR,LR,PR,RR,OR,NR=Xs,ER=Os,zR="undefined"===typeof Int32Array?Array:Int32Array,BR="e\0\0",VR=-1,FR=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],GR=["_approximateExtent"],HR=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;MR(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var r=this._nameList,o=this._idList,a=i.getSource().sourceFormat,s=a===ib;if(s&&!i.pure)for(var l=[],u=t;u0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(r=this.getVisual(e),Hs(r)?r=r.slice():NR(r)&&(r=Ts({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,NR(e)?Ts(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){NR(t)?Ts(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?Ts(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;Ty(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){Rs(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:ER(this.dimensions,this._getDimInfo,this),this.hostModel)),PR(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];Ws(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(rl(arguments)))})},t.internalField=function(){AR=function(t){var e=t._invertedIndicesMap;Rs(e,(function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new zR(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}}}(),t}();const WR=HR;function UR(t,e){Rw(t)||(t=Nw(t)),e=e||{};var n=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=gl(),o=[],a=YR(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&TR(a),l=i===t.dimensionsDefine,u=l?CR(t):IR(i),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=gl(h),d=new PS(a),p=0;p0&&(i.name=r+(o-1)),o++,e.set(r,o)}}function YR(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return Rs(e,(function(t){var e;Xs(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}function XR(t,e,n){if(n||e.hasKey(t)){var i=0;while(e.hasKey(t+i))i++;t+=i}return e.set(t,!0),t}var jR=function(){function t(t){this.coordSysDims=[],this.axisMap=gl(),this.categoryAxisMap=gl(),this.coordSysName=t}return t}();function qR(t){var e=t.get("coordinateSystem"),n=new jR(e),i=KR[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}var KR={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",Ef).models[0],o=t.getReferringComponents("yAxis",Ef).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),$R(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),$R(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",Ef).models[0];e.coordSysDims=["single"],n.set("single",r),$R(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",Ef).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),$R(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),$R(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();Rs(o.parallelAxisIndex,(function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),$R(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function $R(t){return"category"===t.get("type")}function JR(t,e,n){n=n||{};var i,r,o,a=n.byIndex,s=n.stackedCoordDimension;QR(e)?i=e:(r=e.schema,i=r.dimensions,o=e.store);var l,u,h,c,d=!(!t||!t.get("stack"));if(Rs(i,(function(t,e){Us(t)&&(i[e]=t={name:t}),d&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,f=u.type,g=0;Rs(i,(function(t){t.coordDim===p&&g++}));var v={name:h,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:c,coordDim:c,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(v.storeDimIndex=o.ensureCalculationDimension(c,f),y.storeDimIndex=o.ensureCalculationDimension(h,f)),r.appendCalculationDimension(v),r.appendCalculationDimension(y)):(i.push(v),i.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function QR(t){return!MR(t.schema)}function tO(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function eO(t,e){return tO(t,e)?t.getCalculationInfo("stackResultDimension"):e}function nO(t,e){var n,i=t.get("coordinateSystem"),r=Xb.get(i);return e&&e.coordSysDims&&(n=Os(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=yR(r)}return n}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}function iO(t,e,n){var i,r;return n&&Rs(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==i||(t[i].otherDims.itemName=0),i}function rO(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=Nw(t)):(i=r.getSource(),o=i.sourceFormat===ib);var a=qR(e),s=nO(e,a),l=n.useEncodeDefaulter,u=Ws(l)?l:l?Gs(fb,s,e):null,h={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o},c=UR(i,h),d=iO(c.dimensions,n.createInvertedIndices,a),p=o?null:r.getSharedDataStore(c),f=JR(e,{schema:c,store:p}),g=new WR(c,e);g.setCalculationInfo(f);var v=null!=d&&oO(i)?function(t,e,n,i){return i===d?n:this.defaultDimValueGetter(t,e,n,i)}:null;return g.hasItemOption=!1,g.initData(o?i:p,null,v),g}function oO(t){if(t.sourceFormat===ib){var e=aO(t.data||[]);return!Hs(pf(e))}}function aO(t){var e=0;while(e-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(IM);const uO=lO;function hO(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=tS(t,e,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a=0&&i.push(e[o])}return i.join(" ")}var dO=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.updateData(e,n,i,r),o}return qa(e,t),e.prototype._createSymbol=function(t,e,n,i,r){this.removeAll();var o=sA(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=pO,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){cm(this.childAt(0))},e.prototype.downplay=function(){dm(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},e.prototype.updateData=function(t,n,i,r){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var h=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,h)}else{var c=this.childAt(0);c.silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?c.attr(d):Zm(c,d,a,n),$m(c)}if(this._updateCommon(t,n,s,i,r),l){c=this.childAt(0);if(!u){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,Ym(c,d,a,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,r){var o,a,s,l,u,h,c,d,p,f=this.childAt(0),g=t.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,c=i.labelStatesModels,d=i.hoverScale,p=i.cursorStyle,h=i.emphasisDisabled),!i||t.hasItemOption){var v=i&&i.itemModel?i.itemModel:t.getItemModel(e),y=v.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),s=v.getModel(["select","itemStyle"]).getItemStyle(),a=v.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),u=y.get("blurScope"),h=y.get("disabled"),c=i_(v),d=y.getShallow("scale"),p=v.getShallow("cursor")}var m=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(m||0)*Math.PI/180||0);var _=uA(t.getItemVisual(e,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=t.getItemVisual(e,"style"),b=x.fill;if(f instanceof Jv){var w=f.style;f.useStyle(Ts({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(Ts({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),M=this._z2;null!=S?null==M&&(this._z2=f.z2,f.z2+=S):null!=M&&(f.z2=M,this._z2=null);var I=r&&r.useNameLabel;function C(e){return I?t.getName(e):hO(t,e)}n_(f,c,{labelFetcher:g,labelDataIndex:e,defaultText:C,inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var T=f.ensureState("emphasis");T.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var A=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;T.scaleX=this._sizeX*A,T.scaleY=this._sizeY*A,this.setSymbolScale(1),km(this,l,u,h)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=Cy(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&jm(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();jm(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return lA(t.getItemVisual(e,"symbolSize"))},e}(Ip);function pO(t,e){this.parent.drift(t,e)}const fO=dO;function gO(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function vO(t){return null==t||Xs(t)||(t={isIgnore:t}),t||{}}function yO(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:i_(e),cursorStyle:e.get("cursor")}}var mO=function(){function t(t){this.group=new Ip,this._SymbolCtor=t||fO}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=vO(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=yO(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add((function(i){var r=u(i);if(gO(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(h,c){var d=r.getItemGraphicEl(c),p=u(h);if(gO(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),d=new o(t,h,s,l),d.setPosition(p);else{d.updateData(t,h,s,l);var v={x:p[0],y:p[1]};a?d.attr(v):Zm(d,v,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=yO(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=vO(n);for(var r=t.start;r0?n=i[0]:i[1]<0&&(n=i[1]),n}function wO(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var SO="undefined"!==typeof Float32Array,MO=SO?Float32Array:Array;function IO(t){return Hs(t)?SO?new Float32Array(t):t:new MO(t)}function CO(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}function TO(t,e,n,i,r,o,a,s){for(var l=CO(t,e),u=[],h=[],c=[],d=[],p=[],f=[],g=[],v=xO(r,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],_=0;_=r||g<0)break;if(kO(y,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,m),c=y,d=m;else{var _=y-u,x=m-h;if(_*_+x*x<.5){g+=o;continue}if(a>0){var b=g+o,w=e[2*b],S=e[2*b+1];while(w===y&&S===m&&v=i||kO(w,S))p=y,f=m;else{C=w-u,T=S-h;var k=y-u,L=w-y,P=m-h,R=S-m,O=void 0,N=void 0;if("x"===s){O=Math.abs(k),N=Math.abs(L);var E=C>0?1:-1;p=y-E*O*a,f=m,A=y+E*N*a,D=m}else if("y"===s){O=Math.abs(P),N=Math.abs(R);var z=T>0?1:-1;p=y,f=m-z*O*a,A=y,D=m+z*N*a}else O=Math.sqrt(k*k+P*P),N=Math.sqrt(L*L+R*R),I=N/(N+O),p=y-C*a*(1-I),f=m-T*a*(1-I),A=y+C*a*I,D=m+T*a*I,A=AO(A,DO(w,y)),D=AO(D,DO(S,m)),A=DO(A,AO(w,y)),D=DO(D,AO(S,m)),C=A-y,T=D-m,p=y-C*O/N,f=m-T*O/N,p=AO(p,DO(u,y)),f=AO(f,DO(h,m)),p=DO(p,AO(u,y)),f=DO(f,AO(h,m)),C=y-p,T=m-f,A=y+C*N/O,D=m+T*N/O}t.bezierCurveTo(c,d,p,f,y,m),c=A,d=D}else t.lineTo(y,m)}u=y,h=m,g+=o}return v}var PO=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),RO=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return qa(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new PO},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0;r--)if(!kO(n[2*r-2],n[2*r-1]))break;for(;i=0){var m=s?(d-i)*y+i:(c-n)*y+n;return s?[t,m]:[m,t]}n=c,i=d;break;case a.C:c=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++],v=o[u++];var _=s?Nh(n,c,p,g,t,l):Nh(i,d,f,v,t,l);if(_>0)for(var x=0;x<_;x++){var b=l[x];if(b<=1&&b>=0){m=s?Rh(i,d,f,v,b):Rh(n,c,p,g,b);return s?[t,m]:[m,t]}}n=g,i=v;break}}},e}(Uv),OO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e}(PO),NO=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new OO},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0;o--)if(!kO(n[2*o-2],n[2*o-1]))break;for(;re){i?r.push(a(i,l,e)):n&&r.push(a(n,l,0),a(n,l,e));break}n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}}return r}function XO(t,e,n){var i=t.getVisual("visualMeta");if(i&&i.length&&t.count()&&"cartesian2d"===e.type){for(var r,o,a=i.length-1;a>=0;a--){var s=t.getDimensionInfo(i[a].dimension);if(r=s&&s.coordDim,"x"===r||"y"===r){o=i[a];break}}if(o){var l=e.getAxis(r),u=Os(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),h=u.length,c=o.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var d=YO(u,"x"===r?n.getWidth():n.getHeight()),p=d.length;if(!p&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var f=10,g=d[0].coord-f,v=d[p-1].coord+f,y=v-g;if(y<.001)return"transparent";Rs(d,(function(t){t.offset=(t.coord-g)/y})),d.push({offset:p?d[p-1].offset:.5,color:c[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:c[0]||"transparent"});var m=new KI(0,0,0,0,d,!0);return m[r]=g,m[r+"2"]=v,m}}}function jO(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!qO(o,e))){var a=e.mapDimension(o.dim),s={};return Rs(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function qO(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;ai)return!1;return!0}function KO(t,e){return isNaN(t)||isNaN(e)}function $O(t){for(var e=t.length/2;e>0;e--)if(!KO(t[2*e-2],t[2*e-1]))break;return e-1}function JO(t,e){return[t[2*e],t[2*e+1]]}function QO(t,e,n){for(var i,r,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u=e||i>=e&&r<=e){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}function tN(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"])){var O=p.getState("emphasis").style;O.lineWidth=+p.style.lineWidth+1}Cy(p).seriesIndex=t.seriesIndex,km(p,L,P,R);var N=WO(t.get("smooth")),E=t.get("smoothMonotone");if(p.setShape({smooth:N,smoothMonotone:E,connectNulls:w}),f){var z=a.getCalculationInfo("stackedOnSeries"),B=0;f.useStyle(As(l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),z&&(B=WO(z.get("smooth"))),f.setShape({smooth:N,stackedOnSmooth:B,smoothMonotone:E,connectNulls:w}),Om(f,t,"areaStyle"),Cy(f).seriesIndex=t.seriesIndex,km(f,L,P,R)}var V=function(t){i._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=V)})),this._polyline.onHoverStateChange=V,this._data=a,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=C,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,p),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){Cy(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),o=Lf(r,i);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel")||0,c=t.get("z")||0;s=new fO(r,o),s.x=l,s.y=u,s.setZ(h,c);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=h,d.z=c,d.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else jC.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),o=Lf(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else jC.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;nm(this._polyline,t),e&&nm(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new RO({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new NO({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(i=o.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===o.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");Ws(l)&&(l=l(null));var u=s.get("animationDelay")||0,h=Ws(u)?u(null):u;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var c=[t.x,t.y],d=void 0,p=void 0,f=void 0;if(n)if(r){var g=n,v=e.pointToCoord(c);i?(d=g.startAngle,p=g.endAngle,f=-v[1]/180*Math.PI):(d=g.r0,p=g.r,f=v[0])}else{var y=n;i?(d=y.x,p=y.x+y.width,f=t.x):(d=y.y+y.height,p=y.y,f=t.y)}var m=p===d?0:(f-d)/(p-d);a&&(m=1-m);var _=Ws(u)?u(o):l*m+h,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(tN(t)){var r=t.getData(),o=this._polyline,a=r.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||(s=this._endLabel=new Iy({z2:200}),s.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=$O(a);l>=0&&(n_(o,i_(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?cO(r,n):hO(r,t)},enableTextSetter:!0},nN(i,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),v=f.inverse,y=e.shape,m=v?g?y.x:y.y+y.height:g?y.x+y.width:y.y,_=(g?p:0)*(v?-1:1),x=(g?0:-p)*(v?-1:1),b=g?"x":"y",w=QO(u,m,b),S=w.range,M=S[1]-S[0],I=void 0;if(M>=1){if(M>1&&!c){var C=JO(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),r&&(I=h.getRawValue(S[0]))}else{C=l.getPointOn(m,b);C&&s.attr({x:C[0]+_,y:C[1]+x});var T=h.getRawValue(S[0]),A=h.getRawValue(S[1]);r&&(I=Wf(n,d,T,A,w.t))}i.lastFrameIndex=S[0]}else{var D=1===t||i.lastFrameIndex>0?S[0]:0;C=JO(u,D);r&&(I=h.getRawValue(D)),s.attr({x:C[0]+_,y:C[1]+x})}if(r){var k=p_(s);"function"===typeof k.setLabelText&&k.setLabelText(I)}}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=t.hostModel,h=TO(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,o),c=h.current,d=h.stackedOnCurrent,p=h.next,f=h.stackedOnNext;if(r&&(c=ZO(h.current,n,r,a),d=ZO(h.stackedOnCurrent,n,r,a),p=ZO(h.next,n,r,a),f=ZO(h.stackedOnNext,n,r,a)),HO(c,p)>3e3||l&&HO(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=h.current,s.shape.points=c;var g={shape:{points:p}};h.current!==c&&(g.shape.__points=h.next),s.stopAnimation(),Zm(s,g,u),l&&(l.setShape({points:c,stackedOnPoints:d}),l.stopAnimation(),Zm(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var v=[],y=h.status,m=0;me&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),d=Math.round(a/c);if(isFinite(d)&&d>1){"lttb"===r&&t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/d));var p=void 0;Us(r)?p=aN[r]:Ws(r)&&(p=r),p&&t.setData(i.downSample(i.mapDimension(l.dim),1/d,p,sN))}}}}}function uN(t){t.registerChartView(rN),t.registerSeriesModel(uO),t.registerLayout(oN("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,lN("line"))}var hN="__ec_stack_";function cN(t){return t.get("stack")||hN+t.seriesIndex}function dN(t){return t.dim+t.index}function pN(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}function vN(t){var e=gN(t),n=[];return Rs(t,(function(t){var i,r=t.coordinateSystem,o=r.getBaseAxis(),a=o.getExtent();if("category"===o.type)i=o.getBandWidth();else if("value"===o.type||"time"===o.type){var s=o.dim+"_"+o.index,l=e[s],u=Math.abs(a[1]-a[0]),h=o.scale.getExtent(),c=Math.abs(h[1]-h[0]);i=l?u/c*l:u}else{var d=t.getData();i=Math.abs(a[1]-a[0])/d.count()}var p=zp(t.get("barWidth"),i),f=zp(t.get("barMaxWidth"),i),g=zp(t.get("barMinWidth")||(wN(t)?.5:1),i),v=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:f,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:dN(o),stackId:cN(t)})})),yN(n)}function yN(t){var e={};Rs(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(o.gap=c);var d=t.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return Rs(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=Bs(i).length;o=Math.max(35-4*a,15)+"%"}var s=zp(o,r),l=zp(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),Rs(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var d,p=0;Rs(i,(function(t,e){t.width||(t.width=c),d=t,p+=t.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;Rs(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),n}function mN(t,e,n){if(t&&e){var i=t[dN(e)];return null!=i&&null!=n?i[cN(n)]:i}}function _N(t,e){var n=fN(t,e),i=vN(n);Rs(n,(function(t){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),o=cN(t),a=i[dN(r)][o],s=a.offset,l=a.width;e.setLayout({bandWidth:a.bandWidth,offset:s,size:l})}))}function xN(t){return{seriesType:t,plan:AM(),reset:function(t){if(bN(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=n.getOtherAxis(i),o=e.getDimensionIndex(e.mapDimension(r.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(r.dim),u=e.getCalculationInfo("stackResultDimension"),h=tO(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),c=r.isHorizontal(),d=SN(i,r),p=wN(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),v=e.getLayout("size"),y=e.getLayout("offset");return{progress:function(t,e){var i,r=t.count,l=p&&IO(3*r),u=p&&s&&IO(3*r),m=p&&IO(r),_=n.master.getRect(),x=c?_.width:_.height,b=e.getStore(),w=0;while(null!=(i=t.next())){var S=b.get(h?g:o,i),M=b.get(a,i),I=d,C=void 0;h&&(C=+S-b.get(o,i));var T=void 0,A=void 0,D=void 0,k=void 0;if(c){var L=n.dataToPoint([S,M]);if(h){var P=n.dataToPoint([C,M]);I=P[0]}T=I,A=L[1]+y,D=L[0]-I,k=v,Math.abs(D)a){u=(d+l)/2;break}1===c&&(h=p-i[0].tickValue)}null==u&&(l?l&&(u=i[i.length-1].coord):u=i[0].coord),o[n]=t.toGlobalCoord(u)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=i.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(IM);IM.registerClass(MN);const IN=MN;var CN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(){return sO(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=R_(IN.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(IN);const TN=CN;var AN=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}return t}(),DN=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new AN},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-r),s=r+a,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=2*Math.PI,d=h?u-lMath.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}function RN(t,e,n){return e*Math.sin(t)*(n?-1:1)}function ON(t,e,n){return e*Math.cos(t)*(n?1:-1)}function NN(t,e,n){var i=t.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;Hs(i)||(i=[i,i,i,i]);var r=Math.abs(e.r||0-e.r0||0);return{cornerRadius:Os(i,(function(t){return lp(t,r)}))}}var EN=Math.max,zN=Math.min;function BN(t,e){var n=t.getArea&&t.getArea();if(VO(t,"cartesian2d")){var i=t.getBaseAxis();if("category"!==i.type||!i.onBand){var r=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}var VN=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return qa(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var r=t.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var r,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?r=u.isHorizontal():"polar"===l.type&&(r="angle"===u.dim);var h=t.isAnimationEnabled()?t:null,c=HN(t,l);c&&this._enableRealtimeSort(c,a,n);var d=t.get("clip",!0)||c,p=BN(l,a);o.removeClipPath();var f=t.get("roundCap",!0),g=t.get("showBackground",!0),v=t.getModel("backgroundStyle"),y=v.get("borderRadius")||0,m=[],_=this._backgroundEls,x=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function w(t){var e=jN[l.type](a,t),n=oE(l,r,e);return n.useStyle(v.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",y):n.setShape("cornerRadius",y),m[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),i=jN[l.type](a,e,n);if(g&&w(e),a.hasValue(e)&&XN[l.type](i)){var s=!1;d&&(s=FN[l.type](p,i));var v=GN[l.type](t,a,e,i,r,h,u.model,!1,f);c&&(v.forceLabelAnimation=!0),$N(v,a,e,n,i,t,r,"polar"===l.type),x?v.attr({shape:i}):c?WN(c,h,v,i,e,r,!1,!1):Ym(v,{shape:i},t,e),a.setItemGraphicEl(e,v),o.add(v),v.ignore=s}})).update((function(e,n){var i=a.getItemModel(e),S=jN[l.type](a,e,i);if(g){var M=void 0;0===_.length?M=w(n):(M=_[n],M.useStyle(v.getItemStyle()),"cartesian2d"===l.type?M.setShape("r",y):M.setShape("cornerRadius",y),m[e]=M);var I=jN[l.type](a,e),C=rE(r,I,l);Zm(M,{shape:C},h,e)}var T=s.getItemGraphicEl(n);if(a.hasValue(e)&&XN[l.type](S)){var A=!1;if(d&&(A=FN[l.type](p,S),A&&o.remove(T)),T?$m(T):T=GN[l.type](t,a,e,S,r,h,u.model,!!T,f),c&&(T.forceLabelAnimation=!0),b){var D=T.getTextContent();if(D){var k=p_(D);null!=k.prevValue&&(k.prevValue=k.value)}}else $N(T,a,e,i,S,t,r,"polar"===l.type);x?T.attr({shape:S}):c?WN(c,h,T,S,e,r,!0,b):Zm(T,{shape:S},t,e,null),a.setItemGraphicEl(e,T),T.ignore=A,o.add(T)}else o.remove(T)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&Km(n,t,e)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Ip);S.removeAll();for(var M=0;Mo)return!0;o=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){Km(e,t,Cy(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(jC),FN={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,a=EN(e.x,t.x),s=zN(e.x+e.width,r),l=EN(e.y,t.y),u=zN(e.y+e.height,o),h=sr?s:a,e.y=c&&l>o?u:l,e.width=h?0:s-a,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=zN(e.r,t.r),o=EN(e.r0,t.r0);e.r=r,e.r0=o;var a=r-o<0;if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},GN={cartesian2d:function(t,e,n,i,r,o,a,s,l){var u=new sy({shape:Ts({},i),z2:1});if(u.__dataIndex=n,u.name="item",o){var h=u.shape,c=r?"height":"width";h[c]=0}return u},polar:function(t,e,n,i,r,o,a,s,l){var u=!r&&l?kN:bI,h=new u({shape:i,z2:1});h.name="item";var c=KN(r);if(h.calculateTextPosition=LN(c,{isRoundCap:u===kN}),o){var d=h.shape,p=r?"r":"endAngle",f={};d[p]=r?i.r0:i.startAngle,f[p]=i[p],(s?Zm:Ym)(h,{shape:f},o)}return h}};function HN(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function WN(t,e,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?Zm:Ym)(n,{shape:l},e,r,null);var h=e?t.baseAxis.model:null;(a?Zm:Ym)(n,{shape:u},h,r)}function UN(t,e){for(var n=0;n0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function qN(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}function KN(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function $N(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=t.shape,h=NN(i.getModel("itemStyle"),u,!0);Ts(u,h),t.setShape(u)}}else{var c=i.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var d=i.getShallow("cursor");d&&t.attr("cursor",d);var p=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",f=i_(i);n_(t,f,{labelFetcher:o,labelDataIndex:n,defaultText:hO(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=t.getTextContent();if(s&&g){var v=i.get(["label","position"]);t.textConfig.inside="middle"===v||null,PN(t,"outside"===v?p:v,KN(a),i.get(["label","rotate"]))}f_(g,f,o.getRawValue(n),(function(t){return cO(e,t)}));var y=i.getModel(["emphasis"]);km(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Om(t,i),qN(r)&&(t.style.fill="none",t.style.stroke="none",Rs(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}function JN(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var i=t.get(["itemStyle","borderWidth"])||0,r=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,r,o)}var QN=function(){function t(){}return t}(),tE=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new QN},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l=0?n:null}),30,!1);function iE(t,e,n){for(var i=t.baseDimIdx,r=1-i,o=t.shape.points,a=t.largeDataIndices,s=[],l=[],u=t.barWidth,h=0,c=o.length/3;h=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[h]}return-1}function rE(t,e,n){if(VO(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}r=n.getArea();var o=e;return{cx:r.cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}function oE(t,e,n){var i="polar"===t.type?bI:sy;return new i({shape:rE(e,n,t),silent:!0,z2:0})}const aE=VN;function sE(t){t.registerChartView(aE),t.registerSeriesModel(TN),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Gs(_N,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,xN("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,lN("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))}var lE=2*Math.PI,uE=Math.PI/180;function hE(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function cE(t,e){var n=hE(t,e),i=t.get("center"),r=t.get("radius");Hs(r)||(r=[0,r]);var o,a,s=zp(n.width,e.getWidth()),l=zp(n.height,e.getHeight()),u=Math.min(s,l),h=zp(r[0],u/2),c=zp(r[1],u/2),d=t.coordinateSystem;if(d){var p=d.dataToPoint(i);o=p[0]||0,a=p[1]||0}else Hs(i)||(i=[i,i]),o=zp(i[0],s)+n.x,a=zp(i[1],l)+n.y;return{cx:o,cy:a,r0:h,r:c}}function dE(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),r=hE(t,n),o=cE(t,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,h=-t.get("startAngle")*uE,c=t.get("minAngle")*uE,d=0;e.each(i,(function(t){!isNaN(t)&&d++}));var p=e.getSum(i),f=Math.PI/(p||d)*2,g=t.get("clockwise"),v=t.get("roseType"),y=t.get("stillShowZeroSum"),m=e.getDataExtent(i);m[0]=0;var _=lE,x=0,b=h,w=g?1:-1;if(e.setLayout({viewRect:r,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:g,cx:a,cy:s,r0:u,r:v?NaN:l});else{i="area"!==v?0===p&&y?f:t*f:lE/d,in?a:o,h=Math.abs(l.label.y-n);if(h>=u.maxY){var c=l.label.x-e-l.len2*r,d=i+l.len,f=Math.abs(c)t.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var v=(i.style.margin||0)+2.1;o.height=g.height+v,o.y-=(o.height-c)/2}}}function mE(t){return"center"===t.position}function _E(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*fE,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,h=s.x,c=s.y,d=s.height;function p(t){t.ignore=!0}function f(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}i.each((function(t){var s=i.getItemGraphicEl(t),c=s.shape,d=s.getTextContent(),g=s.getTextGuideLine(),v=i.getItemModel(t),y=v.getModel("label"),m=y.get("position")||v.get(["emphasis","label","position"]),_=y.get("distanceToLabelLine"),x=y.get("alignTo"),b=zp(y.get("edgeDistance"),u),w=y.get("bleedMargin"),S=v.getModel("labelLine"),M=S.get("length");M=zp(M,u);var I=S.get("length2");if(I=zp(I,u),Math.abs(c.endAngle-c.startAngle)0?"right":"left":L>0?"left":"right"}var F=Math.PI,G=0,H=y.get("rotate");if(Ys(H))G=H*(F/180);else if("center"===m)G=0;else if("radial"===H||!0===H){var W=L<0?-k+F:-k;G=W}else if("tangential"===H&&"outside"!==m&&"outer"!==m){var U=Math.atan2(L,P);U<0&&(U=2*F+U);var Z=P>0;Z&&(U=F+U),G=U-F}if(o=!!G,d.x=C,d.y=T,d.rotation=G,d.setStyle({verticalAlign:"middle"}),R){d.setStyle({align:D});var Y=d.states.select;Y&&(Y.x+=d.x,Y.y+=d.y)}else{var X=d.getBoundingRect().clone();X.applyTransform(d.getComputedTransform());var j=(d.style.margin||0)+2.1;X.y-=j/2,X.height+=j,r.push({label:d,labelLine:g,position:m,len:M,len2:I,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new Lu(L,P),linePoints:A,textAlign:D,labelDistance:_,labelAlignTo:x,edgeDistance:b,bleedMargin:w,rect:X,unconstrainedWidth:X.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:R})}})),!o&&t.get("avoidLabelOverlap")&&vE(r,e,n,l,u,d,h,c);for(var g=0;g0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=i.r0}},e.type="pie",e}(jC);const wE=bE;function SE(t,e,n){e=Hs(e)&&{coordDimensions:e}||Ts({encodeDefine:t.getEncode()},e);var i=t.getSource(),r=UR(i,e).dimensions,o=new WR(r,t);return o.initData(i,n),o}var ME=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},t.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},t.prototype.getItemVisual=function(t,e){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,e)},t}();const IE=ME;var CE=Pf(),TE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new IE(Fs(this.getData,this),Fs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return SE(this,{coordDimensions:["value"],encodeDefaulter:Gs(gb,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=CE(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),(function(t){o.push(t)})),r=i.seats=Wp(o,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=r[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(IM);const AE=TE;function DE(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf((function(t){var e=n.mapDimension("value"),i=n.get(e,t);return!(Ys(i)&&!isNaN(i)&&i<0)}))}}}function kE(t){t.registerChartView(wE),t.registerSeriesModel(AE),UT("pie",t.registerAction),t.registerLayout(Gs(dE,"pie")),t.registerProcessor(pE("pie")),t.registerProcessor(DE("pie"))}var LE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){return sO(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(IM);const PE=LE;var RE=4,OE=function(){function t(){}return t}(),NE=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return qa(e,t),e.prototype.getDefaultShape=function(){return new OE},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();if(t=n[0],e=n[1],i.contain(t,e)){var r=this.hoverDataIdx=this.findDataIndex(t,e);return r>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const zE=EE;var BE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=oN("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext,r=i.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new zE:new _O,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(jC);const VE=BE;var FE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Jx);const GE=FE;var HE=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},t.prototype.getCoordSysModel=function(){},t}(),WE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ef).models[0]},e.type="cartesian2dAxis",e}(Jx);Ls(WE,HE);var UE={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},ZE=Is({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},UE),YE=Is({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},UE),XE=Is({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},YE),jE=As({logBase:10},YE);const qE={category:ZE,value:YE,time:XE,log:jE};var KE=0,$E=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++KE}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&Os(i,JE);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!Us(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return e=i.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=gl(this.categories))},t}();function JE(t){return Xs(t)&&null!=t.value?t.value:t+""}const QE=$E;var tz={value:1,category:1,time:1,log:1};function ez(t,e,n,i){Rs(tz,(function(r,o){var a=Is(Is({},qE[o],!0),i,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return qa(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=Zx(this),i=n?Xx(t):{},r=e.getTheme();Is(t,r.get(o+"Axis")),Is(t,this.getDefaultOption()),t.type=nz(t),n&&Yx(t,i,n)},n.prototype.optionUpdated=function(){var t=this.option;"category"===t.type&&(this.__ordinalMeta=QE.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",nz)}function nz(t){return t.type||(t.data?"category":"value")}var iz=function(){function t(t){this._setting=t||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();ig(iz);const rz=iz;function oz(t){return"interval"===t.type||"log"===t.type}function az(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=Jp(o/e,!0);null!=n&&ai&&(a=r.interval=i);var s=r.intervalPrecision=lz(a),l=r.niceTickExtent=[Bp(Math.ceil(t[0]/a)*a,s),Bp(Math.floor(t[1]/a)*a,s)];return hz(l,t),r}function sz(t){var e=Math.pow(10,$p(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Bp(n*e)}function lz(t){return Fp(t)+2}function uz(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function hz(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),uz(t,0,e),uz(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function cz(t,e){return t>=e[0]&&t<=e[1]}function dz(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function pz(t,e){return t*(e[1]-e[0])+e[0]}var fz=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new QE({})),Hs(i)&&(i=new QE({categories:Os(i,(function(t){return Xs(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return qa(e,t),e.prototype.parse=function(t){return null==t?NaN:Us(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),cz(t,this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),dz(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(pz(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){var t=[],e=this._extent,n=e[0];while(n<=e[1])t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(rz);rz.registerClass(fz);const gz=fz;var vz=Bp,yz=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return qa(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return cz(t,this._extent)},e.prototype.normalize=function(t){return dz(t,this._extent)},e.prototype.scale=function(t){return pz(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=lz(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;var a=1e4;n[0]a)return[]}var l=o.length?o[o.length-1].value:i[1];return n[1]>l&&(t?o.push({value:vz(l+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&c>>1;t[r][1]n&&(this._approxInterval=n);var o=bz.length,a=Math.min(_z(bz,this._approxInterval,0,o),o-1);this._interval=bz[a][1],this._minLevelUnit=bz[Math.max(a-1,0)][0]},e.prototype.parse=function(t){return Ys(t)?t:+qp(t)},e.prototype.contain=function(t){return cz(this.parse(t),this._extent)},e.prototype.normalize=function(t){return dz(this.parse(t),this._extent)},e.prototype.scale=function(t){return pz(t,this._extent)},e.type="time",e}(mz),bz=[["second",Y_],["minute",X_],["hour",j_],["quarter-day",6*j_],["half-day",12*j_],["day",1.2*q_],["half-week",3.5*q_],["week",7*q_],["month",31*q_],["quarter",95*q_],["half-year",K_/2],["year",K_]];function wz(t,e,n,i){var r=qp(e),o=qp(n),a=function(t){return ux(r,t,i)===ux(o,t,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},h=function(){return u()&&a("hour")},c=function(){return h()&&a("minute")},d=function(){return c()&&a("second")},p=function(){return d()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return d();case"millisecond":return p()}}function Sz(t,e){return t/=q_,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Mz(t){var e=30*q_;return t/=e,t>6?6:t>3?3:t>2?2:1}function Iz(t){return t/=j_,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Cz(t,e){return t/=e?X_:Y_,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Tz(t){return Jp(t,!0)}function Az(t,e,n){var i=new Date(t);switch(ix(e)){case"year":case"month":i[mx(n)](0);case"day":i[_x(n)](1);case"hour":i[xx(n)](0);case"minute":i[bx(n)](0);case"second":i[Sx(n)](0),i[Mx(n)](0)}return i.getTime()}function Dz(t,e,n,i){var r=1e4,o=ex,a=0;function s(t,e,n,r,o,a,s){var l=new Date(e),u=e,h=l[r]();while(u1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u=i[0]&&m<=i[1]&&c++)}var _=(i[1]-i[0])/e;if(c>1.5*_&&d>_/1.5)break;if(u.push(v),c>_||t===o[p])break}h=[]}}}var x=Es(Os(u,(function(t){return Es(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),b=[],w=x.length-1;for(p=0;p0)i*=10;var o=[Bp(Nz(e[0]/i)*i),Bp(Oz(e[1]/i)*i)];this._interval=i,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){Pz.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=zz(t)/zz(this.base),cz(t,this._extent)},e.prototype.normalize=function(t){return t=zz(t)/zz(this.base),dz(t,this._extent)},e.prototype.scale=function(t){return t=pz(t,this._extent),Ez(this.base,t)},e.type="log",e}(rz),Vz=Bz.prototype;function Fz(t,e){return Rz(t,Fp(e))}Vz.getMinorTicks=Pz.getMinorTicks,Vz.getLabel=Pz.getLabel,rz.registerClass(Bz);const Gz=Bz;var Hz=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[Uz[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=Wz[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),Wz={min:"_determinedMin",max:"_determinedMax"},Uz={min:"_dataMin",max:"_dataMax"};function Zz(t,e,n){var i=t.rawExtentInfo;return i||(i=new Hz(t,e,n),t.rawExtentInfo=i,i)}function Yz(t,e){return null==e?null:tl(e)?NaN:t.parse(e)}function Xz(t,e){var n=t.type,i=Zz(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=fN("bar",a),l=!1;if(Rs(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=vN(s),h=jz(r,o,e,u);r=h.min,o=h.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function jz(t,e,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=mN(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;Rs(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;Rs(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=1-(s+l)/o,d=h/c-h;return e+=d*(l/u),t-=d*(s/u),{min:t,max:e}}function qz(t,e){var n=e,i=Xz(t,n),r=i.extent,o=n.get("splitNumber");t instanceof Gz&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function Kz(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new gz({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new kz({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(rz.getClass(e)||mz)}}function $z(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}function Jz(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?function(e){return function(n,i){return t.scale.getFormattedLabel(n,i,e)}}(e):Us(e)?function(e){return function(n){var i=t.scale.getLabel(n),r=e.replace("{value}",null!=i?i:"");return r}}(e):Ws(e)?function(e){return function(i,r){return null!=n&&(r=i.value-n),e(Qz(t,i),r,null!=i.level?{level:i.level}:null)}}(e):function(e){return t.scale.getLabel(e)}}function Qz(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function tB(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();n instanceof gz?r=n.count():(i=n.getTicks(),r=i.length);var a,s=t.getLabelModel(),l=Jz(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;ht[1]&&(t[1]=i[1])}))}var aB=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return Os(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Es(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}();const sB=aB;var lB=["x","y"];function uB(t){return"interval"===t.type||"time"===t.type}var hB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=lB,e}return qa(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(uB(t)&&uB(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,h=r[0]-n[0]*l,c=r[1]-i[0]*u,d=this._transform=[l,0,0,u,h,c];this._invTransform=Au([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new Gu(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return Bl(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return e=e||[],e[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return Bl(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),i=Math.min(e[0],e[1]),r=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-i;return new Gu(n,i,r,o)},e}(sB);const cB=hB;var dB=Pf();function pB(t){return"category"===t.type?gB(t):mB(t)}function fB(t,e){return"category"===t.type?yB(t,e):{ticks:Os(t.scale.getTicks(),(function(t){return t.value}))}}function gB(t){var e=t.getLabelModel(),n=vB(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function vB(t,e){var n,i,r=_B(t,"labels"),o=nB(e),a=xB(r,o);return a||(Ws(o)?n=CB(t,o):(i="auto"===o?wB(t):o,n=IB(t,i)),bB(r,o,{labels:n,labelCategoryInterval:i}))}function yB(t,e){var n,i,r=_B(t,"ticks"),o=nB(e),a=xB(r,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),Ws(o))n=CB(t,o,!0);else if("auto"===o){var s=vB(t,t.getLabelModel());i=s.labelCategoryInterval,n=Os(s.labels,(function(t){return t.tickValue}))}else i=o,n=IB(t,i,!0);return bB(r,o,{ticks:n,tickCategoryInterval:i})}function mB(t){var e=t.scale.getTicks(),n=Jz(t);return{labels:Os(e,(function(e,i){return{level:e.level,formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}function _B(t,e){return dB(t)[e]||(dB(t)[e]=[])}function xB(t,e){for(var n=0;n40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),d=0,p=0;l<=o[1];l+=s){var f=0,g=0,v=rp(n({value:l}),e.font,"center","top");f=1.3*v.width,g=1.3*v.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var y=d/h,m=p/c;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),x=dB(t.model),b=t.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}function MB(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function IB(t,e,n){var i=Jz(t),r=t.scale,o=r.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],h=r.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=iB(t),d=a.get("showMinLabel")||c,p=a.get("showMaxLabel")||c;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return p&&f-l!==o[1]&&g(o[1]),s}function CB(t,e,n){var i=t.scale,r=Jz(t),o=[];return Rs(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var TB=[0,1],AB=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Hp(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),DB(n,i.count())),Ep(t,TB,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),DB(n,i.count()));var r=Ep(t,n,TB,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=fB(this,e),i=n.ticks,r=Os(i,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this),o=e.get("alignWithLabel");return kB(this,r,o,t.clamp),r},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),i=Os(n,(function(t){return Os(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return i},t.prototype.getViewLabels=function(){return pB(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return SB(this)},t}();function DB(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function kB(t,e,n,i){var r=e.length;if(t.onBand&&!n&&r){var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[1]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;Rs(e,(function(t){t.coord-=u/2}));var h=t.scale.getExtent();a=1+h[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a},e.push(o)}var c=s[0]>s[1];d(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]}),d(s[1],o.coord)&&(i?o.coord=s[1]:e.pop()),i&&d(o.coord,s[1])&&e.push({coord:s[1]})}function d(t,e){return t=Bp(t),e=Bp(e),c?t>e:te[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(LB);const RB=PB;function OB(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===u?[c[2]-p,c[3]+p]:[c[0]-p,c[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:c[0],"x"===u?f[d[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);var v={top:-1,bottom:1,left:-1,right:1};o.labelDirection=o.tickDirection=o.nameDirection=v[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),el(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var y=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-y:y,o.z2=1,o}function NB(t){return"cartesian2d"===t.get("coordinateSystem")}function EB(t){var e={xAxisModel:null,yAxisModel:null};return Rs(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Ef).models[0];e[i]=o})),e}var zB=Math.log;function BB(t,e,n){var i=mz.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=Xz(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;if("log"===t.type){var d=zB(t.base);u=[zB(u[0])/d,zB(u[1])/d]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var p=i.getExtent.call(t);h&&(u[0]=p[0]),c&&(u[1]=p[1]);var f=i.getInterval.call(t),g=u[0],v=u[1];if(h&&c)f=(v-g)/a;else if(h){v=u[0]+f*a;while(vu[0]&&isFinite(g)&&isFinite(u[0]))f=sz(f),g=u[1]-f*a}else{var y=t.getTicks().length-1;y>a&&(f=sz(f));var m=f*a;v=Math.ceil(u[1]/f)*f,g=Bp(v-m),g<0&&u[0]>=0?(g=0,v=Bp(m)):v>0&&u[1]<=0&&(v=0,g=-Bp(m))}var _=(r[0].value-o[0].value)/s,x=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+f*_,v+f*x),i.setInterval.call(t,f),(_||x)&&i.setNiceExtent.call(t,g+f,v-f)}var VB=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=lB,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=Bs(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=+n[o],s=t[a],l=s.model,u=s.scale;oz(u)&&l.get("alignTicks")&&null==l.get("interval")?r.push(s):(qz(u,l),oz(u)&&(e=s))}r.length&&(e||(e=r.pop(),qz(e.scale,e.model)),Rs(r,(function(t){BB(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};Rs(n.x,(function(t){GB(n,"y",t,r)})),Rs(n.y,(function(t){GB(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=Hx(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){Rs(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),WB(t,e?o.x:o.y)}))}s(),r&&(Rs(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=tB(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+i,"top"===t.position?o.y+=e.height+i:"left"===t.position&&(o.x+=e.width+i)}}})),s()),Rs(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}Xs(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i0?"top":"bottom",i="center"):Xp(o-ZB)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),XB={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Bl(s,s,a),Bl(l,l,a));var h=Ts({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new EI({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});bC(c.shape,c.style.lineWidth),c.anid="line",n.add(c);var d=e.get(["axisLine","symbol"]);if(null!=d){var p=e.get(["axisLine","symbolSize"]);Us(d)&&(d=[d,d]),(Us(p)||Ys(p))&&(p=[p,p]);var f=uA(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],v=p[1];Rs([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==d[i]&&null!=d[i]){var r=sA(d[i],-g/2,-v/2,g,v,h.stroke,!0),o=e.r+e.offset,a=u?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=tV(n,i,e,t),o=nV(n,i,e,t);if(qB(e,o,r),eV(n,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var a=sL(Os(o,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})));cL(a)}},axisName:function(t,e,n,i){var r=el(t.axisName,e.get("name"));if(r){var o,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),h=e.get("nameGap")||0,c=e.axis.getExtent(),d=c[0]>c[1]?-1:1,p=["start"===s?c[0]-d*h:"end"===s?c[1]+d*h:(c[0]+c[1])/2,JB(s)?t.labelOffset+l*h:0],f=e.get("nameRotate");null!=f&&(f=f*ZB/180),JB(s)?o=YB.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=jB(t.rotation,s,f||0,c),a=t.axisNameAvailableWidth,null!=a&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=el(t.nameTruncateMaxWidth,v.maxWidth,a),_=new Iy({x:p[0],y:p[1],rotation:o.rotation,silent:YB.isLabelSilent(e),style:r_(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:y,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(zC({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=YB.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,Cy(_).eventData=x}i.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function jB(t,e,n,i){var r,o,a=Yp(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return Xp(a-ZB/2)?(o=l?"bottom":"top",r="center"):Xp(a-1.5*ZB)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*ZB&&a>ZB/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:r,textVerticalAlign:o}}function qB(t,e,n){if(!iB(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),r=t.get(["axisLabel","showMaxLabel"]);e=e||[],n=n||[];var o=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],h=n[1],c=n[n.length-1],d=n[n.length-2];!1===i?(KB(o),KB(u)):$B(o,a)&&(i?(KB(a),KB(h)):(KB(o),KB(u))),!1===r?(KB(s),KB(c)):$B(l,s)&&(r?(KB(l),KB(d)):(KB(s),KB(c)))}}function KB(t){t&&(t.ignore=!0)}function $B(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=wu([]);return Cu(r,r,-t.rotation),n.applyTransform(Mu([],r,t.getLocalTransform())),i.applyTransform(Mu([],r,e.getLocalTransform())),n.intersect(i)}}function JB(t){return"middle"===t||"center"===t}function QB(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function hV(t){var e=cV(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=pV(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a0&&!c.min?c.min=0:null!=c.min&&c.min<0&&!c.max&&(c.max=0);var d=a;null!=c.color&&(d=As({color:c.color},a));var p=Is(Ms(c),{boundaryGap:t,splitNumber:e,scale:n,axisLine:i,axisTick:r,axisLabel:o,name:c.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:d,triggerEvent:h},!1);if(Us(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else Ws(l)&&(p.name=l(p.name,p));var g=new A_(p,null,this.ecModel);return Ls(g,HE.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=c},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Is({lineStyle:{color:"#bbb"}},VV.axisLine),axisLabel:FV(VV.axisLabel,!1),axisTick:FV(VV.axisTick,!1),splitLine:FV(VV.splitLine,!0),splitArea:FV(VV.splitArea,!0),indicator:[]},e}(Jx);const HV=GV;var WV=["axisLine","axisTickLabel","axisName"],UV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes(),i=Os(n,(function(t){var n=t.model.get("showName")?t.name:"",i=new iV(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return i}));Rs(i,(function(t){Rs(WV,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var i=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),a=r.getModel("lineStyle"),s=o.getModel("areaStyle"),l=r.get("show"),u=o.get("show"),h=a.get("color"),c=s.get("color"),d=Hs(h)?h:[h],p=Hs(c)?c:[c],f=[],g=[];if("circle"===i)for(var v=n[0].getTicksCoords(),y=e.cx,m=e.cy,_=0;_3?1.4:r>1?1.2:1.1,l=i>0?s:1/s;rF(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(i),h=(i>0?1:-1)*(u>3?.4:u>1?.15:.05);rF(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!eF(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;rF(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Zl);function rF(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(gu(i.event),oF(t,e,n,i,r))}function oF(t,e,n,i,r){r.isAvailableBehavior=Fs(aF,null,n,i),t.trigger(e,r)}function aF(t,e,n){var i=n[t];return!t||i&&(!Us(i)||e.event[i+"Key"])}const sF=iF;function lF(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}function uF(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var hF,cF={axisPointer:1,tooltip:1,brush:1};function dF(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!cF.hasOwnProperty(i.mainType)&&r&&r.model!==n}function pF(t){if(Us(t)){var e=new DOMParser;t=e.parseFromString(t,"text/xml")}var n=t;9===n.nodeType&&(n=n.firstChild);while("svg"!==n.nodeName.toLowerCase()||1!==n.nodeType)n=n.nextSibling;return n}var fF={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-anchor":"textAlign",visibility:"visibility",display:"display"},gF=Bs(fF),vF={"alignment-baseline":"textBaseline","stop-color":"stopColor"},yF=Bs(vF),mF=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var n=pF(t);this._defsUsePending=[];var i=new Ip;this._root=i;var r=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),s=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),MF(n,i,null,!0,!1);var l,u,h=n.firstChild;while(h)this._parseNode(h,i,r,null,!1,!1),h=h.nextSibling;if(AF(this._defs,this._defsUsePending),this._defsUsePending=[],o){var c=kF(o);c.length>=4&&(l={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(l&&null!=a&&null!=s&&(u=zF(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var d=i;i=new Ip,i.add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new sy({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:r}},t.prototype._parseNode=function(t,e,n,i,r,o){var a,s=t.nodeName.toLowerCase(),l=i;if("defs"===s&&(r=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!r){var u=hF[s];if(u&&_l(hF,s)){a=u.call(this,t,e);var h=t.getAttribute("name");if(h){var c={name:h,namedFrom:null,svgNodeTagLower:s,el:a};n.push(c),"g"===s&&(l=c)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var d=_F[s];if(d&&_l(_F,s)){var p=d.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup){var g=t.firstChild;while(g)1===g.nodeType?this._parseNode(g,a,n,l,r,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling}},t.prototype._parseText=function(t,e){var n=new Xv({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});wF(e,n),MF(t,n,this._defsUsePending,!1,!1),IF(n,e);var i=n.style,r=i.fontSize;r&&r<9&&(i.fontSize=9,n.scaleX*=r/9,n.scaleY*=r/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=function(){hF={g:function(t,e){var n=new Ip;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new sy;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new tI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new EI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new iI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,i=t.getAttribute("points");i&&(n=SF(i));var r=new DI({shape:{points:n||[]},silent:!0});return wF(e,r),MF(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var n,i=t.getAttribute("points");i&&(n=SF(i));var r=new PI({shape:{points:n||[]},silent:!0});return wF(e,r),MF(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var n=new Jv;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(o);var a=new Ip;return wF(e,a),MF(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new Ip;return wF(e,a),MF(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(o),a},path:function(t,e){var n=t.getAttribute("d")||"",i=jM(n);return wF(e,i),MF(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),_F={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),o=new KI(e,n,i,r);return xF(t,o),bF(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),r=new JI(e,n,i);return xF(t,r),bF(t,r),r}};function xF(t,e){var n=t.getAttribute("gradientUnits");"userSpaceOnUse"===n&&(e.global=!0)}function bF(t,e){var n=t.firstChild;while(n){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),r=void 0;r=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var o={};NF(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function wF(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),As(e.__inheritedStyle,t.__inheritedStyle))}function SF(t){for(var e=kF(t),n=[],i=0;i0;o-=2){var a=i[o],s=i[o-1],l=kF(a);switch(r=r||bu(),s){case"translate":Iu(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Tu(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Cu(r,r,-parseFloat(l[0])*PF);break;case"skewX":var u=Math.tan(parseFloat(l[0])*PF);Mu(r,[1,0,u,1,0,0],r);break;case"skewY":var h=Math.tan(parseFloat(l[0])*PF);Mu(r,[1,h,0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5]);break}}e.setLocalTransform(r)}}var OF=/([^\s:;]+)\s*:\s*([^:;]+)/g;function NF(t,e,n){var i=t.getAttribute("style");if(i){var r;OF.lastIndex=0;while(null!=(r=OF.exec(i))){var o=r[1],a=_l(fF,o)?fF[o]:null;a&&(e[a]=r[2]);var s=_l(vF,o)?vF[o]:null;s&&(n[s]=r[2])}}}function EF(t,e,n){for(var i=0;in&&(t=r,n=a)}if(t)return ZF(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var n=[1/0,1/0],i=[-1/0,-1/0],r=this.geometries;return Rs(r,(function(e){"polygon"===e.type?UF(e.exterior,n,i,t):Rs(e.points,(function(e){UF(e,n,i,t)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(i[0])&&isFinite(i[1])||(n[0]=n[1]=i[0]=i[1]=0),e=new Gu(n[0],n[1],i[0]-n[0],i[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,r=n.length;i>1^-(1&s),l=l>>1^-(1&l),s+=r,l+=o,r=s,o=l,i.push([s/n,l/n])}return i}function rG(t,e){return t=eG(t),Os(Es(t.features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new XF(o[0],o.slice(1)));break;case"MultiPolygon":Rs(i.coordinates,(function(t){t[0]&&r.push(new XF(t[0],t.slice(1)))}));break;case"LineString":r.push(new jF([i.coordinates]));break;case"MultiLineString":r.push(new jF(i.coordinates))}var a=new qF(n[e||"name"],r,n.cp);return a.properties=n,a}))}for(var oG=[126,25],aG="南海诸岛",sG=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],lG=0;lG0,g={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:f,isGeo:o,transformInfoRaw:c};"geoJSON"===s.resourceType?this._buildGeoJSON(g):"geoSVG"===s.resourceType&&this._buildSVG(g),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=gl(),n=gl(),i=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=t.geo.projection,l=s&&s.stream;function u(t,e){return e&&(t=e(t)),t&&[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]}function h(t){for(var e=[],n=!l&&s&&s.project,i=0;i=0)&&(d=r);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;n_(e,i_(i),{labelFetcher:d,labelDataIndex:c,defaultText:n},p);var f=e.getTextContent();if(f&&(IG(f).ignore=f.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function LG(t,e,n,i,r,o){t.data?t.data.setItemGraphicEl(o,e):Cy(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:n,region:i&&i.option||{}}}function PG(t,e,n,i,r){t.data||zC({el:e,componentModel:r,itemName:n,itemTooltipOption:i.get("tooltip")})}function RG(t,e,n,i,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=i.getModel("emphasis"),a=o.get("focus");return km(e,a,o.get("blurScope"),o.get("disabled")),t.isGeo&&zm(e,r,n),a}function OG(t,e,n){var i,r=[];function o(){i=[]}function a(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(t,e){isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&s.polygonStart(),Rs(t,(function(t){s.lineStart();for(var e=0;e-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(IM);const VG=BG;function FG(t,e){var n={};return Rs(t,(function(t){t.each(t.mapDimension("value"),(function(e,i){var r="ec-"+t.getName(i);n[r]=n[r]||[],isNaN(e)||n[r].push(e)}))})),t[0].map(t[0].mapDimension("value"),(function(i,r){for(var o,a="ec-"+t[0].getName(r),s=0,l=1/0,u=-1/0,h=n[a].length,c=0;c1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=c[1]-p.height/2,p.x=c[0]-p.width/2;else{var b=t.getBoxLayoutParams();b.aspect=_,p=Hx(b,{width:y,height:m})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}function QG(t,e){Rs(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}var tH=function(){function t(){this.dimensions=jG}return t.prototype.create=function(t,e){var n=[];function i(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}t.eachComponent("geo",(function(t,r){var o=t.get("map"),a=new $G(o+r,o,Ts({nameMap:t.get("nameMap")},i(t)));a.zoomLimit=t.get("scaleLimit"),n.push(a),t.coordinateSystem=a,a.model=t,a.resize=JG,a.resize(t,e)})),t.eachSeries((function(t){var e=t.get("coordinateSystem");if("geo"===e){var i=t.get("geoIndex")||0;t.coordinateSystem=n[i]}}));var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),Rs(r,(function(t,r){var o=Os(t,(function(t){return t.get("nameMap")})),a=new $G(r,r,Ts({nameMap:Cs(o)},i(t[0])));a.zoomLimit=el.apply(null,Os(t,(function(t){return t.get("scaleLimit")}))),n.push(a),a.resize=JG,a.resize(t[0],e),Rs(t,(function(t){t.coordinateSystem=a,QG(a,t)}))})),n},t.prototype.getFilledRegions=function(t,e,n,i){for(var r=(t||[]).slice(),o=gl(),a=0;a=0;a--){var s=i[a];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(s)}}function pH(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,r=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){mH(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=_H(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function fH(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function gH(t){return arguments.length?t:MH}function vH(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function yH(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function mH(t){var e=t.children,n=e.length,i=0,r=0;while(--n>=0){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}function _H(t,e,n,i){if(e){var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,u=o.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;while(s=xH(s),o=bH(o),s&&o){r=xH(r),a=bH(a),r.hierNode.ancestor=t;var d=s.hierNode.prelim+c-o.hierNode.prelim-u+i(s,o);d>0&&(SH(wH(s,t,n),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=r.hierNode.modifier,h+=a.hierNode.modifier}s&&!xH(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),o&&!bH(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-h,n=t)}return n}function xH(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function bH(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function wH(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function SH(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function MH(t,e){return t.parentNode===e.parentNode?1:2}var IH=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),CH=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new IH},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,r=e.parentPoint,o=n[0],a=n[i-1];if(1===i)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=zp(e.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(a[u]-r[u])*h,t.moveTo(r[0],r[1]),t.lineTo(c[0],c[1]),t.moveTo(o[0],o[1]),c[l]=o[l],t.lineTo(c[0],c[1]),c[l]=a[l],t.lineTo(c[0],c[1]),t.lineTo(a[0],a[1]);for(var d=1;dm.x,b||(x-=Math.PI));var S=b?"left":"right",M=s.getModel("label"),I=M.get("rotate"),C=I*(Math.PI/180),T=v.getTextContent();T&&(v.setTextConfig({position:M.get("position")||S,rotation:null==I?-x:C,origin:"center"}),T.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),D="relative"===A?vl(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;D&&(Cy(n).focus=D),kH(r,a,h,n,f,p,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&i.hoverState===Ry||nm(n.__edge,e)}})}function kH(t,e,n,i,r,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),d=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new GI({shape:OH(h,c,d,r,r)})),Zm(g,{shape:OH(h,c,d,o,a)},t));else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var v=e.children,y=[],m=0;me&&(e=i.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,n=e.data.getItemModel(this.dataIndex);return n.getModel(t)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e=0){var i=n.getData().tree.root,r=t.targetNode;if(Us(r)&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function JH(t){var e=[];while(t)t=t.parentNode,t&&e.push(t);return e.reverse()}function QH(t,e){var n=JH(t);return Ds(n,e)>=0}function tW(t,e){var n=[];while(t){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var eW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return qa(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i=new A_(n,this,this.ecModel),r=KH.createTree(e,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}var a=0;r.eachNode("preorder",(function(t){t.depth>a&&(a=t.depth)}));var s=t.expandAndCollapse,l=s&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return r.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=l})),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().tree,r=i.root.children[0],o=i.getNodeByDataIndex(t),a=o.getValue(),s=o.name;while(o&&o!==r)s=o.parentNode.name+"."+s,o=o.parentNode;return qS("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=tW(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(IM);const nW=eW;function iW(t,e,n){var i,r=[t],o=[];while(i=r.pop())if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s=0;o--)i.push(r[o])}}function oW(t,e){t.eachSeriesByType("tree",(function(t){aW(t,e)}))}function aW(t,e){var n=yH(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=gH((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(r=n.width,o=n.height,a=gH());var s=t.getData().tree.root,l=s.children[0];if(l){dH(s),iW(l,pH,a),s.hierNode.modifier=-l.hierNode.prelim,rW(l,fH);var u=l,h=l,c=l;rW(l,(function(t){var e=t.getLayout().x;eh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)}));var d=u===h?1:a(u,h)/2,p=d-u.getLayout().x,f=0,g=0,v=0,y=0;if("radial"===i)f=r/(h.getLayout().x+d+p),g=o/(c.depth-1||1),rW(l,(function(t){v=(t.getLayout().x+p)*f,y=(t.depth-1)*g;var e=vH(v,y);t.setLayout({x:e.x,y:e.y,rawX:v,rawY:y},!0)}));else{var m=t.getOrient();"RL"===m||"LR"===m?(g=o/(h.getLayout().x+d+p),f=r/(c.depth-1||1),rW(l,(function(t){y=(t.getLayout().x+p)*g,v="LR"===m?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:v,y},!0)}))):"TB"!==m&&"BT"!==m||(f=r/(h.getLayout().x+d+p),g=o/(c.depth-1||1),rW(l,(function(t){v=(t.getLayout().x+p)*f,y="TB"===m?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:v,y},!0)})))}}}function sW(t){t.eachSeriesByType("tree",(function(t){var e=t.getData(),n=e.tree;n.eachNode((function(t){var n=t.getModel(),i=n.getModel("itemStyle").getItemStyle(),r=e.ensureUniqueItemVisual(t.dataIndex,"style");Ts(r,i)}))}))}function lW(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,i=e.getData().tree,r=i.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(t,e,n){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var i=e.coordinateSystem,r=aH(i,t,void 0,n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}function uW(t){t.registerChartView(NH),t.registerSeriesModel(nW),t.registerLayout(oW),t.registerVisual(sW),lW(t)}var hW=["treemapZoomToNode","treemapRender","treemapMove"];function cW(t){for(var e=0;e1)n=n.parentNode;var r=Db(t.ecModel,n.name||n.dataIndex+"",i);e.setVisual("decal",r)}))}var pW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};fW(n);var i=t.levels||[],r=this.designatedVisualItemStyle={},o=new A_({itemStyle:r},this,e);i=t.levels=gW(i,e);var a=Os(i||[],(function(t){return new A_(t,o,e)}),this),s=KH.createTree(n,this,l);function l(t){t.wrapMethod("getItemModel",(function(t,e){var n=s.getNodeByDataIndex(e),i=n?a[n.depth]:null;return t.parentModel=i||o,t}))}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),o=i.getName(t);return qS("nameValue",{name:o,value:r})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=tW(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Ts(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=gl(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){dW(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(IM);function fW(t){var e=0;Rs(t.children,(function(t){fW(t);var n=t.value;Hs(n)&&(n=n[0]),e+=n}));var n=t.value;Hs(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Hs(t.value)?t.value[0]=n:t.value=n}function gW(t,e){var n=hf(e.get("color")),i=hf(e.get(["aria","decal","decals"]));if(n){var r,o;t=t||[],Rs(t,(function(t){var e=new A_(t),n=e.get("color"),i=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(e.get(["itemStyle","decal"])||i&&"none"!==i)&&(o=!0)}));var a=t[0]||(t[0]={});return r||(a.color=n.slice()),!o&&i&&(a.decal=i.slice()),t}}const vW=pW;var yW=8,mW=8,_W=5,xW=function(){function t(t){this.group=new Ip,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=r.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),h={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,h,l),this._renderContent(t,h,a,s,l,u,i),Wx(o,h.pos,h.box)}},t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var r=Mf(i.getModel().get("name"),""),o=n.getTextRect(r),a=Math.max(o.width+2*yW,e.emptyItemWidth);e.totalWidth+=a+mW,e.renderList.push({node:i,text:r,width:a})}},t.prototype._renderContent=function(t,e,n,i,r,o,a){for(var s=0,l=e.emptyItemWidth,u=t.get(["breadcrumb","height"]),h=Gx(e.pos,e.box),c=e.totalWidth,d=e.renderList,p=i.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],v=g.node,y=g.width,m=g.text;c>h.width&&(c-=y-l,y=l,m=null);var _=new DI({shape:{points:bW(s,0,y,u,f===d.length-1,0===f)},style:As(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Iy({style:r_(r,{text:m})}),textConfig:{position:"inside"},z2:1e4*zy,onclick:Gs(a,v)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=r_(o,{text:m}),_.ensureState("emphasis").style=p,km(_,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(_),wW(_,t,v),s+=y+mW}},t.prototype.remove=function(){this.group.removeAll()},t}();function bW(t,e,n,i,r,o){var a=[[r?t:t-_W,e],[t+n,e],[t+n,e+i],[r?t:t-_W,e+i]];return!o&&a.splice(2,0,[t+n+_W,e+i/2]),!r&&a.push([t,e+i/2]),a}function wW(t,e,n){Cy(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&tW(n,e)}}const SW=xW;var MW=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,i,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,r=this._storage.length;iAW||Math.abs(t.dy)>AW)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var o=new Gu(r.x,r.y,r.width,r.height),a=this.seriesModel.layoutInfo;e-=a.x,n-=a.y;var s=bu();Iu(s,s,[-e,-n]),Tu(s,s,[t.scale,t.scale]),Iu(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var o=r.hostTree.data.getItemModel(r.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Nx(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new SW(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(QH(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=BW(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n,i=this.seriesModel.getViewRoot();return i.eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),a=r.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:i,offsetX:o[0],offsetY:o[1]}}}),this),n},e.type="treemap",e}(jC);function BW(){return{nodeGroup:[],background:[],content:[]}}function VW(t,e,n,i,r,o,a,s,l,u){if(a){var h=a.getLayout(),c=t.getData(),d=a.getModel();if(c.setItemGraphicEl(a.dataIndex,null),h&&h.isInView){var p=h.width,f=h.height,g=h.borderWidth,v=h.invisible,y=a.getRawIndex(),m=s&&s.getRawIndex(),_=a.viewChildren,x=h.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),M=d.getModel(["blur","itemStyle"]),I=d.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,T=F("nodeGroup",CW);if(T){if(l.add(T),T.x=h.x||0,T.y=h.y||0,T.markRedraw(),EW(T).nodeWidth=p,EW(T).nodeHeight=f,h.isAboveViewRoot)return T;var A=F("background",TW,u,PW);A&&N(T,A,b&&h.upperLabelHeight);var D=d.getModel("emphasis"),k=D.get("focus"),L=D.get("blurScope"),P=D.get("disabled"),R="ancestor"===k?a.getAncestorsIndices():"descendant"===k?a.getDescendantIndices():k;if(b)Em(T)&&Nm(T,!1),A&&(Nm(A,!P),c.setItemGraphicEl(a.dataIndex,A),Lm(A,R,L));else{var O=F("content",TW,u,RW);O&&E(T,O),A.disableMorphing=!0,A&&Em(A)&&Nm(A,!1),Nm(T,!P),c.setItemGraphicEl(a.dataIndex,T),Lm(T,R,L)}return T}}}function N(e,n,i){var r=Cy(n);if(r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:C}),v)z(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=NW(w);l.fill=s;var u=OW(S);u.fill=S.get("borderColor");var h=OW(M);h.fill=M.get("borderColor");var c=OW(I);if(c.fill=I.get("borderColor"),i){var d=p-2*g;B(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=h,n.ensureState("select").style=c,lm(n)}e.add(n)}function E(e,n){var i=Cy(n);i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var r=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:o,r:C}),v)z(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=NW(w);u.fill=l,u.decal=s.decal;var h=OW(S),c=OW(M),d=OW(I);B(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=h,n.ensureState("blur").style=c,n.ensureState("select").style=d,lm(n)}e.add(n)}function z(t){!t.invisible&&o.push(t)}function B(e,n,i,r){var o=d.getModel(r?kW:DW),s=Mf(d.get("name"),null),l=o.getShallow("show");n_(e,i_(d,r?kW:DW),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var c=u.style,p=ol(c.padding||0);r&&(e.setTextConfig({layoutRect:r}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((r?r.width:e.shape.width)-p[1]-p[3],0),n=Math.max((r?r.height:e.shape.height)-p[0]-p[2],0);c.width===t&&c.height===n||u.setStyle({width:t,height:n})},c.truncateMinChar=2,c.lineOverflow="truncate",V(c,r,h);var f=u.getState("emphasis");V(f?f.style:null,r,h)}}function V(e,n,i){var r=e?e.text:null;if(!n&&i.isLeafRoot&&null!=r){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+r:r}}function F(t,i,o,a){var s=null!=m&&n[t][m],l=r[t];return s?(n[t][m]=null,G(l,s)):v||(s=new i,s instanceof zg&&(s.z2=FW(o,a)),H(l,s)),e[t][y]=s}function G(t,e){var n=t[y]={};e instanceof CW?(n.oldX=e.x,n.oldY=e.y):n.oldShape=Ts({},e.shape)}function H(t,e){var n=t[y]={},o=a.parentNode,s=e instanceof Ip;if(o&&(!i||"drillDown"===i.direction)){var l=0,u=0,h=r.background[o.getRawIndex()];!i&&h&&h.oldShape&&(l=h.oldShape.width,u=h.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}function FW(t,e){return t*LW+e}const GW=zW;var HW=Rs,WW=Xs,UW=-1,ZW=function(){function t(e){var n=e.mappingMethod,i=e.type,r=this.option=Ms(e);this.type=i,this.mappingMethod=n,this._normalizeData=iU[n];var o=t.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(jW(r),YW(r)):"category"===n?r.categories?XW(r):jW(r,!0):(al("linear"!==n||r.dataExtent),jW(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return Fs(this._normalizeData,this)},t.listVisualTypes=function(){return Bs(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){Xs(t)?Rs(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,i){var r,o=Hs(e)?[]:Xs(e)?{}:(r=!0,null);return t.eachVisual(e,(function(t,e){var a=n.call(i,t,e);r?o=a:o[e]=a})),o},t.retrieveVisuals=function(e){var n,i={};return e&&HW(t.visualHandlers,(function(t,r){e.hasOwnProperty(r)&&(i[r]=e[r],n=!0)})),n?i:null},t.prepareVisualTypes=function(t){if(Hs(t))t=t.slice();else{if(!WW(t))return[];var e=[];HW(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var i,r=1/0,o=0,a=e.length;o=0;o--)null==i[o]&&(delete n[e[o]],e.pop())}function jW(t,e){var n=t.visual,i=[];Xs(n)?HW(n,(function(t){i.push(t)})):null!=n&&i.push(n);var r={color:1,symbol:1};e||1!==i.length||r.hasOwnProperty(t.type)||(i[1]=i[0]),nU(t,i)}function qW(t){return{applyVisual:function(e,n,i){var r=this.mapValueToVisual(e);i("color",t(n("color"),r))},_normalizedToVisual:tU([0,1])}}function KW(t){var e=this.option.visual;return e[Math.round(Ep(t,[0,1],[0,e.length-1],!0))]||{}}function $W(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function JW(t){var e=this.option.visual;return e[this.option.loop&&t!==UW?t%e.length:t]}function QW(){return this.option.visual[0]}function tU(t){return{linear:function(e){return Ep(e,t,this.option.visual,!0)},category:JW,piecewise:function(e,n){var i=eU.call(this,n);return null==i&&(i=Ep(e,t,this.option.visual,!0)),i},fixed:QW}}function eU(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=ZW.findPieceIndex(t,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function nU(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=Os(e,(function(t){var e=fc(t);return e||[0,0,0,1]}))),e}var iU={linear:function(t){return Ep(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=ZW.findPieceIndex(t,e,!0);if(null!=n)return Ep(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?UW:e},fixed:xl};function rU(t,e,n){return t?e<=n:e=n.length||t===n[t.depth]){var o=vU(r,u,t,e,f,i);uU(t,o,n,i)}}))}else s=cU(u),h.fill=s}}function hU(t,e,n){var i=Ts({},e),r=n.designatedVisualItemStyle;return Rs(["color","colorAlpha","colorSaturation"],(function(n){r[n]=e[n];var o=t.get(n);r[n]=null,null!=o&&(i[n]=o)})),i}function cU(t){var e=pU(t,"color");if(e){var n=pU(t,"colorAlpha"),i=pU(t,"colorSaturation");return i&&(e=xc(e,null,null,i)),n&&(e=bc(e,n)),e}}function dU(t,e){return null!=e?xc(e,null,null,t):null}function pU(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function fU(t,e,n,i,r,o){if(o&&o.length){var a=gU(e,"color")||null!=r.color&&"none"!==r.color&&(gU(e,"colorAlpha")||gU(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:a.name,dataExtent:u,visual:a.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new oU(c);return sU(d).drColorMappingBy=h,d}}}function gU(t,e){var n=t.get(e);return Hs(n)&&n.length?{name:e,range:n}:null}function vU(t,e,n,i,r,o){var a=Ts({},e);if(r){var s=r.type,l="color"===s&&sU(r).drColorMappingBy,u="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(u)}return a}var yU=Math.max,mU=Math.min,_U=el,xU=Rs,bU=["itemStyle","borderWidth"],wU=["itemStyle","gapWidth"],SU=["upperLabel","show"],MU=["upperLabel","height"];const IU={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=Hx(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=zp(_U(s.width,l[0]),r),h=zp(_U(s.height,l[1]),o),c=i&&i.type,d=["treemapZoomToNode","treemapRootToNode"],p=$H(i,d,t),f="treemapRender"===c||"treemapMove"===c?i.rootRect:null,g=t.getViewRoot(),v=JH(g);if("treemapMove"!==c){var y="treemapZoomToNode"===c?RU(t,p,g,u,h):f?[f.width,f.height]:[u,h],m=a.sort;m&&"asc"!==m&&"desc"!==m&&(m="desc");var _={squareRatio:a.squareRatio,sort:m,leafDepth:a.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(x),CU(g,_,!1,0),x=g.getLayout(),xU(v,(function(t,e){var n=(v[e+1]||g).getValue();t.setLayout(Ts({dataExtent:[n,n],borderWidth:0,upperHeight:0},x))}))}var b=t.getData().tree.root;b.setLayout(OU(s,f,p),!0),t.setLayoutInfo(s),NU(b,new Gu(-s.x,-s.y,r,o),v,g,0)}};function CU(t,e,n,i){var r,o;if(!t.isRemoved()){var a=t.getLayout();r=a.width,o=a.height;var s=t.getModel(),l=s.get(bU),u=s.get(wU)/2,h=EU(s),c=Math.max(l,h),d=l-u,p=c-u;t.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),r=yU(r-2*d,0),o=yU(o-d-p,0);var f=r*o,g=TU(t,s,f,e,n,i);if(g.length){var v={x:d,y:p,width:r,height:o},y=mU(r,o),m=1/0,_=[];_.area=0;for(var x=0,b=g.length;x=0;l--){var u=r["asc"===i?a-l-1:l].getValue();u/n*ea[1]&&(a[1]=e)}))):a=[NaN,NaN],{sum:i,dataExtent:a}}function LU(t,e,n){for(var i=0,r=1/0,o=0,a=void 0,s=t.length;oi&&(i=a));var l=t.area*t.area,u=e*e*n;return l?yU(u*i/l,l/(u*r)):1/0}function PU(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],h=e?t.area/e:0;(r||h>n[l[a]])&&(h=n[l[a]]);for(var c=0,d=t.length;cZp&&(u=Zp),a=o}ui&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a0&&(m[0]=-m[0],m[1]=-m[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(y[1],y[0]);u[0].8?"left":h[0]<-.8?"right":"center",d=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*f+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",d=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+w,c=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+w,c="center",i.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+w,c=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-w;break}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||d,align:i.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Ip);const AZ=TZ;var DZ=function(){function t(t){this.group=new Ip,this._LineCtor=t||AZ}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=LZ(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=LZ(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||kZ(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0}function LZ(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:i_(e)}}function PZ(t){return isNaN(t[0])||isNaN(t[1])}function RZ(t){return t&&!PZ(t[0])&&!PZ(t[1])}const OZ=DZ;var NZ=[],EZ=[],zZ=[],BZ=Fh,VZ=El,FZ=Math.abs;function GZ(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,h=.1;h<=.9;h+=.1){NZ[0]=BZ(r[0],o[0],a[0],h),NZ[1]=BZ(r[1],o[1],a[1],h);var c=FZ(VZ(NZ,e)-l);c=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function HZ(t,e){var n=[],i=Uh,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[Ml(l[0]),Ml(l[1])],l[2]&&l.__original.push(Ml(l[2])));var c=l.__original;if(null!=l[2]){if(Sl(r[0],c[0]),Sl(r[1],c[2]),Sl(r[2],c[1]),u&&"none"!==u){var d=iZ(t.node1),p=GZ(r,c[0],d*e);i(r[0][0],r[1][0],r[2][0],p,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],p,n),r[0][1]=n[3],r[1][1]=n[4]}if(h&&"none"!==h){d=iZ(t.node2),p=GZ(r,c[1],d*e);i(r[0][0],r[1][0],r[2][0],p,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],p,n),r[1][1]=n[1],r[2][1]=n[2]}Sl(l[0],r[0]),Sl(l[1],r[2]),Sl(l[2],r[1])}else{if(Sl(o[0],c[0]),Sl(o[1],c[1]),Al(a,o[1],o[0]),Pl(a,a),u&&"none"!==u){d=iZ(t.node1);Tl(o[0],o[0],a,d*e)}if(h&&"none"!==h){d=iZ(t.node2);Tl(o[1],o[1],a,-d*e)}Sl(l[0],o[0]),Sl(l[1],o[1])}}))}function WZ(t){return"view"===t.type}var UZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){var n=new _O,i=new OZ,r=this.group;this._controller=new sF(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(WZ(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):Zm(s,l,t)}HZ(t.getGraph(),nZ(t));var u=t.getData();o.updateData(u);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var c=t.forceLayout,d=t.get(["force","layoutAnimation"]);c&&this._startForceLayoutIteration(c,d);var p=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var a=o.get("draggable");a&&r.on("drag",(function(o){switch(p){case"force":c.warmUp(),!i._layouting&&i._startForceLayoutIteration(c,d),c.setFixed(n),u.setItemLayout(n,[r.x,r.y]);break;case"circular":u.setItemLayout(n,[r.x,r.y]),e.setLayout({fixed:!0},!0),aZ(t,"symbolSize",e,[o.offsetX,o.offsetY]),i.updateLayout(t);break;case"none":default:u.setItemLayout(n,[r.x,r.y]),tZ(t.getGraph(),t),i.updateLayout(t);break}})).on("dragend",(function(){c&&c.setUnfixed(n)})),r.setDraggable(a,!!o.get("cursor"));var s=o.get(["emphasis","focus"]);"adjacency"===s&&(Cy(r).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Cy(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),v=u.getLayout("cy");u.graph.eachNode((function(t){lZ(t,f,g,v)})),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;(function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))})()},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker((function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!dF(e,n,t)})),WZ(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){lF(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){uF(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),HZ(t.getGraph(),nZ(t)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=nZ(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){HZ(t.getGraph(),nZ(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(jC);const ZZ=UZ;function YZ(t){return"_EC_"+t}var XZ=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[YZ(t)]){var i=new jZ(t,e);return i.hostGraph=this,this.nodes.push(i),n[YZ(t)]=i,i}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[YZ(t)]},t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if(Ys(t)&&(t=this.nodes[t]),Ys(e)&&(e=this.nodes[e]),t instanceof jZ||(t=i[YZ(t)]),e instanceof jZ||(e=i[YZ(e)]),t&&e){var o=t.id+"-"+e.id,a=new qZ(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof jZ&&(t=t.id),e instanceof jZ&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof jZ||(e=this._nodesMap[YZ(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(r=0,o=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}Ls(jZ,KZ("hostGraph","data")),Ls(qZ,KZ("hostGraph","edgeData"));const $Z=XZ;function JZ(t,e,n,i,r){for(var o=new $Z(i),a=0;a "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=sO(t,n);else{var g=Xb.get(f),v=g&&g.dimensions||[];Ds(v,"value")<0&&v.concat(["value"]);var y=UR(t,{coordDimensions:v,encodeDefine:n.getEncode()}).dimensions;p=new WR(y,n),p.initData(t)}var m=new WR(["value"],n);return m.initData(l,s),r&&r(p,m),YH({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var QZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new IE(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),cf(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],r=this;if(i&&n){KU(this);var o=JZ(i,n,this,!0,a);return Rs(o.edges,(function(t){$U(t.node1,t.node2,this,t.dataIndex)}),this),o.data}function a(t,e){t.wrapMethod("getItemModel",(function(t){var e=r._categoriesModels,n=t.getShallow("category"),i=e[n];return i&&(i.parentModel=t.parentModel,t.parentModel=i),t}));var n=A_.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=o,i}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=i,t}))}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),qS("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}var u=cM({series:this,dataIndex:t,multipleSeries:e});return u},e.prototype._updateCategoriesData=function(){var t=Os(this.option.categories||[],(function(t){return null!=t.value?t:Ts({value:0},t)})),e=new WR(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const tY=QZ;var eY={type:"graphRoam",event:"graphRoam",update:"none"};function nY(t){t.registerChartView(ZZ),t.registerSeriesModel(tY),t.registerProcessor(BU),t.registerVisual(VU),t.registerVisual(GU),t.registerLayout(eZ),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,uZ),t.registerLayout(dZ),t.registerCoordinateSystem("graphView",{dimensions:YG.dimensions,create:fZ}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},xl),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},xl),t.registerAction(eY,(function(t,e,n){e.eachComponent({mainType:"series",query:t},(function(e){var i=e.coordinateSystem,r=aH(i,t,void 0,n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}var iY=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),rY=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new iY},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=r/3?1:2),l=e.y-i(a)*o*(o>=r/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)},e}(Uv);const oY=rY;function aY(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r),a=zp(n[0],e.getWidth()),s=zp(n[1],e.getHeight()),l=zp(t.get("radius"),o/2);return{cx:a,cy:s,r:l}}function sY(t,e){var n=null==t?"":t+"";return e&&(Us(e)?n=e.replace("{value}",n):Ws(e)&&(n=e(t))),n}var lY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),r=aY(t,n);this._renderMain(t,e,n,i,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,r){var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),h=u.get("roundCap"),c=h?kN:bI,d=u.get("show"),p=u.getModel("lineStyle"),f=p.get("width"),g=[s,l];vv(g,!a),s=g[0],l=g[1];for(var v=l-s,y=s,m=[],_=0;d&&_=t&&(0===e?0:i[e-1][0])Math.PI/2&&(B+=Math.PI)):"tangential"===z?B=-M-Math.PI/2:Ys(z)&&(B=z*Math.PI/180),0===B?c.add(new Iy({style:r_(_,{text:R,x:N,y:E,verticalAlign:h<-.8?"top":h>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0})):c.add(new Iy({style:r_(_,{text:R,x:N,y:E,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:N,originY:E,rotation:B}))}if(m.get("show")&&k!==x){L=m.get("distance");L=L?L+l:l;for(var V=0;V<=b;V++){u=Math.cos(M),h=Math.sin(M);var F=new EI({shape:{x1:u*(f-L)+d,y1:h*(f-L)+p,x2:u*(f-S-L)+d,y2:h*(f-S-L)+p},silent:!0,style:A});"auto"===A.stroke&&F.setStyle({stroke:i((k+V/b)/x)}),c.add(F),M+=C}M-=C}else M+=I}},e.prototype._renderPointer=function(t,e,n,i,r,o,a,s,l){var u=this.group,h=this._data,c=this._progressEls,d=[],p=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),v=t.getData(),y=v.mapDimension("value"),m=+t.get("min"),_=+t.get("max"),x=[m,_],b=[o,a];function w(e,n){var i,o=v.getItemModel(e),a=o.getModel("pointer"),s=zp(a.get("width"),r.r),l=zp(a.get("length"),r.r),u=t.get(["pointer","icon"]),h=a.get("offsetCenter"),c=zp(h[0],r.r),d=zp(h[1],r.r),p=a.get("keepAspect");return i=u?sA(u,c-s/2,d-l,s,l,null,p):new oY({shape:{angle:-Math.PI/2,width:s,r:l,x:c,y:d}}),i.rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function S(t,e){var n=f.get("roundCap"),i=n?kN:bI,a=f.get("overlap"),u=a?f.get("width"):l/v.count(),h=a?r.r-u:r.r-(t+1)*u,c=a?r.r:r.r-t*u,d=new i({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:s,r0:h,r:c}});return a&&(d.z2=_-v.get(y,t)%_),d}(g||p)&&(v.diff(h).add((function(e){var n=v.get(y,e);if(p){var i=w(e,o);Ym(i,{rotation:-((isNaN(+n)?b[0]:Ep(n,x,b,!0))+Math.PI/2)},t),u.add(i),v.setItemGraphicEl(e,i)}if(g){var r=S(e,o),a=f.get("clip");Ym(r,{shape:{endAngle:Ep(n,x,b,a)}},t),u.add(r),Ty(t.seriesIndex,v.dataType,e,r),d[e]=r}})).update((function(e,n){var i=v.get(y,e);if(p){var r=h.getItemGraphicEl(n),a=r?r.rotation:o,s=w(e,a);s.rotation=a,Zm(s,{rotation:-((isNaN(+i)?b[0]:Ep(i,x,b,!0))+Math.PI/2)},t),u.add(s),v.setItemGraphicEl(e,s)}if(g){var l=c[n],m=l?l.shape.endAngle:o,_=S(e,m),M=f.get("clip");Zm(_,{shape:{endAngle:Ep(i,x,b,M)}},t),u.add(_),Ty(t.seriesIndex,v.dataType,e,_),d[e]=_}})).execute(),v.each((function(t){var e=v.getItemModel(t),n=e.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=v.getItemGraphicEl(t),l=v.getItemVisual(t,"style"),u=l.fill;if(s instanceof Jv){var h=s.style;s.useStyle(Ts({image:h.image,x:h.x,y:h.y,width:h.width,height:h.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Ep(v.get(y,t),x,[0,1],!0))),s.z2EmphasisLift=0,Om(s,e),km(s,r,o,a)}if(g){var c=d[t];c.useStyle(v.getItemVisual(t,"style")),c.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),c.z2EmphasisLift=0,Om(c,e),km(c,r,o,a)}})),this._progressEls=d)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor"),i=n.get("show");if(i){var r=n.get("size"),o=n.get("icon"),a=n.get("offsetCenter"),s=n.get("keepAspect"),l=sA(o,e.cx-r/2+zp(a[0],e.r),e.cy-r/2+zp(a[1],e.r),r,r,null,s);l.z2=n.get("showAbove")?1:0,l.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(l)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,r){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),h=new Ip,c=[],d=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){c[t]=new Iy({silent:!0}),d[t]=new Iy({silent:!0})})).update((function(t,e){c[t]=o._titleEls[e],d[t]=o._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new Ip,v=i(Ep(o,[l,u],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var m=y.get("offsetCenter"),_=r.cx+zp(m[0],r.r),x=r.cy+zp(m[1],r.r),b=c[e];b.attr({z2:f?0:2,style:r_(y,{x:_,y:x,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:v})}),g.add(b)}var w=n.getModel("detail");if(w.get("show")){var S=w.get("offsetCenter"),M=r.cx+zp(S[0],r.r),I=r.cy+zp(S[1],r.r),C=zp(w.get("width"),r.r),T=zp(w.get("height"),r.r),A=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:v,D=(b=d[e],w.get("formatter"));b.attr({z2:f?0:2,style:r_(w,{x:M,y:I,text:sY(o,D),width:isNaN(C)?null:C,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:A})}),f_(b,{normal:w},o,(function(t){return sY(t,D)})),p&&g_(b,e,a,t,{getFormattedLabel:function(t,e,n,i,r,a){return sY(a?a.interpolatedValue:o,D)}}),g.add(b)}h.add(g)})),this.group.add(h),this._titleEls=c,this._detailEls=d},e.type="gauge",e}(jC);const uY=lY;var hY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return qa(e,t),e.prototype.getInitialData=function(t,e){return SE(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(IM);const cY=hY;function dY(t){t.registerChartView(uY),t.registerSeriesModel(cY)}var pY=["itemStyle","opacity"],fY=function(t){function e(e,n){var i=t.call(this)||this,r=i,o=new PI,a=new Iy;return r.setTextContent(a),i.setTextGuideLine(o),i.updateData(e,n,!0),i}return qa(e,t),e.prototype.updateData=function(t,e,n){var i=this,r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(pY);l=null==l?1:l,n||$m(i),i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,Ym(i,{style:{opacity:l}},r,e)):Zm(i,{style:{opacity:l},shape:{points:a.points}},r,e),Om(i,o),this._updateLabel(t,e),km(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=s.label,u=t.getItemVisual(e,"style"),h=u.fill;n_(r,i_(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:u.opacity,defaultText:t.getName(e)},{normal:{align:l.textAlign,verticalAlign:l.verticalAlign}}),n.setTextConfig({local:!0,inside:!!l.inside,insideStroke:h,outsideFill:h});var c=l.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Lu(c[0][0],c[0][1]):null},Zm(r,{style:{x:l.x,y:l.y}},o,e),r.attr({rotation:l.rotation,originX:l.x,originY:l.y,z2:10}),oL(n,aL(a),{stroke:h})},e}(DI),gY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add((function(t){var e=new fY(i,t);i.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){var n=r.getItemGraphicEl(e);Km(n,t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(jC);const vY=gY;var yY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new IE(Fs(this.getData,this),Fs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return SE(this,{coordDimensions:["value"],encodeDefaulter:Gs(gb,this)})},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=n.mapDimension("value"),o=n.getSum(r);return i.percent=o?+(n.get(r,e)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const mY=yY;function _Y(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function xY(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),r=[],o="ascending"===e,a=0,s=t.count();aWY)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&YY(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function YY(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}const XY=UY;var jY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&Is(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){Rs(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=Es(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this);Rs(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Jx);const qY=jY;var KY=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.axisIndex=o,a}return qa(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(LB);const $Y=KY;function JY(t,e,n,i,r,o){t=t||0;var a=n[1]-n[0];if(null!=r&&(r=tX(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=tX(s,[0,a]),r=o=tX(s,[r,o]),i=0}e[0]=tX(e[0],n),e[1]=tX(e[1],n);var l=QY(e,i);e[i]+=t;var u,h=r||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=tX(e[i],c),u=QY(e,i),null!=r&&(u.sign!==l.sign||u.spano&&(e[1-i]=e[i]+u.sign*o),e}function QY(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function tX(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var eX=Rs,nX=Math.min,iX=Math.max,rX=Math.floor,oX=Math.ceil,aX=Bp,sX=Math.PI,lX=function(){function t(t,e,n){this.type="parallel",this._axesMap=gl(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,r=t.parallelAxisIndex;eX(i,(function(t,n){var i=r[n],o=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new $Y(t,Kz(o),[0,0],o.get("type"),i)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return o>=n&&o<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();eX(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),qz(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],u=this.dimensions.length,h=uX(e.get("axisExpandWidth"),l),c=uX(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,p=e.get("axisExpandWindow");if(p)t=uX(p[1]-p[0],l),p[1]=p[0]+t;else{t=uX(h*(c-1),l);var f=e.get("axisExpandCenter")||rX(u/2);p=[h*f-t/2],p[1]=p[0]+t}var g=(s-t)/(u-c);g<3&&(g=0);var v=[rX(aX(p[0]/h,1))+1,oX(aX(p[1]/h,1))-1],y=g/h*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:p,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),eX(n,(function(e,n){var o=(i.axisExpandable?cX:hX)(n,i),a={horizontal:{x:o.position,y:i.axisLength},vertical:{x:0,y:o.position}},s={horizontal:sX/2,vertical:0},l=[a[r].x+t.x,a[r].y+t.y],u=s[r],h=bu();Cu(h,h,u),Iu(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];Rs(o,(function(e){a.push(t.mapDimension(e)),s.push(r.get(e).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-h[0])?(l="jump",a=s-r*(1-h[2])):(a=s-r*h[1])>=0&&(a=s-r*(1-h[1]))<=0&&(a=0),a*=e.axisExpandWidth/u,a?JY(a,i,o,"all"):l="none";else{var d=i[1]-i[0],p=o[1]*s/d;i=[iX(0,p-d/2)],i[1]=nX(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:l}},t}();function uX(t,e){return nX(iX(t,e[0]),e[1])}function hX(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function cX(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return t=0;n--)Vp(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;iSX}function HX(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function WX(t,e,n,i){var r=new Ip;return r.add(new sy({name:"main",style:XX(n),silent:!0,draggable:!0,cursor:"move",drift:Gs(JX,t,e,r,["n","s","w","e"]),ondragend:Gs(FX,e,{isEnd:!0})})),Rs(i,(function(n){r.add(new sy({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Gs(JX,t,e,r,n),ondragend:Gs(FX,e,{isEnd:!0})}))})),r}function UX(t,e,n,i){var r=i.brushStyle.lineWidth||0,o=xX(r,MX),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,h=n[0][1],c=n[1][1],d=h-o+r/2,p=c-o+r/2,f=h-a,g=c-s,v=f+r,y=g+r;YX(t,e,"main",a,s,f,g),i.transformable&&(YX(t,e,"w",l,u,o,y),YX(t,e,"e",d,u,o,y),YX(t,e,"n",l,u,v,o),YX(t,e,"s",l,p,v,o),YX(t,e,"nw",l,u,o,o),YX(t,e,"ne",d,u,o,o),YX(t,e,"sw",l,p,o,o),YX(t,e,"se",d,p,o,o))}function ZX(t,e){var n=e.__brushOption,i=n.transformable,r=e.childAt(0);r.useStyle(XX(n)),r.attr({silent:!i,cursor:i?"move":"default"}),Rs([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=e.childOfName(n.join("")),o=1===n.length?KX(t,n[0]):$X(t,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?TX[o]+"-resize":null})}))}function YX(t,e,n,i,r,o,a){var s=e.childOfName(n);s&&s.setShape(nj(ej(t,e,[[i,r],[i+o,r+a]])))}function XX(t){return As({strokeNoScale:!0},t.brushStyle)}function jX(t,e,n,i){var r=[_X(t,n),_X(e,i)],o=[xX(t,n),xX(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function qX(t){return MC(t.group)}function KX(t,e){var n={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},r=CC(n[e],qX(t));return i[r]}function $X(t,e){var n=[KX(t,e[0]),KX(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function JX(t,e,n,i,r,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=tj(e,r,o);Rs(i,(function(t){var e=CX[t];s[e[0]][e[1]]+=l[e[0]]})),a.range=t.fromRectRange(jX(s[0][0],s[1][0],s[0][1],s[1][1])),NX(e,n),FX(e,{isEnd:!1})}function QX(t,e,n,i){var r=e.__brushOption.range,o=tj(t,n,i);Rs(r,(function(t){t[0]+=o[0],t[1]+=o[1]})),NX(t,e),FX(t,{isEnd:!1})}function tj(t,e,n){var i=t.group,r=i.transformCoordToLocal(e,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function ej(t,e,n){var i=BX(t,e);return i&&i!==mX?i.clipPath(n,t._transform):Ms(n)}function nj(t){var e=_X(t[0][0],t[1][0]),n=_X(t[0][1],t[1][1]),i=xX(t[0][0],t[1][0]),r=xX(t[0][1],t[1][1]);return{x:e,y:n,width:i-e,height:r-n}}function ij(t,e,n){if(t._brushType&&!hj(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=zX(t,e,n);if(!t._dragging)for(var a=0;ai.getWidth()||n<0||n>i.getHeight()}var cj={lineX:dj(0),lineY:dj(1),rect:{createCover:function(t,e){function n(t){return t}return WX({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=HX(t);return jX(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){UX(t,e,n,i)},updateCommon:ZX,contain:oj},polygon:{createCover:function(t,e){var n=new Ip;return n.add(new PI({name:"main",style:XX(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new DI({name:"main",draggable:!0,drift:Gs(QX,t,e),ondragend:Gs(FX,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,i){e.childAt(0).setShape({points:ej(t,e,n)})},updateCommon:ZX,contain:oj}};function dj(t){return{createCover:function(e,n){return WX({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=HX(e),i=_X(n[0][t],n[1][t]),r=xX(n[0][t],n[1][t]);return[i,r]},updateCoverShape:function(e,n,i,r){var o,a=BX(e,n);if(a!==mX&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(t);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,o];t&&l.reverse(),UX(e,n,l,r)},updateCommon:ZX,contain:oj}}const pj=kX;function fj(t){return t=yj(t),function(e){return kC(e,t)}}function gj(t,e){return t=yj(t),function(n){var i=null!=e?e:n,r=i?t.width:t.height,o=i?t.x:t.y;return[o,o+(r||0)]}}function vj(t,e,n){var i=yj(t);return function(t,r){return i.contain(r[0],r[1])&&!dF(t,e,n)}}function yj(t){return Gu.create(t)}var mj=["axisLine","axisTickLabel","axisName"],_j=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new pj(n.getZr())).on("brush",Fs(this._onBrush,this))},e.prototype.render=function(t,e,n,i){if(!xj(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Ip,this.group.add(this._axisGroup),t.get("show")){var o=wj(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,h=a.getAxisLayout(u),c=Ts({strokeContainThreshold:l},h),d=new iV(t,c);Rs(mj,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,t,o,l,n),DC(r,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,e,n,i,r,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=Gu.create({x:a[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:fj(u),isTargetByCursor:vj(u,o,i),getLinearBrushOtherExtent:gj(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(bj(n))},e.prototype._onBrush=function(t){var e=t.areas,n=this.axisModel,i=n.axis,r=Os(e,(function(t){return[i.coordToData(t.range[0],!0),i.coordToData(t.range[1],!0)]}));(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(TM);function xj(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}function bj(t){var e=t.axis;return Os(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}function wj(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}const Sj=_j;var Mj={type:"axisAreaSelect",event:"axisAreaSelected"};function Ij(t){t.registerAction(Mj,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}var Cj={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Tj(t){t.registerComponentView(XY),t.registerComponentModel(qY),t.registerCoordinateSystem("parallel",gX),t.registerPreprocessor(FY),t.registerComponentModel(yX),t.registerComponentView(Sj),ez(t,"parallel",yX,Cj),Ij(t)}function Aj(t){Ek(Tj),t.registerChartView(PY),t.registerSeriesModel(EY),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,VY)}var Dj=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),kj=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new Dj},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){cm(this)},e.prototype.downplay=function(){dm(this)},e}(Uv),Lj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this,r=t.getGraph(),o=this.group,a=t.layoutInfo,s=a.width,l=a.height,u=t.getData(),h=t.getData("edge"),c=t.get("orient");this._model=t,o.removeAll(),o.x=a.x,o.y=a.y,r.eachEdge((function(e){var n=new kj,i=Cy(n);i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var r,a,u,d,p,f,g,v,y=e.getModel(),m=y.getModel("lineStyle"),_=m.get("curveness"),x=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),S=b.get("localY"),M=e.node2.getLayout(),I=e.node2.getModel(),C=I.get("localX"),T=I.get("localY"),A=e.getLayout();n.shape.extent=Math.max(1,A.dy),n.shape.orient=c,"vertical"===c?(r=(null!=w?w*s:x.x)+A.sy,a=(null!=S?S*l:x.y)+x.dy,u=(null!=C?C*s:M.x)+A.ty,d=null!=T?T*l:M.y,p=r,f=a*(1-_)+d*_,g=u,v=a*_+d*(1-_)):(r=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+A.sy,u=null!=C?C*s:M.x,d=(null!=T?T*l:M.y)+A.ty,p=r*(1-_)+u*_,f=a,g=r*_+u*(1-_),v=d),n.setShape({x1:r,y1:a,x2:u,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:v}),n.useStyle(m.getItemStyle()),Pj(n.style,c,e);var D=""+y.get("value"),k=i_(y,"edgeLabel");n_(n,k,{labelFetcher:{getFormattedLabel:function(e,n,i,r,o,a){return t.getFormattedLabel(e,n,"edge",r,il(o,k.normal&&k.normal.get("formatter"),D),a)}},labelDataIndex:e.dataIndex,defaultText:D}),n.setTextConfig({position:"inside"});var L=y.getModel("emphasis");Om(n,y,"lineStyle",(function(t){var n=t.getItemStyle();return Pj(n,c,e),n})),o.add(n),h.setItemGraphicEl(e.dataIndex,n);var P=L.get("focus");km(n,"adjacency"===P?e.getAdjacentDataIndices():"trajectory"===P?e.getTrajectoryDataIndices():P,L.get("blurScope"),L.get("disabled"))})),r.eachNode((function(e){var n=e.getLayout(),i=e.getModel(),r=i.get("localX"),a=i.get("localY"),h=i.getModel("emphasis"),c=new sy({shape:{x:null!=r?r*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy},style:i.getModel("itemStyle").getItemStyle(),z2:10});n_(c,i_(i),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),c.disableLabelAnimation=!0,c.setStyle("fill",e.getVisual("color")),c.setStyle("decal",e.getVisual("style").decal),Om(c,i),o.add(c),u.setItemGraphicEl(e.dataIndex,c),Cy(c).dataType="node";var d=h.get("focus");km(c,"adjacency"===d?e.getAdjacentDataIndices():"trajectory"===d?e.getTrajectoryDataIndices():d,h.get("blurScope"),h.get("disabled"))})),u.eachItemGraphicEl((function(e,r){var o=u.getItemModel(r);o.get("draggable")&&(e.drift=function(e,o){i._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){i._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&o.setClipPath(Rj(o.getBoundingRect(),t,(function(){o.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(jC);function Pj(t,e,n){switch(t.fill){case"source":t.fill=n.node1.getVisual("color"),t.decal=n.node1.getVisual("style").decal;break;case"target":t.fill=n.node2.getVisual("color"),t.decal=n.node2.getVisual("style").decal;break;case"gradient":var i=n.node1.getVisual("color"),r=n.node2.getVisual("color");Us(i)&&Us(r)&&(t.fill=new KI(0,0,+("horizontal"===e),+("vertical"===e),[{color:i,offset:0},{color:r,offset:1}]))}}function Rj(t,e,n){var i=new sy({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Ym(i,{shape:{width:t.width+20}},e,n),i}const Oj=Lj;var Nj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links,i=t.data||t.nodes,r=t.levels;this.levelModels=[];for(var o=this.levelModels,a=0;a=0&&(o[r[a].depth]=new A_(r[a],this,e));if(i&&n){var s=JZ(i,n,this,!0,l);return s.data}function l(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e),r=i.node1.getLayout();if(r){var o=r.depth,a=n.levelModels[o];a&&(t.parentModel=a)}return t}))}},e.prototype.setNodePosition=function(t,e){var n=this.option.data||this.option.nodes,i=n[t];i.localX=e[0],i.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}if("edge"===n){var r=this.getDataParams(t,n),o=r.data,a=r.value,s=o.source+" -- "+o.target;return qS("nameValue",{name:s,value:a,noValue:i(a)})}var l=this.getGraph().getNodeByIndex(t),u=l.getLayout().value,h=this.getDataParams(t,n).data.name;return qS("nameValue",{name:null!=h?h+"":null,value:u,noValue:i(u)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(e),o=r.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(IM);const Ej=Nj;function zj(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),r=Bj(t,e);t.layoutInfo=r;var o=r.width,a=r.height,s=t.getGraph(),l=s.nodes,u=s.edges;Fj(l);var h=Es(l,(function(t){return 0===t.getLayout().value})),c=0!==h.length?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");Vj(l,u,n,i,o,a,c,d,p)}))}function Bj(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Vj(t,e,n,i,r,o,a,s,l){Gj(t,e,n,r,o,s,l),Yj(t,e,o,r,i,a,s),oq(t,s)}function Fj(t){Rs(t,(function(t){var e=iq(t.outEdges,nq),n=iq(t.inEdges,nq),i=t.getValue()||0,r=Math.max(e,n,i);t.setLayout({value:r},!0)}))}function Gj(t,e,n,i,r,o,a){for(var s=[],l=[],u=[],h=[],c=0,d=0;d=0;y&&v.depth>p&&(p=v.depth),g.setLayout({depth:y?v.depth:c},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var m=0;mc-1?p:c-1;a&&"left"!==a&&Wj(t,a,o,S);var M="vertical"===o?(r-n)/S:(i-n)/S;Zj(t,M,o)}function Hj(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function Wj(t,e,n,i){if("right"===e){var r=[],o=t,a=0;while(o.length){for(var s=0;s0;o--)l*=.99,Kj(s,l,a),qj(s,r,n,i,a),rq(s,l,a),qj(s,r,n,i,a)}function Xj(t,e){var n=[],i="vertical"===e?"y":"x",r=Hf(t,(function(t){return t.getLayout()[i]}));return r.keys.sort((function(t,e){return t-e})),Rs(r.keys,(function(t){n.push(r.buckets.get(t))})),n}function jj(t,e,n,i,r,o){var a=1/0;Rs(t,(function(t){var e=t.length,s=0;Rs(t,(function(t){s+=t.getLayout().value}));var l="vertical"===o?(i-(e-1)*r)/s:(n-(e-1)*r)/s;l0&&(a=s.getLayout()[o]+l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[c]+e;var p="vertical"===r?i:n;if(l=u-e-p,l>0){a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=h-2;d>=0;--d)s=t[d],l=s.getLayout()[o]+s.getLayout()[c]+e-u,l>0&&(a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function Kj(t,e,n){Rs(t.slice().reverse(),(function(t){Rs(t,(function(t){if(t.outEdges.length){var i=iq(t.outEdges,$j,n)/iq(t.outEdges,nq);if(isNaN(i)){var r=t.outEdges.length;i=r?iq(t.outEdges,Jj,n)/r:0}if("vertical"===n){var o=t.getLayout().x+(i-eq(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(i-eq(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function $j(t,e){return eq(t.node2,e)*t.getValue()}function Jj(t,e){return eq(t.node2,e)}function Qj(t,e){return eq(t.node1,e)*t.getValue()}function tq(t,e){return eq(t.node1,e)}function eq(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function nq(t){return t.getValue()}function iq(t,e,n){var i=0,r=t.length,o=-1;while(++oo&&(o=e)})),Rs(n,(function(e){var n=new oU({type:"color",mappingMethod:"linear",dataExtent:[r,o],visual:t.get("color")}),i=n.mapValueToVisual(e.getLayout().value),a=e.getModel().get(["itemStyle","color"]);null!=a?(e.setVisual("color",a),e.setVisual("style",{fill:a})):(e.setVisual("color",i),e.setVisual("style",{fill:i}))}))}i.length&&Rs(i,(function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)}))}))}function sq(t){t.registerChartView(Oj),t.registerSeriesModel(Ej),t.registerLayout(zj),t.registerVisual(aq),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))}var lq=function(){function t(){}return t.prototype.getInitialData=function(t,e){var n,i,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=r.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),i=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[r,o],p=d[u].get("type"),f=d[1-u].get("type"),g=t.data;if(g&&i){var v=[];Rs(g,(function(t,e){var n;Hs(t)?(n=t.slice(),t.unshift(e)):Hs(t.value)?(n=Ts({},t),n.value=n.value.slice(),t.value.unshift(e)):n=t,v.push(n)})),t.data=v}var y=this.defaultValueDimensions,m=[{name:h,type:yR(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:yR(f),dimsDef:y.slice()}];return SE(this,{coordDimensions:m,dimensionsCount:y.length+1,encodeDefaulter:Gs(fb,m,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),uq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return qa(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(IM);Ls(uq,lq,!0);const hq=uq;var cq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this.group,o=this._data;this._data||r.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(o).add((function(t){if(i.hasValue(t)){var e=i.getItemLayout(t),n=fq(e,i,t,a,!0);i.setItemGraphicEl(t,n),r.add(n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var s=i.getItemLayout(t);n?($m(n),gq(s,n,i,t)):n=fq(s,i,t,a),r.add(n),i.setItemGraphicEl(t,n)}else r.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)})).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(jC),dq=function(){function t(){}return t}(),pq=function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new dq},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();ig){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}var Mq={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==rb){var n="";0,lS(n)}var i=Sq(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Iq(t){t.registerSeriesModel(hq),t.registerChartView(yq),t.registerLayout(_q),t.registerTransform(Mq)}var Cq=["color","borderColor"],Tq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,r=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();this._data||i.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(o&&Lq(s,a))return;var l=kq(a,n,!0);Ym(l,{shape:{points:a.ends}},t,n),Pq(l,e,n,r),i.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(e.hasValue(a)){var h=e.getItemLayout(a);o&&Lq(s,h)?i.remove(u):(u?(Zm(u,{shape:{points:h.ends}},t,a),$m(u)):u=kq(h,a),Pq(u,e,a,r),i.add(u),e.setItemGraphicEl(a,u))}else i.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),Eq(t,this.group);var e=t.get("clip",!0)?BO(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){var n,i=e.getData(),r=i.getLayout("isSimpleBox");while(null!=(n=t.next())){var o=i.getItemLayout(n),a=kq(o,n);Pq(a,i,n,r),a.incremental=!0,this.group.add(a),this._progressiveEls.push(a)}},e.prototype._incrementalRenderLarge=function(t,e){Eq(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(jC),Aq=function(){function t(){}return t}(),Dq=function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new Aq},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(Uv);function kq(t,e,n){var i=t.ends;return new Dq({shape:{points:n?Rq(i,t):i},z2:100})}function Lq(t,e){for(var n=!0,i=0;i0?"borderColor":"borderColor0"])||n.get(["itemStyle",t>0?"color":"color0"]);0===t&&(r=n.get(["itemStyle","borderColorDoji"]));var o=n.getModel("itemStyle").getItemStyle(Cq);e.useStyle(o),e.style.fill=null,e.style.stroke=r}const Bq=Tq;var Vq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return qa(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(IM);Ls(Vq,lq,!0);const Fq=Vq;function Gq(t){t&&Hs(t.series)&&Rs(t.series,(function(t){Xs(t)&&"k"===t.type&&(t.type="candlestick")}))}var Hq=["itemStyle","borderColor"],Wq=["itemStyle","borderColor0"],Uq=["itemStyle","borderColorDoji"],Zq=["itemStyle","color"],Yq=["itemStyle","color0"],Xq={seriesType:"candlestick",plan:AM(),performRawSeries:!0,reset:function(t,e){function n(t,e){return e.get(t>0?Zq:Yq)}function i(t,e){return e.get(0===t?Uq:t>0?Hq:Wq)}if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(t,e){var r;while(null!=(r=t.next())){var o=e.getItemModel(r),a=e.getItemLayout(r).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=i(a,o)||s.fill;var l=e.ensureUniqueItemVisual(r,"style");Ts(l,s)}}}}}};const jq=Xq;var qq={seriesType:"candlestick",plan:AM(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),i=$q(t,n),r=0,o=1,a=["x","y"],s=n.getDimensionIndex(n.mapDimension(a[r])),l=Os(n.mapDimensionsAll(a[o]),n.getDimensionIndex,n),u=l[0],h=l[1],c=l[2],d=l[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(s<0||l.length<4))return{progress:t.pipelineContext.large?f:p};function p(t,n){var a,l=n.getStore();while(null!=(a=t.next())){var p=l.get(s,a),f=l.get(u,a),g=l.get(h,a),v=l.get(c,a),y=l.get(d,a),m=Math.min(f,g),_=Math.max(f,g),x=T(m,p),b=T(_,p),w=T(v,p),S=T(y,p),M=[];A(M,b,0),A(M,x,1),M.push(k(S),k(b),k(w),k(x));var I=n.getItemModel(a),C=!!I.get(["itemStyle","borderColorDoji"]);n.setItemLayout(a,{sign:Kq(l,a,f,g,h,C),initBaseline:f>g?b[o]:x[o],ends:M,brushRect:D(v,y,p)})}function T(t,n){var i=[];return i[r]=n,i[o]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function A(t,e,n){var o=e.slice(),a=e.slice();o[r]=SC(o[r]+i/2,1,!1),a[r]=SC(a[r]-i/2,1,!0),n?t.push(o,a):t.push(a,o)}function D(t,e,n){var a=T(t,n),s=T(e,n);return a[r]-=i/2,s[r]-=i/2,{x:a[0],y:a[1],width:o?i:s[0]-a[0],height:o?s[1]-a[1]:i}}function k(t){return t[r]=SC(t[r],1),t}}function f(n,i){var a,l,p=IO(4*n.count),f=0,g=[],v=[],y=i.getStore(),m=!!t.get(["itemStyle","borderColorDoji"]);while(null!=(l=n.next())){var _=y.get(s,l),x=y.get(u,l),b=y.get(h,l),w=y.get(c,l),S=y.get(d,l);isNaN(_)||isNaN(w)||isNaN(S)?(p[f++]=NaN,f+=3):(p[f++]=Kq(y,l,x,b,h,m),g[r]=_,g[o]=w,a=e.dataToPoint(g,null,v),p[f++]=a?a[0]:NaN,p[f++]=a?a[1]:NaN,g[o]=S,a=e.dataToPoint(g,null,v),p[f++]=a?a[1]:NaN)}i.setLayout("largePoints",p)}}};function Kq(t,e,n,i,r,o){var a;return a=n>i?-1:n0?t.get(r,e-1)<=i?1:-1:1,a}function $q(t,e){var n,i=t.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=zp(nl(t.get("barMaxWidth"),r),r),a=zp(nl(t.get("barMinWidth"),1),r),s=t.get("barWidth");return null!=s?zp(s,r):Math.max(Math.min(r/2,o),a)}const Jq=qq;function Qq(t){t.registerChartView(Bq),t.registerSeriesModel(Fq),t.registerPreprocessor(Gq),t.registerVisual(jq),t.registerLayout(Jq)}function tK(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var eK=function(t){function e(e,n){var i=t.call(this)||this,r=new fO(e,n),o=new Ip;return i.add(r),i.add(o),i.updateData(e,n),i}return qa(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,r=this.childAt(1),o=0;o0&&(o=this._getLineLength(i)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=Ws(u)?u(n):u,i.__t>0&&(h=-o*i.__t),this._animateSymbol(i,o,h,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,r){if(e>0){t.__t=0;var o=this,a=t.animate("",i).when(r?2*e:e,{__t:r?2:1}).delay(n).during((function(){o._updateSymbolPosition(t)}));i||a.done((function(){o.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){return Ol(t.__p1,t.__cp1)+Ol(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=Fh,l=Gh;o[0]=s(e[0],i[0],n[0],r),o[1]=s(e[1],i[1],n[1],r);var u=t.__t<1?l(e[0],i[0],n[0],r):l(n[0],i[0],e[0],1-r),h=t.__t<1?l(e[1],i[1],n[1],r):l(n[1],i[1],e[1],1-r);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0;o--)if(i[o]<=e)break;o=Math.min(o,r-2)}else{for(o=a;oe)break;o=Math.min(o-1,r-2)}var l=(e-i[o])/(i[o+1]-i[o]),u=n[o],h=n[o+1];t.x=u[0]*(1-l)+l*h[0],t.y=u[1]*(1-l)+l*h[1];var c=t.__t<1?h[0]-u[0]:u[0]-h[0],d=t.__t<1?h[1]-u[1]:u[1]-h[1];t.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(uK);const pK=dK;var fK=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),gK=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return qa(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new fK},e.prototype.buildPath=function(t,e){var n,i=e.segs,r=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*r,d=(l+h)/2-(u-s)*r;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,r=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){var f=(u+d)/2-(h-p)*r,g=(h+p)/2-(d-u)*r;if(bv(u,h,f,g,d,p,o,t,e))return a}else if(_v(u,h,d,p,o,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();if(t=n[0],e=n[1],i.contain(t,e)){var r=this.hoverDataIdx=this.findDataIndex(t,e);return r>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.segs,i=1/0,r=1/0,o=-1/0,a=-1/0,s=0;s0&&(o.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const yK=vK;var mK={seriesType:"lines",plan:AM(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(r,o){var a=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,h=r.start;h0&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),r.updateData(i);var u=t.get("clip",!0)&&BO(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData(),r=this._updateLineDraw(i,t);r.incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=_K.reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext,a=o.large;return n&&i===this._hasEffet&&r===this._isPolyline&&a===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=a?new yK:new OZ(r?i?pK:cK:i?uK:AZ),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=a),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr(),n="svg"===e.painter.getType();n||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(jC);const bK=xK;var wK="undefined"===typeof Uint32Array?Array:Uint32Array,SK="undefined"===typeof Float64Array?Array:Float64Array;function MK(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=Os(e,(function(t){var e=[t[0].coord,t[1].coord],n={coords:e};return t[0].name&&(n.fromName=t[0].name),t[1].name&&(n.toName=t[1].name),Cs([n,t[0],t[1]])})))}var IK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return qa(e,t),e.prototype.init=function(e){e.data=e.data||[],MK(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(MK(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=vl(this._flatCoords,e.flatCoords),this._flatCoordsOffset=vl(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(IM);const CK=IK;function TK(t){return t instanceof Array||(t=[t,t]),t}var AK={seriesType:"lines",reset:function(t){var e=TK(t.get("symbol")),n=TK(t.get("symbolSize")),i=t.getData();function r(t,e){var n=t.getItemModel(e),i=TK(n.getShallow("symbol",!0)),r=TK(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?r:null}}};const DK=AK;function kK(t){t.registerChartView(bK),t.registerSeriesModel(CK),t.registerLayout(_K),t.registerVisual(DK)}var LK=256,PK=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=us.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=t.length;h.width=e,h.height=n;for(var p=0;p0){var T=o(m)?s:l;m>0&&(m=m*I+S),x[b++]=T[C],x[b++]=T[C+1],x[b++]=T[C+2],x[b++]=T[C+3]*m*256}else b+=4}return c.putImageData(_,0,0),h},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=us.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},t}();const RK=PK;function OK(t,e,n){var i=t[1]-t[0];e=Os(e,(function(e){return{interval:[(e.interval[0]-t[0])/i,(e.interval[1]-t[0])/i]}}));var r=e.length,o=0;return function(t){var i;for(i=o;i=0;i--){a=e[i].interval;if(a[0]<=t&&t<=a[1]){o=i;break}}return i>=0&&i=e[0]&&t<=e[1]}}function EK(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var zK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(i=e)}))})),this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):EK(r)&&this._renderOnGeo(r,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var r=e.coordinateSystem;r&&(EK(r)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,r){var o,a,s,l,u=t.coordinateSystem,h=VO(u,"cartesian2d");if(h){var c=u.getAxis("x"),d=u.getAxis("y");0,o=c.getBandWidth()+.5,a=d.getBandWidth()+.5,s=c.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),v=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),m=t.get(["itemStyle","borderRadius"]),_=i_(t),x=t.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),M=h?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],I=n;Is[1]||Dl[1])continue;var k=u.dataToPoint([A,D]);C=new sy({shape:{x:k[0]-o/2,y:k[1]-a/2,width:o,height:a},style:T})}else{if(isNaN(f.get(M[1],I)))continue;C=new sy({z2:1,shape:u.dataToRect([f.get(M[0],I)]).contentShape,style:T})}if(f.hasItemOption){var L=f.getItemModel(I),P=L.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),v=L.getModel(["blur","itemStyle"]).getItemStyle(),y=L.getModel(["select","itemStyle"]).getItemStyle(),m=L.get(["itemStyle","borderRadius"]),b=P.get("focus"),w=P.get("blurScope"),S=P.get("disabled"),_=i_(L)}C.shape.r=m;var R=t.getRawValue(I),O="-";R&&null!=R[2]&&(O=R[2]+""),n_(C,_,{labelFetcher:t,labelDataIndex:I,defaultOpacity:T.opacity,defaultText:O}),C.ensureState("emphasis").style=g,C.ensureState("blur").style=v,C.ensureState("select").style=y,km(C,b,w,S),C.incremental=r,r&&(C.states.emphasis.hoverLayer=!0),p.add(C),f.setItemGraphicEl(I,C),this._progressiveEls&&this._progressiveEls.push(C)}},e.prototype._renderOnGeo=function(t,e,n,i){var r=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new RK;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),u=t.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,i.getWidth()),p=Math.min(l.height+l.y,i.getHeight()),f=d-h,g=p-c,v=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],y=a.mapArray(v,(function(e,n,i){var r=t.dataToPoint([e,n]);return r[0]-=h,r[1]-=c,r.push(i),r})),m=n.getExtent(),_="visualMap.continuous"===n.type?NK(m,n.option.range):OK(m,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Jv({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(x)},e.type="heatmap",e}(jC);const BK=zK;var VK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(t,e){return sO(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Xb.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const FK=VK;function GK(t){t.registerChartView(BK),t.registerSeriesModel(FK)}var HK=["itemStyle","borderWidth"],WK=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],UK=new tI,ZK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group,r=t.getData(),o=this._data,a=t.coordinateSystem,s=a.getBaseAxis(),l=s.isHorizontal(),u=a.master.getRect(),h={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[u.x,u.x+u.width],[u.y,u.y+u.height]],isHorizontal:l,valueDim:WK[+l],categoryDim:WK[1-+l]};return r.diff(o).add((function(t){if(r.hasValue(t)){var e=i$(r,t),n=YK(r,t,e,h),o=a$(r,h,n);r.setItemGraphicEl(t,o),i.add(o),d$(o,h,n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(r.hasValue(t)){var a=i$(r,t),s=YK(r,t,a,h),l=u$(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(t,null),n=null),n?s$(n,h,s):n=a$(r,h,s,!0),r.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,i.add(n),d$(n,h,s)}else i.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&l$(o,t,e.__pictorialSymbolMeta.animationModel,e)})).execute(),this._data=r,this.group},e.prototype.remove=function(t,e){var n=this.group,i=this._data;t.get("animation")?i&&i.eachItemGraphicEl((function(e){l$(i,Cy(e).dataIndex,t,e)})):n.removeAll()},e.type="pictorialBar",e}(jC);function YK(t,e,n,i){var r=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=n.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),d={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};XK(n,o,r,i,d),qK(t,e,r,o,a,d.boundingLength,d.pxSign,h,i,d),KK(n,d.symbolScale,u,i,d);var p=d.symbolSize,f=uA(n.get("symbolOffset"),p);return $K(n,p,r,o,a,f,s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,i,d),d}function XK(t,e,n,i,r){var o,a=i.valueDim,s=t.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(n[a.wh]<=0);if(Hs(s)){var c=[jK(l,s[0])-u,jK(l,s[1])-u];c[1]0?1:-1}function jK(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function qK(t,e,n,i,r,o,a,s,l,u){var h,c=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=t.getItemVisual(e,"symbolSize");h=Hs(f)?f.slice():null==f?["100%","100%"]:[f,f],h[d.index]=zp(h[d.index],p),h[c.index]=zp(h[c.index],i?p:Math.abs(o)),u.symbolSize=h;var g=u.symbolScale=[h[0]/s,h[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*a}function KK(t,e,n,i,r){var o=t.get(HK)||0;o&&(UK.attr({scaleX:e[0],scaleY:e[1],rotation:n}),UK.updateTransform(),o/=UK.getLineScale(),o*=e[i.valueDim.index]),r.valueLineWidth=o||0}function $K(t,e,n,i,r,o,a,s,l,u,h,c){var d=h.categoryDim,p=h.valueDim,f=c.pxSign,g=Math.max(e[p.index]+s,0),v=g;if(i){var y=Math.abs(l),m=el(t.get("symbolMargin"),"15%")+"",_=!1;m.lastIndexOf("!")===m.length-1&&(_=!0,m=m.slice(0,m.length-1));var x=zp(m,e[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=nf(i),M=S?i:p$((y+w)/b),I=y-M*g;x=I/2/(_?M:Math.max(M-1,1)),b=g+2*x,w=_?0:2*x,S||"fixed"===i||(M=u?p$((Math.abs(u)+w)/b):0),v=M*b-w,c.repeatTimes=M,c.symbolMargin=x}var C=f*(v/2),T=c.pathPosition=[];T[d.index]=n[d.wh]/2,T[p.index]="start"===a?C:"end"===a?l-C:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var A=c.bundlePosition=[];A[d.index]=n[d.xy],A[p.index]=n[p.xy];var D=c.barRectShape=Ts({},n);D[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(T[p.index]+C)),D[d.wh]=n[d.wh];var k=c.clipShape={};k[d.xy]=-n[d.xy],k[d.wh]=h.ecSize[d.wh],k[p.xy]=0,k[p.wh]=n[p.wh]}function JK(t){var e=t.symbolPatternSize,n=sA(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function QK(t,e,n,i){var r=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,h=0,c=o[e.valueDim.index]+a+2*n.symbolMargin;for(h$(t,(function(t){t.__pictorialAnimationIndex=h,t.__pictorialRepeatTimes=u,h0:i<0)&&(r=u-1-t),e[l.index]=c*(r-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function t$(t,e,n,i){var r=t.__pictorialBundle,o=t.__pictorialMainPath;o?c$(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(o=t.__pictorialMainPath=JK(n),r.add(o),c$(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function e$(t,e,n){var i=Ts({},e.barRectShape),r=t.__pictorialBarRect;r?c$(r,null,{shape:i},e,n):(r=t.__pictorialBarRect=new sy({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),r.disableMorphing=!0,t.add(r))}function n$(t,e,n,r){if(n.symbolClip){var o=t.__pictorialClipPath,a=Ts({},n.clipShape),s=e.valueDim,l=n.animationModel,u=n.dataIndex;if(o)Zm(o,{shape:a},l,u);else{a[s.wh]=0,o=new sy({shape:a}),t.__pictorialBundle.setClipPath(o),t.__pictorialClipPath=o;var h={};h[s.wh]=n.clipShape[s.wh],i[r?"updateProps":"initProps"](o,{shape:h},l,u)}}}function i$(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=r$,n.isAnimationEnabled=o$,n}function r$(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function o$(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function a$(t,e,n,i){var r=new Ip,o=new Ip;return r.add(o),r.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?QK(r,e,n):t$(r,e,n),e$(r,n,i),n$(r,e,n,i),r.__pictorialShapeStr=u$(t,n),r.__pictorialSymbolMeta=n,r}function s$(t,e,n){var i=n.animationModel,r=n.dataIndex,o=t.__pictorialBundle;Zm(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?QK(t,e,n,!0):t$(t,e,n,!0),e$(t,n,!0),n$(t,e,n,!0)}function l$(t,e,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var o=[];h$(i,(function(t){o.push(t)})),i.__pictorialMainPath&&o.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),Rs(o,(function(t){jm(t,{scaleX:0,scaleY:0},n,e,(function(){i.parent&&i.parent.remove(i)}))})),t.setItemGraphicEl(e,null)}function u$(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function h$(t,e,n){Rs(t.__pictorialBundle.children(),(function(i){i!==t.__pictorialBarRect&&e.call(n,i)}))}function c$(t,e,n,r,o,a){e&&t.attr(e),r.symbolClip&&!o?n&&t.attr(n):n&&i[o?"updateProps":"initProps"](t,n,r.animationModel,r.dataIndex,a)}function d$(t,e,n){var i=n.dataIndex,r=n.itemModel,o=r.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),h=o.get("focus"),c=o.get("blurScope"),d=o.get("scale");h$(t,(function(t){if(t instanceof Jv){var e=t.style;t.useStyle(Ts({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,d&&(i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var p=e.valueDim.posDesc[+(n.boundingLength>0)],f=t.__pictorialBarRect;n_(f,i_(r),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:hO(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),km(t,h,c,o.get("disabled"))}function p$(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}const f$=ZK;var g$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return qa(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=R_(IN.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(IN);const v$=g$;function y$(t){t.registerChartView(f$),t.registerSeriesModel(v$),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Gs(_N,"pictorialBar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,xN("pictorialBar"))}var m$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this,o=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function h(t){return t.name}o.x=0,o.y=l.y+u[0];var c=new pR(this._layersSeries||[],a,h,h),d=[];function p(e,n,s){var l=r._layers;if("remove"!==e){for(var u,h,c=[],p=[],f=a[n].indices,g=0;go&&(o=s),i.push(s)}for(var u=0;uo&&(o=c)}return{y0:r,max:o}}function T$(t){t.registerChartView(x$),t.registerSeriesModel(S$),t.registerLayout(M$),t.registerProcessor(pE("themeRiver"))}var A$=2,D$=4,k$=function(t){function e(e,n,i,r){var o=t.call(this)||this;o.z2=A$,o.textConfig={inside:!0},Cy(o).seriesIndex=n.seriesIndex;var a=new Iy({z2:D$,silent:e.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,e,n,i,r),o}return qa(e,t),e.prototype.updateData=function(t,e,n,i,r){this.node=e,e.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var o=this;Cy(o).dataIndex=e.dataIndex;var a=e.getModel(),s=a.getModel("emphasis"),l=e.getLayout(),u=Ts({},l);u.label=null;var h=e.getVisual("style");h.lineJoin="bevel";var c=e.getVisual("decal");c&&(h.decal=KA(c,r));var d=NN(a.getModel("itemStyle"),u,!0);Ts(u,d),Rs(Ny,(function(t){var e=o.ensureState(t),n=a.getModel([t,"itemStyle"]);e.style=n.getItemStyle();var i=NN(n,u);i&&(e.shape=i)})),t?(o.setShape(u),o.shape.r=l.r0,Ym(o,{shape:{r:l.r}},n,e.dataIndex)):(Zm(o,{shape:u},n),$m(o)),o.useStyle(h),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus"),g="ancestor"===f?e.getAncestorsIndices():"descendant"===f?e.getDescendantIndices():f;km(this,g,s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),o=r.endAngle-r.startAngle,a=(r.startAngle+r.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,h=u.getTextContent(),c=this.node.dataIndex,d=i.get("minAngle")/180*Math.PI,p=i.get("show")&&!(null!=d&&Math.abs(o)Math.PI/2?"right":"left"):S&&"center"!==S?"left"===S?(m=r.r0+w,a>Math.PI/2&&(S="right")):"right"===S&&(m=r.r-w,a>Math.PI/2&&(S="left")):(m=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=m*s+r.cx,g.y=m*l+r.cy;var M=f(d,"rotate"),I=0;"radial"===M?(I=Sv(-a),I>Math.PI/2&&I<1.5*Math.PI&&(I+=Math.PI)):"tangential"===M?(I=Math.PI/2-a,I>Math.PI/2?I-=Math.PI:I<-Math.PI/2&&(I+=Math.PI)):Ys(M)&&(I=M*Math.PI/180),g.rotation=Sv(I)})),h.dirtyStyle()},e}(bI);const L$=k$;var P$="sunburstRootToNode",R$="sunburstHighlight",O$="sunburstUnhighlight";function N$(t){t.registerAction({type:P$,update:"updateView"},(function(t,e){function n(e,n){var i=$H(t,[P$],e);if(i){var r=e.getViewRoot();r&&(t.direction=QH(r,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}e.eachComponent({mainType:"series",subType:"sunburst",query:t},n)})),t.registerAction({type:R$,update:"none"},(function(t,e,n){function i(e){var n=$H(t,[R$],e);n&&(t.dataIndex=n.node.dataIndex)}t=Ts({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},i),n.dispatchAction(Ts(t,{type:"highlight"}))})),t.registerAction({type:O$,update:"updateView"},(function(t,e,n){t=Ts({},t),n.dispatchAction(Ts(t,{type:"downplay"}))}))}var E$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n,i){var r=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),h=[];s.eachNode((function(t){h.push(t)}));var c=this._oldChildren||[];function d(t,e){function n(t){return t.getId()}function i(n,i){var r=null==n?null:t[n],o=null==i?null:e[i];p(r,o)}0===t.length&&0===e.length||new pR(e,t,n,n).add(i).update(i).remove(Gs(i,null)).execute()}function p(i,r){if(u||!i||i.getValue()||(i=null),i!==a&&r!==a)if(r&&r.piece)i?(r.piece.updateData(!1,i,t,e,n),o.setItemGraphicEl(i.dataIndex,r.piece)):f(r);else if(i){var s=new L$(i,t,e,n);l.add(s),o.setItemGraphicEl(i.dataIndex,s)}}function f(t){t&&t.piece&&(l.remove(t.piece),t.piece=null)}function g(i,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,t,e,n):(r.virtualPiece=new L$(i,t,e,n),l.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",(function(t){r._rootToNode(o.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}d(h,c),g(a,s),this._initEvents(),this._oldChildren=h},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1,i=t.seriesModel.getViewRoot();i.eachNode((function(i){if(!n&&i.piece&&i.piece===e.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)t._rootToNode(i);else if("link"===r){var o=i.getModel(),a=o.get("link");if(a){var s=o.get("target",!0)||"_blank";Nx(a,s)}}n=!0}}))}))},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:P$,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var n=e.getData(),i=n.getItemLayout(0);if(i){var r=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(r*r+o*o);return a<=i.r&&a>=i.r0}},e.type="sunburst",e}(jC);const z$=E$;var B$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};V$(n);var i=this._levelModels=Os(t.levels||[],(function(t){return new A_(t,this,e)}),this),r=KH.createTree(n,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e),o=i[n.depth];return o&&(t.parentModel=o),t}))}return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=tW(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){dW(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(IM);function V$(t){var e=0;Rs(t.children,(function(t){V$(t);var n=t.value;Hs(n)&&(n=n[0]),e+=n}));var n=t.value;Hs(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Hs(t.value)?t.value[0]=n:t.value=n}const F$=B$;var G$=Math.PI/180;function H$(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),i=t.get("radius");Hs(i)||(i=[0,i]),Hs(e)||(e=[e,e]);var r=n.getWidth(),o=n.getHeight(),a=Math.min(r,o),s=zp(e[0],r),l=zp(e[1],o),u=zp(i[0],a/2),h=zp(i[1],a/2),c=-t.get("startAngle")*G$,d=t.get("minAngle")*G$,p=t.getData().tree.root,f=t.getViewRoot(),g=f.depth,v=t.get("sort");null!=v&&W$(f,v);var y=0;Rs(f.children,(function(t){!isNaN(t.getValue())&&y++}));var m=f.getValue(),_=Math.PI/(m||y)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(h-u)/(b||1),S=t.get("clockwise"),M=t.get("stillShowZeroSum"),I=S?1:-1,C=function(e,n){if(e){var i=n;if(e!==p){var r=e.getValue(),o=0===m&&M?_:r*_;o1)r=r.parentNode;var o=n.getColorFromPalette(r.name||r.dataIndex+"",e);return t.depth>1&&Us(o)&&(o=yc(o,(t.depth-1)/(i-1)*.5)),o}t.eachSeriesByType("sunburst",(function(t){var e=t.getData(),i=e.tree;i.eachNode((function(r){var o=r.getModel(),a=o.getModel("itemStyle").getItemStyle();a.fill||(a.fill=n(r,t,i.root.height));var s=e.ensureUniqueItemVisual(r.dataIndex,"style");Ts(s,a)}))}))}function Y$(t){t.registerChartView(z$),t.registerSeriesModel(F$),t.registerLayout(Gs(H$,"sunburst")),t.registerProcessor(Gs(pE,"sunburst")),t.registerVisual(Z$),N$(t)}var X$={color:"fill",borderColor:"stroke"},j$={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},q$=Pf(),K$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return sO(null,this)},e.prototype.getDataParams=function(e,n,i){var r=t.prototype.getDataParams.call(this,e,n);return i&&(r.info=q$(i).info),r},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(IM);const $$=K$;function J$(t,e){return e=e||[0,0],Os(["x","y"],(function(n,i){var r=this.getAxis(n),o=e[i],a=t[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))}),this)}function Q$(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(J$,t)}}}function tJ(t,e){return e=e||[0,0],Os([0,1],(function(n){var i=e[n],r=t[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function eJ(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(tJ,t)}}}function nJ(t,e){var n=this.getAxis(),i=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function iJ(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(nJ,t)}}}function rJ(t,e){return e=e||[0,0],Os(["Radius","Angle"],(function(n,i){var r="get"+n+"Axis",o=this[r](),a=e[i],s=t[i]/2,l="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-s)-o.dataToCoord(a+s));return"Angle"===n&&(l=l*Math.PI/180),l}),this)}function oJ(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=e.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=t.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:Fs(rJ,t)}}}function aJ(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}function sJ(t,e,n,i){return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||_l(t,"text")))}function lJ(t,e,n){var i,r,o,a=t;if("text"===e)o=a;else{o={},_l(a,"text")&&(o.text=a.text),_l(a,"rich")&&(o.rich=a.rich),_l(a,"textFill")&&(o.fill=a.textFill),_l(a,"textStroke")&&(o.stroke=a.textStroke),_l(a,"fontFamily")&&(o.fontFamily=a.fontFamily),_l(a,"fontSize")&&(o.fontSize=a.fontSize),_l(a,"fontStyle")&&(o.fontStyle=a.fontStyle),_l(a,"fontWeight")&&(o.fontWeight=a.fontWeight),r={type:"text",style:o,silent:!0},i={};var s=_l(a,"textPosition");n?i.position=s?a.textPosition:"inside":s&&(i.position=a.textPosition),_l(a,"textPosition")&&(i.position=a.textPosition),_l(a,"textOffset")&&(i.offset=a.textOffset),_l(a,"textRotation")&&(i.rotation=a.textRotation),_l(a,"textDistance")&&(i.distance=a.textDistance)}return uJ(o,t),Rs(o.rich,(function(t){uJ(t,t)})),{textConfig:i,textContent:r}}function uJ(t,e){e&&(e.font=e.textFont||e.font,_l(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),_l(e,"textAlign")&&(t.align=e.textAlign),_l(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),_l(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),_l(e,"textWidth")&&(t.width=e.textWidth),_l(e,"textHeight")&&(t.height=e.textHeight),_l(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),_l(e,"textPadding")&&(t.padding=e.textPadding),_l(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),_l(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),_l(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),_l(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),_l(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),_l(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),_l(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function hJ(t,e,n){var i=t;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,o=t.fill||"#000";cJ(i,e);var a=null==i.textFill;return r?a&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=o),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(a&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,Rs(e.rich,(function(t){cJ(t,t)})),i}function cJ(t,e){e&&(_l(e,"fill")&&(t.textFill=e.fill),_l(e,"stroke")&&(t.textStroke=e.fill),_l(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),_l(e,"font")&&(t.font=e.font),_l(e,"fontStyle")&&(t.fontStyle=e.fontStyle),_l(e,"fontWeight")&&(t.fontWeight=e.fontWeight),_l(e,"fontSize")&&(t.fontSize=e.fontSize),_l(e,"fontFamily")&&(t.fontFamily=e.fontFamily),_l(e,"align")&&(t.textAlign=e.align),_l(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),_l(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),_l(e,"width")&&(t.textWidth=e.width),_l(e,"height")&&(t.textHeight=e.height),_l(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),_l(e,"padding")&&(t.textPadding=e.padding),_l(e,"borderColor")&&(t.textBorderColor=e.borderColor),_l(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),_l(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),_l(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),_l(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),_l(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),_l(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),_l(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),_l(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),_l(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),_l(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var dJ={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},pJ=Bs(dJ),fJ=(Ns(Jd,(function(t,e){return t[e]=1,t}),{}),Jd.join(", "),["","style","shape","extra"]),gJ=Pf();function vJ(t,e,n,i,r){var o=t+"Animation",a=Wm(t,i,r)||{},s=gJ(e).userDuring;return a.duration>0&&(a.during=s?Fs(CJ,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),Ts(a,n[o]),a}function yJ(t,e,n,i){i=i||{};var r=i.dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=gJ(t),u=e.style;l.userDuring=e.during;var h={},c={};if(kJ(t,e,c),AJ("shape",e,c),AJ("extra",e,c),!o&&s&&(DJ(t,e,h),TJ("shape",t,e,h),TJ("extra",t,e,h),LJ(t,e,u,h)),c.style=u,bJ(t,c,a),SJ(t,e),s)if(o){var d={};Rs(fJ,(function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(d[t]=d[t]||{}),Ts(t?d[t]:d,n.enterFrom))}));var p=vJ("enter",t,e,n,r);p.duration>0&&t.animateFrom(d,p)}else wJ(t,e,r||0,n,h);mJ(t,e),u?t.dirty():t.markRedraw()}function mJ(t,e){for(var n=gJ(t).leaveToProps,i=0;i0&&t.animateFrom(r,o)}}function SJ(t,e){_l(e,"silent")&&(t.silent=e.silent),_l(e,"ignore")&&(t.ignore=e.ignore),t instanceof zg&&_l(e,"invisible")&&(t.invisible=e.invisible),t instanceof Uv&&_l(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var MJ={},IJ={setTransform:function(t,e){return MJ.el[t]=e,this},getTransform:function(t){return MJ.el[t]},setShape:function(t,e){var n=MJ.el,i=n.shape||(n.shape={});return i[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=MJ.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=MJ.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=MJ.el.style;if(e)return e[t]},setExtra:function(t,e){var n=MJ.el.extra||(MJ.el.extra={});return n[t]=e,this},getExtra:function(t){var e=MJ.el.extra;if(e)return e[t]}};function CJ(){var t=this,e=t.el;if(e){var n=gJ(e).userDuring,i=t.userDuring;n===i?(MJ.el=e,i(IJ)):t.el=t.userDuring=null}}function TJ(t,e,n,i){var r=n[t];if(r){var o,a=e[t];if(a){var s=n.transition,l=r.transition;if(l)if(!o&&(o=i[t]={}),xJ(l))Ts(o,a);else for(var u=hf(l),h=0;h=0){!o&&(o=i[t]={});var p=Bs(a);for(h=0;h=0)){var d=t.getAnimationStyleProps(),p=d?d.style:null;if(p){!r&&(r=i.style={});var f=Bs(n);for(u=0;u=0?e.getStore().get(r,n):void 0}var o=e.get(i.name,n),a=i&&i.ordinalMeta;return a?a.categories[o]:o}function w(n,i){null==i&&(i=s);var r=e.getItemVisual(i,"style"),o=r&&r.fill,a=r&&r.opacity,l=m(i,BJ).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:Us(o)?o:"#000"},h=_(i,BJ),c=r_(h,null,u,!1,!0);c.text=h.getShallow("show")?nl(t.getFormattedLabel(i,BJ),hO(e,i)):null;var d=o_(h,u,!1);return I(n,l),l=hJ(l,c,d),n&&M(l,n),l.legacy=!0,l}function S(n,i){null==i&&(i=s);var r=m(i,zJ).getItemStyle(),o=_(i,zJ),a=r_(o,null,null,!0,!0);a.text=o.getShallow("show")?il(t.getFormattedLabel(i,zJ),t.getFormattedLabel(i,BJ),hO(e,i)):null;var l=o_(o,null,!0);return I(n,r),r=hJ(r,a,l),n&&M(r,n),r.legacy=!0,r}function M(t,e){for(var n in e)_l(e,n)&&(t[n]=e[n])}function I(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}function C(t,n){if(null==n&&(n=s),_l(X$,t)){var i=e.getItemVisual(n,"style");return i?i[X$[t]]:null}if(_l(j$,t))return e.getItemVisual(n,t)}function T(t){if("cartesian2d"===o.type){var e=o.getBaseAxis();return pN(As({axis:e},t))}}function A(){return n.getCurrentSeriesIndices()}function D(t){return d_(t,n)}}function oQ(t){var e={};return Rs(t.dimensions,(function(n){var i=t.getDimensionInfo(n);if(!i.isExtraCoord){var r=i.coordDim,o=e[r]=e[r]||[];o[i.coordDimIndex]=t.getDimensionIndex(n)}})),e}function aQ(t,e,n,i,r,o,a){if(i){var s=sQ(t,e,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&km(s,i.focus,i.blurScope,i.emphasisDisabled),s}o.remove(e)}function sQ(t,e,n,i,r,o){var a=-1,s=e;e&&lQ(e,i,r)&&(a=Ds(o.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=QJ(i),s&&KJ(s,u)),!1===i.morph?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),YJ.normal.cfg=YJ.normal.conOpt=YJ.emphasis.cfg=YJ.emphasis.conOpt=YJ.blur.cfg=YJ.blur.conOpt=YJ.select.cfg=YJ.select.conOpt=null,YJ.isLegacy=!1,hQ(u,n,i,r,l,YJ),uQ(u,n,i,r,l),tQ(t,u,n,i,YJ,r,l),_l(i,"info")&&(q$(u).info=i.info);for(var h=0;h=0?o.replaceAt(u,a):o.add(u),u}function lQ(t,e,n){var i=q$(t),r=e.type,o=e.shape,a=e.style;return n.isUniversalTransitionEnabled()||null!=r&&r!==i.customGraphicType||"path"===r&&bQ(o)&&xQ(o)!==i.customPathData||"image"===r&&_l(a,"image")&&a.image!==i.customImagePath}function uQ(t,e,n,i,r){var o=n.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var a=t.getClipPath();a&&lQ(a,o,i)&&(a=null),a||(a=QJ(o),t.setClipPath(a)),tQ(null,a,e,o,null,i,r)}}function hQ(t,e,n,i,r,o){if(!t.isGroup){cQ(n,null,o),cQ(n,zJ,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var h=t.getTextContent();if(!1===a)h&&t.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},h?h.clearStates():(h=QJ(a),t.setTextContent(h)),tQ(null,h,e,a,null,i,r);for(var c=a&&a.style,d=0;d=h;p--){var f=e.childAt(p);gQ(e,f,r)}}}function gQ(t,e,n){e&&_J(e,q$(t).option,n)}function vQ(t){new pR(t.oldChildren,t.newChildren,yQ,yQ,t).add(mQ).update(mQ).remove(_Q).execute()}function yQ(t,e){var n=t&&t.name;return null!=n?n:ZJ+e}function mQ(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,r=null!=e?n.oldChildren[e]:null;sQ(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function _Q(t){var e=this.context,n=e.oldChildren[t];n&&_J(n,q$(n).option,e.seriesModel)}function xQ(t){return t&&(t.pathData||t.d)}function bQ(t){return t&&(_l(t,"pathData")||_l(t,"d"))}function wQ(t){t.registerChartView(JJ),t.registerSeriesModel($$)}var SQ=Pf(),MQ=Ms,IQ=Fs,CQ=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,i){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(a){var c=Gs(TQ,e,h);this.updatePointerEl(a,l,c),this.updateLabelEl(a,l,c,e)}else a=this._group=new Ip,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);LQ(a,e,!0),this._renderHandle(r)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,r="category"===i.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=cV(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,r){var o=e.pointer;if(o){var a=SQ(t).pointerEl=new i[o.type](MQ(e.pointer));t.add(a)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=SQ(t).labelEl=new Iy(MQ(e.label));t.add(r),DQ(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=SQ(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=SQ(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),DQ(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=PC(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){gu(t.event)},onmousedown:IQ(this._onHandleDragMove,this,0,0),drift:IQ(this._onHandleDragMove,this),ondragend:IQ(this._onHandleDragEnd,this)}),i.add(r)),LQ(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");Hs(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,QC(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){TQ(this._axisPointerModel,!e&&this._moveAnimation,this._handle,kQ(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(kQ(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(kQ(i)),SQ(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),tT(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}},t}();function TQ(t,e,n,i){AQ(SQ(n).lastProp,i)||(SQ(n).lastProp=i,e?Zm(n,i,t):(n.stopAnimation(),n.attr(i)))}function AQ(t,e){if(Xs(t)&&Xs(e)){var n=!0;return Rs(e,(function(e,i){n=n&&AQ(t[i],e)})),!!n}return t===e}function DQ(t,e){t[e.get(["label","show"])?"show":"hide"]()}function kQ(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function LQ(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)}))}const PQ=CQ;function RQ(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle(),e.fill=null):"shadow"===n&&(e=i.getAreaStyle(),e.stroke=null),e}function OQ(t,e,n,i,r){var o=n.get("value"),a=EQ(o,e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),s=n.getModel("label"),l=Tx(s.get("padding")||0),u=s.getFont(),h=rp(a,u),c=r.position,d=h.width+l[1]+l[3],p=h.height+l[0]+l[2],f=r.align;"right"===f&&(c[0]-=d),"center"===f&&(c[0]-=d/2);var g=r.verticalAlign;"bottom"===g&&(c[1]-=p),"middle"===g&&(c[1]-=p/2),NQ(c,d,p,i);var v=s.get("backgroundColor");v&&"auto"!==v||(v=e.get(["axisLine","lineStyle","color"])),t.label={x:c[0],y:c[1],style:r_(s,{text:a,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function NQ(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function EQ(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:Qz(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};Rs(i,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)})),Us(a)?o=a.replace("{value}",o):Ws(a)&&(o=a(s))}return o}function zQ(t,e,n){var i=bu();return Cu(i,i,n.rotation),Iu(i,i,n.position),IC([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function BQ(t,e,n,i,r,o){var a=iV.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),OQ(e,i,r,o,{position:zQ(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function VQ(t,e,n){return n=n||0,{x1:t[n],y1:t[1-n],x2:e[n],y2:e[1-n]}}function FQ(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}}function GQ(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}var HQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=WQ(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=RQ(i),c=UQ[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}var d=OB(a.model,n);BQ(e,t,d,n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=OB(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=zQ(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=WQ(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}},e}(PQ);function WQ(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var UQ={line:function(t,e,n){var i=VQ([e,n[0]],[e,n[1]],ZQ(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:FQ([e-i/2,n[0]],[i,r],ZQ(t))}}};function ZQ(t){return"x"===t.dim?0:1}const YQ=HQ;var XQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,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",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Jx);const jQ=XQ;var qQ=Pf(),KQ=Rs;function $Q(t,e,n){if(!ts.node){var i=e.getZr();qQ(i).records||(qQ(i).records={}),JQ(i,e);var r=qQ(i).records[t]||(qQ(i).records[t]={});r.handler=n}}function JQ(t,e){function n(n,i){t.on(n,(function(n){var r=n0(e);KQ(qQ(t).records,(function(t){t&&i(t,n,r.dispatchAction)})),QQ(r.pendings,e)}))}qQ(t).initialized||(qQ(t).initialized=!0,n("click",Gs(e0,"click")),n("mousemove",Gs(e0,"mousemove")),n("globalout",t0))}function QQ(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function t0(t,e,n){t.handler("leave",null,n)}function e0(t,e,n,i){e.handler(t,n,i)}function n0(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}function i0(t,e){if(!ts.node){var n=e.getZr(),i=(qQ(n).records||{})[t];i&&(qQ(n).records[t]=null)}}var r0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";$Q("axisPointer",n,(function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){i0("axisPointer",e)},e.prototype.dispose=function(t,e){i0("axisPointer",e)},e.type="axisPointer",e}(TM);const o0=r0;function a0(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=Lf(o,t);if(null==a||a<0||Hs(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,d=u.dim,p="x"===c||"radius"===c?1:0,f=o.mapDimension(d),g=[];g[p]=o.get(f,a),g[1-p]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(g)||[]}else i=l.dataToPoint(o.getValues(Os(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),i=[v.x+v.width/2,v.y+v.height/2]}return{point:i,el:s}}var s0=Pf();function l0(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||Fs(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){m0(r)&&(r=a0({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=m0(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||m0(r),d={},p={},f={list:[],map:{}},g={showPointer:Gs(c0,p),showTooltip:Gs(d0,f)};Rs(s.coordSysMap,(function(t,e){var n=l||t.containPoint(r);Rs(s.coordSysAxesInfo[e],(function(t,e){var i=t.axis,o=v0(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&u0(t,a,g,!1,d)}}))}));var v={};return Rs(h,(function(t,e){var n=t.linkGroup;n&&!p[e]&&Rs(n.axesInfo,(function(e,i){var r=p[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,y0(e),y0(t)))),v[t.key]=o}}))})),Rs(v,(function(t,e){u0(h[e],t,g,!0,d)})),p0(p,h,d),f0(f,r,t,a),g0(h,a,n),d}}function u0(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=h0(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&Ts(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function h0(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return Rs(e.seriesModels,(function(e,l){var u,h,c=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,n);h=d.dataIndices,u=d.nestestValue}else{if(h=e.getData().indicesOfNearest(c[0],t,"category"===n.type?.5:null),!h.length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var p=t-u,f=Math.abs(p);f<=a&&((f=0&&s<0)&&(a=f,s=p,r=u,o.length=0),Rs(h,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}function c0(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function d0(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=fV(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function p0(t,e,n){var i=n.axesInfo=[];Rs(e,(function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}function f0(t,e,n,i){if(!m0(e)&&t.list.length){var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}function g0(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=s0(i)[r]||{},a=s0(i)[r]={};Rs(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&Rs(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];Rs(o,(function(t,e){!a[e]&&l.push(t)})),Rs(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function v0(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function y0(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function m0(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function _0(t){yV.registerAxisPointerClass("CartesianAxisPointer",YQ),t.registerComponentModel(jQ),t.registerComponentView(o0),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!Hs(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=rV(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},l0)}function x0(t){Ek(DV),Ek(_0)}var b0=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o),l=s.getExtent(),u=o.dataToCoord(e),h=i.get("type");if(h&&"none"!==h){var c=RQ(i),d=S0[h](o,a,u,l);d.style=c,t.graphicKey=d.type,t.pointer=d}var p=i.get(["label","margin"]),f=w0(e,n,i,a,p);OQ(t,n,i,r,f)},e}(PQ);function w0(t,e,n,i,r){var o=e.axis,a=o.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=i.getRadiusAxis().getExtent();if("radius"===o.dim){var d=bu();Cu(d,d,s),Iu(d,d,[i.cx,i.cy]),l=IC([a,-r],d);var p=e.getModel("axisLabel").get("rotate")||0,f=iV.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=i.coordToPoint([g+r,a]);var v=i.cx,y=i.cy;u=Math.abs(l[0]-v)/g<.3?"center":l[0]>v?"left":"right",h=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}var S0={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:VQ(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:GQ(e.cx,e.cy,i[0],i[1],(-n-r/2)*o,(r/2-n)*o)}:{type:"Sector",shape:GQ(e.cx,e.cy,n-r/2,n+r/2,0,2*Math.PI)}}};const M0=b0;var I0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.findAxisModel=function(t){var e,n=this.ecModel;return n.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Jx);const C0=I0;var T0=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ef).models[0]},e.type="polarAxis",e}(Jx);Ls(T0,HE);var A0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="angleAxis",e}(T0),D0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="radiusAxis",e}(T0),k0=function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return qa(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(LB);k0.prototype.dataToRadius=LB.prototype.dataToCoord,k0.prototype.radiusToData=LB.prototype.coordToData;const L0=k0;var P0=Pf(),R0=function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return qa(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),r=n.count();if(i[1]-i[0]<1)return 0;var o=i[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=rp(null==o?"":o+"",e.getFont(),"center","top"),u=Math.max(l.height,7),h=u/s;isNaN(h)&&(h=1/0);var c=Math.max(0,Math.floor(h)),d=P0(t.model),p=d.lastAutoInterval,f=d.lastTickCount;return null!=p&&null!=f&&Math.abs(p-c)<=1&&Math.abs(f-r)<=1&&p>c?c=p:(d.lastTickCount=r,d.lastAutoInterval=c),c},e}(LB);R0.prototype.dataToAngle=LB.prototype.dataToCoord,R0.prototype.angleToData=LB.prototype.coordToData;const O0=R0;var N0=["radius","angle"],E0=function(){function t(t){this.dimensions=N0,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new L0,this._angleAxis=new O0,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){var e="_"+t+"Axis";return this[e]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);i.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;var l=Math.atan2(-n,e)/Math.PI*180,u=la)l+=360*u;return[s,l]},t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI,i=Math.cos(n)*e+this.cx,r=-Math.sin(n)*e+this.cy;return[i,r]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis(),n=e.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),r=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*r,endAngle:-i[1]*r,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,i=e-this.cy,r=n*n+i*i-1e-4,o=this.r,a=this.r0;return r<=o*o&&r>=a*a}}},t.prototype.convertToPixel=function(t,e,n){var i=z0(e);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=z0(e);return i===this?this.pointToData(n):null},t}();function z0(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const B0=E0;function V0(t,e,n){var i=e.get("center"),r=n.getWidth(),o=n.getHeight();t.cx=zp(i[0],r),t.cy=zp(i[1],o);var a=t.getRadiusAxis(),s=Math.min(r,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:Hs(l)||(l=[0,l]);var u=[zp(l[0],s),zp(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}function F0(t,e){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();Rs(rB(e,"radius"),(function(t){r.scale.unionExtentFromData(e,t)})),Rs(rB(e,"angle"),(function(t){i.scale.unionExtentFromData(e,t)}))}})),qz(i.scale,i.model),qz(r.scale,r.model),"category"===i.type&&!i.onBand){var o=i.getExtent(),a=360/i.scale.count();i.inverse?o[1]+=a:o[1]-=a,i.setExtent(o[0],o[1])}}function G0(t){return"angleAxis"===t.mainType}function H0(t,e){if(t.type=e.get("type"),t.scale=Kz(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),G0(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle");t.setExtent(n,n+(t.inverse?-360:360))}e.axis=t,t.model=e}var W0={dimensions:N0,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,i){var r=new B0(i+"");r.update=F0;var o=r.getRadiusAxis(),a=r.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");H0(o,s),H0(a,l),V0(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t})),t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",Ef).models[0];0,t.coordinateSystem=e.coordinateSystem}})),n}};const U0=W0;var Z0=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Y0(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),r=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function X0(t){var e=t.getRadiusAxis();return e.inverse?0:1}function j0(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var q0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return qa(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=Os(n.getViewLabels(),(function(t){t=Ms(t);var e=n.scale,i="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=n.dataToCoord(i),t}));j0(s),j0(o),Rs(Z0,(function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||K0[e](this.group,t,i,o,a,r,s)}),this)}},e.type="angleAxis",e}(yV),K0={axisLine:function(t,e,n,i,r,o){var a,s=e.getModel(["axisLine","lineStyle"]),l=X0(n),u=l?0:1;a=0===o[u]?new tI({shape:{cx:n.cx,cy:n.cy,r:o[l]},style:s.getLineStyle(),z2:1,silent:!0}):new MI({shape:{cx:n.cx,cy:n.cy,r:o[l],r0:o[u]},style:s.getLineStyle(),z2:1,silent:!0}),a.style.fill=null,t.add(a)},axisTick:function(t,e,n,i,r,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[X0(n)],u=Os(i,(function(t){return new EI({shape:Y0(n,[l,l+s],t.coord)})}));t.add(_C(u,{style:As(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,r,o){if(r.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[X0(n)],h=[],c=0;cf?"left":"right",y=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[c]){var m=s[c];Xs(m)&&m.textStyle&&(a=new A_(m.textStyle,l,l.ecModel))}var _=new Iy({silent:iV.isLabelSilent(e),style:r_(a,{x:p[0],y:p[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:v,verticalAlign:y})});if(t.add(_),h){var x=iV.makeAxisEventDataBase(e);x.targetType="axisLabel",x.value=i.rawLabel,Cy(_).eventData=x}}),this)},splitLine:function(t,e,n,i,r,o){var a=e.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c=0?"p":"n",C=x;m&&(i[s][M]||(i[s][M]={p:x,n:x}),C=i[s][M][I]);var T=void 0,A=void 0,D=void 0,k=void 0;if("radius"===c.dim){var L=c.dataToCoord(S)-x,P=o.dataToCoord(M);Math.abs(L)=k})}}}))}function s1(t){var e={};Rs(t,(function(t,n){var i=t.getData(),r=t.coordinateSystem,o=r.getBaseAxis(),a=o1(r,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/i.count(),u=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;e[a]=u;var c=r1(t);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=zp(t.get("barWidth"),l),p=zp(t.get("barMaxWidth"),l),f=t.get("barGap"),g=t.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),p&&(h[c].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return Rs(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=zp(t.categoryGap,r),a=zp(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),Rs(i,(function(t,e){var n=t.maxWidth;n&&n=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[r]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){var i=I1(e);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=I1(e);return i===this?this.pointToData(n):null},t}();function I1(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const C1=M1;function T1(t,e){var n=[];return t.eachComponent("singleAxis",(function(i,r){var o=new C1(i,t,e);o.name="single_"+r,o.resize(i,e),i.coordinateSystem=o,n.push(o)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",Ef).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n}var A1={create:T1,dimensions:S1};const D1=A1;var k1=["x","y"],L1=["width","height"],P1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.coordinateSystem,s=N1(a,1-O1(o)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var h=RQ(i),c=R1[u](o,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}var d=p1(n);BQ(e,t,d,n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=p1(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=zQ(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.coordinateSystem,a=O1(r),s=N1(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=N1(o,1-a),h=(u[1]+u[0])/2,c=[h,h];return c[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}},e}(PQ),R1={line:function(t,e,n){var i=VQ([e,n[0]],[e,n[1]],O1(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,n){var i=t.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:FQ([e-i/2,n[0]],[i,r],O1(t))}}};function O1(t){return t.isHorizontal()?0:1}function N1(t,e){var n=t.getRect();return[n[k1[e]],n[k1[e]]+n[L1[e]]]}const E1=P1;var z1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="single",e}(TM);function B1(t){Ek(_0),yV.registerAxisPointerClass("SingleAxisPointer",E1),t.registerComponentView(z1),t.registerComponentView(m1),t.registerComponentModel(x1),ez(t,"single",x1,x1.defaultOption),t.registerCoordinateSystem("single",D1)}var V1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e,n,i){var r=Xx(e);t.prototype.init.apply(this,arguments),F1(e,r)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),F1(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Jx);function F1(t,e){var n,i=t.cellSize;n=Hs(i)?i:t.cellSize=[i,i],1===n.length&&(n[1]=n[0]);var r=Os([0,1],(function(t){return Ux(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]}));Yx(t,e,{type:"box",ignoreSize:r})}const G1=V1;var H1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var r=t.coordinateSystem,o=r.getRangeInfo(),a=r.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,i),this._renderLines(t,o,a,i),this._renderYearText(t,o,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,o,a,i)},e.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new sy({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:r});n.add(u)}},e.prototype._renderLines=function(t,e,n,i){var r=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,h=0;u.time<=e.end.time;h++){d(u.formatedDate),0===h&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=o.getDateInfo(c)}function d(e){r._firstDayOfMonth.push(o.getDateInfo(e)),r._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=r._getLinePointsOfOneWeek(t,e,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,a,i)}d(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),a,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),a,i)},e.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-e/2,i[1][r]=i[1][r]+e/2,i},e.prototype._drawSplitline=function(t,e,n){var i=new PI({z2:20,shape:{points:t},style:e});n.add(i)},e.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,r=i.getDateInfo(e),o=[],a=0;a<7;a++){var s=i.getNextNDay(r.time,a),l=i.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return Us(t)&&t?Px(t,e):Ws(t)?t(e):e.nameMap},e.prototype._yearTextPositionControl=function(t,e,n,i,r){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=r,s=["center","top"]):"left"===i?o-=r:"right"===i?(o+=r,s=["center","top"]):a-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},e.prototype._renderYearText=function(t,e,n,i){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),a=r.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===n?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var p=r.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(p,f),v=new Iy({z2:30,style:r_(r,{text:g})});v.attr(this._yearTextPositionControl(v,c[a],n,a,o)),i.add(v)}},e.prototype._monthTextPositionControl=function(t,e,n,i,r){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=r,e&&(o="center"),"start"===i&&(a="bottom")):(s+=r,e&&(a="middle"),"start"===i&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderMonthText=function(t,e,n,i){var r=t.getModel("monthLabel");if(r.get("show")){var o=r.get("nameMap"),a=r.get("margin"),s=r.get("position"),l=r.get("align"),u=[this._tlpoints,this._blpoints];o&&!Us(o)||(o&&(e=U_(o)||e),o=e.get(["time","monthAbbr"])||[]);var h="start"===s?0:1,c="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=0;p=i.start.time&&n.timea.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/U1)-Math.floor(n[0].time/U1)+1,r=new Date(n[0].time),o=r.getDate(),a=n[1].date.getDate();r.setDate(o+i-1);var s=r.getDate();if(s!==a){var l=r.getTime()-n[1].time>0?1:-1;while((s=r.getDate())!==a&&(r.getTime()-n[1].time)*l>0)i-=l,r.setDate(s-l)}var u=Math.floor((i+n[0].day+6)/7),h=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,nthWeek:h,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&ei.lweek)return null;var r=7*(t-1)-i.fweek+e,o=new Date(i.start.time);return o.setDate(+i.start.d+r),this.getDateInfo(o)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",(function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])})),i},t.dimensions=["time","value"],t}();function Y1(t){var e=t.calendarModel,n=t.seriesModel,i=e?e.coordinateSystem:n?n.coordinateSystem:null;return i}const X1=Z1;function j1(t){t.registerComponentModel(G1),t.registerComponentView(W1),t.registerCoordinateSystem("calendar",X1)}function q1(t,e){var n=t.existing;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}e.parentOption=null}function K1(t,e){var n;return Rs(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}function $1(t,e,n){var i=Ts({},n),r=t[e],o=n.$action||"merge";"merge"===o?r?(Is(r,i,!0),Yx(r,i,{ignoreSize:!0}),jx(n,r),t2(n,r),t2(n,r,"shape"),t2(n,r,"style"),t2(n,r,"extra"),n.clipPath=r.clipPath):t[e]=i:"replace"===o?t[e]=i:"remove"===o&&r&&(t[e]=null)}var J1=["transition","enterFrom","leaveTo"],Q1=J1.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function t2(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?J1:Q1,r=0;r=0;l--){u=n[l],h=Mf(u.id,null),c=null!=h?r.get(h):null;if(c){d=c.parent,g=r2(d);var v=d===i?{width:o,height:a}:{width:g.width,height:g.height},y={},m=Wx(c,u,v,null,{hv:u.hv,boundingMode:u.bounding},y);if(!r2(c).isNew&&m){for(var _=u.transition,x={},b=0;b=0)?x[w]=S:c[w]=S}Zm(c,x,t,0)}else c.attr(y)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){l2(n,r2(n).option,e,t._lastGraphicModel)})),this._elMap=gl()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(TM);function a2(t){var e=_l(i2,t)?i2[t]:gC(t);var n=new e({});return r2(n).type=t,n}function s2(t,e,n,i){var r=a2(n);return e.add(r),i.set(t,r),r2(r).id=t,r2(r).isNew=!0,r}function l2(t,e,n,i){var r=t&&t.parent;r&&("group"===t.type&&t.traverse((function(t){l2(t,e,n,i)})),_J(t,e,i),n.removeKey(r2(t).id))}function u2(t,e,n,i){t.isGroup||Rs([["cursor",zg.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];_l(e,i)?t[i]=nl(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),Rs(Bs(e),(function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=Ws(i)?i:null}})),_l(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}function h2(t){return t=Ts({},t),Rs(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(zx),(function(e){delete t[e]})),t}function c2(t,e,n){var i=Cy(t).eventData;t.silent||t.ignore||i||(i=Cy(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=n.info)}function d2(t){t.registerComponentModel(n2),t.registerComponentView(o2),t.registerPreprocessor((function(t){var e=t.graphic;Hs(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])}))}var p2=["x","y","radius","angle","single"],f2=["cartesian2d","polar","singleAxis"];function g2(t){var e=t.get("coordinateSystem");return Ds(f2,e)>=0}function v2(t){return t+"Axis"}function y2(t,e){var n,i=gl(),r=[],o=gl();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&l(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),u(t)}function l(t){var e=!1;return t.eachTargetAxis((function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)})),e}function u(t){t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return r}function m2(t){var e=t.ecModel,n={infoList:[],infoMap:gl()};return t.eachTargetAxis((function(t,i){var r=e.getComponent(v2(t),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}})),n}var _2=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),x2=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return qa(e,t),e.prototype.init=function(t,e,n){var i=b2(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=b2(t);Is(this.option,t,!0),Is(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;Rs([["start","startValue"],["end","endValue"]],(function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=gl(),n=this._fillSpecifiedTargetAxis(e);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return Rs(p2,(function(n){var i=this.getReferringComponents(v2(n),zf);if(i.specified){e=!0;var r=new _2;Rs(i.models,(function(t){r.add(t.componentIndex)})),t.set(n,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x",o=n.findComponents({mainType:r+"Axis"});a(o,r)}if(i){o=n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}});a(o,"single")}function a(e,n){var r=e[0];if(r){var o=new _2;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",Ef).models[0];a&&Rs(e,(function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Ef).models[0]&&o.add(t.componentIndex)}))}}}i&&Rs(p2,(function(e){if(i){var r=n.findComponents({mainType:v2(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new _2;o.add(r[0].componentIndex),t.set(e,o),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");Rs([["start","startValue"],["end","endValue"]],(function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(v2(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){Rs(n.indexList,(function(n){t.call(e,i,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(v2(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;Rs([["start","startValue"],["end","endValue"]],(function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;Rs(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;io[1];if(h&&!c&&!d)return!0;h&&(r=!0),c&&(e=!0),d&&(n=!0)}return r&&e&&n}))}else D2(i,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return a(t)?t:NaN})));else{var i={};i[n]=o,e.selectRange(i)}}));D2(i,(function(t){e.setApproximateExtent(o,t)}))}}))}function a(t){return t>=o[0]&&t<=o[1]}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;D2(["min","max"],(function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Ep(n[0]+o,n,[0,100],!0):null!=r&&(o=Ep(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Hp(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();function P2(t,e,n){var i=[1/0,-1/0];D2(n,(function(t){oB(i,t.getData(),e)}));var r=t.getAxisModel(),o=Zz(r.axis.scale,r,i).calculate();return[o.min,o.max]}const R2=L2;var O2={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var o=t.getComponent(v2(i),r);e(i,r,o,n)}))}))}e((function(t,e,n,i){n.__dzAxisProxy=null}));var n=[];e((function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new R2(e,i,o,t),n.push(r.__dzAxisProxy))}));var i=gl();return Rs(n,(function(t){Rs(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};const N2=O2;function E2(t){t.registerAction("dataZoom",(function(t,e){var n=y2(e,t);Rs(n,(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}var z2=!1;function B2(t){z2||(z2=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,N2),E2(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function V2(t){t.registerComponentModel(M2),t.registerComponentView(A2),B2(t)}var F2=function(){function t(){}return t}(),G2={};function H2(t,e){G2[t]=e}function W2(t){return G2[t]}var U2=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;Rs(this.option.feature,(function(t,n){var i=W2(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),Is(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Jx);const Z2=U2;function Y2(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Hx(i,o,r);Fx(e.get("orient"),t,e.get("itemGap"),a.width,a.height),Wx(t,i,o,r)}function X2(t,e){var n=Tx(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new sy({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),t}var j2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),u=[];Rs(s,(function(t,e){u.push(e)})),new pR(this._featureNames||[],u).add(h).update(h).remove(Gs(h,null)).execute(),this._featureNames=u,Y2(r,t,n),r.add(X2(r.getBoundingRect(),t)),a||r.eachChild((function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Ws(l)&&e){var u=l.style||(l.style={}),h=rp(e,Iy.makeFont(u)),c=t.x+r.x,d=t.y+r.y+o,p=!1;d+h.height>n.getHeight()&&(a.position="top",p=!0);var f=p?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",f],u.align="right"):c-h.width/2<0&&(a.position=[0,f],u.align="left")}}))}function h(r,o){var a,h=u[r],d=u[o],p=s[h],f=new A_(p,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===h&&(p.title=i.newTitle),h&&!d){if(q2(h))a={onclick:f.option.onclick,featureName:h};else{var g=W2(h);if(!g)return;a=new g}l[h]=a}else if(a=l[d],!a)return;a.uid=k_("toolbox-feature"),a.model=f,a.ecModel=e,a.api=n;var v=a instanceof F2;h||!d?!f.get("show")||v&&a.unusable?v&&a.remove&&a.remove(e,n):(c(f,a,h),f.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?cm:dm)(i[t])},a instanceof F2&&a.render&&a.render(f,e,n,i)):v&&a.dispose&&a.dispose(e,n)}function c(i,s,l){var u,h,c=i.getModel("iconStyle"),d=i.getModel(["emphasis","iconStyle"]),p=s instanceof F2&&s.getIcons?s.getIcons():i.get("icon"),f=i.get("title")||{};Us(p)?(u={},u[l]=p):u=p,Us(f)?(h={},h[l]=f):h=f;var g=i.iconPaths={};Rs(u,(function(l,u){var p=PC(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(c.getItemStyle());var f=p.ensureState("emphasis");f.style=d.getItemStyle();var v=new Iy({style:{text:h[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null},ignore:!0});p.setTextContent(v),zC({el:p,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),p.__title=h[u],p.on("mouseover",(function(){var e=d.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";v.setStyle({fill:d.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||i}),v.ignore=!t.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),v.hide()})),("emphasis"===i.get(["iconStatus",u])?cm:dm)(p),r.add(p),p.on("click",Fs(s.onclick,s,e,n,u)),g[u]=p}))}},e.prototype.updateView=function(t,e,n,i){Rs(this._features,(function(t){t instanceof F2&&t.updateView&&t.updateView(t.model,e,n,i)}))},e.prototype.remove=function(t,e){Rs(this._features,(function(n){n instanceof F2&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){Rs(this._features,(function(n){n instanceof F2&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(TM);function q2(t){return 0===t.indexOf("my")}const K2=j2;var $2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=ts.browser;if(Ws(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||r){var h=a.split(","),c=h[0].indexOf("base64")>-1,d=r?decodeURIComponent(h[1]):h[1];c&&(d=window.atob(d));var p=i+"."+o;if(window.navigator.msSaveOrOpenBlob){var f=d.length,g=new Uint8Array(f);while(f--)g[f]=d.charCodeAt(f);var v=new Blob([g]);window.navigator.msSaveOrOpenBlob(v,p)}else{var y=document.createElement("iframe");document.body.appendChild(y);var m=y.contentWindow,_=m.document;_.open("image/svg+xml","replace"),_.write(d),_.close(),m.focus(),_.execCommand("SaveAs",!0,p),document.body.removeChild(y)}}else{var x=n.get("lang"),b='',w=window.open();w.document.write(b),w.document.title=i}},e.getDefaultOption=function(t){var e={show:!0,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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return e},e}(F2);const J2=$2;var Q2="__ec_magicType_stack__",t5=[["line","bar"],["stack"]],e5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return Rs(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){var e={show:!0,type:[],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"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return e},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if(n5[n]){var o,a={series:[]},s=function(t){var e=t.subType,r=t.id,o=n5[n](e,r,t,i);o&&(As(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim,h=u+"Axis",c=t.getReferringComponents(h,Ef).models[0],d=c.componentIndex;a[h]=a[h]||[];for(var p=0;p<=d;p++)a[h][d]=a[h][d]||{};a[h][d].boundaryGap="bar"===n}}};Rs(t5,(function(t){Ds(t,n)>=0&&Rs(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},s);var l=n;"stack"===n&&(o=Is({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(l="tiled")),e.dispatchAction({type:"changeMagicType",currentType:l,newOption:a,newTitle:o,featureName:"magicType"})}},e}(F2),n5={line:function(t,e,n,i){if("bar"===t)return Is({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return Is({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===Q2;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),Is({id:e,stack:r?"":Q2},i.get(["option","stack"])||{},!0)}};Ik({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));const i5=e5;var r5=new Array(60).join("-"),o5="\t";function a5(t){var e={},n=[],i=[];return t.eachRawSeries((function(t){var r=t.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(t);else{var o=r.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;e[a]||(e[a]={categoryAxis:o,valueAxis:r.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[a].series.push(t)}else n.push(t)}})),{seriesGroupByCategoryAxis:e,other:n,meta:i}}function s5(t){var e=[];return Rs(t,(function(t,n){var i=t.categoryAxis,r=t.valueAxis,o=r.dim,a=[" "].concat(Os(t.series,(function(t){return t.name}))),s=[i.model.getCategories()];Rs(t.series,(function(t){var e=t.getRawData();s.push(t.getRawData().mapArray(e.mapDimension(o),(function(t){return t})))}));for(var l=[a.join(o5)],u=0;u=0)return!0}var d5=new RegExp("["+o5+"]+","g");function p5(t){for(var e=t.split(/\n+/g),n=h5(e.shift()).split(d5),i=[],r=Os(n,(function(t){return{name:t,data:[]}})),o=0;o=0;r--){var o=n[r];if(o[i])break}if(r<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(a){var s=a.getPercentRange();n[0][i]={dataZoomId:i,start:s[0],end:s[1]}}}})),n.push(e)}function w5(t){var e=I5(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return _5(n,(function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n],t){i[n]=t;break}})),i}function S5(t){x5(t).snapshots=null}function M5(t){return I5(t).length}function I5(t){var e=x5(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var C5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.onclick=function(t,e){S5(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var e={show:!0,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:t.getLocaleModel().get(["toolbox","restore","title"])};return e},e}(F2);Ik({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));const T5=C5;var A5=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],D5=function(){function t(t,e,n){var i=this;this._targetInfoList=[];var r=L5(e,t);Rs(P5,(function(t,e){(!n||!n.include||Ds(n.include,e)>=0)&&t(r,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=N5[t.brushType](0,n,e);t.__rangeOffset={offset:z5[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){Rs(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&Rs(i.coordSyses,(function(i){var r=N5[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)}))}),this)},t.prototype.setInputRanges=function(t,e){Rs(t,(function(t){var n=this.findTargetInfo(t,e);if(t.range=t.range||[],n&&!0!==n){t.panelId=n.panelId;var i=N5[t.brushType](0,n.coordSys,t.coordRange),r=t.__rangeOffset;t.range=r?z5[t.brushType](i.values,r.offset,V5(i.xyMinMax,r.xyMinMax)):i.values}}),this)},t.prototype.makePanelOpts=function(t,e){return Os(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:fj(i),isTargetByCursor:vj(i,t,n.coordSysModel),getLinearBrushOtherExtent:gj(i)}}))},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&Ds(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=L5(e,t),r=0;rt[1]&&t.reverse(),t}function L5(t,e){return Of(t,e,{includeMainTypes:A5})}var P5={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=gl(),a={},s={};(n||i||r)&&(Rs(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),Rs(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),Rs(r,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];Rs(r.getCartesians(),(function(t,e){(Ds(n,t.getAxis("x").model)>=0||Ds(i,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:O5.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){Rs(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:O5.geo})}))}},R5=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],O5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(MC(t)),e}},N5={lineX:Gs(E5,0),lineY:Gs(E5,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[k5([r[0],o[0]]),k5([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]],o=Os(n,(function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}));return{values:o,xyMinMax:r}}};function E5(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=k5(Os([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var z5={lineX:Gs(B5,0),lineY:Gs(B5,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return Os(t,(function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]}))}};function B5(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function V5(t,e){var n=F5(t),i=F5(e),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function F5(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const G5=D5;var H5=Rs,W5=Tf("toolbox-dataZoom_"),U5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new pj(n.getZr()),this._brushController.on("brush",Fs(this._onBrush,this)).mount()),j5(t,e,this,i,n),X5(t,e)},e.prototype.onclick=function(t,e,n){Z5[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]);var r=new G5(Y5(this.model),i,{include:["grid"]});r.matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(o("x",n,e[0]),o("y",n,e[1])):o({lineX:"x",lineY:"y"}[i],n,e)}})),b5(i,n),this._dispatchZoomAction(n)}function o(t,e,r){var o=e.getAxis(t),s=o.model,l=a(t,s,i),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(r=JY(0,r.slice(),o.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(n[l.id]={dataZoomId:l.id,startValue:r[0],endValue:r[1]})}function a(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){var r=n.getAxisModel(t,e.componentIndex);r&&(i=n)})),i}},e.prototype._dispatchZoomAction=function(t){var e=[];H5(t,(function(t,n){e.push(Ms(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){var e={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return e},e}(F2),Z5={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(w5(this.ecModel))}};function Y5(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function X5(t,e){t.setIconStatus("back",M5(e)>1?"emphasis":"normal")}function j5(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new G5(Y5(t),e,{include:["grid"]}),s=a.makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}bb("dataZoom",(function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=Y5(i),a=Of(t,o);return H5(a.xAxisModels,(function(t){return s(t,"xAxis","xAxisIndex")})),H5(a.yAxisModels,(function(t){return s(t,"yAxis","yAxisIndex")})),r}function s(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:W5+e+o};a[n]=o,r.push(a)}}));const q5=U5;function K5(t){t.registerComponentModel(Z2),t.registerComponentView(K2),H2("saveAsImage",J2),H2("magicType",i5),H2("dataView",m5),H2("dataZoom",q5),H2("restore",T5),Ek(V2)}var $5=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Jx);const J5=$5;function Q5(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function t3(t){if(ts.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n-1?(l+="top:50%",u+="translateY(-50%) rotate("+(o="left"===a?-225:-45)+"deg)"):(l+="left:50%",u+="translateX(-50%) rotate("+(o="top"===a?225:45)+"deg)");var h=o*Math.PI/180,c=s+r,d=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),p=Math.round(100*((d-Math.SQRT2*r)/2+Math.SQRT2*r-(d-c)/2))/100;l+=";"+a+":-"+p+"px";var f=e+" solid "+r+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",l+";"+u+";","border-bottom:"+f,"border-right:"+f,"background-color:"+i+";"];return'
'}function h3(t,e){var n="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+n,r="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+n,r+=ts.transformSupported?","+a3+i:",left"+i+",top"+i),o3+":"+r}function c3(t,e,n){var i=t.toFixed(0)+"px",r=e.toFixed(0)+"px";if(!ts.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=ts.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+a3+":"+a+";":[["top",0],["left",0],[e3,a]]}function d3(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont()),n&&e.push("line-height:"+Math.round(3*n/2)+"px");var r=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return r&&o&&e.push("text-shadow:"+a+"px "+s+"px "+o+"px "+r),Rs(["decoration","align"],(function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)})),e.join(";")}function p3(t,e,n){var i=[],r=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),u=t.get("shadowOffsetY"),h=t.getModel("textStyle"),c=uM(t,"html"),d=l+"px "+u+"px "+a+"px "+s;return i.push("box-shadow:"+d),e&&r&&i.push(h3(r,n)),o&&i.push("background-color:"+o),Rs(["width","color","radius"],(function(e){var n="border-"+e,r=Cx(n),o=t.get(r);null!=o&&i.push(n+":"+o+("color"===e?"":"px"))})),i.push(d3(h)),null!=c&&i.push("padding:"+Tx(c).join("px ")+"px"),i.join(";")+";"}function f3(t,e,n,i,r){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&$l(t,a,document.body,i,r)}else{t[0]=i,t[1]=r;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var g3=function(){function t(t,e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ts.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=e.getZr(),o=this._appendToBody=n&&n.appendToBody;f3(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(i):t.appendChild(i),this._container=t;var a=this;i.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},i.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=r.handler,n=r.painter.getViewportRoot();cu(n,t,!0),e.dispatch("mousemove",t)}},i.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e=this._container,n=r3(e,"position"),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative");var r=t.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,r=this._styleCoord;n.innerHTML?i.cssText=s3+p3(t,!this._firstShow,this._longHide)+c3(r[0],r[1],!0)+"border-color:"+Ox(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,r){var o=this.el;if(null!=t){var a="";if(Us(r)&&"item"===n.get("trigger")&&!Q5(n)&&(a=u3(n,i,r)),Us(t))o.innerHTML=t+a;else if(t){o.innerHTML="",Hs(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!ts.node&&n.getDom()){var r=I3(i,n);this._ticket="";var o=i.dataByCoordSys,a=k3(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=w3;l.x=i.x,l.y=i.y,l.update(),Cy(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},r)}else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=a0(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(I3(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s){var l=s.getData(),u=M3([l.getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel);if("axis"===u.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}}},e.prototype._tryShow=function(t,e){var n=t.target,i=this._tooltipModel;if(i){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,t);else if(n){var o,a;this._lastDataByCoordSys=null,XT(n,(function(t){return null!=Cy(t).dataIndex?(o=t,!0):null!=Cy(t).tooltipConfig?(a=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):a?this._showComponentItemTooltip(t,a,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=Fs(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=M3([e.tooltipOption],i),a=this._renderMode,s=[],l=qS("section",{blocks:[],noHeader:!0}),u=[],h=new hM;Rs(t,(function(t){Rs(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=EQ(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),c=qS("section",{header:o,noHeader:!sl(o),sortBlocks:!0,blocks:[]});l.blocks.push(c),Rs(t.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=Qz(e.axis,{value:r}),f.axisValueLabel=o,f.marker=h.makeTooltipMarker("item",Ox(f.color),a);var g=iS(d.formatTooltip(p,!0,null)),v=g.frag;if(v){var y=M3([d],i).get("valueFormatter");c.blocks.push(y?Ts({valueFormatter:y},v):v)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var c=e.position,d=o.get("order"),p=eM(l,h,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"
",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],c,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=Cy(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,h=s.getData(u),c=this._renderMode,d=t.positionDefault,p=M3([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),v=new hM;g.marker=v.makeTooltipMarker("item",Ox(g.color),c);var y=iS(s.formatTooltip(l,!1,u)),m=p.get("order"),_=p.get("valueFormatter"),x=y.frag,b=x?eM(_?Ts({valueFormatter:_},x):x,v,c,m,i.get("useUTC"),p.get("textStyle")):y.text,w="item_"+s.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,b,g,w,t.offsetX,t.offsetY,t.position,t.target,v)})),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i=Cy(e),r=i.tooltipConfig,o=r.option||{};if(Us(o)){var a=o;o={content:a,formatter:a}}var s=[o],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=t.positionDefault,h=M3(s,this._tooltipModel,u?{position:u}:null),c=h.get("content"),d=Math.random()+"",p=new hM;this._showOrMove(h,(function(){var n=Ms(h.get("formatterParams")||{});this._showTooltipContent(h,c,n,d,t.offsetX,t.offsetY,t.position,e,p)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")),p=d.color;if(h)if(Us(h)){var f=t.ecModel.get("useUTC"),g=Hs(n)?n[0]:n,v=g&&g.axisType&&g.axisType.indexOf("time")>=0;c=h,v&&(c=ax(g.axisValue,c,f)),c=Lx(c,n,!0)}else if(Ws(h)){var y=Fs((function(e,i){e===this._ticket&&(u.setContent(i,l,t,p,a),this._updatePosition(t,a,r,o,u,n,s))}),this);this._ticket=i,c=h(n,i,y)}else c=h;u.setContent(c,l,t,p,a),u.show(t,p),this._updatePosition(t,a,r,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||Hs(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:Hs(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),Ws(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),Hs(e))n=zp(e[0],s),i=zp(e[1],l);else if(Xs(e)){var p=e;p.width=u[0],p.height=u[1];var f=Hx(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(Us(e)&&a){var g=A3(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else{g=C3(n,i,r,s,l,h?null:20,c?null:20);n=g[0],i=g[1]}if(h&&(n-=D3(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=D3(c)?u[1]/2:"bottom"===c?u[1]:0),Q5(t)){g=T3(n,i,r,s,l);n=g[0],i=g[1]}r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&Rs(n,(function(n,o){var a=n.dataByAxis||[],s=t[o]||{},l=s.dataByAxis||[];r=r&&a.length===l.length,r&&Rs(a,(function(t,n){var o=l[n]||{},a=t.seriesDataIndices||[],s=o.seriesDataIndices||[];r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===s.length,r&&Rs(a,(function(t,e){var n=s[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),i&&Rs(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!ts.node&&e.getDom()&&(tT(this,"_updatePosition"),this._tooltipContent.dispose(),i0("itemTooltip",e))},e.type="tooltip",e}(TM);function M3(t,e,n){var i,r=e.ecModel;n?(i=new A_(n,r,r),i=new A_(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof A_&&(a=a.get("tooltip",!0)),Us(a)&&(a={formatter:a}),a&&(i=new A_(a,i,r)))}return i}function I3(t,e){return t.dispatchAction||Fs(e.dispatchAction,e)}function C3(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],u=s[1];return null!=o&&(t+l+o+2>i?t-=l+o:t+=o),null!=a&&(e+u+a>r?e-=u+a:e+=a),[t,e]}function T3(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function A3(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}function D3(t){return"center"===t||"middle"===t}function k3(t,e,n){var i=Nf(t).queryOptionMap,r=i.keys()[0];if(r&&"series"!==r){var o=Bf(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s,l=n.getViewOfComponentModel(a);return l.group.traverse((function(e){var n=Cy(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s?{componentMainType:r,componentIndex:a.componentIndex,el:s}:void 0}}}const L3=S3;function P3(t){Ek(_0),t.registerComponentModel(J5),t.registerComponentView(L3),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},xl),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},xl)}var R3=["rect","polygon","keep","clear"];function O3(t,e){var n=hf(t?t.brush:[]);if(n.length){var i=[];Rs(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(i=i.concat(e))}));var r=t&&t.toolbox;Hs(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),N3(s),e&&!s.length&&s.push.apply(s,R3)}}function N3(t){var e={};Rs(t,(function(t){e[t]=1})),t.length=0,Rs(e,(function(e,n){t.push(n)}))}var E3=Rs;function z3(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function B3(t,e,n){var i={};return E3(e,(function(e){var o=i[e]=r();E3(t[e],(function(t,i){if(oU.isValidType(i)){var r={type:i,visual:t};n&&n(r,e),o[i]=new oU(r),"opacity"===i&&(r=Ms(r),r.type="colorAlpha",o.__hidden.__alphaForOpacity=new oU(r))}}))})),i;function r(){var t=function(){};t.prototype.__hidden=t.prototype;var e=new t;return e}}function V3(t,e,n){var i;Rs(n,(function(t){e.hasOwnProperty(t)&&z3(e[t])&&(i=!0)})),i&&Rs(n,(function(n){e.hasOwnProperty(n)&&z3(e[n])?t[n]=Ms(e[n]):delete t[n]}))}function F3(t,e,n,i,r,o){var a,s={};function l(t){return GT(n,a,t)}function u(t,e){WT(n,a,t,e)}function h(t,h){a=null==o?t:h;var c=n.getRawDataItem(a);if(!c||!1!==c.visualMap)for(var d=i.call(r,t),p=e[d],f=s[d],g=0,v=f.length;ge[0][1]&&(e[0][1]=o[0]),o[1]e[1][1]&&(e[1][1]=o[1])}return e&&n4(e)}};function n4(t){return new Gu(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var i4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new pj(e.getZr())).on("brush",Fs(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){q3(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){(!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:Ms(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:Ms(n),$from:e})},e.type="brush",e}(TM);const r4=i4;var o4="#ddd",a4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.areas=[],n.brushOption={},n}return qa(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&V3(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:o4},i.hasOwnProperty("liftZ")||(i.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=Os(t,(function(t){return s4(this.option,t)}),this))},e.prototype.setBrushOption=function(t){this.brushOption=s4(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Jx);function s4(t,e){return Is({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new A_(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}const l4=a4;var u4=["rect","polygon","lineX","lineY","keep","clear"],h4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n){var i,r,o;e.eachComponent({mainType:"brush"},(function(t){i=t.brushType,r=t.brushOption.brushMode||"single",o=o||!!t.areas.length})),this._brushType=i,this._brushMode=r,Rs(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===r:"clear"===e?o:e===i)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return Rs(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,r=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},e.getDefaultOption=function(t){var e={show:!0,type:u4.slice(),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",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",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",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",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",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"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return e},e}(F2);const c4=h4;function d4(t){t.registerComponentView(r4),t.registerComponentModel(l4),t.registerPreprocessor(O3),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,K3),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},xl),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},xl),H2("brush",c4)}var p4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return qa(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Jx),f4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=nl(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Iy({style:r_(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Iy({style:r_(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",(function(){Nx(d,"_"+t.get("target"))})),p&&c.on("click",(function(){Nx(p,"_"+t.get("subtarget"))})),Cy(l).eventData=Cy(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),v=t.getBoxLayoutParams();v.width=g.width,v.height=g.height;var y=Hx(v,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||(a=t.get("left")||t.get("right"),"middle"===a&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||(s=t.get("top")||t.get("bottom"),"center"===s&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),c.setStyle(m),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new sy({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(b)}},e.type="title",e}(TM);function g4(t){t.registerComponentModel(p4),t.registerComponentView(f4)}var v4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}return qa(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],Rs(n,(function(e,n){var i,o=Mf(pf(e),"");Xs(e)?(i=Ms(e),i.value=n):i=n,t.push(i),r.push(o)}))):t=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",a=this._data=new WR([{name:"value",type:o}],this);a.initData(t,r)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Jx);const y4=v4;var m4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="timeline.slider",e.defaultOption=R_(y4.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",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",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",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(y4);Ls(m4,nS.prototype);const _4=m4;var x4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="timeline",e}(TM);const b4=x4;var w4=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.type=r||"value",o}return qa(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(LB);const S4=w4;var M4=Math.PI,I4=Pf(),C4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),r=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){var e=a.scale.getLabel({value:t});return qS("nameValue",{noName:!0,value:e})},Rs(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](i,r,a,t)}),this),this._renderAxisLabel(i,o,a,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var n,i=t.get(["label","position"]),r=t.get("orient"),o=A4(t,e);n=null==i||"auto"===i?"horizontal"===r?o.y+o.height/2=0||"+"===n?"left":"right"},h={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:M4/2},d="vertical"===r?o.height:o.width,p=t.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,v=f?p.get("itemGap"):0,y=g+v,m=t.get(["label","rotate"])||0;m=m*M4/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,M=d;"left"===_||"bottom"===_?(x&&(a=[0,0],S+=y),b&&(s=[S,0],S+=y),w&&(l=[M-g,0],M-=y)):(x&&(a=[M-g,0],M-=y),b&&(s=[0,0],S+=y),w&&(l=[M-g,0],M-=y));var I=[S,M];return t.get("inverse")&&I.reverse(),{viewRect:o,mainLength:d,orient:r,rotation:c[r],labelRotation:m,labelPosOpt:n,labelAlign:t.get(["label","align"])||u[r],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||h[r],playPosition:a,prevBtnPosition:s,nextBtnPosition:l,axisExtent:I,controlSize:g,controlGap:v}},e.prototype._position=function(t,e){var n=this._mainGroup,i=this._labelGroup,r=t.viewRect;if("vertical"===t.orient){var o=bu(),a=r.x,s=r.y+r.height;Iu(o,o,[-a,-s]),Cu(o,o,-M4/2),Iu(o,o,[a,s]),r=r.clone(),r.applyTransform(o)}var l=v(r),u=v(n.getBoundingRect()),h=v(i.getBoundingRect()),c=[n.x,n.y],d=[i.x,i.y];d[0]=c[0]=l[0][0];var p=t.labelPosOpt;if(null==p||Us(p)){var f="+"===p?0:1;y(c,u,l,1,f),y(d,h,l,1,1-f)}else{f=p>=0?0:1;y(c,u,l,1,f),d[1]=c[1]+p}function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function v(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function y(t,e,n,i,r){t[i]+=n[i][r]-e[i][r]}n.setPosition(c),i.setPosition(d),n.rotation=i.rotation=t.rotation,g(n),g(i)},e.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),r=T4(e,i);r.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var o=n.getDataExtent("value");r.setExtent(o[0],o[1]),r.calcNiceTicks();var a=new S4("value",r,t.axisExtent,i);return a.model=e,a},e.prototype._createGroup=function(t){var e=this[t]=new Ip;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var o=new EI({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:Ts({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new EI({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:As({lineCap:"round",lineWidth:o.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},e.prototype._renderAxisTick=function(t,e,n,i){var r=this,o=i.getData(),a=n.scale.getTicks();this._tickSymbols=[],Rs(a,(function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),h=s.getModel(["progress","itemStyle"]),c={x:a,y:0,onclick:Fs(r._changeTimeline,r,t.value)},d=k4(s,l,e,c);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=h.getItemStyle(),Am(d);var p=Cy(d);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=i):p.dataIndex=p.dataModel=null,r._tickSymbols.push(d)}))},e.prototype._renderAxisLabel=function(t,e,n,i){var r=this,o=n.getLabelModel();if(o.get("show")){var a=i.getData(),s=n.getViewLabels();this._tickLabels=[],Rs(s,(function(i){var o=i.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),h=s.getModel(["progress","label"]),c=n.dataToCoord(i.tickValue),d=new Iy({x:c,y:0,rotation:t.labelRotation-t.rotation,onclick:Fs(r._changeTimeline,r,o),silent:!1,style:r_(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});d.ensureState("emphasis").style=r_(u),d.ensureState("progress").style=r_(h),e.add(d),Am(d),I4(d).dataIndex=o,r._tickLabels.push(d)}))}},e.prototype._renderControl=function(t,e,n,i){var r=t.controlSize,o=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function h(t,n,l,u){if(t){var h=lp(nl(i.get(["controlStyle",n+"BtnSize"]),r),r),c=[0,-h/2,h,h],d=D4(i,n+"Icon",c,{x:t[0],y:t[1],originX:r/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});d.ensureState("emphasis").style=s,e.add(d),Am(d)}}h(t.nextBtnPosition,"next",Fs(this._changeTimeline,this,u?"-":"+")),h(t.prevBtnPosition,"prev",Fs(this._changeTimeline,this,u?"+":"-")),h(t.playPosition,l?"stop":"play",Fs(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,n,i){var r=i.getData(),o=i.getCurrentIndex(),a=r.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=Fs(s._handlePointerDrag,s),t.ondragend=Fs(s._handlePointerDragend,s),L4(t,s._progressLine,o,n,i,!0)},onUpdate:function(t){L4(t,s._progressLine,o,n,i)}};this._currentPointer=k4(a,a,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=this._axis,r=Vp(i.getExtent().slice());n>r[1]&&(n=r[1]),n=0&&(a[o]=+a[o].toFixed(d)),[a,c]}var q4={min:Gs(j4,"min"),max:Gs(j4,"max"),average:Gs(j4,"average"),median:Gs(j4,"median")};function K4(t,e){if(e){var n=t.getData(),i=t.coordinateSystem,r=i&&i.dimensions;if(!X4(e)&&!Hs(e.coord)&&Hs(r)){var o=$4(e,n,i,t);if(e=Ms(e),e.type&&q4[e.type]&&o.baseAxis&&o.valueAxis){var a=Ds(r,o.baseAxis.dim),s=Ds(r,o.valueAxis.dim),l=q4[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&Hs(r))for(var u=e.coord,h=0;h<2;h++)q4[u[h]]&&(u[h]=n6(n,n.mapDimension(r[h]),u[h]));else e.coord=[];return e}}function $4(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(J4(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function J4(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}function Q4(t,e){return!(t&&t.containData&&e.coord&&!Y4(e))||t.containData(e.coord)}function t6(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!Y4(e)&&!Y4(n))||t.containZone(e.coord,n.coord)}function e6(t,e){return t?function(t,n,i,r){var o=r<2?t.coord&&t.coord[r]:t.value;return uS(o,e[r])}:function(t,n,i,r){return uS(t.value,e[r])}}function n6(t,e,n){if("average"===n){var i=0,r=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,r++)})),i/r}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var i6=Pf(),r6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(){this.markerGroupMap=gl()},e.prototype.render=function(t,e,n){var i=this,r=this.markerGroupMap;r.each((function(t){i6(t).keep=!1})),e.eachSeries((function(t){var r=W4.getMarkerModelFromSeries(t,i.type);r&&i.renderSeries(t,r,e,n)})),r.each((function(t){!i6(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){i6(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;Rs(t,(function(t){var i=W4.getMarkerModelFromSeries(t,n.type);if(i){var r=i.getData();r.eachItemGraphicEl((function(t){t&&(e?pm(t):fm(t))}))}}))},e.type="marker",e}(TM);const o6=r6;function a6(t,e,n){var i=e.coordinateSystem;t.each((function(r){var o,a=t.getItemModel(r),s=zp(a.get("x"),n.getWidth()),l=zp(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(i){var u=t.get(i.dimensions[0],r),h=t.get(i.dimensions[1],r);o=i.dataToPoint([u,h])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)}))}var s6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markPoint");e&&(a6(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new _O),u=l6(r,t,e);e.setData(u),a6(e.getData(),t,i),u.each((function(t){var n=u.getItemModel(t),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Ws(i)||Ws(r)||Ws(o)||Ws(s)){var h=e.getRawValue(t),c=e.getDataParams(t);Ws(i)&&(i=i(h,c)),Ws(r)&&(r=r(h,c)),Ws(o)&&(o=o(h,c)),Ws(s)&&(s=s(h,c))}var d=n.getModel("itemStyle").getItemStyle(),p=HT(a,"color");d.fill||(d.fill=p),u.setItemVisual(t,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(t){t.traverse((function(t){Cy(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(o6);function l6(t,e,n){var i;i=t?Os(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return Ts(Ts({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new WR(i,n),o=Os(n.get("data"),Gs(K4,e));t&&(o=Es(o,Gs(Q4,t)));var a=e6(!!t,i);return r.initData(o,null,a),r}const u6=s6;function h6(t){t.registerComponentModel(Z4),t.registerComponentView(u6),t.registerPreprocessor((function(t){V4(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})}))}var c6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(W4);const d6=c6;var p6=Pf(),f6=function(t,e,n,i){var r,o=t.getData();if(Hs(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=e.getAxis(null!=i.yAxis?"y":"x"),l=el(i.yAxis,i.xAxis);else{var u=$4(i,o,e,t);s=u.valueAxis;var h=eO(o,u.valueDataDim);l=n6(o,h,a)}var c="x"===s.dim?0:1,d=1-c,p=Ms(i),f={coord:[]};p.type=null,p.coord=[],p.coord[d]=-1/0,f.coord[d]=1/0;var g=n.get("precision");g>=0&&Ys(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[c]=f.coord[c]=l,r=[p,f,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var v=[K4(t,r[0]),K4(t,r[1]),Ts({},r[2])];return v[2].type=v[2].type||null,Is(v[2],v[0]),Is(v[2],v[1]),v};function g6(t){return!isNaN(t)&&!isFinite(t)}function v6(t,e,n,i){var r=1-t,o=i.dimensions[t];return g6(e[r])&&g6(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function y6(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(v6(1,n,i,t)||v6(0,n,i,t)))return!0}return Q4(t,e[0])&&Q4(t,e[1])}function m6(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=zp(s.get("x"),r.getWidth()),u=zp(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,c=t.get(h[0],e),d=t.get(h[1],e);o=a.dataToPoint([c,d])}if(VO(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");h=a.dimensions;g6(t.get(h[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):g6(t.get(h[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var _6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),r=p6(e).from,o=p6(e).to;r.each((function(e){m6(r,e,!0,t,n),m6(o,e,!1,t,n)})),i.each((function(t){i.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new OZ);this.group.add(l.group);var u=x6(r,t,e),h=u.from,c=u.to,d=u.line;p6(e).from=h,p6(e).to=c,e.setData(d);var p=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),v=e.get("symbolOffset");function y(e,n,r){var o=e.getItemModel(n);m6(e,n,r,t,i);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=HT(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:nl(o.get("symbolOffset",!0),v[r?0:1]),symbolRotate:nl(o.get("symbolRotate",!0),g[r?0:1]),symbolSize:nl(o.get("symbolSize"),f[r?0:1]),symbol:nl(o.get("symbol",!0),p[r?0:1]),style:s})}Hs(p)||(p=[p,p]),Hs(f)||(f=[f,f]),Hs(g)||(g=[g,g]),Hs(v)||(v=[v,v]),u.from.each((function(t){y(h,t,!0),y(c,t,!1)})),d.each((function(t){var e=d.getItemModel(t).getModel("lineStyle").getLineStyle();d.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),d.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:c.getItemVisual(t,"symbolOffset"),toSymbolRotate:c.getItemVisual(t,"symbolRotate"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol"),style:e})})),l.updateData(d),u.line.eachItemGraphicEl((function(t){Cy(t).dataModel=e,t.traverse((function(t){Cy(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(o6);function x6(t,e,n){var i;i=t?Os(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return Ts(Ts({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new WR(i,n),o=new WR(i,n),a=new WR([],n),s=Os(n.get("data"),Gs(f6,e,t,n));t&&(s=Es(s,Gs(y6,t)));var l=e6(!!t,i);return r.initData(Os(s,(function(t){return t[0]})),null,l),o.initData(Os(s,(function(t){return t[1]})),null,l),a.initData(Os(s,(function(t){return t[2]}))),a.hasItemOption=!0,{from:r,to:o,line:a}}const b6=_6;function w6(t){t.registerComponentModel(d6),t.registerComponentView(b6),t.registerPreprocessor((function(t){V4(t.series,"markLine")&&(t.markLine=t.markLine||{})}))}var S6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(W4);const M6=S6;var I6=Pf(),C6=function(t,e,n,i){var r=i[0],o=i[1];if(r&&o){var a=K4(t,r),s=K4(t,o),l=a.coord,u=s.coord;l[0]=el(l[0],-1/0),l[1]=el(l[1],-1/0),u[0]=el(u[0],1/0),u[1]=el(u[1],1/0);var h=Cs([{},a,s]);return h.coord=[a.coord,s.coord],h.x0=a.x,h.y0=a.y,h.x1=s.x,h.y1=s.y,h}};function T6(t){return!isNaN(t)&&!isFinite(t)}function A6(t,e,n,i){var r=1-t;return T6(e[r])&&T6(n[r])}function D6(t,e){var n=e.coord[0],i=e.coord[1],r={coord:n,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return VO(t,"cartesian2d")?!(!n||!i||!A6(1,n,i,t)&&!A6(0,n,i,t))||t6(t,r,o):Q4(t,r)||Q4(t,o)}function k6(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=zp(s.get(n[0]),r.getWidth()),u=zp(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition){var h=t.getValues(["x0","y0"],e),c=t.getValues(["x1","y1"],e),d=a.clampData(h),p=a.clampData(c),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?c[0]:h[0]:f[0]=d[0]>p[0]?h[0]:c[0],"y0"===n[1]?f[1]=d[1]>p[1]?c[1]:h[1]:f[1]=d[1]>p[1]?h[1]:c[1],o=i.getMarkerPosition(f,n,!0)}else{var g=t.get(n[0],e),v=t.get(n[1],e),y=[g,v];a.clampData&&a.clampData(y,y),o=a.dataToPoint(y,!0)}if(VO(a,"cartesian2d")){var m=a.getAxis("x"),_=a.getAxis("y");g=t.get(n[0],e),v=t.get(n[1],e);T6(g)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):T6(v)&&(o[1]=_.toGlobalCoord(_.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var L6=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],P6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markArea");if(e){var i=e.getData();i.each((function(e){var r=Os(L6,(function(r){return k6(i,e,r,t,n)}));i.setItemLayout(e,r);var o=i.getItemGraphicEl(e);o.setShape("points",r)}))}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Ip});this.group.add(l.group),this.markKeep(l);var u=R6(r,t,e);e.setData(u),u.each((function(e){var n=Os(L6,(function(n){return k6(u,e,n,t,i)})),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),h=s.getExtent(),c=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],d=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];Vp(c),Vp(d);var p=!(l[0]>c[1]||l[1]d[1]||h[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Jx);const B6=z6;var V6=Gs,F6=Rs,G6=Ip,H6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return qa(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new G6),this.group.add(this._selectorGroup=new G6),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),c=Hx(l,u,h),d=this.layoutInner(t,r,c,i,a,s),p=Hx(As({width:d.width,height:d.height},l),u,h);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=X2(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=gl(),u=e.get("selectedMode"),h=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),F6(e.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var c=new G6;return c.newline=!0,void s.add(c)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),v=p.getVisual("style"),y=this._createItem(d,a,o,r,e,t,f,v,g,u,i);y.on("click",V6(Z6,a,null,i,h)).on("mouseover",V6(X6,d.name,null,i,h)).on("mouseout",V6(j6,d.name,null,i,h)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var c=s.indexOfName(a),d=s.getItemVisual(c,"style"),p=s.getItemVisual(c,"legendIcon"),f=fc(d.fill);f&&0===f[3]&&(f[3]=.2,d=Ts(Ts({},d),{fill:wc(f,"rgba")}));var g=this._createItem(n,a,o,r,e,t,{},d,p,u,i);g.on("click",V6(Z6,null,a,i,h)).on("mouseover",V6(X6,null,a,i,h)).on("mouseout",V6(j6,null,a,i,h)),l.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();F6(t,(function(t){var i=t.type,r=new Iy({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);n_(r,{normal:a,emphasis:s},{defaultText:t.title}),Am(r)}))},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,u,h){var c=t.visualDrawType,d=r.get("itemWidth"),p=r.get("itemHeight"),f=r.isSelected(e),g=i.get("symbolRotate"),v=i.get("symbolKeepAspect"),y=i.get("icon");l=y||l||"roundRect";var m=W6(l,i,a,s,c,f,h),_=new G6,x=i.getModel("textStyle");if(!Ws(t.getLegendIcon)||y&&"inherit"!==y){var b="inherit"===y&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;_.add(U6({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}))}else _.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}));var w="left"===o?d+5:-5,S=o,M=r.get("formatter"),I=e;Us(M)&&M?I=M.replace("{name}",null!=e?e:""):Ws(M)&&(I=M(e));var C=f?x.getTextColor():i.get("inactiveColor");_.add(new Iy({style:r_(x,{text:I,x:w,y:p/2,fill:C,align:S,verticalAlign:"middle"},{inheritColor:C})}));var T=new sy({shape:_.getBoundingRect(),invisible:!0}),A=i.getModel("tooltip");return A.get("show")&&zC({el:T,componentModel:r,itemName:e,itemTooltipOption:A.option}),_.add(T),_.eachChild((function(t){t.silent=!0})),T.silent=!u,this.getContentGroup().add(_),Am(_),_.__legendDataIndex=n,_},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Fx(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){Fx("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",v=0===p?"y":"x";"end"===o?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[v]=Math.min(0,h[v]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(TM);function W6(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),F6(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?KA(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!o){var f=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function U6(t){var e=t.icon||"roundRect",n=sA(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n}function Z6(t,e,n,i){j6(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),X6(t,e,n,i)}function Y6(t){var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;while(in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],v=[-d.x,-d.y],y=nl(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var m=t.get("pageButtonPosition",!0);"end"===m?v[i]+=n[r]-d[r]:g[i]+=d[r]+y}v[1-i]+=c[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(v);var _={x:0,y:0};if(_[r]=p?n[r]:c[r],_[o]=Math.max(c[o],d[o]),_[a]=Math.min(0,d[a]+v[1-i]),u.__rectSize=n[r],p){var x={x:0,y:0};x[r]=Math.max(n[r]-d[r]-y,0),x[o]=_[o],u.setClipPath(new sy({shape:x})),u.__rectSize=x[r]}else h.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var b=this._getPageInfo(t);return null!=b.pageIndex&&Zm(l,{x:b.contentPosition[0],y:b.contentPosition[1]},p?t:null),this._updatePageInfoView(t,b),_},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;Rs(["pagePrev","pageNext"],(function(i){var r=i+"DataIndex",o=null!=e[r],a=n.childOfName(i);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")}));var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",Us(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=r8[r],a=o8[r],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=m(u);d.contentPosition[r]=-p.s;for(var f=s+1,g=p,v=p,y=null;f<=h;++f)y=m(l[f]),(!y&&v.e>g.s+i||y&&!_(y,g.s))&&(g=v.i>g.i?v:y,g&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount)),v=y;for(f=s-1,g=p,v=p,y=null;f>=-1;--f)y=m(l[f]),y&&_(v,y.s)||!(g.i=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var e,n,i=this.getContentGroup();return i.eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)})),null!=e?e:n},e.type="legend.scroll",e}(q6);const s8=a8;function l8(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}function u8(t){Ek(Q6),t.registerComponentModel(n8),t.registerComponentView(s8),l8(t)}function h8(t){Ek(Q6),Ek(u8)}var c8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="dataZoom.inside",e.defaultOption=R_(w2.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(w2);const d8=c8;var p8=Pf();function f8(t,e,n){p8(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}function g8(t,e){for(var n=p8(t).coordSysRecordMap,i=n.keys(),r=0;ri[n+e]&&(e=a),r=r&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}function b8(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=p8(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=gl());i.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var n=m2(t);Rs(n.infoList,(function(n){var r=n.model.uid,o=i.get(r)||i.set(r,y8(e,n.model)),a=o.dataZoomInfoMap||(o.dataZoomInfoMap=gl());a.set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),i.each((function(t){var e,n=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var a=x8(r);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),QC(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else v8(i,t)}))}))}var w8=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return qa(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),f8(i,e,{pan:Fs(S8.pan,this),zoom:Fs(S8.zoom,this),scrollMove:Fs(S8.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){g8(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(C2),S8={zoom:function(t,e,n,i){var r=this.range,o=r.slice(),a=t.axisModels[0];if(a){var s=I8[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return JY(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:M8((function(t,e,n,i,r,o){var a=I8[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:M8((function(t,e,n,i,r,o){var a=I8[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n);return a.signal*(t[1]-t[0])*o.scrollDelta}))};function M8(t){return function(e,n,i,r){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s){var l=t(a,s,e,n,i,r);return JY(l,a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}}var I8={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};const C8=w8;function T8(t){B2(t),t.registerComponentModel(d8),t.registerComponentView(C8),b8(t)}var A8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=R_(w2.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(w2);const D8=A8;var k8=sy,L8=7,P8=1,R8=30,O8=7,N8="horizontal",E8="vertical",z8=5,B8=["line","bar","candlestick","scatter"],V8={easing:"cubicOut",duration:100,delay:0},F8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return qa(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=Fs(this._onBrush,this),this._onBrushEnd=Fs(this._onBrushEnd,this)},e.prototype.render=function(e,n,i,r){if(t.prototype.render.apply(this,arguments),QC(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){tT(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Ip;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect"),i=n?O8:0,r=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},a=this._orient===N8?{right:o.width-r.x-r.width,top:o.height-R8-L8-i,width:r.width,height:R8}:{right:L8,top:r.y,width:R8,height:r.height},s=Xx(t.option);Rs(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=a[t])}));var l=Hx(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===E8&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==N8||r?n===N8&&r?{scaleY:a?1:-1,scaleX:-1}:n!==E8||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new k8({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new k8({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:Fs(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=r.getDataExtent(a),h=.3*(u[1]-u[0]);u=[u[0]-h,u[1]+h];var c,d=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],g=[],v=p[1]/(r.count()-1),y=0,m=Math.round(r.count()/e[0]);r.each([a],(function(t,e){if(m>0&&e%m)y+=v;else{var n=null==t||isNaN(t)||""===t,i=n?0:Ep(t,u,d,!0);n&&!c&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&c&&(f.push([y,0]),g.push([y,0])),f.push([y,i]),g.push([y,i]),y+=v,c=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(t){var e=_.getModel(t?"selectedDataBackground":"dataBackground"),n=new Ip,i=new DI({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new PI({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,i=this.ecModel;return t.eachTargetAxis((function(r,o){var a=t.getAxisProxy(r,o).getTargetSeriesModels();Rs(a,(function(t){if(!n&&!(!0!==e&&Ds(B8,t.get("type"))<0)){var a,s=i.getComponent(v2(r),o).axis,l=G8(r),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new k8({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(h),r.add(new k8({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:P8,fill:"rgba(0,0,0,0)"}})),Rs([0,1],(function(e){var o=a.get("handleIcon");!rA[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=sA(o,-1,0,2,2,null,!0);s.attr({cursor:H8(this._orient),draggable:!0,drift:Fs(this._onDragMove,this,e),ondragend:Fs(this._onDragEnd,this),onmouseover:Fs(this._showDataInfo,this,!0),onmouseout:Fs(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=zp(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Am(s);var h=a.get("handleColor");null!=h&&(s.style.fill=h),r.add(n[e]=s);var c=a.getModel("textStyle");t.add(i[e]=new Iy({silent:!0,invisible:!0,style:r_(c,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:c.getTextColor(),font:c.getFont()}),z2:10}))}),this);var c=h;if(u){var d=zp(a.get("moveHandleSize"),o[1]),p=e.moveHandle=new sy({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=e.moveHandleIcon=sA(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var v=Math.min(o[1]/2,Math.max(d,10));c=e.moveZone=new sy({invisible:!0,shape:{y:o[1]-v,height:d+v}}),c.on("mouseover",(function(){s.enterEmphasis(p)})).on("mouseout",(function(){s.leaveEmphasis(p)})),r.add(p),r.add(g),r.add(c)}c.attr({draggable:!0,cursor:H8(this._orient),drift:Fs(this._onDragMove,this,"all"),ondragstart:Fs(this._showDataInfo,this,!0),ondragend:Fs(this._onDragEnd,this),onmouseover:Fs(this._showDataInfo,this,!0),onmouseout:Fs(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Ep(t[0],[0,100],e,!0),Ep(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];JY(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?Ep(o.minSpan,a,r,!0):null,null!=o.maxSpan?Ep(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=Vp([Ep(i[0],r,a,!0),Ep(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Vp(n.slice()),r=this._size;Rs([0,1],(function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})}),this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Lu(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape,i=+new Date;if(!(i-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),o=[0,100];this._range=Vp([Ep(n.x,r,o,!0),Ep(n.x+n.width,r,o,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(gu(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new k8({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?V8:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=m2(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},e.type="dataZoom.slider",e}(C2);function G8(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function H8(t){return"vertical"===t?"ns-resize":"ew-resize"}const W8=F8;function U8(t){t.registerComponentModel(D8),t.registerComponentView(W8),B2(t)}function Z8(t){Ek(T8),Ek(U8)}var Y8={get:function(t,e,n){var i=Ms((X8[t]||{})[e]);return n&&Hs(i)?i[i.length-1]:i}},X8={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const j8=Y8;var q8=oU.mapVisual,K8=oU.eachVisual,$8=Hs,J8=Rs,Q8=Vp,t7=Ep,e7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return qa(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&V3(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=Fs(t,this),this.controllerVisuals=B3(this.option.controller,e,t),this.targetVisuals=B3(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=hf(t),e},e.prototype.eachTargetSeries=function(t,e){Rs(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)}),this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},e.prototype.formatValueText=function(t,e,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],Hs(t)&&(t=t.slice(),i=!0);var l=e?t:i?[u(t[0]),u(t[1])]:u(t);return Us(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):Ws(s)?i?s(t[0],t[1]):s(t):i?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=Q8([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=t.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),r=e.controller||(e.controller={});Is(i,n),Is(r,n);var o=this.isCategory();function a(n){$8(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}function s(t,e,n){var i=t[e],r=t[n];i&&!r&&(r=t[n]={},J8(i,(function(t,e){if(oU.isValidType(e)){var n=j8.get(e,"inactive",o);null!=n&&(r[e]=n,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}function l(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol(),a=r||"roundRect";J8(this.stateList,(function(r){var s=this.itemSize,l=t[r];l||(l=t[r]={color:o?i:[i]}),null==l.symbol&&(l.symbol=e&&Ms(e)||(o?a:[a])),null==l.symbolSize&&(l.symbolSize=n&&Ms(n)||(o?s[0]:[s[0],s[0]])),l.symbol=q8(l.symbol,(function(t){return"none"===t?a:t}));var u=l.symbolSize;if(null!=u){var h=-1/0;K8(u,(function(t){t>h&&(h=t)})),l.symbolSize=q8(u,(function(t){return t7(t,[0,h],[0,s[0]],!0)}))}}),this)}a.call(this,i),a.call(this,r),s.call(this,i,"inRange","outOfRange"),l.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Jx);const n7=e7;var i7=[20,140],r7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=i7[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=i7[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):Hs(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),Rs(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=Vp((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),(function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)}),this),e.push({seriesId:n.id,dataIndex:i})}),this),e},e.prototype.getVisualMeta=function(t){var e=o7(this,"outOfRange",this.getExtent()),n=o7(this,"inRange",this.option.range.slice()),i=[];function r(e,n){i.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;at[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/n})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Ip("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent();p7([0,1],(function(l){var u=r[l];u.setStyle("fill",e.handlesColor[l]),u.y=t[l];var h=d7(t[l],[0,a[1]],s,!0),c=this.getControllerVisual(h,"symbolSize");u.scaleX=u.scaleY=c/a[0],u.x=a[0]-c/2;var d=IC(n.handleLabelPoints[l],MC(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h={convertOpacityToAlpha:!0},c=this.getControllerVisual(t,"color",h),d=this.getControllerVisual(t,"symbolSize"),p=d7(t,o,s,!0),f=a[0]-d/2,g={x:u.x,y:u.y};u.y=p,u.x=f;var v=IC(l.indicatorLabelPoint,MC(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var m=this._applyTransform("left",l.mainGroup),_=this._orient,x="horizontal"===_;y.setStyle({text:(n||"")+r.formatValueText(e),verticalAlign:x?m:"middle",align:x?"center":m});var b={x:f,y:p,style:{fill:c}},w={style:{x:v[0],y:v[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=g.x,u.y=g.y,u.animateTo(b,S),y.animateTo(w,S)}else u.attr(b),y.attr(w);this._firstShowIndicator=!1;var M=this._shapes.handleLabels;if(M)for(var I=0;Ir[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var h=this._hoverLinkDataIndices,c=[];(e||b7(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=kf(h,c);this._dispatchHighDown("downplay",c7(d[0],n)),this._dispatchHighDown("highlight",c7(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(XT(t.target,(function(t){var n=Cy(t);if(null!=n.dataIndex)return e=n,!0}),!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var r=n.getData(e.dataType),o=r.getStore().get(i.getDataDimensionIndex(r),e.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n=0&&(r.dimension=o,i.push(r))}})),t.getData().setVisual("visualMeta",i)}}];function T7(t,e,n,i){for(var r=e.targetVisuals[i],o=oU.prepareVisualTypes(r),a={color:HT(t.getData(),"color")},s=0,l=o.length;s0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction(M7,I7),Rs(C7,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(D7))}function R7(t){t.registerComponentModel(a7),t.registerComponentView(S7),P7(t)}var O7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._pieceList=[],n}return qa(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],N7[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=Ms(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=Os(this._pieceList,(function(t){return t=Ms(t),"inRange"!==e&&(t.visual=null),t})))}))},e.prototype.completeVisualOption=function(){var e=this.option,n={},i=oU.listVisualTypes(),r=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}Rs(e.pieces,(function(t){Rs(i,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),Rs(n,(function(t,n){var i=!1;Rs(this.stateList,(function(t){i=i||o(e,t,n)||o(e.target,t,n)}),this),!i&&Rs(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=j8.get(n,"inRange"===t?"active":"inactive",r)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,r=(e?n:t).selected||{};if(n.selected=r,Rs(i,(function(t,e){var n=this.getSelectedMapKey(t);r.hasOwnProperty(n)||(r[n]=!0)}),this),"single"===n.selectedMode){var o=!1;Rs(i,(function(t,e){var n=this.getSelectedMapKey(t);r[n]&&(o?r[n]=!1:o=!0)}),this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Ms(t)},e.prototype.getValueState=function(t){var e=oU.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),(function(e,i){var o=oU.findPieceIndex(e,n);o===t&&r.push(i)}),this),e.push({seriesId:i.id,dataIndex:r})}),this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),o=r[r.length-1].interval[1],o!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return Rs(r,(function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])}),this),{stops:e,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=t(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:e.push({value:r[0],color:s},{value:r[1],color:s})}},e.type="visualMap.piecewise",e.defaultOption=R_(n7.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(n7),N7={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;var o=(i[1]-i[0])/r;while(+o.toFixed(n)!==o&&n<5)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};function E7(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}const z7=O7;var B7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=el(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,a),Rs(l.viewPieceList,(function(i){var l=i.piece,u=new Ip;u.onclick=Fs(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new Iy({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===d?.5:1}}))}t.add(u)}),this),u&&this._renderEndsText(t,u[1],s,h,a),Fx(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(t){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:t,batch:c7(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return h7(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,r){if(e){var o=new Ip,a=this.visualMapModel.textStyleModel;o.add(new Iy({style:r_(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:e})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=Os(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),n=t.get("text"),i=t.get("orient"),r=t.get("inverse");return("horizontal"===i?r:!r)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},e.prototype._createItemSymbol=function(t,e,n){t.add(sA(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var r=Ms(n.selected),o=e.getSelectedMapKey(t);"single"===i||!0===i?(r[o]=!0,Rs(r,(function(t,e){r[e]=e===o}))):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},e.type="visualMap.piecewise",e}(l7);const V7=B7;function F7(t){t.registerComponentModel(z7),t.registerComponentView(V7),P7(t)}function G7(t){Ek(R7),Ek(F7)}var H7={label:{enabled:!0},decal:{show:!1}},W7=Pf(),U7={};function Z7(t,e){var n=t.getModel("aria");if(n.get("enabled")){var i=Ms(H7);Is(i.label,t.getLocaleModel().get("aria"),!1),Is(n.option,i,!1),r(),o()}function r(){var e=n.getModel("decal"),i=e.get("show");if(i){var r=gl();t.eachSeries((function(t){if(!t.isColorBySeries()){var e=r.get(t.type);e||(e={},r.set(t.type,e)),W7(t).scope=e}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if(Ws(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=Db(e.ecModel,e.name,U7,t.getSeriesCount()),r=n.getVisual("decal");n.setVisual("decal",u(r,i))}else{var o=e.getRawData(),a={},s=W7(e).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=o.count();o.each((function(t){var i=a[t],r=o.getName(t)||t+"",h=Db(e.ecModel,r,s,l),c=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(c,h))}))}}function u(t,e){var n=t?Ts(Ts({},e),t):e;return n.dirty=!0,n}}))}}function o(){var i=t.getLocaleModel().get("aria"),r=n.getModel("label");if(r.option=As(r.option,i),r.get("enabled")){var o=e.getZr().dom;if(r.get("description"))o.setAttribute("aria-label",r.get("description"));else{var u,h=t.getSeriesCount(),c=r.get(["data","maxCount"])||10,d=r.get(["series","maxCount"])||10,p=Math.min(h,d);if(!(h<1)){var f=s();if(f){var g=r.get(["general","withTitle"]);u=a(g,{title:f})}else u=r.get(["general","withoutTitle"]);var v=[],y=h>1?r.get(["series","multiple","prefix"]):r.get(["series","single","prefix"]);u+=a(y,{seriesCount:h}),t.eachSeries((function(t,e){if(e1?r.get(["series","multiple",o]):r.get(["series","single",o]),n=a(n,{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:l(t.subType)});var s=t.getData();if(s.count()>c){var u=r.get(["data","partialData"]);n+=a(u,{displayCnt:c})}else n+=r.get(["data","allData"]);for(var d=r.get(["data","separator","middle"]),f=r.get(["data","separator","end"]),g=[],y=0;y":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},q7=function(){function t(t){var e=this._condVal=Us(t)?new RegExp(t):Qs(t)?t:null;if(null==e){var n="";0,lS(n)}}return t.prototype.evaluate=function(t){var e=typeof t;return Us(e)?this._condVal.test(t):!!Ys(e)&&this._condVal.test(t+"")},t}(),K7=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),$7=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e2&&l.push(e),e=[t,n]}function f(t,n,i,r){g9(t,i)&&g9(n,r)||e.push(t,n,i,r,i,r)}function g(t,n,i,r,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,u=nM:T2&&l.push(e),l}function y9(t,e,n,i,r,o,a,s,l,u){if(g9(t,n)&&g9(e,i)&&g9(r,a)&&g9(o,s))l.push(a,s);else{var h=2/u,c=h*h,d=a-t,p=s-e,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-t,v=i-e,y=r-a,m=o-s,_=g*g+v*v,x=y*y+m*m;if(_=0&&M=0)l.push(a,s);else{var I=[],C=[];zh(t,n,r,a,.5,I),zh(e,i,o,s,.5,C),y9(I[0],C[0],I[1],C[1],I[2],C[2],I[3],C[3],l,u),y9(I[4],C[4],I[5],C[5],I[6],C[6],I[7],C[7],l,u)}}}}function m9(t,e){var n=v9(t),i=[];e=e||1;for(var r=0;r0)for(u=0;uMath.abs(u),c=_9([l,u],h?0:1,e),d=(h?s:u)/c.length,p=0;pr,a=_9([i,r],o?0:1,e),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",h=o?"y":"x",c=t[s]/a.length,d=0;d1?null:new Lu(g*l+t,g*u+e)}function M9(t,e,n){var i=new Lu;Lu.sub(i,n,e),i.normalize();var r=new Lu;Lu.sub(r,t,e);var o=r.dot(i);return o}function I9(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function C9(t,e,n){for(var i=t.length,r=[],o=0;oa?(u.x=h.x=s+o/2,u.y=l,h.y=l+a):(u.y=h.y=l+a/2,u.x=s,h.x=s+o),C9(e,u,h)}function A9(t,e,n,i){if(1===n)i.push(e);else{var r=Math.floor(n/2),o=t(e);A9(t,o[0],r,i),A9(t,o[1],n-r,i)}return i}function D9(t,e){for(var n=[],i=0;i0)for(var b=i/n,w=-i/2;w<=i/2;w+=b){var S=Math.sin(w),M=Math.cos(w),I=0;for(_=0;_0;u/=2){var h=0,c=0;(t&u)>0&&(h=1),(e&u)>0&&(c=1),l+=u*u*(3*h^c),0===c&&(1===h&&(t=u-1-t,e=u-1-e),s=t,t=e,e=s)}return l}function j9(t){var e=1/0,n=1/0,i=-1/0,r=-1/0,o=Os(t,(function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),i=Math.max(s,i),r=Math.max(l,r),[s,l]})),a=Os(o,(function(o,a){return{cp:o,z:X9(o[0],o[1],e,n,i,r),path:t[a]}}));return a.sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function q9(t){return P9(t.path,t.count)}function K9(){return{fromIndividuals:[],toIndividuals:[],count:0}}function $9(t,e,n){var i=[];function r(t){for(var e=0;e=0;r--)if(!n[r].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[r].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var ett={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0;i0){var s,l,u=i.getModel("universalTransition").get("delay"),h=Object.assign({setToFinal:!0},a);Q9(t)&&(s=t,l=e),Q9(e)&&(s=e,l=t);for(var c=s?s===t:t.length>e.length,d=s?ttt(l,s):ttt(c?e:t,[c?t:e]),p=0,f=0;frtt))for(var i=n.getIndices(),r=att(n),o=0;o0&&r.group.traverse((function(t){t instanceof Uv&&!t.animators.length&&t.animateFrom({style:{opacity:0}},o)}))}))}function ftt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function gtt(t){return Hs(t)?t.sort().join(","):t}function vtt(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function ytt(t,e){var n=gl(),i=gl(),r=gl();return Rs(t.oldSeries,(function(e,n){var o=t.oldDataGroupIds[n],a=t.oldData[n],s=ftt(e),l=gtt(s);i.set(l,{dataGroupId:o,data:a}),Hs(s)&&Rs(s,(function(t){r.set(t,{key:l,dataGroupId:o,data:a})}))})),Rs(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),o=t.getData(),a=ftt(t),s=gtt(a),l=i.get(s);if(l)n.set(s,{oldSeries:[{dataGroupId:l.dataGroupId,divide:vtt(l.data),data:l.data}],newSeries:[{dataGroupId:e,divide:vtt(o),data:o}]});else if(Hs(a)){0;var u=[];Rs(a,(function(t){var e=i.get(t);e.data&&u.push({dataGroupId:e.dataGroupId,divide:vtt(e.data),data:e.data})})),u.length&&n.set(s,{oldSeries:u,newSeries:[{dataGroupId:e,data:o,divide:vtt(o)}]})}else{var h=r.get(a);if(h){var c=n.get(h.key);c||(c={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:vtt(h.data)}],newSeries:[]},n.set(h.key,c)),c.newSeries.push({dataGroupId:e,data:o,divide:vtt(o)})}}}})),n}function mtt(t,e){for(var n=0;n=0&&r.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],divide:vtt(e.oldData[n]),dim:t.dimension})})),Rs(hf(t.to),(function(t){var i=mtt(n.updatedSeries,t);if(i>=0){var r=n.updatedSeries[i].getData();o.push({dataGroupId:e.oldDataGroupIds[i],data:r,divide:vtt(r),dim:t.dimension})}})),r.length>0&&o.length>0&&ptt(r,o,i)}function xtt(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){Rs(hf(n.seriesTransition),(function(t){Rs(hf(t.to),(function(t){for(var e=n.updatedSeries,i=0;i((0,r.dD)("data-v-6e4bc48a"),t=t(),(0,r.Cn)(),t),Stt={class:"content-box"},Mtt={class:"info"},Itt={class:"info-content"},Ctt=wtt((()=>(0,r._)("h1",null,[(0,r.Uk)("Organism: "),(0,r._)("span",null,"Homo sapiens")],-1))),Ttt={class:"button-tag"},Att={class:"history"},Dtt={class:"card"},ktt={__name:"index",emits:["changeLoading"],setup(t,{emit:e}){const n=(0,btt.tv)(),i=(0,o.iH)(!1),l=e;let u=500,h=[];const c=(0,o.iH)(!1),d=(0,o.iH)(!1),p=(0,o.iH)([]),f=(0,o.iH)(""),g=(0,o.iH)([]),v=(0,o.iH)([]),y=(0,o.iH)([]),m=["#8DD3C7","#EDBC63","#BEBADA","#FB8072","#80B1D3"],_=(0,o.iH)(),x=(0,o.iH)([]);let b;const w=["heart","stomach","blood plasma","brain","kidney","liver","lung","pancreas","spleen","adrenal gland","testis","ovary","prostate","colon","esophagus","placenta"],S={trigger:"item",axisPointer:{type:"shadow"},textStyle:{},formatter:function(t){return["

"+t.data[0]+"

",'
',"Max:"+parseFloat(t.data[5]).toFixed(2)+"
","Q3:"+parseFloat(t.data[4]).toFixed(2)+"
","Median:"+parseFloat(t.data[3]).toFixed(2)+"
","Q1:"+parseFloat(t.data[2]).toFixed(2)+"
","Min:"+parseFloat(t.data[1]).toFixed(2)+"
"].join("")}};g.value=Array.isArray(n.currentRoute.value.query.protein)?n.currentRoute.value.query.protein:[n.currentRoute.value.query.protein],f.value=n.currentRoute.value.name;const M=async()=>{l("changeLoading");const t="tissues"===f.value?await Wt():await Ut(),e=new Uint8Array(t.data),n=Xa(e,{to:"string"});h=JSON.parse(n),l("changeLoading"),C(g)},I=t=>{p.value.splice(y.value.indexOf(t),1),y.value.splice(y.value.indexOf(t),1),"tissues"===f.value?n.push({path:"/ae/tissues",query:{protein:y.value}}):n.push({path:"/ae/cellline",query:{protein:y.value}})},C=t=>{if("undefined"===typeof t.value[0])return d.value=!1,void(b&&b.dispose());let e=h;t.value.map((t=>{const n=e.find((e=>e.name===t.trim()));n?y.value.includes(t.trim())||(5===y.value.length?(y.value.shift(),y.value.push(t.trim()),p.value.shift(),p.value.push(n)):(y.value.push(t.trim()),p.value.push(n))):alert("Please enter a legal protein name")})),y.value.length!=t.value.length?"tissues"===f.value?n.push({path:"/ae/tissues",query:{protein:y.value}}):n.push({path:"/ae/cellline",query:{protein:y.value}}):(d.value=!0,u=p.value.length>1?400*p.value.length:500,(0,r.Y3)((()=>{D()})))};(0,btt.ao)((t=>{g.value=t.query.protein,C(g)})),(0,r.bv)((()=>{M()}));const T=t=>{"tissues"===f.value&&t.tags.length<18&&w.map((e=>{t.tags.includes(e)||(t.tags.push(e),t.data.push([]))}));let e=[];for(let r=0;rt>=1)),e.push(n)}"tissues"!==f.value&&(e.sort(((t,e)=>{const n=t.data.length,i=e.data.length;return i-n})),e=e.slice(0,20)),e.sort(((t,e)=>{const n=t.data.length>0?t.data.reduce(((t,e)=>t+e))/t.data.length:0,i=t.data.length>0?e.data.reduce(((t,e)=>t+e))/e.data.length:0;return n-i}));let n=[],i=[];return e.map((t=>{n.push(t.data),i.push(t.name)})),{neatData:n,tags:i}},A={title:[],dataset:[],tooltip:{},legend:{show:!0,orient:"vertical",right:10,top:60,data:[]},grid:{left:"10%",right:"10%",bottom:60},yAxis:{type:"category",boundaryGap:!0,nameGap:30,splitArea:{show:!1},splitLine:{show:!1}},xAxis:{type:"value",name:"iBAQLog",nameLocation:"center",nameGap:40,splitArea:{show:!1},splitLine:{show:!1},min:1},toolbox:{feature:{saveAsImage:{type:"png",title:"save as .png",pixelRatio:10}}},series:[]},D=()=>{if(1===p.value.length){A.dataset=[],A.series=[],A.title=[],A.legend.show=!1;let{neatData:t,tags:e}=T(p.value[0]);v.value=e,A.title.push({text:p.value[0].title,left:"center"});let{samples:n,data:i}=k(t,2);c.value?(A.series.push({name:y.value[0],type:"bar",data:i,itemStyle:{color:m[0],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"},label:{show:!0,position:"right",formatter:function(){return`samples: ${n.shift()}`}}}),A.tooltip={trigger:"axis",axisPointer:{type:"shadow"}},A.yAxis.data=v.value):(A.dataset.push({source:t}),A.dataset.push({fromDatasetIndex:0,transform:{type:"boxplot",config:{itemNameFormatter:function(t){return e[t.value]}}}}),A.series.push({name:"category0",type:"boxplot",datasetIndex:1,itemStyle:{color:m[0],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"}}),A.tooltip=S)}else{f.value,v.value=0===v.value.length?T(p.value[0]).tags:v.value,0===p.value.length?A.title=[]:A.title.splice(0,1,{text:`Comparison of protein expression in different ${f.value}`,left:"center"}),0===p.value.length?A.legend.show=!1:A.legend.show=!0;let t=[];p.value.map((e=>{let n=[];v.value.forEach((t=>{if(e.tags.includes(t)){let i=e.tags.indexOf(t),r=e.data[i].filter((t=>t>=1));n.push(r)}else n.push([])})),t.push(n)}));let{samples:e,data:n}=k(t,3);c.value?(t=n,A.dataset=[],A.series=[],A.legend.data=[],t.forEach(((t,n)=>{A.series.push({name:y.value[n],type:"bar",data:t,itemStyle:{color:m[n],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"},label:{show:!0,position:"right",formatter:function(){return`samples: ${e[n].shift()}`}}}),A.legend.data.push({name:y.value[n],itemStyle:{color:m[n],borderColor:m[n]}})})),A.tooltip={trigger:"axis",axisPointer:{type:"shadow"}},A.yAxis.data=v.value):(A.dataset=[],A.series=[],A.legend.data=[],t.forEach(((e,n)=>{A.dataset.push({source:e}),A.series.push({name:y.value[n],type:"boxplot",datasetIndex:t.length+n,itemStyle:{color:m[n],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"}}),A.legend.data.push({name:y.value[n],itemStyle:{color:m[n],borderColor:m[n]}})})),t.forEach(((t,e)=>{A.dataset.push({fromDatasetIndex:e,transform:{type:"boxplot",config:{itemNameFormatter:function(t){return v.value[t.value]}}}})})),A.tooltip=S)}null!=b&&""!==b&&void 0!==b&&b.dispose(),b=yk(_.value,"macarons"),b.clear(),b.resize({height:u}),b.setOption(A),setTimeout((()=>{if(0!==g.value.length){let t=b.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff",excludeComponents:["toolbox"]}),e={proteinName:g.value,url:t};x.value.unshift(e)}}),2e3)},k=(t,e)=>{if(2===e){let e=t.map((t=>t.length));return t=t.map((t=>t.length>0?Number((t.reduce(((t,e)=>t+e))/t.length).toFixed(2)):0)),{samples:e,data:t}}{let e=t.map((t=>t.map((t=>t.length))));return t=t.map((t=>t.map((t=>t.length>0?Number((t.reduce(((t,e)=>t+e))/t.length).toFixed(2)):0)))),{samples:e,data:t}}},L=()=>{D()};return(t,e)=>{const n=Gt,l=Ct.Ks,h=It.gi,p=Mt.F8,f=St,g=K;return(0,r.wy)(((0,r.wg)(),(0,r.iD)("div",Stt,[(0,r._)("div",Mtt,[(0,r._)("div",Itt,[Ctt,(0,r.Wm)(n,{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=t=>c.value=t),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949",position:"absolute"},"active-text":"Bar","inactive-text":"Box",onChange:L},null,8,["modelValue"])]),(0,r._)("div",Ttt,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(y.value,((t,e)=>((0,r.wg)(),(0,r.j4)(l,{key:e,round:"",closable:"",color:m[e],onClose:e=>I(t)},{default:(0,r.w5)((()=>[(0,r.Uk)((0,s.zw)(t),1)])),_:2},1032,["color","onClose"])))),128))]),(0,r._)("div",Att,[(0,r.Wm)(h,{style:{"margin-right":"16px"},class:"history-info",type:"info",onClick:e[1]||(e[1]=t=>i.value=!0)},{default:(0,r.w5)((()=>[(0,r.Uk)(" history ")])),_:1}),(0,r.Wm)(g,{modelValue:i.value,"onUpdate:modelValue":e[2]||(e[2]=t=>i.value=t),title:"I am the title","with-header":!1},{default:(0,r.w5)((()=>[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(x.value,((t,e)=>((0,r.wg)(),(0,r.j4)(f,{"tab-position":"right",style:{height:"300px"},class:"demo-tabs",key:e},{default:(0,r.w5)((()=>[(0,r._)("h5",null,(0,s.zw)(t.proteinName.join()),1),(0,r.Wm)(p,{style:{width:"100%"},src:t.url,fit:"fill","preview-src-list":[t.url]},null,8,["src","preview-src-list"])])),_:2},1024)))),128))])),_:1},8,["modelValue"])])]),(0,r._)("div",Dtt,[(0,r._)("div",{ref_key:"chart",ref:_,style:(0,s.j5)({width:"100%",height:(0,o.SU)(u)+"px"})},null,4)])],512)),[[a.F8,d.value]])}}};var Ltt=n(3744);const Ptt=(0,Ltt.Z)(ktt,[["__scopeId","data-v-6e4bc48a"]]),Rtt=Ptt},6502:(t,e,n)=>{n.d(e,{cU:()=>f,WS:()=>p});var i=n(2262),r=n(6252);const o=Symbol();var a=n(9143),s=n(7774),l=n(4568),u=n(4721),h=n(2771),c=n(5437);const d=(0,i.iH)();function p(t,e=void 0){const n=(0,r.FN)()?(0,r.f3)(o,d):d;return t?(0,r.Fl)((()=>{var i,r;return null!=(r=null==(i=n.value)?void 0:i[t])?r:e})):n}function f(t,e){const n=p(),o=(0,a.s3)(t,(0,r.Fl)((()=>{var t;return(null==(t=n.value)?void 0:t.namespace)||a.tL}))),u=(0,s.bU)((0,r.Fl)((()=>{var t;return null==(t=n.value)?void 0:t.locale}))),h=(0,l.Cn)((0,r.Fl)((()=>{var t;return(null==(t=n.value)?void 0:t.zIndex)||l.DA}))),c=(0,r.Fl)((()=>{var t;return(0,i.SU)(e)||(null==(t=n.value)?void 0:t.size)||""}));return g((0,r.Fl)((()=>(0,i.SU)(n)||{}))),{ns:o,locale:u,zIndex:h,size:c}}const g=(t,e,n=!1)=>{var c;const f=!!(0,r.FN)(),g=f?p():void 0,y=null!=(c=null==e?void 0:e.provide)?c:f?r.JJ:void 0;if(!y)return void(0,u.N)("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const m=(0,r.Fl)((()=>{const e=(0,i.SU)(t);return(null==g?void 0:g.value)?v(g.value,e):e}));return y(o,m),y(s._N,(0,r.Fl)((()=>m.value.locale))),y(a.dP,(0,r.Fl)((()=>m.value.namespace))),y(l.KM,(0,r.Fl)((()=>m.value.zIndex))),y(h.m8,{size:(0,r.Fl)((()=>m.value.size||""))}),!n&&d.value||(d.value=m.value),m},v=(t,e)=>{var n;const i=[...new Set([...(0,c.uc)(t),...(0,c.uc)(e)])],r={};for(const o of i)r[o]=null!=(n=e[o])?n:t[o];return r}},165:(t,e,n)=>{n.d(e,{H:()=>i,K:()=>r});const i=Symbol("formContextKey"),r=Symbol("formItemContextKey")},1069:(t,e,n)=>{n.d(e,{DT:()=>u,Cd:()=>l});var i=n(2262),r=n(6252),o=n(165);const a=t=>{const e=(0,r.FN)();return(0,r.Fl)((()=>{var n,i;return null==(i=null==(n=null==e?void 0:e.proxy)?void 0:n.$props)?void 0:i[t]}))};var s=n(2771);const l=(t,e={})=>{const n=(0,i.iH)(void 0),l=e.prop?n:a("size"),u=e.global?n:(0,s.fl)(),h=e.form?{size:void 0}:(0,r.f3)(o.H,void 0),c=e.formItem?{size:void 0}:(0,r.f3)(o.K,void 0);return(0,r.Fl)((()=>l.value||(0,i.SU)(t)||(null==c?void 0:c.size)||(null==h?void 0:h.size)||u.value||""))},u=t=>{const e=a("disabled"),n=(0,r.f3)(o.H,void 0);return(0,r.Fl)((()=>e.value||(0,i.SU)(t)||(null==n?void 0:n.disabled)||!1))}},5620:(t,e,n)=>{n.d(e,{A:()=>s,p:()=>l});var i=n(6252),r=n(2262),o=n(165),a=n(2259);const s=()=>{const t=(0,i.f3)(o.H,void 0),e=(0,i.f3)(o.K,void 0);return{form:t,formItem:e}},l=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:o})=>{n||(n=(0,r.iH)(!1)),o||(o=(0,r.iH)(!1));const s=(0,r.iH)();let l;const u=(0,i.Fl)((()=>{var n;return!!(!t.label&&e&&e.inputIds&&(null==(n=e.inputIds)?void 0:n.length)<=1)}));return(0,i.bv)((()=>{l=(0,i.YP)([(0,r.Vh)(t,"id"),n],(([t,n])=>{const i=null!=t?t:n?void 0:(0,a.Me)().value;i!==s.value&&((null==e?void 0:e.removeInputId)&&(s.value&&e.removeInputId(s.value),(null==o?void 0:o.value)||n||!i||e.addInputId(i)),s.value=i)}),{immediate:!0})})),(0,i.Ah)((()=>{l&&l(),(null==e?void 0:e.removeInputId)&&s.value&&e.removeInputId(s.value)})),{isLabeledByFormItem:u,inputId:s}}},6398:(t,e,n)=>{n.d(e,{gi:()=>y});var i=n(6252),r=n(3577),o=n(2262),a=n(5027),s=n(209);const l=(0,a.o8)({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:s.k,default:""},truncated:{type:Boolean},lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var u=n(1446),h=n(1069),c=n(9143),d=n(5162);const p=(0,i.aZ)({name:"ElText"}),f=(0,i.aZ)({...p,props:l,setup(t){const e=t,n=(0,h.Cd)(),a=(0,c.s3)("text"),s=(0,i.Fl)((()=>[a.b(),a.m(e.type),a.m(n.value),a.is("truncated",e.truncated),a.is("line-clamp",!(0,d.o8)(e.lineClamp))]));return(t,e)=>((0,i.wg)(),(0,i.j4)((0,i.LL)(t.tag),{class:(0,r.C_)((0,o.SU)(s)),style:(0,r.j5)({"-webkit-line-clamp":t.lineClamp})},{default:(0,i.w5)((()=>[(0,i.WI)(t.$slots,"default")])),_:3},8,["class","style"]))}});var g=(0,u.Z)(f,[["__file","text.vue"]]),v=n(2123);const y=(0,v.nz)(g)},9448:(t,e,n)=>{n(3241)},9460:(t,e,n)=>{n.d(e,{O7:()=>r,e_:()=>o,f_:()=>i});const i="update:modelValue",r="change",o="input"},209:(t,e,n)=>{n.d(e,{V:()=>r,k:()=>i});const i=["","default","small","large"],r={large:40,default:32,small:24}},2259:(t,e,n)=>{n.d(e,{Me:()=>c,SG:()=>h});var i=n(6252),r=n(2262),o=n(9143),a=n(3299),s=n(4721);const l={prefix:Math.floor(1e4*Math.random()),current:0},u=Symbol("elIdInjection"),h=()=>(0,i.FN)()?(0,i.f3)(u,l):l,c=t=>{const e=h();a.C5||e!==l||(0,s.N)("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const n=(0,o.u_)(),u=(0,i.Fl)((()=>(0,r.SU)(t)||`${n.value}-id-${e.prefix}-${e.current++}`));return u}},2771:(t,e,n)=>{n.d(e,{Pp:()=>s,fl:()=>u,m8:()=>l});var i=n(6252),r=n(2262),o=n(5027),a=n(209);const s=(0,o.l0)({type:String,values:a.k,required:!1}),l=Symbol("size"),u=()=>{const t=(0,i.f3)(l,{});return(0,i.Fl)((()=>(0,r.SU)(t.size)||""))}},7601:(t,e,n)=>{function i(t){return null==t}n.d(e,{Z:()=>r});const r=i}}]); -//# sourceMappingURL=874.d34650df.js.map \ No newline at end of file +var Cp={},Tp={};function Ap(t){delete Tp[t]}function Dp(t){if(!t)return!1;if("string"===typeof t)return Sc(t,1)0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*u+a}function zp(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return Us(t)?Np(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Bp(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),Op),t=(+t).toFixed(e),n?t:+t}function Vp(t){return t.sort((function(t,e){return t-e})),t}function Fp(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return Gp(t)}function Gp(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Hp(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Wp(t,e){var n=Ns(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===n)return[];var i=Math.pow(10,e),r=Os(t,(function(t){return(isNaN(t)?0:t)/n*i*100})),o=100*i,a=Os(r,(function(t){return Math.floor(t)})),s=Ns(a,(function(t,e){return t+e}),0),l=Os(r,(function(t,e){return t-a[e]}));while(su&&(u=l[c],h=c);++a[h],l[h]=0,++s}return Os(a,(function(t){return t/i}))}function Up(t,e){var n=Math.max(Fp(t),Fp(e)),i=t+e;return n>Op?i:Bp(i,n)}var Zp=9007199254740991;function Yp(t){var e=2*Math.PI;return(t%e+e)%e}function Xp(t){return t>-Rp&&t=10&&e++,e}function Jp(t,e){var n,i=$p(t),r=Math.pow(10,i),o=t/r;return n=e?o<1.5?1:o<2.5?2:o<4?3:o<7?5:10:o<1?1:o<2?2:o<3?3:o<5?5:10,t=n*r,i>=-20?+t.toFixed(i<0?-i:0):t}function Qp(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function tf(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0||r&&Ds(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var og=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],ag=rg(og),sg=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return ag(this,t,e)},t}(),lg=new tc(50);function ug(t){if("string"===typeof t){var e=lg.get(t);return e&&e.image}return t}function hg(t,e,n,i,r){if(t){if("string"===typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=lg.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?(e=o.image,!dg(e)&&o.pending.push(a)):(e=us.loadImage(t,cg,cg),e.__zrImageSrc=t,lg.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function cg(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=a;l++)s-=a;var u=np(n,e);return u>s&&(n="",u=0),s=t-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=t,r}function vg(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var o=np(t,i);if(o<=n)return t;for(var a=0;;a++){if(o<=r||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?yg(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;t=t.substr(0,s),o=np(t,i)}return""===t&&(t=e.placeholder),t}function yg(t,e,n,i){for(var r=0,o=0,a=t.length;op&&h){var f=Math.floor(p/l);n=n.slice(0,f)}if(t&&a&&null!=c)for(var g=gg(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v=0;vl&&Sg(n,t.substring(l,u),e,s),Sg(n,i[2],e,s,i[1]),l=pg.lastIndex}lo){b>0?(m.tokens=m.tokens.slice(0,b),v(m,x,_),n.lines=n.lines.slice(0,y+1)):n.lines=n.lines.slice(0,y);break t}var A=S.width,D=null==A||"auto"===A;if("string"===typeof A&&"%"===A.charAt(A.length-1))w.percentWidth=A,h.push(w),w.contentWidth=np(w.text,C);else{if(D){var k=S.backgroundColor,L=k&&k.image;L&&(L=ug(L),dg(L)&&(w.width=Math.max(w.width,L.width*T/L.height)))}var P=f&&null!=r?r-x:null;null!=P&&P0&&f+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=f}else{var g=Tg(e,h,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var v=0;v=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Ig=Ns(",&?/;] ".split(""),(function(t,e){return t[e]=!0,t}),{});function Cg(t){return!Mg(t)||!!Ig[t]}function Tg(t,e,n,i,r){for(var o=[],a=[],s="",l="",u=0,h=0,c=0;cn:r+h+p>n)?h?(s||l)&&(f?(s||(s=l,l="",u=0,h=u),o.push(s),a.push(h-u),l+=d,u+=p,s="",h=u):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=d,h=p)):f?(o.push(l),a.push(u),l=d,u=p):(o.push(d),a.push(p)):(h+=p,f?(l+=d,u+=p):(l&&(s+=l,l="",u=0),s+=d))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return o.length||s||(s=t,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=r),{accumWidth:h,lines:o,linesWidths:a}}var Ag="__zr_style_"+Math.round(10*Math.random()),Dg={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},kg={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Dg[Ag]=!0;var Lg=["z","z2","invisible"],Pg=["invisible"],Rg=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype._init=function(e){for(var n=Bs(e),i=0;i1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(Wg[0]=Gg(r)*n+t,Wg[1]=Fg(r)*i+e,Ug[0]=Gg(o)*n+t,Ug[1]=Fg(o)*i+e,u(s,Wg,Ug),h(l,Wg,Ug),r%=Hg,r<0&&(r+=Hg),o%=Hg,o<0&&(o+=Hg),r>o&&!a?o+=Hg:rr&&(Zg[0]=Gg(p)*n+t,Zg[1]=Fg(p)*i+e,u(s,Zg,s),h(l,Zg,l))}var Qg={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tv=[],ev=[],nv=[],iv=[],rv=[],ov=[],av=Math.min,sv=Math.max,lv=Math.cos,uv=Math.sin,hv=Math.abs,cv=Math.PI,dv=2*cv,pv="undefined"!==typeof Float32Array,fv=[];function gv(t){var e=Math.round(t/cv*1e8)/1e8;return e%2*cv}function vv(t,e){var n=gv(t[0]);n<0&&(n+=dv);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=dv?r=n+dv:e&&n-r>=dv?r=n-dv:!e&&n>r?r=n+(dv-gv(n-r)):e&&n0&&(this._ux=hv(n/Vd/t)||0,this._uy=hv(n/Vd/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Qg.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=hv(t-this._xi),i=hv(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Qg.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Qg.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Qg.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),fv[0]=i,fv[1]=r,vv(fv,o),i=fv[0],r=fv[1];var a=r-i;return this.addData(Qg.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=lv(r)*n+t,this._yi=uv(r)*n+e,this},t.prototype.arcTo=function(t,e,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},t.prototype.rect=function(t,e,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Qg.R,t,e,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Qg.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&t.closePath(),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!pv||(this.data=new Float32Array(e));for(var n=0;nu.length&&(this._expandData(),u=this.data);for(var h=0;h0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){nv[0]=nv[1]=rv[0]=rv[1]=Number.MAX_VALUE,iv[0]=iv[1]=ov[0]=ov[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;tn||hv(m)>i||c===e-1)&&(f=Math.sqrt(y*y+m*m),r=g,o=v);break;case Qg.C:var _=t[c++],x=t[c++],b=(g=t[c++],v=t[c++],t[c++]),w=t[c++];f=Vh(r,o,_,x,g,v,b,w,10),r=b,o=w;break;case Qg.Q:_=t[c++],x=t[c++],g=t[c++],v=t[c++];f=Yh(r,o,_,x,g,v,10),r=g,o=v;break;case Qg.A:var S=t[c++],M=t[c++],I=t[c++],C=t[c++],T=t[c++],A=t[c++],D=A+T;c+=1;t[c++];p&&(a=lv(T)*I+S,s=uv(T)*C+M),f=sv(I,C)*av(dv,Math.abs(A)),r=lv(D)*I+S,o=uv(D)*C+M;break;case Qg.R:a=r=t[c++],s=o=t[c++];var k=t[c++],L=t[c++];f=2*k+2*L;break;case Qg.Z:y=a-r,m=s-o;f=Math.sqrt(y*y+m*m),r=a,o=s;break}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,u,h,c,d,p=this.data,f=this._ux,g=this._uy,v=this._len,y=e<1,m=0,_=0,x=0;if(!y||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=this._pathLen,h=e*u,h))t:for(var b=0;b0&&(t.lineTo(c,d),x=0),w){case Qg.M:n=r=p[b++],i=o=p[b++],t.moveTo(r,o);break;case Qg.L:a=p[b++],s=p[b++];var M=hv(a-r),I=hv(s-o);if(M>f||I>g){if(y){var C=l[_++];if(m+C>h){var T=(h-m)/C;t.lineTo(r*(1-T)+a*T,o*(1-T)+s*T);break t}m+=C}t.lineTo(a,s),r=a,o=s,x=0}else{var A=M*M+I*I;A>x&&(c=a,d=s,x=A)}break;case Qg.C:var D=p[b++],k=p[b++],L=p[b++],P=p[b++],R=p[b++],O=p[b++];if(y){C=l[_++];if(m+C>h){T=(h-m)/C;zh(r,D,L,R,T,tv),zh(o,k,P,O,T,ev),t.bezierCurveTo(tv[1],ev[1],tv[2],ev[2],tv[3],ev[3]);break t}m+=C}t.bezierCurveTo(D,k,L,P,R,O),r=R,o=O;break;case Qg.Q:D=p[b++],k=p[b++],L=p[b++],P=p[b++];if(y){C=l[_++];if(m+C>h){T=(h-m)/C;Uh(r,D,L,T,tv),Uh(o,k,P,T,ev),t.quadraticCurveTo(tv[1],ev[1],tv[2],ev[2]);break t}m+=C}t.quadraticCurveTo(D,k,L,P),r=L,o=P;break;case Qg.A:var N=p[b++],E=p[b++],z=p[b++],B=p[b++],V=p[b++],F=p[b++],G=p[b++],H=!p[b++],W=z>B?z:B,U=hv(z-B)>.001,Z=V+F,Y=!1;if(y){C=l[_++];m+C>h&&(Z=V+F*(h-m)/C,Y=!0),m+=C}if(U&&t.ellipse?t.ellipse(N,E,z,B,G,V,Z,H):t.arc(N,E,W,V,Z,H),Y)break t;S&&(n=lv(V)*z+N,i=uv(V)*B+E),r=lv(Z)*z+N,o=uv(Z)*B+E;break;case Qg.R:n=r=p[b],i=o=p[b+1],a=p[b++],s=p[b++];var X=p[b++],j=p[b++];if(y){C=l[_++];if(m+C>h){var q=h-m;t.moveTo(a,s),t.lineTo(a+av(q,X),s),q-=X,q>0&&t.lineTo(a+X,s+av(q,j)),q-=j,q>0&&t.lineTo(a+sv(X-q,0),s+j),q-=X,q>0&&t.lineTo(a,s+sv(j-q,0));break t}m+=C}t.rect(a,s,X,j);break;case Qg.Z:if(y){C=l[_++];if(m+C>h){T=(h-m)/C;t.lineTo(r*(1-T)+n*T,o*(1-T)+i*T);break t}m+=C}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Qg,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();const mv=yv;function _v(t,e,n,i,r,o,a){if(0===r)return!1;var s=r,l=0,u=t;if(a>e+s&&a>i+s||at+s&&o>n+s||oe+c&&h>i+c&&h>o+c&&h>s+c||ht+c&&u>n+c&&u>r+c&&u>a+c||ue+u&&l>i+u&&l>o+u||lt+u&&s>n+u&&s>r+u||sn||h+ur&&(r+=Mv);var d=Math.atan2(l,s);return d<0&&(d+=Mv),d>=i&&d<=r||d+Mv>=i&&d+Mv<=r}function Cv(t,e,n,i,r,o){if(o>e&&o>i||or?s:0}var Tv=mv.CMD,Av=2*Math.PI,Dv=1e-4;function kv(t,e){return Math.abs(t-e)e&&u>i&&u>o&&u>s||u1&&Rv(),p=Rh(e,i,o,s,Pv[0]),d>1&&(f=Rh(e,i,o,s,Pv[1]))),2===d?ve&&s>i&&s>o||s=0&&u<=1){for(var h=0,c=Fh(e,i,o,u),d=0;dn||s<-n)return 0;var l=Math.sqrt(n*n-s*s);Lv[0]=-l,Lv[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=Av-1e-4){i=0,r=Av;var h=o?1:-1;return a>=Lv[0]+t&&a<=Lv[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=Av,r+=Av);for(var d=0,p=0;p<2;p++){var f=Lv[p];if(f+t>a){var g=Math.atan2(s,f);h=o?1:-1;g<0&&(g=Av+g),(g>=i&&g<=r||g+Av>=i&&g+Av<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function zv(t,e,n,i,r){for(var o,a,s=t.data,l=t.len(),u=0,h=0,c=0,d=0,p=0,f=0;f1&&(n||(u+=Cv(h,c,d,p,i,r))),v&&(h=s[f],c=s[f+1],d=h,p=c),g){case Tv.M:d=s[f++],p=s[f++],h=d,c=p;break;case Tv.L:if(n){if(_v(h,c,s[f],s[f+1],e,i,r))return!0}else u+=Cv(h,c,s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.C:if(n){if(xv(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else u+=Ov(h,c,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.Q:if(n){if(bv(h,c,s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else u+=Nv(h,c,s[f++],s[f++],s[f],s[f+1],i,r)||0;h=s[f++],c=s[f++];break;case Tv.A:var y=s[f++],m=s[f++],_=s[f++],x=s[f++],b=s[f++],w=s[f++];f+=1;var S=!!(1-s[f++]);o=Math.cos(b)*_+y,a=Math.sin(b)*x+m,v?(d=o,p=a):u+=Cv(h,c,o,a,i,r);var M=(i-y)*x/_+y;if(n){if(Iv(y,m,x,b,b+w,S,e,M,r))return!0}else u+=Ev(y,m,x,b,b+w,S,M,r);h=Math.cos(b+w)*_+y,c=Math.sin(b+w)*x+m;break;case Tv.R:d=h=s[f++],p=c=s[f++];var I=s[f++],C=s[f++];if(o=d+I,a=p+C,n){if(_v(d,p,o,p,e,i,r)||_v(o,p,o,a,e,i,r)||_v(o,a,d,a,e,i,r)||_v(d,a,d,p,e,i,r))return!0}else u+=Cv(o,p,o,a,i,r),u+=Cv(d,a,d,p,i,r);break;case Tv.Z:if(n){if(_v(h,c,d,p,e,i,r))return!0}else u+=Cv(h,c,d,p,i,r);h=d,c=p;break}}return n||kv(c,p)||(u+=Cv(h,c,d,p,i,r)||0),0!==u}function Bv(t,e,n){return zv(t,0,!1,e,n)}function Vv(t,e,n,i){return zv(t,e,!0,n,i)}var Fv=As({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Dg),Gv={style:As({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},kg.style)},Hv=Jd.concat(["invisible","culling","z","z2","zlevel","parent"]),Wv=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Gd:e>.2?Wd:Hd}if(t)return Hd}return Gd},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(Us(e)){var n=this.__zr,i=!(!n||!n.isDarkMode()),r=Sc(t,0)0))},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||this.__dirty&dh)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),Vv(o,a/s,t,e)))return!0}if(this.hasFill())return Bv(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=dh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"===typeof t?n[t]=e:Ts(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&dh)},e.prototype.createStyle=function(t){return yl(Fv,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=Ts({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=Ts({},i.shape),Ts(s,n.shape)):(s=Ts({},r?this.shape:i.shape),Ts(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=Ts({},this.shape);for(var u={},h=Bs(s),c=0;c0},e.prototype.hasFill=function(){var t=this.style,e=t.fill;return null!=e&&"none"!==e},e.prototype.createStyle=function(t){return yl(Zv,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=rp(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(zg);Yv.prototype.type="tspan";const Xv=Yv;var jv=As({x:0,y:0},Dg),qv={style:As({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},kg.style)};function Kv(t){return!!(t&&"string"!==typeof t&&t.width&&t.height)}var $v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.createStyle=function(t){return yl(jv,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i=Kv(e.image)?e.image:this.__image;if(!i)return 0;var r="width"===t?"height":"width",o=e[r];return null==o?i[t]:i[t]/i[r]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return qv},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Gu(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(zg);$v.prototype.type="image";const Jv=$v;function Qv(t,e){var n,i,r,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"===typeof c?n=i=r=o=c:c instanceof Array?1===c.length?n=i=r=o=c[0]:2===c.length?(n=r=c[0],i=o=c[1]):3===c.length?(n=c[0],i=o=c[1],r=c[2]):(n=c[0],i=c[1],r=c[2],o=c[3]):n=i=r=o=0,n+i>u&&(a=n+i,n*=u/a,i*=u/a),r+o>u&&(a=r+o,r*=u/a,o*=u/a),i+r>h&&(a=i+r,i*=h/a,r*=h/a),n+o>h&&(a=n+o,n*=h/a,o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-i,l),0!==i&&t.arc(s+u-i,l+i,i,-Math.PI/2,0),t.lineTo(s+u,l+h-r),0!==r&&t.arc(s+u-r,l+h-r,r,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}var ty=Math.round;function ey(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(ty(2*i)===ty(2*r)&&(t.x1=t.x2=iy(i,s,!0)),ty(2*o)===ty(2*a)&&(t.y1=t.y2=iy(o,s,!0)),t):t}}function ny(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=iy(i,s,!0),t.y=iy(r,s,!0),t.width=Math.max(iy(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(iy(r+a,s,!1)-t.y,0===a?0:1),t):t}}function iy(t,e,n){if(!e)return t;var i=ty(2*t);return(i+ty(e))%2===0?i/2:(i+(n?1:-1))/2}var ry=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),oy={},ay=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new ry},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=ny(oy,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?Qv(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Uv);ay.prototype.type="rect";const sy=ay;var ly={fill:"#000"},uy=2,hy={style:As({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},kg.style)},cy=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ly,n.attr(e),n}return qa(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),T=r.calculatedLineHeight,A=0;A=0&&(A=x[T],"right"===A.align))this._placeToken(A,t,w,g,C,"right",y),S-=A.width,C-=A.width,T--;I+=(i-(I-f)-(v-C)-S)/2;while(M<=T)A=x[M],this._placeToken(A,t,w,g,I+A.width/2,"center",y),I+=A.width,M++;g+=w}},e.prototype._placeToken=function(t,e,n,i,r,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,u=i+n/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+n-t.height/2);var h=!t.isLineHolder&&My(s);h&&this._renderBackground(s,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,u-t.height/2,t.width,t.height);var c=!!s.backgroundColor,d=t.textPadding;d&&(r=wy(r,o,d),u-=t.height/2-d[0]-t.innerHeight/2);var p=this._getOrCreateChild(Xv),f=p.createStyle();p.useStyle(f);var g=this._defaultStyle,v=!1,y=0,m=by("fill"in s?s.fill:"fill"in e?e.fill:(v=!0,g.fill)),_=xy("stroke"in s?s.stroke:"stroke"in e?e.stroke:c||a||g.autoStroke&&!v?null:(y=uy,g.stroke)),x=s.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=r,f.y=u,x&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||is,f.opacity=il(s.opacity,e.opacity,1),vy(f,s),_&&(f.lineWidth=il(s.lineWidth,e.lineWidth,y),f.lineDash=nl(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=_),m&&(f.fill=m);var b=t.contentWidth,w=t.contentHeight;p.setBoundingRect(new Gu(op(f.x,b,f.textAlign),ap(f.y,w,f.textBaseline),b,w))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l=t.backgroundColor,u=t.borderWidth,h=t.borderColor,c=l&&l.image,d=l&&!c,p=t.borderRadius,f=this;if(d||t.lineHeight||u&&h){a=this._getOrCreateChild(sy),a.useStyle(a.createStyle()),a.style.fill=null;var g=a.shape;g.x=n,g.y=i,g.width=r,g.height=o,g.r=p,a.dirtyShape()}if(d){var v=a.style;v.fill=l||null,v.fillOpacity=nl(t.fillOpacity,1)}else if(c){s=this._getOrCreateChild(Jv),s.onload=function(){f.dirtyStyle()};var y=s.style;y.image=l.image,y.x=n,y.y=i,y.width=r,y.height=o}if(u&&h){v=a.style;v.lineWidth=u,v.stroke=h,v.strokeOpacity=nl(t.strokeOpacity,1),v.lineDash=t.borderDash,v.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(v.strokeFirst=!0,v.lineWidth*=2)}var m=(a||s).style;m.shadowBlur=t.shadowBlur||0,m.shadowColor=t.shadowColor||"transparent",m.shadowOffsetX=t.shadowOffsetX||0,m.shadowOffsetY=t.shadowOffsetY||0,m.opacity=il(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return yy(t)&&(e=[t.fontStyle,t.fontWeight,gy(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&sl(e)||t.textFont||t.font},e}(zg),dy={left:!0,right:1,center:1},py={top:1,bottom:1,middle:1},fy=["fontStyle","fontWeight","fontSize","fontFamily"];function gy(t){return"string"!==typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?es+"px":t+"px":t}function vy(t,e){for(var n=0;n=0,o=!1;if(t instanceof Uv){var a=ky(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(Uy(s)||Uy(l)){i=i||{};var u=i.style||{};"inherit"===u.fill?(o=!0,i=Ts({},i),u=Ts({},u),u.fill=s):!Uy(u.fill)&&Uy(s)?(o=!0,i=Ts({},i),u=Ts({},u),u.fill=Yy(s)):!Uy(u.stroke)&&Uy(l)&&(o||(i=Ts({},i),u=Ts({},u)),u.stroke=Yy(l)),i.style=u}}if(i&&null==i.z2){o||(i=Ts({},i));var h=t.z2EmphasisLift;i.z2=t.z2+(null!=h?h:zy)}return i}function om(t,e,n){if(n&&null==n.z2){n=Ts({},n);var i=t.z2SelectLift;n.z2=t.z2+(null!=i?i:By)}return n}function am(t,e,n){var i=Ds(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:im(t,["opacity"],e,{opacity:1});n=n||{};var a=n.style||{};return null==a.opacity&&(n=Ts({},n),a=Ts({opacity:i?r:.1*o.opacity},a),n.style=a),n}function sm(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return rm(this,t,e,n);if("blur"===t)return am(this,t,n);if("select"===t)return om(this,t,n)}return n}function lm(t){t.stateProxy=sm;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=sm),n&&(n.stateProxy=sm)}function um(t,e){!ym(t,e)&&!t.__highByOuter&&em(t,jy)}function hm(t,e){!ym(t,e)&&!t.__highByOuter&&em(t,qy)}function cm(t,e){t.__highByOuter|=1<<(e||0),em(t,jy)}function dm(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&em(t,qy)}function pm(t){em(t,Ky)}function fm(t){em(t,$y)}function gm(t){em(t,Jy)}function vm(t){em(t,Qy)}function ym(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function mm(t){var e=t.getModel(),n=[],i=[];e.eachComponent((function(e,r){var o=Ly(r),a="series"===e,s=a?t.getViewOfSeriesModel(r):t.getViewOfComponentModel(r);!a&&i.push(s),o.isBlured&&(s.group.traverse((function(t){$y(t)})),a&&n.push(r)),o.isBlured=!1})),Rs(i,(function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)}))}function _m(t,e,n,i){var r=i.getModel();function o(t,e){for(var n=0;n0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}}))})),e}function Am(t,e,n){Nm(t,!0),em(t,lm),Lm(t,e,n)}function Dm(t){Nm(t,!1)}function km(t,e,n,i){i?Dm(t):Am(t,e,n)}function Lm(t,e,n){var i=Cy(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var Pm=["emphasis","blur","select"],Rm={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Om(t,e,n,i){n=n||"itemStyle";for(var r=0;r0){var c=h.duration,d=h.delay,p=h.easing,f={duration:c,delay:d||0,easing:p,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,f):e.animateTo(n,f)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Zm(t,e,n,i,r,o){Um("update",t,e,n,i,r,o)}function Ym(t,e,n,i,r,o){Um("enter",t,e,n,i,r,o)}function Xm(t){if(!t.__zr)return!0;for(var e=0;e=0&&n.push(t)})),n}t.topologicalTravel=function(t,e,i,r){if(t.length){var o=n(e),a=o.graph,s=o.noEntryList,l={};Rs(t,(function(t){l[t]=!0}));while(s.length){var u=s.pop(),h=a[u],c=!!l[u];c&&(i.call(r,u,h.originalDeps.slice()),delete l[u]),Rs(h.successor,c?p:d)}Rs(l,(function(){var t="";throw new Error(t)}))}function d(t){a[t].entryCount--,0===a[t].entryCount&&s.push(t)}function p(t){l[t]=!0,d(t)}}}function R_(t,e){return Is(Is({},t,!0),e,!0)}const O_={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},N_={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},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:""}}}};var E_="ZH",z_="EN",B_=z_,V_={},F_={},G_=ts.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(E_)>-1?E_:B_}():B_;function H_(t,e){t=t.toUpperCase(),F_[t]=new A_(e),V_[t]=e}function W_(t){if(Us(t)){var e=V_[t.toUpperCase()]||{};return t===E_||t===z_?Ms(e):Is(Ms(e),Ms(V_[B_]),!1)}return Is(Ms(t),Ms(V_[B_]),!1)}function U_(t){return F_[t]}function Z_(){return F_[B_]}H_(z_,O_),H_(E_,N_);var Y_=1e3,X_=60*Y_,j_=60*X_,q_=24*j_,K_=365*q_,$_={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},J_="{yyyy}-{MM}-{dd}",Q_={year:"{yyyy}",month:"{yyyy}-{MM}",day:J_,hour:J_+" "+$_.hour,minute:J_+" "+$_.minute,second:J_+" "+$_.second,millisecond:$_.none},tx=["year","month","day","hour","minute","second","millisecond"],ex=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function nx(t,e){return t+="","0000".substr(0,e-t.length)+t}function ix(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function rx(t){return t===ix(t)}function ox(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function ax(t,e,n,i){var r=qp(t),o=r[hx(n)](),a=r[cx(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[dx(n)](),u=r["get"+(n?"UTC":"")+"Day"](),h=r[px(n)](),c=(h-1)%12+1,d=r[fx(n)](),p=r[gx(n)](),f=r[vx(n)](),g=i instanceof A_?i:U_(i||G_)||Z_(),v=g.getModel("time"),y=v.get("month"),m=v.get("monthAbbr"),_=v.get("dayOfWeek"),x=v.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,nx(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,m[a-1]).replace(/{MM}/g,nx(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,nx(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,_[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,nx(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,nx(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,nx(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,nx(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,nx(f,3)).replace(/{S}/g,f+"")}function sx(t,e,n,i,r){var o=null;if(Us(n))o=n;else if(Ws(n))o=n(t.value,e,{level:t.level});else{var a=Ts({},$_);if(t.level>0)for(var s=0;s=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(Hs(o)){var c=null==t.level?0:t.level>=0?t.level:o.length+t.level;c=Math.min(c,o.length-1),o=o[c]}}return ax(new Date(t.value),o,r,i)}function lx(t,e){var n=qp(t),i=n[cx(e)]()+1,r=n[dx(e)](),o=n[px(e)](),a=n[fx(e)](),s=n[gx(e)](),l=n[vx(e)](),u=0===l,h=u&&0===s,c=h&&0===a,d=c&&0===o,p=d&&1===r,f=p&&1===i;return f?"year":p?"month":d?"day":c?"hour":h?"minute":u?"second":"millisecond"}function ux(t,e,n){var i=Ys(t)?qp(t):t;switch(e=e||lx(t,n),e){case"year":return i[hx(n)]();case"half-year":return i[cx(n)]()>=6?1:0;case"quarter":return Math.floor((i[cx(n)]()+1)/4);case"month":return i[cx(n)]();case"day":return i[dx(n)]();case"half-day":return i[px(n)]()/24;case"hour":return i[px(n)]();case"minute":return i[fx(n)]();case"second":return i[gx(n)]();case"millisecond":return i[vx(n)]()}}function hx(t){return t?"getUTCFullYear":"getFullYear"}function cx(t){return t?"getUTCMonth":"getMonth"}function dx(t){return t?"getUTCDate":"getDate"}function px(t){return t?"getUTCHours":"getHours"}function fx(t){return t?"getUTCMinutes":"getMinutes"}function gx(t){return t?"getUTCSeconds":"getSeconds"}function vx(t){return t?"getUTCMilliseconds":"getMilliseconds"}function yx(t){return t?"setUTCFullYear":"setFullYear"}function mx(t){return t?"setUTCMonth":"setMonth"}function _x(t){return t?"setUTCDate":"setDate"}function xx(t){return t?"setUTCHours":"setHours"}function bx(t){return t?"setUTCMinutes":"setMinutes"}function Sx(t){return t?"setUTCSeconds":"setSeconds"}function Mx(t){return t?"setUTCMilliseconds":"setMilliseconds"}function Ix(t){if(!nf(t))return Us(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function Cx(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var Tx=ol;function Ax(t,e,n){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function r(t){return t&&sl(t)?t:"-"}function o(t){return!(null==t||isNaN(t)||!isFinite(t))}var a="time"===e,s=t instanceof Date;if(a||s){var l=a?qp(t):t;if(!isNaN(+l))return ax(l,i,n);if(s)return"-"}if("ordinal"===e)return Zs(t)?r(t):Ys(t)&&o(t)?t+"":"-";var u=ef(t);return o(u)?Ix(u):Zs(t)?r(t):"boolean"===typeof t?t+"":"-"}var Dx=["a","b","c","d","e","f","g"],kx=function(t,e){return"{"+t+(null==e?"":e)+"}"};function Lx(t,e,n){Hs(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o':'';var a=n.markerId||"markerX";return{renderMode:o,content:"{"+a+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function Ox(t,e){return e=e||"transparent",Us(t)?t:Xs(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Nx(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Ex=Rs,zx=["left","right","top","bottom","width","height"],Bx=[["width","left","right"],["height","top","bottom"]];function Vx(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var h,c,d=l.getBoundingRect(),p=e.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=d.width+(f?-f.x+d.x:0);h=o+g,h>i||l.newline?(o=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var v=d.height+(f?-f.y+d.y:0);c=a+v,c>r||l.newline?(o+=s+n,a=0,c=v,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)}))}var Fx=Vx;Gs(Vx,"vertical"),Gs(Vx,"horizontal");function Gx(t,e,n){var i=e.width,r=e.height,o=zp(t.left,i),a=zp(t.top,r),s=zp(t.right,i),l=zp(t.bottom,r);return(isNaN(o)||isNaN(parseFloat(t.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.right)))&&(s=i),(isNaN(a)||isNaN(parseFloat(t.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(t.bottom)))&&(l=r),n=Tx(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}function Hx(t,e,n){n=Tx(n||0);var i=e.width,r=e.height,o=zp(t.left,i),a=zp(t.top,r),s=zp(t.right,i),l=zp(t.bottom,r),u=zp(t.width,i),h=zp(t.height,r),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(h)&&(h=r-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>i/r?u=.8*i:h=.8*r),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-h-c),t.left||t.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d;break}switch(t.top||t.bottom){case"middle":case"center":a=r/2-h/2-n[0];break;case"bottom":a=r-h-c;break}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(h)&&(h=r-c-a-(l||0));var f=new Gu(o+n[3],a+n[0],u,h);return f.margin=n,f}function Wx(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if(o=o||t,o.x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new Gu(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();a=a.clone(),a.applyTransform(h)}var c=Hx(As({width:a.width,height:a.height},e),n,i),d=s?c.x-a.x:0,p=l?c.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===t&&t.markRedraw(),!0}function Ux(t,e){return null!=t[Bx[e][0]]||null!=t[Bx[e][1]]&&null!=t[Bx[e][2]]}function Zx(t){var e=t.layoutMode||t.constructor.layoutMode;return Xs(e)?e:e?{type:e}:null}function Yx(t,e,n){var i=n&&n.ignoreSize;!Hs(i)&&(i=[i,i]);var r=a(Bx[0],0),o=a(Bx[1],1);function a(n,r){var o={},a=0,u={},h=0,c=2;if(Ex(n,(function(e){u[e]=t[e]})),Ex(n,(function(t){s(e,t)&&(o[t]=u[t]=e[t]),l(o,t)&&a++,l(u,t)&&h++})),i[r])return l(e,n[1])?u[n[2]]=null:l(e,n[2])&&(u[n[1]]=null),u;if(h!==c&&a){if(a>=c)return o;for(var d=0;d=0;a--)o=Is(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Bf(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(A_);function $x(t){var e=[];return Rs(Kx.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=Os(e,(function(t){return Xf(t).main})),"dataset"!==t&&Ds(e,"dataset")<=0&&e.unshift("dataset"),e}Jf(Kx,A_),ig(Kx),L_(Kx),P_(Kx,$x);const Jx=Kx;var Qx="";"undefined"!==typeof navigator&&(Qx=navigator.platform||"");var tb="rgba(0, 0, 0, 0.2)";const eb={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:tb,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:tb,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:tb,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:tb,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:tb,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:tb,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Qx.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var nb=gl(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),ib="original",rb="arrayRows",ob="objectRows",ab="keyedColumns",sb="typedArray",lb="unknown",ub="column",hb="row",cb={Must:1,Might:2,Not:3},db=Pf();function pb(t){db(t).datasetMap=gl()}function fb(t,e,n){var i={},r=vb(e);if(!r||!t)return i;var o,a,s=[],l=[],u=e.ecModel,h=db(u).datasetMap,c=r.uid+"_"+n.seriesLayoutBy;t=t.slice(),Rs(t,(function(e,n){var r=Xs(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=f(r)),i[r.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function p(t,e,n){for(var i=0;ie)return t[i];return t[n-1]}function Lb(t,e,n,i,r,o,a){o=o||t;var s=e(o),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var h=null!=a&&i?kb(i,a):n;if(h=h||n,h&&h.length){var c=h[l];return r&&(u[r]=c),s.paletteIdx=(l+1)%h.length,c}}function Pb(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var Rb="\0_ec_inner",Ob=1;var Nb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new A_(i),this._locale=new A_(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=Fb(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Fb(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);0,this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):Ib(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&Rs(a,(function(t){n=!0,this._mergeOption(t,e)}),this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=gl(),s=e&&e.replaceMergeMainTypeMap;function l(e){var o=wb(this,e,hf(t[e])),a=i.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=gf(a,o,l);Af(u,e,Jx),n[e]=null,i.set(e,null),r.set(e,0);var h,c=[],d=[],p=0;Rs(u,(function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=Jx.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(h)return void 0;h=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=Ts({componentIndex:n},t.keyInfo);i=new a(r,this,this,s),Ts(i,s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(c.push(i.option),d.push(i),p++):(c.push(void 0),d.push(void 0))}),this),n[e]=c,i.set(e,d),r.set(e,p),"series"===e&&Sb(this)}pb(this),Rs(t,(function(t,e){null!=t&&(Jx.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?Ms(t):Is(n[e],t,!0))})),s&&s.each((function(t,e){Jx.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))})),Jx.topologicalTravel(o,Jx.getAllClassMainTypes(),l,this),this._seriesIndices||Sb(this)},e.prototype.getOption=function(){var t=Ms(this.option);return Rs(t,(function(e,n){if(Jx.hasClass(n)){for(var i=hf(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!Cf(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}})),delete t[Rb],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r=e:"max"===n?t<=e:t===e}function Qb(t,e){return t.join(",")===e.join(",")}const tw=qb;var ew=Rs,nw=Xs,iw=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function rw(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=iw.length;n=0;g--){var v=t[g];if(s||(d=v.data.rawIndexOf(v.stackedByDimension,c)),d>=0){var y=v.data.getByRawIndex(v.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=Up(p,y),f=y;break}}}return i[0]=p,i[1]=f,i}))}))}var Tw,Aw,Dw,kw,Lw,Pw=function(){function t(t){this.data=t.data||(t.sourceFormat===ab?{}:[]),this.sourceFormat=t.sourceFormat||lb,this.seriesLayoutBy=t.seriesLayoutBy||ub,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;nu&&(u=p)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}))}},t.prototype.getRawValue=function(t,e){return tS(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function iS(t){var e,n;return Xs(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function rS(t){return new oS(t)}var oS=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!i&&(o||d1&&i>0?s:a}};return o;function a(){return e=t?null:oe},gte:function(t,e){return t>=e}},pS=function(){function t(t,e){if(!Ys(e)){var n="";0,lS(n)}this._opFn=dS[t],this._rvalFloat=ef(e)}return t.prototype.evaluate=function(t){return Ys(t)?this._opFn(t,this._rvalFloat):this._opFn(ef(t),this._rvalFloat)},t}(),fS=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=Ys(t)?t:ef(t),i=Ys(e)?e:ef(e),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=Us(t),s=Us(e);a&&(n=s?t:0),s&&(i=a?e:0)}return ni?-this._resultLT:0},t}(),gS=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=ef(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=ef(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function vS(t,e){return"eq"===t||"ne"===t?new gS("eq"===t,e):_l(dS,t)?new pS(t,e):null}var yS=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return uS(t,e)},t}();function mS(t,e){var n=new yS,i=t.data,r=n.sourceFormat=t.sourceFormat,o=t.startIndex,a="";t.seriesLayoutBy!==ub&&lS(a);var s=[],l={},u=t.dimensionsDefine;if(u)Rs(u,(function(t,e){var n=t.name,i={index:e,name:n,displayName:t.displayName};if(s.push(i),null!=n){var r="";_l(l,n)&&lS(r),l[n]=i}}));else for(var h=0;h65535?kS:LS}function ES(){return[1/0,-1/0]}function zS(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function BS(t,e,n,i,r){var o=OS[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;ug[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=Os(o,(function(t){return t.property})),u=0;uv[1]&&(v[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e=0&&e=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&nt))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks,r=i[t],o=[];if(!r)return o;null==n&&(n=1/0);for(var a=1/0,s=-1,l=0,u=0,h=this.count();u=0&&s<0)&&(a=p,s=d,l=0),d===s&&(o[l++]=u))}return o.length=l,o},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r=h&&y<=c||isNaN(y))&&(s[l++]=f),f++}p=!0}else if(2===r){g=d[i[0]];var m=d[i[1]],_=t[i[1]][0],x=t[i[1]][1];for(v=0;v=h&&y<=c||isNaN(y))&&(b>=_&&b<=x||isNaN(b))&&(s[l++]=f),f++}p=!0}}if(!p)if(1===r)for(v=0;v=h&&y<=c||isNaN(y))&&(s[l++]=w)}else for(v=0;vt[I][1])&&(S=!1)}S&&(s[l++]=e.getRawIndex(v))}return lv[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks,s=a[t],l=this.count(),u=0,h=Math.floor(1/e),c=this.getRawIndex(0),d=new(NS(this._rawCount))(Math.min(2*(Math.ceil(l/h)+2),l));d[u++]=c;for(var p=1;pn&&(n=i,r=_))}C>0&&Cu-p&&(s=u-p,a.length=s);for(var f=0;fh[1]&&(h[1]=v),c[d++]=y}return r._count=d,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();rs&&(s=h)}return i=[a,s],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return uS(t[i],this._dimensions[i])}AS={arrayRows:t,objectRows:function(t,e,n,i){return uS(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return uS(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const FS=VS;var GS=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(WS(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var u=i[0];u.prepareSource(),l=u.getSource(),a=l.data,s=l.sourceFormat,e=[u._getVersionSign()]}else a=o.get("data",!0),s=qs(a)?sb:ib,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=nl(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=nl(h.sourceHeader,c.sourceHeader),f=nl(h.dimensions,c.dimensions),g=d!==c.seriesLayoutBy||!!p!==!!c.sourceHeader||f;t=g?[Ow(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var v=n;if(r){var y=this._applyTransform(i);t=y.sourceList,e=y.upstreamSignList}else{var m=v.get("source",!0);t=[Ow(m,this._getSourceMetaRawOption(),null)],e=[]}}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);if(null!=r){var o="";1!==t.length&&US(o)}var a=[],s=[];return Rs(t,(function(t){t.prepareSource();var e=t.getSource(r||0),n="";null==r||e||US(n),a.push(e),s.push(t._getVersionSign())})),i?e=IS(i,a,{datasetIndex:n.componentIndex}):null!=r&&(e=[Ew(a[0])]),{sourceList:e,upstreamSignList:s}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e1||n>0&&!t.noHeader;return Rs(t.blocks,(function(t){var n=JS(t);n>=e&&(e=n+ +(i&&(!n||KS(t)&&!t.noHeader)))})),e}return 0}function QS(t,e,n,i){var r=e.noHeader,o=nM(JS(e)),a=[],s=e.blocks||[];al(!s||Hs(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(_l(u,l)){var h=new fS(u[l],null);s.sort((function(t,e){return h.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===l&&s.reverse()}Rs(s,(function(n,r){var s=e.valueFormatter,l=$S(n)(s?Ts(Ts({},t),{valueFormatter:s}):t,n,r>0?o.html:0,i);null!=l&&a.push(l)}));var c="richText"===t.renderMode?a.join(o.richText):iM(a.join(""),r?n:o.html);if(r)return c;var d=Ax(e.header,"ordinal",t.useUTC),p=YS(i,t.renderMode).nameStyle;return"richText"===t.renderMode?aM(t,d,p)+o.richText+c:iM('
'+ru(d)+"
"+c,n)}function tM(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return t=Hs(t)?t:[t],Os(t,(function(t,e){return Ax(t,Hs(p)?p[e]:p,u)}))};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),d=o?"":Ax(l,"ordinal",u),p=e.valueType,f=a?[]:h(e.value),g=!s||!o,v=!s&&o,y=YS(i,r),m=y.nameStyle,_=y.valueStyle;return"richText"===r?(s?"":c)+(o?"":aM(t,d,m))+(a?"":sM(t,f,g,v,_)):iM((s?"":c)+(o?"":rM(d,!s,m))+(a?"":oM(f,g,v,_)),n)}}function eM(t,e,n,i,r,o){if(t){var a=$S(t),s={useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return a(s,t,0,o)}}function nM(t){return{html:XS[t],richText:jS[t]}}function iM(t,e){var n='
',i="margin: "+e+"px 0 0";return'
'+t+n+"
"}function rM(t,e,n){var i=e?"margin-left:2px":"";return''+ru(t)+""}function oM(t,e,n,i){var r=n?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=Hs(t)?t:[t],''+Os(t,(function(t){return ru(t)})).join("  ")+""}function aM(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function sM(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(Hs(e)?e.join(" "):e,o)}function lM(t,e){var n=t.getData().getItemVisual(e,"style"),i=n[t.visualDrawType];return Ox(i)}function uM(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var hM=function(){function t(){this.richTextStyles={},this._nextStyleNameId=rf()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=Rx({color:e,type:t,renderMode:n,markerId:i});return Us(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};Hs(e)?Rs(e,(function(t){return Ts(n,t)})):Ts(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function cM(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),d=Hs(c),p=lM(o,a);if(h>1||d&&!h){var f=dM(c,o,a,u,p);e=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);r=e=tS(l,a,u[0]),n=g.type}else r=e=d?c[0]:c;var v=If(o),y=v&&o.name||"",m=l.getName(a),_=s?y:m;return qS("section",{header:y,noHeader:s||!v,sortParam:r,blocks:[qS("nameValue",{markerType:"item",markerColor:p,name:_,noName:!sl(_),value:e,valueType:n})].concat(i||[])})}function dM(t,e,n,i,r){var o=e.getData(),a=Ns(t,(function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName}),!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(qS("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?Rs(i,(function(t){h(tS(o,n,t),t)})):Rs(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}var pM=Pf();function fM(t,e){return t.getName(e)||t.getId(e)}var gM="__universalTransitionEnabled",vM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return qa(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=rS({count:_M,reset:xM}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n);var i=pM(this).sourceManager=new GS(this);i.prepareSource();var r=this.getInitialData(t,n);wM(r,this),this.dataTask.context.data=r,pM(this).dataBeforeProcessed=r,yM(this),this._initSelectedMapFromData(r)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Zx(this),i=n?Xx(t):{},r=this.subType;Jx.hasClass(r)&&(r+="Series"),Is(t,e.getTheme().get(this.subType)),Is(t,this.getDefaultOption()),cf(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Yx(t,i,n)},e.prototype.mergeOption=function(t,e){t=Is(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Zx(this);n&&Yx(this.option,t,n);var i=pM(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);wM(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,pM(this).dataBeforeProcessed=r,yM(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!qs(t))for(var e=["show"],n=0;nthis.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=Ab.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[fM(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[gM])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){Xs(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Jx.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Jx);function yM(t){var e=t.name;If(t)||(t.name=mM(t)||e)}function mM(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return Rs(n,(function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)})),i.join(" ")}function _M(t){return t.model.getRawData().count()}function xM(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),bM}function bM(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function wM(t,e){Rs(vl(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(n){t.wrapMethod(n,Gs(SM,e))}))}function SM(t,e){var n=MM(t);return n&&n.setOutputEnd((e||this).count()),e}function MM(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}Ls(vM,nS),Ls(vM,Ab),Jf(vM,Jx);const IM=vM;var CM=function(){function t(){this.group=new Ip,this.uid=k_("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Kf(CM),ig(CM);const TM=CM;function AM(){var t=Pf();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}var DM=mv.CMD,kM=[[],[],[]],LM=Math.sqrt,PM=Math.atan2;function RM(t,e){if(e){var n,i,r,o,a,s,l=t.data,u=t.len(),h=DM.M,c=DM.C,d=DM.L,p=DM.R,f=DM.A,g=DM.Q;for(r=0,o=0;r1&&(a*=OM(f),s*=OM(f));var g=(r===o?-1:1)*OM((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,v=g*a*p/s,y=g*-s*d/a,m=(t+n)/2+EM(c)*v-NM(c)*y,_=(e+i)/2+NM(c)*v+EM(c)*y,x=FM([1,0],[(d-v)/a,(p-y)/s]),b=[(d-v)/a,(p-y)/s],w=[(-1*d-v)/a,(-1*p-y)/s],S=FM(b,w);if(VM(b,w)<=-1&&(S=zM),VM(b,w)>=1&&(S=0),S<0){var M=Math.round(S/zM*1e6)/1e6;S=2*zM+M%2*zM}h.addData(u,m,_,a,s,x,S,c,o)}var HM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,WM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function UM(t){var e=new mv;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=mv.CMD,l=t.match(HM);if(!l)return e;for(var u=0;uk*k+L*L&&(M=C,I=T),{cx:M,cy:I,x0:-h,y0:-c,x1:M*(r/b-1),y1:I*(r/b-1)}}function yI(t){var e;if(Hs(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}function mI(t,e){var n,i=dI(e.r,0),r=dI(e.r0||0,0),o=i>0,a=r>0;if(o||a){if(o||(i=r,r=0),r>i){var s=i;i=r,r=s}var l=e.startAngle,u=e.endAngle;if(!isNaN(l)&&!isNaN(u)){var h=e.cx,c=e.cy,d=!!e.clockwise,p=hI(u-l),f=p>oI&&p%oI;if(f>fI&&(p=f),i>fI)if(p>oI-fI)t.moveTo(h+i*sI(l),c+i*aI(l)),t.arc(h,c,i,l,u,!d),r>fI&&(t.moveTo(h+r*sI(u),c+r*aI(u)),t.arc(h,c,r,u,l,d));else{var g=void 0,v=void 0,y=void 0,m=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,M=void 0,I=void 0,C=void 0,T=void 0,A=void 0,D=void 0,k=void 0,L=i*sI(l),P=i*aI(l),R=r*sI(u),O=r*aI(u),N=p>fI;if(N){var E=e.cornerRadius;E&&(n=yI(E),g=n[0],v=n[1],y=n[2],m=n[3]);var z=hI(i-r)/2;if(_=pI(z,y),x=pI(z,m),b=pI(z,g),w=pI(z,v),I=S=dI(_,x),C=M=dI(b,w),(S>fI||M>fI)&&(T=i*sI(u),A=i*aI(u),D=r*sI(l),k=r*aI(l),pfI){var Z=pI(y,I),Y=pI(m,I),X=vI(D,k,L,P,i,Z,d),j=vI(T,A,R,O,i,Y,d);t.moveTo(h+X.cx+X.x0,c+X.cy+X.y0),I0&&t.arc(h+X.cx,c+X.cy,Z,uI(X.y0,X.x0),uI(X.y1,X.x1),!d),t.arc(h,c,i,uI(X.cy+X.y1,X.cx+X.x1),uI(j.cy+j.y1,j.cx+j.x1),!d),Y>0&&t.arc(h+j.cx,c+j.cy,Y,uI(j.y1,j.x1),uI(j.y0,j.x0),!d))}else t.moveTo(h+L,c+P),t.arc(h,c,i,l,u,!d);else t.moveTo(h+L,c+P);if(r>fI&&N)if(C>fI){Z=pI(g,C),Y=pI(v,C),X=vI(R,O,T,A,r,-Y,d),j=vI(L,P,D,k,r,-Z,d);t.lineTo(h+X.cx+X.x0,c+X.cy+X.y0),C0&&t.arc(h+X.cx,c+X.cy,Y,uI(X.y0,X.x0),uI(X.y1,X.x1),!d),t.arc(h,c,r,uI(X.cy+X.y1,X.cx+X.x1),uI(j.cy+j.y1,j.cx+j.x1),d),Z>0&&t.arc(h+j.cx,c+j.cy,Z,uI(j.y1,j.x1),uI(j.y0,j.x0),!d))}else t.lineTo(h+R,c+O),t.arc(h,c,r,u,l,d);else t.lineTo(h+R,c+O)}else t.moveTo(h,c);t.closePath()}}}var _I=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0}return t}(),xI=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new _I},e.prototype.buildPath=function(t,e){mI(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Uv);xI.prototype.type="sector";const bI=xI;var wI=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),SI=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new wI},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(Uv);SI.prototype.type="ring";const MI=SI;function II(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d=2){if(i){var o=II(r,i,n,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],h=r[(s+1)%a];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{t.moveTo(r[0][0],r[0][1]);s=1;for(var c=r.length;stC[1]){if(a=!1,r)return a;var u=Math.abs(tC[0]-QI[1]),h=Math.abs(QI[0]-tC[1]);Math.min(u,h)>i.len()&&(uMath.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function TC(t){return!t.isGroup}function AC(t){return null!=t.shape}function DC(t,e,n){if(t&&e){var i=r(t);e.traverse((function(t){if(TC(t)&&t.anid){var e=i[t.anid];if(e){var r=o(t);t.attr(o(e)),Zm(t,r,n,Cy(t).dataIndex)}}}))}function r(t){var e={};return t.traverse((function(t){TC(t)&&t.anid&&(e[t.anid]=t)})),e}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return AC(t)&&(e.shape=Ts({},t.shape)),e}}function kC(t,e){return Os(t,(function(t){var n=t[0];n=lC(n,e.x),n=uC(n,e.x+e.width);var i=t[1];return i=lC(i,e.y),i=uC(i,e.y+e.height),[n,i]}))}function LC(t,e){var n=lC(t.x,e.x),i=uC(t.x+t.width,e.x+e.width),r=lC(t.y,e.y),o=uC(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function PC(t,e,n){var i=Ts({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),As(r,n),new Jv(i)):vC(t.replace("path://",""),i,n,"center")}function RC(t,e,n,i,r){for(var o=0,a=r[r.length-1];o1)return!1;var v=NC(p,f,h,c)/d;return!(v<0||v>1)}function NC(t,e,n,i){return t*i-n*e}function EC(t){return t<=1e-6&&t>=-1e-6}function zC(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=Us(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&Rs(Bs(l),(function(t){_l(s,t)||(s[t]=l[t],s.$vars.push(t))}));var u=Cy(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:As({content:i,formatterParams:s},r)}}function BC(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function VC(t,e){if(t)if(Hs(t))for(var n=0;n=0?c():h=setTimeout(c,-r),l=i};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){s=t},d}function QC(t,e,n,i){var r=t[e];if(r){var o=r[qC]||r,a=r[$C],s=r[KC];if(s!==n||a!==i){if(null==n||!i)return t[e]=o;r=t[e]=JC(o,n,"debounce"===i),r[qC]=o,r[$C]=i,r[KC]=n}return r}}function tT(t,e){var n=t[e];n&&n[qC]&&(n.clear&&n.clear(),t[e]=n[qC])}var eT=Pf(),nT={itemStyle:rg(M_,!0),lineStyle:rg(b_,!0)},iT={lineStyle:"stroke",itemStyle:"fill"};function rT(t,e){var n=t.visualStyleMapper||nT[e];return n||(console.warn("Unknown style type '"+e+"'."),nT.itemStyle)}function oT(t,e){var n=t.visualDrawType||iT[e];return n||(console.warn("Unknown style type '"+e+"'."),"fill")}var aT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=rT(t,i),a=o(r),s=r.getShallow("decal");s&&(n.setVisual("decal",s),s.dirty=!0);var l=oT(t,i),u=a[l],h=Ws(u)?u:null,c="auto"===a.fill||"auto"===a.stroke;if(!a[l]||h||c){var d=t.getColorFromPalette(t.name,null,e.getSeriesCount());a[l]||(a[l]=d,n.setVisual("colorFromPalette",!0)),a.fill="auto"===a.fill||Ws(a.fill)?d:a.fill,a.stroke="auto"===a.stroke||Ws(a.stroke)?d:a.stroke}if(n.setVisual("style",a),n.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=Ts({},a);r[l]=h(i),e.setItemVisual(n,"style",r)}}}},sT=new A_,lT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=rT(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){sT.option=n[i];var a=r(sT),s=t.ensureUniqueItemVisual(e,"style");Ts(s,a),sT.option.decal&&(t.setItemVisual(e,"decal",sT.option.decal),sT.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},uT={performRawSeries:!0,overallReset:function(t){var e=gl();t.eachSeries((function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),eT(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=eT(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=oT(e,a);r.each((function(t){var e=r.getRawIndex(t);i[e]=t})),n.each((function(t){var a=i[t],l=r.getItemVisual(a,"colorFromPalette");if(l){var u=r.ensureUniqueItemVisual(a,"style"),h=n.getName(t)||t+"",c=n.count();u[s]=e.getColorFromPalette(h,o,c)}}))}}))}},hT=Math.PI;function cT(t,e){e=e||{},As(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ip,i=new sy({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new Iy({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new sy({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&(r=new UI({shape:{startAngle:-hT/2,endAngle:-hT/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),r.animateShape(!0).when(1e3,{endAngle:3*hT/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*hT/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}var dT=function(){function t(t,e,n,i){this._stageTaskMap=gl(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex,o=r?n.step:null,a=i&&i.modDataCount,s=null!=a?Math.ceil(a/o):null;return{step:o,modBy:s,modDataCount:a}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData(),r=i.count(),o=n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,a=t.get("large")&&r>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?r:null;t.pipelineContext=n.context={progressiveRender:o,modDataCount:s,large:a}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=gl();t.eachSeries((function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;Rs(this._allHandlers,(function(i){var r=t.get(i.uid)||t.set(i.uid,{}),o="";al(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)}),this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}Rs(t,(function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(t){a(i,t)&&(t.dirty(),c=!0)})),c&&h.dirty(),o.updatePayload(h,n);var p=o.getPerformArgs(h,i.block);d.each((function(t){t.perform(p)})),h.perform(p)&&(r=!0)}else u&&u.each((function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=gl(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||rS({plan:yT,reset:mT,count:bT}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||rS({reset:pT});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=gl(),l=t.seriesType,u=t.getTargetSeries,h=!0,c=!1,d="";function p(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,rS({reset:fT,onDirty:vT})));n.context={model:t,overallProgress:h},n.agent=o,n.__block=h,r._pipe(t,n)}al(!t.createOnAllSeries,d),l?n.eachRawSeriesByType(l,p):u?u(n,i).each(p):(h=!1,Rs(n.getSeries(),p)),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return Ws(t)&&(t={overallReset:t,seriesType:wT(t)}),t.uid=k_("stageHandler"),e&&(t.visualType=e),t},t}();function pT(t){t.overallReset(t.ecModel,t.api,t.payload)}function fT(t){return t.overallProgress&&gT}function gT(){this.agent.dirty(),this.getDownstream().dirty()}function vT(){this.agent&&this.agent.dirty()}function yT(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function mT(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=hf(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?Os(e,(function(t,e){return xT(e)})):_T}var _T=xT(0);function xT(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o0&&h===r.length-u.length){var c=r.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)}))}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function u(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),zT=["symbol","symbolSize","symbolRotate","symbolOffset"],BT=zT.concat(["symbolKeepAspect"]),VT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a=0&&hA(l)?l:.5;var u=t.createRadialGradient(a,s,0,a,s,l);return u}function pA(t,e,n){for(var i="radial"===e.type?dA(t,e,n):cA(t,e,n),r=e.colorStops,o=0;o0?"dashed"===t?[4*e,2*e]:"dotted"===t?[e]:Ys(t)?[t]:Hs(t)?t:null:null}function mA(t){var e=t.style,n=e.lineDash&&e.lineWidth>0&&yA(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(n){var r=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;r&&1!==r&&(n=Os(n,(function(t){return t/r})),i/=r)}return[n,i]}var _A=new mv(!0);function xA(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function bA(t){return"string"===typeof t&&"none"!==t}function wA(t){var e=t.fill;return null!=e&&"none"!==e}function SA(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function MA(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function IA(t,e,n){var i=hg(e.image,e.__image,n);if(dg(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"===typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*bl),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}function CA(t,e,n,i){var r,o=xA(n),a=wA(n),s=n.strokePercent,l=s<1,u=!e.path;e.silent&&!l||!u||e.createPathProxy();var h=e.path||_A,c=e.__dirty;if(!i){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,v=a&&!!d.image,y=o&&!!p.image,m=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=e.getBoundingRect()),f&&(m=c?pA(t,d,w):e.__canvasFillGradient,e.__canvasFillGradient=m),g&&(_=c?pA(t,p,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),v&&(x=c||!e.__canvasFillPattern?IA(t,d,e):e.__canvasFillPattern,e.__canvasFillPattern=x),y&&(b=c||!e.__canvasStrokePattern?IA(t,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),f?t.fillStyle=m:v&&(x?t.fillStyle=x:a=!1),g?t.strokeStyle=_:y&&(b?t.strokeStyle=b:o=!1)}var S,M,I=e.getGlobalScale();h.setScale(I[0],I[1],e.segmentIgnoreThreshold),t.setLineDash&&n.lineDash&&(r=mA(e),S=r[0],M=r[1]);var C=!0;(u||c&dh)&&(h.setDPR(t.dpr),l?h.setContext(null):(h.setContext(t),C=!1),h.reset(),e.buildPath(h,e.shape,i),h.toStatic(),e.pathUpdated()),C&&h.rebuildPath(t,l?s:1),S&&(t.setLineDash(S),t.lineDashOffset=M),i||(n.strokeFirst?(o&&MA(t,n),a&&SA(t,n)):(a&&SA(t,n),o&&MA(t,n))),S&&t.setLineDash([])}function TA(t,e,n){var i=e.__image=hg(n.image,e.__image,e,e.onload);if(i&&dg(i)){var r=n.x||0,o=n.y||0,a=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,h=n.sy||0;t.drawImage(i,u,h,n.sWidth,n.sHeight,r,o,a,s)}else if(n.sx&&n.sy){u=n.sx,h=n.sy;var c=a-u,d=s-h;t.drawImage(i,u,h,c,d,r,o,a,s)}else t.drawImage(i,r,o,a,s)}}function AA(t,e,n){var i,r=n.text;if(null!=r&&(r+=""),r){t.font=n.font||is,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var o=void 0,a=void 0;t.setLineDash&&n.lineDash&&(i=mA(e),o=i[0],a=i[1]),o&&(t.setLineDash(o),t.lineDashOffset=a),n.strokeFirst?(xA(n)&&t.strokeText(r,n.x,n.y),wA(n)&&t.fillText(r,n.x,n.y)):(wA(n)&&t.fillText(r,n.x,n.y),xA(n)&&t.strokeText(r,n.x,n.y)),o&&t.setLineDash([])}}var DA=["shadowBlur","shadowOffsetX","shadowOffsetY"],kA=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function LA(t,e,n,i,r){var o=!1;if(!i&&(n=n||{},e===n))return!1;if(i||e.opacity!==n.opacity){HA(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?Dg.opacity:a}(i||e.blend!==n.blend)&&(o||(HA(t,r),o=!0),t.globalCompositeOperation=e.blend||Dg.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this[ID])if(this._disposed)ok(this.id);else{var i,r,o;if(Xs(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[ID]=!0,!this._model||e){var a=new tw(this._api),s=this._theme,l=this._model=new Gb;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},uk);var u={seriesTransition:o,optionChanged:!0};if(n)this[CD]={silent:i,updateParams:u},this[ID]=!1,this.getZr().wakeUp();else{try{ED(this),VD.update.call(this,null,u)}catch(fI){throw this[CD]=null,this[ID]=!1,fI}this._ssr||this._zr.flush(),this[CD]=null,this[ID]=!1,WD.call(this,i),UD.call(this,i)}}},e.prototype.setTheme=function(){sS("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ts.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;return e.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(ts.svgSupported){var t=this._zr,e=t.storage.getDisplayList();return Rs(e,(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){t=t||{};var e=t.excludeComponents,n=this._model,i=[],r=this;Rs(e,(function(t){n.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Rs(i,(function(t){t.group.ignore=!1})),o}ok(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(fk[n]){var a=o,s=o,l=-o,u=-o,h=[],c=t&&t.pixelRatio||this.getDevicePixelRatio();Rs(pk,(function(o,c){if(o.group===n){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(Ms(t)),p=o.getDom().getBoundingClientRect();a=i(p.left,a),s=i(p.top,s),l=r(p.right,l),u=r(p.bottom,u),h.push({dom:d,left:p.left,top:p.top})}})),a*=c,s*=c,l*=c,u*=c;var d=l-a,p=u-s,f=us.createCanvas(),g=Lp(f,{renderer:e?"svg":"canvas"});if(g.resize({width:d,height:p}),e){var v="";return Rs(h,(function(t){var e=t.left-a,n=t.top-s;v+=''+t.dom+""})),g.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new sy({shape:{x:0,y:0,width:d,height:p},style:{fill:t.connectedBackgroundColor}})),Rs(h,(function(t){var e=new Jv({style:{x:t.left*c-a,y:t.top*c-s,image:t.dom}});g.add(e)})),g.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}ok(this.id)},e.prototype.convertToPixel=function(t,e){return FD(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return FD(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){if(!this._disposed){var n,i=this._model,r=Of(i,t);return Rs(r,(function(t,i){i.indexOf("Models")>=0&&Rs(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}else 0}),this)}),this),!!n}ok(this.id)},e.prototype.getVisual=function(t,e){var n=this._model,i=Of(n,t,{defaultMainType:"series"}),r=i.seriesModel;var o=r.getData(),a=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?o.indexOfRawIndex(i.dataIndex):null;return null!=a?GT(o,a,e):HT(o,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;Rs(rk,(function(e){var n=function(n){var i,r=t.getModel(),o=n.target,a="globalout"===e;if(a?i={}:o&&XT(o,(function(t){var e=Cy(t);if(e&&null!=e.dataIndex){var n=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return i=Ts({},e.eventData),!0}),!0),i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&r.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];0,i.event=n,i.type=e,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:i,model:u,view:h},t.trigger(e,i)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)})),Rs(sk,(function(e,n){t._messageCenter.on(n,(function(t){this.trigger(n,t)}),t)})),Rs(["selectchanged"],(function(e){t._messageCenter.on(e,(function(t){this.trigger(e,t)}),t)})),YT(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?ok(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)ok(this.id);else{this._disposed=!0;var t=this.getDom();t&&Vf(this.getDom(),vk,"");var e=this,n=e._api,i=e._model;Rs(e._componentsViews,(function(t){t.dispose(i,n)})),Rs(e._chartsViews,(function(t){t.dispose(i,n)})),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete pk[e.id]}},e.prototype.resize=function(t){if(!this[ID])if(this._disposed)ok(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[CD]&&(null==i&&(i=this[CD].silent),n=!0,this[CD]=null),this[ID]=!0;try{n&&ED(this),VD.update.call(this,{type:"resize",animation:Ts({duration:0},t&&t.animation)})}catch(fI){throw this[ID]=!1,fI}this[ID]=!1,WD.call(this,i),UD.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)ok(this.id);else if(Xs(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),dk[t]){var n=dk[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?ok(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=Ts({},t);return e.type=sk[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)ok(this.id);else if(Xs(e)||(e={silent:!!e}),ak[t.type]&&this._model)if(this[ID])this._pendingActions.push(t);else{var n=e.silent;HD.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&ts.browser.weChat&&this._throttledZrFlush(),WD.call(this,n),UD.call(this,n)}},e.prototype.updateLabelLayout=function(){rD.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)ok(this.id);else{var e=t.seriesIndex,n=this.getModel(),i=n.getSeriesByIndex(e);0,i.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){var e=[],n=[],i=!1;if(t.eachComponent((function(t,r){var o=r.get("zlevel")||0,a=r.get("z")||0,s=r.getZLevelKey();i=i||!!s,("series"===t?n:e).push({zlevel:o,z:a,idx:r.componentIndex,type:t,key:s})})),i){var r,o,a=e.concat(n);uh(a,(function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel})),Rs(a,(function(e){var n=t.getComponent(e.type,e.idx),i=e.zlevel,a=e.key;null!=r&&(i=Math.max(r,i)),a?(i===r&&a!==o&&i++,o=a):o&&(i===r&&i++,o=""),r=i,n.setZLevel(i)}))}}function n(t){for(var e=[],n=t.currentStates,i=0;ie.get("hoverLayerThreshold")&&!ts.node&&!ts.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}function r(t,e){var n=t.get("blendMode")||null;e.eachRendered((function(t){t.isGroup||(t.style.blend=n)}))}function o(t,e){if(!t.preventAutoZ){var n=t.get("z")||0,i=t.get("zlevel")||0;e.eachRendered((function(t){return a(t,n,i,-1/0),!0}))}}function a(t,e,n,i){var r=t.getTextContent(),o=t.getTextGuideLine(),s=t.isGroup;if(s)for(var l=t.childrenRef(),u=0;u0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;e.eachRendered((function(t){if(t.states&&t.states.emphasis){if(Xm(t))return;if(t instanceof Uv&&Gm(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&n(t)}}))}ED=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),zD(t,!0),zD(t,!1),e.plan()},zD=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l=0)){Dk.push(n);var o=TT.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function Lk(t,e){dk[t]=e}function Pk(t,e,n){var i=sD("registerMap");i&&i(t,e,n)}var Rk=MS;Ak(vD,aT),Ak(_D,lT),Ak(_D,uT),Ak(vD,VT),Ak(_D,FT),Ak(SD,nD),xk(Mw),bk(hD,Iw),Lk("default",cT),Ik({type:Vy,event:Vy,update:Vy},xl),Ik({type:Fy,event:Fy,update:Fy},xl),Ik({type:Gy,event:Gy,update:Gy},xl),Ik({type:Hy,event:Hy,update:Hy},xl),Ik({type:Wy,event:Wy,update:Wy},xl),_k("light",DT),_k("dark",NT);var Ok=[],Nk={registerPreprocessor:xk,registerProcessor:bk,registerPostInit:wk,registerPostUpdate:Sk,registerUpdateLifecycle:Mk,registerAction:Ik,registerCoordinateSystem:Ck,registerLayout:Tk,registerVisual:Ak,registerTransform:Rk,registerLoading:Lk,registerMap:Pk,registerImpl:aD,PRIORITY:MD,ComponentModel:Jx,ComponentView:TM,SeriesModel:IM,ChartView:jC,registerComponentModel:function(t){Jx.registerClass(t)},registerComponentView:function(t){TM.registerClass(t)},registerSeriesModel:function(t){IM.registerClass(t)},registerChartView:function(t){jC.registerClass(t)},registerSubTypeDefaulter:function(t,e){Jx.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Pp(t,e)}};function Ek(t){Hs(t)?Rs(t,(function(t){Ek(t)})):Ds(Ok,t)>=0||(Ok.push(t),Ws(t)&&(t={install:t}),t.install(Nk))}var zk=2*Math.PI,Bk=mv.CMD,Vk=["top","right","bottom","left"];function Fk(t,e,n,i,r){var o=n.width,a=n.height;switch(t){case"top":i.set(n.x+o/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+o/2,n.y+a+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),r.set(-1,0);break;case"right":i.set(n.x+o+e,n.y+a/2),r.set(1,0);break}}function Gk(t,e,n,i,r,o,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s);a/=u,s/=u;var h=a*n+t,c=s*n+e;if(Math.abs(i-r)%zk<1e-4)return l[0]=h,l[1]=c,u-n;if(o){var d=i;i=Sv(r),r=Sv(d)}else i=Sv(i),r=Sv(r);i>r&&(r+=zk);var p=Math.atan2(s,a);if(p<0&&(p+=zk),p>=i&&p<=r||p+zk>=i&&p+zk<=r)return l[0]=h,l[1]=c,u-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,v=n*Math.cos(r)+t,y=n*Math.sin(r)+e,m=(f-a)*(f-a)+(g-s)*(g-s),_=(v-a)*(v-a)+(y-s)*(y-s);return m<_?(l[0]=f,l[1]=g,Math.sqrt(m)):(l[0]=v,l[1]=y,Math.sqrt(_))}function Hk(t,e,n,i,r,o,a,s){var l=r-t,u=o-e,h=n-t,c=i-e,d=Math.sqrt(h*h+c*c);h/=d,c/=d;var p=l*h+u*c,f=p/d;s&&(f=Math.min(Math.max(f,0),1)),f*=d;var g=a[0]=t+f*h,v=a[1]=e+f*c;return Math.sqrt((g-r)*(g-r)+(v-o)*(v-o))}function Wk(t,e,n,i,r,o,a){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,u=a[0]=Math.min(Math.max(r,t),s),h=a[1]=Math.min(Math.max(o,e),l);return Math.sqrt((u-r)*(u-r)+(h-o)*(h-o))}var Uk=[];function Zk(t,e,n){var i=Wk(e.x,e.y,e.width,e.height,t.x,t.y,Uk);return n.set(Uk[0],Uk[1]),i}function Yk(t,e,n){for(var i,r,o=0,a=0,s=0,l=0,u=1/0,h=e.data,c=t.x,d=t.y,p=0;p0){e=e/180*Math.PI,Xk.fromArray(t[0]),jk.fromArray(t[1]),qk.fromArray(t[2]),Lu.sub(Kk,Xk,jk),Lu.sub($k,qk,jk);var n=Kk.len(),i=$k.len();if(!(n<.001||i<.001)){Kk.scale(1/n),$k.scale(1/i);var r=Kk.dot($k),o=Math.cos(e);if(o1&&Lu.copy(tL,qk),tL.toArray(t[1])}}}}function nL(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,Xk.fromArray(t[0]),jk.fromArray(t[1]),qk.fromArray(t[2]),Lu.sub(Kk,jk,Xk),Lu.sub($k,qk,jk);var i=Kk.len(),r=$k.len();if(!(i<.001||r<.001)){Kk.scale(1/i),$k.scale(1/r);var o=Kk.dot(e),a=Math.cos(n);if(o=l)Lu.copy(tL,qk);else{tL.scaleAndAdd($k,s/Math.tan(Math.PI/2-h));var c=qk.x!==jk.x?(tL.x-jk.x)/(qk.x-jk.x):(tL.y-jk.y)/(qk.y-jk.y);if(isNaN(c))return;c<0?Lu.copy(tL,jk):c>1&&Lu.copy(tL,qk)}tL.toArray(t[1])}}}}function iL(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function rL(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=Ol(i[0],i[1]),o=Ol(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=zl([],i[1],i[0],a/r),l=zl([],i[1],i[2],a/o),u=zl([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var h=1;h0&&o&&w(-c/a,0,a);var v,y,m=t[0],_=t[a-1];return x(),v<0&&S(-v,.8),y<0&&S(y,.8),x(),b(v,y,1),b(y,v,-1),x(),v<0&&M(-v),y<0&&M(y),u}function x(){v=m.rect[e]-i,y=r-_.rect[e]-_.rect[n]}function b(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){w(i*n,0,a);var r=i+t;r<0&&S(-r*n,1)}else S(-t*n,1)}}function w(n,i,r){0!==n&&(u=!0);for(var o=i;o0)for(l=0;l0;l--){d=o[l-1]*c;w(-d,l,a)}}}function M(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i0?w(n,0,i+1):w(-n,a-i-1,a),t-=n,t<=0)return}}function uL(t,e,n,i){return lL(t,"x","width",e,n,i)}function hL(t,e,n,i){return lL(t,"y","height",e,n,i)}function cL(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var n=new Gu(0,0,0,0);function i(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r=0&&n.attr(r.oldLayoutSelect),Ds(h,"emphasis")>=0&&n.attr(r.oldLayoutEmphasis)),Zm(n,l,e,s)}else if(n.attr(l),!p_(n).valueAnimation){var c=nl(n.style.opacity,1);n.style.opacity=0,Ym(n,{style:{opacity:c}},e,s)}if(r.oldLayout=l,n.states.select){var d=r.oldLayoutSelect={};mL(d,l,_L),mL(d,n.states.select,_L)}if(n.states.emphasis){var p=r.oldLayoutEmphasis={};mL(p,l,_L),mL(p,n.states.emphasis,_L)}g_(n,s,u,e,e)}if(i&&!i.ignore&&!i.invisible){r=yL(i),o=r.oldLayout;var f={points:i.shape.points};o?(i.attr({shape:o}),Zm(i,{shape:f},e)):(i.setShape(f),i.style.strokePercent=0,Ym(i,{style:{strokePercent:1}},e)),r.oldLayout=f}},t}();const bL=xL;var wL=Pf();function SL(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){var i=wL(e).labelManager;i||(i=wL(e).labelManager=new bL),i.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,n){var i=wL(e).labelManager;n.updatedSeries.forEach((function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()}))}function ML(t,e,n){var i=us.createCanvas(),r=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=o*n,i}Ek(SL);var IL=function(t){function e(e,n,i){var r,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,i=i||Vd,"string"===typeof e?r=ML(e,n,i):Xs(e)&&(r=e,e=r.id),o.id=e,o.dom=r;var a=r.style;return a&&(ml(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return qa(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=ML("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],a=this.maxRepaintRectCount,s=!1,l=new Gu(0,0,0,0);function u(t){if(t.isFinite()&&!t.isZero())if(0===o.length){var e=new Gu(0,0,0,0);e.copy(t),o.push(e)}else{for(var n=!1,i=1/0,r=0,u=0;u=a)}}for(var h=this.__startIndex;h15)break}}n.prevElClipPaths&&c.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=d.dpr,b=0;b0&&t>i[0]){for(s=0;st)break;a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i0?DL:0),this._needsManuallyCompositing),u.__builtin__||Ss("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==o&&(u.__dirty=!0),u.__startIndex=o,u.incremental?u.__drawIndex=-1:u.__drawIndex=o,e(o),a=u),i.__dirty&hh&&!i.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=o))}e(o),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,Rs(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?Is(n[t],e,!0):n[t]=e;for(var i=0;i=VL:-l>=VL),d=l>0?l%VL:l%VL+VL,p=!1;p=!!c||!Tc(h)&&d>=BL===!!u;var f=t+n*zL(o),g=e+i*EL(o);this._start&&this._add("M",f,g);var v=Math.round(r*FL);if(c){var y=1/this._p,m=(u?1:-1)*(VL-y);this._add("A",n,i,v,1,+u,t+n*zL(o+m),e+i*EL(o+m)),y>.01&&this._add("A",n,i,v,0,+u,f,g)}else{var _=t+n*zL(a),x=e+i*EL(a);this._add("A",n,i,v,+p,+u,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var u=[],h=this._p,c=1;c"}function iP(t){return""}function rP(t,e){e=e||{};var n=e.newline?"\n":"";function i(t){var e=t.children,r=t.tag,o=t.attrs,a=t.text;return nP(r,o)+("style"!==r?ru(a):a||"")+(e?""+n+Os(e,(function(t){return i(t)})).join(n)+n:"")+iP(r)}return i(t)}function oP(t,e,n){n=n||{};var i=n.newline?"\n":"",r=" {"+i,o=i+"}",a=Os(Bs(t),(function(e){return e+r+Os(Bs(t[e]),(function(n){return n+":"+t[e][n]+";"})).join(i)+o})).join(i),s=Os(Bs(e),(function(t){return"@keyframes "+t+r+Os(Bs(e[t]),(function(n){return n+r+Os(Bs(e[t][n]),(function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"})).join(i)+o})).join(i)+o})).join(i);return a||s?[""].join(i):""}function aP(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function sP(t,e,n,i){return eP("svg","root",{width:t,height:e,xmlns:KL,"xmlns:xlink":$L,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var lP={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},uP="transform-origin";function hP(t,e,n){var i=Ts({},t.shape);Ts(i,e),t.buildPath(n,i);var r=new HL;return r.reset(Hc(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function cP(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[uP]=n+"px "+i+"px")}var dP={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function pP(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function fP(t,e,n){var i,r,o=t.shape.paths,a={};if(Rs(o,(function(t){var e=aP(n.zrId);e.animation=!0,vP(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=Bs(o),u=l.length;if(u){r=l[u-1];var h=o[r];for(var c in h){var d=h[c];a[c]=a[c]||{d:""},a[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(r)>=0&&(i=f)}}})),i){e.d=!1;var s=pP(a,n);return i.replace(r,s)}}function gP(t){return Us(t)?lP[t]?"cubic-bezier("+lP[t]+")":jh(t)?t:"":""}function vP(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof YI){var s=fP(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u0})).length){var D=pP(h,n);return D+" "+r[0]+" both"}}for(var v in l){s=g(l[v]);s&&a.push(s)}if(a.length){var y=n.zrId+"-cls-"+n.cssClassIdx++;n.cssNodes["."+y]={animation:a.join(",")},e["class"]=y}}var yP=Math.round;function mP(t){return t&&Us(t.src)}function _P(t){return t&&Ws(t.toDataURL)}function xP(t,e,n,i){qL((function(r,o){var a="fill"===r||"stroke"===r;a&&Fc(o)?OP(e,t,r,i):a&&zc(o)?NP(n,t,r,i):t[r]=o}),e,n,!1),RP(n,t,i)}function bP(t){return Tc(t[0]-1)&&Tc(t[1])&&Tc(t[2])&&Tc(t[3]-1)}function wP(t){return Tc(t[4])&&Tc(t[5])}function SP(t,e,n){if(e&&(!wP(e)||!bP(e))){var i=n?10:1e4;t.transform=bP(e)?"translate("+yP(e[4]*i)/i+" "+yP(e[5]*i)/i+")":kc(e)}}function MP(t,e,n){for(var i=t.points,r=[],o=0;ou?(a=null==n[d+1]?null:n[d+1].elm,JP(t,a,n,l,d)):QP(t,e,s,u))}function nR(t,e){var n=e.elm=t.elm,i=t.children,r=e.children;t!==e&&(tR(t,e),XP(e.text)?jP(i)&&jP(r)?i!==r&&eR(n,i,r):jP(r)?(jP(t.text)&&WP(n,""),JP(n,null,r,0,r.length-1)):jP(i)?QP(n,i,0,i.length-1):jP(t.text)&&WP(n,""):t.text!==e.text&&(jP(i)&&QP(n,i,0,i.length-1),WP(n,e.text)))}function iR(t,e){if(KP(t,e))nR(t,e);else{var n=t.elm,i=GP(n);$P(e),null!==i&&(BP(i,e.elm,HP(n)),QP(i,[t],0,0))}return e}var rR=0,oR=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=aR("refreshHover"),this.configLayer=aR("configLayer"),this.storage=e,this._opts=n=Ts({},n),this.root=t,this._id="zr"+rR++,this._oldVNode=sP(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=tP("svg");tR(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",iR(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return PP(t,aP(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,i=this._height,r=aP(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress;var o=[],a=this._bgVNode=sR(n,i,this._backgroundColor,r);a&&o.push(a);var s=t.compress?null:this._mainVNode=eP("g","main",{},[]);this._paintList(e,r,s?s.children:o),s&&o.push(s);var l=Os(Bs(r.defs),(function(t){return r.defs[t]}));if(l.length&&o.push(eP("defs","defs",{},l)),t.animation){var u=oP(r.cssNodes,r.cssAnims,{newline:!0});if(u){var h=eP("style","stl",{},[],u);o.push(h)}}return sP(n,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},rP(this.renderToVNode({animation:nl(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:nl(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,u=0;u=0;f--)if(c&&r&&c[f]===r[f])break;for(var g=p-1;g>f;g--)s--,i=a[s-1];for(var v=f+1;v1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),i[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(h>1)for(var d=0;d1)for(var a=0;a30}var AR,DR,kR,LR,PR,RR,OR,NR=Xs,ER=Os,zR="undefined"===typeof Int32Array?Array:Int32Array,BR="e\0\0",VR=-1,FR=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],GR=["_approximateExtent"],HR=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i=!1;MR(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u=e)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var r=this._nameList,o=this._idList,a=i.getSource().sourceFormat,s=a===ib;if(s&&!i.pure)for(var l=[],u=t;u0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(r=this.getVisual(e),Hs(r)?r=r.slice():NR(r)&&(r=Ts({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,NR(e)?Ts(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){NR(t)?Ts(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?Ts(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;Ty(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){Rs(this._graphicEls,(function(n,i){n&&t&&t.call(e,n,i)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:ER(this.dimensions,this._getDimInfo,this),this.hostModel)),PR(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];Ws(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(rl(arguments)))})},t.internalField=function(){AR=function(t){var e=t._invertedIndicesMap;Rs(e,(function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new zR(o.categories.length);for(var s=0;s1&&(s+="__ec__"+u),i[e]=s}}}(),t}();const WR=HR;function UR(t,e){Rw(t)||(t=Nw(t)),e=e||{};var n=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=gl(),o=[],a=YR(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&TR(a),l=i===t.dimensionsDefine,u=l?CR(t):IR(i),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=gl(h),d=new PS(a),p=0;p0&&(i.name=r+(o-1)),o++,e.set(r,o)}}function YR(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return Rs(e,(function(t){var e;Xs(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}function XR(t,e,n){if(n||e.hasKey(t)){var i=0;while(e.hasKey(t+i))i++;t+=i}return e.set(t,!0),t}var jR=function(){function t(t){this.coordSysDims=[],this.axisMap=gl(),this.categoryAxisMap=gl(),this.coordSysName=t}return t}();function qR(t){var e=t.get("coordinateSystem"),n=new jR(e),i=KR[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}var KR={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",Ef).models[0],o=t.getReferringComponents("yAxis",Ef).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),$R(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),$R(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",Ef).models[0];e.coordSysDims=["single"],n.set("single",r),$R(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",Ef).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),$R(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),$R(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();Rs(o.parallelAxisIndex,(function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),$R(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function $R(t){return"category"===t.get("type")}function JR(t,e,n){n=n||{};var i,r,o,a=n.byIndex,s=n.stackedCoordDimension;QR(e)?i=e:(r=e.schema,i=r.dimensions,o=e.store);var l,u,h,c,d=!(!t||!t.get("stack"));if(Rs(i,(function(t,e){Us(t)&&(i[e]=t={name:t}),d&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(u=t))})),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,f=u.type,g=0;Rs(i,(function(t){t.coordDim===p&&g++}));var v={name:h,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:c,coordDim:c,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(v.storeDimIndex=o.ensureCalculationDimension(c,f),y.storeDimIndex=o.ensureCalculationDimension(h,f)),r.appendCalculationDimension(v),r.appendCalculationDimension(y)):(i.push(v),i.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function QR(t){return!MR(t.schema)}function tO(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function eO(t,e){return tO(t,e)?t.getCalculationInfo("stackResultDimension"):e}function nO(t,e){var n,i=t.get("coordinateSystem"),r=Xb.get(i);return e&&e.coordSysDims&&(n=Os(e.coordSysDims,(function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=yR(r)}return n}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}function iO(t,e,n){var i,r;return n&&Rs(t,(function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==i||(t[i].otherDims.itemName=0),i}function rO(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=Nw(t)):(i=r.getSource(),o=i.sourceFormat===ib);var a=qR(e),s=nO(e,a),l=n.useEncodeDefaulter,u=Ws(l)?l:l?Gs(fb,s,e):null,h={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o},c=UR(i,h),d=iO(c.dimensions,n.createInvertedIndices,a),p=o?null:r.getSharedDataStore(c),f=JR(e,{schema:c,store:p}),g=new WR(c,e);g.setCalculationInfo(f);var v=null!=d&&oO(i)?function(t,e,n,i){return i===d?n:this.defaultDimValueGetter(t,e,n,i)}:null;return g.hasItemOption=!1,g.initData(o?i:p,null,v),g}function oO(t){if(t.sourceFormat===ib){var e=aO(t.data||[]);return!Hs(pf(e))}}function aO(t){var e=0;while(e-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(IM);const uO=lO;function hO(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=tS(t,e,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a=0&&i.push(e[o])}return i.join(" ")}var dO=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.updateData(e,n,i,r),o}return qa(e,t),e.prototype._createSymbol=function(t,e,n,i,r){this.removeAll();var o=sA(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=pO,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){cm(this.childAt(0))},e.prototype.downplay=function(){dm(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},e.prototype.updateData=function(t,n,i,r){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var h=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,h)}else{var c=this.childAt(0);c.silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?c.attr(d):Zm(c,d,a,n),$m(c)}if(this._updateCommon(t,n,s,i,r),l){c=this.childAt(0);if(!u){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:c.style.opacity}};c.scaleX=c.scaleY=0,c.style.opacity=0,Ym(c,d,a,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,r){var o,a,s,l,u,h,c,d,p,f=this.childAt(0),g=t.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,c=i.labelStatesModels,d=i.hoverScale,p=i.cursorStyle,h=i.emphasisDisabled),!i||t.hasItemOption){var v=i&&i.itemModel?i.itemModel:t.getItemModel(e),y=v.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),s=v.getModel(["select","itemStyle"]).getItemStyle(),a=v.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),u=y.get("blurScope"),h=y.get("disabled"),c=i_(v),d=y.getShallow("scale"),p=v.getShallow("cursor")}var m=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(m||0)*Math.PI/180||0);var _=uA(t.getItemVisual(e,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=t.getItemVisual(e,"style"),b=x.fill;if(f instanceof Jv){var w=f.style;f.useStyle(Ts({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(Ts({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),M=this._z2;null!=S?null==M&&(this._z2=f.z2,f.z2+=S):null!=M&&(f.z2=M,this._z2=null);var I=r&&r.useNameLabel;function C(e){return I?t.getName(e):hO(t,e)}n_(f,c,{labelFetcher:g,labelDataIndex:e,defaultText:C,inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var T=f.ensureState("emphasis");T.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var A=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;T.scaleX=this._sizeX*A,T.scaleY=this._sizeY*A,this.setSymbolScale(1),km(this,l,u,h)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=Cy(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&jm(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();jm(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return lA(t.getItemVisual(e,"symbolSize"))},e}(Ip);function pO(t,e){this.parent.drift(t,e)}const fO=dO;function gO(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function vO(t){return null==t||Xs(t)||(t={isIgnore:t}),t||{}}function yO(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:i_(e),cursorStyle:e.get("cursor")}}var mO=function(){function t(t){this.group=new Ip,this._SymbolCtor=t||fO}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=vO(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=yO(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add((function(i){var r=u(i);if(gO(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}})).update((function(h,c){var d=r.getItemGraphicEl(c),p=u(h);if(gO(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),d=new o(t,h,s,l),d.setPosition(p);else{d.updateData(t,h,s,l);var v={x:p[0],y:p[1]};a?d.attr(v):Zm(d,v,i)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){n.remove(e)}),i)})).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=yO(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=vO(n);for(var r=t.start;r0?n=i[0]:i[1]<0&&(n=i[1]),n}function wO(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var SO="undefined"!==typeof Float32Array,MO=SO?Float32Array:Array;function IO(t){return Hs(t)?SO?new Float32Array(t):t:new MO(t)}function CO(t,e){var n=[];return e.diff(t).add((function(t){n.push({cmd:"+",idx:t})})).update((function(t,e){n.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){n.push({cmd:"-",idx:t})})).execute(),n}function TO(t,e,n,i,r,o,a,s){for(var l=CO(t,e),u=[],h=[],c=[],d=[],p=[],f=[],g=[],v=xO(r,e,a),y=t.getLayout("points")||[],m=e.getLayout("points")||[],_=0;_=r||g<0)break;if(kO(y,m)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,m),c=y,d=m;else{var _=y-u,x=m-h;if(_*_+x*x<.5){g+=o;continue}if(a>0){var b=g+o,w=e[2*b],S=e[2*b+1];while(w===y&&S===m&&v=i||kO(w,S))p=y,f=m;else{C=w-u,T=S-h;var k=y-u,L=w-y,P=m-h,R=S-m,O=void 0,N=void 0;if("x"===s){O=Math.abs(k),N=Math.abs(L);var E=C>0?1:-1;p=y-E*O*a,f=m,A=y+E*N*a,D=m}else if("y"===s){O=Math.abs(P),N=Math.abs(R);var z=T>0?1:-1;p=y,f=m-z*O*a,A=y,D=m+z*N*a}else O=Math.sqrt(k*k+P*P),N=Math.sqrt(L*L+R*R),I=N/(N+O),p=y-C*a*(1-I),f=m-T*a*(1-I),A=y+C*a*I,D=m+T*a*I,A=AO(A,DO(w,y)),D=AO(D,DO(S,m)),A=DO(A,AO(w,y)),D=DO(D,AO(S,m)),C=A-y,T=D-m,p=y-C*O/N,f=m-T*O/N,p=AO(p,DO(u,y)),f=AO(f,DO(h,m)),p=DO(p,AO(u,y)),f=DO(f,AO(h,m)),C=y-p,T=m-f,A=y+C*N/O,D=m+T*N/O}t.bezierCurveTo(c,d,p,f,y,m),c=A,d=D}else t.lineTo(y,m)}u=y,h=m,g+=o}return v}var PO=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),RO=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return qa(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new PO},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0;r--)if(!kO(n[2*r-2],n[2*r-1]))break;for(;i=0){var m=s?(d-i)*y+i:(c-n)*y+n;return s?[t,m]:[m,t]}n=c,i=d;break;case a.C:c=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++],v=o[u++];var _=s?Nh(n,c,p,g,t,l):Nh(i,d,f,v,t,l);if(_>0)for(var x=0;x<_;x++){var b=l[x];if(b<=1&&b>=0){m=s?Rh(i,d,f,v,b):Rh(n,c,p,g,b);return s?[t,m]:[m,t]}}n=g,i=v;break}}},e}(Uv),OO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e}(PO),NO=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new OO},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0;o--)if(!kO(n[2*o-2],n[2*o-1]))break;for(;re){i?r.push(a(i,l,e)):n&&r.push(a(n,l,0),a(n,l,e));break}n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}}return r}function XO(t,e,n){var i=t.getVisual("visualMeta");if(i&&i.length&&t.count()&&"cartesian2d"===e.type){for(var r,o,a=i.length-1;a>=0;a--){var s=t.getDimensionInfo(i[a].dimension);if(r=s&&s.coordDim,"x"===r||"y"===r){o=i[a];break}}if(o){var l=e.getAxis(r),u=Os(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),h=u.length,c=o.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var d=YO(u,"x"===r?n.getWidth():n.getHeight()),p=d.length;if(!p&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var f=10,g=d[0].coord-f,v=d[p-1].coord+f,y=v-g;if(y<.001)return"transparent";Rs(d,(function(t){t.offset=(t.coord-g)/y})),d.push({offset:p?d[p-1].offset:.5,color:c[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:c[0]||"transparent"});var m=new KI(0,0,0,0,d,!0);return m[r]=g,m[r+"2"]=v,m}}}function jO(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!qO(o,e))){var a=e.mapDimension(o.dim),s={};return Rs(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1})),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function qO(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;ai)return!1;return!0}function KO(t,e){return isNaN(t)||isNaN(e)}function $O(t){for(var e=t.length/2;e>0;e--)if(!KO(t[2*e-2],t[2*e-1]))break;return e-1}function JO(t,e){return[t[2*e],t[2*e+1]]}function QO(t,e,n){for(var i,r,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u=e||i>=e&&r<=e){l=u;break}s=u,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}function tN(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e0&&"bolder"===t.get(["emphasis","lineStyle","width"])){var O=p.getState("emphasis").style;O.lineWidth=+p.style.lineWidth+1}Cy(p).seriesIndex=t.seriesIndex,km(p,L,P,R);var N=WO(t.get("smooth")),E=t.get("smoothMonotone");if(p.setShape({smooth:N,smoothMonotone:E,connectNulls:w}),f){var z=a.getCalculationInfo("stackedOnSeries"),B=0;f.useStyle(As(l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:a.getVisual("style").decal})),z&&(B=WO(z.get("smooth"))),f.setShape({smooth:N,stackedOnSmooth:B,smoothMonotone:E,connectNulls:w}),Om(f,t,"areaStyle"),Cy(f).seriesIndex=t.seriesIndex,km(f,L,P,R)}var V=function(t){i._changePolyState(t)};a.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=V)})),this._polyline.onHoverStateChange=V,this._data=a,this._coordSys=r,this._stackedOnPoints=x,this._points=u,this._step=C,this._valueOrigin=m,t.get("triggerLineEvent")&&(this.packEventData(t,p),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){Cy(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),o=Lf(r,i);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel")||0,c=t.get("z")||0;s=new fO(r,o),s.x=l,s.y=u,s.setZ(h,c);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=h,d.z=c,d.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else jC.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),o=Lf(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else jC.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;nm(this._polyline,t),e&&nm(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new RO({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new NO({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(i=o.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===o.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");Ws(l)&&(l=l(null));var u=s.get("animationDelay")||0,h=Ws(u)?u(null):u;t.eachItemGraphicEl((function(t,o){var s=t;if(s){var c=[t.x,t.y],d=void 0,p=void 0,f=void 0;if(n)if(r){var g=n,v=e.pointToCoord(c);i?(d=g.startAngle,p=g.endAngle,f=-v[1]/180*Math.PI):(d=g.r0,p=g.r,f=v[0])}else{var y=n;i?(d=y.x,p=y.x+y.width,f=t.x):(d=y.y+y.height,p=y.y,f=t.y)}var m=p===d?0:(f-d)/(p-d);a&&(m=1-m);var _=Ws(u)?u(o):l*m+h,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(tN(t)){var r=t.getData(),o=this._polyline,a=r.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||(s=this._endLabel=new Iy({z2:200}),s.ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=$O(a);l>=0&&(n_(o,i_(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?cO(r,n):hO(r,t)},enableTextSetter:!0},nN(i,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),v=f.inverse,y=e.shape,m=v?g?y.x:y.y+y.height:g?y.x+y.width:y.y,_=(g?p:0)*(v?-1:1),x=(g?0:-p)*(v?-1:1),b=g?"x":"y",w=QO(u,m,b),S=w.range,M=S[1]-S[0],I=void 0;if(M>=1){if(M>1&&!c){var C=JO(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),r&&(I=h.getRawValue(S[0]))}else{C=l.getPointOn(m,b);C&&s.attr({x:C[0]+_,y:C[1]+x});var T=h.getRawValue(S[0]),A=h.getRawValue(S[1]);r&&(I=Wf(n,d,T,A,w.t))}i.lastFrameIndex=S[0]}else{var D=1===t||i.lastFrameIndex>0?S[0]:0;C=JO(u,D);r&&(I=h.getRawValue(D)),s.attr({x:C[0]+_,y:C[1]+x})}if(r){var k=p_(s);"function"===typeof k.setLabelText&&k.setLabelText(I)}}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=t.hostModel,h=TO(this._data,t,this._stackedOnPoints,e,this._coordSys,n,this._valueOrigin,o),c=h.current,d=h.stackedOnCurrent,p=h.next,f=h.stackedOnNext;if(r&&(c=ZO(h.current,n,r,a),d=ZO(h.stackedOnCurrent,n,r,a),p=ZO(h.next,n,r,a),f=ZO(h.stackedOnNext,n,r,a)),HO(c,p)>3e3||l&&HO(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=h.current,s.shape.points=c;var g={shape:{points:p}};h.current!==c&&(g.shape.__points=h.next),s.stopAnimation(),Zm(s,g,u),l&&(l.setShape({points:c,stackedOnPoints:d}),l.stopAnimation(),Zm(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var v=[],y=h.status,m=0;me&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),d=Math.round(a/c);if(isFinite(d)&&d>1){"lttb"===r&&t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/d));var p=void 0;Us(r)?p=aN[r]:Ws(r)&&(p=r),p&&t.setData(i.downSample(i.mapDimension(l.dim),1/d,p,sN))}}}}}function uN(t){t.registerChartView(rN),t.registerSeriesModel(uO),t.registerLayout(oN("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,lN("line"))}var hN="__ec_stack_";function cN(t){return t.get("stack")||hN+t.seriesIndex}function dN(t){return t.dim+t.index}function pN(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}function vN(t){var e=gN(t),n=[];return Rs(t,(function(t){var i,r=t.coordinateSystem,o=r.getBaseAxis(),a=o.getExtent();if("category"===o.type)i=o.getBandWidth();else if("value"===o.type||"time"===o.type){var s=o.dim+"_"+o.index,l=e[s],u=Math.abs(a[1]-a[0]),h=o.scale.getExtent(),c=Math.abs(h[1]-h[0]);i=l?u/c*l:u}else{var d=t.getData();i=Math.abs(a[1]-a[0])/d.count()}var p=zp(t.get("barWidth"),i),f=zp(t.get("barMaxWidth"),i),g=zp(t.get("barMinWidth")||(wN(t)?.5:1),i),v=t.get("barGap"),y=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:p,barMaxWidth:f,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:dN(o),stackId:cN(t)})})),yN(n)}function yN(t){var e={};Rs(t,(function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=t.barMaxWidth;u&&(a[s].maxWidth=u);var h=t.barMinWidth;h&&(a[s].minWidth=h);var c=t.barGap;null!=c&&(o.gap=c);var d=t.barCategoryGap;null!=d&&(o.categoryGap=d)}));var n={};return Rs(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=Bs(i).length;o=Math.max(35-4*a,15)+"%"}var s=zp(o,r),l=zp(t.gap,1),u=t.remainedWidth,h=t.autoWidthCount,c=(u-s)/(h+(h-1)*l);c=Math.max(c,0),Rs(i,(function(t){var e=t.maxWidth,n=t.minWidth;if(t.width){i=t.width;e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,u-=i+l*i,h--}else{var i=c;e&&ei&&(i=n),i!==c&&(t.width=i,u-=i+l*i,h--)}})),c=(u-s)/(h+(h-1)*l),c=Math.max(c,0);var d,p=0;Rs(i,(function(t,e){t.width||(t.width=c),d=t,p+=t.width*(1+l)})),d&&(p-=d.width*l);var f=-p/2;Rs(i,(function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),n}function mN(t,e,n){if(t&&e){var i=t[dN(e)];return null!=i&&null!=n?i[cN(n)]:i}}function _N(t,e){var n=fN(t,e),i=vN(n);Rs(n,(function(t){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),o=cN(t),a=i[dN(r)][o],s=a.offset,l=a.width;e.setLayout({bandWidth:a.bandWidth,offset:s,size:l})}))}function xN(t){return{seriesType:t,plan:AM(),reset:function(t){if(bN(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=n.getOtherAxis(i),o=e.getDimensionIndex(e.mapDimension(r.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(r.dim),u=e.getCalculationInfo("stackResultDimension"),h=tO(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),c=r.isHorizontal(),d=SN(i,r),p=wN(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),v=e.getLayout("size"),y=e.getLayout("offset");return{progress:function(t,e){var i,r=t.count,l=p&&IO(3*r),u=p&&s&&IO(3*r),m=p&&IO(r),_=n.master.getRect(),x=c?_.width:_.height,b=e.getStore(),w=0;while(null!=(i=t.next())){var S=b.get(h?g:o,i),M=b.get(a,i),I=d,C=void 0;h&&(C=+S-b.get(o,i));var T=void 0,A=void 0,D=void 0,k=void 0;if(c){var L=n.dataToPoint([S,M]);if(h){var P=n.dataToPoint([C,M]);I=P[0]}T=I,A=L[1]+y,D=L[0]-I,k=v,Math.abs(D)a){u=(d+l)/2;break}1===c&&(h=p-i[0].tickValue)}null==u&&(l?l&&(u=i[i.length-1].coord):u=i[0].coord),o[n]=t.toGlobalCoord(u)}}));else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=i.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(IM);IM.registerClass(MN);const IN=MN;var CN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(){return sO(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=R_(IN.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(IN);const TN=CN;var AN=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}return t}(),DN=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new AN},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-r),s=r+a,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=2*Math.PI,d=h?u-lMath.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}function RN(t,e,n){return e*Math.sin(t)*(n?-1:1)}function ON(t,e,n){return e*Math.cos(t)*(n?1:-1)}function NN(t,e,n){var i=t.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;Hs(i)||(i=[i,i,i,i]);var r=Math.abs(e.r||0-e.r0||0);return{cornerRadius:Os(i,(function(t){return lp(t,r)}))}}var EN=Math.max,zN=Math.min;function BN(t,e){var n=t.getArea&&t.getArea();if(VO(t,"cartesian2d")){var i=t.getBaseAxis();if("category"!==i.type||!i.onBand){var r=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}var VN=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return qa(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var r=t.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var r,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?r=u.isHorizontal():"polar"===l.type&&(r="angle"===u.dim);var h=t.isAnimationEnabled()?t:null,c=HN(t,l);c&&this._enableRealtimeSort(c,a,n);var d=t.get("clip",!0)||c,p=BN(l,a);o.removeClipPath();var f=t.get("roundCap",!0),g=t.get("showBackground",!0),v=t.getModel("backgroundStyle"),y=v.get("borderRadius")||0,m=[],_=this._backgroundEls,x=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function w(t){var e=jN[l.type](a,t),n=oE(l,r,e);return n.useStyle(v.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",y):n.setShape("cornerRadius",y),m[t]=n,n}a.diff(s).add((function(e){var n=a.getItemModel(e),i=jN[l.type](a,e,n);if(g&&w(e),a.hasValue(e)&&XN[l.type](i)){var s=!1;d&&(s=FN[l.type](p,i));var v=GN[l.type](t,a,e,i,r,h,u.model,!1,f);c&&(v.forceLabelAnimation=!0),$N(v,a,e,n,i,t,r,"polar"===l.type),x?v.attr({shape:i}):c?WN(c,h,v,i,e,r,!1,!1):Ym(v,{shape:i},t,e),a.setItemGraphicEl(e,v),o.add(v),v.ignore=s}})).update((function(e,n){var i=a.getItemModel(e),S=jN[l.type](a,e,i);if(g){var M=void 0;0===_.length?M=w(n):(M=_[n],M.useStyle(v.getItemStyle()),"cartesian2d"===l.type?M.setShape("r",y):M.setShape("cornerRadius",y),m[e]=M);var I=jN[l.type](a,e),C=rE(r,I,l);Zm(M,{shape:C},h,e)}var T=s.getItemGraphicEl(n);if(a.hasValue(e)&&XN[l.type](S)){var A=!1;if(d&&(A=FN[l.type](p,S),A&&o.remove(T)),T?$m(T):T=GN[l.type](t,a,e,S,r,h,u.model,!!T,f),c&&(T.forceLabelAnimation=!0),b){var D=T.getTextContent();if(D){var k=p_(D);null!=k.prevValue&&(k.prevValue=k.value)}}else $N(T,a,e,i,S,t,r,"polar"===l.type);x?T.attr({shape:S}):c?WN(c,h,T,S,e,r,!0,b):Zm(T,{shape:S},t,e,null),a.setItemGraphicEl(e,T),T.ignore=A,o.add(T)}else o.remove(T)})).remove((function(e){var n=s.getItemGraphicEl(e);n&&Km(n,t,e)})).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Ip);S.removeAll();for(var M=0;Mo)return!0;o=u}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,(function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)}));n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl((function(e){Km(e,t,Cy(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(jC),FN={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,a=EN(e.x,t.x),s=zN(e.x+e.width,r),l=EN(e.y,t.y),u=zN(e.y+e.height,o),h=sr?s:a,e.y=c&&l>o?u:l,e.width=h?0:s-a,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=zN(e.r,t.r),o=EN(e.r0,t.r0);e.r=r,e.r0=o;var a=r-o<0;if(n<0){i=e.r;e.r=e.r0,e.r0=i}return a}},GN={cartesian2d:function(t,e,n,i,r,o,a,s,l){var u=new sy({shape:Ts({},i),z2:1});if(u.__dataIndex=n,u.name="item",o){var h=u.shape,c=r?"height":"width";h[c]=0}return u},polar:function(t,e,n,i,r,o,a,s,l){var u=!r&&l?kN:bI,h=new u({shape:i,z2:1});h.name="item";var c=KN(r);if(h.calculateTextPosition=LN(c,{isRoundCap:u===kN}),o){var d=h.shape,p=r?"r":"endAngle",f={};d[p]=r?i.r0:i.startAngle,f[p]=i[p],(s?Zm:Ym)(h,{shape:f},o)}return h}};function HN(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}function WN(t,e,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?Zm:Ym)(n,{shape:l},e,r,null);var h=e?t.baseAxis.model:null;(a?Zm:Ym)(n,{shape:u},h,r)}function UN(t,e){for(var n=0;n0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function qN(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}function KN(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function $N(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=t.shape,h=NN(i.getModel("itemStyle"),u,!0);Ts(u,h),t.setShape(u)}}else{var c=i.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var d=i.getShallow("cursor");d&&t.attr("cursor",d);var p=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",f=i_(i);n_(t,f,{labelFetcher:o,labelDataIndex:n,defaultText:hO(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var g=t.getTextContent();if(s&&g){var v=i.get(["label","position"]);t.textConfig.inside="middle"===v||null,PN(t,"outside"===v?p:v,KN(a),i.get(["label","rotate"]))}f_(g,f,o.getRawValue(n),(function(t){return cO(e,t)}));var y=i.getModel(["emphasis"]);km(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Om(t,i),qN(r)&&(t.style.fill="none",t.style.stroke="none",Rs(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}function JN(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var i=t.get(["itemStyle","borderWidth"])||0,r=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,r,o)}var QN=function(){function t(){}return t}(),tE=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new QN},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l=0?n:null}),30,!1);function iE(t,e,n){for(var i=t.baseDimIdx,r=1-i,o=t.shape.points,a=t.largeDataIndices,s=[],l=[],u=t.barWidth,h=0,c=o.length/3;h=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[h]}return-1}function rE(t,e,n){if(VO(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}r=n.getArea();var o=e;return{cx:r.cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}function oE(t,e,n){var i="polar"===t.type?bI:sy;return new i({shape:rE(e,n,t),silent:!0,z2:0})}const aE=VN;function sE(t){t.registerChartView(aE),t.registerSeriesModel(TN),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Gs(_N,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,xN("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,lN("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))}var lE=2*Math.PI,uE=Math.PI/180;function hE(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function cE(t,e){var n=hE(t,e),i=t.get("center"),r=t.get("radius");Hs(r)||(r=[0,r]);var o,a,s=zp(n.width,e.getWidth()),l=zp(n.height,e.getHeight()),u=Math.min(s,l),h=zp(r[0],u/2),c=zp(r[1],u/2),d=t.coordinateSystem;if(d){var p=d.dataToPoint(i);o=p[0]||0,a=p[1]||0}else Hs(i)||(i=[i,i]),o=zp(i[0],s)+n.x,a=zp(i[1],l)+n.y;return{cx:o,cy:a,r0:h,r:c}}function dE(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.getData(),i=e.mapDimension("value"),r=hE(t,n),o=cE(t,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,h=-t.get("startAngle")*uE,c=t.get("minAngle")*uE,d=0;e.each(i,(function(t){!isNaN(t)&&d++}));var p=e.getSum(i),f=Math.PI/(p||d)*2,g=t.get("clockwise"),v=t.get("roseType"),y=t.get("stillShowZeroSum"),m=e.getDataExtent(i);m[0]=0;var _=lE,x=0,b=h,w=g?1:-1;if(e.setLayout({viewRect:r,r:l}),e.each(i,(function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:g,cx:a,cy:s,r0:u,r:v?NaN:l});else{i="area"!==v?0===p&&y?f:t*f:lE/d,in?a:o,h=Math.abs(l.label.y-n);if(h>=u.maxY){var c=l.label.x-e-l.len2*r,d=i+l.len,f=Math.abs(c)t.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var v=(i.style.margin||0)+2.1;o.height=g.height+v,o.y-=(o.height-c)/2}}}function mE(t){return"center"===t.position}function _E(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*fE,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,h=s.x,c=s.y,d=s.height;function p(t){t.ignore=!0}function f(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}i.each((function(t){var s=i.getItemGraphicEl(t),c=s.shape,d=s.getTextContent(),g=s.getTextGuideLine(),v=i.getItemModel(t),y=v.getModel("label"),m=y.get("position")||v.get(["emphasis","label","position"]),_=y.get("distanceToLabelLine"),x=y.get("alignTo"),b=zp(y.get("edgeDistance"),u),w=y.get("bleedMargin"),S=v.getModel("labelLine"),M=S.get("length");M=zp(M,u);var I=S.get("length2");if(I=zp(I,u),Math.abs(c.endAngle-c.startAngle)0?"right":"left":L>0?"left":"right"}var F=Math.PI,G=0,H=y.get("rotate");if(Ys(H))G=H*(F/180);else if("center"===m)G=0;else if("radial"===H||!0===H){var W=L<0?-k+F:-k;G=W}else if("tangential"===H&&"outside"!==m&&"outer"!==m){var U=Math.atan2(L,P);U<0&&(U=2*F+U);var Z=P>0;Z&&(U=F+U),G=U-F}if(o=!!G,d.x=C,d.y=T,d.rotation=G,d.setStyle({verticalAlign:"middle"}),R){d.setStyle({align:D});var Y=d.states.select;Y&&(Y.x+=d.x,Y.y+=d.y)}else{var X=d.getBoundingRect().clone();X.applyTransform(d.getComputedTransform());var j=(d.style.margin||0)+2.1;X.y-=j/2,X.height+=j,r.push({label:d,labelLine:g,position:m,len:M,len2:I,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new Lu(L,P),linePoints:A,textAlign:D,labelDistance:_,labelAlignTo:x,edgeDistance:b,bleedMargin:w,rect:X,unconstrainedWidth:X.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:R})}})),!o&&t.get("avoidLabelOverlap")&&vE(r,e,n,l,u,d,h,c);for(var g=0;g0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u=i.r0}},e.type="pie",e}(jC);const wE=bE;function SE(t,e,n){e=Hs(e)&&{coordDimensions:e}||Ts({encodeDefine:t.getEncode()},e);var i=t.getSource(),r=UR(i,e).dimensions,o=new WR(r,t);return o.initData(i,n),o}var ME=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){var e=this._getRawData();return e.indexOfName(t)>=0},t.prototype.indexOfName=function(t){var e=this._getDataWithEncodedVisual();return e.indexOfName(t)},t.prototype.getItemVisual=function(t,e){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,e)},t}();const IE=ME;var CE=Pf(),TE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new IE(Fs(this.getData,this),Fs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return SE(this,{coordDimensions:["value"],encodeDefaulter:Gs(gb,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=CE(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),(function(t){o.push(t)})),r=i.seats=Wp(o,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=r[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(IM);const AE=TE;function DE(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf((function(t){var e=n.mapDimension("value"),i=n.get(e,t);return!(Ys(i)&&!isNaN(i)&&i<0)}))}}}function kE(t){t.registerChartView(wE),t.registerSeriesModel(AE),UT("pie",t.registerAction),t.registerLayout(Gs(dE,"pie")),t.registerProcessor(pE("pie")),t.registerProcessor(DE("pie"))}var LE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){return sO(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(IM);const PE=LE;var RE=4,OE=function(){function t(){}return t}(),NE=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return qa(e,t),e.prototype.getDefaultShape=function(){return new OE},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]=0;s--){var l=2*s,u=i[l]-o/2,h=i[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();if(t=n[0],e=n[1],i.contain(t,e)){var r=this.hoverDataIdx=this.findDataIndex(t,e);return r>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h=0&&(l.dataIndex=n+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const zE=EE;var BE=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData(),r=this._updateSymbolDraw(i,t);r.incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=oN("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext,r=i.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new zE:new _O,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(jC);const VE=BE;var FE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Jx);const GE=FE;var HE=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},t.prototype.getCoordSysModel=function(){},t}(),WE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ef).models[0]},e.type="cartesian2dAxis",e}(Jx);Ls(WE,HE);var UE={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},ZE=Is({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},UE),YE=Is({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},UE),XE=Is({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},YE),jE=As({logBase:10},YE);const qE={category:ZE,value:YE,time:XE,log:jE};var KE=0,$E=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++KE}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&Os(i,JE);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!Us(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return e=i.get(t),null==e&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=gl(this.categories))},t}();function JE(t){return Xs(t)&&null!=t.value?t.value:t+""}const QE=$E;var tz={value:1,category:1,time:1,log:1};function ez(t,e,n,i){Rs(tz,(function(r,o){var a=Is(Is({},qE[o],!0),i,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return qa(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=Zx(this),i=n?Xx(t):{},r=e.getTheme();Is(t,r.get(o+"Axis")),Is(t,this.getDefaultOption()),t.type=nz(t),n&&Yx(t,i,n)},n.prototype.optionUpdated=function(){var t=this.option;"category"===t.type&&(this.__ordinalMeta=QE.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)})),t.registerSubTypeDefaulter(e+"Axis",nz)}function nz(t){return t.type||(t.data?"category":"value")}var iz=function(){function t(t){this._setting=t||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();ig(iz);const rz=iz;function oz(t){return"interval"===t.type||"log"===t.type}function az(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=Jp(o/e,!0);null!=n&&ai&&(a=r.interval=i);var s=r.intervalPrecision=lz(a),l=r.niceTickExtent=[Bp(Math.ceil(t[0]/a)*a,s),Bp(Math.floor(t[1]/a)*a,s)];return hz(l,t),r}function sz(t){var e=Math.pow(10,$p(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Bp(n*e)}function lz(t){return Fp(t)+2}function uz(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function hz(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),uz(t,0,e),uz(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function cz(t,e){return t>=e[0]&&t<=e[1]}function dz(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function pz(t,e){return t*(e[1]-e[0])+e[0]}var fz=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new QE({})),Hs(i)&&(i=new QE({categories:Os(i,(function(t){return Xs(t)?t.value:t}))})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return qa(e,t),e.prototype.parse=function(t){return null==t?NaN:Us(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),cz(t,this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),dz(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(pz(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){var t=[],e=this._extent,n=e[0];while(n<=e[1])t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(rz);rz.registerClass(fz);const gz=fz;var vz=Bp,yz=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return qa(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return cz(t,this._extent)},e.prototype.normalize=function(t){return dz(t,this._extent)},e.prototype.scale=function(t){return pz(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=lz(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;var a=1e4;n[0]a)return[]}var l=o.length?o[o.length-1].value:i[1];return n[1]>l&&(t?o.push({value:vz(l+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;ri[0]&&c>>1;t[r][1]n&&(this._approxInterval=n);var o=bz.length,a=Math.min(_z(bz,this._approxInterval,0,o),o-1);this._interval=bz[a][1],this._minLevelUnit=bz[Math.max(a-1,0)][0]},e.prototype.parse=function(t){return Ys(t)?t:+qp(t)},e.prototype.contain=function(t){return cz(this.parse(t),this._extent)},e.prototype.normalize=function(t){return dz(this.parse(t),this._extent)},e.prototype.scale=function(t){return pz(t,this._extent)},e.type="time",e}(mz),bz=[["second",Y_],["minute",X_],["hour",j_],["quarter-day",6*j_],["half-day",12*j_],["day",1.2*q_],["half-week",3.5*q_],["week",7*q_],["month",31*q_],["quarter",95*q_],["half-year",K_/2],["year",K_]];function wz(t,e,n,i){var r=qp(e),o=qp(n),a=function(t){return ux(r,t,i)===ux(o,t,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},h=function(){return u()&&a("hour")},c=function(){return h()&&a("minute")},d=function(){return c()&&a("second")},p=function(){return d()&&a("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return h();case"minute":return c();case"second":return d();case"millisecond":return p()}}function Sz(t,e){return t/=q_,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function Mz(t){var e=30*q_;return t/=e,t>6?6:t>3?3:t>2?2:1}function Iz(t){return t/=j_,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Cz(t,e){return t/=e?X_:Y_,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function Tz(t){return Jp(t,!0)}function Az(t,e,n){var i=new Date(t);switch(ix(e)){case"year":case"month":i[mx(n)](0);case"day":i[_x(n)](1);case"hour":i[xx(n)](0);case"minute":i[bx(n)](0);case"second":i[Sx(n)](0),i[Mx(n)](0)}return i.getTime()}function Dz(t,e,n,i){var r=1e4,o=ex,a=0;function s(t,e,n,r,o,a,s){var l=new Date(e),u=e,h=l[r]();while(u1&&0===u&&o.unshift({value:o[0].value-d})}}for(u=0;u=i[0]&&m<=i[1]&&c++)}var _=(i[1]-i[0])/e;if(c>1.5*_&&d>_/1.5)break;if(u.push(v),c>_||t===o[p])break}h=[]}}}var x=Es(Os(u,(function(t){return Es(t,(function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd}))})),(function(t){return t.length>0})),b=[],w=x.length-1;for(p=0;p0)i*=10;var o=[Bp(Nz(e[0]/i)*i),Bp(Oz(e[1]/i)*i)];this._interval=i,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){Pz.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=zz(t)/zz(this.base),cz(t,this._extent)},e.prototype.normalize=function(t){return t=zz(t)/zz(this.base),dz(t,this._extent)},e.prototype.scale=function(t){return t=pz(t,this._extent),Ez(this.base,t)},e.type="log",e}(rz),Vz=Bz.prototype;function Fz(t,e){return Rz(t,Fp(e))}Vz.getMinorTicks=Pz.getMinorTicks,Vz.getLabel=Pz.getLabel,rz.registerClass(Bz);const Gz=Bz;var Hz=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]0&&s>0&&!l&&(a=0),a<0&&s<0&&!u&&(s=0));var c=this._determinedMin,d=this._determinedMax;return null!=c&&(a=c,l=!0),null!=d&&(s=d,u=!0),{min:a,max:s,minFixed:l,maxFixed:u,isBlank:h}},t.prototype.modifyDataMinMax=function(t,e){this[Uz[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var n=Wz[t];this[n]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),Wz={min:"_determinedMin",max:"_determinedMax"},Uz={min:"_dataMin",max:"_dataMax"};function Zz(t,e,n){var i=t.rawExtentInfo;return i||(i=new Hz(t,e,n),t.rawExtentInfo=i,i)}function Yz(t,e){return null==e?null:tl(e)?NaN:t.parse(e)}function Xz(t,e){var n=t.type,i=Zz(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=fN("bar",a),l=!1;if(Rs(s,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var u=vN(s),h=jz(r,o,e,u);r=h.min,o=h.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function jz(t,e,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=mN(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;Rs(a,(function(t){s=Math.min(t.offset,s)}));var l=-1/0;Rs(a,(function(t){l=Math.max(t.offset+t.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=1-(s+l)/o,d=h/c-h;return e+=d*(l/u),t-=d*(s/u),{min:t,max:e}}function qz(t,e){var n=e,i=Xz(t,n),r=i.extent,o=n.get("splitNumber");t instanceof Gz&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function Kz(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new gz({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new kz({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(rz.getClass(e)||mz)}}function $z(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}function Jz(t){var e=t.getLabelModel().get("formatter"),n="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?function(e){return function(n,i){return t.scale.getFormattedLabel(n,i,e)}}(e):Us(e)?function(e){return function(n){var i=t.scale.getLabel(n),r=e.replace("{value}",null!=i?i:"");return r}}(e):Ws(e)?function(e){return function(i,r){return null!=n&&(r=i.value-n),e(Qz(t,i),r,null!=i.level?{level:i.level}:null)}}(e):function(e){return t.scale.getLabel(e)}}function Qz(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function tB(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();n instanceof gz?r=n.count():(i=n.getTicks(),r=i.length);var a,s=t.getLabelModel(),l=Jz(t),u=1;r>40&&(u=Math.ceil(r/40));for(var h=0;ht[1]&&(t[1]=i[1])}))}var aB=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return Os(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),Es(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}();const sB=aB;var lB=["x","y"];function uB(t){return"interval"===t.type||"time"===t.type}var hB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=lB,e}return qa(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(uB(t)&&uB(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,h=r[0]-n[0]*l,c=r[1]-i[0]*u,d=this._transform=[l,0,0,u,h,c];this._invTransform=Au([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new Gu(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return Bl(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return e=e||[],e[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return Bl(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),n=Math.min(t[0],t[1]),i=Math.min(e[0],e[1]),r=Math.max(t[0],t[1])-n,o=Math.max(e[0],e[1])-i;return new Gu(n,i,r,o)},e}(sB);const cB=hB;var dB=Pf();function pB(t){return"category"===t.type?gB(t):mB(t)}function fB(t,e){return"category"===t.type?yB(t,e):{ticks:Os(t.scale.getTicks(),(function(t){return t.value}))}}function gB(t){var e=t.getLabelModel(),n=vB(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function vB(t,e){var n,i,r=_B(t,"labels"),o=nB(e),a=xB(r,o);return a||(Ws(o)?n=CB(t,o):(i="auto"===o?wB(t):o,n=IB(t,i)),bB(r,o,{labels:n,labelCategoryInterval:i}))}function yB(t,e){var n,i,r=_B(t,"ticks"),o=nB(e),a=xB(r,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),Ws(o))n=CB(t,o,!0);else if("auto"===o){var s=vB(t,t.getLabelModel());i=s.labelCategoryInterval,n=Os(s.labels,(function(t){return t.tickValue}))}else i=o,n=IB(t,i,!0);return bB(r,o,{ticks:n,tickCategoryInterval:i})}function mB(t){var e=t.scale.getTicks(),n=Jz(t);return{labels:Os(e,(function(e,i){return{level:e.level,formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}function _B(t,e){return dB(t)[e]||(dB(t)[e]=[])}function xB(t,e){for(var n=0;n40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(i)),c=Math.abs(u*Math.sin(i)),d=0,p=0;l<=o[1];l+=s){var f=0,g=0,v=rp(n({value:l}),e.font,"center","top");f=1.3*v.width,g=1.3*v.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var y=d/h,m=p/c;isNaN(y)&&(y=1/0),isNaN(m)&&(m=1/0);var _=Math.max(0,Math.floor(Math.min(y,m))),x=dB(t.model),b=t.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}function MB(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function IB(t,e,n){var i=Jz(t),r=t.scale,o=r.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=o[0],h=r.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=iB(t),d=a.get("showMinLabel")||c,p=a.get("showMaxLabel")||c;d&&u!==o[0]&&g(o[0]);for(var f=u;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return p&&f-l!==o[1]&&g(o[1]),s}function CB(t,e,n){var i=t.scale,r=Jz(t),o=[];return Rs(i.getTicks(),(function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})})),o}var TB=[0,1],AB=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Hp(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&(n=n.slice(),DB(n,i.count())),Ep(t,TB,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&(n=n.slice(),DB(n,i.count()));var r=Ep(t,n,TB,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){t=t||{};var e=t.tickModel||this.getTickModel(),n=fB(this,e),i=n.ticks,r=Os(i,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this),o=e.get("alignWithLabel");return kB(this,r,o,t.clamp),r},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick"),e=t.get("splitNumber");e>0&&e<100||(e=5);var n=this.scale.getMinorTicks(e),i=Os(n,(function(t){return Os(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this);return i},t.prototype.getViewLabels=function(){return pB(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return SB(this)},t}();function DB(t,e){var n=t[1]-t[0],i=e,r=n/i/2;t[0]+=r,t[1]-=r}function kB(t,e,n,i){var r=e.length;if(t.onBand&&!n&&r){var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[1]};else{var l=e[r-1].tickValue-e[0].tickValue,u=(e[r-1].coord-e[0].coord)/l;Rs(e,(function(t){t.coord-=u/2}));var h=t.scale.getExtent();a=1+h[1]-e[r-1].tickValue,o={coord:e[r-1].coord+u*a},e.push(o)}var c=s[0]>s[1];d(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]}),d(s[1],o.coord)&&(i?o.coord=s[1]:e.pop()),i&&d(o.coord,s[1])&&e.push({coord:s[1]})}function d(t,e){return t=Bp(t),e=Bp(e),c?t>e:te[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(LB);const RB=PB;function OB(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,h=i.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===u?[c[2]-p,c[3]+p]:[c[0]-p,c[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===u?f[d[l]]:c[0],"x"===u?f[d[l]]:c[3]],o.rotation=Math.PI/2*("x"===u?0:1);var v={top:-1,bottom:1,left:-1,right:1};o.labelDirection=o.tickDirection=o.nameDirection=v[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),el(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var y=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-y:y,o.z2=1,o}function NB(t){return"cartesian2d"===t.get("coordinateSystem")}function EB(t){var e={xAxisModel:null,yAxisModel:null};return Rs(e,(function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Ef).models[0];e[i]=o})),e}var zB=Math.log;function BB(t,e,n){var i=mz.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=Xz(t,e),u=l.extent,h=l.fixMin,c=l.fixMax;if("log"===t.type){var d=zB(t.base);u=[zB(u[0])/d,zB(u[1])/d]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:a,fixMin:h,fixMax:c});var p=i.getExtent.call(t);h&&(u[0]=p[0]),c&&(u[1]=p[1]);var f=i.getInterval.call(t),g=u[0],v=u[1];if(h&&c)f=(v-g)/a;else if(h){v=u[0]+f*a;while(vu[0]&&isFinite(g)&&isFinite(u[0]))f=sz(f),g=u[1]-f*a}else{var y=t.getTicks().length-1;y>a&&(f=sz(f));var m=f*a;v=Math.ceil(u[1]/f)*f,g=Bp(v-m),g<0&&u[0]>=0?(g=0,v=Bp(m)):v>0&&u[1]<=0&&(v=0,g=-Bp(m))}var _=(r[0].value-o[0].value)/s,x=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+f*_,v+f*x),i.setInterval.call(t,f),(_||x)&&i.setNiceExtent.call(t,g+f,v-f)}var VB=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=lB,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=Bs(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=+n[o],s=t[a],l=s.model,u=s.scale;oz(u)&&l.get("alignTicks")&&null==l.get("interval")?r.push(s):(qz(u,l),oz(u)&&(e=s))}r.length&&(e||(e=r.pop(),qz(e.scale,e.model)),Rs(r,(function(t){BB(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};Rs(n.x,(function(t){GB(n,"y",t,r)})),Rs(n.y,(function(t){GB(n,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=Hx(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){Rs(a,(function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),WB(t,e?o.x:o.y)}))}s(),r&&(Rs(a,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=tB(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+i,"top"===t.position?o.y+=e.height+i:"left"===t.position&&(o.x+=e.width+i)}}})),s()),Rs(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}Xs(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i0?"top":"bottom",i="center"):Xp(o-ZB)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),XB={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(Bl(s,s,a),Bl(l,l,a));var h=Ts({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),c=new EI({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:h,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});bC(c.shape,c.style.lineWidth),c.anid="line",n.add(c);var d=e.get(["axisLine","symbol"]);if(null!=d){var p=e.get(["axisLine","symbolSize"]);Us(d)&&(d=[d,d]),(Us(p)||Ys(p))&&(p=[p,p]);var f=uA(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],v=p[1];Rs([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],(function(e,i){if("none"!==d[i]&&null!=d[i]){var r=sA(d[i],-g/2,-v/2,g,v,h.stroke,!0),o=e.r+e.offset,a=u?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}}))}}},axisTickLabel:function(t,e,n,i){var r=tV(n,i,e,t),o=nV(n,i,e,t);if(qB(e,o,r),eV(n,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var a=sL(Os(o,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})));cL(a)}},axisName:function(t,e,n,i){var r=el(t.axisName,e.get("name"));if(r){var o,a,s=e.get("nameLocation"),l=t.nameDirection,u=e.getModel("nameTextStyle"),h=e.get("nameGap")||0,c=e.axis.getExtent(),d=c[0]>c[1]?-1:1,p=["start"===s?c[0]-d*h:"end"===s?c[1]+d*h:(c[0]+c[1])/2,JB(s)?t.labelOffset+l*h:0],f=e.get("nameRotate");null!=f&&(f=f*ZB/180),JB(s)?o=YB.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=jB(t.rotation,s,f||0,c),a=t.axisNameAvailableWidth,null!=a&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=u.getFont(),v=e.get("nameTruncate",!0)||{},y=v.ellipsis,m=el(t.nameTruncateMaxWidth,v.maxWidth,a),_=new Iy({x:p[0],y:p[1],rotation:o.rotation,silent:YB.isLabelSilent(e),style:r_(u,{text:r,font:g,overflow:"truncate",width:m,ellipsis:y,fill:u.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:u.get("align")||o.textAlign,verticalAlign:u.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(zC({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=YB.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,Cy(_).eventData=x}i.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function jB(t,e,n,i){var r,o,a=Yp(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return Xp(a-ZB/2)?(o=l?"bottom":"top",r="center"):Xp(a-1.5*ZB)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*ZB&&a>ZB/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:r,textVerticalAlign:o}}function qB(t,e,n){if(!iB(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),r=t.get(["axisLabel","showMaxLabel"]);e=e||[],n=n||[];var o=e[0],a=e[1],s=e[e.length-1],l=e[e.length-2],u=n[0],h=n[1],c=n[n.length-1],d=n[n.length-2];!1===i?(KB(o),KB(u)):$B(o,a)&&(i?(KB(a),KB(h)):(KB(o),KB(u))),!1===r?(KB(s),KB(c)):$B(l,s)&&(r?(KB(l),KB(d)):(KB(s),KB(c)))}}function KB(t){t&&(t.ignore=!0)}function $B(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=wu([]);return Cu(r,r,-t.rotation),n.applyTransform(Mu([],r,t.getLocalTransform())),i.applyTransform(Mu([],r,e.getLocalTransform())),n.intersect(i)}}function JB(t){return"middle"===t||"center"===t}function QB(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l=0||t===e}function hV(t){var e=cV(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=pV(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a0&&!c.min?c.min=0:null!=c.min&&c.min<0&&!c.max&&(c.max=0);var d=a;null!=c.color&&(d=As({color:c.color},a));var p=Is(Ms(c),{boundaryGap:t,splitNumber:e,scale:n,axisLine:i,axisTick:r,axisLabel:o,name:c.text,showName:s,nameLocation:"end",nameGap:u,nameTextStyle:d,triggerEvent:h},!1);if(Us(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else Ws(l)&&(p.name=l(p.name,p));var g=new A_(p,null,this.ecModel);return Ls(g,HE.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this._indicatorModels=c},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Is({lineStyle:{color:"#bbb"}},VV.axisLine),axisLabel:FV(VV.axisLabel,!1),axisTick:FV(VV.axisTick,!1),splitLine:FV(VV.splitLine,!0),splitArea:FV(VV.splitArea,!0),indicator:[]},e}(Jx);const HV=GV;var WV=["axisLine","axisTickLabel","axisName"],UV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes(),i=Os(n,(function(t){var n=t.model.get("showName")?t.name:"",i=new iV(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return i}));Rs(i,(function(t){Rs(WV,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var i=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),a=r.getModel("lineStyle"),s=o.getModel("areaStyle"),l=r.get("show"),u=o.get("show"),h=a.get("color"),c=s.get("color"),d=Hs(h)?h:[h],p=Hs(c)?c:[c],f=[],g=[];if("circle"===i)for(var v=n[0].getTicksCoords(),y=e.cx,m=e.cy,_=0;_3?1.4:r>1?1.2:1.1,l=i>0?s:1/s;rF(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(i),h=(i>0?1:-1)*(u>3?.4:u>1?.15:.05);rF(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!eF(this._zr,"globalPan")){var e=t.pinchScale>1?1.1:1/1.1;rF(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(Zl);function rF(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(gu(i.event),oF(t,e,n,i,r))}function oF(t,e,n,i,r){r.isAvailableBehavior=Fs(aF,null,n,i),t.trigger(e,r)}function aF(t,e,n){var i=n[t];return!t||i&&(!Us(i)||e.event[i+"Key"])}const sF=iF;function lF(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}function uF(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var u=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(u-1),r.y-=(i-r.y)*(u-1),r.scaleX*=u,r.scaleY*=u,r.dirty()}var hF,cF={axisPointer:1,tooltip:1,brush:1};function dF(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!cF.hasOwnProperty(i.mainType)&&r&&r.model!==n}function pF(t){if(Us(t)){var e=new DOMParser;t=e.parseFromString(t,"text/xml")}var n=t;9===n.nodeType&&(n=n.firstChild);while("svg"!==n.nodeName.toLowerCase()||1!==n.nodeType)n=n.nextSibling;return n}var fF={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-anchor":"textAlign",visibility:"visibility",display:"display"},gF=Bs(fF),vF={"alignment-baseline":"textBaseline","stop-color":"stopColor"},yF=Bs(vF),mF=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var n=pF(t);this._defsUsePending=[];var i=new Ip;this._root=i;var r=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),s=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),MF(n,i,null,!0,!1);var l,u,h=n.firstChild;while(h)this._parseNode(h,i,r,null,!1,!1),h=h.nextSibling;if(AF(this._defs,this._defsUsePending),this._defsUsePending=[],o){var c=kF(o);c.length>=4&&(l={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(l&&null!=a&&null!=s&&(u=zF(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var d=i;i=new Ip,i.add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new sy({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:r}},t.prototype._parseNode=function(t,e,n,i,r,o){var a,s=t.nodeName.toLowerCase(),l=i;if("defs"===s&&(r=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!r){var u=hF[s];if(u&&_l(hF,s)){a=u.call(this,t,e);var h=t.getAttribute("name");if(h){var c={name:h,namedFrom:null,svgNodeTagLower:s,el:a};n.push(c),"g"===s&&(l=c)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var d=_F[s];if(d&&_l(_F,s)){var p=d.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup){var g=t.firstChild;while(g)1===g.nodeType?this._parseNode(g,a,n,l,r,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling}},t.prototype._parseText=function(t,e){var n=new Xv({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});wF(e,n),MF(t,n,this._defsUsePending,!1,!1),IF(n,e);var i=n.style,r=i.fontSize;r&&r<9&&(i.fontSize=9,n.scaleX*=r/9,n.scaleY*=r/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=function(){hF={g:function(t,e){var n=new Ip;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new sy;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new tI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new EI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new iI;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,i=t.getAttribute("points");i&&(n=SF(i));var r=new DI({shape:{points:n||[]},silent:!0});return wF(e,r),MF(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var n,i=t.getAttribute("points");i&&(n=SF(i));var r=new PI({shape:{points:n||[]},silent:!0});return wF(e,r),MF(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var n=new Jv;return wF(e,n),MF(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(o);var a=new Ip;return wF(e,a),MF(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new Ip;return wF(e,a),MF(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(o),a},path:function(t,e){var n=t.getAttribute("d")||"",i=jM(n);return wF(e,i),MF(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),_F={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),o=new KI(e,n,i,r);return xF(t,o),bF(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),r=new JI(e,n,i);return xF(t,r),bF(t,r),r}};function xF(t,e){var n=t.getAttribute("gradientUnits");"userSpaceOnUse"===n&&(e.global=!0)}function bF(t,e){var n=t.firstChild;while(n){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i=n.getAttribute("offset"),r=void 0;r=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var o={};NF(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:r,color:a})}n=n.nextSibling}}function wF(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),As(e.__inheritedStyle,t.__inheritedStyle))}function SF(t){for(var e=kF(t),n=[],i=0;i0;o-=2){var a=i[o],s=i[o-1],l=kF(a);switch(r=r||bu(),s){case"translate":Iu(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Tu(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Cu(r,r,-parseFloat(l[0])*PF);break;case"skewX":var u=Math.tan(parseFloat(l[0])*PF);Mu(r,[1,0,u,1,0,0],r);break;case"skewY":var h=Math.tan(parseFloat(l[0])*PF);Mu(r,[1,h,0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5]);break}}e.setLocalTransform(r)}}var OF=/([^\s:;]+)\s*:\s*([^:;]+)/g;function NF(t,e,n){var i=t.getAttribute("style");if(i){var r;OF.lastIndex=0;while(null!=(r=OF.exec(i))){var o=r[1],a=_l(fF,o)?fF[o]:null;a&&(e[a]=r[2]);var s=_l(vF,o)?vF[o]:null;s&&(n[s]=r[2])}}}function EF(t,e,n){for(var i=0;in&&(t=r,n=a)}if(t)return ZF(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var n=[1/0,1/0],i=[-1/0,-1/0],r=this.geometries;return Rs(r,(function(e){"polygon"===e.type?UF(e.exterior,n,i,t):Rs(e.points,(function(e){UF(e,n,i,t)}))})),isFinite(n[0])&&isFinite(n[1])&&isFinite(i[0])&&isFinite(i[1])||(n[0]=n[1]=i[0]=i[1]=0),e=new Gu(n[0],n[1],i[0]-n[0],i[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,r=n.length;i>1^-(1&s),l=l>>1^-(1&l),s+=r,l+=o,r=s,o=l,i.push([s/n,l/n])}return i}function rG(t,e){return t=eG(t),Os(Es(t.features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new XF(o[0],o.slice(1)));break;case"MultiPolygon":Rs(i.coordinates,(function(t){t[0]&&r.push(new XF(t[0],t.slice(1)))}));break;case"LineString":r.push(new jF([i.coordinates]));break;case"MultiLineString":r.push(new jF(i.coordinates))}var a=new qF(n[e||"name"],r,n.cp);return a.properties=n,a}))}for(var oG=[126,25],aG="南海诸岛",sG=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],lG=0;lG0,g={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:f,isGeo:o,transformInfoRaw:c};"geoJSON"===s.resourceType?this._buildGeoJSON(g):"geoSVG"===s.resourceType&&this._buildSVG(g),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=gl(),n=gl(),i=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=t.geo.projection,l=s&&s.stream;function u(t,e){return e&&(t=e(t)),t&&[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]}function h(t){for(var e=[],n=!l&&s&&s.project,i=0;i=0)&&(d=r);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;n_(e,i_(i),{labelFetcher:d,labelDataIndex:c,defaultText:n},p);var f=e.getTextContent();if(f&&(IG(f).ignore=f.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function LG(t,e,n,i,r,o){t.data?t.data.setItemGraphicEl(o,e):Cy(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:n,region:i&&i.option||{}}}function PG(t,e,n,i,r){t.data||zC({el:e,componentModel:r,itemName:n,itemTooltipOption:i.get("tooltip")})}function RG(t,e,n,i,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=i.getModel("emphasis"),a=o.get("focus");return km(e,a,o.get("blurScope"),o.get("disabled")),t.isGeo&&zm(e,r,n),a}function OG(t,e,n){var i,r=[];function o(){i=[]}function a(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(t,e){isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&s.polygonStart(),Rs(t,(function(t){s.lineStart();for(var e=0;e-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(IM);const VG=BG;function FG(t,e){var n={};return Rs(t,(function(t){t.each(t.mapDimension("value"),(function(e,i){var r="ec-"+t.getName(i);n[r]=n[r]||[],isNaN(e)||n[r].push(e)}))})),t[0].map(t[0].mapDimension("value"),(function(i,r){for(var o,a="ec-"+t[0].getName(r),s=0,l=1/0,u=-1/0,h=n[a].length,c=0;c1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=c[1]-p.height/2,p.x=c[0]-p.width/2;else{var b=t.getBoxLayoutParams();b.aspect=_,p=Hx(b,{width:y,height:m})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}function QG(t,e){Rs(e.get("geoCoord"),(function(e,n){t.addGeoCoord(n,e)}))}var tH=function(){function t(){this.dimensions=jG}return t.prototype.create=function(t,e){var n=[];function i(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}t.eachComponent("geo",(function(t,r){var o=t.get("map"),a=new $G(o+r,o,Ts({nameMap:t.get("nameMap")},i(t)));a.zoomLimit=t.get("scaleLimit"),n.push(a),t.coordinateSystem=a,a.model=t,a.resize=JG,a.resize(t,e)})),t.eachSeries((function(t){var e=t.get("coordinateSystem");if("geo"===e){var i=t.get("geoIndex")||0;t.coordinateSystem=n[i]}}));var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),Rs(r,(function(t,r){var o=Os(t,(function(t){return t.get("nameMap")})),a=new $G(r,r,Ts({nameMap:Cs(o)},i(t[0])));a.zoomLimit=el.apply(null,Os(t,(function(t){return t.get("scaleLimit")}))),n.push(a),a.resize=JG,a.resize(t[0],e),Rs(t,(function(t){t.coordinateSystem=a,QG(a,t)}))})),n},t.prototype.getFilledRegions=function(t,e,n,i){for(var r=(t||[]).slice(),o=gl(),a=0;a=0;a--){var s=i[a];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},r.push(s)}}function pH(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,r=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){mH(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=_H(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function fH(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function gH(t){return arguments.length?t:MH}function vH(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function yH(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function mH(t){var e=t.children,n=e.length,i=0,r=0;while(--n>=0){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}function _H(t,e,n,i){if(e){var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,u=o.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;while(s=xH(s),o=bH(o),s&&o){r=xH(r),a=bH(a),r.hierNode.ancestor=t;var d=s.hierNode.prelim+c-o.hierNode.prelim-u+i(s,o);d>0&&(SH(wH(s,t,n),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=r.hierNode.modifier,h+=a.hierNode.modifier}s&&!xH(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=c-l),o&&!bH(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-h,n=t)}return n}function xH(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function bH(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function wH(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function SH(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function MH(t,e){return t.parentNode===e.parentNode?1:2}var IH=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),CH=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new IH},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,r=e.parentPoint,o=n[0],a=n[i-1];if(1===i)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=zp(e.forkPosition,1),c=[];c[l]=r[l],c[u]=r[u]+(a[u]-r[u])*h,t.moveTo(r[0],r[1]),t.lineTo(c[0],c[1]),t.moveTo(o[0],o[1]),c[l]=o[l],t.lineTo(c[0],c[1]),c[l]=a[l],t.lineTo(c[0],c[1]),t.lineTo(a[0],a[1]);for(var d=1;dm.x,b||(x-=Math.PI));var S=b?"left":"right",M=s.getModel("label"),I=M.get("rotate"),C=I*(Math.PI/180),T=v.getTextContent();T&&(v.setTextConfig({position:M.get("position")||S,rotation:null==I?-x:C,origin:"center"}),T.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),D="relative"===A?vl(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;D&&(Cy(n).focus=D),kH(r,a,h,n,f,p,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&i.hoverState===Ry||nm(n.__edge,e)}})}function kH(t,e,n,i,r,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),d=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new GI({shape:OH(h,c,d,r,r)})),Zm(g,{shape:OH(h,c,d,o,a)},t));else if("polyline"===u)if("orthogonal"===h){if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var v=e.children,y=[],m=0;me&&(e=i.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0)){var e=this.hostTree,n=e.data.getItemModel(this.dataIndex);return n.getModel(t)}},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e=0){var i=n.getData().tree.root,r=t.targetNode;if(Us(r)&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function JH(t){var e=[];while(t)t=t.parentNode,t&&e.push(t);return e.reverse()}function QH(t,e){var n=JH(t);return Ds(n,e)>=0}function tW(t,e){var n=[];while(t){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var eW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return qa(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i=new A_(n,this,this.ecModel),r=KH.createTree(e,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t}))}var a=0;r.eachNode("preorder",(function(t){t.depth>a&&(a=t.depth)}));var s=t.expandAndCollapse,l=s&&t.initialTreeDepth>=0?t.initialTreeDepth:a;return r.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=l})),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().tree,r=i.root.children[0],o=i.getNodeByDataIndex(t),a=o.getValue(),s=o.name;while(o&&o!==r)s=o.parentNode.name+"."+s,o=o.parentNode;return qS("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=tW(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(IM);const nW=eW;function iW(t,e,n){var i,r=[t],o=[];while(i=r.pop())if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s=0;o--)i.push(r[o])}}function oW(t,e){t.eachSeriesByType("tree",(function(t){aW(t,e)}))}function aW(t,e){var n=yH(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=gH((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(r=n.width,o=n.height,a=gH());var s=t.getData().tree.root,l=s.children[0];if(l){dH(s),iW(l,pH,a),s.hierNode.modifier=-l.hierNode.prelim,rW(l,fH);var u=l,h=l,c=l;rW(l,(function(t){var e=t.getLayout().x;eh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)}));var d=u===h?1:a(u,h)/2,p=d-u.getLayout().x,f=0,g=0,v=0,y=0;if("radial"===i)f=r/(h.getLayout().x+d+p),g=o/(c.depth-1||1),rW(l,(function(t){v=(t.getLayout().x+p)*f,y=(t.depth-1)*g;var e=vH(v,y);t.setLayout({x:e.x,y:e.y,rawX:v,rawY:y},!0)}));else{var m=t.getOrient();"RL"===m||"LR"===m?(g=o/(h.getLayout().x+d+p),f=r/(c.depth-1||1),rW(l,(function(t){y=(t.getLayout().x+p)*g,v="LR"===m?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:v,y},!0)}))):"TB"!==m&&"BT"!==m||(f=r/(h.getLayout().x+d+p),g=o/(c.depth-1||1),rW(l,(function(t){v=(t.getLayout().x+p)*f,y="TB"===m?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:v,y},!0)})))}}}function sW(t){t.eachSeriesByType("tree",(function(t){var e=t.getData(),n=e.tree;n.eachNode((function(t){var n=t.getModel(),i=n.getModel("itemStyle").getItemStyle(),r=e.ensureUniqueItemVisual(t.dataIndex,"style");Ts(r,i)}))}))}function lW(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=t.dataIndex,i=e.getData().tree,r=i.getNodeByDataIndex(n);r.isExpand=!r.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(t,e,n){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var i=e.coordinateSystem,r=aH(i,t,void 0,n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}function uW(t){t.registerChartView(NH),t.registerSeriesModel(nW),t.registerLayout(oW),t.registerVisual(sW),lW(t)}var hW=["treemapZoomToNode","treemapRender","treemapMove"];function cW(t){for(var e=0;e1)n=n.parentNode;var r=Db(t.ecModel,n.name||n.dataIndex+"",i);e.setVisual("decal",r)}))}var pW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};fW(n);var i=t.levels||[],r=this.designatedVisualItemStyle={},o=new A_({itemStyle:r},this,e);i=t.levels=gW(i,e);var a=Os(i||[],(function(t){return new A_(t,o,e)}),this),s=KH.createTree(n,this,l);function l(t){t.wrapMethod("getItemModel",(function(t,e){var n=s.getNodeByDataIndex(e),i=n?a[n.depth]:null;return t.parentModel=i||o,t}))}return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),o=i.getName(t);return qS("nameValue",{name:o,value:r})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=tW(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Ts(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=gl(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){dW(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(IM);function fW(t){var e=0;Rs(t.children,(function(t){fW(t);var n=t.value;Hs(n)&&(n=n[0]),e+=n}));var n=t.value;Hs(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Hs(t.value)?t.value[0]=n:t.value=n}function gW(t,e){var n=hf(e.get("color")),i=hf(e.get(["aria","decal","decals"]));if(n){var r,o;t=t||[],Rs(t,(function(t){var e=new A_(t),n=e.get("color"),i=e.get("decal");(e.get(["itemStyle","color"])||n&&"none"!==n)&&(r=!0),(e.get(["itemStyle","decal"])||i&&"none"!==i)&&(o=!0)}));var a=t[0]||(t[0]={});return r||(a.color=n.slice()),!o&&i&&(a.decal=i.slice()),t}}const vW=pW;var yW=8,mW=8,_W=5,xW=function(){function t(t){this.group=new Ip,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=r.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),h={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,h,l),this._renderContent(t,h,a,s,l,u,i),Wx(o,h.pos,h.box)}},t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var r=Mf(i.getModel().get("name"),""),o=n.getTextRect(r),a=Math.max(o.width+2*yW,e.emptyItemWidth);e.totalWidth+=a+mW,e.renderList.push({node:i,text:r,width:a})}},t.prototype._renderContent=function(t,e,n,i,r,o,a){for(var s=0,l=e.emptyItemWidth,u=t.get(["breadcrumb","height"]),h=Gx(e.pos,e.box),c=e.totalWidth,d=e.renderList,p=i.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],v=g.node,y=g.width,m=g.text;c>h.width&&(c-=y-l,y=l,m=null);var _=new DI({shape:{points:bW(s,0,y,u,f===d.length-1,0===f)},style:As(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Iy({style:r_(r,{text:m})}),textConfig:{position:"inside"},z2:1e4*zy,onclick:Gs(a,v)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=r_(o,{text:m}),_.ensureState("emphasis").style=p,km(_,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(_),wW(_,t,v),s+=y+mW}},t.prototype.remove=function(){this.group.removeAll()},t}();function bW(t,e,n,i,r,o){var a=[[r?t:t-_W,e],[t+n,e],[t+n,e+i],[r?t:t-_W,e+i]];return!o&&a.splice(2,0,[t+n+_W,e+i/2]),!r&&a.push([t,e+i/2]),a}function wW(t,e,n){Cy(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&tW(n,e)}}const SW=xW;var MW=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,i,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){e--,e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,r=this._storage.length;iAW||Math.abs(t.dy)>AW)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY;if("animating"!==this._state){var i=this.seriesModel.getData().tree.root;if(!i)return;var r=i.getLayout();if(!r)return;var o=new Gu(r.x,r.y,r.width,r.height),a=this.seriesModel.layoutInfo;e-=a.x,n-=a.y;var s=bu();Iu(s,s,[-e,-n]),Tu(s,s,[t.scale,t.scale]),Iu(s,s,[e,n]),o.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var o=r.hostTree.data.getItemModel(r.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Nx(a,s)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2),n||(n={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new SW(this.group))).render(t,e,n.node,(function(e){"animating"!==i._state&&(QH(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=BW(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n,i=this.seriesModel.getViewRoot();return i.eachNode({attr:"viewChildren",order:"preorder"},(function(i){var r=this._storage.background[i.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),a=r.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:i,offsetX:o[0],offsetY:o[1]}}}),this),n},e.type="treemap",e}(jC);function BW(){return{nodeGroup:[],background:[],content:[]}}function VW(t,e,n,i,r,o,a,s,l,u){if(a){var h=a.getLayout(),c=t.getData(),d=a.getModel();if(c.setItemGraphicEl(a.dataIndex,null),h&&h.isInView){var p=h.width,f=h.height,g=h.borderWidth,v=h.invisible,y=a.getRawIndex(),m=s&&s.getRawIndex(),_=a.viewChildren,x=h.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),M=d.getModel(["blur","itemStyle"]),I=d.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,T=F("nodeGroup",CW);if(T){if(l.add(T),T.x=h.x||0,T.y=h.y||0,T.markRedraw(),EW(T).nodeWidth=p,EW(T).nodeHeight=f,h.isAboveViewRoot)return T;var A=F("background",TW,u,PW);A&&N(T,A,b&&h.upperLabelHeight);var D=d.getModel("emphasis"),k=D.get("focus"),L=D.get("blurScope"),P=D.get("disabled"),R="ancestor"===k?a.getAncestorsIndices():"descendant"===k?a.getDescendantIndices():k;if(b)Em(T)&&Nm(T,!1),A&&(Nm(A,!P),c.setItemGraphicEl(a.dataIndex,A),Lm(A,R,L));else{var O=F("content",TW,u,RW);O&&E(T,O),A.disableMorphing=!0,A&&Em(A)&&Nm(A,!1),Nm(T,!P),c.setItemGraphicEl(a.dataIndex,T),Lm(T,R,L)}return T}}}function N(e,n,i){var r=Cy(n);if(r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:C}),v)z(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=NW(w);l.fill=s;var u=OW(S);u.fill=S.get("borderColor");var h=OW(M);h.fill=M.get("borderColor");var c=OW(I);if(c.fill=I.get("borderColor"),i){var d=p-2*g;B(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=h,n.ensureState("select").style=c,lm(n)}e.add(n)}function E(e,n){var i=Cy(n);i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var r=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:o,r:C}),v)z(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=NW(w);u.fill=l,u.decal=s.decal;var h=OW(S),c=OW(M),d=OW(I);B(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=h,n.ensureState("blur").style=c,n.ensureState("select").style=d,lm(n)}e.add(n)}function z(t){!t.invisible&&o.push(t)}function B(e,n,i,r){var o=d.getModel(r?kW:DW),s=Mf(d.get("name"),null),l=o.getShallow("show");n_(e,i_(d,r?kW:DW),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var c=u.style,p=ol(c.padding||0);r&&(e.setTextConfig({layoutRect:r}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((r?r.width:e.shape.width)-p[1]-p[3],0),n=Math.max((r?r.height:e.shape.height)-p[0]-p[2],0);c.width===t&&c.height===n||u.setStyle({width:t,height:n})},c.truncateMinChar=2,c.lineOverflow="truncate",V(c,r,h);var f=u.getState("emphasis");V(f?f.style:null,r,h)}}function V(e,n,i){var r=e?e.text:null;if(!n&&i.isLeafRoot&&null!=r){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+r:r}}function F(t,i,o,a){var s=null!=m&&n[t][m],l=r[t];return s?(n[t][m]=null,G(l,s)):v||(s=new i,s instanceof zg&&(s.z2=FW(o,a)),H(l,s)),e[t][y]=s}function G(t,e){var n=t[y]={};e instanceof CW?(n.oldX=e.x,n.oldY=e.y):n.oldShape=Ts({},e.shape)}function H(t,e){var n=t[y]={},o=a.parentNode,s=e instanceof Ip;if(o&&(!i||"drillDown"===i.direction)){var l=0,u=0,h=r.background[o.getRawIndex()];!i&&h&&h.oldShape&&(l=h.oldShape.width,u=h.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}function FW(t,e){return t*LW+e}const GW=zW;var HW=Rs,WW=Xs,UW=-1,ZW=function(){function t(e){var n=e.mappingMethod,i=e.type,r=this.option=Ms(e);this.type=i,this.mappingMethod=n,this._normalizeData=iU[n];var o=t.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(jW(r),YW(r)):"category"===n?r.categories?XW(r):jW(r,!0):(al("linear"!==n||r.dataExtent),jW(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return Fs(this._normalizeData,this)},t.listVisualTypes=function(){return Bs(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){Xs(t)?Rs(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,i){var r,o=Hs(e)?[]:Xs(e)?{}:(r=!0,null);return t.eachVisual(e,(function(t,e){var a=n.call(i,t,e);r?o=a:o[e]=a})),o},t.retrieveVisuals=function(e){var n,i={};return e&&HW(t.visualHandlers,(function(t,r){e.hasOwnProperty(r)&&(i[r]=e[r],n=!0)})),n?i:null},t.prepareVisualTypes=function(t){if(Hs(t))t=t.slice();else{if(!WW(t))return[];var e=[];HW(t,(function(t,n){e.push(n)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var i,r=1/0,o=0,a=e.length;o=0;o--)null==i[o]&&(delete n[e[o]],e.pop())}function jW(t,e){var n=t.visual,i=[];Xs(n)?HW(n,(function(t){i.push(t)})):null!=n&&i.push(n);var r={color:1,symbol:1};e||1!==i.length||r.hasOwnProperty(t.type)||(i[1]=i[0]),nU(t,i)}function qW(t){return{applyVisual:function(e,n,i){var r=this.mapValueToVisual(e);i("color",t(n("color"),r))},_normalizedToVisual:tU([0,1])}}function KW(t){var e=this.option.visual;return e[Math.round(Ep(t,[0,1],[0,e.length-1],!0))]||{}}function $W(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function JW(t){var e=this.option.visual;return e[this.option.loop&&t!==UW?t%e.length:t]}function QW(){return this.option.visual[0]}function tU(t){return{linear:function(e){return Ep(e,t,this.option.visual,!0)},category:JW,piecewise:function(e,n){var i=eU.call(this,n);return null==i&&(i=Ep(e,t,this.option.visual,!0)),i},fixed:QW}}function eU(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=ZW.findPieceIndex(t,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function nU(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=Os(e,(function(t){var e=fc(t);return e||[0,0,0,1]}))),e}var iU={linear:function(t){return Ep(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=ZW.findPieceIndex(t,e,!0);if(null!=n)return Ep(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?UW:e},fixed:xl};function rU(t,e,n){return t?e<=n:e=n.length||t===n[t.depth]){var o=vU(r,u,t,e,f,i);uU(t,o,n,i)}}))}else s=cU(u),h.fill=s}}function hU(t,e,n){var i=Ts({},e),r=n.designatedVisualItemStyle;return Rs(["color","colorAlpha","colorSaturation"],(function(n){r[n]=e[n];var o=t.get(n);r[n]=null,null!=o&&(i[n]=o)})),i}function cU(t){var e=pU(t,"color");if(e){var n=pU(t,"colorAlpha"),i=pU(t,"colorSaturation");return i&&(e=xc(e,null,null,i)),n&&(e=bc(e,n)),e}}function dU(t,e){return null!=e?xc(e,null,null,t):null}function pU(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function fU(t,e,n,i,r,o){if(o&&o.length){var a=gU(e,"color")||null!=r.color&&"none"!==r.color&&(gU(e,"colorAlpha")||gU(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:a.name,dataExtent:u,visual:a.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new oU(c);return sU(d).drColorMappingBy=h,d}}}function gU(t,e){var n=t.get(e);return Hs(n)&&n.length?{name:e,range:n}:null}function vU(t,e,n,i,r,o){var a=Ts({},e);if(r){var s=r.type,l="color"===s&&sU(r).drColorMappingBy,u="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(u)}return a}var yU=Math.max,mU=Math.min,_U=el,xU=Rs,bU=["itemStyle","borderWidth"],wU=["itemStyle","gapWidth"],SU=["upperLabel","show"],MU=["upperLabel","height"];const IU={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=Hx(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],u=zp(_U(s.width,l[0]),r),h=zp(_U(s.height,l[1]),o),c=i&&i.type,d=["treemapZoomToNode","treemapRootToNode"],p=$H(i,d,t),f="treemapRender"===c||"treemapMove"===c?i.rootRect:null,g=t.getViewRoot(),v=JH(g);if("treemapMove"!==c){var y="treemapZoomToNode"===c?RU(t,p,g,u,h):f?[f.width,f.height]:[u,h],m=a.sort;m&&"asc"!==m&&"desc"!==m&&(m="desc");var _={squareRatio:a.squareRatio,sort:m,leafDepth:a.leafDepth};g.hostTree.clearLayouts();var x={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};g.setLayout(x),CU(g,_,!1,0),x=g.getLayout(),xU(v,(function(t,e){var n=(v[e+1]||g).getValue();t.setLayout(Ts({dataExtent:[n,n],borderWidth:0,upperHeight:0},x))}))}var b=t.getData().tree.root;b.setLayout(OU(s,f,p),!0),t.setLayoutInfo(s),NU(b,new Gu(-s.x,-s.y,r,o),v,g,0)}};function CU(t,e,n,i){var r,o;if(!t.isRemoved()){var a=t.getLayout();r=a.width,o=a.height;var s=t.getModel(),l=s.get(bU),u=s.get(wU)/2,h=EU(s),c=Math.max(l,h),d=l-u,p=c-u;t.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0),r=yU(r-2*d,0),o=yU(o-d-p,0);var f=r*o,g=TU(t,s,f,e,n,i);if(g.length){var v={x:d,y:p,width:r,height:o},y=mU(r,o),m=1/0,_=[];_.area=0;for(var x=0,b=g.length;x=0;l--){var u=r["asc"===i?a-l-1:l].getValue();u/n*ea[1]&&(a[1]=e)}))):a=[NaN,NaN],{sum:i,dataExtent:a}}function LU(t,e,n){for(var i=0,r=1/0,o=0,a=void 0,s=t.length;oi&&(i=a));var l=t.area*t.area,u=e*e*n;return l?yU(u*i/l,l/(u*r)):1/0}function PU(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],h=e?t.area/e:0;(r||h>n[l[a]])&&(h=n[l[a]]);for(var c=0,d=t.length;cZp&&(u=Zp),a=o}ui&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a0&&(m[0]=-m[0],m[1]=-m[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(y[1],y[0]);u[0].8?"left":h[0]<-.8?"right":"center",d=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":i.x=-h[0]*f+l[0],i.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",d=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+w,c=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+w,c="center",i.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+u[0],i.y=u[1]+w,c=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-w;break}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||d,align:i.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(Ip);const AZ=TZ;var DZ=function(){function t(t){this.group=new Ip,this._LineCtor=t||AZ}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=LZ(t);t.diff(r).add((function(n){e._doAdd(t,n,o)})).update((function(n,i){e._doUpdate(r,t,i,n,o)})).remove((function(t){i.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,n){e.updateLayout(t,n)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=LZ(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||kZ(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i0}function LZ(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:i_(e)}}function PZ(t){return isNaN(t[0])||isNaN(t[1])}function RZ(t){return t&&!PZ(t[0])&&!PZ(t[1])}const OZ=DZ;var NZ=[],EZ=[],zZ=[],BZ=Fh,VZ=El,FZ=Math.abs;function GZ(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,h=.1;h<=.9;h+=.1){NZ[0]=BZ(r[0],o[0],a[0],h),NZ[1]=BZ(r[1],o[1],a[1],h);var c=FZ(VZ(NZ,e)-l);c=0?i+=u:i-=u:f>=0?i-=u:i+=u}return i}function HZ(t,e){var n=[],i=Uh,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge((function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[Ml(l[0]),Ml(l[1])],l[2]&&l.__original.push(Ml(l[2])));var c=l.__original;if(null!=l[2]){if(Sl(r[0],c[0]),Sl(r[1],c[2]),Sl(r[2],c[1]),u&&"none"!==u){var d=iZ(t.node1),p=GZ(r,c[0],d*e);i(r[0][0],r[1][0],r[2][0],p,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],p,n),r[0][1]=n[3],r[1][1]=n[4]}if(h&&"none"!==h){d=iZ(t.node2),p=GZ(r,c[1],d*e);i(r[0][0],r[1][0],r[2][0],p,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],p,n),r[1][1]=n[1],r[2][1]=n[2]}Sl(l[0],r[0]),Sl(l[1],r[2]),Sl(l[2],r[1])}else{if(Sl(o[0],c[0]),Sl(o[1],c[1]),Al(a,o[1],o[0]),Pl(a,a),u&&"none"!==u){d=iZ(t.node1);Tl(o[0],o[0],a,d*e)}if(h&&"none"!==h){d=iZ(t.node2);Tl(o[1],o[1],a,-d*e)}Sl(l[0],o[0]),Sl(l[1],o[1])}}))}function WZ(t){return"view"===t.type}var UZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){var n=new _O,i=new OZ,r=this.group;this._controller=new sF(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(WZ(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):Zm(s,l,t)}HZ(t.getGraph(),nZ(t));var u=t.getData();o.updateData(u);var h=t.getEdgeData();a.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var c=t.forceLayout,d=t.get(["force","layoutAnimation"]);c&&this._startForceLayoutIteration(c,d);var p=t.get("layout");u.graph.eachNode((function(e){var n=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var a=o.get("draggable");a&&r.on("drag",(function(o){switch(p){case"force":c.warmUp(),!i._layouting&&i._startForceLayoutIteration(c,d),c.setFixed(n),u.setItemLayout(n,[r.x,r.y]);break;case"circular":u.setItemLayout(n,[r.x,r.y]),e.setLayout({fixed:!0},!0),aZ(t,"symbolSize",e,[o.offsetX,o.offsetY]),i.updateLayout(t);break;case"none":default:u.setItemLayout(n,[r.x,r.y]),tZ(t.getGraph(),t),i.updateLayout(t);break}})).on("dragend",(function(){c&&c.setUnfixed(n)})),r.setDraggable(a,!!o.get("cursor"));var s=o.get(["emphasis","focus"]);"adjacency"===s&&(Cy(r).focus=e.getAdjacentDataIndices())}})),u.graph.eachEdge((function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Cy(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=u.getLayout("cx"),v=u.getLayout("cy");u.graph.eachNode((function(t){lZ(t,f,g,v)})),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;(function i(){t.step((function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())}))})()},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker((function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!dF(e,n,t)})),WZ(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){lF(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){uF(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),HZ(t.getGraph(),nZ(t)),i._lineDraw.updateLayout(),n.updateLabelLayout()}))):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=nZ(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(n)}))},e.prototype.updateLayout=function(t){HZ(t.getGraph(),nZ(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(jC);const ZZ=UZ;function YZ(t){return"_EC_"+t}var XZ=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[YZ(t)]){var i=new jZ(t,e);return i.hostGraph=this,this.nodes.push(i),n[YZ(t)]=i,i}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[YZ(t)]},t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if(Ys(t)&&(t=this.nodes[t]),Ys(e)&&(e=this.nodes[e]),t instanceof jZ||(t=i[YZ(t)]),e instanceof jZ||(e=i[YZ(e)]),t&&e){var o=t.id+"-"+e.id,a=new qZ(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof jZ&&(t=t.id),e instanceof jZ&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof jZ||(e=this._nodesMap[YZ(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0}));for(r=0,o=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}Ls(jZ,KZ("hostGraph","data")),Ls(qZ,KZ("hostGraph","edgeData"));const $Z=XZ;function JZ(t,e,n,i,r){for(var o=new $Z(i),a=0;a "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=sO(t,n);else{var g=Xb.get(f),v=g&&g.dimensions||[];Ds(v,"value")<0&&v.concat(["value"]);var y=UR(t,{coordDimensions:v,encodeDefine:n.getEncode()}).dimensions;p=new WR(y,n),p.initData(t)}var m=new WR(["value"],n);return m.initData(l,s),r&&r(p,m),YH({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:m},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var QZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new IE(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),cf(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],r=this;if(i&&n){KU(this);var o=JZ(i,n,this,!0,a);return Rs(o.edges,(function(t){$U(t.node1,t.node2,this,t.dataIndex)}),this),o.data}function a(t,e){t.wrapMethod("getItemModel",(function(t){var e=r._categoriesModels,n=t.getShallow("category"),i=e[n];return i&&(i.parentModel=t.parentModel,t.parentModel=i),t}));var n=A_.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=o,i}function o(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=o,t.getModel=i,t}))}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),qS("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}var u=cM({series:this,dataIndex:t,multipleSeries:e});return u},e.prototype._updateCategoriesData=function(){var t=Os(this.option.categories||[],(function(t){return null!=t.value?t:Ts({value:0},t)})),e=new WR(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const tY=QZ;var eY={type:"graphRoam",event:"graphRoam",update:"none"};function nY(t){t.registerChartView(ZZ),t.registerSeriesModel(tY),t.registerProcessor(BU),t.registerVisual(VU),t.registerVisual(GU),t.registerLayout(eZ),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,uZ),t.registerLayout(dZ),t.registerCoordinateSystem("graphView",{dimensions:YG.dimensions,create:fZ}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},xl),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},xl),t.registerAction(eY,(function(t,e,n){e.eachComponent({mainType:"series",query:t},(function(e){var i=e.coordinateSystem,r=aH(i,t,void 0,n);e.setCenter&&e.setCenter(r.center),e.setZoom&&e.setZoom(r.zoom)}))}))}var iY=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),rY=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new iY},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=r/3?1:2),l=e.y-i(a)*o*(o>=r/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)},e}(Uv);const oY=rY;function aY(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r),a=zp(n[0],e.getWidth()),s=zp(n[1],e.getHeight()),l=zp(t.get("radius"),o/2);return{cx:a,cy:s,r:l}}function sY(t,e){var n=null==t?"":t+"";return e&&(Us(e)?n=e.replace("{value}",n):Ws(e)&&(n=e(t))),n}var lY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),r=aY(t,n);this._renderMain(t,e,n,i,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,r){var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),h=u.get("roundCap"),c=h?kN:bI,d=u.get("show"),p=u.getModel("lineStyle"),f=p.get("width"),g=[s,l];vv(g,!a),s=g[0],l=g[1];for(var v=l-s,y=s,m=[],_=0;d&&_=t&&(0===e?0:i[e-1][0])Math.PI/2&&(B+=Math.PI)):"tangential"===z?B=-M-Math.PI/2:Ys(z)&&(B=z*Math.PI/180),0===B?c.add(new Iy({style:r_(_,{text:R,x:N,y:E,verticalAlign:h<-.8?"top":h>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:O}),silent:!0})):c.add(new Iy({style:r_(_,{text:R,x:N,y:E,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:N,originY:E,rotation:B}))}if(m.get("show")&&k!==x){L=m.get("distance");L=L?L+l:l;for(var V=0;V<=b;V++){u=Math.cos(M),h=Math.sin(M);var F=new EI({shape:{x1:u*(f-L)+d,y1:h*(f-L)+p,x2:u*(f-S-L)+d,y2:h*(f-S-L)+p},silent:!0,style:A});"auto"===A.stroke&&F.setStyle({stroke:i((k+V/b)/x)}),c.add(F),M+=C}M-=C}else M+=I}},e.prototype._renderPointer=function(t,e,n,i,r,o,a,s,l){var u=this.group,h=this._data,c=this._progressEls,d=[],p=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),v=t.getData(),y=v.mapDimension("value"),m=+t.get("min"),_=+t.get("max"),x=[m,_],b=[o,a];function w(e,n){var i,o=v.getItemModel(e),a=o.getModel("pointer"),s=zp(a.get("width"),r.r),l=zp(a.get("length"),r.r),u=t.get(["pointer","icon"]),h=a.get("offsetCenter"),c=zp(h[0],r.r),d=zp(h[1],r.r),p=a.get("keepAspect");return i=u?sA(u,c-s/2,d-l,s,l,null,p):new oY({shape:{angle:-Math.PI/2,width:s,r:l,x:c,y:d}}),i.rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function S(t,e){var n=f.get("roundCap"),i=n?kN:bI,a=f.get("overlap"),u=a?f.get("width"):l/v.count(),h=a?r.r-u:r.r-(t+1)*u,c=a?r.r:r.r-t*u,d=new i({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:s,r0:h,r:c}});return a&&(d.z2=_-v.get(y,t)%_),d}(g||p)&&(v.diff(h).add((function(e){var n=v.get(y,e);if(p){var i=w(e,o);Ym(i,{rotation:-((isNaN(+n)?b[0]:Ep(n,x,b,!0))+Math.PI/2)},t),u.add(i),v.setItemGraphicEl(e,i)}if(g){var r=S(e,o),a=f.get("clip");Ym(r,{shape:{endAngle:Ep(n,x,b,a)}},t),u.add(r),Ty(t.seriesIndex,v.dataType,e,r),d[e]=r}})).update((function(e,n){var i=v.get(y,e);if(p){var r=h.getItemGraphicEl(n),a=r?r.rotation:o,s=w(e,a);s.rotation=a,Zm(s,{rotation:-((isNaN(+i)?b[0]:Ep(i,x,b,!0))+Math.PI/2)},t),u.add(s),v.setItemGraphicEl(e,s)}if(g){var l=c[n],m=l?l.shape.endAngle:o,_=S(e,m),M=f.get("clip");Zm(_,{shape:{endAngle:Ep(i,x,b,M)}},t),u.add(_),Ty(t.seriesIndex,v.dataType,e,_),d[e]=_}})).execute(),v.each((function(t){var e=v.getItemModel(t),n=e.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=v.getItemGraphicEl(t),l=v.getItemVisual(t,"style"),u=l.fill;if(s instanceof Jv){var h=s.style;s.useStyle(Ts({image:h.image,x:h.x,y:h.y,width:h.width,height:h.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Ep(v.get(y,t),x,[0,1],!0))),s.z2EmphasisLift=0,Om(s,e),km(s,r,o,a)}if(g){var c=d[t];c.useStyle(v.getItemVisual(t,"style")),c.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),c.z2EmphasisLift=0,Om(c,e),km(c,r,o,a)}})),this._progressEls=d)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor"),i=n.get("show");if(i){var r=n.get("size"),o=n.get("icon"),a=n.get("offsetCenter"),s=n.get("keepAspect"),l=sA(o,e.cx-r/2+zp(a[0],e.r),e.cy-r/2+zp(a[1],e.r),r,r,null,s);l.z2=n.get("showAbove")?1:0,l.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(l)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,r){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),h=new Ip,c=[],d=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add((function(t){c[t]=new Iy({silent:!0}),d[t]=new Iy({silent:!0})})).update((function(t,e){c[t]=o._titleEls[e],d[t]=o._detailEls[e]})).execute(),a.each((function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new Ip,v=i(Ep(o,[l,u],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var m=y.get("offsetCenter"),_=r.cx+zp(m[0],r.r),x=r.cy+zp(m[1],r.r),b=c[e];b.attr({z2:f?0:2,style:r_(y,{x:_,y:x,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:v})}),g.add(b)}var w=n.getModel("detail");if(w.get("show")){var S=w.get("offsetCenter"),M=r.cx+zp(S[0],r.r),I=r.cy+zp(S[1],r.r),C=zp(w.get("width"),r.r),T=zp(w.get("height"),r.r),A=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:v,D=(b=d[e],w.get("formatter"));b.attr({z2:f?0:2,style:r_(w,{x:M,y:I,text:sY(o,D),width:isNaN(C)?null:C,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:A})}),f_(b,{normal:w},o,(function(t){return sY(t,D)})),p&&g_(b,e,a,t,{getFormattedLabel:function(t,e,n,i,r,a){return sY(a?a.interpolatedValue:o,D)}}),g.add(b)}h.add(g)})),this.group.add(h),this._titleEls=c,this._detailEls=d},e.type="gauge",e}(jC);const uY=lY;var hY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return qa(e,t),e.prototype.getInitialData=function(t,e){return SE(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(IM);const cY=hY;function dY(t){t.registerChartView(uY),t.registerSeriesModel(cY)}var pY=["itemStyle","opacity"],fY=function(t){function e(e,n){var i=t.call(this)||this,r=i,o=new PI,a=new Iy;return r.setTextContent(a),i.setTextGuideLine(o),i.updateData(e,n,!0),i}return qa(e,t),e.prototype.updateData=function(t,e,n){var i=this,r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(pY);l=null==l?1:l,n||$m(i),i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,Ym(i,{style:{opacity:l}},r,e)):Zm(i,{style:{opacity:l},shape:{points:a.points}},r,e),Om(i,o),this._updateLabel(t,e),km(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=s.label,u=t.getItemVisual(e,"style"),h=u.fill;n_(r,i_(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:u.opacity,defaultText:t.getName(e)},{normal:{align:l.textAlign,verticalAlign:l.verticalAlign}}),n.setTextConfig({local:!0,inside:!!l.inside,insideStroke:h,outsideFill:h});var c=l.linePoints;i.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Lu(c[0][0],c[0][1]):null},Zm(r,{style:{x:l.x,y:l.y}},o,e),r.attr({rotation:l.rotation,originX:l.x,originY:l.y,z2:10}),oL(n,aL(a),{stroke:h})},e}(DI),gY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add((function(t){var e=new fY(i,t);i.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)})).remove((function(e){var n=r.getItemGraphicEl(e);Km(n,t,e)})).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(jC);const vY=gY;var yY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new IE(Fs(this.getData,this),Fs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return SE(this,{coordDimensions:["value"],encodeDefaulter:Gs(gb,this)})},e.prototype._defaultLabelLine=function(t){cf(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=n.mapDimension("value"),o=n.getSum(r);return i.percent=o?+(n.get(r,e)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const mY=yY;function _Y(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function xY(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,(function(t){return t})),r=[],o="ascending"===e,a=0,s=t.count();aWY)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&YY(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function YY(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}const XY=UY;var jY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&Is(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){Rs(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[],n=Es(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this);Rs(n,(function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Jx);const qY=jY;var KY=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.axisIndex=o,a}return qa(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(LB);const $Y=KY;function JY(t,e,n,i,r,o){t=t||0;var a=n[1]-n[0];if(null!=r&&(r=tX(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=tX(s,[0,a]),r=o=tX(s,[r,o]),i=0}e[0]=tX(e[0],n),e[1]=tX(e[1],n);var l=QY(e,i);e[i]+=t;var u,h=r||0,c=n.slice();return l.sign<0?c[0]+=h:c[1]-=h,e[i]=tX(e[i],c),u=QY(e,i),null!=r&&(u.sign!==l.sign||u.spano&&(e[1-i]=e[i]+u.sign*o),e}function QY(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function tX(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var eX=Rs,nX=Math.min,iX=Math.max,rX=Math.floor,oX=Math.ceil,aX=Bp,sX=Math.PI,lX=function(){function t(t,e,n){this.type="parallel",this._axesMap=gl(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,r=t.parallelAxisIndex;eX(i,(function(t,n){var i=r[n],o=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new $Y(t,Kz(o),[0,0],o.get("type"),i)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return o>=n&&o<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(n){if(t.contains(n,e)){var i=n.getData();eX(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),qz(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],u=this.dimensions.length,h=uX(e.get("axisExpandWidth"),l),c=uX(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,p=e.get("axisExpandWindow");if(p)t=uX(p[1]-p[0],l),p[1]=p[0]+t;else{t=uX(h*(c-1),l);var f=e.get("axisExpandCenter")||rX(u/2);p=[h*f-t/2],p[1]=p[0]+t}var g=(s-t)/(u-c);g<3&&(g=0);var v=[rX(aX(p[0]/h,1))+1,oX(aX(p[1]/h,1))-1],y=g/h*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:g,axisExpandWindow:p,axisCount:u,winInnerIndices:v,axisExpandWindow0Pos:y}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;e.each((function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])})),eX(n,(function(e,n){var o=(i.axisExpandable?cX:hX)(n,i),a={horizontal:{x:o.position,y:i.axisLength},vertical:{x:0,y:o.position}},s={horizontal:sX/2,vertical:0},l=[a[r].x+t.x,a[r].y+t.y],u=s[r],h=bu();Cu(h,h,u),Iu(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];Rs(o,(function(e){a.push(t.mapDimension(e)),s.push(r.get(e).model)}));for(var l=this.hasAxisBrushed(),u=n;ur*(1-h[0])?(l="jump",a=s-r*(1-h[2])):(a=s-r*h[1])>=0&&(a=s-r*(1-h[1]))<=0&&(a=0),a*=e.axisExpandWidth/u,a?JY(a,i,o,"all"):l="none";else{var d=i[1]-i[0],p=o[1]*s/d;i=[iX(0,p-d/2)],i[1]=nX(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:l}},t}();function uX(t,e){return nX(iX(t,e[0]),e[1])}function hX(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function cX(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return t=0;n--)Vp(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;iSX}function HX(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function WX(t,e,n,i){var r=new Ip;return r.add(new sy({name:"main",style:XX(n),silent:!0,draggable:!0,cursor:"move",drift:Gs(JX,t,e,r,["n","s","w","e"]),ondragend:Gs(FX,e,{isEnd:!0})})),Rs(i,(function(n){r.add(new sy({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Gs(JX,t,e,r,n),ondragend:Gs(FX,e,{isEnd:!0})}))})),r}function UX(t,e,n,i){var r=i.brushStyle.lineWidth||0,o=xX(r,MX),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,h=n[0][1],c=n[1][1],d=h-o+r/2,p=c-o+r/2,f=h-a,g=c-s,v=f+r,y=g+r;YX(t,e,"main",a,s,f,g),i.transformable&&(YX(t,e,"w",l,u,o,y),YX(t,e,"e",d,u,o,y),YX(t,e,"n",l,u,v,o),YX(t,e,"s",l,p,v,o),YX(t,e,"nw",l,u,o,o),YX(t,e,"ne",d,u,o,o),YX(t,e,"sw",l,p,o,o),YX(t,e,"se",d,p,o,o))}function ZX(t,e){var n=e.__brushOption,i=n.transformable,r=e.childAt(0);r.useStyle(XX(n)),r.attr({silent:!i,cursor:i?"move":"default"}),Rs([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(n){var r=e.childOfName(n.join("")),o=1===n.length?KX(t,n[0]):$X(t,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?TX[o]+"-resize":null})}))}function YX(t,e,n,i,r,o,a){var s=e.childOfName(n);s&&s.setShape(nj(ej(t,e,[[i,r],[i+o,r+a]])))}function XX(t){return As({strokeNoScale:!0},t.brushStyle)}function jX(t,e,n,i){var r=[_X(t,n),_X(e,i)],o=[xX(t,n),xX(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function qX(t){return MC(t.group)}function KX(t,e){var n={w:"left",e:"right",n:"top",s:"bottom"},i={left:"w",right:"e",top:"n",bottom:"s"},r=CC(n[e],qX(t));return i[r]}function $X(t,e){var n=[KX(t,e[0]),KX(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}function JX(t,e,n,i,r,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=tj(e,r,o);Rs(i,(function(t){var e=CX[t];s[e[0]][e[1]]+=l[e[0]]})),a.range=t.fromRectRange(jX(s[0][0],s[1][0],s[0][1],s[1][1])),NX(e,n),FX(e,{isEnd:!1})}function QX(t,e,n,i){var r=e.__brushOption.range,o=tj(t,n,i);Rs(r,(function(t){t[0]+=o[0],t[1]+=o[1]})),NX(t,e),FX(t,{isEnd:!1})}function tj(t,e,n){var i=t.group,r=i.transformCoordToLocal(e,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function ej(t,e,n){var i=BX(t,e);return i&&i!==mX?i.clipPath(n,t._transform):Ms(n)}function nj(t){var e=_X(t[0][0],t[1][0]),n=_X(t[0][1],t[1][1]),i=xX(t[0][0],t[1][0]),r=xX(t[0][1],t[1][1]);return{x:e,y:n,width:i-e,height:r-n}}function ij(t,e,n){if(t._brushType&&!hj(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=zX(t,e,n);if(!t._dragging)for(var a=0;ai.getWidth()||n<0||n>i.getHeight()}var cj={lineX:dj(0),lineY:dj(1),rect:{createCover:function(t,e){function n(t){return t}return WX({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=HX(t);return jX(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){UX(t,e,n,i)},updateCommon:ZX,contain:oj},polygon:{createCover:function(t,e){var n=new Ip;return n.add(new PI({name:"main",style:XX(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new DI({name:"main",draggable:!0,drift:Gs(QX,t,e),ondragend:Gs(FX,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,i){e.childAt(0).setShape({points:ej(t,e,n)})},updateCommon:ZX,contain:oj}};function dj(t){return{createCover:function(e,n){return WX({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=HX(e),i=_X(n[0][t],n[1][t]),r=xX(n[0][t],n[1][t]);return[i,r]},updateCoverShape:function(e,n,i,r){var o,a=BX(e,n);if(a!==mX&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(t);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,o];t&&l.reverse(),UX(e,n,l,r)},updateCommon:ZX,contain:oj}}const pj=kX;function fj(t){return t=yj(t),function(e){return kC(e,t)}}function gj(t,e){return t=yj(t),function(n){var i=null!=e?e:n,r=i?t.width:t.height,o=i?t.x:t.y;return[o,o+(r||0)]}}function vj(t,e,n){var i=yj(t);return function(t,r){return i.contain(r[0],r[1])&&!dF(t,e,n)}}function yj(t){return Gu.create(t)}var mj=["axisLine","axisTickLabel","axisName"],_j=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new pj(n.getZr())).on("brush",Fs(this._onBrush,this))},e.prototype.render=function(t,e,n,i){if(!xj(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new Ip,this.group.add(this._axisGroup),t.get("show")){var o=wj(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,h=a.getAxisLayout(u),c=Ts({strokeContainThreshold:l},h),d=new iV(t,c);Rs(mj,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,t,o,l,n),DC(r,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,e,n,i,r,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=Gu.create({x:a[0],y:-r/2,width:s,height:r});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:fj(u),isTargetByCursor:vj(u,o,i),getLinearBrushOtherExtent:gj(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(bj(n))},e.prototype._onBrush=function(t){var e=t.areas,n=this.axisModel,i=n.axis,r=Os(e,(function(t){return[i.coordToData(t.range[0],!0),i.coordToData(t.range[1],!0)]}));(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(TM);function xj(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}function bj(t){var e=t.axis;return Os(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}function wj(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}const Sj=_j;var Mj={type:"axisAreaSelect",event:"axisAreaSelected"};function Ij(t){t.registerAction(Mj,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}var Cj={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Tj(t){t.registerComponentView(XY),t.registerComponentModel(qY),t.registerCoordinateSystem("parallel",gX),t.registerPreprocessor(FY),t.registerComponentModel(yX),t.registerComponentView(Sj),ez(t,"parallel",yX,Cj),Ij(t)}function Aj(t){Ek(Tj),t.registerChartView(PY),t.registerSeriesModel(EY),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,VY)}var Dj=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return t}(),kj=function(t){function e(e){return t.call(this,e)||this}return qa(e,t),e.prototype.getDefaultShape=function(){return new Dj},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){cm(this)},e.prototype.downplay=function(){dm(this)},e}(Uv),Lj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this,r=t.getGraph(),o=this.group,a=t.layoutInfo,s=a.width,l=a.height,u=t.getData(),h=t.getData("edge"),c=t.get("orient");this._model=t,o.removeAll(),o.x=a.x,o.y=a.y,r.eachEdge((function(e){var n=new kj,i=Cy(n);i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var r,a,u,d,p,f,g,v,y=e.getModel(),m=y.getModel("lineStyle"),_=m.get("curveness"),x=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),S=b.get("localY"),M=e.node2.getLayout(),I=e.node2.getModel(),C=I.get("localX"),T=I.get("localY"),A=e.getLayout();n.shape.extent=Math.max(1,A.dy),n.shape.orient=c,"vertical"===c?(r=(null!=w?w*s:x.x)+A.sy,a=(null!=S?S*l:x.y)+x.dy,u=(null!=C?C*s:M.x)+A.ty,d=null!=T?T*l:M.y,p=r,f=a*(1-_)+d*_,g=u,v=a*_+d*(1-_)):(r=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+A.sy,u=null!=C?C*s:M.x,d=(null!=T?T*l:M.y)+A.ty,p=r*(1-_)+u*_,f=a,g=r*_+u*(1-_),v=d),n.setShape({x1:r,y1:a,x2:u,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:v}),n.useStyle(m.getItemStyle()),Pj(n.style,c,e);var D=""+y.get("value"),k=i_(y,"edgeLabel");n_(n,k,{labelFetcher:{getFormattedLabel:function(e,n,i,r,o,a){return t.getFormattedLabel(e,n,"edge",r,il(o,k.normal&&k.normal.get("formatter"),D),a)}},labelDataIndex:e.dataIndex,defaultText:D}),n.setTextConfig({position:"inside"});var L=y.getModel("emphasis");Om(n,y,"lineStyle",(function(t){var n=t.getItemStyle();return Pj(n,c,e),n})),o.add(n),h.setItemGraphicEl(e.dataIndex,n);var P=L.get("focus");km(n,"adjacency"===P?e.getAdjacentDataIndices():"trajectory"===P?e.getTrajectoryDataIndices():P,L.get("blurScope"),L.get("disabled"))})),r.eachNode((function(e){var n=e.getLayout(),i=e.getModel(),r=i.get("localX"),a=i.get("localY"),h=i.getModel("emphasis"),c=new sy({shape:{x:null!=r?r*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy},style:i.getModel("itemStyle").getItemStyle(),z2:10});n_(c,i_(i),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),c.disableLabelAnimation=!0,c.setStyle("fill",e.getVisual("color")),c.setStyle("decal",e.getVisual("style").decal),Om(c,i),o.add(c),u.setItemGraphicEl(e.dataIndex,c),Cy(c).dataType="node";var d=h.get("focus");km(c,"adjacency"===d?e.getAdjacentDataIndices():"trajectory"===d?e.getTrajectoryDataIndices():d,h.get("blurScope"),h.get("disabled"))})),u.eachItemGraphicEl((function(e,r){var o=u.getItemModel(r);o.get("draggable")&&(e.drift=function(e,o){i._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:u.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){i._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&o.setClipPath(Rj(o.getBoundingRect(),t,(function(){o.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(jC);function Pj(t,e,n){switch(t.fill){case"source":t.fill=n.node1.getVisual("color"),t.decal=n.node1.getVisual("style").decal;break;case"target":t.fill=n.node2.getVisual("color"),t.decal=n.node2.getVisual("style").decal;break;case"gradient":var i=n.node1.getVisual("color"),r=n.node2.getVisual("color");Us(i)&&Us(r)&&(t.fill=new KI(0,0,+("horizontal"===e),+("vertical"===e),[{color:i,offset:0},{color:r,offset:1}]))}}function Rj(t,e,n){var i=new sy({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Ym(i,{shape:{width:t.width+20}},e,n),i}const Oj=Lj;var Nj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links,i=t.data||t.nodes,r=t.levels;this.levelModels=[];for(var o=this.levelModels,a=0;a=0&&(o[r[a].depth]=new A_(r[a],this,e));if(i&&n){var s=JZ(i,n,this,!0,l);return s.data}function l(t,e){t.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t})),e.wrapMethod("getItemModel",(function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e),r=i.node1.getLayout();if(r){var o=r.depth,a=n.levelModels[o];a&&(t.parentModel=a)}return t}))}},e.prototype.setNodePosition=function(t,e){var n=this.option.data||this.option.nodes,i=n[t];i.localX=e[0],i.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}if("edge"===n){var r=this.getDataParams(t,n),o=r.data,a=r.value,s=o.source+" -- "+o.target;return qS("nameValue",{name:s,value:a,noValue:i(a)})}var l=this.getGraph().getNodeByIndex(t),u=l.getLayout().value,h=this.getDataParams(t,n).data.name;return qS("nameValue",{name:null!=h?h+"":null,value:u,noValue:i(u)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(e),o=r.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(IM);const Ej=Nj;function zj(t,e){t.eachSeriesByType("sankey",(function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),r=Bj(t,e);t.layoutInfo=r;var o=r.width,a=r.height,s=t.getGraph(),l=s.nodes,u=s.edges;Fj(l);var h=Es(l,(function(t){return 0===t.getLayout().value})),c=0!==h.length?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");Vj(l,u,n,i,o,a,c,d,p)}))}function Bj(t,e){return Hx(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Vj(t,e,n,i,r,o,a,s,l){Gj(t,e,n,r,o,s,l),Yj(t,e,o,r,i,a,s),oq(t,s)}function Fj(t){Rs(t,(function(t){var e=iq(t.outEdges,nq),n=iq(t.inEdges,nq),i=t.getValue()||0,r=Math.max(e,n,i);t.setLayout({value:r},!0)}))}function Gj(t,e,n,i,r,o,a){for(var s=[],l=[],u=[],h=[],c=0,d=0;d=0;y&&v.depth>p&&(p=v.depth),g.setLayout({depth:y?v.depth:c},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var m=0;mc-1?p:c-1;a&&"left"!==a&&Wj(t,a,o,S);var M="vertical"===o?(r-n)/S:(i-n)/S;Zj(t,M,o)}function Hj(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function Wj(t,e,n,i){if("right"===e){var r=[],o=t,a=0;while(o.length){for(var s=0;s0;o--)l*=.99,Kj(s,l,a),qj(s,r,n,i,a),rq(s,l,a),qj(s,r,n,i,a)}function Xj(t,e){var n=[],i="vertical"===e?"y":"x",r=Hf(t,(function(t){return t.getLayout()[i]}));return r.keys.sort((function(t,e){return t-e})),Rs(r.keys,(function(t){n.push(r.buckets.get(t))})),n}function jj(t,e,n,i,r,o){var a=1/0;Rs(t,(function(t){var e=t.length,s=0;Rs(t,(function(t){s+=t.getLayout().value}));var l="vertical"===o?(i-(e-1)*r)/s:(n-(e-1)*r)/s;l0&&(a=s.getLayout()[o]+l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[c]+e;var p="vertical"===r?i:n;if(l=u-e-p,l>0){a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=h-2;d>=0;--d)s=t[d],l=s.getLayout()[o]+s.getLayout()[c]+e-u,l>0&&(a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}}))}function Kj(t,e,n){Rs(t.slice().reverse(),(function(t){Rs(t,(function(t){if(t.outEdges.length){var i=iq(t.outEdges,$j,n)/iq(t.outEdges,nq);if(isNaN(i)){var r=t.outEdges.length;i=r?iq(t.outEdges,Jj,n)/r:0}if("vertical"===n){var o=t.getLayout().x+(i-eq(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(i-eq(t,n))*e;t.setLayout({y:a},!0)}}}))}))}function $j(t,e){return eq(t.node2,e)*t.getValue()}function Jj(t,e){return eq(t.node2,e)}function Qj(t,e){return eq(t.node1,e)*t.getValue()}function tq(t,e){return eq(t.node1,e)}function eq(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function nq(t){return t.getValue()}function iq(t,e,n){var i=0,r=t.length,o=-1;while(++oo&&(o=e)})),Rs(n,(function(e){var n=new oU({type:"color",mappingMethod:"linear",dataExtent:[r,o],visual:t.get("color")}),i=n.mapValueToVisual(e.getLayout().value),a=e.getModel().get(["itemStyle","color"]);null!=a?(e.setVisual("color",a),e.setVisual("style",{fill:a})):(e.setVisual("color",i),e.setVisual("style",{fill:i}))}))}i.length&&Rs(i,(function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)}))}))}function sq(t){t.registerChartView(Oj),t.registerSeriesModel(Ej),t.registerLayout(zj),t.registerVisual(aq),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))}var lq=function(){function t(){}return t.prototype.getInitialData=function(t,e){var n,i,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=r.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=r.getOrdinalMeta(),i=!0):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),i=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[r,o],p=d[u].get("type"),f=d[1-u].get("type"),g=t.data;if(g&&i){var v=[];Rs(g,(function(t,e){var n;Hs(t)?(n=t.slice(),t.unshift(e)):Hs(t.value)?(n=Ts({},t),n.value=n.value.slice(),t.value.unshift(e)):n=t,v.push(n)})),t.data=v}var y=this.defaultValueDimensions,m=[{name:h,type:yR(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:yR(f),dimsDef:y.slice()}];return SE(this,{coordDimensions:m,dimensionsCount:y.length+1,encodeDefaulter:Gs(fb,m,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),uq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return qa(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(IM);Ls(uq,lq,!0);const hq=uq;var cq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this.group,o=this._data;this._data||r.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(o).add((function(t){if(i.hasValue(t)){var e=i.getItemLayout(t),n=fq(e,i,t,a,!0);i.setItemGraphicEl(t,n),r.add(n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var s=i.getItemLayout(t);n?($m(n),gq(s,n,i,t)):n=fq(s,i,t,a),r.add(n),i.setItemGraphicEl(t,n)}else r.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)})).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(jC),dq=function(){function t(){}return t}(),pq=function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new dq},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();ig){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}var Mq={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==rb){var n="";0,lS(n)}var i=Sq(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Iq(t){t.registerSeriesModel(hq),t.registerChartView(yq),t.registerLayout(_q),t.registerTransform(Mq)}var Cq=["color","borderColor"],Tq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,r=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();this._data||i.removeAll(),e.diff(n).add((function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(o&&Lq(s,a))return;var l=kq(a,n,!0);Ym(l,{shape:{points:a.ends}},t,n),Pq(l,e,n,r),i.add(l),e.setItemGraphicEl(n,l)}})).update((function(a,l){var u=n.getItemGraphicEl(l);if(e.hasValue(a)){var h=e.getItemLayout(a);o&&Lq(s,h)?i.remove(u):(u?(Zm(u,{shape:{points:h.ends}},t,a),$m(u)):u=kq(h,a),Pq(u,e,a,r),i.add(u),e.setItemGraphicEl(a,u))}else i.remove(u)})).remove((function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),Eq(t,this.group);var e=t.get("clip",!0)?BO(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){var n,i=e.getData(),r=i.getLayout("isSimpleBox");while(null!=(n=t.next())){var o=i.getItemLayout(n),a=kq(o,n);Pq(a,i,n,r),a.incremental=!0,this.group.add(a),this._progressiveEls.push(a)}},e.prototype._incrementalRenderLarge=function(t,e){Eq(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(jC),Aq=function(){function t(){}return t}(),Dq=function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return qa(e,t),e.prototype.getDefaultShape=function(){return new Aq},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(Uv);function kq(t,e,n){var i=t.ends;return new Dq({shape:{points:n?Rq(i,t):i},z2:100})}function Lq(t,e){for(var n=!0,i=0;i0?"borderColor":"borderColor0"])||n.get(["itemStyle",t>0?"color":"color0"]);0===t&&(r=n.get(["itemStyle","borderColorDoji"]));var o=n.getModel("itemStyle").getItemStyle(Cq);e.useStyle(o),e.style.fill=null,e.style.stroke=r}const Bq=Tq;var Vq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return qa(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(IM);Ls(Vq,lq,!0);const Fq=Vq;function Gq(t){t&&Hs(t.series)&&Rs(t.series,(function(t){Xs(t)&&"k"===t.type&&(t.type="candlestick")}))}var Hq=["itemStyle","borderColor"],Wq=["itemStyle","borderColor0"],Uq=["itemStyle","borderColorDoji"],Zq=["itemStyle","color"],Yq=["itemStyle","color0"],Xq={seriesType:"candlestick",plan:AM(),performRawSeries:!0,reset:function(t,e){function n(t,e){return e.get(t>0?Zq:Yq)}function i(t,e){return e.get(0===t?Uq:t>0?Hq:Wq)}if(!e.isSeriesFiltered(t)){var r=t.pipelineContext.large;return!r&&{progress:function(t,e){var r;while(null!=(r=t.next())){var o=e.getItemModel(r),a=e.getItemLayout(r).sign,s=o.getItemStyle();s.fill=n(a,o),s.stroke=i(a,o)||s.fill;var l=e.ensureUniqueItemVisual(r,"style");Ts(l,s)}}}}}};const jq=Xq;var qq={seriesType:"candlestick",plan:AM(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),i=$q(t,n),r=0,o=1,a=["x","y"],s=n.getDimensionIndex(n.mapDimension(a[r])),l=Os(n.mapDimensionsAll(a[o]),n.getDimensionIndex,n),u=l[0],h=l[1],c=l[2],d=l[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(s<0||l.length<4))return{progress:t.pipelineContext.large?f:p};function p(t,n){var a,l=n.getStore();while(null!=(a=t.next())){var p=l.get(s,a),f=l.get(u,a),g=l.get(h,a),v=l.get(c,a),y=l.get(d,a),m=Math.min(f,g),_=Math.max(f,g),x=T(m,p),b=T(_,p),w=T(v,p),S=T(y,p),M=[];A(M,b,0),A(M,x,1),M.push(k(S),k(b),k(w),k(x));var I=n.getItemModel(a),C=!!I.get(["itemStyle","borderColorDoji"]);n.setItemLayout(a,{sign:Kq(l,a,f,g,h,C),initBaseline:f>g?b[o]:x[o],ends:M,brushRect:D(v,y,p)})}function T(t,n){var i=[];return i[r]=n,i[o]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function A(t,e,n){var o=e.slice(),a=e.slice();o[r]=SC(o[r]+i/2,1,!1),a[r]=SC(a[r]-i/2,1,!0),n?t.push(o,a):t.push(a,o)}function D(t,e,n){var a=T(t,n),s=T(e,n);return a[r]-=i/2,s[r]-=i/2,{x:a[0],y:a[1],width:o?i:s[0]-a[0],height:o?s[1]-a[1]:i}}function k(t){return t[r]=SC(t[r],1),t}}function f(n,i){var a,l,p=IO(4*n.count),f=0,g=[],v=[],y=i.getStore(),m=!!t.get(["itemStyle","borderColorDoji"]);while(null!=(l=n.next())){var _=y.get(s,l),x=y.get(u,l),b=y.get(h,l),w=y.get(c,l),S=y.get(d,l);isNaN(_)||isNaN(w)||isNaN(S)?(p[f++]=NaN,f+=3):(p[f++]=Kq(y,l,x,b,h,m),g[r]=_,g[o]=w,a=e.dataToPoint(g,null,v),p[f++]=a?a[0]:NaN,p[f++]=a?a[1]:NaN,g[o]=S,a=e.dataToPoint(g,null,v),p[f++]=a?a[1]:NaN)}i.setLayout("largePoints",p)}}};function Kq(t,e,n,i,r,o){var a;return a=n>i?-1:n0?t.get(r,e-1)<=i?1:-1:1,a}function $q(t,e){var n,i=t.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=zp(nl(t.get("barMaxWidth"),r),r),a=zp(nl(t.get("barMinWidth"),1),r),s=t.get("barWidth");return null!=s?zp(s,r):Math.max(Math.min(r/2,o),a)}const Jq=qq;function Qq(t){t.registerChartView(Bq),t.registerSeriesModel(Fq),t.registerPreprocessor(Gq),t.registerVisual(jq),t.registerLayout(Jq)}function tK(t,e){var n=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})}))}var eK=function(t){function e(e,n){var i=t.call(this)||this,r=new fO(e,n),o=new Ip;return i.add(r),i.add(o),i.updateData(e,n),i}return qa(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,r=this.childAt(1),o=0;o0&&(o=this._getLineLength(i)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var h=void 0;h=Ws(u)?u(n):u,i.__t>0&&(h=-o*i.__t),this._animateSymbol(i,o,h,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,r){if(e>0){t.__t=0;var o=this,a=t.animate("",i).when(r?2*e:e,{__t:r?2:1}).delay(n).during((function(){o._updateSymbolPosition(t)}));i||a.done((function(){o.remove(t)})),a.start()}},e.prototype._getLineLength=function(t){return Ol(t.__p1,t.__cp1)+Ol(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=Fh,l=Gh;o[0]=s(e[0],i[0],n[0],r),o[1]=s(e[1],i[1],n[1],r);var u=t.__t<1?l(e[0],i[0],n[0],r):l(n[0],i[0],e[0],1-r),h=t.__t<1?l(e[1],i[1],n[1],r):l(n[1],i[1],e[1],1-r);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT=0;o--)if(i[o]<=e)break;o=Math.min(o,r-2)}else{for(o=a;oe)break;o=Math.min(o-1,r-2)}var l=(e-i[o])/(i[o+1]-i[o]),u=n[o],h=n[o+1];t.x=u[0]*(1-l)+l*h[0],t.y=u[1]*(1-l)+l*h[1];var c=t.__t<1?h[0]-u[0]:u[0]-h[0],d=t.__t<1?h[1]-u[1]:u[1]-h[1];t.rotation=-Math.atan2(d,c)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(uK);const pK=dK;var fK=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),gK=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return qa(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new fK},e.prototype.buildPath=function(t,e){var n,i=e.segs,r=e.curveness;if(e.polyline)for(n=this._off;n0){t.moveTo(i[n++],i[n++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*r,d=(l+h)/2-(u-s)*r;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,r=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s0)for(var u=i[s++],h=i[s++],c=1;c0){var f=(u+d)/2-(h-p)*r,g=(h+p)/2-(d-u)*r;if(bv(u,h,f,g,d,p,o,t,e))return a}else if(_v(u,h,d,p,o,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();if(t=n[0],e=n[1],i.contain(t,e)){var r=this.hoverDataIdx=this.findDataIndex(t,e);return r>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.segs,i=1/0,r=1/0,o=-1/0,a=-1/0,s=0;s0&&(o.dataIndex=n+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const yK=vK;var mK={seriesType:"lines",plan:AM(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(r,o){var a=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var u=0,h=r.start;h0&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),r.updateData(i);var u=t.get("clip",!0)&&BO(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData(),r=this._updateLineDraw(i,t);r.incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=_K.reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext,a=o.large;return n&&i===this._hasEffet&&r===this._isPolyline&&a===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=a?new yK:new OZ(r?i?pK:cK:i?uK:AZ),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=a),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr(),n="svg"===e.painter.getType();n||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(jC);const bK=xK;var wK="undefined"===typeof Uint32Array?Array:Uint32Array,SK="undefined"===typeof Float64Array?Array:Float64Array;function MK(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=Os(e,(function(t){var e=[t[0].coord,t[1].coord],n={coords:e};return t[0].name&&(n.fromName=t[0].name),t[1].name&&(n.toName=t[1].name),Cs([n,t[0],t[1]])})))}var IK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return qa(e,t),e.prototype.init=function(e){e.data=e.data||[],MK(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(MK(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=vl(this._flatCoords,e.flatCoords),this._flatCoordsOffset=vl(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");return n},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(IM);const CK=IK;function TK(t){return t instanceof Array||(t=[t,t]),t}var AK={seriesType:"lines",reset:function(t){var e=TK(t.get("symbol")),n=TK(t.get("symbolSize")),i=t.getData();function r(t,e){var n=t.getItemModel(e),i=TK(n.getShallow("symbol",!0)),r=TK(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?r:null}}};const DK=AK;function kK(t){t.registerChartView(bK),t.registerSeriesModel(CK),t.registerLayout(_K),t.registerVisual(DK)}var LK=256,PK=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=us.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=t.length;h.width=e,h.height=n;for(var p=0;p0){var T=o(m)?s:l;m>0&&(m=m*I+S),x[b++]=T[C],x[b++]=T[C+1],x[b++]=T[C+2],x[b++]=T[C+3]*m*256}else b+=4}return c.putImageData(_,0,0),h},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=us.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},t}();const RK=PK;function OK(t,e,n){var i=t[1]-t[0];e=Os(e,(function(e){return{interval:[(e.interval[0]-t[0])/i,(e.interval[1]-t[0])/i]}}));var r=e.length,o=0;return function(t){var i;for(i=o;i=0;i--){a=e[i].interval;if(a[0]<=t&&t<=a[1]){o=i;break}}return i>=0&&i=e[0]&&t<=e[1]}}function EK(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var zK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(n){n===t&&(i=e)}))})),this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):EK(r)&&this._renderOnGeo(r,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var r=e.coordinateSystem;r&&(EK(r)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){VC(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,r){var o,a,s,l,u=t.coordinateSystem,h=VO(u,"cartesian2d");if(h){var c=u.getAxis("x"),d=u.getAxis("y");0,o=c.getBandWidth()+.5,a=d.getBandWidth()+.5,s=c.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),v=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),m=t.get(["itemStyle","borderRadius"]),_=i_(t),x=t.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),M=h?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],I=n;Is[1]||Dl[1])continue;var k=u.dataToPoint([A,D]);C=new sy({shape:{x:k[0]-o/2,y:k[1]-a/2,width:o,height:a},style:T})}else{if(isNaN(f.get(M[1],I)))continue;C=new sy({z2:1,shape:u.dataToRect([f.get(M[0],I)]).contentShape,style:T})}if(f.hasItemOption){var L=f.getItemModel(I),P=L.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),v=L.getModel(["blur","itemStyle"]).getItemStyle(),y=L.getModel(["select","itemStyle"]).getItemStyle(),m=L.get(["itemStyle","borderRadius"]),b=P.get("focus"),w=P.get("blurScope"),S=P.get("disabled"),_=i_(L)}C.shape.r=m;var R=t.getRawValue(I),O="-";R&&null!=R[2]&&(O=R[2]+""),n_(C,_,{labelFetcher:t,labelDataIndex:I,defaultOpacity:T.opacity,defaultText:O}),C.ensureState("emphasis").style=g,C.ensureState("blur").style=v,C.ensureState("select").style=y,km(C,b,w,S),C.incremental=r,r&&(C.states.emphasis.hoverLayer=!0),p.add(C),f.setItemGraphicEl(I,C),this._progressiveEls&&this._progressiveEls.push(C)}},e.prototype._renderOnGeo=function(t,e,n,i){var r=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new RK;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),u=t.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,i.getWidth()),p=Math.min(l.height+l.y,i.getHeight()),f=d-h,g=p-c,v=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],y=a.mapArray(v,(function(e,n,i){var r=t.dataToPoint([e,n]);return r[0]-=h,r[1]-=c,r.push(i),r})),m=n.getExtent(),_="visualMap.continuous"===n.type?NK(m,n.option.range):OK(m,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Jv({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(x)},e.type="heatmap",e}(jC);const BK=zK;var VK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.getInitialData=function(t,e){return sO(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Xb.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(IM);const FK=VK;function GK(t){t.registerChartView(BK),t.registerSeriesModel(FK)}var HK=["itemStyle","borderWidth"],WK=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],UK=new tI,ZK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group,r=t.getData(),o=this._data,a=t.coordinateSystem,s=a.getBaseAxis(),l=s.isHorizontal(),u=a.master.getRect(),h={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[u.x,u.x+u.width],[u.y,u.y+u.height]],isHorizontal:l,valueDim:WK[+l],categoryDim:WK[1-+l]};return r.diff(o).add((function(t){if(r.hasValue(t)){var e=i$(r,t),n=YK(r,t,e,h),o=a$(r,h,n);r.setItemGraphicEl(t,o),i.add(o),d$(o,h,n)}})).update((function(t,e){var n=o.getItemGraphicEl(e);if(r.hasValue(t)){var a=i$(r,t),s=YK(r,t,a,h),l=u$(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(t,null),n=null),n?s$(n,h,s):n=a$(r,h,s,!0),r.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,i.add(n),d$(n,h,s)}else i.remove(n)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&l$(o,t,e.__pictorialSymbolMeta.animationModel,e)})).execute(),this._data=r,this.group},e.prototype.remove=function(t,e){var n=this.group,i=this._data;t.get("animation")?i&&i.eachItemGraphicEl((function(e){l$(i,Cy(e).dataIndex,t,e)})):n.removeAll()},e.type="pictorialBar",e}(jC);function YK(t,e,n,i){var r=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=n.get("symbolRotate"),u=(l||0)*Math.PI/180||0,h=n.get("symbolPatternSize")||2,c=n.isAnimationEnabled(),d={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:h,rotation:u,animationModel:c?n:null,hoverScale:c&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};XK(n,o,r,i,d),qK(t,e,r,o,a,d.boundingLength,d.pxSign,h,i,d),KK(n,d.symbolScale,u,i,d);var p=d.symbolSize,f=uA(n.get("symbolOffset"),p);return $K(n,p,r,o,a,f,s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,i,d),d}function XK(t,e,n,i,r){var o,a=i.valueDim,s=t.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(n[a.wh]<=0);if(Hs(s)){var c=[jK(l,s[0])-u,jK(l,s[1])-u];c[1]0?1:-1}function jK(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function qK(t,e,n,i,r,o,a,s,l,u){var h,c=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=t.getItemVisual(e,"symbolSize");h=Hs(f)?f.slice():null==f?["100%","100%"]:[f,f],h[d.index]=zp(h[d.index],p),h[c.index]=zp(h[c.index],i?p:Math.abs(o)),u.symbolSize=h;var g=u.symbolScale=[h[0]/s,h[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*a}function KK(t,e,n,i,r){var o=t.get(HK)||0;o&&(UK.attr({scaleX:e[0],scaleY:e[1],rotation:n}),UK.updateTransform(),o/=UK.getLineScale(),o*=e[i.valueDim.index]),r.valueLineWidth=o||0}function $K(t,e,n,i,r,o,a,s,l,u,h,c){var d=h.categoryDim,p=h.valueDim,f=c.pxSign,g=Math.max(e[p.index]+s,0),v=g;if(i){var y=Math.abs(l),m=el(t.get("symbolMargin"),"15%")+"",_=!1;m.lastIndexOf("!")===m.length-1&&(_=!0,m=m.slice(0,m.length-1));var x=zp(m,e[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=nf(i),M=S?i:p$((y+w)/b),I=y-M*g;x=I/2/(_?M:Math.max(M-1,1)),b=g+2*x,w=_?0:2*x,S||"fixed"===i||(M=u?p$((Math.abs(u)+w)/b):0),v=M*b-w,c.repeatTimes=M,c.symbolMargin=x}var C=f*(v/2),T=c.pathPosition=[];T[d.index]=n[d.wh]/2,T[p.index]="start"===a?C:"end"===a?l-C:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var A=c.bundlePosition=[];A[d.index]=n[d.xy],A[p.index]=n[p.xy];var D=c.barRectShape=Ts({},n);D[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(T[p.index]+C)),D[d.wh]=n[d.wh];var k=c.clipShape={};k[d.xy]=-n[d.xy],k[d.wh]=h.ecSize[d.wh],k[p.xy]=0,k[p.wh]=n[p.wh]}function JK(t){var e=t.symbolPatternSize,n=sA(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function QK(t,e,n,i){var r=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,h=0,c=o[e.valueDim.index]+a+2*n.symbolMargin;for(h$(t,(function(t){t.__pictorialAnimationIndex=h,t.__pictorialRepeatTimes=u,h0:i<0)&&(r=u-1-t),e[l.index]=c*(r-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function t$(t,e,n,i){var r=t.__pictorialBundle,o=t.__pictorialMainPath;o?c$(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(o=t.__pictorialMainPath=JK(n),r.add(o),c$(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function e$(t,e,n){var i=Ts({},e.barRectShape),r=t.__pictorialBarRect;r?c$(r,null,{shape:i},e,n):(r=t.__pictorialBarRect=new sy({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),r.disableMorphing=!0,t.add(r))}function n$(t,e,n,r){if(n.symbolClip){var o=t.__pictorialClipPath,a=Ts({},n.clipShape),s=e.valueDim,l=n.animationModel,u=n.dataIndex;if(o)Zm(o,{shape:a},l,u);else{a[s.wh]=0,o=new sy({shape:a}),t.__pictorialBundle.setClipPath(o),t.__pictorialClipPath=o;var h={};h[s.wh]=n.clipShape[s.wh],i[r?"updateProps":"initProps"](o,{shape:h},l,u)}}}function i$(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=r$,n.isAnimationEnabled=o$,n}function r$(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function o$(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function a$(t,e,n,i){var r=new Ip,o=new Ip;return r.add(o),r.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?QK(r,e,n):t$(r,e,n),e$(r,n,i),n$(r,e,n,i),r.__pictorialShapeStr=u$(t,n),r.__pictorialSymbolMeta=n,r}function s$(t,e,n){var i=n.animationModel,r=n.dataIndex,o=t.__pictorialBundle;Zm(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?QK(t,e,n,!0):t$(t,e,n,!0),e$(t,n,!0),n$(t,e,n,!0)}function l$(t,e,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var o=[];h$(i,(function(t){o.push(t)})),i.__pictorialMainPath&&o.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),Rs(o,(function(t){jm(t,{scaleX:0,scaleY:0},n,e,(function(){i.parent&&i.parent.remove(i)}))})),t.setItemGraphicEl(e,null)}function u$(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function h$(t,e,n){Rs(t.__pictorialBundle.children(),(function(i){i!==t.__pictorialBarRect&&e.call(n,i)}))}function c$(t,e,n,r,o,a){e&&t.attr(e),r.symbolClip&&!o?n&&t.attr(n):n&&i[o?"updateProps":"initProps"](t,n,r.animationModel,r.dataIndex,a)}function d$(t,e,n){var i=n.dataIndex,r=n.itemModel,o=r.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),u=r.getShallow("cursor"),h=o.get("focus"),c=o.get("blurScope"),d=o.get("scale");h$(t,(function(t){if(t instanceof Jv){var e=t.style;t.useStyle(Ts({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,d&&(i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2}));var p=e.valueDim.posDesc[+(n.boundingLength>0)],f=t.__pictorialBarRect;n_(f,i_(r),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:hO(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),km(t,h,c,o.get("disabled"))}function p$(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}const f$=ZK;var g$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return qa(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=R_(IN.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(IN);const v$=g$;function y$(t){t.registerChartView(f$),t.registerSeriesModel(v$),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Gs(_N,"pictorialBar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,xN("pictorialBar"))}var m$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return qa(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this,o=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function h(t){return t.name}o.x=0,o.y=l.y+u[0];var c=new pR(this._layersSeries||[],a,h,h),d=[];function p(e,n,s){var l=r._layers;if("remove"!==e){for(var u,h,c=[],p=[],f=a[n].indices,g=0;go&&(o=s),i.push(s)}for(var u=0;uo&&(o=c)}return{y0:r,max:o}}function T$(t){t.registerChartView(x$),t.registerSeriesModel(S$),t.registerLayout(M$),t.registerProcessor(pE("themeRiver"))}var A$=2,D$=4,k$=function(t){function e(e,n,i,r){var o=t.call(this)||this;o.z2=A$,o.textConfig={inside:!0},Cy(o).seriesIndex=n.seriesIndex;var a=new Iy({z2:D$,silent:e.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,e,n,i,r),o}return qa(e,t),e.prototype.updateData=function(t,e,n,i,r){this.node=e,e.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var o=this;Cy(o).dataIndex=e.dataIndex;var a=e.getModel(),s=a.getModel("emphasis"),l=e.getLayout(),u=Ts({},l);u.label=null;var h=e.getVisual("style");h.lineJoin="bevel";var c=e.getVisual("decal");c&&(h.decal=KA(c,r));var d=NN(a.getModel("itemStyle"),u,!0);Ts(u,d),Rs(Ny,(function(t){var e=o.ensureState(t),n=a.getModel([t,"itemStyle"]);e.style=n.getItemStyle();var i=NN(n,u);i&&(e.shape=i)})),t?(o.setShape(u),o.shape.r=l.r0,Ym(o,{shape:{r:l.r}},n,e.dataIndex)):(Zm(o,{shape:u},n),$m(o)),o.useStyle(h),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus"),g="ancestor"===f?e.getAncestorsIndices():"descendant"===f?e.getDescendantIndices():f;km(this,g,s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),o=r.endAngle-r.startAngle,a=(r.startAngle+r.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,h=u.getTextContent(),c=this.node.dataIndex,d=i.get("minAngle")/180*Math.PI,p=i.get("show")&&!(null!=d&&Math.abs(o)Math.PI/2?"right":"left"):S&&"center"!==S?"left"===S?(m=r.r0+w,a>Math.PI/2&&(S="right")):"right"===S&&(m=r.r-w,a>Math.PI/2&&(S="left")):(m=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=m*s+r.cx,g.y=m*l+r.cy;var M=f(d,"rotate"),I=0;"radial"===M?(I=Sv(-a),I>Math.PI/2&&I<1.5*Math.PI&&(I+=Math.PI)):"tangential"===M?(I=Math.PI/2-a,I>Math.PI/2?I-=Math.PI:I<-Math.PI/2&&(I+=Math.PI)):Ys(M)&&(I=M*Math.PI/180),g.rotation=Sv(I)})),h.dirtyStyle()},e}(bI);const L$=k$;var P$="sunburstRootToNode",R$="sunburstHighlight",O$="sunburstUnhighlight";function N$(t){t.registerAction({type:P$,update:"updateView"},(function(t,e){function n(e,n){var i=$H(t,[P$],e);if(i){var r=e.getViewRoot();r&&(t.direction=QH(r,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}}e.eachComponent({mainType:"series",subType:"sunburst",query:t},n)})),t.registerAction({type:R$,update:"none"},(function(t,e,n){function i(e){var n=$H(t,[R$],e);n&&(t.dataIndex=n.node.dataIndex)}t=Ts({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},i),n.dispatchAction(Ts(t,{type:"highlight"}))})),t.registerAction({type:O$,update:"updateView"},(function(t,e,n){t=Ts({},t),n.dispatchAction(Ts(t,{type:"downplay"}))}))}var E$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n,i){var r=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),h=[];s.eachNode((function(t){h.push(t)}));var c=this._oldChildren||[];function d(t,e){function n(t){return t.getId()}function i(n,i){var r=null==n?null:t[n],o=null==i?null:e[i];p(r,o)}0===t.length&&0===e.length||new pR(e,t,n,n).add(i).update(i).remove(Gs(i,null)).execute()}function p(i,r){if(u||!i||i.getValue()||(i=null),i!==a&&r!==a)if(r&&r.piece)i?(r.piece.updateData(!1,i,t,e,n),o.setItemGraphicEl(i.dataIndex,r.piece)):f(r);else if(i){var s=new L$(i,t,e,n);l.add(s),o.setItemGraphicEl(i.dataIndex,s)}}function f(t){t&&t.piece&&(l.remove(t.piece),t.piece=null)}function g(i,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,t,e,n):(r.virtualPiece=new L$(i,t,e,n),l.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",(function(t){r._rootToNode(o.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}d(h,c),g(a,s),this._initEvents(),this._oldChildren=h},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var n=!1,i=t.seriesModel.getViewRoot();i.eachNode((function(i){if(!n&&i.piece&&i.piece===e.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)t._rootToNode(i);else if("link"===r){var o=i.getModel(),a=o.get("link");if(a){var s=o.get("target",!0)||"_blank";Nx(a,s)}}n=!0}}))}))},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:P$,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var n=e.getData(),i=n.getItemLayout(0);if(i){var r=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(r*r+o*o);return a<=i.r&&a>=i.r0}},e.type="sunburst",e}(jC);const z$=E$;var B$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return qa(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};V$(n);var i=this._levelModels=Os(t.levels||[],(function(t){return new A_(t,this,e)}),this),r=KH.createTree(n,this,o);function o(t){t.wrapMethod("getItemModel",(function(t,e){var n=r.getNodeByDataIndex(e),o=i[n.depth];return o&&(t.parentModel=o),t}))}return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=tW(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){dW(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(IM);function V$(t){var e=0;Rs(t.children,(function(t){V$(t);var n=t.value;Hs(n)&&(n=n[0]),e+=n}));var n=t.value;Hs(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),Hs(t.value)?t.value[0]=n:t.value=n}const F$=B$;var G$=Math.PI/180;function H$(t,e,n){e.eachSeriesByType(t,(function(t){var e=t.get("center"),i=t.get("radius");Hs(i)||(i=[0,i]),Hs(e)||(e=[e,e]);var r=n.getWidth(),o=n.getHeight(),a=Math.min(r,o),s=zp(e[0],r),l=zp(e[1],o),u=zp(i[0],a/2),h=zp(i[1],a/2),c=-t.get("startAngle")*G$,d=t.get("minAngle")*G$,p=t.getData().tree.root,f=t.getViewRoot(),g=f.depth,v=t.get("sort");null!=v&&W$(f,v);var y=0;Rs(f.children,(function(t){!isNaN(t.getValue())&&y++}));var m=f.getValue(),_=Math.PI/(m||y)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(h-u)/(b||1),S=t.get("clockwise"),M=t.get("stillShowZeroSum"),I=S?1:-1,C=function(e,n){if(e){var i=n;if(e!==p){var r=e.getValue(),o=0===m&&M?_:r*_;o1)r=r.parentNode;var o=n.getColorFromPalette(r.name||r.dataIndex+"",e);return t.depth>1&&Us(o)&&(o=yc(o,(t.depth-1)/(i-1)*.5)),o}t.eachSeriesByType("sunburst",(function(t){var e=t.getData(),i=e.tree;i.eachNode((function(r){var o=r.getModel(),a=o.getModel("itemStyle").getItemStyle();a.fill||(a.fill=n(r,t,i.root.height));var s=e.ensureUniqueItemVisual(r.dataIndex,"style");Ts(s,a)}))}))}function Y$(t){t.registerChartView(z$),t.registerSeriesModel(F$),t.registerLayout(Gs(H$,"sunburst")),t.registerProcessor(Gs(pE,"sunburst")),t.registerVisual(Z$),N$(t)}var X$={color:"fill",borderColor:"stroke"},j$={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},q$=Pf(),K$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return sO(null,this)},e.prototype.getDataParams=function(e,n,i){var r=t.prototype.getDataParams.call(this,e,n);return i&&(r.info=q$(i).info),r},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(IM);const $$=K$;function J$(t,e){return e=e||[0,0],Os(["x","y"],(function(n,i){var r=this.getAxis(n),o=e[i],a=t[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))}),this)}function Q$(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(J$,t)}}}function tJ(t,e){return e=e||[0,0],Os([0,1],(function(n){var i=e[n],r=t[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])}),this)}function eJ(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(tJ,t)}}}function nJ(t,e){var n=this.getAxis(),i=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function iJ(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:Fs(nJ,t)}}}function rJ(t,e){return e=e||[0,0],Os(["Radius","Angle"],(function(n,i){var r="get"+n+"Axis",o=this[r](),a=e[i],s=t[i]/2,l="category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-s)-o.dataToCoord(a+s));return"Angle"===n&&(l=l*Math.PI/180),l}),this)}function oJ(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=e.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=t.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:Fs(rJ,t)}}}function aJ(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}function sJ(t,e,n,i){return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||_l(t,"text")))}function lJ(t,e,n){var i,r,o,a=t;if("text"===e)o=a;else{o={},_l(a,"text")&&(o.text=a.text),_l(a,"rich")&&(o.rich=a.rich),_l(a,"textFill")&&(o.fill=a.textFill),_l(a,"textStroke")&&(o.stroke=a.textStroke),_l(a,"fontFamily")&&(o.fontFamily=a.fontFamily),_l(a,"fontSize")&&(o.fontSize=a.fontSize),_l(a,"fontStyle")&&(o.fontStyle=a.fontStyle),_l(a,"fontWeight")&&(o.fontWeight=a.fontWeight),r={type:"text",style:o,silent:!0},i={};var s=_l(a,"textPosition");n?i.position=s?a.textPosition:"inside":s&&(i.position=a.textPosition),_l(a,"textPosition")&&(i.position=a.textPosition),_l(a,"textOffset")&&(i.offset=a.textOffset),_l(a,"textRotation")&&(i.rotation=a.textRotation),_l(a,"textDistance")&&(i.distance=a.textDistance)}return uJ(o,t),Rs(o.rich,(function(t){uJ(t,t)})),{textConfig:i,textContent:r}}function uJ(t,e){e&&(e.font=e.textFont||e.font,_l(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),_l(e,"textAlign")&&(t.align=e.textAlign),_l(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),_l(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),_l(e,"textWidth")&&(t.width=e.textWidth),_l(e,"textHeight")&&(t.height=e.textHeight),_l(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),_l(e,"textPadding")&&(t.padding=e.textPadding),_l(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),_l(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),_l(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),_l(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),_l(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),_l(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),_l(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function hJ(t,e,n){var i=t;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,o=t.fill||"#000";cJ(i,e);var a=null==i.textFill;return r?a&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=o),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(a&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,Rs(e.rich,(function(t){cJ(t,t)})),i}function cJ(t,e){e&&(_l(e,"fill")&&(t.textFill=e.fill),_l(e,"stroke")&&(t.textStroke=e.fill),_l(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),_l(e,"font")&&(t.font=e.font),_l(e,"fontStyle")&&(t.fontStyle=e.fontStyle),_l(e,"fontWeight")&&(t.fontWeight=e.fontWeight),_l(e,"fontSize")&&(t.fontSize=e.fontSize),_l(e,"fontFamily")&&(t.fontFamily=e.fontFamily),_l(e,"align")&&(t.textAlign=e.align),_l(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),_l(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),_l(e,"width")&&(t.textWidth=e.width),_l(e,"height")&&(t.textHeight=e.height),_l(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),_l(e,"padding")&&(t.textPadding=e.padding),_l(e,"borderColor")&&(t.textBorderColor=e.borderColor),_l(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),_l(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),_l(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),_l(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),_l(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),_l(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),_l(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),_l(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),_l(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),_l(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var dJ={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},pJ=Bs(dJ),fJ=(Ns(Jd,(function(t,e){return t[e]=1,t}),{}),Jd.join(", "),["","style","shape","extra"]),gJ=Pf();function vJ(t,e,n,i,r){var o=t+"Animation",a=Wm(t,i,r)||{},s=gJ(e).userDuring;return a.duration>0&&(a.during=s?Fs(CJ,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),Ts(a,n[o]),a}function yJ(t,e,n,i){i=i||{};var r=i.dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=gJ(t),u=e.style;l.userDuring=e.during;var h={},c={};if(kJ(t,e,c),AJ("shape",e,c),AJ("extra",e,c),!o&&s&&(DJ(t,e,h),TJ("shape",t,e,h),TJ("extra",t,e,h),LJ(t,e,u,h)),c.style=u,bJ(t,c,a),SJ(t,e),s)if(o){var d={};Rs(fJ,(function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(d[t]=d[t]||{}),Ts(t?d[t]:d,n.enterFrom))}));var p=vJ("enter",t,e,n,r);p.duration>0&&t.animateFrom(d,p)}else wJ(t,e,r||0,n,h);mJ(t,e),u?t.dirty():t.markRedraw()}function mJ(t,e){for(var n=gJ(t).leaveToProps,i=0;i0&&t.animateFrom(r,o)}}function SJ(t,e){_l(e,"silent")&&(t.silent=e.silent),_l(e,"ignore")&&(t.ignore=e.ignore),t instanceof zg&&_l(e,"invisible")&&(t.invisible=e.invisible),t instanceof Uv&&_l(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var MJ={},IJ={setTransform:function(t,e){return MJ.el[t]=e,this},getTransform:function(t){return MJ.el[t]},setShape:function(t,e){var n=MJ.el,i=n.shape||(n.shape={});return i[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=MJ.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=MJ.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=MJ.el.style;if(e)return e[t]},setExtra:function(t,e){var n=MJ.el.extra||(MJ.el.extra={});return n[t]=e,this},getExtra:function(t){var e=MJ.el.extra;if(e)return e[t]}};function CJ(){var t=this,e=t.el;if(e){var n=gJ(e).userDuring,i=t.userDuring;n===i?(MJ.el=e,i(IJ)):t.el=t.userDuring=null}}function TJ(t,e,n,i){var r=n[t];if(r){var o,a=e[t];if(a){var s=n.transition,l=r.transition;if(l)if(!o&&(o=i[t]={}),xJ(l))Ts(o,a);else for(var u=hf(l),h=0;h=0){!o&&(o=i[t]={});var p=Bs(a);for(h=0;h=0)){var d=t.getAnimationStyleProps(),p=d?d.style:null;if(p){!r&&(r=i.style={});var f=Bs(n);for(u=0;u=0?e.getStore().get(r,n):void 0}var o=e.get(i.name,n),a=i&&i.ordinalMeta;return a?a.categories[o]:o}function w(n,i){null==i&&(i=s);var r=e.getItemVisual(i,"style"),o=r&&r.fill,a=r&&r.opacity,l=m(i,BJ).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var u={inheritColor:Us(o)?o:"#000"},h=_(i,BJ),c=r_(h,null,u,!1,!0);c.text=h.getShallow("show")?nl(t.getFormattedLabel(i,BJ),hO(e,i)):null;var d=o_(h,u,!1);return I(n,l),l=hJ(l,c,d),n&&M(l,n),l.legacy=!0,l}function S(n,i){null==i&&(i=s);var r=m(i,zJ).getItemStyle(),o=_(i,zJ),a=r_(o,null,null,!0,!0);a.text=o.getShallow("show")?il(t.getFormattedLabel(i,zJ),t.getFormattedLabel(i,BJ),hO(e,i)):null;var l=o_(o,null,!0);return I(n,r),r=hJ(r,a,l),n&&M(r,n),r.legacy=!0,r}function M(t,e){for(var n in e)_l(e,n)&&(t[n]=e[n])}function I(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}function C(t,n){if(null==n&&(n=s),_l(X$,t)){var i=e.getItemVisual(n,"style");return i?i[X$[t]]:null}if(_l(j$,t))return e.getItemVisual(n,t)}function T(t){if("cartesian2d"===o.type){var e=o.getBaseAxis();return pN(As({axis:e},t))}}function A(){return n.getCurrentSeriesIndices()}function D(t){return d_(t,n)}}function oQ(t){var e={};return Rs(t.dimensions,(function(n){var i=t.getDimensionInfo(n);if(!i.isExtraCoord){var r=i.coordDim,o=e[r]=e[r]||[];o[i.coordDimIndex]=t.getDimensionIndex(n)}})),e}function aQ(t,e,n,i,r,o,a){if(i){var s=sQ(t,e,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&km(s,i.focus,i.blurScope,i.emphasisDisabled),s}o.remove(e)}function sQ(t,e,n,i,r,o){var a=-1,s=e;e&&lQ(e,i,r)&&(a=Ds(o.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=QJ(i),s&&KJ(s,u)),!1===i.morph?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),YJ.normal.cfg=YJ.normal.conOpt=YJ.emphasis.cfg=YJ.emphasis.conOpt=YJ.blur.cfg=YJ.blur.conOpt=YJ.select.cfg=YJ.select.conOpt=null,YJ.isLegacy=!1,hQ(u,n,i,r,l,YJ),uQ(u,n,i,r,l),tQ(t,u,n,i,YJ,r,l),_l(i,"info")&&(q$(u).info=i.info);for(var h=0;h=0?o.replaceAt(u,a):o.add(u),u}function lQ(t,e,n){var i=q$(t),r=e.type,o=e.shape,a=e.style;return n.isUniversalTransitionEnabled()||null!=r&&r!==i.customGraphicType||"path"===r&&bQ(o)&&xQ(o)!==i.customPathData||"image"===r&&_l(a,"image")&&a.image!==i.customImagePath}function uQ(t,e,n,i,r){var o=n.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var a=t.getClipPath();a&&lQ(a,o,i)&&(a=null),a||(a=QJ(o),t.setClipPath(a)),tQ(null,a,e,o,null,i,r)}}function hQ(t,e,n,i,r,o){if(!t.isGroup){cQ(n,null,o),cQ(n,zJ,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var h=t.getTextContent();if(!1===a)h&&t.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},h?h.clearStates():(h=QJ(a),t.setTextContent(h)),tQ(null,h,e,a,null,i,r);for(var c=a&&a.style,d=0;d=h;p--){var f=e.childAt(p);gQ(e,f,r)}}}function gQ(t,e,n){e&&_J(e,q$(t).option,n)}function vQ(t){new pR(t.oldChildren,t.newChildren,yQ,yQ,t).add(mQ).update(mQ).remove(_Q).execute()}function yQ(t,e){var n=t&&t.name;return null!=n?n:ZJ+e}function mQ(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,r=null!=e?n.oldChildren[e]:null;sQ(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function _Q(t){var e=this.context,n=e.oldChildren[t];n&&_J(n,q$(n).option,e.seriesModel)}function xQ(t){return t&&(t.pathData||t.d)}function bQ(t){return t&&(_l(t,"pathData")||_l(t,"d"))}function wQ(t){t.registerChartView(JJ),t.registerSeriesModel($$)}var SQ=Pf(),MQ=Ms,IQ=Fs,CQ=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,i){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(a){var c=Gs(TQ,e,h);this.updatePointerEl(a,l,c),this.updateLabelEl(a,l,c,e)}else a=this._group=new Ip,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);LQ(a,e,!0),this._renderHandle(r)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,r="category"===i.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=cV(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,r){var o=e.pointer;if(o){var a=SQ(t).pointerEl=new i[o.type](MQ(e.pointer));t.add(a)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=SQ(t).labelEl=new Iy(MQ(e.label));t.add(r),DQ(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=SQ(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=SQ(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),DQ(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=PC(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){gu(t.event)},onmousedown:IQ(this._onHandleDragMove,this,0,0),drift:IQ(this._onHandleDragMove,this),ondragend:IQ(this._onHandleDragEnd,this)}),i.add(r)),LQ(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");Hs(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,QC(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){TQ(this._axisPointerModel,!e&&this._moveAnimation,this._handle,kQ(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(kQ(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(kQ(i)),SQ(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var t=this._handle;if(t){var e=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var t=this._handle;if(t){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),tT(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}},t}();function TQ(t,e,n,i){AQ(SQ(n).lastProp,i)||(SQ(n).lastProp=i,e?Zm(n,i,t):(n.stopAnimation(),n.attr(i)))}function AQ(t,e){if(Xs(t)&&Xs(e)){var n=!0;return Rs(e,(function(e,i){n=n&&AQ(t[i],e)})),!!n}return t===e}function DQ(t,e){t[e.get(["label","show"])?"show":"hide"]()}function kQ(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function LQ(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)}))}const PQ=CQ;function RQ(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle(),e.fill=null):"shadow"===n&&(e=i.getAreaStyle(),e.stroke=null),e}function OQ(t,e,n,i,r){var o=n.get("value"),a=EQ(o,e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),s=n.getModel("label"),l=Tx(s.get("padding")||0),u=s.getFont(),h=rp(a,u),c=r.position,d=h.width+l[1]+l[3],p=h.height+l[0]+l[2],f=r.align;"right"===f&&(c[0]-=d),"center"===f&&(c[0]-=d/2);var g=r.verticalAlign;"bottom"===g&&(c[1]-=p),"middle"===g&&(c[1]-=p/2),NQ(c,d,p,i);var v=s.get("backgroundColor");v&&"auto"!==v||(v=e.get(["axisLine","lineStyle","color"])),t.label={x:c[0],y:c[1],style:r_(s,{text:a,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function NQ(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function EQ(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:Qz(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};Rs(i,(function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)})),Us(a)?o=a.replace("{value}",o):Ws(a)&&(o=a(s))}return o}function zQ(t,e,n){var i=bu();return Cu(i,i,n.rotation),Iu(i,i,n.position),IC([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function BQ(t,e,n,i,r,o){var a=iV.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),OQ(e,i,r,o,{position:zQ(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function VQ(t,e,n){return n=n||0,{x1:t[n],y1:t[1-n],x2:e[n],y2:e[1-n]}}function FQ(t,e,n){return n=n||0,{x:t[n],y:t[1-n],width:e[n],height:e[1-n]}}function GQ(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}var HQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=WQ(a,o).getOtherAxis(o).getGlobalExtent(),u=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var h=RQ(i),c=UQ[s](o,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}var d=OB(a.model,n);BQ(e,t,d,n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=OB(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=zQ(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=WQ(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}},e}(PQ);function WQ(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var UQ={line:function(t,e,n){var i=VQ([e,n[0]],[e,n[1]],ZQ(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:FQ([e-i/2,n[0]],[i,r],ZQ(t))}}};function ZQ(t){return"x"===t.dim?0:1}const YQ=HQ;var XQ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,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",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Jx);const jQ=XQ;var qQ=Pf(),KQ=Rs;function $Q(t,e,n){if(!ts.node){var i=e.getZr();qQ(i).records||(qQ(i).records={}),JQ(i,e);var r=qQ(i).records[t]||(qQ(i).records[t]={});r.handler=n}}function JQ(t,e){function n(n,i){t.on(n,(function(n){var r=n0(e);KQ(qQ(t).records,(function(t){t&&i(t,n,r.dispatchAction)})),QQ(r.pendings,e)}))}qQ(t).initialized||(qQ(t).initialized=!0,n("click",Gs(e0,"click")),n("mousemove",Gs(e0,"mousemove")),n("globalout",t0))}function QQ(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function t0(t,e,n){t.handler("leave",null,n)}function e0(t,e,n,i){e.handler(t,n,i)}function n0(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}function i0(t,e){if(!ts.node){var n=e.getZr(),i=(qQ(n).records||{})[t];i&&(qQ(n).records[t]=null)}}var r0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";$Q("axisPointer",n,(function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){i0("axisPointer",e)},e.prototype.dispose=function(t,e){i0("axisPointer",e)},e.type="axisPointer",e}(TM);const o0=r0;function a0(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=Lf(o,t);if(null==a||a<0||Hs(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u),c=h.dim,d=u.dim,p="x"===c||"radius"===c?1:0,f=o.mapDimension(d),g=[];g[p]=o.get(f,a),g[1-p]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(g)||[]}else i=l.dataToPoint(o.getValues(Os(l.dimensions,(function(t){return o.mapDimension(t)})),a))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),i=[v.x+v.width/2,v.y+v.height/2]}return{point:i,el:s}}var s0=Pf();function l0(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||Fs(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){m0(r)&&(r=a0({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=m0(r),u=o.axesInfo,h=s.axesInfo,c="leave"===i||m0(r),d={},p={},f={list:[],map:{}},g={showPointer:Gs(c0,p),showTooltip:Gs(d0,f)};Rs(s.coordSysMap,(function(t,e){var n=l||t.containPoint(r);Rs(s.coordSysAxesInfo[e],(function(t,e){var i=t.axis,o=v0(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&u0(t,a,g,!1,d)}}))}));var v={};return Rs(h,(function(t,e){var n=t.linkGroup;n&&!p[e]&&Rs(n.axesInfo,(function(e,i){var r=p[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,y0(e),y0(t)))),v[t.key]=o}}))})),Rs(v,(function(t,e){u0(h[e],t,g,!0,d)})),p0(p,h,d),f0(f,r,t,a),g0(h,a,n),d}}function u0(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=h0(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&Ts(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function h0(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return Rs(e.seriesModels,(function(e,l){var u,h,c=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,n);h=d.dataIndices,u=d.nestestValue}else{if(h=e.getData().indicesOfNearest(c[0],t,"category"===n.type?.5:null),!h.length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var p=t-u,f=Math.abs(p);f<=a&&((f=0&&s<0)&&(a=f,s=p,r=u,o.length=0),Rs(h,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}function c0(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function d0(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,u=fV(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function p0(t,e,n){var i=n.axesInfo=[];Rs(e,(function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}function f0(t,e,n,i){if(!m0(e)&&t.list.length){var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}function g0(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=s0(i)[r]||{},a=s0(i)[r]={};Rs(t,(function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&Rs(n.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t}))}));var s=[],l=[];Rs(o,(function(t,e){!a[e]&&l.push(t)})),Rs(a,(function(t,e){!o[e]&&s.push(t)})),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function v0(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function y0(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function m0(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function _0(t){yV.registerAxisPointerClass("CartesianAxisPointer",YQ),t.registerComponentModel(jQ),t.registerComponentView(o0),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!Hs(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=rV(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},l0)}function x0(t){Ek(DV),Ek(_0)}var b0=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o),l=s.getExtent(),u=o.dataToCoord(e),h=i.get("type");if(h&&"none"!==h){var c=RQ(i),d=S0[h](o,a,u,l);d.style=c,t.graphicKey=d.type,t.pointer=d}var p=i.get(["label","margin"]),f=w0(e,n,i,a,p);OQ(t,n,i,r,f)},e}(PQ);function w0(t,e,n,i,r){var o=e.axis,a=o.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=i.getRadiusAxis().getExtent();if("radius"===o.dim){var d=bu();Cu(d,d,s),Iu(d,d,[i.cx,i.cy]),l=IC([a,-r],d);var p=e.getModel("axisLabel").get("rotate")||0,f=iV.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=i.coordToPoint([g+r,a]);var v=i.cx,y=i.cy;u=Math.abs(l[0]-v)/g<.3?"center":l[0]>v?"left":"right",h=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}var S0={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:VQ(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:GQ(e.cx,e.cy,i[0],i[1],(-n-r/2)*o,(r/2-n)*o)}:{type:"Sector",shape:GQ(e.cx,e.cy,n-r/2,n+r/2,0,2*Math.PI)}}};const M0=b0;var I0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.findAxisModel=function(t){var e,n=this.ecModel;return n.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Jx);const C0=I0;var T0=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Ef).models[0]},e.type="polarAxis",e}(Jx);Ls(T0,HE);var A0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="angleAxis",e}(T0),D0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="radiusAxis",e}(T0),k0=function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return qa(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(LB);k0.prototype.dataToRadius=LB.prototype.dataToCoord,k0.prototype.radiusToData=LB.prototype.coordToData;const L0=k0;var P0=Pf(),R0=function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return qa(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),r=n.count();if(i[1]-i[0]<1)return 0;var o=i[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=rp(null==o?"":o+"",e.getFont(),"center","top"),u=Math.max(l.height,7),h=u/s;isNaN(h)&&(h=1/0);var c=Math.max(0,Math.floor(h)),d=P0(t.model),p=d.lastAutoInterval,f=d.lastTickCount;return null!=p&&null!=f&&Math.abs(p-c)<=1&&Math.abs(f-r)<=1&&p>c?c=p:(d.lastTickCount=r,d.lastAutoInterval=c),c},e}(LB);R0.prototype.dataToAngle=LB.prototype.dataToCoord,R0.prototype.angleToData=LB.prototype.coordToData;const O0=R0;var N0=["radius","angle"],E0=function(){function t(t){this.dimensions=N0,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new L0,this._angleAxis=new O0,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){var e="_"+t+"Axis";return this[e]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);i.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;var l=Math.atan2(-n,e)/Math.PI*180,u=la)l+=360*u;return[s,l]},t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI,i=Math.cos(n)*e+this.cx,r=-Math.sin(n)*e+this.cy;return[i,r]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis(),n=e.getExtent().slice();n[0]>n[1]&&n.reverse();var i=t.getExtent(),r=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*r,endAngle:-i[1]*r,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,i=e-this.cy,r=n*n+i*i-1e-4,o=this.r,a=this.r0;return r<=o*o&&r>=a*a}}},t.prototype.convertToPixel=function(t,e,n){var i=z0(e);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=z0(e);return i===this?this.pointToData(n):null},t}();function z0(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const B0=E0;function V0(t,e,n){var i=e.get("center"),r=n.getWidth(),o=n.getHeight();t.cx=zp(i[0],r),t.cy=zp(i[1],o);var a=t.getRadiusAxis(),s=Math.min(r,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:Hs(l)||(l=[0,l]);var u=[zp(l[0],s),zp(l[1],s)];a.inverse?a.setExtent(u[1],u[0]):a.setExtent(u[0],u[1])}function F0(t,e){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries((function(t){if(t.coordinateSystem===n){var e=t.getData();Rs(rB(e,"radius"),(function(t){r.scale.unionExtentFromData(e,t)})),Rs(rB(e,"angle"),(function(t){i.scale.unionExtentFromData(e,t)}))}})),qz(i.scale,i.model),qz(r.scale,r.model),"category"===i.type&&!i.onBand){var o=i.getExtent(),a=360/i.scale.count();i.inverse?o[1]+=a:o[1]-=a,i.setExtent(o[0],o[1])}}function G0(t){return"angleAxis"===t.mainType}function H0(t,e){if(t.type=e.get("type"),t.scale=Kz(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),G0(e)){t.inverse=t.inverse!==e.get("clockwise");var n=e.get("startAngle");t.setExtent(n,n+(t.inverse?-360:360))}e.axis=t,t.model=e}var W0={dimensions:N0,create:function(t,e){var n=[];return t.eachComponent("polar",(function(t,i){var r=new B0(i+"");r.update=F0;var o=r.getRadiusAxis(),a=r.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");H0(o,s),H0(a,l),V0(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t})),t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",Ef).models[0];0,t.coordinateSystem=e.coordinateSystem}})),n}};const U0=W0;var Z0=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Y0(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),r=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function X0(t){var e=t.getRadiusAxis();return e.inverse?0:1}function j0(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var q0=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return qa(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=Os(n.getViewLabels(),(function(t){t=Ms(t);var e=n.scale,i="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=n.dataToCoord(i),t}));j0(s),j0(o),Rs(Z0,(function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||K0[e](this.group,t,i,o,a,r,s)}),this)}},e.type="angleAxis",e}(yV),K0={axisLine:function(t,e,n,i,r,o){var a,s=e.getModel(["axisLine","lineStyle"]),l=X0(n),u=l?0:1;a=0===o[u]?new tI({shape:{cx:n.cx,cy:n.cy,r:o[l]},style:s.getLineStyle(),z2:1,silent:!0}):new MI({shape:{cx:n.cx,cy:n.cy,r:o[l],r0:o[u]},style:s.getLineStyle(),z2:1,silent:!0}),a.style.fill=null,t.add(a)},axisTick:function(t,e,n,i,r,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[X0(n)],u=Os(i,(function(t){return new EI({shape:Y0(n,[l,l+s],t.coord)})}));t.add(_C(u,{style:As(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,r,o){if(r.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[X0(n)],h=[],c=0;cf?"left":"right",y=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[c]){var m=s[c];Xs(m)&&m.textStyle&&(a=new A_(m.textStyle,l,l.ecModel))}var _=new Iy({silent:iV.isLabelSilent(e),style:r_(a,{x:p[0],y:p[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:v,verticalAlign:y})});if(t.add(_),h){var x=iV.makeAxisEventDataBase(e);x.targetType="axisLabel",x.value=i.rawLabel,Cy(_).eventData=x}}),this)},splitLine:function(t,e,n,i,r,o){var a=e.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var h=[],c=0;c=0?"p":"n",C=x;m&&(i[s][M]||(i[s][M]={p:x,n:x}),C=i[s][M][I]);var T=void 0,A=void 0,D=void 0,k=void 0;if("radius"===c.dim){var L=c.dataToCoord(S)-x,P=o.dataToCoord(M);Math.abs(L)=k})}}}))}function s1(t){var e={};Rs(t,(function(t,n){var i=t.getData(),r=t.coordinateSystem,o=r.getBaseAxis(),a=o1(r,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/i.count(),u=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;e[a]=u;var c=r1(t);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=zp(t.get("barWidth"),l),p=zp(t.get("barMaxWidth"),l),f=t.get("barGap"),g=t.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),p&&(h[c].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return Rs(e,(function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=zp(t.categoryGap,r),a=zp(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-o)/(l+(l-1)*a);u=Math.max(u,0),Rs(i,(function(t,e){var n=t.maxWidth;n&&n=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[r]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){var i=I1(e);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=I1(e);return i===this?this.pointToData(n):null},t}();function I1(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const C1=M1;function T1(t,e){var n=[];return t.eachComponent("singleAxis",(function(i,r){var o=new C1(i,t,e);o.name="single_"+r,o.resize(i,e),i.coordinateSystem=o,n.push(o)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",Ef).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),n}var A1={create:T1,dimensions:S1};const D1=A1;var k1=["x","y"],L1=["width","height"],P1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.coordinateSystem,s=N1(a,1-O1(o)),l=a.dataToPoint(e)[0],u=i.get("type");if(u&&"none"!==u){var h=RQ(i),c=R1[u](o,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}var d=p1(n);BQ(e,t,d,n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=p1(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=zQ(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.coordinateSystem,a=O1(r),s=N1(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=N1(o,1-a),h=(u[1]+u[0])/2,c=[h,h];return c[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}},e}(PQ),R1={line:function(t,e,n){var i=VQ([e,n[0]],[e,n[1]],O1(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,n){var i=t.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:FQ([e-i/2,n[0]],[i,r],O1(t))}}};function O1(t){return t.isHorizontal()?0:1}function N1(t,e){var n=t.getRect();return[n[k1[e]],n[k1[e]]+n[L1[e]]]}const E1=P1;var z1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="single",e}(TM);function B1(t){Ek(_0),yV.registerAxisPointerClass("SingleAxisPointer",E1),t.registerComponentView(z1),t.registerComponentView(m1),t.registerComponentModel(x1),ez(t,"single",x1,x1.defaultOption),t.registerCoordinateSystem("single",D1)}var V1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(e,n,i){var r=Xx(e);t.prototype.init.apply(this,arguments),F1(e,r)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),F1(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Jx);function F1(t,e){var n,i=t.cellSize;n=Hs(i)?i:t.cellSize=[i,i],1===n.length&&(n[1]=n[0]);var r=Os([0,1],(function(t){return Ux(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]}));Yx(t,e,{type:"box",ignoreSize:r})}const G1=V1;var H1=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var r=t.coordinateSystem,o=r.getRangeInfo(),a=r.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,i),this._renderLines(t,o,a,i),this._renderYearText(t,o,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,o,a,i)},e.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,u=new sy({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:r});n.add(u)}},e.prototype._renderLines=function(t,e,n,i){var r=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,h=0;u.time<=e.end.time;h++){d(u.formatedDate),0===h&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=o.getDateInfo(c)}function d(e){r._firstDayOfMonth.push(o.getDateInfo(e)),r._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=r._getLinePointsOfOneWeek(t,e,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,a,i)}d(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),a,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),a,i)},e.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-e/2,i[1][r]=i[1][r]+e/2,i},e.prototype._drawSplitline=function(t,e,n){var i=new PI({z2:20,shape:{points:t},style:e});n.add(i)},e.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,r=i.getDateInfo(e),o=[],a=0;a<7;a++){var s=i.getNextNDay(r.time,a),l=i.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return Us(t)&&t?Px(t,e):Ws(t)?t(e):e.nameMap},e.prototype._yearTextPositionControl=function(t,e,n,i,r){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=r,s=["center","top"]):"left"===i?o-=r:"right"===i?(o+=r,s=["center","top"]):a-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},e.prototype._renderYearText=function(t,e,n,i){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),a=r.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===n?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var p=r.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(p,f),v=new Iy({z2:30,style:r_(r,{text:g})});v.attr(this._yearTextPositionControl(v,c[a],n,a,o)),i.add(v)}},e.prototype._monthTextPositionControl=function(t,e,n,i,r){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=r,e&&(o="center"),"start"===i&&(a="bottom")):(s+=r,e&&(a="middle"),"start"===i&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderMonthText=function(t,e,n,i){var r=t.getModel("monthLabel");if(r.get("show")){var o=r.get("nameMap"),a=r.get("margin"),s=r.get("position"),l=r.get("align"),u=[this._tlpoints,this._blpoints];o&&!Us(o)||(o&&(e=U_(o)||e),o=e.get(["time","monthAbbr"])||[]);var h="start"===s?0:1,c="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=0;p=i.start.time&&n.timea.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/U1)-Math.floor(n[0].time/U1)+1,r=new Date(n[0].time),o=r.getDate(),a=n[1].date.getDate();r.setDate(o+i-1);var s=r.getDate();if(s!==a){var l=r.getTime()-n[1].time>0?1:-1;while((s=r.getDate())!==a&&(r.getTime()-n[1].time)*l>0)i-=l,r.setDate(s-l)}var u=Math.floor((i+n[0].day+6)/7),h=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:u,nthWeek:h,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&ei.lweek)return null;var r=7*(t-1)-i.fweek+e,o=new Date(i.start.time);return o.setDate(+i.start.d+r),this.getDateInfo(o)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",(function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])})),i},t.dimensions=["time","value"],t}();function Y1(t){var e=t.calendarModel,n=t.seriesModel,i=e?e.coordinateSystem:n?n.coordinateSystem:null;return i}const X1=Z1;function j1(t){t.registerComponentModel(G1),t.registerComponentView(W1),t.registerCoordinateSystem("calendar",X1)}function q1(t,e){var n=t.existing;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}e.parentOption=null}function K1(t,e){var n;return Rs(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)})),n}function $1(t,e,n){var i=Ts({},n),r=t[e],o=n.$action||"merge";"merge"===o?r?(Is(r,i,!0),Yx(r,i,{ignoreSize:!0}),jx(n,r),t2(n,r),t2(n,r,"shape"),t2(n,r,"style"),t2(n,r,"extra"),n.clipPath=r.clipPath):t[e]=i:"replace"===o?t[e]=i:"remove"===o&&r&&(t[e]=null)}var J1=["transition","enterFrom","leaveTo"],Q1=J1.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function t2(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?J1:Q1,r=0;r=0;l--){u=n[l],h=Mf(u.id,null),c=null!=h?r.get(h):null;if(c){d=c.parent,g=r2(d);var v=d===i?{width:o,height:a}:{width:g.width,height:g.height},y={},m=Wx(c,u,v,null,{hv:u.hv,boundingMode:u.bounding},y);if(!r2(c).isNew&&m){for(var _=u.transition,x={},b=0;b=0)?x[w]=S:c[w]=S}Zm(c,x,t,0)}else c.attr(y)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(n){l2(n,r2(n).option,e,t._lastGraphicModel)})),this._elMap=gl()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(TM);function a2(t){var e=_l(i2,t)?i2[t]:gC(t);var n=new e({});return r2(n).type=t,n}function s2(t,e,n,i){var r=a2(n);return e.add(r),i.set(t,r),r2(r).id=t,r2(r).isNew=!0,r}function l2(t,e,n,i){var r=t&&t.parent;r&&("group"===t.type&&t.traverse((function(t){l2(t,e,n,i)})),_J(t,e,i),n.removeKey(r2(t).id))}function u2(t,e,n,i){t.isGroup||Rs([["cursor",zg.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],(function(n){var i=n[0];_l(e,i)?t[i]=nl(e[i],n[1]):null==t[i]&&(t[i]=n[1])})),Rs(Bs(e),(function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=Ws(i)?i:null}})),_l(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}function h2(t){return t=Ts({},t),Rs(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(zx),(function(e){delete t[e]})),t}function c2(t,e,n){var i=Cy(t).eventData;t.silent||t.ignore||i||(i=Cy(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=n.info)}function d2(t){t.registerComponentModel(n2),t.registerComponentView(o2),t.registerPreprocessor((function(t){var e=t.graphic;Hs(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])}))}var p2=["x","y","radius","angle","single"],f2=["cartesian2d","polar","singleAxis"];function g2(t){var e=t.get("coordinateSystem");return Ds(f2,e)>=0}function v2(t){return t+"Axis"}function y2(t,e){var n,i=gl(),r=[],o=gl();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||s(t)}));do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&l(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),u(t)}function l(t){var e=!1;return t.eachTargetAxis((function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)})),e}function u(t){t.eachTargetAxis((function(t,e){(i.get(t)||i.set(t,[]))[e]=!0}))}return r}function m2(t){var e=t.ecModel,n={infoList:[],infoMap:gl()};return t.eachTargetAxis((function(t,i){var r=e.getComponent(v2(t),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}})),n}var _2=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),x2=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return qa(e,t),e.prototype.init=function(t,e,n){var i=b2(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=b2(t);Is(this.option,t,!0),Is(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;Rs([["start","startValue"],["end","endValue"]],(function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=gl(),n=this._fillSpecifiedTargetAxis(e);n?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return Rs(p2,(function(n){var i=this.getReferringComponents(v2(n),zf);if(i.specified){e=!0;var r=new _2;Rs(i.models,(function(t){r.add(t.componentIndex)})),t.set(n,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x",o=n.findComponents({mainType:r+"Axis"});a(o,r)}if(i){o=n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}});a(o,"single")}function a(e,n){var r=e[0];if(r){var o=new _2;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",Ef).models[0];a&&Rs(e,(function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Ef).models[0]&&o.add(t.componentIndex)}))}}}i&&Rs(p2,(function(e){if(i){var r=n.findComponents({mainType:v2(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new _2;o.add(r[0].componentIndex),t.set(e,o),i=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");Rs([["start","startValue"],["end","endValue"]],(function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,n){null==t&&(t=this.ecModel.getComponent(v2(e),n))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(n,i){Rs(n.indexList,(function(n){t.call(e,i,n)}))}))},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(v2(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;Rs([["start","startValue"],["end","endValue"]],(function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;Rs(["start","startValue","end","endValue"],(function(n){e[n]=t[n]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;io[1];if(h&&!c&&!d)return!0;h&&(r=!0),c&&(e=!0),d&&(n=!0)}return r&&e&&n}))}else D2(i,(function(n){if("empty"===r)t.setData(e=e.map(n,(function(t){return a(t)?t:NaN})));else{var i={};i[n]=o,e.selectRange(i)}}));D2(i,(function(t){e.setApproximateExtent(o,t)}))}}))}function a(t){return t>=o[0]&&t<=o[1]}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;D2(["min","max"],(function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Ep(n[0]+o,n,[0,100],!0):null!=r&&(o=Ep(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Hp(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();function P2(t,e,n){var i=[1/0,-1/0];D2(n,(function(t){oB(i,t.getData(),e)}));var r=t.getAxisModel(),o=Zz(r.axis.scale,r,i).calculate();return[o.min,o.max]}const R2=L2;var O2={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(n){n.eachTargetAxis((function(i,r){var o=t.getComponent(v2(i),r);e(i,r,o,n)}))}))}e((function(t,e,n,i){n.__dzAxisProxy=null}));var n=[];e((function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new R2(e,i,o,t),n.push(r.__dzAxisProxy))}));var i=gl();return Rs(n,(function(t){Rs(t.getTargetSeriesModels(),(function(t){i.set(t.uid,t)}))})),i},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,n){t.getAxisProxy(e,n).reset(t)})),t.eachTargetAxis((function(n,i){t.getAxisProxy(n,i).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}}))}};const N2=O2;function E2(t){t.registerAction("dataZoom",(function(t,e){var n=y2(e,t);Rs(n,(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}var z2=!1;function B2(t){z2||(z2=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,N2),E2(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function V2(t){t.registerComponentModel(M2),t.registerComponentView(A2),B2(t)}var F2=function(){function t(){}return t}(),G2={};function H2(t,e){G2[t]=e}function W2(t){return G2[t]}var U2=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;Rs(this.option.feature,(function(t,n){var i=W2(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),Is(t,i.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Jx);const Z2=U2;function Y2(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Hx(i,o,r);Fx(e.get("orient"),t,e.get("itemGap"),a.width,a.height),Wx(t,i,o,r)}function X2(t,e){var n=Tx(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new sy({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),t}var j2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),u=[];Rs(s,(function(t,e){u.push(e)})),new pR(this._featureNames||[],u).add(h).update(h).remove(Gs(h,null)).execute(),this._featureNames=u,Y2(r,t,n),r.add(X2(r.getBoundingRect(),t)),a||r.eachChild((function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Ws(l)&&e){var u=l.style||(l.style={}),h=rp(e,Iy.makeFont(u)),c=t.x+r.x,d=t.y+r.y+o,p=!1;d+h.height>n.getHeight()&&(a.position="top",p=!0);var f=p?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",f],u.align="right"):c-h.width/2<0&&(a.position=[0,f],u.align="left")}}))}function h(r,o){var a,h=u[r],d=u[o],p=s[h],f=new A_(p,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===h&&(p.title=i.newTitle),h&&!d){if(q2(h))a={onclick:f.option.onclick,featureName:h};else{var g=W2(h);if(!g)return;a=new g}l[h]=a}else if(a=l[d],!a)return;a.uid=k_("toolbox-feature"),a.model=f,a.ecModel=e,a.api=n;var v=a instanceof F2;h||!d?!f.get("show")||v&&a.unusable?v&&a.remove&&a.remove(e,n):(c(f,a,h),f.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?cm:dm)(i[t])},a instanceof F2&&a.render&&a.render(f,e,n,i)):v&&a.dispose&&a.dispose(e,n)}function c(i,s,l){var u,h,c=i.getModel("iconStyle"),d=i.getModel(["emphasis","iconStyle"]),p=s instanceof F2&&s.getIcons?s.getIcons():i.get("icon"),f=i.get("title")||{};Us(p)?(u={},u[l]=p):u=p,Us(f)?(h={},h[l]=f):h=f;var g=i.iconPaths={};Rs(u,(function(l,u){var p=PC(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(c.getItemStyle());var f=p.ensureState("emphasis");f.style=d.getItemStyle();var v=new Iy({style:{text:h[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null},ignore:!0});p.setTextContent(v),zC({el:p,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),p.__title=h[u],p.on("mouseover",(function(){var e=d.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";v.setStyle({fill:d.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||i}),v.ignore=!t.get("showTitle"),n.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==i.get(["iconStatus",u])&&n.leaveEmphasis(this),v.hide()})),("emphasis"===i.get(["iconStatus",u])?cm:dm)(p),r.add(p),p.on("click",Fs(s.onclick,s,e,n,u)),g[u]=p}))}},e.prototype.updateView=function(t,e,n,i){Rs(this._features,(function(t){t instanceof F2&&t.updateView&&t.updateView(t.model,e,n,i)}))},e.prototype.remove=function(t,e){Rs(this._features,(function(n){n instanceof F2&&n.remove&&n.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){Rs(this._features,(function(n){n instanceof F2&&n.dispose&&n.dispose(t,e)}))},e.type="toolbox",e}(TM);function q2(t){return 0===t.indexOf("my")}const K2=j2;var $2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=ts.browser;if(Ws(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||r){var h=a.split(","),c=h[0].indexOf("base64")>-1,d=r?decodeURIComponent(h[1]):h[1];c&&(d=window.atob(d));var p=i+"."+o;if(window.navigator.msSaveOrOpenBlob){var f=d.length,g=new Uint8Array(f);while(f--)g[f]=d.charCodeAt(f);var v=new Blob([g]);window.navigator.msSaveOrOpenBlob(v,p)}else{var y=document.createElement("iframe");document.body.appendChild(y);var m=y.contentWindow,_=m.document;_.open("image/svg+xml","replace"),_.write(d),_.close(),m.focus(),_.execCommand("SaveAs",!0,p),document.body.removeChild(y)}}else{var x=n.get("lang"),b='',w=window.open();w.document.write(b),w.document.title=i}},e.getDefaultOption=function(t){var e={show:!0,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:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return e},e}(F2);const J2=$2;var Q2="__ec_magicType_stack__",t5=[["line","bar"],["stack"]],e5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return Rs(t.get("type"),(function(t){e[t]&&(n[t]=e[t])})),n},e.getDefaultOption=function(t){var e={show:!0,type:[],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"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return e},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if(n5[n]){var o,a={series:[]},s=function(t){var e=t.subType,r=t.id,o=n5[n](e,r,t,i);o&&(As(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim,h=u+"Axis",c=t.getReferringComponents(h,Ef).models[0],d=c.componentIndex;a[h]=a[h]||[];for(var p=0;p<=d;p++)a[h][d]=a[h][d]||{};a[h][d].boundaryGap="bar"===n}}};Rs(t5,(function(t){Ds(t,n)>=0&&Rs(t,(function(t){i.setIconStatus(t,"normal")}))})),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},s);var l=n;"stack"===n&&(o=Is({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(l="tiled")),e.dispatchAction({type:"changeMagicType",currentType:l,newOption:a,newTitle:o,featureName:"magicType"})}},e}(F2),n5={line:function(t,e,n,i){if("bar"===t)return Is({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return Is({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===Q2;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),Is({id:e,stack:r?"":Q2},i.get(["option","stack"])||{},!0)}};Ik({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));const i5=e5;var r5=new Array(60).join("-"),o5="\t";function a5(t){var e={},n=[],i=[];return t.eachRawSeries((function(t){var r=t.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(t);else{var o=r.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;e[a]||(e[a]={categoryAxis:o,valueAxis:r.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[a].series.push(t)}else n.push(t)}})),{seriesGroupByCategoryAxis:e,other:n,meta:i}}function s5(t){var e=[];return Rs(t,(function(t,n){var i=t.categoryAxis,r=t.valueAxis,o=r.dim,a=[" "].concat(Os(t.series,(function(t){return t.name}))),s=[i.model.getCategories()];Rs(t.series,(function(t){var e=t.getRawData();s.push(t.getRawData().mapArray(e.mapDimension(o),(function(t){return t})))}));for(var l=[a.join(o5)],u=0;u=0)return!0}var d5=new RegExp("["+o5+"]+","g");function p5(t){for(var e=t.split(/\n+/g),n=h5(e.shift()).split(d5),i=[],r=Os(n,(function(t){return{name:t,data:[]}})),o=0;o=0;r--){var o=n[r];if(o[i])break}if(r<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(a){var s=a.getPercentRange();n[0][i]={dataZoomId:i,start:s[0],end:s[1]}}}})),n.push(e)}function w5(t){var e=I5(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return _5(n,(function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n],t){i[n]=t;break}})),i}function S5(t){x5(t).snapshots=null}function M5(t){return I5(t).length}function I5(t){var e=x5(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var C5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.onclick=function(t,e){S5(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var e={show:!0,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:t.getLocaleModel().get(["toolbox","restore","title"])};return e},e}(F2);Ik({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));const T5=C5;var A5=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],D5=function(){function t(t,e,n){var i=this;this._targetInfoList=[];var r=L5(e,t);Rs(P5,(function(t,e){(!n||!n.include||Ds(n.include,e)>=0)&&t(r,i._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=N5[t.brushType](0,n,e);t.__rangeOffset={offset:z5[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,n){Rs(t,(function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&Rs(i.coordSyses,(function(i){var r=N5[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)}))}),this)},t.prototype.setInputRanges=function(t,e){Rs(t,(function(t){var n=this.findTargetInfo(t,e);if(t.range=t.range||[],n&&!0!==n){t.panelId=n.panelId;var i=N5[t.brushType](0,n.coordSys,t.coordRange),r=t.__rangeOffset;t.range=r?z5[t.brushType](i.values,r.offset,V5(i.xyMinMax,r.xyMinMax)):i.values}}),this)},t.prototype.makePanelOpts=function(t,e){return Os(this._targetInfoList,(function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:fj(i),isTargetByCursor:vj(i,t,n.coordSysModel),getLinearBrushOtherExtent:gj(i)}}))},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&Ds(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=L5(e,t),r=0;rt[1]&&t.reverse(),t}function L5(t,e){return Of(t,e,{includeMainTypes:A5})}var P5={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=gl(),a={},s={};(n||i||r)&&(Rs(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),Rs(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),Rs(r,(function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];Rs(r.getCartesians(),(function(t,e){(Ds(n,t.getAxis("x").model)>=0||Ds(i,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:O5.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})})))},geo:function(t,e){Rs(t.geoModels,(function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:O5.geo})}))}},R5=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],O5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(MC(t)),e}},N5={lineX:Gs(E5,0),lineY:Gs(E5,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[k5([r[0],o[0]]),k5([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]],o=Os(n,(function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}));return{values:o,xyMinMax:r}}};function E5(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=k5(Os([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))}))),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var z5={lineX:Gs(B5,0),lineY:Gs(B5,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return Os(t,(function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]}))}};function B5(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function V5(t,e){var n=F5(t),i=F5(e),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}function F5(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const G5=D5;var H5=Rs,W5=Tf("toolbox-dataZoom_"),U5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new pj(n.getZr()),this._brushController.on("brush",Fs(this._onBrush,this)).mount()),j5(t,e,this,i,n),X5(t,e)},e.prototype.onclick=function(t,e,n){Z5[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]);var r=new G5(Y5(this.model),i,{include:["grid"]});r.matchOutputRanges(e,i,(function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(o("x",n,e[0]),o("y",n,e[1])):o({lineX:"x",lineY:"y"}[i],n,e)}})),b5(i,n),this._dispatchZoomAction(n)}function o(t,e,r){var o=e.getAxis(t),s=o.model,l=a(t,s,i),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(r=JY(0,r.slice(),o.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(n[l.id]={dataZoomId:l.id,startValue:r[0],endValue:r[1]})}function a(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},(function(n){var r=n.getAxisModel(t,e.componentIndex);r&&(i=n)})),i}},e.prototype._dispatchZoomAction=function(t){var e=[];H5(t,(function(t,n){e.push(Ms(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){var e={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return e},e}(F2),Z5={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(w5(this.ecModel))}};function Y5(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}function X5(t,e){t.setIconStatus("back",M5(e)>1?"emphasis":"normal")}function j5(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new G5(Y5(t),e,{include:["grid"]}),s=a.makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}bb("dataZoom",(function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=Y5(i),a=Of(t,o);return H5(a.xAxisModels,(function(t){return s(t,"xAxis","xAxisIndex")})),H5(a.yAxisModels,(function(t){return s(t,"yAxis","yAxisIndex")})),r}function s(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:W5+e+o};a[n]=o,r.push(a)}}));const q5=U5;function K5(t){t.registerComponentModel(Z2),t.registerComponentView(K2),H2("saveAsImage",J2),H2("magicType",i5),H2("dataView",m5),H2("dataZoom",q5),H2("restore",T5),Ek(V2)}var $5=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Jx);const J5=$5;function Q5(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function t3(t){if(ts.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n-1?(l+="top:50%",u+="translateY(-50%) rotate("+(o="left"===a?-225:-45)+"deg)"):(l+="left:50%",u+="translateX(-50%) rotate("+(o="top"===a?225:45)+"deg)");var h=o*Math.PI/180,c=s+r,d=c*Math.abs(Math.cos(h))+c*Math.abs(Math.sin(h)),p=Math.round(100*((d-Math.SQRT2*r)/2+Math.SQRT2*r-(d-c)/2))/100;l+=";"+a+":-"+p+"px";var f=e+" solid "+r+"px;",g=["position:absolute;width:"+s+"px;height:"+s+"px;z-index:-1;",l+";"+u+";","border-bottom:"+f,"border-right:"+f,"background-color:"+i+";"];return'
'}function h3(t,e){var n="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+n,r="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+n,r+=ts.transformSupported?","+a3+i:",left"+i+",top"+i),o3+":"+r}function c3(t,e,n){var i=t.toFixed(0)+"px",r=e.toFixed(0)+"px";if(!ts.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=ts.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+a3+":"+a+";":[["top",0],["left",0],[e3,a]]}function d3(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont()),n&&e.push("line-height:"+Math.round(3*n/2)+"px");var r=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,a=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return r&&o&&e.push("text-shadow:"+a+"px "+s+"px "+o+"px "+r),Rs(["decoration","align"],(function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)})),e.join(";")}function p3(t,e,n){var i=[],r=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),u=t.get("shadowOffsetY"),h=t.getModel("textStyle"),c=uM(t,"html"),d=l+"px "+u+"px "+a+"px "+s;return i.push("box-shadow:"+d),e&&r&&i.push(h3(r,n)),o&&i.push("background-color:"+o),Rs(["width","color","radius"],(function(e){var n="border-"+e,r=Cx(n),o=t.get(r);null!=o&&i.push(n+":"+o+("color"===e?"":"px"))})),i.push(d3(h)),null!=c&&i.push("padding:"+Tx(c).join("px ")+"px"),i.join(";")+";"}function f3(t,e,n,i,r){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&$l(t,a,document.body,i,r)}else{t[0]=i,t[1]=r;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var g3=function(){function t(t,e,n){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ts.wxa)return null;var i=document.createElement("div");i.domBelongToZr=!0,this.el=i;var r=this._zr=e.getZr(),o=this._appendToBody=n&&n.appendToBody;f3(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(i):t.appendChild(i),this._container=t;var a=this;i.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},i.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=r.handler,n=r.painter.getViewportRoot();cu(n,t,!0),e.dispatch("mousemove",t)}},i.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){var e=this._container,n=r3(e,"position"),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative");var r=t.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,r=this._styleCoord;n.innerHTML?i.cssText=s3+p3(t,!this._firstShow,this._longHide)+c3(r[0],r[1],!0)+"border-color:"+Ox(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,r){var o=this.el;if(null!=t){var a="";if(Us(r)&&"item"===n.get("trigger")&&!Q5(n)&&(a=u3(n,i,r)),Us(t))o.innerHTML=t+a;else if(t){o.innerHTML="",Hs(t)||(t=[t]);for(var s=0;s=0?this._tryShow(n,i):"leave"===t&&this._hide(i))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!ts.node&&n.getDom()){var r=I3(i,n);this._ticket="";var o=i.dataByCoordSys,a=k3(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=w3;l.x=i.x,l.y=i.y,l.update(),Cy(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},r)}else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var u=a0(i,e),h=u.point[0],c=u.point[1];null!=h&&null!=c&&this._tryShow({offsetX:h,offsetY:c,target:u.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(I3(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s){var l=s.getData(),u=M3([l.getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel);if("axis"===u.get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}}},e.prototype._tryShow=function(t,e){var n=t.target,i=this._tooltipModel;if(i){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,t);else if(n){var o,a;this._lastDataByCoordSys=null,XT(n,(function(t){return null!=Cy(t).dataIndex?(o=t,!0):null!=Cy(t).tooltipConfig?(a=t,!0):void 0}),!0),o?this._showSeriesItemTooltip(t,o,e):a?this._showComponentItemTooltip(t,a,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=Fs(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=M3([e.tooltipOption],i),a=this._renderMode,s=[],l=qS("section",{blocks:[],noHeader:!0}),u=[],h=new hM;Rs(t,(function(t){Rs(t.dataByAxis,(function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=EQ(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),c=qS("section",{header:o,noHeader:!sl(o),sortBlocks:!0,blocks:[]});l.blocks.push(c),Rs(t.seriesDataIndices,(function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=Qz(e.axis,{value:r}),f.axisValueLabel=o,f.marker=h.makeTooltipMarker("item",Ox(f.color),a);var g=iS(d.formatTooltip(p,!0,null)),v=g.frag;if(v){var y=M3([d],i).get("valueFormatter");c.blocks.push(y?Ts({valueFormatter:y},v):v)}g.text&&u.push(g.text),s.push(f)}}))}}))})),l.blocks.reverse(),u.reverse();var c=e.position,d=o.get("order"),p=eM(l,h,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"
",g=u.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],c,null,h)}))},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=Cy(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,h=s.getData(u),c=this._renderMode,d=t.positionDefault,p=M3([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),v=new hM;g.marker=v.makeTooltipMarker("item",Ox(g.color),c);var y=iS(s.formatTooltip(l,!1,u)),m=p.get("order"),_=p.get("valueFormatter"),x=y.frag,b=x?eM(_?Ts({valueFormatter:_},x):x,v,c,m,i.get("useUTC"),p.get("textStyle")):y.text,w="item_"+s.name+"_"+l;this._showOrMove(p,(function(){this._showTooltipContent(p,b,g,w,t.offsetX,t.offsetY,t.position,t.target,v)})),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i=Cy(e),r=i.tooltipConfig,o=r.option||{};if(Us(o)){var a=o;o={content:a,formatter:a}}var s=[o],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=t.positionDefault,h=M3(s,this._tooltipModel,u?{position:u}:null),c=h.get("content"),d=Math.random()+"",p=new hM;this._showOrMove(h,(function(){var n=Ms(h.get("formatterParams")||{});this._showTooltipContent(h,c,n,d,t.offsetX,t.offsetY,t.position,e,p)})),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")),p=d.color;if(h)if(Us(h)){var f=t.ecModel.get("useUTC"),g=Hs(n)?n[0]:n,v=g&&g.axisType&&g.axisType.indexOf("time")>=0;c=h,v&&(c=ax(g.axisValue,c,f)),c=Lx(c,n,!0)}else if(Ws(h)){var y=Fs((function(e,i){e===this._ticket&&(u.setContent(i,l,t,p,a),this._updatePosition(t,a,r,o,u,n,s))}),this);this._ticket=i,c=h(n,i,y)}else c=h;u.setContent(c,l,t,p,a),u.show(t,p),this._updatePosition(t,a,r,o,u,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||Hs(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:Hs(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=r.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),Ws(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),Hs(e))n=zp(e[0],s),i=zp(e[1],l);else if(Xs(e)){var p=e;p.width=u[0],p.height=u[1];var f=Hx(p,{width:s,height:l});n=f.x,i=f.y,h=null,c=null}else if(Us(e)&&a){var g=A3(e,d,u,t.get("borderWidth"));n=g[0],i=g[1]}else{g=C3(n,i,r,s,l,h?null:20,c?null:20);n=g[0],i=g[1]}if(h&&(n-=D3(h)?u[0]/2:"right"===h?u[0]:0),c&&(i-=D3(c)?u[1]/2:"bottom"===c?u[1]:0),Q5(t)){g=T3(n,i,r,s,l);n=g[0],i=g[1]}r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&Rs(n,(function(n,o){var a=n.dataByAxis||[],s=t[o]||{},l=s.dataByAxis||[];r=r&&a.length===l.length,r&&Rs(a,(function(t,n){var o=l[n]||{},a=t.seriesDataIndices||[],s=o.seriesDataIndices||[];r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===s.length,r&&Rs(a,(function(t,e){var n=s[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})),i&&Rs(t.seriesDataIndices,(function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!ts.node&&e.getDom()&&(tT(this,"_updatePosition"),this._tooltipContent.dispose(),i0("itemTooltip",e))},e.type="tooltip",e}(TM);function M3(t,e,n){var i,r=e.ecModel;n?(i=new A_(n,r,r),i=new A_(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof A_&&(a=a.get("tooltip",!0)),Us(a)&&(a={formatter:a}),a&&(i=new A_(a,i,r)))}return i}function I3(t,e){return t.dispatchAction||Fs(e.dispatchAction,e)}function C3(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],u=s[1];return null!=o&&(t+l+o+2>i?t-=l+o:t+=o),null!=a&&(e+u+a>r?e-=u+a:e+=a),[t,e]}function T3(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function A3(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-r/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-r/2,l=e.y+h+a;break;case"left":s=e.x-r-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}function D3(t){return"center"===t||"middle"===t}function k3(t,e,n){var i=Nf(t).queryOptionMap,r=i.keys()[0];if(r&&"series"!==r){var o=Bf(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(a){var s,l=n.getViewOfComponentModel(a);return l.group.traverse((function(e){var n=Cy(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0})),s?{componentMainType:r,componentIndex:a.componentIndex,el:s}:void 0}}}const L3=S3;function P3(t){Ek(_0),t.registerComponentModel(J5),t.registerComponentView(L3),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},xl),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},xl)}var R3=["rect","polygon","keep","clear"];function O3(t,e){var n=hf(t?t.brush:[]);if(n.length){var i=[];Rs(n,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(i=i.concat(e))}));var r=t&&t.toolbox;Hs(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),N3(s),e&&!s.length&&s.push.apply(s,R3)}}function N3(t){var e={};Rs(t,(function(t){e[t]=1})),t.length=0,Rs(e,(function(e,n){t.push(n)}))}var E3=Rs;function z3(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function B3(t,e,n){var i={};return E3(e,(function(e){var o=i[e]=r();E3(t[e],(function(t,i){if(oU.isValidType(i)){var r={type:i,visual:t};n&&n(r,e),o[i]=new oU(r),"opacity"===i&&(r=Ms(r),r.type="colorAlpha",o.__hidden.__alphaForOpacity=new oU(r))}}))})),i;function r(){var t=function(){};t.prototype.__hidden=t.prototype;var e=new t;return e}}function V3(t,e,n){var i;Rs(n,(function(t){e.hasOwnProperty(t)&&z3(e[t])&&(i=!0)})),i&&Rs(n,(function(n){e.hasOwnProperty(n)&&z3(e[n])?t[n]=Ms(e[n]):delete t[n]}))}function F3(t,e,n,i,r,o){var a,s={};function l(t){return GT(n,a,t)}function u(t,e){WT(n,a,t,e)}function h(t,h){a=null==o?t:h;var c=n.getRawDataItem(a);if(!c||!1!==c.visualMap)for(var d=i.call(r,t),p=e[d],f=s[d],g=0,v=f.length;ge[0][1]&&(e[0][1]=o[0]),o[1]e[1][1]&&(e[1][1]=o[1])}return e&&n4(e)}};function n4(t){return new Gu(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var i4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new pj(e.getZr())).on("brush",Fs(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){q3(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){(!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:Ms(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:Ms(n),$from:e})},e.type="brush",e}(TM);const r4=i4;var o4="#ddd",a4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.areas=[],n.brushOption={},n}return qa(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&V3(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:o4},i.hasOwnProperty("liftZ")||(i.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=Os(t,(function(t){return s4(this.option,t)}),this))},e.prototype.setBrushOption=function(t){this.brushOption=s4(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Jx);function s4(t,e){return Is({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new A_(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}const l4=a4;var u4=["rect","polygon","lineX","lineY","keep","clear"],h4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qa(e,t),e.prototype.render=function(t,e,n){var i,r,o;e.eachComponent({mainType:"brush"},(function(t){i=t.brushType,r=t.brushOption.brushMode||"single",o=o||!!t.areas.length})),this._brushType=i,this._brushMode=r,Rs(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===r:"clear"===e?o:e===i)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return Rs(t.get("type",!0),(function(t){e[t]&&(n[t]=e[t])})),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,r=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},e.getDefaultOption=function(t){var e={show:!0,type:u4.slice(),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",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",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",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",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",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"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return e},e}(F2);const c4=h4;function d4(t){t.registerComponentView(r4),t.registerComponentModel(l4),t.registerPreprocessor(O3),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,K3),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},xl),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},xl),H2("brush",c4)}var p4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return qa(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Jx),f4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=nl(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Iy({style:r_(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Iy({style:r_(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",(function(){Nx(d,"_"+t.get("target"))})),p&&c.on("click",(function(){Nx(p,"_"+t.get("subtarget"))})),Cy(l).eventData=Cy(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),h&&i.add(c);var g=i.getBoundingRect(),v=t.getBoxLayoutParams();v.width=g.width,v.height=g.height;var y=Hx(v,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||(a=t.get("left")||t.get("right"),"middle"===a&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||(s=t.get("top")||t.get("bottom"),"center"===s&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var m={align:a,verticalAlign:s};l.setStyle(m),c.setStyle(m),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new sy({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(b)}},e.type="title",e}(TM);function g4(t){t.registerComponentModel(p4),t.registerComponentView(f4)}var v4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}return qa(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],Rs(n,(function(e,n){var i,o=Mf(pf(e),"");Xs(e)?(i=Ms(e),i.value=n):i=n,t.push(i),r.push(o)}))):t=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number",a=this._data=new WR([{name:"value",type:o}],this);a.initData(t,r)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Jx);const y4=v4;var m4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="timeline.slider",e.defaultOption=R_(y4.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",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",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",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(y4);Ls(m4,nS.prototype);const _4=m4;var x4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="timeline",e}(TM);const b4=x4;var w4=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.type=r||"value",o}return qa(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(LB);const S4=w4;var M4=Math.PI,I4=Pf(),C4=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),r=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){var e=a.scale.getLabel({value:t});return qS("nameValue",{noName:!0,value:e})},Rs(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](i,r,a,t)}),this),this._renderAxisLabel(i,o,a,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var n,i=t.get(["label","position"]),r=t.get("orient"),o=A4(t,e);n=null==i||"auto"===i?"horizontal"===r?o.y+o.height/2=0||"+"===n?"left":"right"},h={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:M4/2},d="vertical"===r?o.height:o.width,p=t.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,v=f?p.get("itemGap"):0,y=g+v,m=t.get(["label","rotate"])||0;m=m*M4/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,M=d;"left"===_||"bottom"===_?(x&&(a=[0,0],S+=y),b&&(s=[S,0],S+=y),w&&(l=[M-g,0],M-=y)):(x&&(a=[M-g,0],M-=y),b&&(s=[0,0],S+=y),w&&(l=[M-g,0],M-=y));var I=[S,M];return t.get("inverse")&&I.reverse(),{viewRect:o,mainLength:d,orient:r,rotation:c[r],labelRotation:m,labelPosOpt:n,labelAlign:t.get(["label","align"])||u[r],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||h[r],playPosition:a,prevBtnPosition:s,nextBtnPosition:l,axisExtent:I,controlSize:g,controlGap:v}},e.prototype._position=function(t,e){var n=this._mainGroup,i=this._labelGroup,r=t.viewRect;if("vertical"===t.orient){var o=bu(),a=r.x,s=r.y+r.height;Iu(o,o,[-a,-s]),Cu(o,o,-M4/2),Iu(o,o,[a,s]),r=r.clone(),r.applyTransform(o)}var l=v(r),u=v(n.getBoundingRect()),h=v(i.getBoundingRect()),c=[n.x,n.y],d=[i.x,i.y];d[0]=c[0]=l[0][0];var p=t.labelPosOpt;if(null==p||Us(p)){var f="+"===p?0:1;y(c,u,l,1,f),y(d,h,l,1,1-f)}else{f=p>=0?0:1;y(c,u,l,1,f),d[1]=c[1]+p}function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function v(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function y(t,e,n,i,r){t[i]+=n[i][r]-e[i][r]}n.setPosition(c),i.setPosition(d),n.rotation=i.rotation=t.rotation,g(n),g(i)},e.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),r=T4(e,i);r.getTicks=function(){return n.mapArray(["value"],(function(t){return{value:t}}))};var o=n.getDataExtent("value");r.setExtent(o[0],o[1]),r.calcNiceTicks();var a=new S4("value",r,t.axisExtent,i);return a.model=e,a},e.prototype._createGroup=function(t){var e=this[t]=new Ip;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var o=new EI({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:Ts({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new EI({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:As({lineCap:"round",lineWidth:o.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},e.prototype._renderAxisTick=function(t,e,n,i){var r=this,o=i.getData(),a=n.scale.getTicks();this._tickSymbols=[],Rs(a,(function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),h=s.getModel(["progress","itemStyle"]),c={x:a,y:0,onclick:Fs(r._changeTimeline,r,t.value)},d=k4(s,l,e,c);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=h.getItemStyle(),Am(d);var p=Cy(d);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=i):p.dataIndex=p.dataModel=null,r._tickSymbols.push(d)}))},e.prototype._renderAxisLabel=function(t,e,n,i){var r=this,o=n.getLabelModel();if(o.get("show")){var a=i.getData(),s=n.getViewLabels();this._tickLabels=[],Rs(s,(function(i){var o=i.tickValue,s=a.getItemModel(o),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),h=s.getModel(["progress","label"]),c=n.dataToCoord(i.tickValue),d=new Iy({x:c,y:0,rotation:t.labelRotation-t.rotation,onclick:Fs(r._changeTimeline,r,o),silent:!1,style:r_(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});d.ensureState("emphasis").style=r_(u),d.ensureState("progress").style=r_(h),e.add(d),Am(d),I4(d).dataIndex=o,r._tickLabels.push(d)}))}},e.prototype._renderControl=function(t,e,n,i){var r=t.controlSize,o=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),u=i.get("inverse",!0);function h(t,n,l,u){if(t){var h=lp(nl(i.get(["controlStyle",n+"BtnSize"]),r),r),c=[0,-h/2,h,h],d=D4(i,n+"Icon",c,{x:t[0],y:t[1],originX:r/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});d.ensureState("emphasis").style=s,e.add(d),Am(d)}}h(t.nextBtnPosition,"next",Fs(this._changeTimeline,this,u?"-":"+")),h(t.prevBtnPosition,"prev",Fs(this._changeTimeline,this,u?"+":"-")),h(t.playPosition,l?"stop":"play",Fs(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,n,i){var r=i.getData(),o=i.getCurrentIndex(),a=r.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=Fs(s._handlePointerDrag,s),t.ondragend=Fs(s._handlePointerDragend,s),L4(t,s._progressLine,o,n,i,!0)},onUpdate:function(t){L4(t,s._progressLine,o,n,i)}};this._currentPointer=k4(a,a,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=this._axis,r=Vp(i.getExtent().slice());n>r[1]&&(n=r[1]),n=0&&(a[o]=+a[o].toFixed(d)),[a,c]}var q4={min:Gs(j4,"min"),max:Gs(j4,"max"),average:Gs(j4,"average"),median:Gs(j4,"median")};function K4(t,e){if(e){var n=t.getData(),i=t.coordinateSystem,r=i&&i.dimensions;if(!X4(e)&&!Hs(e.coord)&&Hs(r)){var o=$4(e,n,i,t);if(e=Ms(e),e.type&&q4[e.type]&&o.baseAxis&&o.valueAxis){var a=Ds(r,o.baseAxis.dim),s=Ds(r,o.valueAxis.dim),l=q4[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&Hs(r))for(var u=e.coord,h=0;h<2;h++)q4[u[h]]&&(u[h]=n6(n,n.mapDimension(r[h]),u[h]));else e.coord=[];return e}}function $4(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(J4(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function J4(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}function Q4(t,e){return!(t&&t.containData&&e.coord&&!Y4(e))||t.containData(e.coord)}function t6(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!Y4(e)&&!Y4(n))||t.containZone(e.coord,n.coord)}function e6(t,e){return t?function(t,n,i,r){var o=r<2?t.coord&&t.coord[r]:t.value;return uS(o,e[r])}:function(t,n,i,r){return uS(t.value,e[r])}}function n6(t,e,n){if("average"===n){var i=0,r=0;return t.each(e,(function(t,e){isNaN(t)||(i+=t,r++)})),i/r}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var i6=Pf(),r6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.init=function(){this.markerGroupMap=gl()},e.prototype.render=function(t,e,n){var i=this,r=this.markerGroupMap;r.each((function(t){i6(t).keep=!1})),e.eachSeries((function(t){var r=W4.getMarkerModelFromSeries(t,i.type);r&&i.renderSeries(t,r,e,n)})),r.each((function(t){!i6(t).keep&&i.group.remove(t.group)}))},e.prototype.markKeep=function(t){i6(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;Rs(t,(function(t){var i=W4.getMarkerModelFromSeries(t,n.type);if(i){var r=i.getData();r.eachItemGraphicEl((function(t){t&&(e?pm(t):fm(t))}))}}))},e.type="marker",e}(TM);const o6=r6;function a6(t,e,n){var i=e.coordinateSystem;t.each((function(r){var o,a=t.getItemModel(r),s=zp(a.get("x"),n.getWidth()),l=zp(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(i){var u=t.get(i.dimensions[0],r),h=t.get(i.dimensions[1],r);o=i.dataToPoint([u,h])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)}))}var s6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markPoint");e&&(a6(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new _O),u=l6(r,t,e);e.setData(u),a6(e.getData(),t,i),u.each((function(t){var n=u.getItemModel(t),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Ws(i)||Ws(r)||Ws(o)||Ws(s)){var h=e.getRawValue(t),c=e.getDataParams(t);Ws(i)&&(i=i(h,c)),Ws(r)&&(r=r(h,c)),Ws(o)&&(o=o(h,c)),Ws(s)&&(s=s(h,c))}var d=n.getModel("itemStyle").getItemStyle(),p=HT(a,"color");d.fill||(d.fill=p),u.setItemVisual(t,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(t){t.traverse((function(t){Cy(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(o6);function l6(t,e,n){var i;i=t?Os(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return Ts(Ts({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new WR(i,n),o=Os(n.get("data"),Gs(K4,e));t&&(o=Es(o,Gs(Q4,t)));var a=e6(!!t,i);return r.initData(o,null,a),r}const u6=s6;function h6(t){t.registerComponentModel(Z4),t.registerComponentView(u6),t.registerPreprocessor((function(t){V4(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})}))}var c6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(W4);const d6=c6;var p6=Pf(),f6=function(t,e,n,i){var r,o=t.getData();if(Hs(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=e.getAxis(null!=i.yAxis?"y":"x"),l=el(i.yAxis,i.xAxis);else{var u=$4(i,o,e,t);s=u.valueAxis;var h=eO(o,u.valueDataDim);l=n6(o,h,a)}var c="x"===s.dim?0:1,d=1-c,p=Ms(i),f={coord:[]};p.type=null,p.coord=[],p.coord[d]=-1/0,f.coord[d]=1/0;var g=n.get("precision");g>=0&&Ys(l)&&(l=+l.toFixed(Math.min(g,20))),p.coord[c]=f.coord[c]=l,r=[p,f,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var v=[K4(t,r[0]),K4(t,r[1]),Ts({},r[2])];return v[2].type=v[2].type||null,Is(v[2],v[0]),Is(v[2],v[1]),v};function g6(t){return!isNaN(t)&&!isFinite(t)}function v6(t,e,n,i){var r=1-t,o=i.dimensions[t];return g6(e[r])&&g6(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function y6(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(v6(1,n,i,t)||v6(0,n,i,t)))return!0}return Q4(t,e[0])&&Q4(t,e[1])}function m6(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=zp(s.get("x"),r.getWidth()),u=zp(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,c=t.get(h[0],e),d=t.get(h[1],e);o=a.dataToPoint([c,d])}if(VO(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");h=a.dimensions;g6(t.get(h[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):g6(t.get(h[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var _6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),r=p6(e).from,o=p6(e).to;r.each((function(e){m6(r,e,!0,t,n),m6(o,e,!1,t,n)})),i.each((function(t){i.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new OZ);this.group.add(l.group);var u=x6(r,t,e),h=u.from,c=u.to,d=u.line;p6(e).from=h,p6(e).to=c,e.setData(d);var p=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),v=e.get("symbolOffset");function y(e,n,r){var o=e.getItemModel(n);m6(e,n,r,t,i);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=HT(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:nl(o.get("symbolOffset",!0),v[r?0:1]),symbolRotate:nl(o.get("symbolRotate",!0),g[r?0:1]),symbolSize:nl(o.get("symbolSize"),f[r?0:1]),symbol:nl(o.get("symbol",!0),p[r?0:1]),style:s})}Hs(p)||(p=[p,p]),Hs(f)||(f=[f,f]),Hs(g)||(g=[g,g]),Hs(v)||(v=[v,v]),u.from.each((function(t){y(h,t,!0),y(c,t,!1)})),d.each((function(t){var e=d.getItemModel(t).getModel("lineStyle").getLineStyle();d.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]),null==e.stroke&&(e.stroke=h.getItemVisual(t,"style").fill),d.setItemVisual(t,{fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:c.getItemVisual(t,"symbolOffset"),toSymbolRotate:c.getItemVisual(t,"symbolRotate"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol"),style:e})})),l.updateData(d),u.line.eachItemGraphicEl((function(t){Cy(t).dataModel=e,t.traverse((function(t){Cy(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(o6);function x6(t,e,n){var i;i=t?Os(t&&t.dimensions,(function(t){var n=e.getData().getDimensionInfo(e.getData().mapDimension(t))||{};return Ts(Ts({},n),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new WR(i,n),o=new WR(i,n),a=new WR([],n),s=Os(n.get("data"),Gs(f6,e,t,n));t&&(s=Es(s,Gs(y6,t)));var l=e6(!!t,i);return r.initData(Os(s,(function(t){return t[0]})),null,l),o.initData(Os(s,(function(t){return t[1]})),null,l),a.initData(Os(s,(function(t){return t[2]}))),a.hasItemOption=!0,{from:r,to:o,line:a}}const b6=_6;function w6(t){t.registerComponentModel(d6),t.registerComponentView(b6),t.registerPreprocessor((function(t){V4(t.series,"markLine")&&(t.markLine=t.markLine||{})}))}var S6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(W4);const M6=S6;var I6=Pf(),C6=function(t,e,n,i){var r=i[0],o=i[1];if(r&&o){var a=K4(t,r),s=K4(t,o),l=a.coord,u=s.coord;l[0]=el(l[0],-1/0),l[1]=el(l[1],-1/0),u[0]=el(u[0],1/0),u[1]=el(u[1],1/0);var h=Cs([{},a,s]);return h.coord=[a.coord,s.coord],h.x0=a.x,h.y0=a.y,h.x1=s.x,h.y1=s.y,h}};function T6(t){return!isNaN(t)&&!isFinite(t)}function A6(t,e,n,i){var r=1-t;return T6(e[r])&&T6(n[r])}function D6(t,e){var n=e.coord[0],i=e.coord[1],r={coord:n,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return VO(t,"cartesian2d")?!(!n||!i||!A6(1,n,i,t)&&!A6(0,n,i,t))||t6(t,r,o):Q4(t,r)||Q4(t,o)}function k6(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=zp(s.get(n[0]),r.getWidth()),u=zp(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition){var h=t.getValues(["x0","y0"],e),c=t.getValues(["x1","y1"],e),d=a.clampData(h),p=a.clampData(c),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?c[0]:h[0]:f[0]=d[0]>p[0]?h[0]:c[0],"y0"===n[1]?f[1]=d[1]>p[1]?c[1]:h[1]:f[1]=d[1]>p[1]?h[1]:c[1],o=i.getMarkerPosition(f,n,!0)}else{var g=t.get(n[0],e),v=t.get(n[1],e),y=[g,v];a.clampData&&a.clampData(y,y),o=a.dataToPoint(y,!0)}if(VO(a,"cartesian2d")){var m=a.getAxis("x"),_=a.getAxis("y");g=t.get(n[0],e),v=t.get(n[1],e);T6(g)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):T6(v)&&(o[1]=_.toGlobalCoord(_.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var L6=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],P6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries((function(t){var e=W4.getMarkerModelFromSeries(t,"markArea");if(e){var i=e.getData();i.each((function(e){var r=Os(L6,(function(r){return k6(i,e,r,t,n)}));i.setItemLayout(e,r);var o=i.getItemGraphicEl(e);o.setShape("points",r)}))}}),this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Ip});this.group.add(l.group),this.markKeep(l);var u=R6(r,t,e);e.setData(u),u.each((function(e){var n=Os(L6,(function(n){return k6(u,e,n,t,i)})),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),h=s.getExtent(),c=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],d=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];Vp(c),Vp(d);var p=!(l[0]>c[1]||l[1]d[1]||h[1]=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Jx);const B6=z6;var V6=Gs,F6=Rs,G6=Ip,H6=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return qa(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new G6),this.group.add(this._selectorGroup=new G6),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},h=t.get("padding"),c=Hx(l,u,h),d=this.layoutInner(t,r,c,i,a,s),p=Hx(As({width:d.width,height:d.height},l),u,h);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=X2(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=gl(),u=e.get("selectedMode"),h=[];n.eachRawSeries((function(t){!t.get("legendHoverLink")&&h.push(t.id)})),F6(e.getData(),(function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var c=new G6;return c.newline=!0,void s.add(c)}var d=n.getSeriesByName(a)[0];if(!l.get(a)){if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),v=p.getVisual("style"),y=this._createItem(d,a,o,r,e,t,f,v,g,u,i);y.on("click",V6(Z6,a,null,i,h)).on("mouseover",V6(X6,d.name,null,i,h)).on("mouseout",V6(j6,d.name,null,i,h)),l.set(a,!0)}else n.eachRawSeries((function(n){if(!l.get(a)&&n.legendVisualProvider){var s=n.legendVisualProvider;if(!s.containName(a))return;var c=s.indexOfName(a),d=s.getItemVisual(c,"style"),p=s.getItemVisual(c,"legendIcon"),f=fc(d.fill);f&&0===f[3]&&(f[3]=.2,d=Ts(Ts({},d),{fill:wc(f,"rgba")}));var g=this._createItem(n,a,o,r,e,t,{},d,p,u,i);g.on("click",V6(Z6,null,a,i,h)).on("mouseover",V6(X6,null,a,i,h)).on("mouseout",V6(j6,null,a,i,h)),l.set(a,!0)}}),this);0}}),this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();F6(t,(function(t){var i=t.type,r=new Iy({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r);var a=e.getModel("selectorLabel"),s=e.getModel(["emphasis","selectorLabel"]);n_(r,{normal:a,emphasis:s},{defaultText:t.title}),Am(r)}))},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,u,h){var c=t.visualDrawType,d=r.get("itemWidth"),p=r.get("itemHeight"),f=r.isSelected(e),g=i.get("symbolRotate"),v=i.get("symbolKeepAspect"),y=i.get("icon");l=y||l||"roundRect";var m=W6(l,i,a,s,c,f,h),_=new G6,x=i.getModel("textStyle");if(!Ws(t.getLegendIcon)||y&&"inherit"!==y){var b="inherit"===y&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;_.add(U6({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}))}else _.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:m.itemStyle,lineStyle:m.lineStyle,symbolKeepAspect:v}));var w="left"===o?d+5:-5,S=o,M=r.get("formatter"),I=e;Us(M)&&M?I=M.replace("{name}",null!=e?e:""):Ws(M)&&(I=M(e));var C=f?x.getTextColor():i.get("inactiveColor");_.add(new Iy({style:r_(x,{text:I,x:w,y:p/2,fill:C,align:S,verticalAlign:"middle"},{inheritColor:C})}));var T=new sy({shape:_.getBoundingRect(),invisible:!0}),A=i.getModel("tooltip");return A.get("show")&&zC({el:T,componentModel:r,itemName:e,itemTooltipOption:A.option}),_.add(T),_.eachChild((function(t){t.silent=!0})),T.silent=!u,this.getContentGroup().add(_),Am(_),_.__legendDataIndex=n,_},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Fx(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){Fx("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",v=0===p?"y":"x";"end"===o?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var y={x:0,y:0};return y[f]=l[f]+d+h[f],y[g]=Math.max(l[g],h[g]),y[v]=Math.min(0,h[v]+c[1-p]),y}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(TM);function W6(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),F6(t,(function(n,i){"inherit"===t[i]&&(t[i]=e[i])}))}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?KA(c,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]),"inherit"===u.stroke&&(u.stroke=i[h]),"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity),s(u,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!o){var f=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}function U6(t){var e=t.icon||"roundRect",n=sA(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n}function Z6(t,e,n,i){j6(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),X6(t,e,n,i)}function Y6(t){var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;while(in[r],f=[-c.x,-c.y];e||(f[i]=l[s]);var g=[0,0],v=[-d.x,-d.y],y=nl(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var m=t.get("pageButtonPosition",!0);"end"===m?v[i]+=n[r]-d[r]:g[i]+=d[r]+y}v[1-i]+=c[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(v);var _={x:0,y:0};if(_[r]=p?n[r]:c[r],_[o]=Math.max(c[o],d[o]),_[a]=Math.min(0,d[a]+v[1-i]),u.__rectSize=n[r],p){var x={x:0,y:0};x[r]=Math.max(n[r]-d[r]-y,0),x[o]=_[o],u.setClipPath(new sy({shape:x})),u.__rectSize=x[r]}else h.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var b=this._getPageInfo(t);return null!=b.pageIndex&&Zm(l,{x:b.contentPosition[0],y:b.contentPosition[1]},p?t:null),this._updatePageInfoView(t,b),_},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;Rs(["pagePrev","pageNext"],(function(i){var r=i+"DataIndex",o=null!=e[r],a=n.childOfName(i);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")}));var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",Us(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=r8[r],a=o8[r],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=m(u);d.contentPosition[r]=-p.s;for(var f=s+1,g=p,v=p,y=null;f<=h;++f)y=m(l[f]),(!y&&v.e>g.s+i||y&&!_(y,g.s))&&(g=v.i>g.i?v:y,g&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount)),v=y;for(f=s-1,g=p,v=p,y=null;f>=-1;--f)y=m(l[f]),y&&_(v,y.s)||!(g.i=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var e,n,i=this.getContentGroup();return i.eachChild((function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)})),null!=e?e:n},e.type="legend.scroll",e}(q6);const s8=a8;function l8(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(n)}))}))}function u8(t){Ek(Q6),t.registerComponentModel(n8),t.registerComponentView(s8),l8(t)}function h8(t){Ek(Q6),Ek(u8)}var c8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="dataZoom.inside",e.defaultOption=R_(w2.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(w2);const d8=c8;var p8=Pf();function f8(t,e,n){p8(t).coordSysRecordMap.each((function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)}))}function g8(t,e){for(var n=p8(t).coordSysRecordMap,i=n.keys(),r=0;ri[n+e]&&(e=a),r=r&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}function b8(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var n=p8(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=gl());i.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){var n=m2(t);Rs(n.infoList,(function(n){var r=n.model.uid,o=i.get(r)||i.set(r,y8(e,n.model)),a=o.dataZoomInfoMap||(o.dataZoomInfoMap=gl());a.set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})}))})),i.each((function(t){var e,n=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var a=x8(r);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),QC(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else v8(i,t)}))}))}var w8=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return qa(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),f8(i,e,{pan:Fs(S8.pan,this),zoom:Fs(S8.zoom,this),scrollMove:Fs(S8.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){g8(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(C2),S8={zoom:function(t,e,n,i){var r=this.range,o=r.slice(),a=t.axisModels[0];if(a){var s=I8[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return JY(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:M8((function(t,e,n,i,r,o){var a=I8[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength})),scrollMove:M8((function(t,e,n,i,r,o){var a=I8[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n);return a.signal*(t[1]-t[0])*o.scrollDelta}))};function M8(t){return function(e,n,i,r){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s){var l=t(a,s,e,n,i,r);return JY(l,a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}}var I8={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};const C8=w8;function T8(t){B2(t),t.registerComponentModel(d8),t.registerComponentView(C8),b8(t)}var A8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=R_(w2.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(w2);const D8=A8;var k8=sy,L8=7,P8=1,R8=30,O8=7,N8="horizontal",E8="vertical",z8=5,B8=["line","bar","candlestick","scatter"],V8={easing:"cubicOut",duration:100,delay:0},F8=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return qa(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=Fs(this._onBrush,this),this._onBrushEnd=Fs(this._onBrushEnd,this)},e.prototype.render=function(e,n,i,r){if(t.prototype.render.apply(this,arguments),QC(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){tT(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Ip;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect"),i=n?O8:0,r=this._findCoordRect(),o={width:e.getWidth(),height:e.getHeight()},a=this._orient===N8?{right:o.width-r.x-r.width,top:o.height-R8-L8-i,width:r.width,height:R8}:{right:L8,top:r.y,width:R8,height:r.height},s=Xx(t.option);Rs(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=a[t])}));var l=Hx(s,o);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===E8&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==N8||r?n===N8&&r?{scaleY:a?1:-1,scaleX:-1}:n!==E8||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new k8({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new k8({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:Fs(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=r.getDataExtent(a),h=.3*(u[1]-u[0]);u=[u[0]-h,u[1]+h];var c,d=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],g=[],v=p[1]/(r.count()-1),y=0,m=Math.round(r.count()/e[0]);r.each([a],(function(t,e){if(m>0&&e%m)y+=v;else{var n=null==t||isNaN(t)||""===t,i=n?0:Ep(t,u,d,!0);n&&!c&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&c&&(f.push([y,0]),g.push([y,0])),f.push([y,i]),g.push([y,i]),y+=v,c=n}})),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(t){var e=_.getModel(t?"selectedDataBackground":"dataBackground"),n=new Ip,i=new DI({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new PI({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,i=this.ecModel;return t.eachTargetAxis((function(r,o){var a=t.getAxisProxy(r,o).getTargetSeriesModels();Rs(a,(function(t){if(!n&&!(!0!==e&&Ds(B8,t.get("type"))<0)){var a,s=i.getComponent(v2(r),o).axis,l=G8(r),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}}),this)}),this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new k8({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(h),r.add(new k8({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:P8,fill:"rgba(0,0,0,0)"}})),Rs([0,1],(function(e){var o=a.get("handleIcon");!rA[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=sA(o,-1,0,2,2,null,!0);s.attr({cursor:H8(this._orient),draggable:!0,drift:Fs(this._onDragMove,this,e),ondragend:Fs(this._onDragEnd,this),onmouseover:Fs(this._showDataInfo,this,!0),onmouseout:Fs(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=zp(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Am(s);var h=a.get("handleColor");null!=h&&(s.style.fill=h),r.add(n[e]=s);var c=a.getModel("textStyle");t.add(i[e]=new Iy({silent:!0,invisible:!0,style:r_(c,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:c.getTextColor(),font:c.getFont()}),z2:10}))}),this);var c=h;if(u){var d=zp(a.get("moveHandleSize"),o[1]),p=e.moveHandle=new sy({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=e.moveHandleIcon=sA(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var v=Math.min(o[1]/2,Math.max(d,10));c=e.moveZone=new sy({invisible:!0,shape:{y:o[1]-v,height:d+v}}),c.on("mouseover",(function(){s.enterEmphasis(p)})).on("mouseout",(function(){s.leaveEmphasis(p)})),r.add(p),r.add(g),r.add(c)}c.attr({draggable:!0,cursor:H8(this._orient),drift:Fs(this._onDragMove,this,"all"),ondragstart:Fs(this._showDataInfo,this,!0),ondragend:Fs(this._onDragEnd,this),onmouseover:Fs(this._showDataInfo,this,!0),onmouseout:Fs(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Ep(t[0],[0,100],e,!0),Ep(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];JY(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?Ep(o.minSpan,a,r,!0):null,null!=o.maxSpan?Ep(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=Vp([Ep(i[0],r,a,!0),Ep(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Vp(n.slice()),r=this._size;Rs([0,1],(function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})}),this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;le[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Lu(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape,i=+new Date;if(!(i-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),o=[0,100];this._range=Vp([Ep(n.x,r,o,!0),Ep(n.x+n.width,r,o,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(gu(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new k8({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?V8:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=m2(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},e.type="dataZoom.slider",e}(C2);function G8(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function H8(t){return"vertical"===t?"ns-resize":"ew-resize"}const W8=F8;function U8(t){t.registerComponentModel(D8),t.registerComponentView(W8),B2(t)}function Z8(t){Ek(T8),Ek(U8)}var Y8={get:function(t,e,n){var i=Ms((X8[t]||{})[e]);return n&&Hs(i)?i[i.length-1]:i}},X8={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const j8=Y8;var q8=oU.mapVisual,K8=oU.eachVisual,$8=Hs,J8=Rs,Q8=Vp,t7=Ep,e7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return qa(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&V3(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=Fs(t,this),this.controllerVisuals=B3(this.option.controller,e,t),this.targetVisuals=B3(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,n){e.push(n)})):e=hf(t),e},e.prototype.eachTargetSeries=function(t,e){Rs(this.getTargetSeriesIndices(),(function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)}),this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(n){n===t&&(e=!0)})),e},e.prototype.formatValueText=function(t,e,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],Hs(t)&&(t=t.slice(),i=!0);var l=e?t:i?[u(t[0]),u(t[1])]:u(t);return Us(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):Ws(s)?i?s(t[0],t[1]):s(t):i?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=Q8([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=t.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),r=e.controller||(e.controller={});Is(i,n),Is(r,n);var o=this.isCategory();function a(n){$8(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}function s(t,e,n){var i=t[e],r=t[n];i&&!r&&(r=t[n]={},J8(i,(function(t,e){if(oU.isValidType(e)){var n=j8.get(e,"inactive",o);null!=n&&(r[e]=n,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}function l(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol(),a=r||"roundRect";J8(this.stateList,(function(r){var s=this.itemSize,l=t[r];l||(l=t[r]={color:o?i:[i]}),null==l.symbol&&(l.symbol=e&&Ms(e)||(o?a:[a])),null==l.symbolSize&&(l.symbolSize=n&&Ms(n)||(o?s[0]:[s[0],s[0]])),l.symbol=q8(l.symbol,(function(t){return"none"===t?a:t}));var u=l.symbolSize;if(null!=u){var h=-1/0;K8(u,(function(t){t>h&&(h=t)})),l.symbolSize=q8(u,(function(t){return t7(t,[0,h],[0,s[0]],!0)}))}}),this)}a.call(this,i),a.call(this,r),s.call(this,i,"inRange","outOfRange"),l.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Jx);const n7=e7;var i7=[20,140],r7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=i7[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=i7[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):Hs(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),Rs(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=Vp((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),(function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)}),this),e.push({seriesId:n.id,dataIndex:i})}),this),e},e.prototype.getVisualMeta=function(t){var e=o7(this,"outOfRange",this.getExtent()),n=o7(this,"inRange",this.option.range.slice()),i=[];function r(e,n){i.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;at[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/n})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Ip("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent();p7([0,1],(function(l){var u=r[l];u.setStyle("fill",e.handlesColor[l]),u.y=t[l];var h=d7(t[l],[0,a[1]],s,!0),c=this.getControllerVisual(h,"symbolSize");u.scaleX=u.scaleY=c/a[0],u.x=a[0]-c/2;var d=IC(n.handleLabelPoints[l],MC(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h={convertOpacityToAlpha:!0},c=this.getControllerVisual(t,"color",h),d=this.getControllerVisual(t,"symbolSize"),p=d7(t,o,s,!0),f=a[0]-d/2,g={x:u.x,y:u.y};u.y=p,u.x=f;var v=IC(l.indicatorLabelPoint,MC(u,this.group)),y=l.indicatorLabel;y.attr("invisible",!1);var m=this._applyTransform("left",l.mainGroup),_=this._orient,x="horizontal"===_;y.setStyle({text:(n||"")+r.formatValueText(e),verticalAlign:x?m:"middle",align:x?"center":m});var b={x:f,y:p,style:{fill:c}},w={style:{x:v[0],y:v[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var S={duration:100,easing:"cubicInOut",additive:!0};u.x=g.x,u.y=g.y,u.animateTo(b,S),y.animateTo(w,S)}else u.attr(b),y.attr(w);this._firstShowIndicator=!1;var M=this._shapes.handleLabels;if(M)for(var I=0;Ir[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var h=this._hoverLinkDataIndices,c=[];(e||b7(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=kf(h,c);this._dispatchHighDown("downplay",c7(d[0],n)),this._dispatchHighDown("highlight",c7(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(XT(t.target,(function(t){var n=Cy(t);if(null!=n.dataIndex)return e=n,!0}),!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var r=n.getData(e.dataType),o=r.getStore().get(i.getDataDimensionIndex(r),e.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n=0&&(r.dimension=o,i.push(r))}})),t.getData().setVisual("visualMeta",i)}}];function T7(t,e,n,i){for(var r=e.targetVisuals[i],o=oU.prepareVisualTypes(r),a={color:HT(t.getData(),"color")},s=0,l=o.length;s0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction(M7,I7),Rs(C7,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(D7))}function R7(t){t.registerComponentModel(a7),t.registerComponentView(S7),P7(t)}var O7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._pieceList=[],n}return qa(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],N7[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=Ms(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=Os(this._pieceList,(function(t){return t=Ms(t),"inRange"!==e&&(t.visual=null),t})))}))},e.prototype.completeVisualOption=function(){var e=this.option,n={},i=oU.listVisualTypes(),r=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}Rs(e.pieces,(function(t){Rs(i,(function(e){t.hasOwnProperty(e)&&(n[e]=1)}))})),Rs(n,(function(t,n){var i=!1;Rs(this.stateList,(function(t){i=i||o(e,t,n)||o(e.target,t,n)}),this),!i&&Rs(this.stateList,(function(t){(e[t]||(e[t]={}))[n]=j8.get(n,"inRange"===t?"active":"inactive",r)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,r=(e?n:t).selected||{};if(n.selected=r,Rs(i,(function(t,e){var n=this.getSelectedMapKey(t);r.hasOwnProperty(n)||(r[n]=!0)}),this),"single"===n.selectedMode){var o=!1;Rs(i,(function(t,e){var n=this.getSelectedMapKey(t);r[n]&&(o?r[n]=!1:o=!0)}),this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Ms(t)},e.prototype.getValueState=function(t){var e=oU.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries((function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),(function(e,i){var o=oU.findPieceIndex(e,n);o===t&&r.push(i)}),this),e.push({seriesId:i.id,dataIndex:r})}),this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),o=r[r.length-1].interval[1],o!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return Rs(r,(function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])}),this),{stops:e,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=t(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:e.push({value:r[0],color:s},{value:r[1],color:s})}},e.type="visualMap.piecewise",e.defaultOption=R_(n7.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(n7),N7={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;var o=(i[1]-i[0])/r;while(+o.toFixed(n)!==o&&n<5)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)}),this)}};function E7(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}const z7=O7;var B7=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return qa(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=el(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,a),Rs(l.viewPieceList,(function(i){var l=i.piece,u=new Ip;u.onclick=Fs(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new Iy({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===d?.5:1}}))}t.add(u)}),this),u&&this._renderEndsText(t,u[1],s,h,a),Fx(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",(function(){return i("highlight")})).on("mouseout",(function(){return i("downplay")}));var i=function(t){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:t,batch:c7(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return h7(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,r){if(e){var o=new Ip,a=this.visualMapModel.textStyleModel;o.add(new Iy({style:r_(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:e})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=Os(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),n=t.get("text"),i=t.get("orient"),r=t.get("inverse");return("horizontal"===i?r:!r)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},e.prototype._createItemSymbol=function(t,e,n){t.add(sA(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color")))},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var r=Ms(n.selected),o=e.getSelectedMapKey(t);"single"===i||!0===i?(r[o]=!0,Rs(r,(function(t,e){r[e]=e===o}))):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},e.type="visualMap.piecewise",e}(l7);const V7=B7;function F7(t){t.registerComponentModel(z7),t.registerComponentView(V7),P7(t)}function G7(t){Ek(R7),Ek(F7)}var H7={label:{enabled:!0},decal:{show:!1}},W7=Pf(),U7={};function Z7(t,e){var n=t.getModel("aria");if(n.get("enabled")){var i=Ms(H7);Is(i.label,t.getLocaleModel().get("aria"),!1),Is(n.option,i,!1),r(),o()}function r(){var e=n.getModel("decal"),i=e.get("show");if(i){var r=gl();t.eachSeries((function(t){if(!t.isColorBySeries()){var e=r.get(t.type);e||(e={},r.set(t.type,e)),W7(t).scope=e}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if(Ws(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=Db(e.ecModel,e.name,U7,t.getSeriesCount()),r=n.getVisual("decal");n.setVisual("decal",u(r,i))}else{var o=e.getRawData(),a={},s=W7(e).scope;n.each((function(t){var e=n.getRawIndex(t);a[e]=t}));var l=o.count();o.each((function(t){var i=a[t],r=o.getName(t)||t+"",h=Db(e.ecModel,r,s,l),c=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",u(c,h))}))}}function u(t,e){var n=t?Ts(Ts({},e),t):e;return n.dirty=!0,n}}))}}function o(){var i=t.getLocaleModel().get("aria"),r=n.getModel("label");if(r.option=As(r.option,i),r.get("enabled")){var o=e.getZr().dom;if(r.get("description"))o.setAttribute("aria-label",r.get("description"));else{var u,h=t.getSeriesCount(),c=r.get(["data","maxCount"])||10,d=r.get(["series","maxCount"])||10,p=Math.min(h,d);if(!(h<1)){var f=s();if(f){var g=r.get(["general","withTitle"]);u=a(g,{title:f})}else u=r.get(["general","withoutTitle"]);var v=[],y=h>1?r.get(["series","multiple","prefix"]):r.get(["series","single","prefix"]);u+=a(y,{seriesCount:h}),t.eachSeries((function(t,e){if(e1?r.get(["series","multiple",o]):r.get(["series","single",o]),n=a(n,{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:l(t.subType)});var s=t.getData();if(s.count()>c){var u=r.get(["data","partialData"]);n+=a(u,{displayCnt:c})}else n+=r.get(["data","allData"]);for(var d=r.get(["data","separator","middle"]),f=r.get(["data","separator","end"]),g=[],y=0;y":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},q7=function(){function t(t){var e=this._condVal=Us(t)?new RegExp(t):Qs(t)?t:null;if(null==e){var n="";0,lS(n)}}return t.prototype.evaluate=function(t){var e=typeof t;return Us(e)?this._condVal.test(t):!!Ys(e)&&this._condVal.test(t+"")},t}(),K7=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),$7=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e2&&l.push(e),e=[t,n]}function f(t,n,i,r){g9(t,i)&&g9(n,r)||e.push(t,n,i,r,i,r)}function g(t,n,i,r,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,u=nM:T2&&l.push(e),l}function y9(t,e,n,i,r,o,a,s,l,u){if(g9(t,n)&&g9(e,i)&&g9(r,a)&&g9(o,s))l.push(a,s);else{var h=2/u,c=h*h,d=a-t,p=s-e,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-t,v=i-e,y=r-a,m=o-s,_=g*g+v*v,x=y*y+m*m;if(_=0&&M=0)l.push(a,s);else{var I=[],C=[];zh(t,n,r,a,.5,I),zh(e,i,o,s,.5,C),y9(I[0],C[0],I[1],C[1],I[2],C[2],I[3],C[3],l,u),y9(I[4],C[4],I[5],C[5],I[6],C[6],I[7],C[7],l,u)}}}}function m9(t,e){var n=v9(t),i=[];e=e||1;for(var r=0;r0)for(u=0;uMath.abs(u),c=_9([l,u],h?0:1,e),d=(h?s:u)/c.length,p=0;pr,a=_9([i,r],o?0:1,e),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",h=o?"y":"x",c=t[s]/a.length,d=0;d1?null:new Lu(g*l+t,g*u+e)}function M9(t,e,n){var i=new Lu;Lu.sub(i,n,e),i.normalize();var r=new Lu;Lu.sub(r,t,e);var o=r.dot(i);return o}function I9(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function C9(t,e,n){for(var i=t.length,r=[],o=0;oa?(u.x=h.x=s+o/2,u.y=l,h.y=l+a):(u.y=h.y=l+a/2,u.x=s,h.x=s+o),C9(e,u,h)}function A9(t,e,n,i){if(1===n)i.push(e);else{var r=Math.floor(n/2),o=t(e);A9(t,o[0],r,i),A9(t,o[1],n-r,i)}return i}function D9(t,e){for(var n=[],i=0;i0)for(var b=i/n,w=-i/2;w<=i/2;w+=b){var S=Math.sin(w),M=Math.cos(w),I=0;for(_=0;_0;u/=2){var h=0,c=0;(t&u)>0&&(h=1),(e&u)>0&&(c=1),l+=u*u*(3*h^c),0===c&&(1===h&&(t=u-1-t,e=u-1-e),s=t,t=e,e=s)}return l}function j9(t){var e=1/0,n=1/0,i=-1/0,r=-1/0,o=Os(t,(function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),i=Math.max(s,i),r=Math.max(l,r),[s,l]})),a=Os(o,(function(o,a){return{cp:o,z:X9(o[0],o[1],e,n,i,r),path:t[a]}}));return a.sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function q9(t){return P9(t.path,t.count)}function K9(){return{fromIndividuals:[],toIndividuals:[],count:0}}function $9(t,e,n){var i=[];function r(t){for(var e=0;e=0;r--)if(!n[r].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[r].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var ett={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0;i0){var s,l,u=i.getModel("universalTransition").get("delay"),h=Object.assign({setToFinal:!0},a);Q9(t)&&(s=t,l=e),Q9(e)&&(s=e,l=t);for(var c=s?s===t:t.length>e.length,d=s?ttt(l,s):ttt(c?e:t,[c?t:e]),p=0,f=0;frtt))for(var i=n.getIndices(),r=att(n),o=0;o0&&r.group.traverse((function(t){t instanceof Uv&&!t.animators.length&&t.animateFrom({style:{opacity:0}},o)}))}))}function ftt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function gtt(t){return Hs(t)?t.sort().join(","):t}function vtt(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function ytt(t,e){var n=gl(),i=gl(),r=gl();return Rs(t.oldSeries,(function(e,n){var o=t.oldDataGroupIds[n],a=t.oldData[n],s=ftt(e),l=gtt(s);i.set(l,{dataGroupId:o,data:a}),Hs(s)&&Rs(s,(function(t){r.set(t,{key:l,dataGroupId:o,data:a})}))})),Rs(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),o=t.getData(),a=ftt(t),s=gtt(a),l=i.get(s);if(l)n.set(s,{oldSeries:[{dataGroupId:l.dataGroupId,divide:vtt(l.data),data:l.data}],newSeries:[{dataGroupId:e,divide:vtt(o),data:o}]});else if(Hs(a)){0;var u=[];Rs(a,(function(t){var e=i.get(t);e.data&&u.push({dataGroupId:e.dataGroupId,divide:vtt(e.data),data:e.data})})),u.length&&n.set(s,{oldSeries:u,newSeries:[{dataGroupId:e,data:o,divide:vtt(o)}]})}else{var h=r.get(a);if(h){var c=n.get(h.key);c||(c={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:vtt(h.data)}],newSeries:[]},n.set(h.key,c)),c.newSeries.push({dataGroupId:e,data:o,divide:vtt(o)})}}}})),n}function mtt(t,e){for(var n=0;n=0&&r.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],divide:vtt(e.oldData[n]),dim:t.dimension})})),Rs(hf(t.to),(function(t){var i=mtt(n.updatedSeries,t);if(i>=0){var r=n.updatedSeries[i].getData();o.push({dataGroupId:e.oldDataGroupIds[i],data:r,divide:vtt(r),dim:t.dimension})}})),r.length>0&&o.length>0&&ptt(r,o,i)}function xtt(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,n){Rs(hf(n.seriesTransition),(function(t){Rs(hf(t.to),(function(t){for(var e=n.updatedSeries,i=0;i((0,r.dD)("data-v-609a8e64"),t=t(),(0,r.Cn)(),t),Stt={class:"content-box"},Mtt={class:"info"},Itt={class:"info-content"},Ctt=wtt((()=>(0,r._)("h1",null,[(0,r.Uk)("Organism: "),(0,r._)("span",null,"Homo sapiens")],-1))),Ttt={class:"button-tag"},Att={class:"history"},Dtt={class:"card"},ktt={__name:"index",emits:["changeLoading"],setup(t,{emit:e}){const n=(0,btt.tv)(),i=(0,o.iH)(!1),l=e;let u=500,h=[];const c=(0,o.iH)(!1),d=(0,o.iH)(!1),p=(0,o.iH)(!1),f=(0,o.iH)([]),g=(0,o.iH)(""),v=(0,o.iH)([]),y=(0,o.iH)([]),m=(0,o.iH)([]),_=["#8DD3C7","#EDBC63","#BEBADA","#FB8072","#80B1D3"],x=(0,o.iH)(),b=(0,o.iH)([]);let w;const S=["heart","stomach","blood plasma","brain","kidney","liver","lung","pancreas","spleen","adrenal gland","testis","ovary","prostate","colon","esophagus","placenta"],M={trigger:"item",axisPointer:{type:"shadow"},textStyle:{},formatter:function(t){return["

"+t.data[0]+"

",'
',"Max:"+parseFloat(t.data[5]).toFixed(2)+"
","Q3:"+parseFloat(t.data[4]).toFixed(2)+"
","Median:"+parseFloat(t.data[3]).toFixed(2)+"
","Q1:"+parseFloat(t.data[2]).toFixed(2)+"
","Min:"+parseFloat(t.data[1]).toFixed(2)+"
"].join("")}};v.value=Array.isArray(n.currentRoute.value.query.protein)?n.currentRoute.value.query.protein:[n.currentRoute.value.query.protein],g.value=n.currentRoute.value.name;const I=async()=>{l("changeLoading");const t="tissues"===g.value?await Wt():await Ut(),e=new Uint8Array(t.data),n=Xa(e,{to:"string"});h=JSON.parse(n),l("changeLoading"),T(v)},C=t=>{f.value.splice(m.value.indexOf(t),1),m.value.splice(m.value.indexOf(t),1),"tissues"===g.value?n.push({path:"/ae/tissues",query:{protein:m.value}}):n.push({path:"/ae/cellline",query:{protein:m.value}})},T=t=>{if("undefined"===typeof t.value[0])return p.value=!1,void(w&&w.dispose());let e=h;t.value.map((t=>{const n=e.find((e=>e.name===t.trim()));n?m.value.includes(t.trim())||(5===m.value.length?(m.value.shift(),m.value.push(t.trim()),f.value.shift(),f.value.push(n)):(m.value.push(t.trim()),f.value.push(n))):alert("Please enter a legal protein name")})),m.value.length!=t.value.length?"tissues"===g.value?n.push({path:"/ae/tissues",query:{protein:m.value}}):n.push({path:"/ae/cellline",query:{protein:m.value}}):(p.value=!0,u=f.value.length>1?400*f.value.length:500,(0,r.Y3)((()=>{k()})))};(0,btt.ao)((t=>{v.value=t.query.protein,T(v)})),(0,r.bv)((()=>{I()}));const A=t=>{"tissues"===g.value&&t.tags.length<18&&S.map((e=>{t.tags.includes(e)||(t.tags.push(e),t.data.push([]))}));let e=[];for(let r=0;rt>=1)),e.push(n)}"tissues"!==g.value&&(e.sort(((t,e)=>{const n=t.data.length,i=e.data.length;return i-n})),e=e.slice(0,20)),e.sort(((t,e)=>{const n=t.data.length>0?t.data.reduce(((t,e)=>t+e))/t.data.length:0,i=t.data.length>0?e.data.reduce(((t,e)=>t+e))/e.data.length:0;return n-i}));let n=[],i=[];return e.map((t=>{n.push(t.data),i.push(t.name)})),{neatData:n,tags:i}},D={title:[],dataset:[],tooltip:{},legend:{show:!0,orient:"vertical",right:10,top:60,data:[]},grid:{left:"10%",right:"10%",bottom:60},yAxis:{type:"category",boundaryGap:!0,nameGap:30,splitArea:{show:!1},splitLine:{show:!1}},xAxis:{type:"value",name:"iBAQLog",nameLocation:"center",nameGap:40,splitArea:{show:!1},splitLine:{show:!1},min:1},toolbox:{feature:{saveAsImage:{type:"png",title:"save as .png",pixelRatio:10}}},series:[]},k=()=>{if(1===f.value.length){D.dataset=[],D.series=[],D.title=[],D.legend.show=!1;let{neatData:t,tags:e}=A(f.value[0]);y.value=e,D.title.push({text:f.value[0].title,left:"center"});let{samples:n,data:i}=L(t,2);c.value?(D.series.push({name:m.value[0],type:"bar",data:i,itemStyle:{color:_[0],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"},label:{show:d.value,position:"right",formatter:function(){return`samples: ${n.shift()}`}}}),D.tooltip={trigger:"axis",axisPointer:{type:"shadow"}},D.yAxis.data=y.value):(D.dataset.push({source:t}),D.dataset.push({fromDatasetIndex:0,transform:{type:"boxplot",config:{itemNameFormatter:function(t){return e[t.value]}}}}),D.series.push({name:"category0",type:"boxplot",datasetIndex:1,itemStyle:{color:_[0],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"}}),D.tooltip=M)}else{g.value,y.value=0===y.value.length?A(f.value[0]).tags:y.value,0===f.value.length?D.title=[]:D.title.splice(0,1,{text:`Comparison of protein expression in different ${g.value}`,left:"center"}),0===f.value.length?D.legend.show=!1:D.legend.show=!0;let t=[];f.value.map((e=>{let n=[];y.value.forEach((t=>{if(e.tags.includes(t)){let i=e.tags.indexOf(t),r=e.data[i].filter((t=>t>=1));n.push(r)}else n.push([])})),t.push(n)}));let{samples:e,data:n}=L(t,3);c.value?(t=n,D.dataset=[],D.series=[],D.legend.data=[],t.forEach(((t,n)=>{D.series.push({name:m.value[n],type:"bar",data:t,itemStyle:{color:_[n],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"},label:{show:d.value,position:"right",formatter:function(){return`samples: ${e[n].shift()}`}}}),D.legend.data.push({name:m.value[n],itemStyle:{color:_[n],borderColor:_[n]}})})),D.tooltip={trigger:"axis",axisPointer:{type:"shadow"}},D.yAxis.data=y.value):(D.dataset=[],D.series=[],D.legend.data=[],t.forEach(((e,n)=>{D.dataset.push({source:e}),D.series.push({name:m.value[n],type:"boxplot",datasetIndex:t.length+n,itemStyle:{color:_[n],color0:"#FA0000",borderColor:"#030609",borderColor0:"#030609"}}),D.legend.data.push({name:m.value[n],itemStyle:{color:_[n],borderColor:_[n]}})})),t.forEach(((t,e)=>{D.dataset.push({fromDatasetIndex:e,transform:{type:"boxplot",config:{itemNameFormatter:function(t){return y.value[t.value]}}}})})),D.tooltip=M)}null!=w&&""!==w&&void 0!==w&&w.dispose(),w=yk(x.value,"macarons"),w.clear(),w.resize({height:u}),w.setOption(D),setTimeout((()=>{if(0!==v.value.length){let t=w.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff",excludeComponents:["toolbox"]}),e={proteinName:v.value,url:t};b.value.unshift(e)}}),2e3)},L=(t,e)=>{if(2===e){let e=t.map((t=>t.length));return t=t.map((t=>t.length>0?Number((t.reduce(((t,e)=>t+e))/t.length).toFixed(2)):0)),{samples:e,data:t}}{let e=t.map((t=>t.map((t=>t.length))));return t=t.map((t=>t.map((t=>t.length>0?Number((t.reduce(((t,e)=>t+e))/t.length).toFixed(2)):0)))),{samples:e,data:t}}},P=()=>{k()},R=()=>{k()};return(t,e)=>{const n=Gt,l=Ct.Ks,h=It.gi,f=Mt.F8,g=St,v=K;return(0,r.wy)(((0,r.wg)(),(0,r.iD)("div",Stt,[(0,r._)("div",Mtt,[(0,r._)("div",Itt,[Ctt,(0,r.Wm)(n,{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=t=>c.value=t),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949",position:"absolute"},"active-text":"Bar","inactive-text":"Box",onChange:P},null,8,["modelValue"]),(0,r.wy)((0,r.Wm)(n,{modelValue:d.value,"onUpdate:modelValue":e[1]||(e[1]=t=>d.value=t),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949",position:"absolute",left:"5.5rem"},"active-text":"Show label","inactive-text":"Off label",onChange:R},null,8,["modelValue"]),[[a.F8,c.value]])]),(0,r._)("div",Ttt,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(m.value,((t,e)=>((0,r.wg)(),(0,r.j4)(l,{key:e,round:"",closable:"",color:_[e],onClose:e=>C(t)},{default:(0,r.w5)((()=>[(0,r.Uk)((0,s.zw)(t),1)])),_:2},1032,["color","onClose"])))),128))]),(0,r._)("div",Att,[(0,r.Wm)(h,{style:{"margin-right":"16px"},class:"history-info",type:"info",onClick:e[2]||(e[2]=t=>i.value=!0)},{default:(0,r.w5)((()=>[(0,r.Uk)(" history ")])),_:1}),(0,r.Wm)(v,{modelValue:i.value,"onUpdate:modelValue":e[3]||(e[3]=t=>i.value=t),title:"I am the title","with-header":!1},{default:(0,r.w5)((()=>[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(b.value,((t,e)=>((0,r.wg)(),(0,r.j4)(g,{"tab-position":"right",style:{height:"300px"},class:"demo-tabs",key:e},{default:(0,r.w5)((()=>[(0,r._)("h5",null,(0,s.zw)(t.proteinName.join()),1),(0,r.Wm)(f,{style:{width:"100%"},src:t.url,fit:"fill","preview-src-list":[t.url]},null,8,["src","preview-src-list"])])),_:2},1024)))),128))])),_:1},8,["modelValue"])])]),(0,r._)("div",Dtt,[(0,r._)("div",{ref_key:"chart",ref:x,style:(0,s.j5)({width:"100%",height:(0,o.SU)(u)+"px"})},null,4)])],512)),[[a.F8,p.value]])}}};var Ltt=n(3744);const Ptt=(0,Ltt.Z)(ktt,[["__scopeId","data-v-609a8e64"]]),Rtt=Ptt},6502:(t,e,n)=>{n.d(e,{cU:()=>f,WS:()=>p});var i=n(2262),r=n(6252);const o=Symbol();var a=n(9143),s=n(7774),l=n(4568),u=n(4721),h=n(2771),c=n(5437);const d=(0,i.iH)();function p(t,e=void 0){const n=(0,r.FN)()?(0,r.f3)(o,d):d;return t?(0,r.Fl)((()=>{var i,r;return null!=(r=null==(i=n.value)?void 0:i[t])?r:e})):n}function f(t,e){const n=p(),o=(0,a.s3)(t,(0,r.Fl)((()=>{var t;return(null==(t=n.value)?void 0:t.namespace)||a.tL}))),u=(0,s.bU)((0,r.Fl)((()=>{var t;return null==(t=n.value)?void 0:t.locale}))),h=(0,l.Cn)((0,r.Fl)((()=>{var t;return(null==(t=n.value)?void 0:t.zIndex)||l.DA}))),c=(0,r.Fl)((()=>{var t;return(0,i.SU)(e)||(null==(t=n.value)?void 0:t.size)||""}));return g((0,r.Fl)((()=>(0,i.SU)(n)||{}))),{ns:o,locale:u,zIndex:h,size:c}}const g=(t,e,n=!1)=>{var c;const f=!!(0,r.FN)(),g=f?p():void 0,y=null!=(c=null==e?void 0:e.provide)?c:f?r.JJ:void 0;if(!y)return void(0,u.N)("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const m=(0,r.Fl)((()=>{const e=(0,i.SU)(t);return(null==g?void 0:g.value)?v(g.value,e):e}));return y(o,m),y(s._N,(0,r.Fl)((()=>m.value.locale))),y(a.dP,(0,r.Fl)((()=>m.value.namespace))),y(l.KM,(0,r.Fl)((()=>m.value.zIndex))),y(h.m8,{size:(0,r.Fl)((()=>m.value.size||""))}),!n&&d.value||(d.value=m.value),m},v=(t,e)=>{var n;const i=[...new Set([...(0,c.uc)(t),...(0,c.uc)(e)])],r={};for(const o of i)r[o]=null!=(n=e[o])?n:t[o];return r}},165:(t,e,n)=>{n.d(e,{H:()=>i,K:()=>r});const i=Symbol("formContextKey"),r=Symbol("formItemContextKey")},1069:(t,e,n)=>{n.d(e,{DT:()=>u,Cd:()=>l});var i=n(2262),r=n(6252),o=n(165);const a=t=>{const e=(0,r.FN)();return(0,r.Fl)((()=>{var n,i;return null==(i=null==(n=null==e?void 0:e.proxy)?void 0:n.$props)?void 0:i[t]}))};var s=n(2771);const l=(t,e={})=>{const n=(0,i.iH)(void 0),l=e.prop?n:a("size"),u=e.global?n:(0,s.fl)(),h=e.form?{size:void 0}:(0,r.f3)(o.H,void 0),c=e.formItem?{size:void 0}:(0,r.f3)(o.K,void 0);return(0,r.Fl)((()=>l.value||(0,i.SU)(t)||(null==c?void 0:c.size)||(null==h?void 0:h.size)||u.value||""))},u=t=>{const e=a("disabled"),n=(0,r.f3)(o.H,void 0);return(0,r.Fl)((()=>e.value||(0,i.SU)(t)||(null==n?void 0:n.disabled)||!1))}},5620:(t,e,n)=>{n.d(e,{A:()=>s,p:()=>l});var i=n(6252),r=n(2262),o=n(165),a=n(2259);const s=()=>{const t=(0,i.f3)(o.H,void 0),e=(0,i.f3)(o.K,void 0);return{form:t,formItem:e}},l=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:o})=>{n||(n=(0,r.iH)(!1)),o||(o=(0,r.iH)(!1));const s=(0,r.iH)();let l;const u=(0,i.Fl)((()=>{var n;return!!(!t.label&&e&&e.inputIds&&(null==(n=e.inputIds)?void 0:n.length)<=1)}));return(0,i.bv)((()=>{l=(0,i.YP)([(0,r.Vh)(t,"id"),n],(([t,n])=>{const i=null!=t?t:n?void 0:(0,a.Me)().value;i!==s.value&&((null==e?void 0:e.removeInputId)&&(s.value&&e.removeInputId(s.value),(null==o?void 0:o.value)||n||!i||e.addInputId(i)),s.value=i)}),{immediate:!0})})),(0,i.Ah)((()=>{l&&l(),(null==e?void 0:e.removeInputId)&&s.value&&e.removeInputId(s.value)})),{isLabeledByFormItem:u,inputId:s}}},6398:(t,e,n)=>{n.d(e,{gi:()=>y});var i=n(6252),r=n(3577),o=n(2262),a=n(5027),s=n(209);const l=(0,a.o8)({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:s.k,default:""},truncated:{type:Boolean},lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var u=n(1446),h=n(1069),c=n(9143),d=n(5162);const p=(0,i.aZ)({name:"ElText"}),f=(0,i.aZ)({...p,props:l,setup(t){const e=t,n=(0,h.Cd)(),a=(0,c.s3)("text"),s=(0,i.Fl)((()=>[a.b(),a.m(e.type),a.m(n.value),a.is("truncated",e.truncated),a.is("line-clamp",!(0,d.o8)(e.lineClamp))]));return(t,e)=>((0,i.wg)(),(0,i.j4)((0,i.LL)(t.tag),{class:(0,r.C_)((0,o.SU)(s)),style:(0,r.j5)({"-webkit-line-clamp":t.lineClamp})},{default:(0,i.w5)((()=>[(0,i.WI)(t.$slots,"default")])),_:3},8,["class","style"]))}});var g=(0,u.Z)(f,[["__file","text.vue"]]),v=n(2123);const y=(0,v.nz)(g)},9448:(t,e,n)=>{n(3241)},9460:(t,e,n)=>{n.d(e,{O7:()=>r,e_:()=>o,f_:()=>i});const i="update:modelValue",r="change",o="input"},209:(t,e,n)=>{n.d(e,{V:()=>r,k:()=>i});const i=["","default","small","large"],r={large:40,default:32,small:24}},2259:(t,e,n)=>{n.d(e,{Me:()=>c,SG:()=>h});var i=n(6252),r=n(2262),o=n(9143),a=n(3299),s=n(4721);const l={prefix:Math.floor(1e4*Math.random()),current:0},u=Symbol("elIdInjection"),h=()=>(0,i.FN)()?(0,i.f3)(u,l):l,c=t=>{const e=h();a.C5||e!==l||(0,s.N)("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const n=(0,o.u_)(),u=(0,i.Fl)((()=>(0,r.SU)(t)||`${n.value}-id-${e.prefix}-${e.current++}`));return u}},2771:(t,e,n)=>{n.d(e,{Pp:()=>s,fl:()=>u,m8:()=>l});var i=n(6252),r=n(2262),o=n(5027),a=n(209);const s=(0,o.l0)({type:String,values:a.k,required:!1}),l=Symbol("size"),u=()=>{const t=(0,i.f3)(l,{});return(0,i.Fl)((()=>(0,r.SU)(t.size)||""))}},7601:(t,e,n)=>{function i(t){return null==t}n.d(e,{Z:()=>r});const r=i}}]); +//# sourceMappingURL=145.354ab71d.js.map \ No newline at end of file diff --git a/js/874.d34650df.js.map b/js/145.354ab71d.js.map similarity index 57% rename from js/874.d34650df.js.map rename to js/145.354ab71d.js.map index f3e59b5..3f9cca4 100644 --- a/js/874.d34650df.js.map +++ b/js/145.354ab71d.js.map @@ -1 +1 @@ -{"version":3,"file":"js/874.d34650df.js","mappings":"+pCAEA,MAAMA,EAAiBC,IACrB,IAAKA,EACH,MAAO,CAAEC,QAAS,KAAMC,YAAa,KAAMC,UAAW,MAExD,IAAIC,GAAkB,EAClBC,GAAgB,EACpB,MAAMJ,EAAWK,IACXF,GAAmBC,GACrBL,EAAYM,GAEdF,EAAkBC,GAAgB,CAAK,EAEnCH,EAAeI,IACnBF,EAAkBE,EAAEC,SAAWD,EAAEE,aAAa,EAE1CL,EAAaG,IACjBD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,EACrB,QAAW0J,EAAKuB,OAAQ,cAE1BI,EAAG,GACF,EAAG,CAAC,QAAS,UAEpB,IAEF,IAAImxX,GAAuB,OAAYn0X,EAAW,CAAC,CAAC,SAAU,c,UCnC9D,MAAMo0X,GAAS,QAAYD,E,6ECL3B,MAAME,EAAqB,oBACrBC,EAAe,SACfC,EAAc,O,yCCFpB,MAAMC,EAAiB,CAAC,GAAI,UAAW,QAAS,SAC1CC,EAAmB,CACvBl8O,MAAO,GACP5gJ,QAAS,GACT+8X,MAAO,G,kGCET,MAAMC,EAAqB,CACzBjkR,OAAQpoG,KAAKmhD,MAAsB,IAAhBnhD,KAAKopE,UACxBmuB,QAAS,GAEL+0R,EAAmBvxX,OAAO,iBAC1BwxX,EAAiB,KACd,WAAuB,QAAOD,EAAkBD,GAAsBA,EAEzErI,EAASwI,IACb,MAAMC,EAAcF,IACf,MAAYE,IAAgBJ,IAC/B,OAAU,cAAe,8MAM3B,MAAMt3X,GAAY,UACZ23X,GAAQ,SAAS,KAAM,QAAMF,IAAoB,GAAGz3X,EAAUvB,YAAYi5X,EAAYrkR,UAAUqkR,EAAYl1R,cAClH,OAAOm1R,CAAK,C,gGCnBd,MAAMC,GAAc,QAAU,CAC5Bx9X,KAAMK,OACNqE,OAAQ,IACR+4X,UAAU,IAKNC,EAAqB9xX,OAAO,QAC5B+xX,EAAgB,KACpB,MAAMC,GAAe,QAAOF,EAAoB,CAAC,GACjD,OAAO,SAAS,KACP,QAAME,EAAaj5X,OAAS,IACnC,C,iBCCJ,SAASk5X,EAAMx5X,GACb,OAAgB,MAATA,CACT,C,iBAEA,S","sources":["webpack://quantms.org/./node_modules/element-plus/es/hooks/use-same-target/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/utils/vue/vnode.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/overlay/src/overlay.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/overlay/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/dialog-content.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/dialog.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/src/drawer.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-lockscreen/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/use-dialog.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/src/drawer2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-bar.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-bar2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-nav.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-ordered-children/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tabs.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-pane.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-pane2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/src/switch.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/src/switch2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/index.mjs","webpack://quantms.org/./src/api/search.js","webpack://quantms.org/./node_modules/pako/dist/pako.esm.mjs","webpack://quantms.org/./node_modules/tslib/tslib.es6.js","webpack://quantms.org/./node_modules/zrender/lib/core/env.js","webpack://quantms.org/./node_modules/zrender/lib/core/platform.js","webpack://quantms.org/./node_modules/zrender/lib/core/util.js","webpack://quantms.org/./node_modules/zrender/lib/core/vector.js","webpack://quantms.org/./node_modules/zrender/lib/mixin/Draggable.js","webpack://quantms.org/./node_modules/zrender/lib/core/Eventful.js","webpack://quantms.org/./node_modules/zrender/lib/core/fourPointsTransform.js","webpack://quantms.org/./node_modules/zrender/lib/core/dom.js","webpack://quantms.org/./node_modules/zrender/lib/core/event.js","webpack://quantms.org/./node_modules/zrender/lib/core/GestureMgr.js","webpack://quantms.org/./node_modules/zrender/lib/core/matrix.js","webpack://quantms.org/./node_modules/zrender/lib/core/Point.js","webpack://quantms.org/./node_modules/zrender/lib/core/BoundingRect.js","webpack://quantms.org/./node_modules/zrender/lib/Handler.js","webpack://quantms.org/./node_modules/zrender/lib/core/timsort.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/constants.js","webpack://quantms.org/./node_modules/zrender/lib/Storage.js","webpack://quantms.org/./node_modules/zrender/lib/animation/requestAnimationFrame.js","webpack://quantms.org/./node_modules/zrender/lib/animation/easing.js","webpack://quantms.org/./node_modules/zrender/lib/core/curve.js","webpack://quantms.org/./node_modules/zrender/lib/animation/cubicEasing.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Clip.js","webpack://quantms.org/./node_modules/zrender/lib/core/LRU.js","webpack://quantms.org/./node_modules/zrender/lib/tool/color.js","webpack://quantms.org/./node_modules/zrender/lib/svg/helper.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Animator.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Animation.js","webpack://quantms.org/./node_modules/zrender/lib/dom/HandlerProxy.js","webpack://quantms.org/./node_modules/zrender/lib/config.js","webpack://quantms.org/./node_modules/zrender/lib/core/Transformable.js","webpack://quantms.org/./node_modules/zrender/lib/contain/text.js","webpack://quantms.org/./node_modules/zrender/lib/Element.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Group.js","webpack://quantms.org/./node_modules/zrender/lib/zrender.js","webpack://quantms.org/./node_modules/echarts/lib/util/number.js","webpack://quantms.org/./node_modules/echarts/lib/util/model.js","webpack://quantms.org/./node_modules/echarts/lib/util/clazz.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/makeStyleMapper.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/areaStyle.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/image.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/parseText.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Displayable.js","webpack://quantms.org/./node_modules/zrender/lib/core/bbox.js","webpack://quantms.org/./node_modules/zrender/lib/core/PathProxy.js","webpack://quantms.org/./node_modules/zrender/lib/contain/line.js","webpack://quantms.org/./node_modules/zrender/lib/contain/cubic.js","webpack://quantms.org/./node_modules/zrender/lib/contain/quadratic.js","webpack://quantms.org/./node_modules/zrender/lib/contain/util.js","webpack://quantms.org/./node_modules/zrender/lib/contain/arc.js","webpack://quantms.org/./node_modules/zrender/lib/contain/windingLine.js","webpack://quantms.org/./node_modules/zrender/lib/contain/path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/TSpan.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Image.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/roundRect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Rect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Text.js","webpack://quantms.org/./node_modules/echarts/lib/util/innerStore.js","webpack://quantms.org/./node_modules/echarts/lib/util/states.js","webpack://quantms.org/./node_modules/echarts/lib/animation/basicTransition.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/textStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/lineStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/itemStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/Model.js","webpack://quantms.org/./node_modules/echarts/lib/util/component.js","webpack://quantms.org/./node_modules/echarts/lib/i18n/langEN.js","webpack://quantms.org/./node_modules/echarts/lib/i18n/langZH.js","webpack://quantms.org/./node_modules/echarts/lib/core/locale.js","webpack://quantms.org/./node_modules/echarts/lib/util/time.js","webpack://quantms.org/./node_modules/echarts/lib/util/format.js","webpack://quantms.org/./node_modules/echarts/lib/util/layout.js","webpack://quantms.org/./node_modules/echarts/lib/model/Component.js","webpack://quantms.org/./node_modules/echarts/lib/model/globalDefault.js","webpack://quantms.org/./node_modules/echarts/lib/util/types.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/sourceHelper.js","webpack://quantms.org/./node_modules/echarts/lib/model/internalComponentCreator.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/palette.js","webpack://quantms.org/./node_modules/echarts/lib/model/Global.js","webpack://quantms.org/./node_modules/echarts/lib/core/ExtensionAPI.js","webpack://quantms.org/./node_modules/echarts/lib/core/CoordinateSystem.js","webpack://quantms.org/./node_modules/echarts/lib/model/OptionManager.js","webpack://quantms.org/./node_modules/echarts/lib/preprocessor/helper/compatStyle.js","webpack://quantms.org/./node_modules/echarts/lib/preprocessor/backwardCompat.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataStack.js","webpack://quantms.org/./node_modules/echarts/lib/data/Source.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataProvider.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/dataFormat.js","webpack://quantms.org/./node_modules/echarts/lib/core/task.js","webpack://quantms.org/./node_modules/echarts/lib/util/log.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataValueHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/transform.js","webpack://quantms.org/./node_modules/echarts/lib/data/DataStore.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/sourceManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/tooltipMarkup.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js","webpack://quantms.org/./node_modules/echarts/lib/model/Series.js","webpack://quantms.org/./node_modules/echarts/lib/view/Component.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createRenderPlanner.js","webpack://quantms.org/./node_modules/zrender/lib/tool/transformPath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Circle.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Ellipse.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/roundSector.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Sector.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Ring.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/smoothBezier.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/poly.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Polygon.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Polyline.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Line.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/BezierCurve.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Arc.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/CompoundPath.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Gradient.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/LinearGradient.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/RadialGradient.js","webpack://quantms.org/./node_modules/zrender/lib/core/OrientedBoundingRect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/IncrementalDisplayable.js","webpack://quantms.org/./node_modules/echarts/lib/util/graphic.js","webpack://quantms.org/./node_modules/echarts/lib/view/Chart.js","webpack://quantms.org/./node_modules/echarts/lib/util/throttle.js","webpack://quantms.org/./node_modules/echarts/lib/visual/style.js","webpack://quantms.org/./node_modules/echarts/lib/loading/default.js","webpack://quantms.org/./node_modules/echarts/lib/core/Scheduler.js","webpack://quantms.org/./node_modules/echarts/lib/theme/light.js","webpack://quantms.org/./node_modules/echarts/lib/theme/dark.js","webpack://quantms.org/./node_modules/echarts/lib/util/ECEventProcessor.js","webpack://quantms.org/./node_modules/echarts/lib/visual/symbol.js","webpack://quantms.org/./node_modules/echarts/lib/visual/helper.js","webpack://quantms.org/./node_modules/echarts/lib/legacy/dataSelectAction.js","webpack://quantms.org/./node_modules/echarts/lib/util/event.js","webpack://quantms.org/./node_modules/zrender/lib/core/WeakMap.js","webpack://quantms.org/./node_modules/echarts/lib/util/symbol.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/helper.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/dashStyle.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/graphic.js","webpack://quantms.org/./node_modules/echarts/lib/util/decal.js","webpack://quantms.org/./node_modules/echarts/lib/visual/decal.js","webpack://quantms.org/./node_modules/echarts/lib/core/lifecycle.js","webpack://quantms.org/./node_modules/echarts/lib/core/impl.js","webpack://quantms.org/./node_modules/echarts/lib/core/echarts.js","webpack://quantms.org/./node_modules/echarts/lib/extension.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelGuideHelper.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/label/LabelManager.js","webpack://quantms.org/./node_modules/echarts/lib/label/installLabelLayout.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/Layer.js","webpack://quantms.org/./node_modules/echarts/lib/export/core.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/Painter.js","webpack://quantms.org/./node_modules/echarts/lib/renderer/installCanvasRenderer.js","webpack://quantms.org/./node_modules/zrender/lib/svg/SVGPathRebuilder.js","webpack://quantms.org/./node_modules/zrender/lib/svg/mapStyleToAttrs.js","webpack://quantms.org/./node_modules/zrender/lib/svg/core.js","webpack://quantms.org/./node_modules/zrender/lib/svg/cssAnimation.js","webpack://quantms.org/./node_modules/zrender/lib/svg/graphic.js","webpack://quantms.org/./node_modules/zrender/lib/svg/domapi.js","webpack://quantms.org/./node_modules/zrender/lib/svg/patch.js","webpack://quantms.org/./node_modules/zrender/lib/svg/Painter.js","webpack://quantms.org/./node_modules/echarts/lib/renderer/installSVGRenderer.js","webpack://quantms.org/./node_modules/echarts/lib/data/DataDiffer.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dimensionHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/SeriesDimensionDefine.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/SeriesDataSchema.js","webpack://quantms.org/./node_modules/echarts/lib/data/SeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/createDimensions.js","webpack://quantms.org/./node_modules/echarts/lib/model/referHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataStackHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createSeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/LineSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/labelHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Symbol.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/SymbolDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/helper.js","webpack://quantms.org/./node_modules/echarts/lib/util/vendor.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/lineAnimationDiff.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/poly.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js","webpack://quantms.org/./node_modules/echarts/lib/coord/CoordinateSystem.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/LineView.js","webpack://quantms.org/./node_modules/echarts/lib/layout/points.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataSample.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/install.js","webpack://quantms.org/./node_modules/echarts/lib/layout/barGrid.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BaseBarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/util/shape/sausage.js","webpack://quantms.org/./node_modules/echarts/lib/label/sectorLabel.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/sectorHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/pieLayout.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/labelLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/PieView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js","webpack://quantms.org/./node_modules/echarts/lib/visual/LegendVisualProvider.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/PieSeries.js","webpack://quantms.org/./node_modules/echarts/lib/processor/negativeDataFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/ScatterSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LargeSymbolDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/ScatterView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/GridModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisModelCommonMixin.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisDefault.js","webpack://quantms.org/./node_modules/echarts/lib/data/OrdinalMeta.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisCommonTypes.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisModelCreator.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Scale.js","webpack://quantms.org/./node_modules/echarts/lib/scale/helper.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Ordinal.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Interval.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Time.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Log.js","webpack://quantms.org/./node_modules/echarts/lib/coord/scaleRawExtentInfo.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Cartesian.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Cartesian2D.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisTickLabelBuilder.js","webpack://quantms.org/./node_modules/echarts/lib/coord/Axis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Axis2D.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisAlignTicks.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Grid.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AxisBuilder.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/modelHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/axisSplitHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/CartesianAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/grid/installSimple.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/radarLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/backwardCompat.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/RadarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/RadarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/RadarModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/radar/RadarView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/IndicatorAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/Radar.js","webpack://quantms.org/./node_modules/echarts/lib/component/radar/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/interactionMutex.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/RoamController.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/roamHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/cursorHelper.js","webpack://quantms.org/./node_modules/zrender/lib/tool/parseSVG.js","webpack://quantms.org/./node_modules/zrender/lib/tool/parseXML.js","webpack://quantms.org/./node_modules/zrender/lib/contain/polygon.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/Region.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoSVGResource.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/parseGeoJson.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/nanhai.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/textCoord.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoJSONResource.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/geoSourceManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/MapDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/MapView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/MapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/mapDataStatistic.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/mapSymbolLayout.js","webpack://quantms.org/./node_modules/echarts/lib/coord/View.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/Geo.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/geoCreator.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoModel.js","webpack://quantms.org/./node_modules/echarts/lib/action/roamHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/geo/GeoView.js","webpack://quantms.org/./node_modules/echarts/lib/component/geo/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/layoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/TreeView.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/linkSeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/data/Tree.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/treeHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/TreeSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/traversalHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/enableAriaDecalForTree.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/TreemapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/Breadcrumb.js","webpack://quantms.org/./node_modules/echarts/lib/util/animation.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/TreemapView.js","webpack://quantms.org/./node_modules/echarts/lib/visual/VisualMapping.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/categoryFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/categoryVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/edgeVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/multipleGraphEdgeHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/simpleLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/graphHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/circularLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/circularLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/forceHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/forceLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/createView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LinePath.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Line.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LineDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/adjustEdge.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/GraphView.js","webpack://quantms.org/./node_modules/echarts/lib/data/Graph.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/GraphSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/PointerPath.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/GaugeView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/GaugeSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/FunnelView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/FunnelSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/funnelLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/ParallelView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/ParallelSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/parallelVisual.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/parallel/ParallelView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/ParallelModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/ParallelAxis.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/sliderMove.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/Parallel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/parallelCreator.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/BrushController.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/brushHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/ParallelAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/parallelAxisAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/parallel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/SankeyView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/SankeySeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/sankeyLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/sankeyVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/BoxplotSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/BoxplotView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/boxplotLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/prepareBoxplotData.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/boxplotTransform.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/CandlestickView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/CandlestickSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/candlestickVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/candlestickLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectSymbol.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/EffectScatterView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/EffectScatterSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectLine.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Polyline.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectPolyline.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LargeLineDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/linesLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/LinesView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/LinesSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/linesVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapLayer.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/PictorialBarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/PictorialBarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/installPictorialBar.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/ThemeRiverView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/ThemeRiverSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/themeRiverLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstPiece.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/CustomSeries.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/util/styleCompat.js","webpack://quantms.org/./node_modules/echarts/lib/animation/customGraphicTransition.js","webpack://quantms.org/./node_modules/echarts/lib/animation/customGraphicKeyframeAnimation.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/CustomView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/viewHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/globalListener.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/AxisPointerView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/axisTrigger.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/grid/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/PolarModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/RadiusAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/AngleAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/Polar.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/polarCreator.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AngleAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/RadiusAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/layout/barPolar.js","webpack://quantms.org/./node_modules/echarts/lib/component/polar/install.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/singleAxisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/SingleAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/SingleAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/Single.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/singleCreator.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/singleAxis/install.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/CalendarModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/calendar/CalendarView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/Calendar.js","webpack://quantms.org/./node_modules/echarts/lib/component/calendar/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/GraphicModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/GraphicView.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/DataZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/DataZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SelectZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/AxisProxy.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/dataZoomAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installCommon.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/featureManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/ToolboxModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/listComponent.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/ToolboxView.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/MagicType.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/DataView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/history.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/Restore.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/BrushTargetManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/DataZoom.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipRichContent.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipView.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/visual/visualSolution.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/selector.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/visualEncoding.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/BrushView.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/BrushModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/Brush.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/title/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/SliderTimelineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineAxis.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/SliderTimelineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/timelineAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/checkMarkerInSeries.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkerModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkPointModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/markerHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkerView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkPointView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkPoint.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkLineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkLineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkLine.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkAreaModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkAreaView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkArea.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/LegendModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/LegendView.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/legendFilter.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/legendAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/installLegendPlain.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/ScrollableLegendModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/ScrollableLegendView.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/scrollableLegendAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/installLegendScroll.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/roams.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/InsideZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SliderZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/install.js","webpack://quantms.org/./node_modules/echarts/lib/visual/visualDefault.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/VisualMapModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/ContinuousModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/VisualMapView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/ContinuousView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/visualMapAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/visualEncoding.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installCommon.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/PiecewiseModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/PiecewiseView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/install.js","webpack://quantms.org/./node_modules/echarts/lib/visual/aria.js","webpack://quantms.org/./node_modules/echarts/lib/component/aria/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/aria/install.js","webpack://quantms.org/./node_modules/echarts/lib/util/conditionalExpression.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/filterTransform.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/sortTransform.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataset/install.js","webpack://quantms.org/./node_modules/zrender/lib/tool/convertPath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/dividePath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/morphPath.js","webpack://quantms.org/./node_modules/echarts/lib/animation/morphTransitionHelper.js","webpack://quantms.org/./node_modules/echarts/lib/animation/universalTransition.js","webpack://quantms.org/./node_modules/echarts/index.js","webpack://quantms.org/./src/components/AeShow/index.vue","webpack://quantms.org/./src/components/AeShow/index.vue?7d9f","webpack://quantms.org/./node_modules/element-plus/es/components/config-provider/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/config-provider/src/hooks/use-global-config.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-prop/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/hooks/use-form-item.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/src/text.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/src/text2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/constants/event.mjs","webpack://quantms.org/./node_modules/element-plus/es/constants/size.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-id/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-size/index.mjs","webpack://quantms.org/./node_modules/lodash-es/isNil.js"],"sourcesContent":["import { NOOP } from '@vue/shared';\n\nconst useSameTarget = (handleClick) => {\n if (!handleClick) {\n return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };\n }\n let mousedownTarget = false;\n let mouseupTarget = false;\n const onClick = (e) => {\n if (mousedownTarget && mouseupTarget) {\n handleClick(e);\n }\n mousedownTarget = mouseupTarget = false;\n };\n const onMousedown = (e) => {\n mousedownTarget = e.target === e.currentTarget;\n };\n const onMouseup = (e) => {\n mouseupTarget = e.target === e.currentTarget;\n };\n return { onClick, onMousedown, onMouseup };\n};\n\nexport { useSameTarget };\n//# sourceMappingURL=index.mjs.map\n","import { isVNode, Fragment, Text, Comment, openBlock, createBlock, createCommentVNode } from 'vue';\nimport { hasOwn, camelize, isArray } from '@vue/shared';\nimport '../objects.mjs';\nimport { debugWarn } from '../error.mjs';\n\nconst SCOPE = \"utils/vue/vnode\";\nvar PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {\n PatchFlags2[PatchFlags2[\"TEXT\"] = 1] = \"TEXT\";\n PatchFlags2[PatchFlags2[\"CLASS\"] = 2] = \"CLASS\";\n PatchFlags2[PatchFlags2[\"STYLE\"] = 4] = \"STYLE\";\n PatchFlags2[PatchFlags2[\"PROPS\"] = 8] = \"PROPS\";\n PatchFlags2[PatchFlags2[\"FULL_PROPS\"] = 16] = \"FULL_PROPS\";\n PatchFlags2[PatchFlags2[\"HYDRATE_EVENTS\"] = 32] = \"HYDRATE_EVENTS\";\n PatchFlags2[PatchFlags2[\"STABLE_FRAGMENT\"] = 64] = \"STABLE_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"KEYED_FRAGMENT\"] = 128] = \"KEYED_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"UNKEYED_FRAGMENT\"] = 256] = \"UNKEYED_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"NEED_PATCH\"] = 512] = \"NEED_PATCH\";\n PatchFlags2[PatchFlags2[\"DYNAMIC_SLOTS\"] = 1024] = \"DYNAMIC_SLOTS\";\n PatchFlags2[PatchFlags2[\"HOISTED\"] = -1] = \"HOISTED\";\n PatchFlags2[PatchFlags2[\"BAIL\"] = -2] = \"BAIL\";\n return PatchFlags2;\n})(PatchFlags || {});\nfunction isFragment(node) {\n return isVNode(node) && node.type === Fragment;\n}\nfunction isText(node) {\n return isVNode(node) && node.type === Text;\n}\nfunction isComment(node) {\n return isVNode(node) && node.type === Comment;\n}\nconst TEMPLATE = \"template\";\nfunction isTemplate(node) {\n return isVNode(node) && node.type === TEMPLATE;\n}\nfunction isValidElementNode(node) {\n return isVNode(node) && !isFragment(node) && !isComment(node);\n}\nfunction getChildren(node, depth) {\n if (isComment(node))\n return;\n if (isFragment(node) || isTemplate(node)) {\n return depth > 0 ? getFirstValidNode(node.children, depth - 1) : void 0;\n }\n return node;\n}\nconst getFirstValidNode = (nodes, maxDepth = 3) => {\n if (Array.isArray(nodes)) {\n return getChildren(nodes[0], maxDepth);\n } else {\n return getChildren(nodes, maxDepth);\n }\n};\nfunction renderIf(condition, ...args) {\n return condition ? renderBlock(...args) : createCommentVNode(\"v-if\", true);\n}\nfunction renderBlock(...args) {\n return openBlock(), createBlock(...args);\n}\nconst getNormalizedProps = (node) => {\n if (!isVNode(node)) {\n debugWarn(SCOPE, \"[getNormalizedProps] must be a VNode\");\n return {};\n }\n const raw = node.props || {};\n const type = (isVNode(node.type) ? node.type.props : void 0) || {};\n const props = {};\n Object.keys(type).forEach((key) => {\n if (hasOwn(type[key], \"default\")) {\n props[key] = type[key].default;\n }\n });\n Object.keys(raw).forEach((key) => {\n props[camelize(key)] = raw[key];\n });\n return props;\n};\nconst ensureOnlyChild = (children) => {\n if (!isArray(children) || children.length > 1) {\n throw new Error(\"expect to receive a single Vue element child\");\n }\n return children[0];\n};\nconst flattedChildren = (children) => {\n const vNodes = isArray(children) ? children : [children];\n const result = [];\n vNodes.forEach((child) => {\n var _a;\n if (isArray(child)) {\n result.push(...flattedChildren(child));\n } else if (isVNode(child) && isArray(child.children)) {\n result.push(...flattedChildren(child.children));\n } else {\n result.push(child);\n if (isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) {\n result.push(...flattedChildren(child.component.subTree));\n }\n }\n });\n return result;\n};\n\nexport { PatchFlags, ensureOnlyChild, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf };\n//# sourceMappingURL=vnode.mjs.map\n","import { defineComponent, createVNode, renderSlot, h } from 'vue';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useSameTarget } from '../../../hooks/use-same-target/index.mjs';\nimport { PatchFlags } from '../../../utils/vue/vnode.mjs';\n\nconst overlayProps = buildProps({\n mask: {\n type: Boolean,\n default: true\n },\n customMaskEvent: {\n type: Boolean,\n default: false\n },\n overlayClass: {\n type: definePropType([\n String,\n Array,\n Object\n ])\n },\n zIndex: {\n type: definePropType([String, Number])\n }\n});\nconst overlayEmits = {\n click: (evt) => evt instanceof MouseEvent\n};\nconst BLOCK = \"overlay\";\nvar Overlay = defineComponent({\n name: \"ElOverlay\",\n props: overlayProps,\n emits: overlayEmits,\n setup(props, { slots, emit }) {\n const ns = useNamespace(BLOCK);\n const onMaskClick = (e) => {\n emit(\"click\", e);\n };\n const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);\n return () => {\n return props.mask ? createVNode(\"div\", {\n class: [ns.b(), props.overlayClass],\n style: {\n zIndex: props.zIndex\n },\n onClick,\n onMousedown,\n onMouseup\n }, [renderSlot(slots, \"default\")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, [\"onClick\", \"onMouseup\", \"onMousedown\"]) : h(\"div\", {\n class: props.overlayClass,\n style: {\n zIndex: props.zIndex,\n position: \"fixed\",\n top: \"0px\",\n right: \"0px\",\n bottom: \"0px\",\n left: \"0px\"\n }\n }, [renderSlot(slots, \"default\")]);\n };\n }\n});\n\nexport { Overlay as default, overlayEmits, overlayProps };\n//# sourceMappingURL=overlay.mjs.map\n","import Overlay from './src/overlay.mjs';\nexport { overlayEmits, overlayProps } from './src/overlay.mjs';\n\nconst ElOverlay = Overlay;\n\nexport { ElOverlay, ElOverlay as default };\n//# sourceMappingURL=index.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\n\nconst dialogContentProps = buildProps({\n center: Boolean,\n alignCenter: Boolean,\n closeIcon: {\n type: iconPropType\n },\n customClass: {\n type: String,\n default: \"\"\n },\n draggable: Boolean,\n fullscreen: Boolean,\n showClose: {\n type: Boolean,\n default: true\n },\n title: {\n type: String,\n default: \"\"\n },\n ariaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst dialogContentEmits = {\n close: () => true\n};\n\nexport { dialogContentEmits, dialogContentProps };\n//# sourceMappingURL=dialog-content.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { dialogContentProps } from './dialog-content.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { isBoolean } from '../../../utils/types.mjs';\n\nconst dialogProps = buildProps({\n ...dialogContentProps,\n appendToBody: Boolean,\n appendTo: {\n type: definePropType(String),\n default: \"body\"\n },\n beforeClose: {\n type: definePropType(Function)\n },\n destroyOnClose: Boolean,\n closeOnClickModal: {\n type: Boolean,\n default: true\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true\n },\n lockScroll: {\n type: Boolean,\n default: true\n },\n modal: {\n type: Boolean,\n default: true\n },\n openDelay: {\n type: Number,\n default: 0\n },\n closeDelay: {\n type: Number,\n default: 0\n },\n top: {\n type: String\n },\n modelValue: Boolean,\n modalClass: String,\n width: {\n type: [String, Number]\n },\n zIndex: {\n type: Number\n },\n trapFocus: {\n type: Boolean,\n default: false\n },\n headerAriaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst dialogEmits = {\n open: () => true,\n opened: () => true,\n close: () => true,\n closed: () => true,\n [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),\n openAutoFocus: () => true,\n closeAutoFocus: () => true\n};\n\nexport { dialogEmits, dialogProps };\n//# sourceMappingURL=dialog.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../dialog/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { dialogProps, dialogEmits } from '../../dialog/src/dialog.mjs';\n\nconst drawerProps = buildProps({\n ...dialogProps,\n direction: {\n type: String,\n default: \"rtl\",\n values: [\"ltr\", \"rtl\", \"ttb\", \"btt\"]\n },\n size: {\n type: [String, Number],\n default: \"30%\"\n },\n withHeader: {\n type: Boolean,\n default: true\n },\n modalFade: {\n type: Boolean,\n default: true\n },\n headerAriaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst drawerEmits = dialogEmits;\n\nexport { drawerEmits, drawerProps };\n//# sourceMappingURL=drawer.mjs.map\n","import { isRef, watch, onScopeDispose } from 'vue';\nimport { computed } from '@vue/reactivity';\nimport '../../utils/index.mjs';\nimport { useNamespace } from '../use-namespace/index.mjs';\nimport { throwError } from '../../utils/error.mjs';\nimport { isClient } from '@vueuse/core';\nimport { hasClass, removeClass, getStyle, addClass } from '../../utils/dom/style.mjs';\nimport { getScrollBarWidth } from '../../utils/dom/scroll.mjs';\n\nconst useLockscreen = (trigger, options = {}) => {\n if (!isRef(trigger)) {\n throwError(\"[useLockscreen]\", \"You need to pass a ref param to this function\");\n }\n const ns = options.ns || useNamespace(\"popup\");\n const hiddenCls = computed(() => ns.bm(\"parent\", \"hidden\"));\n if (!isClient || hasClass(document.body, hiddenCls.value)) {\n return;\n }\n let scrollBarWidth = 0;\n let withoutHiddenClass = false;\n let bodyWidth = \"0\";\n const cleanup = () => {\n setTimeout(() => {\n removeClass(document == null ? void 0 : document.body, hiddenCls.value);\n if (withoutHiddenClass && document) {\n document.body.style.width = bodyWidth;\n }\n }, 200);\n };\n watch(trigger, (val) => {\n if (!val) {\n cleanup();\n return;\n }\n withoutHiddenClass = !hasClass(document.body, hiddenCls.value);\n if (withoutHiddenClass) {\n bodyWidth = document.body.style.width;\n }\n scrollBarWidth = getScrollBarWidth(ns.namespace.value);\n const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;\n const bodyOverflowY = getStyle(document.body, \"overflowY\");\n if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === \"scroll\") && withoutHiddenClass) {\n document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;\n }\n addClass(document.body, hiddenCls.value);\n });\n onScopeDispose(() => cleanup());\n};\n\nexport { useLockscreen };\n//# sourceMappingURL=index.mjs.map\n","import { getCurrentInstance, ref, computed, watch, nextTick, onMounted } from 'vue';\nimport { useTimeoutFn, isClient } from '@vueuse/core';\nimport { isUndefined } from 'lodash-unified';\nimport '../../../hooks/index.mjs';\nimport '../../../constants/index.mjs';\nimport '../../../utils/index.mjs';\nimport '../../config-provider/index.mjs';\nimport { useZIndex } from '../../../hooks/use-z-index/index.mjs';\nimport { useId } from '../../../hooks/use-id/index.mjs';\nimport { useGlobalConfig } from '../../config-provider/src/hooks/use-global-config.mjs';\nimport { defaultNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { useLockscreen } from '../../../hooks/use-lockscreen/index.mjs';\n\nconst useDialog = (props, targetRef) => {\n var _a;\n const instance = getCurrentInstance();\n const emit = instance.emit;\n const { nextZIndex } = useZIndex();\n let lastPosition = \"\";\n const titleId = useId();\n const bodyId = useId();\n const visible = ref(false);\n const closed = ref(false);\n const rendered = ref(false);\n const zIndex = ref((_a = props.zIndex) != null ? _a : nextZIndex());\n let openTimer = void 0;\n let closeTimer = void 0;\n const namespace = useGlobalConfig(\"namespace\", defaultNamespace);\n const style = computed(() => {\n const style2 = {};\n const varPrefix = `--${namespace.value}-dialog`;\n if (!props.fullscreen) {\n if (props.top) {\n style2[`${varPrefix}-margin-top`] = props.top;\n }\n if (props.width) {\n style2[`${varPrefix}-width`] = addUnit(props.width);\n }\n }\n return style2;\n });\n const overlayDialogStyle = computed(() => {\n if (props.alignCenter) {\n return { display: \"flex\" };\n }\n return {};\n });\n function afterEnter() {\n emit(\"opened\");\n }\n function afterLeave() {\n emit(\"closed\");\n emit(UPDATE_MODEL_EVENT, false);\n if (props.destroyOnClose) {\n rendered.value = false;\n }\n }\n function beforeLeave() {\n emit(\"close\");\n }\n function open() {\n closeTimer == null ? void 0 : closeTimer();\n openTimer == null ? void 0 : openTimer();\n if (props.openDelay && props.openDelay > 0) {\n ;\n ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));\n } else {\n doOpen();\n }\n }\n function close() {\n openTimer == null ? void 0 : openTimer();\n closeTimer == null ? void 0 : closeTimer();\n if (props.closeDelay && props.closeDelay > 0) {\n ;\n ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));\n } else {\n doClose();\n }\n }\n function handleClose() {\n function hide(shouldCancel) {\n if (shouldCancel)\n return;\n closed.value = true;\n visible.value = false;\n }\n if (props.beforeClose) {\n props.beforeClose(hide);\n } else {\n close();\n }\n }\n function onModalClick() {\n if (props.closeOnClickModal) {\n handleClose();\n }\n }\n function doOpen() {\n if (!isClient)\n return;\n visible.value = true;\n }\n function doClose() {\n visible.value = false;\n }\n function onOpenAutoFocus() {\n emit(\"openAutoFocus\");\n }\n function onCloseAutoFocus() {\n emit(\"closeAutoFocus\");\n }\n function onFocusoutPrevented(event) {\n var _a2;\n if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === \"pointer\") {\n event.preventDefault();\n }\n }\n if (props.lockScroll) {\n useLockscreen(visible);\n }\n function onCloseRequested() {\n if (props.closeOnPressEscape) {\n handleClose();\n }\n }\n watch(() => props.modelValue, (val) => {\n if (val) {\n closed.value = false;\n open();\n rendered.value = true;\n zIndex.value = isUndefined(props.zIndex) ? nextZIndex() : zIndex.value++;\n nextTick(() => {\n emit(\"open\");\n if (targetRef.value) {\n targetRef.value.scrollTop = 0;\n }\n });\n } else {\n if (visible.value) {\n close();\n }\n }\n });\n watch(() => props.fullscreen, (val) => {\n if (!targetRef.value)\n return;\n if (val) {\n lastPosition = targetRef.value.style.transform;\n targetRef.value.style.transform = \"\";\n } else {\n targetRef.value.style.transform = lastPosition;\n }\n });\n onMounted(() => {\n if (props.modelValue) {\n visible.value = true;\n rendered.value = true;\n open();\n }\n });\n return {\n afterEnter,\n afterLeave,\n beforeLeave,\n handleClose,\n onModalClick,\n close,\n doClose,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n titleId,\n bodyId,\n closed,\n style,\n overlayDialogStyle,\n rendered,\n visible,\n zIndex\n };\n};\n\nexport { useDialog };\n//# sourceMappingURL=use-dialog.mjs.map\n","import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, mergeProps, withModifiers, normalizeClass, createElementBlock, renderSlot, toDisplayString, createCommentVNode, vShow } from 'vue';\nimport { Close } from '@element-plus/icons-vue';\nimport { ElOverlay } from '../../overlay/index.mjs';\nimport '../../focus-trap/index.mjs';\nimport '../../dialog/index.mjs';\nimport '../../../utils/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { drawerProps, drawerEmits } from './drawer.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useLocale } from '../../../hooks/use-locale/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { useDialog } from '../../dialog/src/use-dialog.mjs';\n\nconst _sfc_main = defineComponent({\n name: \"ElDrawer\",\n components: {\n ElOverlay,\n ElFocusTrap,\n ElIcon,\n Close\n },\n inheritAttrs: false,\n props: drawerProps,\n emits: drawerEmits,\n setup(props, { slots }) {\n useDeprecated({\n scope: \"el-drawer\",\n from: \"the title slot\",\n replacement: \"the header slot\",\n version: \"3.0.0\",\n ref: \"https://element-plus.org/en-US/component/drawer.html#slots\"\n }, computed(() => !!slots.title));\n useDeprecated({\n scope: \"el-drawer\",\n from: \"custom-class\",\n replacement: \"class\",\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/drawer.html#attributes\",\n type: \"Attribute\"\n }, computed(() => !!props.customClass));\n const drawerRef = ref();\n const focusStartRef = ref();\n const ns = useNamespace(\"drawer\");\n const { t } = useLocale();\n const isHorizontal = computed(() => props.direction === \"rtl\" || props.direction === \"ltr\");\n const drawerSize = computed(() => addUnit(props.size));\n return {\n ...useDialog(props, drawerRef),\n drawerRef,\n focusStartRef,\n isHorizontal,\n drawerSize,\n ns,\n t\n };\n }\n});\nconst _hoisted_1 = [\"aria-label\", \"aria-labelledby\", \"aria-describedby\"];\nconst _hoisted_2 = [\"id\", \"aria-level\"];\nconst _hoisted_3 = [\"aria-label\"];\nconst _hoisted_4 = [\"id\"];\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_close = resolveComponent(\"close\");\n const _component_el_icon = resolveComponent(\"el-icon\");\n const _component_el_focus_trap = resolveComponent(\"el-focus-trap\");\n const _component_el_overlay = resolveComponent(\"el-overlay\");\n return openBlock(), createBlock(Teleport, {\n to: \"body\",\n disabled: !_ctx.appendToBody\n }, [\n createVNode(Transition, {\n name: _ctx.ns.b(\"fade\"),\n onAfterEnter: _ctx.afterEnter,\n onAfterLeave: _ctx.afterLeave,\n onBeforeLeave: _ctx.beforeLeave,\n persisted: \"\"\n }, {\n default: withCtx(() => [\n withDirectives(createVNode(_component_el_overlay, {\n mask: _ctx.modal,\n \"overlay-class\": _ctx.modalClass,\n \"z-index\": _ctx.zIndex,\n onClick: _ctx.onModalClick\n }, {\n default: withCtx(() => [\n createVNode(_component_el_focus_trap, {\n loop: \"\",\n trapped: _ctx.visible,\n \"focus-trap-el\": _ctx.drawerRef,\n \"focus-start-el\": _ctx.focusStartRef,\n onReleaseRequested: _ctx.onCloseRequested\n }, {\n default: withCtx(() => [\n createElementVNode(\"div\", mergeProps({\n ref: \"drawerRef\",\n \"aria-modal\": \"true\",\n \"aria-label\": _ctx.title || void 0,\n \"aria-labelledby\": !_ctx.title ? _ctx.titleId : void 0,\n \"aria-describedby\": _ctx.bodyId\n }, _ctx.$attrs, {\n class: [_ctx.ns.b(), _ctx.direction, _ctx.visible && \"open\", _ctx.customClass],\n style: _ctx.isHorizontal ? \"width: \" + _ctx.drawerSize : \"height: \" + _ctx.drawerSize,\n role: \"dialog\",\n onClick: _cache[1] || (_cache[1] = withModifiers(() => {\n }, [\"stop\"]))\n }), [\n createElementVNode(\"span\", {\n ref: \"focusStartRef\",\n class: normalizeClass(_ctx.ns.e(\"sr-focus\")),\n tabindex: \"-1\"\n }, null, 2),\n _ctx.withHeader ? (openBlock(), createElementBlock(\"header\", {\n key: 0,\n class: normalizeClass(_ctx.ns.e(\"header\"))\n }, [\n !_ctx.$slots.title ? renderSlot(_ctx.$slots, \"header\", {\n key: 0,\n close: _ctx.handleClose,\n titleId: _ctx.titleId,\n titleClass: _ctx.ns.e(\"title\")\n }, () => [\n !_ctx.$slots.title ? (openBlock(), createElementBlock(\"span\", {\n key: 0,\n id: _ctx.titleId,\n role: \"heading\",\n \"aria-level\": _ctx.headerAriaLevel,\n class: normalizeClass(_ctx.ns.e(\"title\"))\n }, toDisplayString(_ctx.title), 11, _hoisted_2)) : createCommentVNode(\"v-if\", true)\n ]) : renderSlot(_ctx.$slots, \"title\", { key: 1 }, () => [\n createCommentVNode(\" DEPRECATED SLOT \")\n ]),\n _ctx.showClose ? (openBlock(), createElementBlock(\"button\", {\n key: 2,\n \"aria-label\": _ctx.t(\"el.drawer.close\"),\n class: normalizeClass(_ctx.ns.e(\"close-btn\")),\n type: \"button\",\n onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClose && _ctx.handleClose(...args))\n }, [\n createVNode(_component_el_icon, {\n class: normalizeClass(_ctx.ns.e(\"close\"))\n }, {\n default: withCtx(() => [\n createVNode(_component_close)\n ]),\n _: 1\n }, 8, [\"class\"])\n ], 10, _hoisted_3)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n _ctx.rendered ? (openBlock(), createElementBlock(\"div\", {\n key: 1,\n id: _ctx.bodyId,\n class: normalizeClass(_ctx.ns.e(\"body\"))\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 10, _hoisted_4)) : createCommentVNode(\"v-if\", true),\n _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", {\n key: 2,\n class: normalizeClass(_ctx.ns.e(\"footer\"))\n }, [\n renderSlot(_ctx.$slots, \"footer\")\n ], 2)) : createCommentVNode(\"v-if\", true)\n ], 16, _hoisted_1)\n ]),\n _: 3\n }, 8, [\"trapped\", \"focus-trap-el\", \"focus-start-el\", \"onReleaseRequested\"])\n ]),\n _: 3\n }, 8, [\"mask\", \"overlay-class\", \"z-index\", \"onClick\"]), [\n [vShow, _ctx.visible]\n ])\n ]),\n _: 3\n }, 8, [\"name\", \"onAfterEnter\", \"onAfterLeave\", \"onBeforeLeave\"])\n ], 8, [\"disabled\"]);\n}\nvar Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__file\", \"drawer.vue\"]]);\n\nexport { Drawer as default };\n//# sourceMappingURL=drawer2.mjs.map\n","import '../../utils/index.mjs';\nimport Drawer from './src/drawer2.mjs';\nexport { drawerEmits, drawerProps } from './src/drawer.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElDrawer = withInstall(Drawer);\n\nexport { ElDrawer, ElDrawer as default };\n//# sourceMappingURL=index.mjs.map\n","const tabsRootContextKey = Symbol(\"tabsRootContextKey\");\n\nexport { tabsRootContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\n\nconst tabBarProps = buildProps({\n tabs: {\n type: definePropType(Array),\n default: () => mutable([])\n }\n});\n\nexport { tabBarProps };\n//# sourceMappingURL=tab-bar.mjs.map\n","import { defineComponent, getCurrentInstance, inject, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';\nimport { useResizeObserver } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { tabBarProps } from './tab-bar.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { capitalize } from '../../../utils/strings.mjs';\n\nconst COMPONENT_NAME = \"ElTabBar\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: tabBarProps,\n setup(__props, { expose }) {\n const props = __props;\n const instance = getCurrentInstance();\n const rootTabs = inject(tabsRootContextKey);\n if (!rootTabs)\n throwError(COMPONENT_NAME, \"\");\n const ns = useNamespace(\"tabs\");\n const barRef = ref();\n const barStyle = ref();\n const getBarStyle = () => {\n let offset = 0;\n let tabSize = 0;\n const sizeName = [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition) ? \"width\" : \"height\";\n const sizeDir = sizeName === \"width\" ? \"x\" : \"y\";\n const position = sizeDir === \"x\" ? \"left\" : \"top\";\n props.tabs.every((tab) => {\n var _a, _b;\n const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];\n if (!$el)\n return false;\n if (!tab.active) {\n return true;\n }\n offset = $el[`offset${capitalize(position)}`];\n tabSize = $el[`client${capitalize(sizeName)}`];\n const tabStyles = window.getComputedStyle($el);\n if (sizeName === \"width\") {\n if (props.tabs.length > 1) {\n tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);\n }\n offset += Number.parseFloat(tabStyles.paddingLeft);\n }\n return false;\n });\n return {\n [sizeName]: `${tabSize}px`,\n transform: `translate${capitalize(sizeDir)}(${offset}px)`\n };\n };\n const update = () => barStyle.value = getBarStyle();\n watch(() => props.tabs, async () => {\n await nextTick();\n update();\n }, { immediate: true });\n useResizeObserver(barRef, () => update());\n expose({\n ref: barRef,\n update\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n ref_key: \"barRef\",\n ref: barRef,\n class: normalizeClass([unref(ns).e(\"active-bar\"), unref(ns).is(unref(rootTabs).props.tabPosition)]),\n style: normalizeStyle(barStyle.value)\n }, null, 6);\n };\n }\n});\nvar TabBar = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"tab-bar.vue\"]]);\n\nexport { TabBar as default };\n//# sourceMappingURL=tab-bar2.mjs.map\n","import { defineComponent, getCurrentInstance, inject, ref, computed, nextTick, watch, onMounted, onUpdated, createVNode } from 'vue';\nimport { useDocumentVisibility, useWindowFocus, useResizeObserver } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue';\nimport '../../../hooks/index.mjs';\nimport TabBar from './tab-bar2.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { capitalize } from '../../../utils/strings.mjs';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\n\nconst tabNavProps = buildProps({\n panes: {\n type: definePropType(Array),\n default: () => mutable([])\n },\n currentName: {\n type: [String, Number],\n default: \"\"\n },\n editable: Boolean,\n type: {\n type: String,\n values: [\"card\", \"border-card\", \"\"],\n default: \"\"\n },\n stretch: Boolean\n});\nconst tabNavEmits = {\n tabClick: (tab, tabName, ev) => ev instanceof Event,\n tabRemove: (tab, ev) => ev instanceof Event\n};\nconst COMPONENT_NAME = \"ElTabNav\";\nconst TabNav = defineComponent({\n name: COMPONENT_NAME,\n props: tabNavProps,\n emits: tabNavEmits,\n setup(props, {\n expose,\n emit\n }) {\n const vm = getCurrentInstance();\n const rootTabs = inject(tabsRootContextKey);\n if (!rootTabs)\n throwError(COMPONENT_NAME, ``);\n const ns = useNamespace(\"tabs\");\n const visibility = useDocumentVisibility();\n const focused = useWindowFocus();\n const navScroll$ = ref();\n const nav$ = ref();\n const el$ = ref();\n const tabBarRef = ref();\n const scrollable = ref(false);\n const navOffset = ref(0);\n const isFocus = ref(false);\n const focusable = ref(true);\n const sizeName = computed(() => [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition) ? \"width\" : \"height\");\n const navStyle = computed(() => {\n const dir = sizeName.value === \"width\" ? \"X\" : \"Y\";\n return {\n transform: `translate${dir}(-${navOffset.value}px)`\n };\n });\n const scrollPrev = () => {\n if (!navScroll$.value)\n return;\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (!currentOffset)\n return;\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;\n navOffset.value = newOffset;\n };\n const scrollNext = () => {\n if (!navScroll$.value || !nav$.value)\n return;\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (navSize - currentOffset <= containerSize)\n return;\n const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;\n navOffset.value = newOffset;\n };\n const scrollToActiveTab = async () => {\n const nav = nav$.value;\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav)\n return;\n await nextTick();\n const activeTab = el$.value.querySelector(\".is-active\");\n if (!activeTab)\n return;\n const navScroll = navScroll$.value;\n const isHorizontal = [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition);\n const activeTabBounding = activeTab.getBoundingClientRect();\n const navScrollBounding = navScroll.getBoundingClientRect();\n const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;\n const currentOffset = navOffset.value;\n let newOffset = currentOffset;\n if (isHorizontal) {\n if (activeTabBounding.left < navScrollBounding.left) {\n newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);\n }\n if (activeTabBounding.right > navScrollBounding.right) {\n newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;\n }\n } else {\n if (activeTabBounding.top < navScrollBounding.top) {\n newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);\n }\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\n newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);\n }\n }\n newOffset = Math.max(newOffset, 0);\n navOffset.value = Math.min(newOffset, maxOffset);\n };\n const update = () => {\n var _a;\n if (!nav$.value || !navScroll$.value)\n return;\n props.stretch && ((_a = tabBarRef.value) == null ? void 0 : _a.update());\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (containerSize < navSize) {\n scrollable.value = scrollable.value || {};\n scrollable.value.prev = currentOffset;\n scrollable.value.next = currentOffset + containerSize < navSize;\n if (navSize - currentOffset < containerSize) {\n navOffset.value = navSize - containerSize;\n }\n } else {\n scrollable.value = false;\n if (currentOffset > 0) {\n navOffset.value = 0;\n }\n }\n };\n const changeTab = (e) => {\n const code = e.code;\n const {\n up,\n down,\n left,\n right\n } = EVENT_CODE;\n if (![up, down, left, right].includes(code))\n return;\n const tabList = Array.from(e.currentTarget.querySelectorAll(\"[role=tab]:not(.is-disabled)\"));\n const currentIndex = tabList.indexOf(e.target);\n let nextIndex;\n if (code === left || code === up) {\n if (currentIndex === 0) {\n nextIndex = tabList.length - 1;\n } else {\n nextIndex = currentIndex - 1;\n }\n } else {\n if (currentIndex < tabList.length - 1) {\n nextIndex = currentIndex + 1;\n } else {\n nextIndex = 0;\n }\n }\n tabList[nextIndex].focus({\n preventScroll: true\n });\n tabList[nextIndex].click();\n setFocus();\n };\n const setFocus = () => {\n if (focusable.value)\n isFocus.value = true;\n };\n const removeFocus = () => isFocus.value = false;\n watch(visibility, (visibility2) => {\n if (visibility2 === \"hidden\") {\n focusable.value = false;\n } else if (visibility2 === \"visible\") {\n setTimeout(() => focusable.value = true, 50);\n }\n });\n watch(focused, (focused2) => {\n if (focused2) {\n setTimeout(() => focusable.value = true, 50);\n } else {\n focusable.value = false;\n }\n });\n useResizeObserver(el$, update);\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0));\n onUpdated(() => update());\n expose({\n scrollToActiveTab,\n removeFocus\n });\n watch(() => props.panes, () => vm.update(), {\n flush: \"post\",\n deep: true\n });\n return () => {\n const scrollBtn = scrollable.value ? [createVNode(\"span\", {\n \"class\": [ns.e(\"nav-prev\"), ns.is(\"disabled\", !scrollable.value.prev)],\n \"onClick\": scrollPrev\n }, [createVNode(ElIcon, null, {\n default: () => [createVNode(ArrowLeft, null, null)]\n })]), createVNode(\"span\", {\n \"class\": [ns.e(\"nav-next\"), ns.is(\"disabled\", !scrollable.value.next)],\n \"onClick\": scrollNext\n }, [createVNode(ElIcon, null, {\n default: () => [createVNode(ArrowRight, null, null)]\n })])] : null;\n const tabs = props.panes.map((pane, index) => {\n var _a, _b, _c, _d;\n const uid = pane.uid;\n const disabled = pane.props.disabled;\n const tabName = (_b = (_a = pane.props.name) != null ? _a : pane.index) != null ? _b : `${index}`;\n const closable = !disabled && (pane.isClosable || props.editable);\n pane.index = `${index}`;\n const btnClose = closable ? createVNode(ElIcon, {\n \"class\": \"is-icon-close\",\n \"onClick\": (ev) => emit(\"tabRemove\", pane, ev)\n }, {\n default: () => [createVNode(Close, null, null)]\n }) : null;\n const tabLabelContent = ((_d = (_c = pane.slots).label) == null ? void 0 : _d.call(_c)) || pane.props.label;\n const tabindex = !disabled && pane.active ? 0 : -1;\n return createVNode(\"div\", {\n \"ref\": `tab-${uid}`,\n \"class\": [ns.e(\"item\"), ns.is(rootTabs.props.tabPosition), ns.is(\"active\", pane.active), ns.is(\"disabled\", disabled), ns.is(\"closable\", closable), ns.is(\"focus\", isFocus.value)],\n \"id\": `tab-${tabName}`,\n \"key\": `tab-${uid}`,\n \"aria-controls\": `pane-${tabName}`,\n \"role\": \"tab\",\n \"aria-selected\": pane.active,\n \"tabindex\": tabindex,\n \"onFocus\": () => setFocus(),\n \"onBlur\": () => removeFocus(),\n \"onClick\": (ev) => {\n removeFocus();\n emit(\"tabClick\", pane, tabName, ev);\n },\n \"onKeydown\": (ev) => {\n if (closable && (ev.code === EVENT_CODE.delete || ev.code === EVENT_CODE.backspace)) {\n emit(\"tabRemove\", pane, ev);\n }\n }\n }, [...[tabLabelContent, btnClose]]);\n });\n return createVNode(\"div\", {\n \"ref\": el$,\n \"class\": [ns.e(\"nav-wrap\"), ns.is(\"scrollable\", !!scrollable.value), ns.is(rootTabs.props.tabPosition)]\n }, [scrollBtn, createVNode(\"div\", {\n \"class\": ns.e(\"nav-scroll\"),\n \"ref\": navScroll$\n }, [createVNode(\"div\", {\n \"class\": [ns.e(\"nav\"), ns.is(rootTabs.props.tabPosition), ns.is(\"stretch\", props.stretch && [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition))],\n \"ref\": nav$,\n \"style\": navStyle.value,\n \"role\": \"tablist\",\n \"onKeydown\": changeTab\n }, [...[!props.type ? createVNode(TabBar, {\n \"ref\": tabBarRef,\n \"tabs\": [...props.panes]\n }, null) : null, tabs]])])]);\n };\n }\n});\n\nexport { TabNav as default, tabNavEmits, tabNavProps };\n//# sourceMappingURL=tab-nav.mjs.map\n","import { isVNode, shallowRef } from 'vue';\nimport '../../utils/index.mjs';\nimport { flattedChildren } from '../../utils/vue/vnode.mjs';\n\nconst getOrderedChildren = (vm, childComponentName, children) => {\n const nodes = flattedChildren(vm.subTree).filter((n) => {\n var _a;\n return isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component;\n });\n const uids = nodes.map((n) => n.component.uid);\n return uids.map((uid) => children[uid]).filter((p) => !!p);\n};\nconst useOrderedChildren = (vm, childComponentName) => {\n const children = {};\n const orderedChildren = shallowRef([]);\n const addChild = (child) => {\n children[child.uid] = child;\n orderedChildren.value = getOrderedChildren(vm, childComponentName, children);\n };\n const removeChild = (uid) => {\n delete children[uid];\n orderedChildren.value = orderedChildren.value.filter((children2) => children2.uid !== uid);\n };\n return {\n children: orderedChildren,\n addChild,\n removeChild\n };\n};\n\nexport { useOrderedChildren };\n//# sourceMappingURL=index.mjs.map\n","import { defineComponent, getCurrentInstance, ref, computed, watch, nextTick, provide, createVNode, renderSlot } from 'vue';\nimport '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport { Plus } from '@element-plus/icons-vue';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport TabNav from './tab-nav.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { isString } from '@vue/shared';\nimport { isNumber, isUndefined } from '../../../utils/types.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useOrderedChildren } from '../../../hooks/use-ordered-children/index.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\n\nconst tabsProps = buildProps({\n type: {\n type: String,\n values: [\"card\", \"border-card\", \"\"],\n default: \"\"\n },\n activeName: {\n type: [String, Number]\n },\n closable: Boolean,\n addable: Boolean,\n modelValue: {\n type: [String, Number]\n },\n editable: Boolean,\n tabPosition: {\n type: String,\n values: [\"top\", \"right\", \"bottom\", \"left\"],\n default: \"top\"\n },\n beforeLeave: {\n type: definePropType(Function),\n default: () => true\n },\n stretch: Boolean\n});\nconst isPaneName = (value) => isString(value) || isNumber(value);\nconst tabsEmits = {\n [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),\n tabClick: (pane, ev) => ev instanceof Event,\n tabChange: (name) => isPaneName(name),\n edit: (paneName, action) => [\"remove\", \"add\"].includes(action),\n tabRemove: (name) => isPaneName(name),\n tabAdd: () => true\n};\nconst Tabs = defineComponent({\n name: \"ElTabs\",\n props: tabsProps,\n emits: tabsEmits,\n setup(props, {\n emit,\n slots,\n expose\n }) {\n var _a, _b;\n const ns = useNamespace(\"tabs\");\n const {\n children: panes,\n addChild: registerPane,\n removeChild: unregisterPane\n } = useOrderedChildren(getCurrentInstance(), \"ElTabPane\");\n const nav$ = ref();\n const currentName = ref((_b = (_a = props.modelValue) != null ? _a : props.activeName) != null ? _b : \"0\");\n const setCurrentName = async (value, trigger = false) => {\n var _a2, _b2, _c;\n if (currentName.value === value || isUndefined(value))\n return;\n try {\n const canLeave = await ((_a2 = props.beforeLeave) == null ? void 0 : _a2.call(props, value, currentName.value));\n if (canLeave !== false) {\n currentName.value = value;\n if (trigger) {\n emit(UPDATE_MODEL_EVENT, value);\n emit(\"tabChange\", value);\n }\n (_c = (_b2 = nav$.value) == null ? void 0 : _b2.removeFocus) == null ? void 0 : _c.call(_b2);\n }\n } catch (e) {\n }\n };\n const handleTabClick = (tab, tabName, event) => {\n if (tab.props.disabled)\n return;\n setCurrentName(tabName, true);\n emit(\"tabClick\", tab, event);\n };\n const handleTabRemove = (pane, ev) => {\n if (pane.props.disabled || isUndefined(pane.props.name))\n return;\n ev.stopPropagation();\n emit(\"edit\", pane.props.name, \"remove\");\n emit(\"tabRemove\", pane.props.name);\n };\n const handleTabAdd = () => {\n emit(\"edit\", void 0, \"add\");\n emit(\"tabAdd\");\n };\n useDeprecated({\n from: '\"activeName\"',\n replacement: '\"model-value\" or \"v-model\"',\n scope: \"ElTabs\",\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/tabs.html#attributes\",\n type: \"Attribute\"\n }, computed(() => !!props.activeName));\n watch(() => props.activeName, (modelValue) => setCurrentName(modelValue));\n watch(() => props.modelValue, (modelValue) => setCurrentName(modelValue));\n watch(currentName, async () => {\n var _a2;\n await nextTick();\n (_a2 = nav$.value) == null ? void 0 : _a2.scrollToActiveTab();\n });\n provide(tabsRootContextKey, {\n props,\n currentName,\n registerPane,\n unregisterPane\n });\n expose({\n currentName\n });\n return () => {\n const addSlot = slots.addIcon;\n const newButton = props.editable || props.addable ? createVNode(\"span\", {\n \"class\": ns.e(\"new-tab\"),\n \"tabindex\": \"0\",\n \"onClick\": handleTabAdd,\n \"onKeydown\": (ev) => {\n if (ev.code === EVENT_CODE.enter)\n handleTabAdd();\n }\n }, [addSlot ? renderSlot(slots, \"addIcon\") : createVNode(ElIcon, {\n \"class\": ns.is(\"icon-plus\")\n }, {\n default: () => [createVNode(Plus, null, null)]\n })]) : null;\n const header = createVNode(\"div\", {\n \"class\": [ns.e(\"header\"), ns.is(props.tabPosition)]\n }, [newButton, createVNode(TabNav, {\n \"ref\": nav$,\n \"currentName\": currentName.value,\n \"editable\": props.editable,\n \"type\": props.type,\n \"panes\": panes.value,\n \"stretch\": props.stretch,\n \"onTabClick\": handleTabClick,\n \"onTabRemove\": handleTabRemove\n }, null)]);\n const panels = createVNode(\"div\", {\n \"class\": ns.e(\"content\")\n }, [renderSlot(slots, \"default\")]);\n return createVNode(\"div\", {\n \"class\": [ns.b(), ns.m(props.tabPosition), {\n [ns.m(\"card\")]: props.type === \"card\",\n [ns.m(\"border-card\")]: props.type === \"border-card\"\n }]\n }, [...props.tabPosition !== \"bottom\" ? [header, panels] : [panels, header]]);\n };\n }\n});\n\nexport { Tabs as default, tabsEmits, tabsProps };\n//# sourceMappingURL=tabs.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\n\nconst tabPaneProps = buildProps({\n label: {\n type: String,\n default: \"\"\n },\n name: {\n type: [String, Number]\n },\n closable: Boolean,\n disabled: Boolean,\n lazy: Boolean\n});\n\nexport { tabPaneProps };\n//# sourceMappingURL=tab-pane.mjs.map\n","import { defineComponent, getCurrentInstance, useSlots, inject, ref, computed, watch, reactive, onMounted, onUnmounted, unref, withDirectives, openBlock, createElementBlock, normalizeClass, renderSlot, vShow, createCommentVNode } from 'vue';\nimport { eagerComputed } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { tabPaneProps } from './tab-pane.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\n\nconst _hoisted_1 = [\"id\", \"aria-hidden\", \"aria-labelledby\"];\nconst COMPONENT_NAME = \"ElTabPane\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: tabPaneProps,\n setup(__props) {\n const props = __props;\n const instance = getCurrentInstance();\n const slots = useSlots();\n const tabsRoot = inject(tabsRootContextKey);\n if (!tabsRoot)\n throwError(COMPONENT_NAME, \"usage: \");\n const ns = useNamespace(\"tab-pane\");\n const index = ref();\n const isClosable = computed(() => props.closable || tabsRoot.props.closable);\n const active = eagerComputed(() => {\n var _a;\n return tabsRoot.currentName.value === ((_a = props.name) != null ? _a : index.value);\n });\n const loaded = ref(active.value);\n const paneName = computed(() => {\n var _a;\n return (_a = props.name) != null ? _a : index.value;\n });\n const shouldBeRender = eagerComputed(() => !props.lazy || loaded.value || active.value);\n watch(active, (val) => {\n if (val)\n loaded.value = true;\n });\n const pane = reactive({\n uid: instance.uid,\n slots,\n props,\n paneName,\n active,\n index,\n isClosable\n });\n onMounted(() => {\n tabsRoot.registerPane(pane);\n });\n onUnmounted(() => {\n tabsRoot.unregisterPane(pane.uid);\n });\n return (_ctx, _cache) => {\n return unref(shouldBeRender) ? withDirectives((openBlock(), createElementBlock(\"div\", {\n key: 0,\n id: `pane-${unref(paneName)}`,\n class: normalizeClass(unref(ns).b()),\n role: \"tabpanel\",\n \"aria-hidden\": !unref(active),\n \"aria-labelledby\": `tab-${unref(paneName)}`\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 10, _hoisted_1)), [\n [vShow, unref(active)]\n ]) : createCommentVNode(\"v-if\", true);\n };\n }\n});\nvar TabPane = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"tab-pane.vue\"]]);\n\nexport { TabPane as default };\n//# sourceMappingURL=tab-pane2.mjs.map\n","import '../../utils/index.mjs';\nimport Tabs from './src/tabs.mjs';\nexport { tabsEmits, tabsProps } from './src/tabs.mjs';\nimport TabPane from './src/tab-pane2.mjs';\nexport { tabBarProps } from './src/tab-bar.mjs';\nexport { tabNavEmits, tabNavProps } from './src/tab-nav.mjs';\nexport { tabPaneProps } from './src/tab-pane.mjs';\nexport { tabsRootContextKey } from './src/constants.mjs';\nimport { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';\n\nconst ElTabs = withInstall(Tabs, {\n TabPane\n});\nconst ElTabPane = withNoopInstall(TabPane);\n\nexport { ElTabPane, ElTabs, ElTabs as default };\n//# sourceMappingURL=index.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { isValidComponentSize } from '../../../utils/vue/validator.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';\nimport { isBoolean, isNumber } from '../../../utils/types.mjs';\nimport { isString } from '@vue/shared';\n\nconst switchProps = buildProps({\n modelValue: {\n type: [Boolean, String, Number],\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n loading: {\n type: Boolean,\n default: false\n },\n size: {\n type: String,\n validator: isValidComponentSize\n },\n width: {\n type: [String, Number],\n default: \"\"\n },\n inlinePrompt: {\n type: Boolean,\n default: false\n },\n inactiveActionIcon: {\n type: iconPropType\n },\n activeActionIcon: {\n type: iconPropType\n },\n activeIcon: {\n type: iconPropType\n },\n inactiveIcon: {\n type: iconPropType\n },\n activeText: {\n type: String,\n default: \"\"\n },\n inactiveText: {\n type: String,\n default: \"\"\n },\n activeValue: {\n type: [Boolean, String, Number],\n default: true\n },\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false\n },\n activeColor: {\n type: String,\n default: \"\"\n },\n inactiveColor: {\n type: String,\n default: \"\"\n },\n borderColor: {\n type: String,\n default: \"\"\n },\n name: {\n type: String,\n default: \"\"\n },\n validateEvent: {\n type: Boolean,\n default: true\n },\n beforeChange: {\n type: definePropType(Function)\n },\n id: String,\n tabindex: {\n type: [String, Number]\n },\n value: {\n type: [Boolean, String, Number],\n default: false\n },\n label: {\n type: String,\n default: void 0\n }\n});\nconst switchEmits = {\n [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)\n};\n\nexport { switchEmits, switchProps };\n//# sourceMappingURL=switch.mjs.map\n","import { defineComponent, getCurrentInstance, computed, ref, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, createVNode, renderSlot } from 'vue';\nimport { isPromise } from '@vue/shared';\nimport '../../../utils/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport '../../form/index.mjs';\nimport { Loading } from '@element-plus/icons-vue';\nimport '../../../constants/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { switchProps, switchEmits } from './switch.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';\nimport { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';\nimport { debugWarn, throwError } from '../../../utils/error.mjs';\nimport { isBoolean } from '../../../utils/types.mjs';\n\nconst _hoisted_1 = [\"onClick\"];\nconst _hoisted_2 = [\"id\", \"aria-checked\", \"aria-disabled\", \"aria-label\", \"name\", \"true-value\", \"false-value\", \"disabled\", \"tabindex\", \"onKeydown\"];\nconst _hoisted_3 = [\"aria-hidden\"];\nconst _hoisted_4 = [\"aria-hidden\"];\nconst _hoisted_5 = [\"aria-hidden\"];\nconst COMPONENT_NAME = \"ElSwitch\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: switchProps,\n emits: switchEmits,\n setup(__props, { expose, emit }) {\n const props = __props;\n const vm = getCurrentInstance();\n const { formItem } = useFormItem();\n const switchSize = useFormSize();\n const ns = useNamespace(\"switch\");\n const useBatchDeprecated = (list) => {\n list.forEach((param) => {\n useDeprecated({\n from: param[0],\n replacement: param[1],\n scope: COMPONENT_NAME,\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/switch.html#attributes\",\n type: \"Attribute\"\n }, computed(() => {\n var _a;\n return !!((_a = vm.vnode.props) == null ? void 0 : _a[param[2]]);\n }));\n });\n };\n useBatchDeprecated([\n ['\"value\"', '\"model-value\" or \"v-model\"', \"value\"],\n ['\"active-color\"', \"CSS var `--el-switch-on-color`\", \"activeColor\"],\n ['\"inactive-color\"', \"CSS var `--el-switch-off-color`\", \"inactiveColor\"],\n ['\"border-color\"', \"CSS var `--el-switch-border-color`\", \"borderColor\"]\n ]);\n const { inputId } = useFormItemInputId(props, {\n formItemContext: formItem\n });\n const switchDisabled = useFormDisabled(computed(() => props.loading));\n const isControlled = ref(props.modelValue !== false);\n const input = ref();\n const core = ref();\n const switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is(\"disabled\", switchDisabled.value),\n ns.is(\"checked\", checked.value)\n ]);\n const labelLeftKls = computed(() => [\n ns.e(\"label\"),\n ns.em(\"label\", \"left\"),\n ns.is(\"active\", !checked.value)\n ]);\n const labelRightKls = computed(() => [\n ns.e(\"label\"),\n ns.em(\"label\", \"right\"),\n ns.is(\"active\", checked.value)\n ]);\n const coreStyle = computed(() => ({\n width: addUnit(props.width)\n }));\n watch(() => props.modelValue, () => {\n isControlled.value = true;\n });\n watch(() => props.value, () => {\n isControlled.value = false;\n });\n const actualValue = computed(() => {\n return isControlled.value ? props.modelValue : props.value;\n });\n const checked = computed(() => actualValue.value === props.activeValue);\n if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue);\n emit(CHANGE_EVENT, props.inactiveValue);\n emit(INPUT_EVENT, props.inactiveValue);\n }\n watch(checked, (val) => {\n var _a;\n input.value.checked = val;\n if (props.validateEvent) {\n (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, \"change\").catch((err) => debugWarn(err));\n }\n });\n const handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue;\n emit(UPDATE_MODEL_EVENT, val);\n emit(CHANGE_EVENT, val);\n emit(INPUT_EVENT, val);\n nextTick(() => {\n input.value.checked = checked.value;\n });\n };\n const switchValue = () => {\n if (switchDisabled.value)\n return;\n const { beforeChange } = props;\n if (!beforeChange) {\n handleChange();\n return;\n }\n const shouldChange = beforeChange();\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange)\n ].includes(true);\n if (!isPromiseOrBool) {\n throwError(COMPONENT_NAME, \"beforeChange must return type `Promise` or `boolean`\");\n }\n if (isPromise(shouldChange)) {\n shouldChange.then((result) => {\n if (result) {\n handleChange();\n }\n }).catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);\n });\n } else if (shouldChange) {\n handleChange();\n }\n };\n const styles = computed(() => {\n return ns.cssVarBlock({\n ...props.activeColor ? { \"on-color\": props.activeColor } : null,\n ...props.inactiveColor ? { \"off-color\": props.inactiveColor } : null,\n ...props.borderColor ? { \"border-color\": props.borderColor } : null\n });\n });\n const focus = () => {\n var _a, _b;\n (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);\n };\n onMounted(() => {\n input.value.checked = checked.value;\n });\n expose({\n focus,\n checked\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass(unref(switchKls)),\n style: normalizeStyle(unref(styles)),\n onClick: withModifiers(switchValue, [\"prevent\"])\n }, [\n createElementVNode(\"input\", {\n id: unref(inputId),\n ref_key: \"input\",\n ref: input,\n class: normalizeClass(unref(ns).e(\"input\")),\n type: \"checkbox\",\n role: \"switch\",\n \"aria-checked\": unref(checked),\n \"aria-disabled\": unref(switchDisabled),\n \"aria-label\": _ctx.label,\n name: _ctx.name,\n \"true-value\": _ctx.activeValue,\n \"false-value\": _ctx.inactiveValue,\n disabled: unref(switchDisabled),\n tabindex: _ctx.tabindex,\n onChange: handleChange,\n onKeydown: withKeys(switchValue, [\"enter\"])\n }, null, 42, _hoisted_2),\n !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock(\"span\", {\n key: 0,\n class: normalizeClass(unref(labelLeftKls))\n }, [\n _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true),\n !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n \"aria-hidden\": unref(checked)\n }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n createElementVNode(\"span\", {\n ref_key: \"core\",\n ref: core,\n class: normalizeClass(unref(ns).e(\"core\")),\n style: normalizeStyle(unref(coreStyle))\n }, [\n _ctx.inlinePrompt ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(unref(ns).e(\"inner\"))\n }, [\n _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {\n key: 0,\n class: normalizeClass(unref(ns).is(\"icon\"))\n }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))\n ]),\n _: 1\n }, 8, [\"class\"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass(unref(ns).is(\"text\")),\n \"aria-hidden\": !unref(checked)\n }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n createElementVNode(\"div\", {\n class: normalizeClass(unref(ns).e(\"action\"))\n }, [\n _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {\n key: 0,\n class: normalizeClass(unref(ns).is(\"loading\"))\n }, {\n default: withCtx(() => [\n createVNode(unref(Loading))\n ]),\n _: 1\n }, 8, [\"class\"])) : unref(checked) ? renderSlot(_ctx.$slots, \"active-action\", { key: 1 }, () => [\n _ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true)\n ]) : !unref(checked) ? renderSlot(_ctx.$slots, \"inactive-action\", { key: 2 }, () => [\n _ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true)\n ]) : createCommentVNode(\"v-if\", true)\n ], 2)\n ], 6),\n !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass(unref(labelRightKls))\n }, [\n _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true),\n !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n \"aria-hidden\": !unref(checked)\n }, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true)\n ], 14, _hoisted_1);\n };\n }\n});\nvar Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"switch.vue\"]]);\n\nexport { Switch as default };\n//# sourceMappingURL=switch2.mjs.map\n","import '../../utils/index.mjs';\nimport Switch from './src/switch2.mjs';\nexport { switchEmits, switchProps } from './src/switch.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElSwitch = withInstall(Switch);\n\nexport { ElSwitch, ElSwitch as default };\n//# sourceMappingURL=index.mjs.map\n","import request from './request'\nexport const queryKey = (proteinName) => {\n const param = new URLSearchParams()\n param.append('protein_name', proteinName)\n return request({\n method: 'post',\n url: 'query',\n data: param\n })\n}\n\nexport const getProteins = () => {\n return request({\n method: 'get',\n url: '/data/proteinTable.json.gz',\n responseType: 'arraybuffer'\n })\n}\n\nexport const getCellLineProteins = () => {\n return request({\n method: 'get',\n url: '/data/Cell_lines_IBAQ.json.gz',\n responseType: 'arraybuffer'\n })\n}\n","\n/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED$1 = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN$1 = 2;\n\n/*============================================================================*/\n\n\nfunction zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH$1 = 3;\nconst MAX_MATCH$1 = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES$1 = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS$1 = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES$1 = 30;\n/* number of distance codes */\n\nconst BL_CODES$1 = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE$1 = 2 * L_CODES$1 + 1;\n/* maximum heap size */\n\nconst MAX_BITS$1 = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES$1 + 2) * 2);\nzero$1(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES$1 * 2);\nzero$1(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero$1(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1);\nzero$1(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES$1);\nzero$1(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES$1);\nzero$1(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS$1; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS$1 + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES$1 - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES$1; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES$1 + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES$1; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE$1;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS$1; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init$1 = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align$1 = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN$1) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block$1(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally$1 = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nvar _tr_init_1 = _tr_init$1;\nvar _tr_stored_block_1 = _tr_stored_block$1;\nvar _tr_flush_block_1 = _tr_flush_block$1;\nvar _tr_tally_1 = _tr_tally$1;\nvar _tr_align_1 = _tr_align$1;\n\nvar trees = {\n\t_tr_init: _tr_init_1,\n\t_tr_stored_block: _tr_stored_block_1,\n\t_tr_flush_block: _tr_flush_block_1,\n\t_tr_tally: _tr_tally_1,\n\t_tr_align: _tr_align_1\n};\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nvar adler32_1 = adler32;\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nvar crc32_1 = crc32;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar messages = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar constants$2 = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees;\n\n\n\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1,\n Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1,\n Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1,\n Z_UNKNOWN,\n Z_DEFLATED: Z_DEFLATED$2\n} = constants$2;\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS$1 = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = messages[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH$3) ||\n flush === Z_NO_FLUSH$2 ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH$3 && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH$2 && flush !== Z_FINISH$3 &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH$3) && flush !== Z_NO_FLUSH$2 &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH$3 && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED$2; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK$3;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK$3) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR$2;\n }\n strm.state.gzhead = head;\n return Z_OK$3;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR$2;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION$1) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1);\n};\n\n\n/* ========================================================================= */\nconst deflate$2 = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK$1 || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH$3)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK$3;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH$3) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK$3;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH$1) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK$3;\n }\n }\n }\n\n if (flush !== Z_FINISH$3) { return Z_OK$3; }\n if (s.wrap <= 0) { return Z_STREAM_END$3; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR$2;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32_1(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK$3;\n};\n\n\nvar deflateInit_1 = deflateInit;\nvar deflateInit2_1 = deflateInit2;\nvar deflateReset_1 = deflateReset;\nvar deflateResetKeep_1 = deflateResetKeep;\nvar deflateSetHeader_1 = deflateSetHeader;\nvar deflate_2$1 = deflate$2;\nvar deflateEnd_1 = deflateEnd;\nvar deflateSetDictionary_1 = deflateSetDictionary;\nvar deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n\nvar deflate_1$2 = {\n\tdeflateInit: deflateInit_1,\n\tdeflateInit2: deflateInit2_1,\n\tdeflateReset: deflateReset_1,\n\tdeflateResetKeep: deflateResetKeep_1,\n\tdeflateSetHeader: deflateSetHeader_1,\n\tdeflate: deflate_2$1,\n\tdeflateEnd: deflateEnd_1,\n\tdeflateSetDictionary: deflateSetDictionary_1,\n\tdeflateInfo: deflateInfo\n};\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nvar assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nvar flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n\nvar common = {\n\tassign: assign,\n\tflattenChunks: flattenChunks\n};\n\n// String encode/decode helpers\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nvar string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nvar buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nvar utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\nvar strings = {\n\tstring2buf: string2buf,\n\tbuf2string: buf2string,\n\tutf8border: utf8border\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nvar zstream = ZStream;\n\nconst toString$1 = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2,\n Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2,\n Z_DEFAULT_COMPRESSION,\n Z_DEFAULT_STRATEGY,\n Z_DEFLATED: Z_DEFLATED$1\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate$1(options) {\n this.options = common.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED$1,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = deflate_1$2.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n if (opt.header) {\n deflate_1$2.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = deflate_1$2.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString$1.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = deflate_1$2.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END$2) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = deflate_1$2.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK$2;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK$2) {\n this.result = common.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate$1(input, options) {\n const deflator = new Deflate$1(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip$1(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}\n\n\nvar Deflate_1$1 = Deflate$1;\nvar deflate_2 = deflate$1;\nvar deflateRaw_1$1 = deflateRaw$1;\nvar gzip_1$1 = gzip$1;\nvar constants$1 = constants$2;\n\nvar deflate_1$1 = {\n\tDeflate: Deflate_1$1,\n\tdeflate: deflate_2,\n\tdeflateRaw: deflateRaw_1$1,\n\tgzip: gzip_1$1,\n\tconstants: constants$1\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD$1 = 16209; /* got a data error -- remain here until reset */\nconst TYPE$1 = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nvar inffast = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE$1;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS$1 = 852;\nconst ENOUGH_DISTS$1 = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES$1 = 0;\nconst LENS$1 = 1;\nconst DISTS$1 = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES$1 || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES$1) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS$1) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nvar inftrees = inflate_table;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n\n\n\n\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES,\n Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR,\n Z_DEFLATED\n} = constants$2;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK$1;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR$1;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR$1; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK$1) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate$2 = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR$1;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK$1;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32_1(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT$1;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inffast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END$1;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR$1;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR$1;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR$1;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH$1))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR$1;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK$1;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK$1;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR$1;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32_1(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR$1;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR$1;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK$1;\n};\n\n\nvar inflateReset_1 = inflateReset;\nvar inflateReset2_1 = inflateReset2;\nvar inflateResetKeep_1 = inflateResetKeep;\nvar inflateInit_1 = inflateInit;\nvar inflateInit2_1 = inflateInit2;\nvar inflate_2$1 = inflate$2;\nvar inflateEnd_1 = inflateEnd;\nvar inflateGetHeader_1 = inflateGetHeader;\nvar inflateSetDictionary_1 = inflateSetDictionary;\nvar inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n\nvar inflate_1$2 = {\n\tinflateReset: inflateReset_1,\n\tinflateReset2: inflateReset2_1,\n\tinflateResetKeep: inflateResetKeep_1,\n\tinflateInit: inflateInit_1,\n\tinflateInit2: inflateInit2_1,\n\tinflate: inflate_2$1,\n\tinflateEnd: inflateEnd_1,\n\tinflateGetHeader: inflateGetHeader_1,\n\tinflateSetDictionary: inflateSetDictionary_1,\n\tinflateInfo: inflateInfo\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nvar gzheader = GZheader;\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate$1(options) {\n this.options = common.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = inflate_1$2.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n\n this.header = new gzheader();\n\n inflate_1$2.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = inflate_1$2.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = inflate_1$2.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = inflate_1$2.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n inflate_1$2.inflateReset(strm);\n status = inflate_1$2.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = inflate_1$2.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = common.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate$1(input, options) {\n const inflator = new Inflate$1(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || messages[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return inflate$1(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nvar Inflate_1$1 = Inflate$1;\nvar inflate_2 = inflate$1;\nvar inflateRaw_1$1 = inflateRaw$1;\nvar ungzip$1 = inflate$1;\nvar constants = constants$2;\n\nvar inflate_1$1 = {\n\tInflate: Inflate_1$1,\n\tinflate: inflate_2,\n\tinflateRaw: inflateRaw_1$1,\n\tungzip: ungzip$1,\n\tconstants: constants\n};\n\nconst { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;\n\nconst { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;\n\n\n\nvar Deflate_1 = Deflate;\nvar deflate_1 = deflate;\nvar deflateRaw_1 = deflateRaw;\nvar gzip_1 = gzip;\nvar Inflate_1 = Inflate;\nvar inflate_1 = inflate;\nvar inflateRaw_1 = inflateRaw;\nvar ungzip_1 = ungzip;\nvar constants_1 = constants$2;\n\nvar pako = {\n\tDeflate: Deflate_1,\n\tdeflate: deflate_1,\n\tdeflateRaw: deflateRaw_1,\n\tgzip: gzip_1,\n\tInflate: Inflate_1,\n\tinflate: inflate_1,\n\tinflateRaw: inflateRaw_1,\n\tungzip: ungzip_1,\n\tconstants: constants_1\n};\n\nexport { Deflate_1 as Deflate, Inflate_1 as Inflate, constants_1 as constants, pako as default, deflate_1 as deflate, deflateRaw_1 as deflateRaw, gzip_1 as gzip, inflate_1 as inflate, inflateRaw_1 as inflateRaw, ungzip_1 as ungzip };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","var Browser = (function () {\n function Browser() {\n this.firefox = false;\n this.ie = false;\n this.edge = false;\n this.newEdge = false;\n this.weChat = false;\n }\n return Browser;\n}());\nvar Env = (function () {\n function Env() {\n this.browser = new Browser();\n this.node = false;\n this.wxa = false;\n this.worker = false;\n this.svgSupported = false;\n this.touchEventsSupported = false;\n this.pointerEventsSupported = false;\n this.domSupported = false;\n this.transformSupported = false;\n this.transform3dSupported = false;\n this.hasGlobalWindow = typeof window !== 'undefined';\n }\n return Env;\n}());\nvar env = new Env();\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n env.wxa = true;\n env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n env.worker = true;\n}\nelse if (typeof navigator === 'undefined') {\n env.node = true;\n env.svgSupported = true;\n}\nelse {\n detect(navigator.userAgent, env);\n}\nfunction detect(ua, env) {\n var browser = env.browser;\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge?\\/([\\d.]+)/);\n var weChat = (/micromessenger/i).test(ua);\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n browser.newEdge = +edge[1].split('.')[0] > 18;\n }\n if (weChat) {\n browser.weChat = true;\n }\n env.svgSupported = typeof SVGRect !== 'undefined';\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n env.pointerEventsSupported = 'onpointerdown' in window\n && (browser.edge || (browser.ie && +browser.version >= 11));\n env.domSupported = typeof document !== 'undefined';\n var style = document.documentElement.style;\n env.transform3dSupported = ((browser.ie && 'transition' in style)\n || browser.edge\n || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n || 'MozPerspective' in style)\n && !('OTransition' in style);\n env.transformSupported = env.transform3dSupported\n || (browser.ie && +browser.version >= 9);\n}\nexport default env;\n","export var DEFAULT_FONT_SIZE = 12;\nexport var DEFAULT_FONT_FAMILY = 'sans-serif';\nexport var DEFAULT_FONT = DEFAULT_FONT_SIZE + \"px \" + DEFAULT_FONT_FAMILY;\nvar OFFSET = 20;\nvar SCALE = 100;\nvar defaultWidthMapStr = \"007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\\\\\WQb\\\\0FWLg\\\\bWb\\\\WQ\\\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\\\FFF5.5N\";\nfunction getTextWidthMap(mapStr) {\n var map = {};\n if (typeof JSON === 'undefined') {\n return map;\n }\n for (var i = 0; i < mapStr.length; i++) {\n var char = String.fromCharCode(i + 32);\n var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;\n map[char] = size;\n }\n return map;\n}\nexport var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);\nexport var platformApi = {\n createCanvas: function () {\n return typeof document !== 'undefined'\n && document.createElement('canvas');\n },\n measureText: (function () {\n var _ctx;\n var _cachedFont;\n return function (text, font) {\n if (!_ctx) {\n var canvas = platformApi.createCanvas();\n _ctx = canvas && canvas.getContext('2d');\n }\n if (_ctx) {\n if (_cachedFont !== font) {\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\n }\n return _ctx.measureText(text);\n }\n else {\n text = text || '';\n font = font || DEFAULT_FONT;\n var res = /(\\d+)px/.exec(font);\n var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;\n var width = 0;\n if (font.indexOf('mono') >= 0) {\n width = fontSize * text.length;\n }\n else {\n for (var i = 0; i < text.length; i++) {\n var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];\n width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize);\n }\n }\n return { width: width };\n }\n };\n })(),\n loadImage: function (src, onload, onerror) {\n var image = new Image();\n image.onload = onload;\n image.onerror = onerror;\n image.src = src;\n return image;\n }\n};\nexport function setPlatformAPI(newPlatformApis) {\n for (var key in platformApi) {\n if (newPlatformApis[key]) {\n platformApi[key] = newPlatformApis[key];\n }\n }\n}\n","import { platformApi } from './platform.js';\nvar BUILTIN_OBJECT = reduce([\n 'Function',\n 'RegExp',\n 'Date',\n 'Error',\n 'CanvasGradient',\n 'CanvasPattern',\n 'Image',\n 'Canvas'\n], function (obj, val) {\n obj['[object ' + val + ']'] = true;\n return obj;\n}, {});\nvar TYPED_ARRAY = reduce([\n 'Int8',\n 'Uint8',\n 'Uint8Clamped',\n 'Int16',\n 'Uint16',\n 'Int32',\n 'Uint32',\n 'Float32',\n 'Float64'\n], function (obj, val) {\n obj['[object ' + val + 'Array]'] = true;\n return obj;\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 ctorFunction = function () { }.constructor;\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\nvar protoKey = '__proto__';\nvar idStart = 0x0907;\nexport function guid() {\n return idStart++;\n}\nexport function logError() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (typeof console !== 'undefined') {\n console.error.apply(console, args);\n }\n}\nexport function clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n var result = source;\n var typeStr = objToString.call(source);\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n if (Ctor.from) {\n result = Ctor.from(source);\n }\n else {\n result = new Ctor(source.length);\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = source[i];\n }\n }\n }\n }\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n result[key] = clone(source[key]);\n }\n }\n }\n return result;\n}\nexport function merge(target, source, overwrite) {\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n var targetProp = target[key];\n var sourceProp = source[key];\n if (isObject(sourceProp)\n && isObject(targetProp)\n && !isArray(sourceProp)\n && !isArray(targetProp)\n && !isDom(sourceProp)\n && !isDom(targetProp)\n && !isBuiltInObject(sourceProp)\n && !isBuiltInObject(targetProp)\n && !isPrimitive(sourceProp)\n && !isPrimitive(targetProp)) {\n merge(targetProp, sourceProp, overwrite);\n }\n else if (overwrite || !(key in target)) {\n target[key] = clone(source[key]);\n }\n }\n }\n return target;\n}\nexport function mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n return result;\n}\nexport function extend(target, source) {\n if (Object.assign) {\n Object.assign(target, source);\n }\n else {\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\nexport function defaults(target, source, overlay) {\n var keysArr = keys(source);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if ((overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport var createCanvas = platformApi.createCanvas;\nexport function indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n return -1;\n}\nexport function inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n function F() { }\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n for (var prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\nexport function mixin(target, source, override) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n if (Object.getOwnPropertyNames) {\n var keyList = Object.getOwnPropertyNames(source);\n for (var i = 0; i < keyList.length; i++) {\n var key = keyList[i];\n if (key !== 'constructor') {\n if ((override ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n }\n }\n else {\n defaults(target, source, override);\n }\n}\nexport function isArrayLike(data) {\n if (!data) {\n return false;\n }\n if (typeof data === 'string') {\n return false;\n }\n return typeof data.length === 'number';\n}\nexport function each(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n if (arr.forEach && arr.forEach === nativeForEach) {\n arr.forEach(cb, context);\n }\n else if (arr.length === +arr.length) {\n for (var i = 0, len = arr.length; i < len; i++) {\n cb.call(context, arr[i], i, arr);\n }\n }\n else {\n for (var key in arr) {\n if (arr.hasOwnProperty(key)) {\n cb.call(context, arr[key], key, arr);\n }\n }\n }\n}\nexport function map(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.map && arr.map === nativeMap) {\n return arr.map(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n result.push(cb.call(context, arr[i], i, arr));\n }\n return result;\n }\n}\nexport function reduce(arr, cb, memo, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n memo = cb.call(context, memo, arr[i], i, arr);\n }\n return memo;\n}\nexport function filter(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.filter && arr.filter === nativeFilter) {\n return arr.filter(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n}\nexport function find(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n return arr[i];\n }\n }\n}\nexport function keys(obj) {\n if (!obj) {\n return [];\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keyList = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyList.push(key);\n }\n }\n return keyList;\n}\nfunction bindPolyfill(func, context) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport var bind = (protoFunction && isFunction(protoFunction.bind))\n ? protoFunction.call.bind(protoFunction.bind)\n : bindPolyfill;\nfunction curry(func) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport { curry };\nexport function isArray(value) {\n if (Array.isArray) {\n return Array.isArray(value);\n }\n return objToString.call(value) === '[object Array]';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isString(value) {\n return typeof value === 'string';\n}\nexport function isStringSafe(value) {\n return objToString.call(value) === '[object String]';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isObject(value) {\n var type = typeof value;\n return type === 'function' || (!!value && type === 'object');\n}\nexport function isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\nexport function isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\nexport function isDom(value) {\n return typeof value === 'object'\n && typeof value.nodeType === 'number'\n && typeof value.ownerDocument === 'object';\n}\nexport function isGradientObject(value) {\n return value.colorStops != null;\n}\nexport function isImagePatternObject(value) {\n return value.image != null;\n}\nexport function isRegExp(value) {\n return objToString.call(value) === '[object RegExp]';\n}\nexport function eqNaN(value) {\n return value !== value;\n}\nexport function retrieve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0, len = args.length; i < len; i++) {\n if (args[i] != null) {\n return args[i];\n }\n }\n}\nexport function retrieve2(value0, value1) {\n return value0 != null\n ? value0\n : value1;\n}\nexport function retrieve3(value0, value1, value2) {\n return value0 != null\n ? value0\n : value1 != null\n ? value1\n : value2;\n}\nexport function slice(arr) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return nativeSlice.apply(arr, args);\n}\nexport function normalizeCssArray(val) {\n if (typeof (val) === 'number') {\n return [val, val, val, val];\n }\n var len = val.length;\n if (len === 2) {\n return [val[0], val[1], val[0], val[1]];\n }\n else if (len === 3) {\n return [val[0], val[1], val[2], val[1]];\n }\n return val;\n}\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\nexport function trim(str) {\n if (str == null) {\n return null;\n }\n else if (typeof str.trim === 'function') {\n return str.trim();\n }\n else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\nvar primitiveKey = '__ec_primitive__';\nexport function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\nexport function isPrimitive(obj) {\n return obj[primitiveKey];\n}\nvar MapPolyfill = (function () {\n function MapPolyfill() {\n this.data = {};\n }\n MapPolyfill.prototype[\"delete\"] = function (key) {\n var existed = this.has(key);\n if (existed) {\n delete this.data[key];\n }\n return existed;\n };\n MapPolyfill.prototype.has = function (key) {\n return this.data.hasOwnProperty(key);\n };\n MapPolyfill.prototype.get = function (key) {\n return this.data[key];\n };\n MapPolyfill.prototype.set = function (key, value) {\n this.data[key] = value;\n return this;\n };\n MapPolyfill.prototype.keys = function () {\n return keys(this.data);\n };\n MapPolyfill.prototype.forEach = function (callback) {\n var data = this.data;\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n callback(data[key], key);\n }\n }\n };\n return MapPolyfill;\n}());\nvar isNativeMapSupported = typeof Map === 'function';\nfunction maybeNativeMap() {\n return (isNativeMapSupported ? new Map() : new MapPolyfill());\n}\nvar HashMap = (function () {\n function HashMap(obj) {\n var isArr = isArray(obj);\n this.data = maybeNativeMap();\n var thisMap = this;\n (obj instanceof HashMap)\n ? obj.each(visit)\n : (obj && each(obj, visit));\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n }\n HashMap.prototype.hasKey = function (key) {\n return this.data.has(key);\n };\n HashMap.prototype.get = function (key) {\n return this.data.get(key);\n };\n HashMap.prototype.set = function (key, value) {\n this.data.set(key, value);\n return value;\n };\n HashMap.prototype.each = function (cb, context) {\n this.data.forEach(function (value, key) {\n cb.call(context, value, key);\n });\n };\n HashMap.prototype.keys = function () {\n var keys = this.data.keys();\n return isNativeMapSupported\n ? Array.from(keys)\n : keys;\n };\n HashMap.prototype.removeKey = function (key) {\n this.data[\"delete\"](key);\n };\n return HashMap;\n}());\nexport { HashMap };\nexport function createHashMap(obj) {\n return new HashMap(obj);\n}\nexport function concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n var offset = a.length;\n for (var i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n return newArray;\n}\nexport function createObject(proto, properties) {\n var obj;\n if (Object.create) {\n obj = Object.create(proto);\n }\n else {\n var StyleCtor = function () { };\n StyleCtor.prototype = proto;\n obj = new StyleCtor();\n }\n if (properties) {\n extend(obj, properties);\n }\n return obj;\n}\nexport function disableUserSelect(dom) {\n var domStyle = dom.style;\n domStyle.webkitUserSelect = 'none';\n domStyle.userSelect = 'none';\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n domStyle['-webkit-touch-callout'] = 'none';\n}\nexport function hasOwn(own, prop) {\n return own.hasOwnProperty(prop);\n}\nexport function noop() { }\nexport var RADIAN_TO_DEGREE = 180 / Math.PI;\n","export function create(x, y) {\n if (x == null) {\n x = 0;\n }\n if (y == null) {\n y = 0;\n }\n return [x, y];\n}\nexport function copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\nexport function clone(v) {\n return [v[0], v[1]];\n}\nexport function set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\nexport function add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\nexport function 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}\nexport function sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\nexport function len(v) {\n return Math.sqrt(lenSquare(v));\n}\nexport var length = len;\nexport function lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\nexport var lengthSquare = lenSquare;\nexport function mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\nexport function div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\nexport function dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\nexport function scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\nexport function normalize(out, v) {\n var d = len(v);\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n }\n else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n return out;\n}\nexport function distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\nexport var dist = distance;\nexport function distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport var distSquare = distanceSquare;\nexport function negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\nexport function 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}\nexport function 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}\nexport function 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}\nexport function 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","var Param = (function () {\n function Param(target, e) {\n this.target = target;\n this.topTarget = e && e.topTarget;\n }\n return Param;\n}());\nvar Draggable = (function () {\n function Draggable(handler) {\n this.handler = handler;\n handler.on('mousedown', this._dragStart, this);\n handler.on('mousemove', this._drag, this);\n handler.on('mouseup', this._dragEnd, this);\n }\n Draggable.prototype._dragStart = function (e) {\n var draggingTarget = e.target;\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;\n }\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\n }\n };\n Draggable.prototype._drag = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\n }\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n };\n Draggable.prototype._dragEnd = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n if (this._dropTarget) {\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n }\n this._draggingTarget = null;\n this._dropTarget = null;\n };\n return Draggable;\n}());\nexport default Draggable;\n","var Eventful = (function () {\n function Eventful(eventProcessors) {\n if (eventProcessors) {\n this._$eventProcessor = eventProcessors;\n }\n }\n Eventful.prototype.on = function (event, query, handler, context) {\n if (!this._$handlers) {\n this._$handlers = {};\n }\n var _h = this._$handlers;\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n if (!handler || !event) {\n return this;\n }\n var eventProcessor = this._$eventProcessor;\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n if (!_h[event]) {\n _h[event] = [];\n }\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return this;\n }\n }\n var wrap = {\n h: handler,\n query: query,\n ctx: (context || this),\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n (lastWrap && lastWrap.callAtLast)\n ? _h[event].splice(lastIndex, 0, wrap)\n : _h[event].push(wrap);\n return this;\n };\n Eventful.prototype.isSilent = function (eventName) {\n var _h = this._$handlers;\n return !_h || !_h[eventName] || !_h[eventName].length;\n };\n Eventful.prototype.off = function (eventType, handler) {\n var _h = this._$handlers;\n if (!_h) {\n return this;\n }\n if (!eventType) {\n this._$handlers = {};\n return this;\n }\n if (handler) {\n if (_h[eventType]) {\n var newList = [];\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\n if (_h[eventType][i].h !== handler) {\n newList.push(_h[eventType][i]);\n }\n }\n _h[eventType] = newList;\n }\n if (_h[eventType] && _h[eventType].length === 0) {\n delete _h[eventType];\n }\n }\n else {\n delete _h[eventType];\n }\n return this;\n };\n Eventful.prototype.trigger = function (eventType) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[eventType];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(eventType, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(hItem.ctx);\n break;\n case 1:\n hItem.h.call(hItem.ctx, args[0]);\n break;\n case 2:\n hItem.h.call(hItem.ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(eventType);\n return this;\n };\n Eventful.prototype.triggerWithContext = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var ctx = args[argLen - 1];\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(type, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(ctx);\n break;\n case 1:\n hItem.h.call(ctx, args[0]);\n break;\n case 2:\n hItem.h.call(ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(type);\n return this;\n };\n return Eventful;\n}());\nexport default Eventful;\n","var LN2 = Math.log(2);\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n var cacheKey = rowMask + '-' + colMask;\n var fullRank = rows.length;\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n if (rank === 1) {\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n var subRowMask = rowMask | (1 << rowStart);\n var subRowStart = rowStart + 1;\n while (rowMask & (1 << subRowStart)) {\n subRowStart++;\n }\n var sum = 0;\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n var colTag = 1 << j;\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n detCache[cacheKey] = sum;\n return sum;\n}\nexport function buildTransformer(src, dest) {\n var mA = [\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n ];\n var detCache = {};\n var det = determinant(mA, 8, 0, 0, 0, detCache);\n if (det === 0) {\n return;\n }\n var vh = [];\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1)\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n / det * dest[i];\n }\n }\n return function (out, srcPointX, srcPointY) {\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n","import env from './env.js';\nimport { buildTransformer } from './fourPointsTransform.js';\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\nexport function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\nexport function transformCoordWithViewport(out, el, inX, inY, inverse) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n var markers = prepareCoordMarkers(el, saved);\n var transformer = preparePointerTransformer(markers, saved, inverse);\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n return false;\n}\nfunction prepareCoordMarkers(el, saved) {\n var markers = saved.markers;\n if (markers) {\n return markers;\n }\n markers = saved.markers = [];\n var propLR = ['left', 'right'];\n var propTB = ['top', 'bottom'];\n for (var i = 0; i < 4; i++) {\n var marker = document.createElement('div');\n var stl = marker.style;\n var idxLR = i % 2;\n var idxTB = (i >> 1) % 2;\n stl.cssText = [\n 'position: absolute',\n 'visibility: hidden',\n 'padding: 0',\n 'margin: 0',\n 'border-width: 0',\n 'user-select: none',\n 'width:0',\n 'height:0',\n propLR[idxLR] + ':0',\n propTB[idxTB] + ':0',\n propLR[1 - idxLR] + ':auto',\n propTB[1 - idxTB] + ':auto',\n ''\n ].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n return markers;\n}\nfunction preparePointerTransformer(markers, saved, inverse) {\n var transformerName = inverse ? 'invTrans' : 'trans';\n var transformer = saved[transformerName];\n var oldSrcCoords = saved.srcCoords;\n var srcCoords = [];\n var destCoords = [];\n var oldCoordTheSame = true;\n for (var i = 0; i < 4; i++) {\n var rect = markers[i].getBoundingClientRect();\n var ii = 2 * i;\n var x = rect.left;\n var y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n }\n return (oldCoordTheSame && transformer)\n ? transformer\n : (saved.srcCoords = srcCoords,\n saved[transformerName] = inverse\n ? buildTransformer(destCoords, srcCoords)\n : buildTransformer(srcCoords, destCoords));\n}\nexport function isCanvasEl(el) {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\nexport function encodeHTML(source) {\n return source == null\n ? ''\n : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n","import Eventful from './Eventful.js';\nimport env from './env.js';\nimport { isCanvasEl, transformCoordWithViewport } from './dom.js';\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\nvar firefoxNotSupportOffsetXY = env.browser.firefox\n && +env.browser.version.split('.')[0] < 39;\nexport function clientToLocal(el, e, out, calculate) {\n out = out || {};\n if (calculate) {\n calculateZrXY(el, e, out);\n }\n else if (firefoxNotSupportOffsetXY\n && e.layerX != null\n && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n }\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n }\n else {\n calculateZrXY(el, e, out);\n }\n return out;\n}\nfunction calculateZrXY(el, e, out) {\n if (env.domSupported && el.getBoundingClientRect) {\n var ex = e.clientX;\n var ey = e.clientY;\n if (isCanvasEl(el)) {\n var box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n }\n else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n out.zrX = out.zrY = 0;\n}\nexport function getNativeEvent(e) {\n return e\n || window.event;\n}\nexport function normalizeEvent(el, e, calculate) {\n e = getNativeEvent(e);\n if (e.zrX != null) {\n return e;\n }\n var eventType = e.type;\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n var wheelDelta = getWheelDeltaMayPolyfill(e);\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n }\n else {\n var touch = eventType !== 'touchend'\n ? e.targetTouches[0]\n : e.changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n }\n var button = e.button;\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n }\n return e;\n}\nfunction getWheelDeltaMayPolyfill(e) {\n var rawWheelDelta = e.wheelDelta;\n if (rawWheelDelta) {\n return rawWheelDelta;\n }\n var deltaX = e.deltaX;\n var deltaY = e.deltaY;\n if (deltaX == null || deltaY == null) {\n return rawWheelDelta;\n }\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n var sign = deltaY > 0 ? -1\n : deltaY < 0 ? 1\n : deltaX > 0 ? -1\n : 1;\n return 3 * delta * sign;\n}\nexport function addEventListener(el, name, handler, opt) {\n el.addEventListener(name, handler, opt);\n}\nexport function removeEventListener(el, name, handler, opt) {\n el.removeEventListener(name, handler, opt);\n}\nexport var stop = function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n};\nexport function isMiddleOrRightButtonOnMouseUpDown(e) {\n return e.which === 2 || e.which === 3;\n}\nexport { Eventful as Dispatcher };\n","import * as eventUtil from './event.js';\nvar GestureMgr = (function () {\n function GestureMgr() {\n this._track = [];\n }\n GestureMgr.prototype.recognize = function (event, target, root) {\n this._doTrack(event, target, root);\n return this._recognize(event);\n };\n GestureMgr.prototype.clear = function () {\n this._track.length = 0;\n return this;\n };\n GestureMgr.prototype._doTrack = function (event, target, root) {\n var touches = event.touches;\n if (!touches) {\n return;\n }\n var trackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n for (var i = 0, len = touches.length; i < len; i++) {\n var touch = touches[i];\n var pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n this._track.push(trackItem);\n };\n GestureMgr.prototype._recognize = function (event) {\n for (var eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n var gestureInfo = recognizers[eventName](this._track, event);\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n };\n return GestureMgr;\n}());\nexport { GestureMgr };\nfunction dist(pointPair) {\n var dx = pointPair[1][0] - pointPair[0][0];\n var dy = pointPair[1][1] - pointPair[0][1];\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction center(pointPair) {\n return [\n (pointPair[0][0] + pointPair[1][0]) / 2,\n (pointPair[0][1] + pointPair[1][1]) / 2\n ];\n}\nvar recognizers = {\n pinch: function (tracks, event) {\n var trackLen = tracks.length;\n if (!trackLen) {\n return;\n }\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n if (pinchPre\n && pinchPre.length > 1\n && pinchEnd\n && pinchEnd.length > 1) {\n var pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n event.pinchScale = pinchScale;\n var pinchCenter = center(pinchEnd);\n event.pinchX = pinchCenter[0];\n event.pinchY = pinchCenter[1];\n return {\n type: 'pinch',\n target: tracks[0].target,\n event: event\n };\n }\n }\n};\n","export function create() {\n return [1, 0, 0, 1, 0, 0];\n}\nexport function 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}\nexport function 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}\nexport function mul(out, m1, m2) {\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}\nexport function 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}\nexport function 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}\nexport function 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}\nexport function 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 if (!det) {\n return null;\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}\nexport function clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n","var Point = (function () {\n function Point(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n Point.prototype.copy = function (other) {\n this.x = other.x;\n this.y = other.y;\n return this;\n };\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n Point.prototype.set = function (x, y) {\n this.x = x;\n this.y = y;\n return this;\n };\n Point.prototype.equal = function (other) {\n return other.x === this.x && other.y === this.y;\n };\n Point.prototype.add = function (other) {\n this.x += other.x;\n this.y += other.y;\n return this;\n };\n Point.prototype.scale = function (scalar) {\n this.x *= scalar;\n this.y *= scalar;\n };\n Point.prototype.scaleAndAdd = function (other, scalar) {\n this.x += other.x * scalar;\n this.y += other.y * scalar;\n };\n Point.prototype.sub = function (other) {\n this.x -= other.x;\n this.y -= other.y;\n return this;\n };\n Point.prototype.dot = function (other) {\n return this.x * other.x + this.y * other.y;\n };\n Point.prototype.len = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n };\n Point.prototype.lenSquare = function () {\n return this.x * this.x + this.y * this.y;\n };\n Point.prototype.normalize = function () {\n var len = this.len();\n this.x /= len;\n this.y /= len;\n return this;\n };\n Point.prototype.distance = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n Point.prototype.distanceSquare = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return dx * dx + dy * dy;\n };\n Point.prototype.negate = function () {\n this.x = -this.x;\n this.y = -this.y;\n return this;\n };\n Point.prototype.transform = function (m) {\n if (!m) {\n return;\n }\n var x = this.x;\n var y = this.y;\n this.x = m[0] * x + m[2] * y + m[4];\n this.y = m[1] * x + m[3] * y + m[5];\n return this;\n };\n Point.prototype.toArray = function (out) {\n out[0] = this.x;\n out[1] = this.y;\n return out;\n };\n Point.prototype.fromArray = function (input) {\n this.x = input[0];\n this.y = input[1];\n };\n Point.set = function (p, x, y) {\n p.x = x;\n p.y = y;\n };\n Point.copy = function (p, p2) {\n p.x = p2.x;\n p.y = p2.y;\n };\n Point.len = function (p) {\n return Math.sqrt(p.x * p.x + p.y * p.y);\n };\n Point.lenSquare = function (p) {\n return p.x * p.x + p.y * p.y;\n };\n Point.dot = function (p0, p1) {\n return p0.x * p1.x + p0.y * p1.y;\n };\n Point.add = function (out, p0, p1) {\n out.x = p0.x + p1.x;\n out.y = p0.y + p1.y;\n };\n Point.sub = function (out, p0, p1) {\n out.x = p0.x - p1.x;\n out.y = p0.y - p1.y;\n };\n Point.scale = function (out, p0, scalar) {\n out.x = p0.x * scalar;\n out.y = p0.y * scalar;\n };\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\n out.x = p0.x + p1.x * scalar;\n out.y = p0.y + p1.y * scalar;\n };\n Point.lerp = function (out, p0, p1, t) {\n var onet = 1 - t;\n out.x = onet * p0.x + t * p1.x;\n out.y = onet * p0.y + t * p1.y;\n };\n return Point;\n}());\nexport default Point;\n","import * as matrix from './matrix.js';\nimport Point from './Point.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar lt = new Point();\nvar rb = new Point();\nvar lb = new Point();\nvar rt = new Point();\nvar minTv = new Point();\nvar maxTv = new Point();\nvar BoundingRect = (function () {\n function BoundingRect(x, y, width, height) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BoundingRect.prototype.union = function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n if (isFinite(this.x) && isFinite(this.width)) {\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n }\n else {\n this.width = other.width;\n }\n if (isFinite(this.y) && isFinite(this.height)) {\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n }\n else {\n this.height = other.height;\n }\n this.x = x;\n this.y = y;\n };\n BoundingRect.prototype.applyTransform = function (m) {\n BoundingRect.applyTransform(this, this, m);\n };\n BoundingRect.prototype.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 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 BoundingRect.prototype.intersect = function (b, mtv) {\n if (!b) {\n return false;\n }\n if (!(b instanceof BoundingRect)) {\n b = BoundingRect.create(b);\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 var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n if (mtv) {\n var dMin = Infinity;\n var dMax = 0;\n var d0 = Math.abs(ax1 - bx0);\n var d1 = Math.abs(bx1 - ax0);\n var d2 = Math.abs(ay1 - by0);\n var d3 = Math.abs(by1 - ay0);\n var dx = Math.min(d0, d1);\n var dy = Math.min(d2, d3);\n if (ax1 < bx0 || bx1 < ax0) {\n if (dx > dMax) {\n dMax = dx;\n if (d0 < d1) {\n Point.set(maxTv, -d0, 0);\n }\n else {\n Point.set(maxTv, d1, 0);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d0 < d1) {\n Point.set(minTv, d0, 0);\n }\n else {\n Point.set(minTv, -d1, 0);\n }\n }\n }\n if (ay1 < by0 || by1 < ay0) {\n if (dy > dMax) {\n dMax = dy;\n if (d2 < d3) {\n Point.set(maxTv, 0, -d2);\n }\n else {\n Point.set(maxTv, 0, d3);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d2 < d3) {\n Point.set(minTv, 0, d2);\n }\n else {\n Point.set(minTv, 0, -d3);\n }\n }\n }\n }\n if (mtv) {\n Point.copy(mtv, overlap ? minTv : maxTv);\n }\n return overlap;\n };\n BoundingRect.prototype.contain = function (x, y) {\n var rect = this;\n return x >= rect.x\n && x <= (rect.x + rect.width)\n && y >= rect.y\n && y <= (rect.y + rect.height);\n };\n BoundingRect.prototype.clone = function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n };\n BoundingRect.prototype.copy = function (other) {\n BoundingRect.copy(this, other);\n };\n BoundingRect.prototype.plain = function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n };\n BoundingRect.prototype.isFinite = function () {\n return isFinite(this.x)\n && isFinite(this.y)\n && isFinite(this.width)\n && isFinite(this.height);\n };\n BoundingRect.prototype.isZero = function () {\n return this.width === 0 || this.height === 0;\n };\n BoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n };\n BoundingRect.copy = function (target, source) {\n target.x = source.x;\n target.y = source.y;\n target.width = source.width;\n target.height = source.height;\n };\n BoundingRect.applyTransform = function (target, source, m) {\n if (!m) {\n if (target !== source) {\n BoundingRect.copy(target, source);\n }\n return;\n }\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n var sx = m[0];\n var sy = m[3];\n var tx = m[4];\n var ty = m[5];\n target.x = source.x * sx + tx;\n target.y = source.y * sy + ty;\n target.width = source.width * sx;\n target.height = source.height * sy;\n if (target.width < 0) {\n target.x += target.width;\n target.width = -target.width;\n }\n if (target.height < 0) {\n target.y += target.height;\n target.height = -target.height;\n }\n return;\n }\n lt.x = lb.x = source.x;\n lt.y = rt.y = source.y;\n rb.x = rt.x = source.x + source.width;\n rb.y = lb.y = source.y + source.height;\n lt.transform(m);\n rt.transform(m);\n rb.transform(m);\n lb.transform(m);\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n target.width = maxX - target.x;\n target.height = maxY - target.y;\n };\n return BoundingRect;\n}());\nexport default BoundingRect;\n","import { __extends } from \"tslib\";\nimport * as util from './core/util.js';\nimport * as vec2 from './core/vector.js';\nimport Draggable from './mixin/Draggable.js';\nimport Eventful from './core/Eventful.js';\nimport * as eventTool from './core/event.js';\nimport { GestureMgr } from './core/GestureMgr.js';\nimport BoundingRect from './core/BoundingRect.js';\nvar SILENT = 'silent';\nfunction makeEventPacket(eveType, targetInfo, event) {\n return {\n type: eveType,\n event: event,\n target: targetInfo.target,\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: event.gestureEvent,\n pinchX: event.pinchX,\n pinchY: event.pinchY,\n pinchScale: event.pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\nfunction stopEvent() {\n eventTool.stop(this.event);\n}\nvar EmptyProxy = (function (_super) {\n __extends(EmptyProxy, _super);\n function EmptyProxy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handler = null;\n return _this;\n }\n EmptyProxy.prototype.dispose = function () { };\n EmptyProxy.prototype.setCursor = function () { };\n return EmptyProxy;\n}(Eventful));\nvar HoveredResult = (function () {\n function HoveredResult(x, y) {\n this.x = x;\n this.y = y;\n }\n return HoveredResult;\n}());\nvar handlerNames = [\n 'click', 'dblclick', 'mousewheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar Handler = (function (_super) {\n __extends(Handler, _super);\n function Handler(storage, painter, proxy, painterRoot, pointerSize) {\n var _this = _super.call(this) || this;\n _this._hovered = new HoveredResult(0, 0);\n _this.storage = storage;\n _this.painter = painter;\n _this.painterRoot = painterRoot;\n _this._pointerSize = pointerSize;\n proxy = proxy || new EmptyProxy();\n _this.proxy = null;\n _this.setHandlerProxy(proxy);\n _this._draggingMgr = new Draggable(_this);\n return _this;\n }\n Handler.prototype.setHandlerProxy = function (proxy) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name], this);\n }, this);\n proxy.handler = this;\n }\n this.proxy = proxy;\n };\n Handler.prototype.mousemove = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var lastHovered = this._hovered;\n var lastHoveredTarget = lastHovered.target;\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n var hoveredTarget = hovered.target;\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n }\n this.dispatchToElement(hovered, 'mousemove', event);\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n };\n Handler.prototype.mouseout = function (event) {\n var eventControl = event.zrEventControl;\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n if (eventControl !== 'no_globalout') {\n this.trigger('globalout', { type: 'globalout', event: event });\n }\n };\n Handler.prototype.resize = function () {\n this._hovered = new HoveredResult(0, 0);\n };\n Handler.prototype.dispatch = function (eventName, eventArgs) {\n var handler = this[eventName];\n handler && handler.call(this, eventArgs);\n };\n Handler.prototype.dispose = function () {\n this.proxy.dispose();\n this.storage = null;\n this.proxy = null;\n this.painter = null;\n };\n Handler.prototype.setCursorStyle = function (cursorStyle) {\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n };\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\n targetInfo = targetInfo || {};\n var el = targetInfo.target;\n if (el && el.silent) {\n return;\n }\n var eventKey = ('on' + eventName);\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\n while (el) {\n el[eventKey]\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n el.trigger(eventName, eventPacket);\n el = el.__hostTarget ? el.__hostTarget : el.parent;\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n if (!eventPacket.cancelBubble) {\n this.trigger(eventName, eventPacket);\n if (this.painter && this.painter.eachOtherLayer) {\n this.painter.eachOtherLayer(function (layer) {\n if (typeof (layer[eventKey]) === 'function') {\n layer[eventKey].call(layer, eventPacket);\n }\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n }\n };\n Handler.prototype.findHover = function (x, y, exclude) {\n var list = this.storage.getDisplayList();\n var out = new HoveredResult(x, y);\n setHoverTarget(list, out, x, y, exclude);\n if (this._pointerSize && !out.target) {\n var candidates = [];\n var pointerSize = this._pointerSize;\n var targetSizeHalf = pointerSize / 2;\n var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n if (el !== exclude\n && !el.ignore\n && !el.ignoreCoarsePointer\n && (!el.parent || !el.parent.ignoreCoarsePointer)) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n if (tmpRect.intersect(pointerRect)) {\n candidates.push(el);\n }\n }\n }\n if (candidates.length) {\n var rStep = 4;\n var thetaStep = Math.PI / 12;\n var PI2 = Math.PI * 2;\n for (var r = 0; r < targetSizeHalf; r += rStep) {\n for (var theta = 0; theta < PI2; theta += thetaStep) {\n var x1 = x + r * Math.cos(theta);\n var y1 = y + r * Math.sin(theta);\n setHoverTarget(candidates, out, x1, y1, exclude);\n if (out.target) {\n return out;\n }\n }\n }\n }\n }\n return out;\n };\n Handler.prototype.processGesture = function (event, stage) {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n var gestureMgr = this._gestureMgr;\n stage === 'start' && gestureMgr.clear();\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n stage === 'end' && gestureMgr.clear();\n if (gestureInfo) {\n var type = gestureInfo.type;\n event.gestureEvent = type;\n var res = new HoveredResult();\n res.target = gestureInfo.target;\n this.dispatchToElement(res, type, gestureInfo.event);\n }\n };\n return Handler;\n}(Eventful));\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n Handler.prototype[name] = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var hovered;\n var hoveredTarget;\n if (name !== 'mouseup' || !isOutside) {\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY];\n this._upEl = hoveredTarget;\n }\n else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n }\n else if (name === 'click') {\n if (this._downEl !== this._upEl\n || !this._downPoint\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n return;\n }\n this._downPoint = null;\n }\n this.dispatchToElement(hovered, name, event);\n };\n});\nfunction isHover(displayable, x, y) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n var el = displayable;\n var isSilent = void 0;\n var ignoreClip = false;\n while (el) {\n if (el.ignoreClip) {\n ignoreClip = true;\n }\n if (!ignoreClip) {\n var clipPath = el.getClipPath();\n if (clipPath && !clipPath.contain(x, y)) {\n return false;\n }\n if (el.silent) {\n isSilent = true;\n }\n }\n var hostEl = el.__hostTarget;\n el = hostEl ? hostEl : el.parent;\n }\n return isSilent ? SILENT : true;\n }\n return false;\n}\nfunction setHoverTarget(list, out, x, y, exclude) {\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n var hoverCheckResult = void 0;\n if (el !== exclude\n && !el.ignore\n && (hoverCheckResult = isHover(el, x, y))) {\n !out.topTarget && (out.topTarget = el);\n if (hoverCheckResult !== SILENT) {\n out.target = el;\n break;\n }\n }\n }\n}\nfunction isOutsideBoundary(handlerInstance, x, y) {\n var painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\nexport default Handler;\n","var DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nvar DEFAULT_TMP_STORAGE_LENGTH = 256;\nfunction minRunLength(n) {\n var r = 0;\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n return n + r;\n}\nfunction makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n if (runHi === hi) {\n return 1;\n }\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n reverseRun(array, lo, runHi);\n }\n else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n return runHi - lo;\n}\nfunction reverseRun(array, lo, hi) {\n hi--;\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n for (; start < hi; start++) {\n var pivot = array[start];\n var left = lo;\n var right = start;\n var mid;\n while (left < right) {\n mid = left + right >>> 1;\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n }\n else {\n left = mid + 1;\n }\n }\n var n = start - left;\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n case 2:\n array[left + 2] = array[left + 1];\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n array[left] = pivot;\n }\n}\nfunction gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n }\n else {\n offset = m;\n }\n }\n return offset;\n}\nfunction gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n else {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n }\n else {\n lastOffset = m + 1;\n }\n }\n return offset;\n}\nfunction TimSort(array, compare) {\n var minGallop = DEFAULT_MIN_GALLOPING;\n var length = 0;\n var tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;\n var stackLength = 0;\n var runStart;\n var runLength;\n var stackSize = 0;\n length = array.length;\n if (length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {\n tmpStorageLength = length >>> 1;\n }\n var tmp = [];\n stackLength = length < 120 ? 5 : length < 1542 ? 10 : length < 119151 ? 19 : 40;\n runStart = [];\n runLength = [];\n function pushRun(_runStart, _runLength) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n }\n else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n mergeAt(n);\n }\n }\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n mergeAt(n);\n }\n }\n function mergeAt(i) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n runLength[i] = length1 + length2;\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n stackSize--;\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n if (length1 === 0) {\n return;\n }\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n if (length2 === 0) {\n return;\n }\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n }\n else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n function mergeLow(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n if (--length2 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n exit = true;\n break;\n }\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n if (--length1 === 1) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n minGallop < 1 && (minGallop = 1);\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n }\n else if (length1 === 0) {\n throw new Error();\n }\n else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n function mergeHigh(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n return;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n return;\n }\n var _minGallop = minGallop;\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n array[dest--] = tmp[cursor2--];\n if (--length2 === 1) {\n exit = true;\n break;\n }\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n if (minGallop < 1) {\n minGallop = 1;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n }\n else if (length2 === 0) {\n throw new Error();\n }\n else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n return {\n mergeRuns: mergeRuns,\n forceMergeRuns: forceMergeRuns,\n pushRun: pushRun\n };\n}\nexport default function sort(array, compare, lo, hi) {\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n var remaining = hi - lo;\n if (remaining < 2) {\n return;\n }\n var runLength = 0;\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n var ts = TimSort(array, compare);\n var minRun = minRunLength(remaining);\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n ts.forceMergeRuns();\n}\n","export var REDRAW_BIT = 1;\nexport var STYLE_CHANGED_BIT = 2;\nexport var SHAPE_CHANGED_BIT = 4;\n","import * as util from './core/util.js';\nimport timsort from './core/timsort.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nvar invalidZErrorLogged = false;\nfunction logInvalidZError() {\n if (invalidZErrorLogged) {\n return;\n }\n invalidZErrorLogged = true;\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\nfunction shapeCompareFunc(a, b) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n return a.z2 - b.z2;\n }\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n}\nvar Storage = (function () {\n function Storage() {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n this.displayableSortFunc = shapeCompareFunc;\n }\n Storage.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n };\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\n includeIgnore = includeIgnore || false;\n var displayList = this._displayList;\n if (update || !displayList.length) {\n this.updateDisplayList(includeIgnore);\n }\n return displayList;\n };\n Storage.prototype.updateDisplayList = function (includeIgnore) {\n this._displayListLen = 0;\n var roots = this._roots;\n var displayList = this._displayList;\n for (var i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n displayList.length = this._displayListLen;\n timsort(displayList, shapeCompareFunc);\n };\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n el.beforeUpdate();\n el.update();\n el.afterUpdate();\n var userSetClipPath = el.getClipPath();\n if (el.ignoreClip) {\n clipPaths = null;\n }\n else if (userSetClipPath) {\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n }\n else {\n clipPaths = [];\n }\n var currentClipPath = userSetClipPath;\n var parentClipPath = el;\n while (currentClipPath) {\n currentClipPath.parent = parentClipPath;\n currentClipPath.updateTransform();\n clipPaths.push(currentClipPath);\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.getClipPath();\n }\n }\n if (el.childrenRef) {\n var children = el.childrenRef();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (el.__dirty) {\n child.__dirty |= REDRAW_BIT;\n }\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n }\n el.__dirty = 0;\n }\n else {\n var disp = el;\n if (clipPaths && clipPaths.length) {\n disp.__clipPaths = clipPaths;\n }\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\n disp.__clipPaths = [];\n }\n if (isNaN(disp.z)) {\n logInvalidZError();\n disp.z = 0;\n }\n if (isNaN(disp.z2)) {\n logInvalidZError();\n disp.z2 = 0;\n }\n if (isNaN(disp.zlevel)) {\n logInvalidZError();\n disp.zlevel = 0;\n }\n this._displayList[this._displayListLen++] = disp;\n }\n var decalEl = el.getDecalElement && el.getDecalElement();\n if (decalEl) {\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\n }\n var textGuide = el.getTextGuideLine();\n if (textGuide) {\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\n }\n var textEl = el.getTextContent();\n if (textEl) {\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\n }\n };\n Storage.prototype.addRoot = function (el) {\n if (el.__zr && el.__zr.storage === this) {\n return;\n }\n this._roots.push(el);\n };\n Storage.prototype.delRoot = function (el) {\n if (el instanceof Array) {\n for (var i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n return;\n }\n var idx = util.indexOf(this._roots, el);\n if (idx >= 0) {\n this._roots.splice(idx, 1);\n }\n };\n Storage.prototype.delAllRoots = function () {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n return;\n };\n Storage.prototype.getRoots = function () {\n return this._roots;\n };\n Storage.prototype.dispose = function () {\n this._displayList = null;\n this._roots = null;\n };\n return Storage;\n}());\nexport default Storage;\n","import env from '../core/env.js';\nvar requestAnimationFrame;\nrequestAnimationFrame = (env.hasGlobalWindow\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame)) || function (func) {\n return setTimeout(func, 16);\n};\nexport default requestAnimationFrame;\n","var easingFuncs = {\n linear: function (k) {\n return k;\n },\n quadraticIn: function (k) {\n return k * k;\n },\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * (--k * (k - 2) - 1);\n },\n cubicIn: function (k) {\n return k * k * k;\n },\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n quarticIn: function (k) {\n return k * k * k * k;\n },\n quarticOut: function (k) {\n return 1 - (--k * k * k * k);\n },\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n circularOut: function (k) {\n return Math.sqrt(1 - (--k * k));\n },\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return (a * Math.pow(2, -10 * k)\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n },\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n bounceIn: function (k) {\n return 1 - easingFuncs.bounceOut(1 - k);\n },\n bounceOut: function (k) {\n if (k < (1 / 2.75)) {\n return 7.5625 * k * k;\n }\n else if (k < (2 / 2.75)) {\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n }\n else if (k < (2.5 / 2.75)) {\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n }\n else {\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n }\n },\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easingFuncs.bounceIn(k * 2) * 0.5;\n }\n return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nexport default easingFuncs;\n","import { create as v2Create, distSquare as v2DistSquare } from './vector.js';\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;\nvar _v0 = v2Create();\nvar _v1 = v2Create();\nvar _v2 = v2Create();\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nexport function cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1)\n + t * t * (t * p3 + 3 * onet * p2);\n}\nexport function cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n + (p3 - p2) * t * t);\n}\nexport function cubicRootAt(p0, p1, p2, p3, val, roots) {\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 if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n }\n else {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = B * B - 4 * A * C;\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K;\n var t2 = -K / 2;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\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 if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n }\n else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n }\n else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\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 if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n return n;\n}\nexport function 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 if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\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 if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function 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;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123;\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\nexport function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\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;\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 if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n prev = t - interval;\n next = t + interval;\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n }\n return mathSqrt(d);\n}\nexport function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = cubicAt(x0, x1, x2, x3, t);\n var y = cubicAt(y0, y1, y2, y3, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\nexport function quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\nexport function quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\nexport function 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 if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\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 if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n if (divider === 0) {\n return 0.5;\n }\n else {\n return (p0 - p1) / divider;\n }\n}\nexport function 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;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\nexport function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y;\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 if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n var prev = t - interval;\n var next = t + interval;\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n }\n return mathSqrt(d);\n}\nexport function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = quadraticAt(x0, x1, x2, t);\n var y = quadraticAt(y0, y1, y2, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\n","import { cubicAt, cubicRootAt } from '../core/curve.js';\nimport { trim } from '../core/util.js';\nvar regexp = /cubic-bezier\\(([0-9,\\.e ]+)\\)/;\nexport function createCubicEasingFunc(cubicEasingStr) {\n var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);\n if (cubic) {\n var points = cubic[1].split(',');\n var a_1 = +trim(points[0]);\n var b_1 = +trim(points[1]);\n var c_1 = +trim(points[2]);\n var d_1 = +trim(points[3]);\n if (isNaN(a_1 + b_1 + c_1 + d_1)) {\n return;\n }\n var roots_1 = [];\n return function (p) {\n return p <= 0\n ? 0 : p >= 1\n ? 1\n : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);\n };\n }\n}\n","import easingFuncs from './easing.js';\nimport { isFunction, noop } from '../core/util.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nvar Clip = (function () {\n function Clip(opts) {\n this._inited = false;\n this._startTime = 0;\n this._pausedTime = 0;\n this._paused = false;\n this._life = opts.life || 1000;\n this._delay = opts.delay || 0;\n this.loop = opts.loop || false;\n this.onframe = opts.onframe || noop;\n this.ondestroy = opts.ondestroy || noop;\n this.onrestart = opts.onrestart || noop;\n opts.easing && this.setEasing(opts.easing);\n }\n Clip.prototype.step = function (globalTime, deltaTime) {\n if (!this._inited) {\n this._startTime = globalTime + this._delay;\n this._inited = true;\n }\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n var life = this._life;\n var elapsedTime = globalTime - this._startTime - this._pausedTime;\n var percent = elapsedTime / life;\n if (percent < 0) {\n percent = 0;\n }\n percent = Math.min(percent, 1);\n var easingFunc = this.easingFunc;\n var schedule = easingFunc ? easingFunc(percent) : percent;\n this.onframe(schedule);\n if (percent === 1) {\n if (this.loop) {\n var remainder = elapsedTime % life;\n this._startTime = globalTime - remainder;\n this._pausedTime = 0;\n this.onrestart();\n }\n else {\n return true;\n }\n }\n return false;\n };\n Clip.prototype.pause = function () {\n this._paused = true;\n };\n Clip.prototype.resume = function () {\n this._paused = false;\n };\n Clip.prototype.setEasing = function (easing) {\n this.easing = easing;\n this.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n };\n return Clip;\n}());\nexport default Clip;\n","var Entry = (function () {\n function Entry(val) {\n this.value = val;\n }\n return Entry;\n}());\nexport { Entry };\nvar LinkedList = (function () {\n function LinkedList() {\n this._len = 0;\n }\n LinkedList.prototype.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n };\n LinkedList.prototype.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n }\n else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n this._len++;\n };\n LinkedList.prototype.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this.head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this.tail = prev;\n }\n entry.next = entry.prev = null;\n this._len--;\n };\n LinkedList.prototype.len = function () {\n return this._len;\n };\n LinkedList.prototype.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n };\n return LinkedList;\n}());\nexport { LinkedList };\nvar LRU = (function () {\n function LRU(maxSize) {\n this._list = new LinkedList();\n this._maxSize = 10;\n this._map = {};\n this._maxSize = maxSize;\n }\n LRU.prototype.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n if (map[key] == null) {\n var len = list.len();\n var entry = this._lastRemovedEntry;\n if (len >= this._maxSize && len > 0) {\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n if (entry) {\n entry.value = value;\n }\n else {\n entry = new Entry(value);\n }\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n return removed;\n };\n LRU.prototype.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n if (entry != null) {\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n return entry.value;\n }\n };\n LRU.prototype.clear = function () {\n this._list.clear();\n this._map = {};\n };\n LRU.prototype.len = function () {\n return this._list.len();\n };\n return LRU;\n}());\nexport default LRU;\n","import LRU from '../core/LRU.js';\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\nfunction clampCssByte(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\nfunction clampCssAngle(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\nfunction clampCssFloat(f) {\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\nfunction parseCssInt(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n return clampCssByte(parseInt(str, 10));\n}\nfunction parseCssFloat(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n return clampCssFloat(parseFloat(str));\n}\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n }\n else if (h > 1) {\n h -= 1;\n }\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\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}\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}\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\nfunction putToCache(colorStr, rgbaArr) {\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\nexport function parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n if (cached) {\n return copyRgba(rgbaArr, cached);\n }\n colorStr = colorStr + '';\n var str = colorStr.replace(/ /g, '').toLowerCase();\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n var strLen = str.length;\n if (str.charAt(0) === '#') {\n if (strLen === 4 || strLen === 5) {\n var iv = parseInt(str.slice(1, 4), 16);\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else if (strLen === 7 || strLen === 9) {\n var iv = parseInt(str.slice(1, 7), 16);\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n return;\n }\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === strLen) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1;\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n return params.length === 3\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n : setRgba(rgbaArr, 0, 0, 0, 1);\n }\n alpha = parseCssFloat(params.pop());\n case 'rgb':\n if (params.length >= 3) {\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n default:\n return;\n }\n }\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\nfunction hsla2rgba(hsla, rgba) {\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\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 if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n return rgba;\n}\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\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);\n var vMax = Math.max(R, G, B);\n var delta = vMax - vMin;\n var L = (vMax + vMin) / 2;\n var H;\n var S;\n if (delta === 0) {\n H = 0;\n S = 0;\n }\n else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n }\n else {\n S = delta / (2 - vMax - vMin);\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 if (R === vMax) {\n H = deltaB - deltaG;\n }\n else if (G === vMax) {\n H = (1 / 3) + deltaR - deltaB;\n }\n else if (B === vMax) {\n H = (2 / 3) + deltaG - deltaR;\n }\n if (H < 0) {\n H += 1;\n }\n if (H > 1) {\n H -= 1;\n }\n }\n var hsla = [H * 360, S, L];\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n return hsla;\n}\nexport function lift(color, level) {\n var colorArr = parse(color);\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n }\n else {\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n }\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n }\n else if (colorArr[i] < 0) {\n colorArr[i] = 0;\n }\n }\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\nexport function toHex(color) {\n var colorArr = parse(color);\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n }\n}\nexport function fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\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}\nexport var fastMapToColor = fastLerp;\nexport function lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\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([\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n ], 'rgba');\n return fullOutput\n ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n }\n : color;\n}\nexport var mapToColor = lerp;\nexport function modifyHSL(color, h, s, l) {\n var colorArr = parse(color);\n if (color) {\n colorArr = rgba2hsla(colorArr);\n h != null && (colorArr[0] = clampCssAngle(h));\n s != null && (colorArr[1] = parseCssFloat(s));\n l != null && (colorArr[2] = parseCssFloat(l));\n return stringify(hsla2rgba(colorArr), 'rgba');\n }\n}\nexport function modifyAlpha(color, alpha) {\n var colorArr = parse(color);\n if (colorArr && alpha != null) {\n colorArr[3] = clampCssFloat(alpha);\n return stringify(colorArr, 'rgba');\n }\n}\nexport function stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n return type + '(' + colorStr + ')';\n}\nexport function lum(color, backgroundLum) {\n var arr = parse(color);\n return arr\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n + (1 - arr[3]) * backgroundLum\n : 0;\n}\nexport function random() {\n return stringify([\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255)\n ], 'rgb');\n}\n","import { RADIAN_TO_DEGREE, retrieve2, logError, isFunction } from '../core/util.js';\nimport { parse } from '../tool/color.js';\nimport env from '../core/env.js';\nvar mathRound = Math.round;\nexport function normalizeColor(color) {\n var opacity;\n if (!color || color === 'transparent') {\n color = 'none';\n }\n else if (typeof color === 'string' && color.indexOf('rgba') > -1) {\n var arr = parse(color);\n if (arr) {\n color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';\n opacity = arr[3];\n }\n }\n return {\n color: color,\n opacity: opacity == null ? 1 : opacity\n };\n}\nvar EPSILON = 1e-4;\nexport function isAroundZero(transform) {\n return transform < EPSILON && transform > -EPSILON;\n}\nexport function round3(transform) {\n return mathRound(transform * 1e3) / 1e3;\n}\nexport function round4(transform) {\n return mathRound(transform * 1e4) / 1e4;\n}\nexport function round1(transform) {\n return mathRound(transform * 10) / 10;\n}\nexport function getMatrixStr(m) {\n return 'matrix('\n + round3(m[0]) + ','\n + round3(m[1]) + ','\n + round3(m[2]) + ','\n + round3(m[3]) + ','\n + round4(m[4]) + ','\n + round4(m[5])\n + ')';\n}\nexport var TEXT_ALIGN_TO_ANCHOR = {\n left: 'start',\n right: 'end',\n center: 'middle',\n middle: 'middle'\n};\nexport function adjustTextY(y, lineHeight, textBaseline) {\n if (textBaseline === 'top') {\n y += lineHeight / 2;\n }\n else if (textBaseline === 'bottom') {\n y -= lineHeight / 2;\n }\n return y;\n}\nexport function hasShadow(style) {\n return style\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\nexport function getShadowKey(displayable) {\n var style = displayable.style;\n var globalScale = displayable.getGlobalScale();\n return [\n style.shadowColor,\n (style.shadowBlur || 0).toFixed(2),\n (style.shadowOffsetX || 0).toFixed(2),\n (style.shadowOffsetY || 0).toFixed(2),\n globalScale[0],\n globalScale[1]\n ].join(',');\n}\nexport function getClipPathsKey(clipPaths) {\n var key = [];\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n key.push(clipPath.id);\n }\n }\n return key.join(',');\n}\nexport function isImagePattern(val) {\n return val && (!!val.image);\n}\nexport function isSVGPattern(val) {\n return val && (!!val.svgElement);\n}\nexport function isPattern(val) {\n return isImagePattern(val) || isSVGPattern(val);\n}\nexport function isLinearGradient(val) {\n return val.type === 'linear';\n}\nexport function isRadialGradient(val) {\n return val.type === 'radial';\n}\nexport function isGradient(val) {\n return val && (val.type === 'linear'\n || val.type === 'radial');\n}\nexport function getIdURL(id) {\n return \"url(#\" + id + \")\";\n}\nexport function getPathPrecision(el) {\n var scale = el.getGlobalScale();\n var size = Math.max(scale[0], scale[1]);\n return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);\n}\nexport function getSRTTransformString(transform) {\n var x = transform.x || 0;\n var y = transform.y || 0;\n var rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE;\n var scaleX = retrieve2(transform.scaleX, 1);\n var scaleY = retrieve2(transform.scaleY, 1);\n var skewX = transform.skewX || 0;\n var skewY = transform.skewY || 0;\n var res = [];\n if (x || y) {\n res.push(\"translate(\" + x + \"px,\" + y + \"px)\");\n }\n if (rotation) {\n res.push(\"rotate(\" + rotation + \")\");\n }\n if (scaleX !== 1 || scaleY !== 1) {\n res.push(\"scale(\" + scaleX + \",\" + scaleY + \")\");\n }\n if (skewX || skewY) {\n res.push(\"skew(\" + mathRound(skewX * RADIAN_TO_DEGREE) + \"deg, \" + mathRound(skewY * RADIAN_TO_DEGREE) + \"deg)\");\n }\n return res.join(' ');\n}\nexport var encodeBase64 = (function () {\n if (env.hasGlobalWindow && isFunction(window.btoa)) {\n return function (str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n };\n }\n if (typeof Buffer !== 'undefined') {\n return function (str) {\n return Buffer.from(str).toString('base64');\n };\n }\n return function (str) {\n if (process.env.NODE_ENV !== 'production') {\n logError('Base64 isn\\'t natively supported in the current environment.');\n }\n return null;\n };\n})();\n","import Clip from './Clip.js';\nimport * as color from '../tool/color.js';\nimport { eqNaN, extend, isArrayLike, isFunction, isGradientObject, isNumber, isString, keys, logError, map } from '../core/util.js';\nimport easingFuncs from './easing.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nimport { isLinearGradient, isRadialGradient } from '../svg/helper.js';\n;\nvar arraySlice = Array.prototype.slice;\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\nfunction interpolate1DArray(out, p0, p1, percent) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n return out;\n}\nfunction interpolate2DArray(out, p0, p1, percent) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n return out;\n}\nfunction add1DArray(out, p0, p1, sign) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = p0[i] + p1[i] * sign;\n }\n return out;\n}\nfunction add2DArray(out, p0, p1, sign) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = p0[i][j] + p1[i][j] * sign;\n }\n }\n return out;\n}\nfunction fillColorStops(val0, val1) {\n var len0 = val0.length;\n var len1 = val1.length;\n var shorterArr = len0 > len1 ? val1 : val0;\n var shorterLen = Math.min(len0, len1);\n var last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };\n for (var i = shorterLen; i < Math.max(len0, len1); i++) {\n shorterArr.push({\n offset: last.offset,\n color: last.color.slice()\n });\n }\n}\nfunction fillArray(val0, val1, arrDim) {\n var arr0 = val0;\n var arr1 = val1;\n if (!arr0.push || !arr1.push) {\n return;\n }\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n if (arr0Len !== arr1Len) {\n var isPreviousLarger = arr0Len > arr1Len;\n if (isPreviousLarger) {\n arr0.length = arr1Len;\n }\n else {\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n }\n var len2 = arr0[0] && arr0[0].length;\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 }\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}\nexport function cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n if (isArrayLike(value[0])) {\n var ret = [];\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n return ret;\n }\n return arraySlice.call(value);\n }\n return value;\n}\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]) || 0;\n rgba[1] = Math.floor(rgba[1]) || 0;\n rgba[2] = Math.floor(rgba[2]) || 0;\n rgba[3] = rgba[3] == null ? 1 : rgba[3];\n return 'rgba(' + rgba.join(',') + ')';\n}\nfunction guessArrayDim(value) {\n return isArrayLike(value && value[0]) ? 2 : 1;\n}\nvar VALUE_TYPE_NUMBER = 0;\nvar VALUE_TYPE_1D_ARRAY = 1;\nvar VALUE_TYPE_2D_ARRAY = 2;\nvar VALUE_TYPE_COLOR = 3;\nvar VALUE_TYPE_LINEAR_GRADIENT = 4;\nvar VALUE_TYPE_RADIAL_GRADIENT = 5;\nvar VALUE_TYPE_UNKOWN = 6;\nfunction isGradientValueType(valType) {\n return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;\n}\nfunction isArrayValueType(valType) {\n return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;\n}\nvar tmpRgba = [0, 0, 0, 0];\nvar Track = (function () {\n function Track(propName) {\n this.keyframes = [];\n this.discrete = false;\n this._invalid = false;\n this._needsSort = false;\n this._lastFr = 0;\n this._lastFrP = 0;\n this.propName = propName;\n }\n Track.prototype.isFinished = function () {\n return this._finished;\n };\n Track.prototype.setFinished = function () {\n this._finished = true;\n if (this._additiveTrack) {\n this._additiveTrack.setFinished();\n }\n };\n Track.prototype.needsAnimate = function () {\n return this.keyframes.length >= 1;\n };\n Track.prototype.getAdditiveTrack = function () {\n return this._additiveTrack;\n };\n Track.prototype.addKeyframe = function (time, rawValue, easing) {\n this._needsSort = true;\n var keyframes = this.keyframes;\n var len = keyframes.length;\n var discrete = false;\n var valType = VALUE_TYPE_UNKOWN;\n var value = rawValue;\n if (isArrayLike(rawValue)) {\n var arrayDim = guessArrayDim(rawValue);\n valType = arrayDim;\n if (arrayDim === 1 && !isNumber(rawValue[0])\n || arrayDim === 2 && !isNumber(rawValue[0][0])) {\n discrete = true;\n }\n }\n else {\n if (isNumber(rawValue) && !eqNaN(rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else if (isString(rawValue)) {\n if (!isNaN(+rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else {\n var colorArray = color.parse(rawValue);\n if (colorArray) {\n value = colorArray;\n valType = VALUE_TYPE_COLOR;\n }\n }\n }\n else if (isGradientObject(rawValue)) {\n var parsedGradient = extend({}, value);\n parsedGradient.colorStops = map(rawValue.colorStops, function (colorStop) { return ({\n offset: colorStop.offset,\n color: color.parse(colorStop.color)\n }); });\n if (isLinearGradient(rawValue)) {\n valType = VALUE_TYPE_LINEAR_GRADIENT;\n }\n else if (isRadialGradient(rawValue)) {\n valType = VALUE_TYPE_RADIAL_GRADIENT;\n }\n value = parsedGradient;\n }\n }\n if (len === 0) {\n this.valType = valType;\n }\n else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {\n discrete = true;\n }\n this.discrete = this.discrete || discrete;\n var kf = {\n time: time,\n value: value,\n rawValue: rawValue,\n percent: 0\n };\n if (easing) {\n kf.easing = easing;\n kf.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n }\n keyframes.push(kf);\n return kf;\n };\n Track.prototype.prepare = function (maxTime, additiveTrack) {\n var kfs = this.keyframes;\n if (this._needsSort) {\n kfs.sort(function (a, b) {\n return a.time - b.time;\n });\n }\n var valType = this.valType;\n var kfsLen = kfs.length;\n var lastKf = kfs[kfsLen - 1];\n var isDiscrete = this.discrete;\n var isArr = isArrayValueType(valType);\n var isGradient = isGradientValueType(valType);\n for (var i = 0; i < kfsLen; i++) {\n var kf = kfs[i];\n var value = kf.value;\n var lastValue = lastKf.value;\n kf.percent = kf.time / maxTime;\n if (!isDiscrete) {\n if (isArr && i !== kfsLen - 1) {\n fillArray(value, lastValue, valType);\n }\n else if (isGradient) {\n fillColorStops(value.colorStops, lastValue.colorStops);\n }\n }\n }\n if (!isDiscrete\n && valType !== VALUE_TYPE_RADIAL_GRADIENT\n && additiveTrack\n && this.needsAnimate()\n && additiveTrack.needsAnimate()\n && valType === additiveTrack.valType\n && !additiveTrack._finished) {\n this._additiveTrack = additiveTrack;\n var startValue = kfs[0].value;\n for (var i = 0; i < kfsLen; i++) {\n if (valType === VALUE_TYPE_NUMBER) {\n kfs[i].additiveValue = kfs[i].value - startValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n kfs[i].additiveValue =\n add1DArray([], kfs[i].value, startValue, -1);\n }\n else if (isArrayValueType(valType)) {\n kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY\n ? add1DArray([], kfs[i].value, startValue, -1)\n : add2DArray([], kfs[i].value, startValue, -1);\n }\n }\n }\n };\n Track.prototype.step = function (target, percent) {\n if (this._finished) {\n return;\n }\n if (this._additiveTrack && this._additiveTrack._finished) {\n this._additiveTrack = null;\n }\n var isAdditive = this._additiveTrack != null;\n var valueKey = isAdditive ? 'additiveValue' : 'value';\n var valType = this.valType;\n var keyframes = this.keyframes;\n var kfsNum = keyframes.length;\n var propName = this.propName;\n var isValueColor = valType === VALUE_TYPE_COLOR;\n var frameIdx;\n var lastFrame = this._lastFr;\n var mathMin = Math.min;\n var frame;\n var nextFrame;\n if (kfsNum === 1) {\n frame = nextFrame = keyframes[0];\n }\n else {\n if (percent < 0) {\n frameIdx = 0;\n }\n else if (percent < this._lastFrP) {\n var start = mathMin(lastFrame + 1, kfsNum - 1);\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n if (keyframes[frameIdx].percent <= percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx, kfsNum - 2);\n }\n else {\n for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {\n if (keyframes[frameIdx].percent > percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx - 1, kfsNum - 2);\n }\n nextFrame = keyframes[frameIdx + 1];\n frame = keyframes[frameIdx];\n }\n if (!(frame && nextFrame)) {\n return;\n }\n this._lastFr = frameIdx;\n this._lastFrP = percent;\n var interval = (nextFrame.percent - frame.percent);\n var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);\n if (nextFrame.easingFunc) {\n w = nextFrame.easingFunc(w);\n }\n var targetArr = isAdditive ? this._additiveValue\n : (isValueColor ? tmpRgba : target[propName]);\n if ((isArrayValueType(valType) || isValueColor) && !targetArr) {\n targetArr = this._additiveValue = [];\n }\n if (this.discrete) {\n target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;\n }\n else if (isArrayValueType(valType)) {\n valType === VALUE_TYPE_1D_ARRAY\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n }\n else if (isGradientValueType(valType)) {\n var val = frame[valueKey];\n var nextVal_1 = nextFrame[valueKey];\n var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;\n target[propName] = {\n type: isLinearGradient_1 ? 'linear' : 'radial',\n x: interpolateNumber(val.x, nextVal_1.x, w),\n y: interpolateNumber(val.y, nextVal_1.y, w),\n colorStops: map(val.colorStops, function (colorStop, idx) {\n var nextColorStop = nextVal_1.colorStops[idx];\n return {\n offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w),\n color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w))\n };\n }),\n global: nextVal_1.global\n };\n if (isLinearGradient_1) {\n target[propName].x2 = interpolateNumber(val.x2, nextVal_1.x2, w);\n target[propName].y2 = interpolateNumber(val.y2, nextVal_1.y2, w);\n }\n else {\n target[propName].r = interpolateNumber(val.r, nextVal_1.r, w);\n }\n }\n else if (isValueColor) {\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n if (!isAdditive) {\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n var value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n if (isAdditive) {\n this._addToTarget(target);\n }\n };\n Track.prototype._addToTarget = function (target) {\n var valType = this.valType;\n var propName = this.propName;\n var additiveValue = this._additiveValue;\n if (valType === VALUE_TYPE_NUMBER) {\n target[propName] = target[propName] + additiveValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n color.parse(target[propName], tmpRgba);\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\n target[propName] = rgba2String(tmpRgba);\n }\n else if (valType === VALUE_TYPE_1D_ARRAY) {\n add1DArray(target[propName], target[propName], additiveValue, 1);\n }\n else if (valType === VALUE_TYPE_2D_ARRAY) {\n add2DArray(target[propName], target[propName], additiveValue, 1);\n }\n };\n return Track;\n}());\nvar Animator = (function () {\n function Animator(target, loop, allowDiscreteAnimation, additiveTo) {\n this._tracks = {};\n this._trackKeys = [];\n this._maxTime = 0;\n this._started = 0;\n this._clip = null;\n this._target = target;\n this._loop = loop;\n if (loop && additiveTo) {\n logError('Can\\' use additive animation on looped animation.');\n return;\n }\n this._additiveAnimators = additiveTo;\n this._allowDiscrete = allowDiscreteAnimation;\n }\n Animator.prototype.getMaxTime = function () {\n return this._maxTime;\n };\n Animator.prototype.getDelay = function () {\n return this._delay;\n };\n Animator.prototype.getLoop = function () {\n return this._loop;\n };\n Animator.prototype.getTarget = function () {\n return this._target;\n };\n Animator.prototype.changeTarget = function (target) {\n this._target = target;\n };\n Animator.prototype.when = function (time, props, easing) {\n return this.whenWithKeys(time, props, keys(props), easing);\n };\n Animator.prototype.whenWithKeys = function (time, props, propNames, easing) {\n var tracks = this._tracks;\n for (var i = 0; i < propNames.length; i++) {\n var propName = propNames[i];\n var track = tracks[propName];\n if (!track) {\n track = tracks[propName] = new Track(propName);\n var initialValue = void 0;\n var additiveTrack = this._getAdditiveTrack(propName);\n if (additiveTrack) {\n var addtiveTrackKfs = additiveTrack.keyframes;\n var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];\n initialValue = lastFinalKf && lastFinalKf.value;\n if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {\n initialValue = rgba2String(initialValue);\n }\n }\n else {\n initialValue = this._target[propName];\n }\n if (initialValue == null) {\n continue;\n }\n if (time > 0) {\n track.addKeyframe(0, cloneValue(initialValue), easing);\n }\n this._trackKeys.push(propName);\n }\n track.addKeyframe(time, cloneValue(props[propName]), easing);\n }\n this._maxTime = Math.max(this._maxTime, time);\n return this;\n };\n Animator.prototype.pause = function () {\n this._clip.pause();\n this._paused = true;\n };\n Animator.prototype.resume = function () {\n this._clip.resume();\n this._paused = false;\n };\n Animator.prototype.isPaused = function () {\n return !!this._paused;\n };\n Animator.prototype.duration = function (duration) {\n this._maxTime = duration;\n this._force = true;\n return this;\n };\n Animator.prototype._doneCallback = function () {\n this._setTracksFinished();\n this._clip = null;\n var doneList = this._doneCbs;\n if (doneList) {\n var len = doneList.length;\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n }\n };\n Animator.prototype._abortedCallback = function () {\n this._setTracksFinished();\n var animation = this.animation;\n var abortedList = this._abortedCbs;\n if (animation) {\n animation.removeClip(this._clip);\n }\n this._clip = null;\n if (abortedList) {\n for (var i = 0; i < abortedList.length; i++) {\n abortedList[i].call(this);\n }\n }\n };\n Animator.prototype._setTracksFinished = function () {\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < tracksKeys.length; i++) {\n tracks[tracksKeys[i]].setFinished();\n }\n };\n Animator.prototype._getAdditiveTrack = function (trackName) {\n var additiveTrack;\n var additiveAnimators = this._additiveAnimators;\n if (additiveAnimators) {\n for (var i = 0; i < additiveAnimators.length; i++) {\n var track = additiveAnimators[i].getTrack(trackName);\n if (track) {\n additiveTrack = track;\n }\n }\n }\n return additiveTrack;\n };\n Animator.prototype.start = function (easing) {\n if (this._started > 0) {\n return;\n }\n this._started = 1;\n var self = this;\n var tracks = [];\n var maxTime = this._maxTime || 0;\n for (var i = 0; i < this._trackKeys.length; i++) {\n var propName = this._trackKeys[i];\n var track = this._tracks[propName];\n var additiveTrack = this._getAdditiveTrack(propName);\n var kfs = track.keyframes;\n var kfsNum = kfs.length;\n track.prepare(maxTime, additiveTrack);\n if (track.needsAnimate()) {\n if (!this._allowDiscrete && track.discrete) {\n var lastKf = kfs[kfsNum - 1];\n if (lastKf) {\n self._target[track.propName] = lastKf.rawValue;\n }\n track.setFinished();\n }\n else {\n tracks.push(track);\n }\n }\n }\n if (tracks.length || this._force) {\n var clip = new Clip({\n life: maxTime,\n loop: this._loop,\n delay: this._delay || 0,\n onframe: function (percent) {\n self._started = 2;\n var additiveAnimators = self._additiveAnimators;\n if (additiveAnimators) {\n var stillHasAdditiveAnimator = false;\n for (var i = 0; i < additiveAnimators.length; i++) {\n if (additiveAnimators[i]._clip) {\n stillHasAdditiveAnimator = true;\n break;\n }\n }\n if (!stillHasAdditiveAnimator) {\n self._additiveAnimators = null;\n }\n }\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].step(self._target, percent);\n }\n var onframeList = self._onframeCbs;\n if (onframeList) {\n for (var i = 0; i < onframeList.length; i++) {\n onframeList[i](self._target, percent);\n }\n }\n },\n ondestroy: function () {\n self._doneCallback();\n }\n });\n this._clip = clip;\n if (this.animation) {\n this.animation.addClip(clip);\n }\n if (easing) {\n clip.setEasing(easing);\n }\n }\n else {\n this._doneCallback();\n }\n return this;\n };\n Animator.prototype.stop = function (forwardToLast) {\n if (!this._clip) {\n return;\n }\n var clip = this._clip;\n if (forwardToLast) {\n clip.onframe(1);\n }\n this._abortedCallback();\n };\n Animator.prototype.delay = function (time) {\n this._delay = time;\n return this;\n };\n Animator.prototype.during = function (cb) {\n if (cb) {\n if (!this._onframeCbs) {\n this._onframeCbs = [];\n }\n this._onframeCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.done = function (cb) {\n if (cb) {\n if (!this._doneCbs) {\n this._doneCbs = [];\n }\n this._doneCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.aborted = function (cb) {\n if (cb) {\n if (!this._abortedCbs) {\n this._abortedCbs = [];\n }\n this._abortedCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.getClip = function () {\n return this._clip;\n };\n Animator.prototype.getTrack = function (propName) {\n return this._tracks[propName];\n };\n Animator.prototype.getTracks = function () {\n var _this = this;\n return map(this._trackKeys, function (key) { return _this._tracks[key]; });\n };\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\n if (!propNames.length || !this._clip) {\n return true;\n }\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < propNames.length; i++) {\n var track = tracks[propNames[i]];\n if (track && !track.isFinished()) {\n if (forwardToLast) {\n track.step(this._target, 1);\n }\n else if (this._started === 1) {\n track.step(this._target, 0);\n }\n track.setFinished();\n }\n }\n var allAborted = true;\n for (var i = 0; i < tracksKeys.length; i++) {\n if (!tracks[tracksKeys[i]].isFinished()) {\n allAborted = false;\n break;\n }\n }\n if (allAborted) {\n this._abortedCallback();\n }\n return allAborted;\n };\n Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) {\n if (!target) {\n return;\n }\n trackKeys = trackKeys || this._trackKeys;\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track || track.isFinished()) {\n continue;\n }\n var kfs = track.keyframes;\n var kf = kfs[firstOrLast ? 0 : kfs.length - 1];\n if (kf) {\n target[propName] = cloneValue(kf.rawValue);\n }\n }\n };\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\n trackKeys = trackKeys || keys(finalProps);\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track) {\n continue;\n }\n var kfs = track.keyframes;\n if (kfs.length > 1) {\n var lastKf = kfs.pop();\n track.addKeyframe(lastKf.time, finalProps[propName]);\n track.prepare(this._maxTime, track.getAdditiveTrack());\n }\n }\n };\n return Animator;\n}());\nexport default Animator;\n","import { __extends } from \"tslib\";\nimport Eventful from '../core/Eventful.js';\nimport requestAnimationFrame from './requestAnimationFrame.js';\nimport Animator from './Animator.js';\nexport function getTime() {\n return new Date().getTime();\n}\nvar Animation = (function (_super) {\n __extends(Animation, _super);\n function Animation(opts) {\n var _this = _super.call(this) || this;\n _this._running = false;\n _this._time = 0;\n _this._pausedTime = 0;\n _this._pauseStart = 0;\n _this._paused = false;\n opts = opts || {};\n _this.stage = opts.stage || {};\n return _this;\n }\n Animation.prototype.addClip = function (clip) {\n if (clip.animation) {\n this.removeClip(clip);\n }\n if (!this._head) {\n this._head = this._tail = clip;\n }\n else {\n this._tail.next = clip;\n clip.prev = this._tail;\n clip.next = null;\n this._tail = clip;\n }\n clip.animation = this;\n };\n Animation.prototype.addAnimator = function (animator) {\n animator.animation = this;\n var clip = animator.getClip();\n if (clip) {\n this.addClip(clip);\n }\n };\n Animation.prototype.removeClip = function (clip) {\n if (!clip.animation) {\n return;\n }\n var prev = clip.prev;\n var next = clip.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this._head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this._tail = prev;\n }\n clip.next = clip.prev = clip.animation = null;\n };\n Animation.prototype.removeAnimator = function (animator) {\n var clip = animator.getClip();\n if (clip) {\n this.removeClip(clip);\n }\n animator.animation = null;\n };\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\n var time = getTime() - this._pausedTime;\n var delta = time - this._time;\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n var finished = clip.step(time, delta);\n if (finished) {\n clip.ondestroy();\n this.removeClip(clip);\n clip = nextClip;\n }\n else {\n clip = nextClip;\n }\n }\n this._time = time;\n if (!notTriggerFrameAndStageUpdate) {\n this.trigger('frame', delta);\n this.stage.update && this.stage.update();\n }\n };\n Animation.prototype._startLoop = function () {\n var self = this;\n this._running = true;\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self.update();\n }\n }\n requestAnimationFrame(step);\n };\n Animation.prototype.start = function () {\n if (this._running) {\n return;\n }\n this._time = getTime();\n this._pausedTime = 0;\n this._startLoop();\n };\n Animation.prototype.stop = function () {\n this._running = false;\n };\n Animation.prototype.pause = function () {\n if (!this._paused) {\n this._pauseStart = getTime();\n this._paused = true;\n }\n };\n Animation.prototype.resume = function () {\n if (this._paused) {\n this._pausedTime += getTime() - this._pauseStart;\n this._paused = false;\n }\n };\n Animation.prototype.clear = function () {\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n clip.prev = clip.next = clip.animation = null;\n clip = nextClip;\n }\n this._head = this._tail = null;\n };\n Animation.prototype.isFinished = function () {\n return this._head == null;\n };\n Animation.prototype.animate = function (target, options) {\n options = options || {};\n this.start();\n var animator = new Animator(target, options.loop);\n this.addAnimator(animator);\n return animator;\n };\n return Animation;\n}(Eventful));\nexport default Animation;\n","import { __extends } from \"tslib\";\nimport { addEventListener, removeEventListener, normalizeEvent, getNativeEvent } from '../core/event.js';\nimport * as zrUtil from '../core/util.js';\nimport Eventful from '../core/Eventful.js';\nimport env from '../core/env.js';\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\nvar localNativeListenerNames = (function () {\n var mouseHandlerNames = [\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n ];\n var touchHandlerNames = [\n 'touchstart', 'touchend', 'touchmove'\n ];\n var pointerEventNameMap = {\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n})();\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\nvar wheelEventSupported = false;\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n}\nfunction setTouchTimer(scope) {\n scope.touching = true;\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n}\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n}\nfunction normalizeGlobalEvent(instance, event) {\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n while (elTmp && elTmp.nodeType !== 9\n && !(isLocal = elTmp.domBelongToZr\n || (elTmp !== el && elTmp === instance.painterRoot))) {\n elTmp = elTmp.parentNode;\n }\n return isLocal;\n}\nvar FakeGlobalEvent = (function () {\n function FakeGlobalEvent(instance, event) {\n this.stopPropagation = zrUtil.noop;\n this.stopImmediatePropagation = zrUtil.noop;\n this.preventDefault = zrUtil.noop;\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType;\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n }\n return FakeGlobalEvent;\n}());\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this.__mayPointerCapture;\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n this.__togglePointerCapture(true);\n }\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event);\n var element = event.toElement || event.relatedTarget;\n if (!isLocalEl(this, element)) {\n if (this.__pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n }\n this.trigger('mouseout', event);\n }\n },\n wheel: function (event) {\n wheelEventSupported = true;\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n mousewheel: function (event) {\n if (wheelEventSupported) {\n return;\n }\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n touchstart: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.__lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start');\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change');\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event);\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event);\n },\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\nvar globalDOMHandlers = {\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this.__pointerCapturing;\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n if (env.pointerEventsSupported) {\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n });\n });\n }\n else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n });\n }\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n if (!scope.touching) {\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\nfunction mountGlobalDOMEventListeners(instance, scope) {\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n }\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event);\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\n }\n}\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n scope.mounted = {};\n}\nvar DOMHandlerScope = (function () {\n function DOMHandlerScope(domTarget, domHandlers) {\n this.mounted = {};\n this.listenerOpts = {};\n this.touching = false;\n this.domTarget = domTarget;\n this.domHandlers = domHandlers;\n }\n return DOMHandlerScope;\n}());\nvar HandlerDomProxy = (function (_super) {\n __extends(HandlerDomProxy, _super);\n function HandlerDomProxy(dom, painterRoot) {\n var _this = _super.call(this) || this;\n _this.__pointerCapturing = false;\n _this.dom = dom;\n _this.painterRoot = painterRoot;\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n if (globalEventSupported) {\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\n return _this;\n }\n HandlerDomProxy.prototype.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n };\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n };\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\n this.__mayPointerCapture = null;\n if (globalEventSupported\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\n this.__pointerCapturing = isPointerCapturing;\n var globalHandlerScope = this._globalHandlerScope;\n isPointerCapturing\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n : unmountDOMEventListeners(globalHandlerScope);\n }\n };\n return HandlerDomProxy;\n}(Eventful));\nexport default HandlerDomProxy;\n","import env from './core/env.js';\nvar dpr = 1;\nif (env.hasGlobalWindow) {\n dpr = Math.max(window.devicePixelRatio\n || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI)\n || 1, 1);\n}\nexport var debugMode = 0;\nexport var devicePixelRatio = dpr;\nexport var DARK_MODE_THRESHOLD = 0.4;\nexport var DARK_LABEL_COLOR = '#333';\nexport var LIGHT_LABEL_COLOR = '#ccc';\nexport var LIGHTER_LABEL_COLOR = '#eee';\n","import * as matrix from './matrix.js';\nimport * as vector from './vector.js';\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nvar scaleTmp = [];\nvar tmpTransform = [];\nvar originTransform = matrix.create();\nvar abs = Math.abs;\nvar Transformable = (function () {\n function Transformable() {\n }\n Transformable.prototype.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n };\n Transformable.prototype.setPosition = function (arr) {\n this.x = arr[0];\n this.y = arr[1];\n };\n Transformable.prototype.setScale = function (arr) {\n this.scaleX = arr[0];\n this.scaleY = arr[1];\n };\n Transformable.prototype.setSkew = function (arr) {\n this.skewX = arr[0];\n this.skewY = arr[1];\n };\n Transformable.prototype.setOrigin = function (arr) {\n this.originX = arr[0];\n this.originY = arr[1];\n };\n Transformable.prototype.needLocalTransform = function () {\n return isNotAroundZero(this.rotation)\n || isNotAroundZero(this.x)\n || isNotAroundZero(this.y)\n || isNotAroundZero(this.scaleX - 1)\n || isNotAroundZero(this.scaleY - 1)\n || isNotAroundZero(this.skewX)\n || isNotAroundZero(this.skewY);\n };\n Transformable.prototype.updateTransform = function () {\n var parentTransform = this.parent && this.parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n if (!(needLocalTransform || parentTransform)) {\n if (m) {\n mIdentity(m);\n this.invTransform = null;\n }\n return;\n }\n m = m || matrix.create();\n if (needLocalTransform) {\n this.getLocalTransform(m);\n }\n else {\n mIdentity(m);\n }\n if (parentTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parentTransform, m);\n }\n else {\n matrix.copy(m, parentTransform);\n }\n }\n this.transform = m;\n this._resolveGlobalScaleRatio(m);\n };\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\n var globalScaleRatio = this.globalScaleRatio;\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 this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n };\n Transformable.prototype.getComputedTransform = function () {\n var transformNode = this;\n var ancestors = [];\n while (transformNode) {\n ancestors.push(transformNode);\n transformNode = transformNode.parent;\n }\n while (transformNode = ancestors.pop()) {\n transformNode.updateTransform();\n }\n return this.transform;\n };\n Transformable.prototype.setLocalTransform = function (m) {\n if (!m) {\n return;\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 rotation = Math.atan2(m[1], m[0]);\n var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);\n sy = Math.sqrt(sy) * Math.cos(shearX);\n sx = Math.sqrt(sx);\n this.skewX = shearX;\n this.skewY = 0;\n this.rotation = -rotation;\n this.x = +m[4];\n this.y = +m[5];\n this.scaleX = sx;\n this.scaleY = sy;\n this.originX = 0;\n this.originY = 0;\n };\n Transformable.prototype.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n var parent = this.parent;\n var m = this.transform;\n if (parent && parent.transform) {\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n var ox = this.originX;\n var oy = this.originY;\n if (ox || oy) {\n originTransform[4] = ox;\n originTransform[5] = oy;\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= ox;\n tmpTransform[5] -= oy;\n m = tmpTransform;\n }\n this.setLocalTransform(m);\n };\n Transformable.prototype.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\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 if (m[0] < 0) {\n out[0] = -out[0];\n }\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n return out;\n };\n Transformable.prototype.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n return v2;\n };\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n return v2;\n };\n Transformable.prototype.getLineScale = function () {\n var m = this.transform;\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n : 1;\n };\n Transformable.prototype.copyTransform = function (source) {\n copyTransform(this, source);\n };\n Transformable.getLocalTransform = function (target, m) {\n m = m || [];\n var ox = target.originX || 0;\n var oy = target.originY || 0;\n var sx = target.scaleX;\n var sy = target.scaleY;\n var ax = target.anchorX;\n var ay = target.anchorY;\n var rotation = target.rotation || 0;\n var x = target.x;\n var y = target.y;\n var skewX = target.skewX ? Math.tan(target.skewX) : 0;\n var skewY = target.skewY ? Math.tan(-target.skewY) : 0;\n if (ox || oy || ax || ay) {\n var dx = ox + ax;\n var dy = oy + ay;\n m[4] = -dx * sx - skewX * dy * sy;\n m[5] = -dy * sy - skewY * dx * sx;\n }\n else {\n m[4] = m[5] = 0;\n }\n m[0] = sx;\n m[3] = sy;\n m[1] = skewY * sx;\n m[2] = skewX * sy;\n rotation && matrix.rotate(m, m, rotation);\n m[4] += ox + x;\n m[5] += oy + y;\n return m;\n };\n Transformable.initDefaultProps = (function () {\n var proto = Transformable.prototype;\n proto.scaleX =\n proto.scaleY =\n proto.globalScaleRatio = 1;\n proto.x =\n proto.y =\n proto.originX =\n proto.originY =\n proto.skewX =\n proto.skewY =\n proto.rotation =\n proto.anchorX =\n proto.anchorY = 0;\n })();\n return Transformable;\n}());\n;\nexport var TRANSFORMABLE_PROPS = [\n 'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'\n];\nexport function copyTransform(target, source) {\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var propName = TRANSFORMABLE_PROPS[i];\n target[propName] = source[propName];\n }\n}\nexport default Transformable;\n","import BoundingRect from '../core/BoundingRect.js';\nimport LRU from '../core/LRU.js';\nimport { DEFAULT_FONT, platformApi } from '../core/platform.js';\nvar textWidthCache = {};\nexport function getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var cacheOfFont = textWidthCache[font];\n if (!cacheOfFont) {\n cacheOfFont = textWidthCache[font] = new LRU(500);\n }\n var width = cacheOfFont.get(text);\n if (width == null) {\n width = platformApi.measureText(text, font).width;\n cacheOfFont.put(text, width);\n }\n return width;\n}\nexport function innerGetBoundingRect(text, font, textAlign, textBaseline) {\n var width = getWidth(text, font);\n var height = getLineHeight(font);\n var x = adjustTextX(0, width, textAlign);\n var y = adjustTextY(0, height, textBaseline);\n var rect = new BoundingRect(x, y, width, height);\n return rect;\n}\nexport function getBoundingRect(text, font, textAlign, textBaseline) {\n var textLines = ((text || '') + '').split('\\n');\n var len = textLines.length;\n if (len === 1) {\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n }\n else {\n var uniondRect = new BoundingRect(0, 0, 0, 0);\n for (var i = 0; i < textLines.length; i++) {\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n }\n return uniondRect;\n }\n}\nexport function adjustTextX(x, width, textAlign) {\n if (textAlign === 'right') {\n x -= width;\n }\n else if (textAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nexport function adjustTextY(y, height, verticalAlign) {\n if (verticalAlign === 'middle') {\n y -= height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y -= height;\n }\n return y;\n}\nexport function getLineHeight(font) {\n return getWidth('国', font);\n}\nexport function measureText(text, font) {\n return platformApi.measureText(text, font);\n}\nexport function parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n return parseFloat(value);\n }\n return value;\n}\nexport function calculateTextPosition(out, opts, rect) {\n var textPosition = opts.position || 'inside';\n var distance = opts.distance != null ? opts.distance : 5;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var x = rect.x;\n var y = rect.y;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n if (textPosition instanceof Array) {\n x += parsePercent(textPosition[0], rect.width);\n y += parsePercent(textPosition[1], rect.height);\n textAlign = null;\n textVerticalAlign = null;\n }\n else {\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n }\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n}\n","import Transformable, { TRANSFORMABLE_PROPS } from './core/Transformable.js';\nimport Animator, { cloneValue } from './animation/Animator.js';\nimport BoundingRect from './core/BoundingRect.js';\nimport Eventful from './core/Eventful.js';\nimport { calculateTextPosition, parsePercent } from './contain/text.js';\nimport { guid, isObject, keys, extend, indexOf, logError, mixin, isArrayLike, isTypedArray, isGradientObject, filter, reduce } from './core/util.js';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config.js';\nimport { parse, stringify } from './tool/color.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nexport var PRESERVED_NORMAL_STATE = '__zr_normal__';\nvar PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(['ignore']);\nvar DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = true;\n return obj;\n}, { ignore: false });\nvar tmpTextPosCalcRes = {};\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\nvar Element = (function () {\n function Element(props) {\n this.id = guid();\n this.animators = [];\n this.currentStates = [];\n this.states = {};\n this._init(props);\n }\n Element.prototype._init = function (props) {\n this.attr(props);\n };\n Element.prototype.drift = function (dx, dy, e) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n case 'vertical':\n dx = 0;\n break;\n }\n var m = this.transform;\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.markRedraw();\n };\n Element.prototype.beforeUpdate = function () { };\n Element.prototype.afterUpdate = function () { };\n Element.prototype.update = function () {\n this.updateTransform();\n if (this.__dirty) {\n this.updateInnerText();\n }\n };\n Element.prototype.updateInnerText = function (forceUpdate) {\n var textEl = this._textContent;\n if (textEl && (!textEl.ignore || forceUpdate)) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n var textConfig = this.textConfig;\n var isLocal = textConfig.local;\n var innerTransformable = textEl.innerTransformable;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var textStyleChanged = false;\n innerTransformable.parent = isLocal ? this : null;\n var innerOrigin = false;\n innerTransformable.copyTransform(textEl);\n if (textConfig.position != null) {\n var layoutRect = tmpBoundingRect;\n if (textConfig.layoutRect) {\n layoutRect.copy(textConfig.layoutRect);\n }\n else {\n layoutRect.copy(this.getBoundingRect());\n }\n if (!isLocal) {\n layoutRect.applyTransform(this.transform);\n }\n if (this.calculateTextPosition) {\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n else {\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n innerTransformable.x = tmpTextPosCalcRes.x;\n innerTransformable.y = tmpTextPosCalcRes.y;\n textAlign = tmpTextPosCalcRes.align;\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n var textOrigin = textConfig.origin;\n if (textOrigin && textConfig.rotation != null) {\n var relOriginX = void 0;\n var relOriginY = void 0;\n if (textOrigin === 'center') {\n relOriginX = layoutRect.width * 0.5;\n relOriginY = layoutRect.height * 0.5;\n }\n else {\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n }\n innerOrigin = true;\n innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n }\n }\n if (textConfig.rotation != null) {\n innerTransformable.rotation = textConfig.rotation;\n }\n var textOffset = textConfig.offset;\n if (textOffset) {\n innerTransformable.x += textOffset[0];\n innerTransformable.y += textOffset[1];\n if (!innerOrigin) {\n innerTransformable.originX = -textOffset[0];\n innerTransformable.originY = -textOffset[1];\n }\n }\n var isInside = textConfig.inside == null\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n : textConfig.inside;\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n var textFill = void 0;\n var textStroke = void 0;\n var autoStroke = void 0;\n if (isInside && this.canBeInsideText()) {\n textFill = textConfig.insideFill;\n textStroke = textConfig.insideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getInsideTextFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getInsideTextStroke(textFill);\n autoStroke = true;\n }\n }\n else {\n textFill = textConfig.outsideFill;\n textStroke = textConfig.outsideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getOutsideFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getOutsideStroke(textFill);\n autoStroke = true;\n }\n }\n textFill = textFill || '#000';\n if (textFill !== innerTextDefaultStyle.fill\n || textStroke !== innerTextDefaultStyle.stroke\n || autoStroke !== innerTextDefaultStyle.autoStroke\n || textAlign !== innerTextDefaultStyle.align\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\n textStyleChanged = true;\n innerTextDefaultStyle.fill = textFill;\n innerTextDefaultStyle.stroke = textStroke;\n innerTextDefaultStyle.autoStroke = autoStroke;\n innerTextDefaultStyle.align = textAlign;\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\n }\n textEl.__dirty |= REDRAW_BIT;\n if (textStyleChanged) {\n textEl.dirtyStyle(true);\n }\n }\n };\n Element.prototype.canBeInsideText = function () {\n return true;\n };\n Element.prototype.getInsideTextFill = function () {\n return '#fff';\n };\n Element.prototype.getInsideTextStroke = function (textFill) {\n return '#000';\n };\n Element.prototype.getOutsideFill = function () {\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n };\n Element.prototype.getOutsideStroke = function (textFill) {\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\n if (!colorArr) {\n colorArr = [255, 255, 255, 1];\n }\n var alpha = colorArr[3];\n var isDark = this.__zr.isDarkMode();\n for (var i = 0; i < 3; i++) {\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n }\n colorArr[3] = 1;\n return stringify(colorArr, 'rgba');\n };\n Element.prototype.traverse = function (cb, context) { };\n Element.prototype.attrKV = function (key, value) {\n if (key === 'textConfig') {\n this.setTextConfig(value);\n }\n else if (key === 'textContent') {\n this.setTextContent(value);\n }\n else if (key === 'clipPath') {\n this.setClipPath(value);\n }\n else if (key === 'extra') {\n this.extra = this.extra || {};\n extend(this.extra, value);\n }\n else {\n this[key] = value;\n }\n };\n Element.prototype.hide = function () {\n this.ignore = true;\n this.markRedraw();\n };\n Element.prototype.show = function () {\n this.ignore = false;\n this.markRedraw();\n };\n Element.prototype.attr = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.attrKV(keyOrObj, value);\n }\n else if (isObject(keyOrObj)) {\n var obj = keyOrObj;\n var keysArr = keys(obj);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n this.attrKV(key, keyOrObj[key]);\n }\n }\n this.markRedraw();\n return this;\n };\n Element.prototype.saveCurrentToNormalState = function (toState) {\n this._innerSaveToNormal(toState);\n var normalState = this._normalState;\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var fromStateTransition = animator.__fromStateTransition;\n if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n continue;\n }\n var targetName = animator.targetName;\n var target = targetName\n ? normalState[targetName] : normalState;\n animator.saveTo(target);\n }\n };\n Element.prototype._innerSaveToNormal = function (toState) {\n var normalState = this._normalState;\n if (!normalState) {\n normalState = this._normalState = {};\n }\n if (toState.textConfig && !normalState.textConfig) {\n normalState.textConfig = this.textConfig;\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\n for (var i = 0; i < primaryKeys.length; i++) {\n var key = primaryKeys[i];\n if (toState[key] != null && !(key in normalState)) {\n normalState[key] = this[key];\n }\n }\n };\n Element.prototype.hasState = function () {\n return this.currentStates.length > 0;\n };\n Element.prototype.getState = function (name) {\n return this.states[name];\n };\n Element.prototype.ensureState = function (name) {\n var states = this.states;\n if (!states[name]) {\n states[name] = {};\n }\n return states[name];\n };\n Element.prototype.clearStates = function (noAnimation) {\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n };\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) {\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\n var hasStates = this.hasState();\n if (!hasStates && toNormalState) {\n return;\n }\n var currentStates = this.currentStates;\n var animationCfg = this.stateTransition;\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n return;\n }\n var state;\n if (this.stateProxy && !toNormalState) {\n state = this.stateProxy(stateName);\n }\n if (!state) {\n state = (this.states && this.states[stateName]);\n }\n if (!state && !toNormalState) {\n logError(\"State \" + stateName + \" not exists.\");\n return;\n }\n if (!toNormalState) {\n this.saveCurrentToNormalState(state);\n }\n var useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (toNormalState) {\n this.currentStates = [];\n this._normalState = {};\n }\n else {\n if (!keepCurrentStates) {\n this.currentStates = [stateName];\n }\n else {\n this.currentStates.push(stateName);\n }\n }\n this._updateAnimationTargets();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n return state;\n };\n Element.prototype.useStates = function (states, noAnimation, forceUseHoverLayer) {\n if (!states.length) {\n this.clearStates();\n }\n else {\n var stateObjects = [];\n var currentStates = this.currentStates;\n var len = states.length;\n var notChange = len === currentStates.length;\n if (notChange) {\n for (var i = 0; i < len; i++) {\n if (states[i] !== currentStates[i]) {\n notChange = false;\n break;\n }\n }\n }\n if (notChange) {\n return;\n }\n for (var i = 0; i < len; i++) {\n var stateName = states[i];\n var stateObj = void 0;\n if (this.stateProxy) {\n stateObj = this.stateProxy(stateName, states);\n }\n if (!stateObj) {\n stateObj = this.states[stateName];\n }\n if (stateObj) {\n stateObjects.push(stateObj);\n }\n }\n var lastStateObj = stateObjects[len - 1];\n var useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n var mergedState = this._mergeStates(stateObjects);\n var animationCfg = this.stateTransition;\n this.saveCurrentToNormalState(mergedState);\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useStates(states, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useStates(states, noAnimation, useHoverLayer);\n }\n this._updateAnimationTargets();\n this.currentStates = states.slice();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n }\n };\n Element.prototype._updateAnimationTargets = function () {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n if (animator.targetName) {\n animator.changeTarget(this[animator.targetName]);\n }\n }\n };\n Element.prototype.removeState = function (state) {\n var idx = indexOf(this.currentStates, state);\n if (idx >= 0) {\n var currentStates = this.currentStates.slice();\n currentStates.splice(idx, 1);\n this.useStates(currentStates);\n }\n };\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\n var currentStates = this.currentStates.slice();\n var idx = indexOf(currentStates, oldState);\n var newStateExists = indexOf(currentStates, newState) >= 0;\n if (idx >= 0) {\n if (!newStateExists) {\n currentStates[idx] = newState;\n }\n else {\n currentStates.splice(idx, 1);\n }\n }\n else if (forceAdd && !newStateExists) {\n currentStates.push(newState);\n }\n this.useStates(currentStates);\n };\n Element.prototype.toggleState = function (state, enable) {\n if (enable) {\n this.useState(state, true);\n }\n else {\n this.removeState(state);\n }\n };\n Element.prototype._mergeStates = function (states) {\n var mergedState = {};\n var mergedTextConfig;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n extend(mergedState, state);\n if (state.textConfig) {\n mergedTextConfig = mergedTextConfig || {};\n extend(mergedTextConfig, state.textConfig);\n }\n }\n if (mergedTextConfig) {\n mergedState.textConfig = mergedTextConfig;\n }\n return mergedState;\n };\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n var needsRestoreToNormal = !(state && keepCurrentStates);\n if (state && state.textConfig) {\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\n extend(this.textConfig, state.textConfig);\n }\n else if (needsRestoreToNormal) {\n if (normalState.textConfig) {\n this.textConfig = normalState.textConfig;\n }\n }\n var transitionTarget = {};\n var hasTransition = false;\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n var key = PRIMARY_STATES_KEYS[i];\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n if (state && state[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = state[key];\n }\n else {\n this[key] = state[key];\n }\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = normalState[key];\n }\n else {\n this[key] = normalState[key];\n }\n }\n }\n }\n if (!transition) {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var targetName = animator.targetName;\n if (!animator.getLoop()) {\n animator.__changeFinalValue(targetName\n ? (state || normalState)[targetName]\n : (state || normalState));\n }\n }\n }\n if (hasTransition) {\n this._transitionState(stateName, transitionTarget, animationCfg);\n }\n };\n Element.prototype._attachComponent = function (componentEl) {\n if (componentEl.__zr && !componentEl.__hostTarget) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Text element has been added to zrender.');\n }\n return;\n }\n if (componentEl === this) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Recursive component attachment.');\n }\n return;\n }\n var zr = this.__zr;\n if (zr) {\n componentEl.addSelfToZr(zr);\n }\n componentEl.__zr = zr;\n componentEl.__hostTarget = this;\n };\n Element.prototype._detachComponent = function (componentEl) {\n if (componentEl.__zr) {\n componentEl.removeSelfFromZr(componentEl.__zr);\n }\n componentEl.__zr = null;\n componentEl.__hostTarget = null;\n };\n Element.prototype.getClipPath = function () {\n return this._clipPath;\n };\n Element.prototype.setClipPath = function (clipPath) {\n if (this._clipPath && this._clipPath !== clipPath) {\n this.removeClipPath();\n }\n this._attachComponent(clipPath);\n this._clipPath = clipPath;\n this.markRedraw();\n };\n Element.prototype.removeClipPath = function () {\n var clipPath = this._clipPath;\n if (clipPath) {\n this._detachComponent(clipPath);\n this._clipPath = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextContent = function () {\n return this._textContent;\n };\n Element.prototype.setTextContent = function (textEl) {\n var previousTextContent = this._textContent;\n if (previousTextContent === textEl) {\n return;\n }\n if (previousTextContent && previousTextContent !== textEl) {\n this.removeTextContent();\n }\n if (process.env.NODE_ENV !== 'production') {\n if (textEl.__zr && !textEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n }\n textEl.innerTransformable = new Transformable();\n this._attachComponent(textEl);\n this._textContent = textEl;\n this.markRedraw();\n };\n Element.prototype.setTextConfig = function (cfg) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n extend(this.textConfig, cfg);\n this.markRedraw();\n };\n Element.prototype.removeTextConfig = function () {\n this.textConfig = null;\n this.markRedraw();\n };\n Element.prototype.removeTextContent = function () {\n var textEl = this._textContent;\n if (textEl) {\n textEl.innerTransformable = null;\n this._detachComponent(textEl);\n this._textContent = null;\n this._innerTextDefaultStyle = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextGuideLine = function () {\n return this._textGuide;\n };\n Element.prototype.setTextGuideLine = function (guideLine) {\n if (this._textGuide && this._textGuide !== guideLine) {\n this.removeTextGuideLine();\n }\n this._attachComponent(guideLine);\n this._textGuide = guideLine;\n this.markRedraw();\n };\n Element.prototype.removeTextGuideLine = function () {\n var textGuide = this._textGuide;\n if (textGuide) {\n this._detachComponent(textGuide);\n this._textGuide = null;\n this.markRedraw();\n }\n };\n Element.prototype.markRedraw = function () {\n this.__dirty |= REDRAW_BIT;\n var zr = this.__zr;\n if (zr) {\n if (this.__inHover) {\n zr.refreshHover();\n }\n else {\n zr.refresh();\n }\n }\n if (this.__hostTarget) {\n this.__hostTarget.markRedraw();\n }\n };\n Element.prototype.dirty = function () {\n this.markRedraw();\n };\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\n this.__inHover = inHover;\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.__inHover = inHover;\n }\n if (textGuide) {\n textGuide.__inHover = inHover;\n }\n };\n Element.prototype.addSelfToZr = function (zr) {\n if (this.__zr === zr) {\n return;\n }\n this.__zr = zr;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.addSelfToZr(zr);\n }\n if (this._textContent) {\n this._textContent.addSelfToZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.addSelfToZr(zr);\n }\n };\n Element.prototype.removeSelfFromZr = function (zr) {\n if (!this.__zr) {\n return;\n }\n this.__zr = null;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.removeSelfFromZr(zr);\n }\n if (this._textContent) {\n this._textContent.removeSelfFromZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.removeSelfFromZr(zr);\n }\n };\n Element.prototype.animate = function (key, loop, allowDiscreteAnimation) {\n var target = key ? this[key] : this;\n if (process.env.NODE_ENV !== 'production') {\n if (!target) {\n logError('Property \"'\n + key\n + '\" is not existed in element '\n + this.id);\n return;\n }\n }\n var animator = new Animator(target, loop, allowDiscreteAnimation);\n key && (animator.targetName = key);\n this.addAnimator(animator, key);\n return animator;\n };\n Element.prototype.addAnimator = function (animator, key) {\n var zr = this.__zr;\n var el = this;\n animator.during(function () {\n el.updateDuringAnimation(key);\n }).done(function () {\n var animators = el.animators;\n var idx = indexOf(animators, animator);\n if (idx >= 0) {\n animators.splice(idx, 1);\n }\n });\n this.animators.push(animator);\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n zr && zr.wakeUp();\n };\n Element.prototype.updateDuringAnimation = function (key) {\n this.markRedraw();\n };\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n var leftAnimators = [];\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n if (!scope || scope === animator.scope) {\n animator.stop(forwardToLast);\n }\n else {\n leftAnimators.push(animator);\n }\n }\n this.animators = leftAnimators;\n return this;\n };\n Element.prototype.animateTo = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps);\n };\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps, true);\n };\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\n var animators = animateTo(this, target, cfg, animationProps);\n for (var i = 0; i < animators.length; i++) {\n animators[i].__fromStateTransition = stateName;\n }\n };\n Element.prototype.getBoundingRect = function () {\n return null;\n };\n Element.prototype.getPaintRect = function () {\n return null;\n };\n Element.initDefaultProps = (function () {\n var elProto = Element.prototype;\n elProto.type = 'element';\n elProto.name = '';\n elProto.ignore =\n elProto.silent =\n elProto.isGroup =\n elProto.draggable =\n elProto.dragging =\n elProto.ignoreClip =\n elProto.__inHover = false;\n elProto.__dirty = REDRAW_BIT;\n var logs = {};\n function logDeprecatedError(key, xKey, yKey) {\n if (!logs[key + xKey + yKey]) {\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\n logs[key + xKey + yKey] = true;\n }\n }\n function createLegacyProperty(key, privateKey, xKey, yKey) {\n Object.defineProperty(elProto, key, {\n get: function () {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n if (!this[privateKey]) {\n var pos = this[privateKey] = [];\n enhanceArray(this, pos);\n }\n return this[privateKey];\n },\n set: function (pos) {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n this[xKey] = pos[0];\n this[yKey] = pos[1];\n this[privateKey] = pos;\n enhanceArray(this, pos);\n }\n });\n function enhanceArray(self, pos) {\n Object.defineProperty(pos, 0, {\n get: function () {\n return self[xKey];\n },\n set: function (val) {\n self[xKey] = val;\n }\n });\n Object.defineProperty(pos, 1, {\n get: function () {\n return self[yKey];\n },\n set: function (val) {\n self[yKey] = val;\n }\n });\n }\n }\n if (Object.defineProperty) {\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n }\n })();\n return Element;\n}());\nmixin(Element, Eventful);\nmixin(Element, Transformable);\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\n cfg = cfg || {};\n var animators = [];\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\n var finishCount = animators.length;\n var doneHappened = false;\n var cfgDone = cfg.done;\n var cfgAborted = cfg.aborted;\n var doneCb = function () {\n doneHappened = true;\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n var abortedCb = function () {\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n if (!finishCount) {\n cfgDone && cfgDone();\n }\n if (animators.length > 0 && cfg.during) {\n animators[0].during(function (target, percent) {\n cfg.during(percent);\n });\n }\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i];\n if (doneCb) {\n animator.done(doneCb);\n }\n if (abortedCb) {\n animator.aborted(abortedCb);\n }\n if (cfg.force) {\n animator.duration(cfg.duration);\n }\n animator.start(cfg.easing);\n }\n return animators;\n}\nfunction copyArrShallow(source, target, len) {\n for (var i = 0; i < len; i++) {\n source[i] = target[i];\n }\n}\nfunction is2DArray(value) {\n return isArrayLike(value[0]);\n}\nfunction copyValue(target, source, key) {\n if (isArrayLike(source[key])) {\n if (!isArrayLike(target[key])) {\n target[key] = [];\n }\n if (isTypedArray(source[key])) {\n var len = source[key].length;\n if (target[key].length !== len) {\n target[key] = new (source[key].constructor)(len);\n copyArrShallow(target[key], source[key], len);\n }\n }\n else {\n var sourceArr = source[key];\n var targetArr = target[key];\n var len0 = sourceArr.length;\n if (is2DArray(sourceArr)) {\n var len1 = sourceArr[0].length;\n for (var i = 0; i < len0; i++) {\n if (!targetArr[i]) {\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n }\n else {\n copyArrShallow(targetArr[i], sourceArr[i], len1);\n }\n }\n }\n else {\n copyArrShallow(targetArr, sourceArr, len0);\n }\n targetArr.length = sourceArr.length;\n }\n }\n else {\n target[key] = source[key];\n }\n}\nfunction isValueSame(val1, val2) {\n return val1 === val2\n || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);\n}\nfunction is1DArraySame(arr0, arr1) {\n var len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n return true;\n}\nfunction animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse) {\n var targetKeys = keys(target);\n var duration = cfg.duration;\n var delay = cfg.delay;\n var additive = cfg.additive;\n var setToFinal = cfg.setToFinal;\n var animateAll = !isObject(animationProps);\n var existsAnimators = animatable.animators;\n var animationKeys = [];\n for (var k = 0; k < targetKeys.length; k++) {\n var innerKey = targetKeys[k];\n var targetVal = target[innerKey];\n if (targetVal != null && animateObj[innerKey] != null\n && (animateAll || animationProps[innerKey])) {\n if (isObject(targetVal)\n && !isArrayLike(targetVal)\n && !isGradientObject(targetVal)) {\n if (topKey) {\n if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n }\n continue;\n }\n animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse);\n }\n else {\n animationKeys.push(innerKey);\n }\n }\n else if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n animationKeys.push(innerKey);\n }\n }\n var keyLen = animationKeys.length;\n if (!additive && keyLen) {\n for (var i = 0; i < existsAnimators.length; i++) {\n var animator = existsAnimators[i];\n if (animator.targetName === topKey) {\n var allAborted = animator.stopTracks(animationKeys);\n if (allAborted) {\n var idx = indexOf(existsAnimators, animator);\n existsAnimators.splice(idx, 1);\n }\n }\n }\n }\n if (!cfg.force) {\n animationKeys = filter(animationKeys, function (key) { return !isValueSame(target[key], animateObj[key]); });\n keyLen = animationKeys.length;\n }\n if (keyLen > 0\n || (cfg.force && !animators.length)) {\n var revertedSource = void 0;\n var reversedTarget = void 0;\n var sourceClone = void 0;\n if (reverse) {\n reversedTarget = {};\n if (setToFinal) {\n revertedSource = {};\n }\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n reversedTarget[innerKey] = animateObj[innerKey];\n if (setToFinal) {\n revertedSource[innerKey] = target[innerKey];\n }\n else {\n animateObj[innerKey] = target[innerKey];\n }\n }\n }\n else if (setToFinal) {\n sourceClone = {};\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n sourceClone[innerKey] = cloneValue(animateObj[innerKey]);\n copyValue(animateObj, target, innerKey);\n }\n }\n var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function (animator) { return animator.targetName === topKey; }) : null);\n animator.targetName = topKey;\n if (cfg.scope) {\n animator.scope = cfg.scope;\n }\n if (setToFinal && revertedSource) {\n animator.whenWithKeys(0, revertedSource, animationKeys);\n }\n if (sourceClone) {\n animator.whenWithKeys(0, sourceClone, animationKeys);\n }\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animationKeys).delay(delay || 0);\n animatable.addAnimator(animator, topKey);\n animators.push(animator);\n }\n}\nexport default Element;\n","import { __extends } from \"tslib\";\nimport * as zrUtil from '../core/util.js';\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar Group = (function (_super) {\n __extends(Group, _super);\n function Group(opts) {\n var _this = _super.call(this) || this;\n _this.isGroup = true;\n _this._children = [];\n _this.attr(opts);\n return _this;\n }\n Group.prototype.childrenRef = function () {\n return this._children;\n };\n Group.prototype.children = function () {\n return this._children.slice();\n };\n Group.prototype.childAt = function (idx) {\n return this._children[idx];\n };\n Group.prototype.childOfName = function (name) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n };\n Group.prototype.childCount = function () {\n return this._children.length;\n };\n Group.prototype.add = function (child) {\n if (child) {\n if (child !== this && child.parent !== this) {\n this._children.push(child);\n this._doAdd(child);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (child.__hostTarget) {\n throw 'This elemenet has been used as an attachment';\n }\n }\n }\n return this;\n };\n Group.prototype.addBefore = function (child, nextSibling) {\n if (child && child !== this && child.parent !== this\n && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n if (idx >= 0) {\n children.splice(idx, 0, child);\n this._doAdd(child);\n }\n }\n return this;\n };\n Group.prototype.replace = function (oldChild, newChild) {\n var idx = zrUtil.indexOf(this._children, oldChild);\n if (idx >= 0) {\n this.replaceAt(newChild, idx);\n }\n return this;\n };\n Group.prototype.replaceAt = function (child, index) {\n var children = this._children;\n var old = children[index];\n if (child && child !== this && child.parent !== this && child !== old) {\n children[index] = child;\n old.parent = null;\n var zr = this.__zr;\n if (zr) {\n old.removeSelfFromZr(zr);\n }\n this._doAdd(child);\n }\n return this;\n };\n Group.prototype._doAdd = function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n child.parent = this;\n var zr = this.__zr;\n if (zr && zr !== child.__zr) {\n child.addSelfToZr(zr);\n }\n zr && zr.refresh();\n };\n Group.prototype.remove = function (child) {\n var zr = this.__zr;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n if (idx < 0) {\n return this;\n }\n children.splice(idx, 1);\n child.parent = null;\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n zr && zr.refresh();\n return this;\n };\n Group.prototype.removeAll = function () {\n var children = this._children;\n var zr = this.__zr;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n child.parent = null;\n }\n children.length = 0;\n return this;\n };\n Group.prototype.eachChild = function (cb, context) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n return this;\n };\n Group.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n var stopped = cb.call(context, child);\n if (child.isGroup && !stopped) {\n child.traverse(cb, context);\n }\n }\n return this;\n };\n Group.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.addSelfToZr(zr);\n }\n };\n Group.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.removeSelfFromZr(zr);\n }\n };\n Group.prototype.getBoundingRect = function (includeChildren) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.ignore || child.invisible) {\n continue;\n }\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n BoundingRect.applyTransform(tmpRect, childRect, transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n return rect || tmpRect;\n };\n return Group;\n}(Element));\nGroup.prototype.type = 'group';\nexport default Group;\n","/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nimport env from './core/env.js';\nimport * as zrUtil from './core/util.js';\nimport Handler from './Handler.js';\nimport Storage from './Storage.js';\nimport Animation, { getTime } from './animation/Animation.js';\nimport HandlerProxy from './dom/HandlerProxy.js';\nimport { lum } from './tool/color.js';\nimport { DARK_MODE_THRESHOLD } from './config.js';\nimport Group from './graphic/Group.js';\nvar painterCtors = {};\nvar instances = {};\nfunction delInstance(id) {\n delete instances[id];\n}\nfunction isDarkMode(backgroundColor) {\n if (!backgroundColor) {\n return false;\n }\n if (typeof backgroundColor === 'string') {\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n }\n else if (backgroundColor.colorStops) {\n var colorStops = backgroundColor.colorStops;\n var totalLum = 0;\n var len = colorStops.length;\n for (var i = 0; i < len; i++) {\n totalLum += lum(colorStops[i].color, 1);\n }\n totalLum /= len;\n return totalLum < DARK_MODE_THRESHOLD;\n }\n return false;\n}\nvar ZRender = (function () {\n function ZRender(id, dom, opts) {\n var _this = this;\n this._sleepAfterStill = 10;\n this._stillFrameAccum = 0;\n this._needsRefresh = true;\n this._needsRefreshHover = true;\n this._darkMode = false;\n opts = opts || {};\n this.dom = dom;\n this.id = id;\n var storage = new Storage();\n var rendererType = opts.renderer || 'canvas';\n if (!painterCtors[rendererType]) {\n rendererType = zrUtil.keys(painterCtors)[0];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!painterCtors[rendererType]) {\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\n }\n }\n opts.useDirtyRect = opts.useDirtyRect == null\n ? false\n : opts.useDirtyRect;\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\n var ssrMode = opts.ssr || painter.ssrOnly;\n this.storage = storage;\n this.painter = painter;\n var handerProxy = (!env.node && !env.worker && !ssrMode)\n ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n : null;\n var useCoarsePointer = opts.useCoarsePointer;\n var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')\n ? env.touchEventsSupported\n : !!useCoarsePointer;\n var defaultPointerSize = 44;\n var pointerSize;\n if (usePointerSize) {\n pointerSize = zrUtil.retrieve2(opts.pointerSize, defaultPointerSize);\n }\n this.handler = new Handler(storage, painter, handerProxy, painter.root, pointerSize);\n this.animation = new Animation({\n stage: {\n update: ssrMode ? null : function () { return _this._flush(true); }\n }\n });\n if (!ssrMode) {\n this.animation.start();\n }\n }\n ZRender.prototype.add = function (el) {\n if (!el) {\n return;\n }\n this.storage.addRoot(el);\n el.addSelfToZr(this);\n this.refresh();\n };\n ZRender.prototype.remove = function (el) {\n if (!el) {\n return;\n }\n this.storage.delRoot(el);\n el.removeSelfFromZr(this);\n this.refresh();\n };\n ZRender.prototype.configLayer = function (zLevel, config) {\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n this.refresh();\n };\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n this.refresh();\n this._backgroundColor = backgroundColor;\n this._darkMode = isDarkMode(backgroundColor);\n };\n ZRender.prototype.getBackgroundColor = function () {\n return this._backgroundColor;\n };\n ZRender.prototype.setDarkMode = function (darkMode) {\n this._darkMode = darkMode;\n };\n ZRender.prototype.isDarkMode = function () {\n return this._darkMode;\n };\n ZRender.prototype.refreshImmediately = function (fromInside) {\n if (!fromInside) {\n this.animation.update(true);\n }\n this._needsRefresh = false;\n this.painter.refresh();\n this._needsRefresh = false;\n };\n ZRender.prototype.refresh = function () {\n this._needsRefresh = true;\n this.animation.start();\n };\n ZRender.prototype.flush = function () {\n this._flush(false);\n };\n ZRender.prototype._flush = function (fromInside) {\n var triggerRendered;\n var start = getTime();\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately(fromInside);\n }\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n var end = getTime();\n if (triggerRendered) {\n this._stillFrameAccum = 0;\n this.trigger('rendered', {\n elapsedTime: end - start\n });\n }\n else if (this._sleepAfterStill > 0) {\n this._stillFrameAccum++;\n if (this._stillFrameAccum > this._sleepAfterStill) {\n this.animation.stop();\n }\n }\n };\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\n this._sleepAfterStill = stillFramesCount;\n };\n ZRender.prototype.wakeUp = function () {\n this.animation.start();\n this._stillFrameAccum = 0;\n };\n ZRender.prototype.refreshHover = function () {\n this._needsRefreshHover = true;\n };\n ZRender.prototype.refreshHoverImmediately = function () {\n this._needsRefreshHover = false;\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n this.painter.refreshHover();\n }\n };\n ZRender.prototype.resize = function (opts) {\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n };\n ZRender.prototype.clearAnimation = function () {\n this.animation.clear();\n };\n ZRender.prototype.getWidth = function () {\n return this.painter.getWidth();\n };\n ZRender.prototype.getHeight = function () {\n return this.painter.getHeight();\n };\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\n this.handler.setCursorStyle(cursorStyle);\n };\n ZRender.prototype.findHover = function (x, y) {\n return this.handler.findHover(x, y);\n };\n ZRender.prototype.on = function (eventName, eventHandler, context) {\n this.handler.on(eventName, eventHandler, context);\n return this;\n };\n ZRender.prototype.off = function (eventName, eventHandler) {\n this.handler.off(eventName, eventHandler);\n };\n ZRender.prototype.trigger = function (eventName, event) {\n this.handler.trigger(eventName, event);\n };\n ZRender.prototype.clear = function () {\n var roots = this.storage.getRoots();\n for (var i = 0; i < roots.length; i++) {\n if (roots[i] instanceof Group) {\n roots[i].removeSelfFromZr(this);\n }\n }\n this.storage.delAllRoots();\n this.painter.clear();\n };\n ZRender.prototype.dispose = function () {\n this.animation.stop();\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n this.animation =\n this.storage =\n this.painter =\n this.handler = null;\n delInstance(this.id);\n };\n return ZRender;\n}());\nexport function init(dom, opts) {\n var zr = new ZRender(zrUtil.guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\nexport function dispose(zr) {\n zr.dispose();\n}\nexport function disposeAll() {\n for (var key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n instances = {};\n}\nexport function getInstance(id) {\n return instances[id];\n}\nexport function registerPainter(name, Ctor) {\n painterCtors[name] = Ctor;\n}\nexport var version = '5.4.4';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The method \"quantile\" was copied from \"d3.js\".\r\n* (See more details in the comment of the method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar RADIAN_EPSILON = 1e-4; // Although chrome already enlarge this number to 100 for `toFixed`, but\n// we sill follow the spec for compatibility.\n\nvar ROUND_SUPPORTED_PRECISION_MAX = 20;\n\nfunction _trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n/**\r\n * Linear mapping a value from domain to range\r\n * @param val\r\n * @param domain Domain extent domain[0] can be bigger than domain[1]\r\n * @param range Range extent range[0] can be bigger than range[1]\r\n * @param clamp Default to be false\r\n */\n\n\nexport function linearMap(val, domain, range, clamp) {\n var d0 = domain[0];\n var d1 = domain[1];\n var r0 = range[0];\n var r1 = range[1];\n var subDomain = d1 - d0;\n var subRange = r1 - r0;\n\n if (subDomain === 0) {\n return subRange === 0 ? r0 : (r0 + r1) / 2;\n } // Avoid accuracy problem in edge, such as\n // 146.39 - 62.83 === 83.55999999999999.\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n // It is a little verbose for efficiency considering this method\n // is a hotspot.\n\n\n if (clamp) {\n if (subDomain > 0) {\n if (val <= d0) {\n return r0;\n } else if (val >= d1) {\n return r1;\n }\n } else {\n if (val >= d0) {\n return r0;\n } else if (val <= d1) {\n return r1;\n }\n }\n } else {\n if (val === d0) {\n return r0;\n }\n\n if (val === d1) {\n return r1;\n }\n }\n\n return (val - d0) / subDomain * subRange + r0;\n}\n/**\r\n * Convert a percent string to absolute number.\r\n * Returns NaN if percent is not a valid string or number\r\n */\n\nexport function parsePercent(percent, all) {\n switch (percent) {\n case 'center':\n case 'middle':\n percent = '50%';\n break;\n\n case 'left':\n case 'top':\n percent = '0%';\n break;\n\n case 'right':\n case 'bottom':\n percent = '100%';\n break;\n }\n\n if (zrUtil.isString(percent)) {\n if (_trim(percent).match(/%$/)) {\n return parseFloat(percent) / 100 * all;\n }\n\n return parseFloat(percent);\n }\n\n return percent == null ? NaN : +percent;\n}\nexport function round(x, precision, returnStr) {\n if (precision == null) {\n precision = 10;\n } // Avoid range error\n\n\n precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'\n\n x = (+x).toFixed(precision);\n return returnStr ? x : +x;\n}\n/**\r\n * Inplacd asc sort arr.\r\n * The input arr will be modified.\r\n */\n\nexport function asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}\n/**\r\n * Get precision.\r\n */\n\nexport function getPrecision(val) {\n val = +val;\n\n if (isNaN(val)) {\n return 0;\n } // It is much faster than methods converting number to string as follows\n // let tmp = val.toString();\n // return tmp.length - 1 - tmp.indexOf('.');\n // especially when precision is low\n // Notice:\n // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.\n // (see https://jsbench.me/2vkpcekkvw/1)\n // (2) If the val is less than for example 1e-15, the result may be incorrect.\n // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)\n\n\n if (val > 1e-14) {\n var e = 1;\n\n for (var i = 0; i < 15; i++, e *= 10) {\n if (Math.round(val * e) / e === val) {\n return i;\n }\n }\n }\n\n return getPrecisionSafe(val);\n}\n/**\r\n * Get precision with slow but safe method\r\n */\n\nexport function getPrecisionSafe(val) {\n // toLowerCase for: '3.4E-12'\n var str = val.toString().toLowerCase(); // Consider scientific notation: '3.4e-12' '3.4e+12'\n\n var eIndex = str.indexOf('e');\n var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;\n var significandPartLen = eIndex > 0 ? eIndex : str.length;\n var dotIndex = str.indexOf('.');\n var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;\n return Math.max(0, decimalPartLen - exp);\n}\n/**\r\n * Minimal dicernible data precisioin according to a single pixel.\r\n */\n\nexport function getPixelPrecision(dataExtent, pixelExtent) {\n var log = Math.log;\n var LN10 = Math.LN10;\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20.\n\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n return !isFinite(precision) ? 20 : precision;\n}\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param idx index of the data to be processed in valueList\r\n * @param precision integer number showing digits of precision\r\n * @return percent ranging from 0 to 100\r\n */\n\nexport function getPercentWithPrecision(valueList, idx, precision) {\n if (!valueList[idx]) {\n return 0;\n }\n\n var seats = getPercentSeats(valueList, precision);\n return seats[idx] || 0;\n}\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param precision integer number showing digits of precision\r\n * @return {Array}\r\n */\n\nexport function getPercentSeats(valueList, precision) {\n var sum = zrUtil.reduce(valueList, function (acc, val) {\n return acc + (isNaN(val) ? 0 : val);\n }, 0);\n\n if (sum === 0) {\n return [];\n }\n\n var digits = Math.pow(10, precision);\n var votesPerQuota = zrUtil.map(valueList, function (val) {\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\n });\n var targetSeats = digits * 100;\n var seats = zrUtil.map(votesPerQuota, function (votes) {\n // Assign automatic seats.\n return Math.floor(votes);\n });\n var currentSum = zrUtil.reduce(seats, function (acc, val) {\n return acc + val;\n }, 0);\n var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n return votes - seats[idx];\n }); // Has remainding votes.\n\n while (currentSum < targetSeats) {\n // Find next largest remainder.\n var max = Number.NEGATIVE_INFINITY;\n var maxId = null;\n\n for (var i = 0, len = remainder.length; i < len; ++i) {\n if (remainder[i] > max) {\n max = remainder[i];\n maxId = i;\n }\n } // Add a vote to max remainder.\n\n\n ++seats[maxId];\n remainder[maxId] = 0;\n ++currentSum;\n }\n\n return zrUtil.map(seats, function (seat) {\n return seat / digits;\n });\n}\n/**\r\n * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004\r\n * See \r\n */\n\nexport function addSafe(val0, val1) {\n var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); // const multiplier = Math.pow(10, maxPrecision);\n // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;\n\n var sum = val0 + val1; // // PENDING: support more?\n\n return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision);\n} // Number.MAX_SAFE_INTEGER, ie do not support.\n\nexport var MAX_SAFE_INTEGER = 9007199254740991;\n/**\r\n * To 0 - 2 * PI, considering negative radian.\r\n */\n\nexport function remRadian(radian) {\n var pi2 = Math.PI * 2;\n return (radian % pi2 + pi2) % pi2;\n}\n/**\r\n * @param {type} radian\r\n * @return {boolean}\r\n */\n\nexport function isRadianAroundZero(val) {\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n} // eslint-disable-next-line\n\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n\n/**\r\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\r\n * These values can be accepted:\r\n * + An instance of Date, represent a time in its own time zone.\r\n * + Or string in a subset of ISO 8601, only including:\r\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\r\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\r\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\r\n * all of which will be treated as local time if time zone is not specified\r\n * (see ).\r\n * + Or other string format, including (all of which will be treated as local time):\r\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\r\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\r\n * + a timestamp, which represent a time in UTC.\r\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\r\n */\n\nexport function parseDate(value) {\n if (value instanceof Date) {\n return value;\n } else if (zrUtil.isString(value)) {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n var match = TIME_REG.exec(value);\n\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n } // Use local time when no timezone offset is specified.\n\n\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);\n } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n else {\n var hour = +match[4] || 0;\n\n if (match[8].toUpperCase() !== 'Z') {\n hour -= +match[8].slice(0, 3);\n }\n\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));\n }\n } else if (value == null) {\n return new Date(NaN);\n }\n\n return new Date(Math.round(value));\n}\n/**\r\n * Quantity of a number. e.g. 0.1, 1, 10, 100\r\n *\r\n * @param val\r\n * @return\r\n */\n\nexport function quantity(val) {\n return Math.pow(10, quantityExponent(val));\n}\n/**\r\n * Exponent of the quantity of a number\r\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\r\n *\r\n * @param val non-negative value\r\n * @return\r\n */\n\nexport function quantityExponent(val) {\n if (val === 0) {\n return 0;\n }\n\n var exp = Math.floor(Math.log(val) / Math.LN10);\n /**\r\n * exp is expected to be the rounded-down result of the base-10 log of val.\r\n * But due to the precision loss with Math.log(val), we need to restore it\r\n * using 10^exp to make sure we can get val back from exp. #11249\r\n */\n\n if (val / Math.pow(10, exp) >= 10) {\n exp++;\n }\n\n return exp;\n}\n/**\r\n * find a “nice” number approximately equal to x. Round the number if round = true,\r\n * take ceiling if round = false. The primary observation is that the “nicest”\r\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\r\n *\r\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\r\n *\r\n * @param val Non-negative value.\r\n * @param round\r\n * @return Niced number\r\n */\n\nexport function nice(val, round) {\n var exponent = quantityExponent(val);\n var exp10 = Math.pow(10, exponent);\n var f = val / exp10; // 1 <= f < 10\n\n var nf;\n\n if (round) {\n if (f < 1.5) {\n nf = 1;\n } else if (f < 2.5) {\n nf = 2;\n } else if (f < 4) {\n nf = 3;\n } else if (f < 7) {\n nf = 5;\n } else {\n nf = 10;\n }\n } else {\n if (f < 1) {\n nf = 1;\n } else if (f < 2) {\n nf = 2;\n } else if (f < 3) {\n nf = 3;\n } else if (f < 5) {\n nf = 5;\n } else {\n nf = 10;\n }\n }\n\n val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n // 20 is the uppper bound of toFixed.\n\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\r\n * This code was copied from \"d3.js\"\r\n * .\r\n * See the license statement at the head of this file.\r\n * @param ascArr\r\n */\n\nexport function quantile(ascArr, p) {\n var H = (ascArr.length - 1) * p + 1;\n var h = Math.floor(H);\n var v = +ascArr[h - 1];\n var e = H - h;\n return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\r\n * Order intervals asc, and split them when overlap.\r\n * expect(numberUtil.reformIntervals([\r\n * {interval: [18, 62], close: [1, 1]},\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [1, 1]},\r\n * {interval: [62, 150], close: [1, 1]},\r\n * {interval: [106, 150], close: [1, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ])).toEqual([\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [0, 1]},\r\n * {interval: [18, 62], close: [0, 1]},\r\n * {interval: [62, 150], close: [0, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ]);\r\n * @param list, where `close` mean open or close\r\n * of the interval, and Infinity can be used.\r\n * @return The origin list, which has been reformed.\r\n */\n\nexport function reformIntervals(list) {\n list.sort(function (a, b) {\n return littleThan(a, b, 0) ? -1 : 1;\n });\n var curr = -Infinity;\n var currClose = 1;\n\n for (var i = 0; i < list.length;) {\n var interval = list[i].interval;\n var close_1 = list[i].close;\n\n for (var lg = 0; lg < 2; lg++) {\n if (interval[lg] <= curr) {\n interval[lg] = curr;\n close_1[lg] = !lg ? 1 - currClose : 1;\n }\n\n curr = interval[lg];\n currClose = close_1[lg];\n }\n\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\n list.splice(i, 1);\n } else {\n i++;\n }\n }\n\n return list;\n\n function littleThan(a, b, lg) {\n 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));\n }\n}\n/**\r\n * [Numeric is defined as]:\r\n * `parseFloat(val) == val`\r\n * For example:\r\n * numeric:\r\n * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\r\n * and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\r\n * not-numeric:\r\n * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\r\n * empty string, string with only white-spaces or line-terminal (see es spec),\r\n * 0x12, '0x12', '-0x12', 012, '012', '-012',\r\n * non-string, ...\r\n *\r\n * @test See full test cases in `test/ut/spec/util/number.js`.\r\n * @return Must be a typeof number. If not numeric, return NaN.\r\n */\n\nexport function numericToNumber(val) {\n var valFloat = parseFloat(val);\n return valFloat == val // eslint-disable-line eqeqeq\n && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.\n ? valFloat : NaN;\n}\n/**\r\n * Definition of \"numeric\": see `numericToNumber`.\r\n */\n\nexport function isNumeric(val) {\n return !isNaN(numericToNumber(val));\n}\n/**\r\n * Use random base to prevent users hard code depending on\r\n * this auto generated marker id.\r\n * @return An positive integer.\r\n */\n\nexport function getRandomIdBase() {\n return Math.round(Math.random() * 9);\n}\n/**\r\n * Get the greatest common divisor.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\n\nexport function getGreatestCommonDividor(a, b) {\n if (b === 0) {\n return a;\n }\n\n return getGreatestCommonDividor(b, a % b);\n}\n/**\r\n * Get the least common multiple.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\n\nexport function getLeastCommonMultiple(a, b) {\n if (a == null) {\n return b;\n }\n\n if (b == null) {\n return a;\n }\n\n return a * b / getGreatestCommonDividor(a, b);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isObject, isArray, createHashMap, map, assert, isString, indexOf, isStringSafe, isNumber } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { isNumeric, getRandomIdBase, getPrecision, round } from './number.js';\nimport { warn } from './log.js';\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\r\n * Make the name displayable. But we should\r\n * make sure it is not duplicated with user\r\n * specified name, so use '\\0';\r\n */\n\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\n/**\r\n * If value is not array, then translate it to array.\r\n * @param {*} value\r\n * @return {Array} [value] or value\r\n */\n\nexport function normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\r\n * Sync default option between normal and emphasis like `position` and `show`\r\n * In case some one will write code like\r\n * label: {\r\n * show: false,\r\n * position: 'outside',\r\n * fontSize: 18\r\n * },\r\n * emphasis: {\r\n * label: { show: true }\r\n * }\r\n */\n\nexport function 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}\nexport 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([\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/**\r\n * The method does not ensure performance.\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method retrieves value from data.\r\n */\n\nexport function getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method determine if dataItem has extra option besides value\r\n */\n\nexport function 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/**\r\n * Mapping to existings for merge.\r\n *\r\n * Mode \"normalMege\":\r\n * The mapping result (merge result) will keep the order of the existing\r\n * component, rather than the order of new option. Because we should ensure\r\n * some specified index reference (like xAxisIndex) keep work.\r\n * And in most cases, \"merge option\" is used to update partial option but not\r\n * be expected to change the order.\r\n *\r\n * Mode \"replaceMege\":\r\n * (1) Only the id mapped components will be merged.\r\n * (2) Other existing components (except internal components) will be removed.\r\n * (3) Other new options will be used to create new component.\r\n * (4) The index of the existing components will not be modified.\r\n * That means their might be \"hole\" after the removal.\r\n * The new components are created first at those available index.\r\n *\r\n * Mode \"replaceAll\":\r\n * This mode try to support that reproduce an echarts instance from another\r\n * echarts instance (via `getOption`) in some simple cases.\r\n * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,\r\n * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,\r\n * the \"hole\" in `newCmptOptions` will also be kept.\r\n * On the contrary, other modes try best to eliminate holes.\r\n * PENDING: This is an experimental mode yet.\r\n *\r\n * @return See the comment of .\r\n */\n\nexport function mappingToExists(existings, newCmptOptions, mode) {\n var isNormalMergeMode = mode === 'normalMerge';\n var isReplaceMergeMode = mode === 'replaceMerge';\n var isReplaceAllMode = mode === 'replaceAll';\n existings = existings || [];\n newCmptOptions = (newCmptOptions || []).slice();\n var existingIdIdxMap = createHashMap(); // Validate id and name on user input option.\n\n each(newCmptOptions, function (cmptOption, index) {\n if (!isObject(cmptOption)) {\n newCmptOptions[index] = null;\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // There is some legacy case that name is set as `false`.\n // But should work normally rather than throw error.\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\n warnInvalidateIdOrName(cmptOption.id);\n }\n\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\n warnInvalidateIdOrName(cmptOption.name);\n }\n }\n });\n var result = prepareResult(existings, existingIdIdxMap, mode);\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\n }\n\n if (isNormalMergeMode) {\n mappingByName(result, newCmptOptions);\n }\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\n } else if (isReplaceAllMode) {\n mappingInReplaceAllMode(result, newCmptOptions);\n }\n\n makeIdAndName(result); // The array `result` MUST NOT contain elided items, otherwise the\n // forEach will omit those items and result in incorrect result.\n\n return result;\n}\n\nfunction prepareResult(existings, existingIdIdxMap, mode) {\n var result = [];\n\n if (mode === 'replaceAll') {\n return result;\n } // Do not use native `map` to in case that the array `existings`\n // contains elided items, which will be omitted.\n\n\n for (var index = 0; index < existings.length; index++) {\n var existing = existings[index]; // Because of replaceMerge, `existing` may be null/undefined.\n\n if (existing && existing.id != null) {\n existingIdIdxMap.set(existing.id, index);\n } // For non-internal-componnets:\n // Mode \"normalMerge\": all existings kept.\n // Mode \"replaceMerge\": all existing removed unless mapped by id.\n // For internal-components:\n // go with \"replaceMerge\" approach in both mode.\n\n\n result.push({\n existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing,\n newOption: null,\n keyInfo: null,\n brandNew: null\n });\n }\n\n return result;\n}\n\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\n // Mapping by id if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.id == null) {\n return;\n }\n\n var optionId = makeComparableKey(cmptOption.id);\n var existingIdx = existingIdIdxMap.get(optionId);\n\n if (existingIdx != null) {\n var resultItem = result[existingIdx];\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\n resultItem.newOption = cmptOption; // In both mode, if id matched, new option will be merged to\n // the existings rather than creating new component model.\n\n resultItem.existing = existings[existingIdx];\n newCmptOptions[index] = null;\n }\n });\n}\n\nfunction mappingByName(result, newCmptOptions) {\n // Mapping by name if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.name == null) {\n return;\n }\n\n for (var i = 0; i < result.length; i++) {\n var existing = result[i].existing;\n\n if (!result[i].newOption // Consider name: two map to one.\n // Can not match when both ids existing but different.\n && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) {\n result[i].newOption = cmptOption;\n newCmptOptions[index] = null;\n return;\n }\n }\n });\n}\n\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\n each(newCmptOptions, function (cmptOption) {\n if (!cmptOption) {\n return;\n } // Find the first place that not mapped by id and not internal component (consider the \"hole\").\n\n\n var resultItem;\n var nextIdx = 0;\n\n while ( // Be `!resultItem` only when `nextIdx >= result.length`.\n (resultItem = result[nextIdx]) && ( // (1) Existing models that already have id should be able to mapped to. Because\n // after mapping performed, model will always be assigned with an id if user not given.\n // After that all models have id.\n // (2) If new option has id, it can only set to a hole or append to the last. It should\n // not be merged to the existings with different id. Because id should not be overwritten.\n // (3) Name can be overwritten, because axis use name as 'show label text'.\n resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\n resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) {\n nextIdx++;\n }\n\n if (resultItem) {\n resultItem.newOption = cmptOption;\n resultItem.brandNew = brandNew;\n } else {\n result.push({\n newOption: cmptOption,\n brandNew: brandNew,\n existing: null,\n keyInfo: null\n });\n }\n\n nextIdx++;\n });\n}\n\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\n each(newCmptOptions, function (cmptOption) {\n // The feature \"reproduce\" requires \"hole\" will also reproduced\n // in case that component index referring are broken.\n result.push({\n newOption: cmptOption,\n brandNew: true,\n existing: null,\n keyInfo: null\n });\n });\n}\n/**\r\n * Make id and name for mapping result (result of mappingToExists)\r\n * into `keyInfo` field.\r\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 = createHashMap();\n each(mapResult, function (item) {\n var existing = item.existing;\n existing && idMap.set(existing.id, item);\n });\n each(mapResult, function (item) {\n var opt = item.newOption; // Force ensure id not duplicated.\n\n 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 existing = item.existing;\n var opt = item.newOption;\n var keyInfo = item.keyInfo;\n\n if (!isObject(opt)) {\n return;\n } // Name can be overwritten. 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 ? makeComparableKey(opt.name) : existing ? existing.name // Avoid that different series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n\n if (existing) {\n keyInfo.id = makeComparableKey(existing.id);\n } else if (opt.id != null) {\n keyInfo.id = makeComparableKey(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 keyExistAndEqual(attr, obj1, obj2) {\n var key1 = convertOptionIdName(obj1[attr], null);\n var key2 = convertOptionIdName(obj2[attr], null); // See `MappingExistingItem`. `id` and `name` trade string equals to number.\n\n return key1 != null && key2 != null && key1 === key2;\n}\n/**\r\n * @return return null if not exist.\r\n */\n\n\nfunction makeComparableKey(val) {\n if (process.env.NODE_ENV !== 'production') {\n if (val == null) {\n throw new Error();\n }\n }\n\n return convertOptionIdName(val, '');\n}\n\nexport function convertOptionIdName(idOrName, defaultValue) {\n if (idOrName == null) {\n return defaultValue;\n }\n\n return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue;\n}\n\nfunction warnInvalidateIdOrName(idOrName) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\n }\n}\n\nfunction isValidIdOrName(idOrName) {\n return isStringSafe(idOrName) || isNumeric(idOrName);\n}\n\nexport function 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/**\r\n * @public\r\n * @param {Object} cmptOption\r\n * @return {boolean}\r\n */\n\nexport function isComponentIdInternal(cmptOption) {\n return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\n}\nexport function makeInternalComponentId(idSuffix) {\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\n}\nexport function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\n // Set mainType and complete subType.\n each(mappingResult, function (item) {\n var newOption = item.newOption;\n\n if (isObject(newOption)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\n }\n });\n}\n\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\n var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : componentModelCtor.determineSubType(mainType, newCmptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\r\n * A helper for removing duplicate items between batchA and batchB,\r\n * and in themselves, and categorize by series.\r\n *\r\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @return result: [resultBatchA, resultBatchB]\r\n */\n\n\nexport function 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 = convertOptionIdName(sourceBatch[i].seriesId, null);\n\n if (seriesId == null) {\n return;\n }\n\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/**\r\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\r\n * each of which can be Array or primary type.\r\n * @return dataIndex If not found, return undefined/null.\r\n */\n\nexport function queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return isArray(payload.name) ? map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\r\n * Enable property storage to any host object.\r\n * Notice: Serialization is not supported.\r\n *\r\n * For example:\r\n * let inner = zrUitl.makeInner();\r\n *\r\n * function some1(hostObj) {\r\n * inner(hostObj).someProperty = 1212;\r\n * ...\r\n * }\r\n * function some2() {\r\n * let fields = inner(this);\r\n * fields.someProperty1 = 1212;\r\n * fields.someProperty2 = 'xx';\r\n * ...\r\n * }\r\n *\r\n * @return {Function}\r\n */\n\nexport function makeInner() {\n var key = '__ec_inner_' + innerUniqueIndex++;\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\nvar innerUniqueIndex = getRandomIdBase();\n/**\r\n * The same behavior as `component.getReferringComponents`.\r\n */\n\nexport function parseFinder(ecModel, finderInput, opt) {\n var _a = preParseFinder(finderInput, opt),\n mainTypeSpecified = _a.mainTypeSpecified,\n queryOptionMap = _a.queryOptionMap,\n others = _a.others;\n\n var result = others;\n var defaultMainType = opt ? opt.defaultMainType : null;\n\n if (!mainTypeSpecified && defaultMainType) {\n queryOptionMap.set(defaultMainType, {});\n }\n\n queryOptionMap.each(function (queryOption, mainType) {\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\n useDefault: defaultMainType === mainType,\n enableAll: opt && opt.enableAll != null ? opt.enableAll : true,\n enableNone: opt && opt.enableNone != null ? opt.enableNone : true\n });\n result[mainType + 'Models'] = queryResult.models;\n result[mainType + 'Model'] = queryResult.models[0];\n });\n return result;\n}\nexport function preParseFinder(finderInput, opt) {\n var finder;\n\n if (isString(finderInput)) {\n var obj = {};\n obj[finderInput + 'Index'] = 0;\n finder = obj;\n } else {\n finder = finderInput;\n }\n\n var queryOptionMap = createHashMap();\n var others = {};\n var mainTypeSpecified = false;\n each(finder, function (value, key) {\n // Exclude 'dataIndex' and other illgal keys.\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n others[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 || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n\n mainTypeSpecified = mainTypeSpecified || !!mainType;\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\n queryOption[queryType] = value;\n });\n return {\n mainTypeSpecified: mainTypeSpecified,\n queryOptionMap: queryOptionMap,\n others: others\n };\n}\nexport var SINGLE_REFERRING = {\n useDefault: true,\n enableAll: false,\n enableNone: false\n};\nexport var MULTIPLE_REFERRING = {\n useDefault: false,\n enableAll: true,\n enableNone: true\n};\nexport function queryReferringComponents(ecModel, mainType, userOption, opt) {\n opt = opt || SINGLE_REFERRING;\n var indexOption = userOption.index;\n var idOption = userOption.id;\n var nameOption = userOption.name;\n var result = {\n models: null,\n specified: indexOption != null || idOption != null || nameOption != null\n };\n\n if (!result.specified) {\n // Use the first as default if `useDefault`.\n var firstCmpt = void 0;\n result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];\n return result;\n }\n\n if (indexOption === 'none' || indexOption === false) {\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\n result.models = [];\n return result;\n } // `queryComponents` will return all components if\n // both all of index/id/name are null/undefined.\n\n\n if (indexOption === 'all') {\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\n indexOption = idOption = nameOption = null;\n }\n\n result.models = ecModel.queryComponents({\n mainType: mainType,\n index: indexOption,\n id: idOption,\n name: nameOption\n });\n return result;\n}\nexport function setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\nexport function getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\nexport function 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/**\r\n * Group a list by key.\r\n */\n\nexport function groupData(array, getKey // return key\n) {\n var buckets = createHashMap();\n var keys = [];\n 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/**\r\n * Interpolate raw values of a series with percent\r\n *\r\n * @param data data\r\n * @param labelModel label model of the text element\r\n * @param sourceValue start value. May be null/undefined when init.\r\n * @param targetValue end value\r\n * @param percent 0~1 percentage; 0 uses start value while 1 uses end value\r\n * @return interpolated values\r\n * If `sourceValue` and `targetValue` are `number`, return `number`.\r\n * If `sourceValue` and `targetValue` are `string`, return `string`.\r\n * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\r\n * Other cases do not supported.\r\n */\n\nexport function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\n var isAutoPrecision = precision == null || precision === 'auto';\n\n if (targetValue == null) {\n return targetValue;\n }\n\n if (isNumber(targetValue)) {\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\n return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision);\n } else if (isString(targetValue)) {\n return percent < 1 ? sourceValue : targetValue;\n } else {\n var interpolated = [];\n var leftArr = sourceValue;\n var rightArr = targetValue;\n var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\n\n for (var i = 0; i < length_1; ++i) {\n var info = data.getDimensionInfo(i); // Don't interpolate ordinal dims\n\n if (info && info.type === 'ordinal') {\n // In init, there is no `sourceValue`, but should better not to get undefined result.\n interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i];\n } else {\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\n var rightVal = rightArr[i];\n var value = interpolateNumber(leftVal, rightVal, percent);\n interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision);\n }\n }\n\n return interpolated;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\n/**\r\n * Notice, parseClassType('') should returns {main: '', sub: ''}\r\n * @public\r\n */\n\nexport function parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n\n if (componentType) {\n var typeArr = componentType.split(TYPE_DELIMITER);\n ret.main = typeArr[0] || '';\n ret.sub = typeArr[1] || '';\n }\n\n return ret;\n}\n/**\r\n * @public\r\n */\n\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\n\nexport function isExtendedClass(clz) {\n return !!(clz && clz[IS_EXTENDED_CLASS]);\n}\n/**\r\n * Implements `ExtendableConstructor` for `rootClz`.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\r\n * enableClassExtend(Xxx as XxxConstructor);\r\n * ```\r\n */\n\nexport function enableClassExtend(rootClz, mandatoryMethods) {\n rootClz.$constructor = rootClz; // FIXME: not necessary?\n\n rootClz.extend = function (proto) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(mandatoryMethods, function (method) {\n if (!proto[method]) {\n console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');\n }\n });\n }\n\n var superClass = this;\n var ExtendedClass;\n\n if (isESClass(superClass)) {\n ExtendedClass =\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super.apply(this, arguments) || this;\n }\n\n return class_1;\n }(superClass);\n } else {\n // For backward compat, we both support ts class inheritance and this\n // \"extend\" approach.\n // The constructor should keep the same behavior as ts class inheritance:\n // If this constructor/$constructor is not declared, auto invoke the super\n // constructor.\n // If this constructor/$constructor is declared, it is responsible for\n // calling the super constructor.\n ExtendedClass = function () {\n (proto.$constructor || superClass).apply(this, arguments);\n };\n\n zrUtil.inherits(ExtendedClass, this);\n }\n\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass[IS_EXTENDED_CLASS] = true;\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\n\nfunction isESClass(fn) {\n return zrUtil.isFunction(fn) && /^class\\s/.test(Function.prototype.toString.call(fn));\n}\n/**\r\n * A work around to both support ts extend and this extend mechanism.\r\n * on sub-class.\r\n * @usage\r\n * ```ts\r\n * class Component { ... }\r\n * classUtil.enableClassExtend(Component);\r\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\r\n *\r\n * class Series extends Component { ... }\r\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\r\n * Component.markExtend(Series);\r\n * ```\r\n */\n\n\nexport function mountExtend(SubClz, SupperClz) {\n SubClz.extend = SupperClz.extend;\n} // A random offset.\n\nvar classBase = Math.round(Math.random() * 10);\n/**\r\n * Implements `CheckableConstructor` for `target`.\r\n * Can not use instanceof, consider different scope by\r\n * cross domain or es module import in ec extensions.\r\n * Mount a method \"isInstance()\" to Clz.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\r\n * enableClassCheck(Xxx as XxxConstructor)\r\n * ```\r\n */\n\nexport function enableClassCheck(target) {\n var classAttr = ['__\\0is_clz', classBase++].join('_');\n target.prototype[classAttr] = true;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\n }\n\n target.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n} // superCall should have class info, which can not be fetched 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, does not override method f,\n// then when method of class C is called, dead loop occurred.\n\nfunction superCall(context, methodName) {\n var args = [];\n\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n\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/**\r\n * Implements `ClassManager` for `target`\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ClassManager\r\n * enableClassManagement(Xxx as XxxConstructor);\r\n * ```\r\n */\n\n\nexport function enableClassManagement(target) {\n /**\r\n * Component model classes\r\n * key: componentType,\r\n * value:\r\n * componentClass, when componentType is 'a'\r\n * or Object., when componentType is 'a.b'\r\n */\n var storage = {};\n\n target.registerClass = function (clz) {\n // `type` should not be a \"instance member\".\n // If using TS class, should better declared as `static type = 'series.pie'`.\n // otherwise users have to mount `type` on prototype manually.\n // For backward compat and enable instance visit type via `this.type`,\n // we still support fetch `type` from prototype.\n var componentFullType = clz.type || clz.prototype.type;\n\n if (componentFullType) {\n checkClassType(componentFullType); // If only static type declared, we assign it to prototype mandatorily.\n\n clz.prototype.type = componentFullType;\n var componentTypeInfo = parseClassType(componentFullType);\n\n if (!componentTypeInfo.sub) {\n if (process.env.NODE_ENV !== 'production') {\n if (storage[componentTypeInfo.main]) {\n console.warn(componentTypeInfo.main + ' exists.');\n }\n }\n\n storage[componentTypeInfo.main] = clz;\n } else if (componentTypeInfo.sub !== IS_CONTAINER) {\n var container = makeContainer(componentTypeInfo);\n container[componentTypeInfo.sub] = clz;\n }\n }\n\n return clz;\n };\n\n target.getClass = function (mainType, subType, throwWhenNotFound) {\n var clz = storage[mainType];\n\n if (clz && clz[IS_CONTAINER]) {\n clz = subType ? clz[subType] : null;\n }\n\n if (throwWhenNotFound && !clz) {\n throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.');\n }\n\n return clz;\n };\n\n target.getClassesByMainType = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var result = [];\n var obj = storage[componentTypeInfo.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 target.hasClass = function (componentType) {\n // Just consider componentType.main.\n var componentTypeInfo = parseClassType(componentType);\n return !!storage[componentTypeInfo.main];\n };\n /**\r\n * @return Like ['aa', 'bb'], but can not be ['aa.xx']\r\n */\n\n\n target.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\r\n * If a main type is container and has sub types\r\n */\n\n\n target.hasSubTypes = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var obj = storage[componentTypeInfo.main];\n return obj && obj[IS_CONTAINER];\n };\n\n function makeContainer(componentTypeInfo) {\n var container = storage[componentTypeInfo.main];\n\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentTypeInfo.main] = {};\n container[IS_CONTAINER] = true;\n }\n\n return container;\n }\n} // /**\n// * @param {string|Array.} properties\n// */\n// export function setReadOnly(obj, properties) {\n// 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// let 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/*\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO Parse shadow style\n// TODO Only shallow path support\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function makeStyleMapper(properties, ignoreParent) {\n // Normalize\n for (var i = 0; i < properties.length; i++) {\n if (!properties[i][1]) {\n properties[i][1] = properties[i][0];\n }\n }\n\n ignoreParent = ignoreParent || false;\n return function (model, excludes, includes) {\n var style = {};\n\n for (var i = 0; i < properties.length; i++) {\n var propName = properties[i][1];\n\n if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n continue;\n }\n\n var val = model.getShallow(propName, ignoreParent);\n\n if (val != null) {\n style[properties[i][0]] = val;\n }\n } // TODO Text or image?\n\n\n return style;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\n\nvar AreaStyleMixin =\n/** @class */\nfunction () {\n function AreaStyleMixin() {}\n\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\n return getAreaStyle(this, excludes, includes);\n };\n\n return AreaStyleMixin;\n}();\n\n;\nexport { AreaStyleMixin };","import LRU from '../../core/LRU.js';\nimport { platformApi } from '../../core/platform.js';\nvar globalImageCache = new LRU(50);\nexport function findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n }\n else {\n return newImageOrSrc;\n }\n}\nexport function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n }\n else if (typeof newImageOrSrc === 'string') {\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\n return image;\n }\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n }\n else {\n image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);\n image.__zrImageSrc = newImageOrSrc;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n }\n return image;\n }\n else {\n return newImageOrSrc;\n }\n}\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\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 cachedImgObj.pending.length = 0;\n}\nexport function isImageReady(image) {\n return image && image.width && image.height;\n}\n","import * as imageHelper from '../helper/image.js';\nimport { extend, retrieve2, retrieve3, reduce } from '../../core/util.js';\nimport { getLineHeight, getWidth, parsePercent } from '../../contain/text.js';\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nexport function truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n return textLines.join('\\n');\n}\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = options || {};\n var preparedOpts = extend({}, options);\n preparedOpts.font = font;\n ellipsis = retrieve2(ellipsis, '...');\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n preparedOpts.cnCharWidth = getWidth('国', font);\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n var ellipsisWidth = getWidth(ellipsis, font);\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n contentWidth = containerWidth - ellipsisWidth;\n preparedOpts.ellipsis = ellipsis;\n preparedOpts.ellipsisWidth = ellipsisWidth;\n preparedOpts.contentWidth = contentWidth;\n preparedOpts.containerWidth = containerWidth;\n return preparedOpts;\n}\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n if (!containerWidth) {\n return '';\n }\n var lineWidth = getWidth(textLine, font);\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n var subLength = j === 0\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\n : lineWidth > 0\n ? Math.floor(textLine.length * contentWidth / lineWidth)\n : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n if (textLine === '') {\n textLine = options.placeholder;\n }\n return textLine;\n}\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\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 return i;\n}\nexport function parsePlainText(text, style) {\n text != null && (text += '');\n var overflow = style.overflow;\n var padding = style.padding;\n var font = style.font;\n var truncate = overflow === 'truncate';\n var calculatedLineHeight = getLineHeight(font);\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n var bgColorDrawn = !!(style.backgroundColor);\n var truncateLineOverflow = style.lineOverflow === 'truncate';\n var width = style.width;\n var lines;\n if (width != null && (overflow === 'break' || overflow === 'breakAll')) {\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n }\n else {\n lines = text ? text.split('\\n') : [];\n }\n var contentHeight = lines.length * lineHeight;\n var height = retrieve2(style.height, contentHeight);\n if (contentHeight > height && truncateLineOverflow) {\n var lineCount = Math.floor(height / lineHeight);\n lines = lines.slice(0, lineCount);\n }\n if (text && truncate && width != null) {\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\n minChar: style.truncateMinChar,\n placeholder: style.placeholder\n });\n for (var i = 0; i < lines.length; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n var outerHeight = height;\n var contentWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n contentWidth = Math.max(getWidth(lines[i], font), contentWidth);\n }\n if (width == null) {\n width = contentWidth;\n }\n var outerWidth = contentWidth;\n if (padding) {\n outerHeight += padding[0] + padding[2];\n outerWidth += padding[1] + padding[3];\n width += padding[1] + padding[3];\n }\n if (bgColorDrawn) {\n outerWidth = width;\n }\n return {\n lines: lines,\n height: height,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n calculatedLineHeight: calculatedLineHeight,\n contentWidth: contentWidth,\n contentHeight: contentHeight,\n width: width\n };\n}\nvar RichTextToken = (function () {\n function RichTextToken() {\n }\n return RichTextToken;\n}());\nvar RichTextLine = (function () {\n function RichTextLine(tokens) {\n this.tokens = [];\n if (tokens) {\n this.tokens = tokens;\n }\n }\n return RichTextLine;\n}());\nvar RichTextContentBlock = (function () {\n function RichTextContentBlock() {\n this.width = 0;\n this.height = 0;\n this.contentWidth = 0;\n this.contentHeight = 0;\n this.outerWidth = 0;\n this.outerHeight = 0;\n this.lines = [];\n }\n return RichTextContentBlock;\n}());\nexport { RichTextContentBlock };\nexport function parseRichText(text, style) {\n var contentBlock = new RichTextContentBlock();\n text != null && (text += '');\n if (!text) {\n return contentBlock;\n }\n var topWidth = style.width;\n var topHeight = style.height;\n var overflow = style.overflow;\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\n : null;\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n }\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n }\n var pendingList = [];\n var calculatedHeight = 0;\n var calculatedWidth = 0;\n var stlPadding = style.padding;\n var truncate = overflow === 'truncate';\n var truncateLine = style.lineOverflow === 'truncate';\n function finishLine(line, lineWidth, lineHeight) {\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n calculatedHeight += lineHeight;\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\n }\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\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] || {};\n var textPadding = token.textPadding = tokenStyle.padding;\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n var font = token.font = tokenStyle.font || style.font;\n token.contentHeight = getLineHeight(font);\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\n token.innerHeight = tokenHeight;\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\n token.align = tokenStyle && tokenStyle.align || style.align;\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n if (j > 0) {\n line.tokens = line.tokens.slice(0, j);\n finishLine(line, lineWidth, lineHeight);\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n }\n else {\n contentBlock.lines = contentBlock.lines.slice(0, i);\n }\n break outer;\n }\n var styleTokenWidth = tokenStyle.width;\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n token.percentWidth = styleTokenWidth;\n pendingList.push(token);\n token.contentWidth = getWidth(token.text, font);\n }\n else {\n if (tokenWidthNotSpecified) {\n var textBackgroundColor = tokenStyle.backgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image;\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n if (imageHelper.isImageReady(bgImg)) {\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n var remainTruncWidth = truncate && topWidth != null\n ? topWidth - lineWidth : null;\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n token.text = '';\n token.width = token.contentWidth = 0;\n }\n else {\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\n token.width = token.contentWidth = getWidth(token.text, font);\n }\n }\n else {\n token.contentWidth = getWidth(token.text, font);\n }\n }\n token.width += paddingH;\n lineWidth += token.width;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n finishLine(line, lineWidth, lineHeight);\n }\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n contentBlock.contentHeight = calculatedHeight;\n contentBlock.contentWidth = calculatedWidth;\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth;\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n }\n return contentBlock;\n}\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\n var isEmptyStr = str === '';\n var tokenStyle = styleName && style.rich[styleName] || {};\n var lines = block.lines;\n var font = tokenStyle.font || style.font;\n var newLine = false;\n var strLines;\n var linesWidths;\n if (wrapInfo) {\n var tokenPadding = tokenStyle.padding;\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n if (lines.length > 0) {\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\n strLines = str.split('\\n');\n newLine = true;\n }\n }\n wrapInfo.accumWidth = outerWidth_1;\n }\n else {\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n linesWidths = res.linesWidths;\n strLines = res.lines;\n }\n }\n else {\n strLines = str.split('\\n');\n }\n for (var i = 0; i < strLines.length; i++) {\n var text = strLines[i];\n var token = new RichTextToken();\n token.styleName = styleName;\n token.text = text;\n token.isLineHolder = !text && !isEmptyStr;\n if (typeof tokenStyle.width === 'number') {\n token.width = tokenStyle.width;\n }\n else {\n token.width = linesWidths\n ? linesWidths[i]\n : getWidth(text, font);\n }\n if (!i && !newLine) {\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n var tokensLen = tokens.length;\n (tokensLen === 1 && tokens[0].isLineHolder)\n ? (tokens[0] = token)\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n }\n else {\n lines.push(new RichTextLine([token]));\n }\n }\n}\nfunction isAlphabeticLetter(ch) {\n var code = ch.charCodeAt(0);\n return code >= 0x20 && code <= 0x24F\n || code >= 0x370 && code <= 0x10FF\n || code >= 0x1200 && code <= 0x13FF\n || code >= 0x1E00 && code <= 0x206F;\n}\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n obj[ch] = true;\n return obj;\n}, {});\nfunction isWordBreakChar(ch) {\n if (isAlphabeticLetter(ch)) {\n if (breakCharMap[ch]) {\n return true;\n }\n return false;\n }\n return true;\n}\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\n var lines = [];\n var linesWidths = [];\n var line = '';\n var currentWord = '';\n var currentWordWidth = 0;\n var accumWidth = 0;\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch === '\\n') {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = '';\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = 0;\n continue;\n }\n var chWidth = getWidth(ch, font);\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\n if (!lines.length\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\n : accumWidth + chWidth > lineWidth) {\n if (!accumWidth) {\n if (inWord) {\n lines.push(currentWord);\n linesWidths.push(currentWordWidth);\n currentWord = ch;\n currentWordWidth = chWidth;\n }\n else {\n lines.push(ch);\n linesWidths.push(chWidth);\n }\n }\n else if (line || currentWord) {\n if (inWord) {\n if (!line) {\n line = currentWord;\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth - currentWordWidth);\n currentWord += ch;\n currentWordWidth += chWidth;\n line = '';\n accumWidth = currentWordWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = ch;\n accumWidth = chWidth;\n }\n }\n continue;\n }\n accumWidth += chWidth;\n if (inWord) {\n currentWord += ch;\n currentWordWidth += chWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n line += ch;\n }\n }\n if (!lines.length && !line) {\n line = text;\n currentWord = '';\n currentWordWidth = 0;\n }\n if (currentWord) {\n line += currentWord;\n }\n if (line) {\n lines.push(line);\n linesWidths.push(accumWidth);\n }\n if (lines.length === 1) {\n accumWidth += lastAccumWidth;\n }\n return {\n accumWidth: accumWidth,\n lines: lines,\n linesWidths: linesWidths\n };\n}\n","import { __extends } from \"tslib\";\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { keys, extend, createObject } from '../core/util.js';\nimport { REDRAW_BIT, STYLE_CHANGED_BIT } from './constants.js';\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\nexport var DEFAULT_COMMON_STYLE = {\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: '#000',\n opacity: 1,\n blend: 'source-over'\n};\nexport var DEFAULT_COMMON_ANIMATION_PROPS = {\n style: {\n shadowBlur: true,\n shadowOffsetX: true,\n shadowOffsetY: true,\n shadowColor: true,\n opacity: true\n }\n};\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\nvar PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'];\nvar PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible'];\nvar Displayable = (function (_super) {\n __extends(Displayable, _super);\n function Displayable(props) {\n return _super.call(this, props) || this;\n }\n Displayable.prototype._init = function (props) {\n var keysArr = keys(props);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if (key === 'style') {\n this.useStyle(props[key]);\n }\n else {\n _super.prototype.attrKV.call(this, key, props[key]);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Displayable.prototype.beforeBrush = function () { };\n Displayable.prototype.afterBrush = function () { };\n Displayable.prototype.innerBeforeBrush = function () { };\n Displayable.prototype.innerAfterBrush = function () { };\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\n var m = this.transform;\n if (this.ignore\n || this.invisible\n || this.style.opacity === 0\n || (this.culling\n && isDisplayableCulled(this, viewWidth, viewHeight))\n || (m && !m[0] && !m[3])) {\n return false;\n }\n if (considerClipPath && this.__clipPaths) {\n for (var i = 0; i < this.__clipPaths.length; ++i) {\n if (this.__clipPaths[i].isZeroArea()) {\n return false;\n }\n }\n }\n if (considerAncestors && this.parent) {\n var parent_1 = this.parent;\n while (parent_1) {\n if (parent_1.ignore) {\n return false;\n }\n parent_1 = parent_1.parent;\n }\n }\n return true;\n };\n Displayable.prototype.contain = function (x, y) {\n return this.rectContain(x, y);\n };\n Displayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n Displayable.prototype.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 Displayable.prototype.getPaintRect = function () {\n var rect = this._paintRect;\n if (!this._paintRect || this.__dirty) {\n var transform = this.transform;\n var elRect = this.getBoundingRect();\n var style = this.style;\n var shadowSize = style.shadowBlur || 0;\n var shadowOffsetX = style.shadowOffsetX || 0;\n var shadowOffsetY = style.shadowOffsetY || 0;\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n if (transform) {\n BoundingRect.applyTransform(rect, elRect, transform);\n }\n else {\n rect.copy(elRect);\n }\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n }\n var tolerance = this.dirtyRectTolerance;\n if (!rect.isZero()) {\n rect.x = Math.floor(rect.x - tolerance);\n rect.y = Math.floor(rect.y - tolerance);\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n }\n }\n return rect;\n };\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\n if (paintRect) {\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n this._prevPaintRect.copy(paintRect);\n }\n else {\n this._prevPaintRect = null;\n }\n };\n Displayable.prototype.getPrevPaintRect = function () {\n return this._prevPaintRect;\n };\n Displayable.prototype.animateStyle = function (loop) {\n return this.animate('style', loop);\n };\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else {\n this.markRedraw();\n }\n };\n Displayable.prototype.attrKV = function (key, value) {\n if (key !== 'style') {\n _super.prototype.attrKV.call(this, key, value);\n }\n else {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n this.setStyle(value);\n }\n }\n };\n Displayable.prototype.setStyle = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.style[keyOrObj] = value;\n }\n else {\n extend(this.style, keyOrObj);\n }\n this.dirtyStyle();\n return this;\n };\n Displayable.prototype.dirtyStyle = function (notRedraw) {\n if (!notRedraw) {\n this.markRedraw();\n }\n this.__dirty |= STYLE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n };\n Displayable.prototype.dirty = function () {\n this.dirtyStyle();\n };\n Displayable.prototype.styleChanged = function () {\n return !!(this.__dirty & STYLE_CHANGED_BIT);\n };\n Displayable.prototype.styleUpdated = function () {\n this.__dirty &= ~STYLE_CHANGED_BIT;\n };\n Displayable.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_COMMON_STYLE, obj);\n };\n Displayable.prototype.useStyle = function (obj) {\n if (!obj[STYLE_MAGIC_KEY]) {\n obj = this.createStyle(obj);\n }\n if (this.__inHover) {\n this.__hoverStyle = obj;\n }\n else {\n this.style = obj;\n }\n this.dirtyStyle();\n };\n Displayable.prototype.isStyleObject = function (obj) {\n return obj[STYLE_MAGIC_KEY];\n };\n Displayable.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.style && !normalState.style) {\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetStyle;\n if (state && state.style) {\n if (transition) {\n if (keepCurrentStates) {\n targetStyle = state.style;\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else if (needsRestoreToNormal) {\n targetStyle = normalState.style;\n }\n if (targetStyle) {\n if (transition) {\n var sourceStyle = this.style;\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n if (needsRestoreToNormal) {\n var changedKeys = keys(sourceStyle);\n for (var i = 0; i < changedKeys.length; i++) {\n var key = changedKeys[i];\n if (key in targetStyle) {\n targetStyle[key] = targetStyle[key];\n this.style[key] = sourceStyle[key];\n }\n }\n }\n var targetKeys = keys(targetStyle);\n for (var i = 0; i < targetKeys.length; i++) {\n var key = targetKeys[i];\n this.style[key] = this.style[key];\n }\n this._transitionState(stateName, {\n style: targetStyle\n }, animationCfg, this.getAnimationStyleProps());\n }\n else {\n this.useStyle(targetStyle);\n }\n }\n var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;\n for (var i = 0; i < statesKeys.length; i++) {\n var key = statesKeys[i];\n if (state && state[key] != null) {\n this[key] = state[key];\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n this[key] = normalState[key];\n }\n }\n }\n };\n Displayable.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedStyle;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.style) {\n mergedStyle = mergedStyle || {};\n this._mergeStyle(mergedStyle, state.style);\n }\n }\n if (mergedStyle) {\n mergedState.style = mergedStyle;\n }\n return mergedState;\n };\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n extend(targetStyle, sourceStyle);\n return targetStyle;\n };\n Displayable.prototype.getAnimationStyleProps = function () {\n return DEFAULT_COMMON_ANIMATION_PROPS;\n };\n Displayable.initDefaultProps = (function () {\n var dispProto = Displayable.prototype;\n dispProto.type = 'displayable';\n dispProto.invisible = false;\n dispProto.z = 0;\n dispProto.z2 = 0;\n dispProto.zlevel = 0;\n dispProto.culling = false;\n dispProto.cursor = 'pointer';\n dispProto.rectHover = false;\n dispProto.incremental = false;\n dispProto._rect = null;\n dispProto.dirtyRectTolerance = 0;\n dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;\n })();\n return Displayable;\n}(Element));\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el, width, height) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\nexport default Displayable;\n","import * as vec2 from './vector.js';\nimport * as curve from './curve.js';\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();\nexport function fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\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 for (var 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 min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\nexport function 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}\nvar xDim = [];\nvar yDim = [];\nexport function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\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 for (var 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 = cubicExtrema(y0, y1, y2, y3, yDim);\n for (var 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 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}\nexport function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt;\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}\nexport function 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 if (diff % PI2 < 1e-4 && diff > 1e-4) {\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\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);\n startAngle = startAngle % (PI2);\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n endAngle = endAngle % (PI2);\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n }\n else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\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","import * as vec2 from './vector.js';\nimport BoundingRect from './BoundingRect.js';\nimport { devicePixelRatio as dpr } from '../config.js';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox.js';\nimport { cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve.js';\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n R: 7\n};\nvar tmpOutX = [];\nvar tmpOutY = [];\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 mathAbs = Math.abs;\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\nvar tmpAngles = [];\nfunction modPI2(radian) {\n var n = Math.round(radian / PI * 1e8) / 1e8;\n return (n % 2) * PI;\n}\nexport function normalizeArcAngles(angles, anticlockwise) {\n var newStartAngle = modPI2(angles[0]);\n if (newStartAngle < 0) {\n newStartAngle += PI2;\n }\n var delta = newStartAngle - angles[0];\n var newEndAngle = angles[1];\n newEndAngle += delta;\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n newEndAngle = newStartAngle + PI2;\n }\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n newEndAngle = newStartAngle - PI2;\n }\n else if (!anticlockwise && newStartAngle > newEndAngle) {\n newEndAngle = newStartAngle + (PI2 - modPI2(newStartAngle - newEndAngle));\n }\n else if (anticlockwise && newStartAngle < newEndAngle) {\n newEndAngle = newStartAngle - (PI2 - modPI2(newEndAngle - newStartAngle));\n }\n angles[0] = newStartAngle;\n angles[1] = newEndAngle;\n}\nvar PathProxy = (function () {\n function PathProxy(notSaveData) {\n this.dpr = 1;\n this._xi = 0;\n this._yi = 0;\n this._x0 = 0;\n this._y0 = 0;\n this._len = 0;\n if (notSaveData) {\n this._saveData = false;\n }\n if (this._saveData) {\n this.data = [];\n }\n }\n PathProxy.prototype.increaseVersion = function () {\n this._version++;\n };\n PathProxy.prototype.getVersion = function () {\n return this._version;\n };\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n if (segmentIgnoreThreshold > 0) {\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n }\n };\n PathProxy.prototype.setDPR = function (dpr) {\n this.dpr = dpr;\n };\n PathProxy.prototype.setContext = function (ctx) {\n this._ctx = ctx;\n };\n PathProxy.prototype.getContext = function () {\n return this._ctx;\n };\n PathProxy.prototype.beginPath = function () {\n this._ctx && this._ctx.beginPath();\n this.reset();\n return this;\n };\n PathProxy.prototype.reset = function () {\n if (this._saveData) {\n this._len = 0;\n }\n if (this._pathSegLen) {\n this._pathSegLen = null;\n this._pathLen = 0;\n }\n this._version++;\n };\n PathProxy.prototype.moveTo = function (x, y) {\n this._drawPendingPt();\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y);\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n };\n PathProxy.prototype.lineTo = function (x, y) {\n var dx = mathAbs(x - this._xi);\n var dy = mathAbs(y - this._yi);\n var exceedUnit = dx > this._ux || dy > this._uy;\n this.addData(CMD.L, x, y);\n if (this._ctx && exceedUnit) {\n this._ctx.lineTo(x, y);\n }\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n this._pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > this._pendingPtDist) {\n this._pendingPtX = x;\n this._pendingPtY = y;\n this._pendingPtDist = d2;\n }\n }\n return this;\n };\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\n this._drawPendingPt();\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n if (this._ctx) {\n this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n this._xi = x3;\n this._yi = y3;\n return this;\n };\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\n this._drawPendingPt();\n this.addData(CMD.Q, x1, y1, x2, y2);\n if (this._ctx) {\n this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n this._xi = x2;\n this._yi = y2;\n return this;\n };\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this._drawPendingPt();\n tmpAngles[0] = startAngle;\n tmpAngles[1] = endAngle;\n normalizeArcAngles(tmpAngles, anticlockwise);\n startAngle = tmpAngles[0];\n endAngle = tmpAngles[1];\n var delta = endAngle - startAngle;\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 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 PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._drawPendingPt();\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n return this;\n };\n PathProxy.prototype.rect = function (x, y, w, h) {\n this._drawPendingPt();\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n };\n PathProxy.prototype.closePath = function () {\n this._drawPendingPt();\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n if (ctx) {\n ctx.closePath();\n }\n this._xi = x0;\n this._yi = y0;\n return this;\n };\n PathProxy.prototype.fill = function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n };\n PathProxy.prototype.stroke = function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n };\n PathProxy.prototype.len = function () {\n return this._len;\n };\n PathProxy.prototype.setData = function (data) {\n var len = data.length;\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n this._len = len;\n };\n PathProxy.prototype.appendPath = function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n if (hasTypedArray && (this.data instanceof Float32Array)) {\n this.data = new Float32Array(offset + appendSize);\n }\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n this._len = offset;\n };\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\n if (!this._saveData) {\n return;\n }\n var data = this.data;\n if (this._len + arguments.length > data.length) {\n this._expandData();\n data = this.data;\n }\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n };\n PathProxy.prototype._drawPendingPt = function () {\n if (this._pendingPtDist > 0) {\n this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);\n this._pendingPtDist = 0;\n }\n };\n PathProxy.prototype._expandData = function () {\n if (!(this.data instanceof Array)) {\n var newData = [];\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n this.data = newData;\n }\n };\n PathProxy.prototype.toStatic = function () {\n if (!this._saveData) {\n return;\n }\n this._drawPendingPt();\n var data = this.data;\n if (data instanceof Array) {\n data.length = this._len;\n if (hasTypedArray && this._len > 11) {\n this.data = new Float32Array(data);\n }\n }\n };\n PathProxy.prototype.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 var i;\n for (i = 0; i < this._len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n case CMD.L:\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n 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 case CMD.Q:\n 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 case CMD.A:\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;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n 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 case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n }\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n }\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n PathProxy.prototype._calculateLength = function () {\n var data = this.data;\n var len = this._len;\n var ux = this._ux;\n var uy = this._uy;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n if (!this._pathSegLen) {\n this._pathSegLen = [];\n }\n var pathSegLen = this._pathSegLen;\n var pathTotalLen = 0;\n var segCount = 0;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n var l = -1;\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n break;\n case CMD.L: {\n var x2 = data[i++];\n var y2 = data[i++];\n var dx = x2 - xi;\n var dy = y2 - yi;\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x2;\n yi = y2;\n }\n break;\n }\n case CMD.C: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n var x3 = data[i++];\n var y3 = data[i++];\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\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 delta = data[i++];\n var endAngle = delta + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\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 l = width * 2 + height * 2;\n break;\n }\n case CMD.Z: {\n var dx = x0 - xi;\n var dy = y0 - yi;\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (l >= 0) {\n pathSegLen[segCount++] = l;\n pathTotalLen += l;\n }\n }\n this._pathLen = pathTotalLen;\n return pathTotalLen;\n };\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\n var d = this.data;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n var x0;\n var y0;\n var xi;\n var yi;\n var x;\n var y;\n var drawPart = percent < 1;\n var pathSegLen;\n var pathTotalLen;\n var accumLength = 0;\n var segCount = 0;\n var displayedLength;\n var pendingPtDist = 0;\n var pendingPtX;\n var pendingPtY;\n if (drawPart) {\n if (!this._pathSegLen) {\n this._calculateLength();\n }\n pathSegLen = this._pathSegLen;\n pathTotalLen = this._pathLen;\n displayedLength = percent * pathTotalLen;\n if (!displayedLength) {\n return;\n }\n }\n lo: for (var i = 0; i < len;) {\n var cmd = d[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n if (cmd !== CMD.L && pendingPtDist > 0) {\n ctx.lineTo(pendingPtX, pendingPtY);\n pendingPtDist = 0;\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 case CMD.L: {\n x = d[i++];\n y = d[i++];\n var dx = mathAbs(x - xi);\n var dy = mathAbs(y - yi);\n if (dx > ux || dy > uy) {\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > pendingPtDist) {\n pendingPtX = x;\n pendingPtY = y;\n pendingPtDist = d2;\n }\n }\n break;\n }\n case CMD.C: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n var x3 = d[i++];\n var y3 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n break lo;\n }\n accumLength += l;\n }\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n break lo;\n }\n accumLength += l;\n }\n ctx.quadraticCurveTo(x1, y1, x2, y2);\n xi = x2;\n yi = y2;\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 startAngle = d[i++];\n var delta = d[i++];\n var psi = d[i++];\n var anticlockwise = !d[i++];\n var r = (rx > ry) ? rx : ry;\n var isEllipse = mathAbs(rx - ry) > 1e-3;\n var endAngle = startAngle + delta;\n var breakBuild = false;\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n breakBuild = true;\n }\n accumLength += l;\n }\n if (isEllipse && ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n }\n else {\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n }\n if (breakBuild) {\n break lo;\n }\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n x = d[i++];\n y = d[i++];\n var width = d[i++];\n var height = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var d_1 = displayedLength - accumLength;\n ctx.moveTo(x, y);\n ctx.lineTo(x + mathMin(d_1, width), y);\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x + width, y + mathMin(d_1, height));\n }\n d_1 -= height;\n if (d_1 > 0) {\n ctx.lineTo(x + mathMax(width - d_1, 0), y + height);\n }\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x, y + mathMax(height - d_1, 0));\n }\n break lo;\n }\n accumLength += l;\n }\n ctx.rect(x, y, width, height);\n break;\n case CMD.Z:\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n };\n PathProxy.prototype.clone = function () {\n var newProxy = new PathProxy();\n var data = this.data;\n newProxy.data = data.slice ? data.slice()\n : Array.prototype.slice.call(data);\n newProxy._len = this._len;\n return newProxy;\n };\n PathProxy.CMD = CMD;\n PathProxy.initDefaultProps = (function () {\n var proto = PathProxy.prototype;\n proto._saveData = true;\n proto._ux = 0;\n proto._uy = 0;\n proto._pendingPtDist = 0;\n proto._version = 0;\n })();\n return PathProxy;\n}());\nexport default PathProxy;\n","export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n var _a = 0;\n var _b = x0;\n if ((y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)) {\n return false;\n }\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n var tmp = _a * x - y + _b;\n var _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}\n","import * as curve from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n return false;\n }\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n","import { quadraticProjectPoint } from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n return false;\n }\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n","var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}\n","import { normalizeRadian } from './util.js';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n return true;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n","export default function windingLine(x0, y0, x1, y1, x, y) {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n if (y1 === y0) {\n return 0;\n }\n var t = (y - y0) / (y1 - y0);\n var dir = y1 < y0 ? 1 : -1;\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n var x_ = t * (x1 - x0) + x0;\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n","import PathProxy from '../core/PathProxy.js';\nimport * as line from './line.js';\nimport * as cubic from './cubic.js';\nimport * as quadratic from './quadratic.js';\nimport * as arc from './arc.js';\nimport * as curve from '../core/curve.js';\nimport windingLine from './windingLine.js';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n if ((y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\n return 0;\n }\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var w = 0;\n var nExtrema = -1;\n var y0_ = void 0;\n var y1_ = void 0;\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i];\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) {\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n if ((y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)) {\n return 0;\n }\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n for (var i = 0; i < nRoots; i++) {\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) {\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) {\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n if (startAngle > endAngle) {\n var tmp_1 = startAngle;\n startAngle = endAngle;\n endAngle = tmp_1;\n }\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n var w = 0;\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if ((angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n var data = path.data;\n var len = path.len();\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (cmd === CMD.M && i > 1) {\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n }\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\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 }\n else {\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\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 }\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 xi = data[i++];\n yi = data[i++];\n break;\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 }\n else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\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++];\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n x0 = x1;\n y0 = y1;\n }\n var _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n }\n else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\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 x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n return containPath(pathProxy, lineWidth, true, x, y);\n}\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n]);\nvar Path = (function (_super) {\n __extends(Path, _super);\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n Path.prototype.update = function () {\n var _this = this;\n _super.prototype.update.call(this);\n var style = this.style;\n if (style.decal) {\n var decalEl = this._decalEl = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n decalEl.__dirty |= REDRAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n extend(this.style, value);\n }\n }\n else if (key === 'shape') {\n extend(this.shape, value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n if (fillLum > 0.5) {\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n }\n return DARK_LABEL_COLOR;\n };\n Path.prototype.getInsideTextStroke = function (textFill) {\n var pathFill = this.style.fill;\n if (isString(pathFill)) {\n var zr = this.__zr;\n var isDarkMode = !!(zr && zr.isDarkMode());\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n };\n Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };\n Path.prototype.pathUpdated = function () {\n this.__dirty &= ~SHAPE_CHANGED_BIT;\n };\n Path.prototype.getUpdatedPathProxy = function (inBatch) {\n !this.path && this.createPathProxy();\n this.path.beginPath();\n this.buildPath(this.path, this.shape, inBatch);\n return this.path;\n };\n Path.prototype.createPathProxy = function () {\n this.path = new PathProxy(false);\n };\n Path.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n };\n Path.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n Path.prototype.getBoundingRect = function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n if (needsUpdateRect) {\n var firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n this.createPathProxy();\n }\n var path = this.path;\n if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectStroke.copy(rect);\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n var w = style.lineWidth;\n if (!this.hasFill()) {\n var strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n if (lineScale > 1e-10) {\n rectStroke.width += w / lineScale;\n rectStroke.height += w / lineScale;\n rectStroke.x -= w / lineScale / 2;\n rectStroke.y -= w / lineScale / 2;\n }\n }\n return rectStroke;\n }\n return rect;\n };\n Path.prototype.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 if (rect.contain(x, y)) {\n var pathProxy = this.path;\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n if (lineScale > 1e-10) {\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n };\n Path.prototype.dirtyShape = function () {\n this.__dirty |= SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n };\n Path.prototype.dirty = function () {\n this.dirtyStyle();\n this.dirtyShape();\n };\n Path.prototype.animateShape = function (loop) {\n return this.animate('shape', loop);\n };\n Path.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n };\n Path.prototype.attrKV = function (key, value) {\n if (key === 'shape') {\n this.setShape(value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n };\n Path.prototype.setShape = function (keyOrObj, value) {\n var shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj);\n }\n this.dirtyShape();\n return this;\n };\n Path.prototype.shapeChanged = function () {\n return !!(this.__dirty & SHAPE_CHANGED_BIT);\n };\n Path.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n };\n Path.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n };\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetShape;\n if (state && state.shape) {\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n if (targetShape) {\n if (transition) {\n this.shape = extend({}, this.shape);\n var targetShapePrimaryProps = {};\n var shapeKeys = keys(targetShape);\n for (var i = 0; i < shapeKeys.length; i++) {\n var key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n this.shape[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n }, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n };\n Path.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedShape;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n };\n Path.prototype.getAnimationStyleProps = function () {\n return DEFAULT_PATH_ANIMATION_PROPS;\n };\n Path.prototype.isZeroArea = function () {\n return false;\n };\n Path.extend = function (defaultProps) {\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n defaultProps.init && defaultProps.init.call(_this, opts);\n return _this;\n }\n Sub.prototype.getDefaultStyle = function () {\n return clone(defaultProps.style);\n };\n Sub.prototype.getDefaultShape = function () {\n return clone(defaultProps.shape);\n };\n return Sub;\n }(Path));\n for (var key in defaultProps) {\n if (typeof defaultProps[key] === 'function') {\n Sub.prototype[key] = defaultProps[key];\n }\n }\n return Sub;\n };\n Path.initDefaultProps = (function () {\n var pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n })();\n return Path;\n}(Displayable));\nexport default Path;\n","import { __extends } from \"tslib\";\nimport Displayable from './Displayable.js';\nimport { getBoundingRect } from '../contain/text.js';\nimport { DEFAULT_PATH_STYLE } from './Path.js';\nimport { createObject, defaults } from '../core/util.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nexport var DEFAULT_TSPAN_STYLE = defaults({\n strokeFirst: true,\n font: DEFAULT_FONT,\n x: 0,\n y: 0,\n textAlign: 'left',\n textBaseline: 'top',\n miterLimit: 2\n}, DEFAULT_PATH_STYLE);\nvar TSpan = (function (_super) {\n __extends(TSpan, _super);\n function TSpan() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TSpan.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n };\n TSpan.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n TSpan.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_TSPAN_STYLE, obj);\n };\n TSpan.prototype.setBoundingRect = function (rect) {\n this._rect = rect;\n };\n TSpan.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n var text = style.text;\n text != null ? (text += '') : (text = '');\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n if (this.hasStroke()) {\n var w = style.lineWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n this._rect = rect;\n }\n return this._rect;\n };\n TSpan.initDefaultProps = (function () {\n var tspanProto = TSpan.prototype;\n tspanProto.dirtyRectTolerance = 10;\n })();\n return TSpan;\n}(Displayable));\nTSpan.prototype.type = 'tspan';\nexport default TSpan;\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { defaults, createObject } from '../core/util.js';\nexport var DEFAULT_IMAGE_STYLE = defaults({\n x: 0,\n y: 0\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_IMAGE_ANIMATION_PROPS = {\n style: defaults({\n x: true,\n y: true,\n width: true,\n height: true,\n sx: true,\n sy: true,\n sWidth: true,\n sHeight: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nfunction isImageLike(source) {\n return !!(source\n && typeof source !== 'string'\n && source.width && source.height);\n}\nvar ZRImage = (function (_super) {\n __extends(ZRImage, _super);\n function ZRImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ZRImage.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_IMAGE_STYLE, obj);\n };\n ZRImage.prototype._getSize = function (dim) {\n var style = this.style;\n var size = style[dim];\n if (size != null) {\n return size;\n }\n var imageSource = isImageLike(style.image)\n ? style.image : this.__image;\n if (!imageSource) {\n return 0;\n }\n var otherDim = dim === 'width' ? 'height' : 'width';\n var otherDimSize = style[otherDim];\n if (otherDimSize == null) {\n return imageSource[dim];\n }\n else {\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n }\n };\n ZRImage.prototype.getWidth = function () {\n return this._getSize('width');\n };\n ZRImage.prototype.getHeight = function () {\n return this._getSize('height');\n };\n ZRImage.prototype.getAnimationStyleProps = function () {\n return DEFAULT_IMAGE_ANIMATION_PROPS;\n };\n ZRImage.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\n }\n return this._rect;\n };\n return ZRImage;\n}(Displayable));\nZRImage.prototype.type = 'image';\nexport default ZRImage;\n","export function 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;\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n var total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\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","var round = Math.round;\nexport function subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n return outputShape;\n}\nexport function subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\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 return outputShape;\n}\nexport function subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n }\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0\n ? doubledPosition / 2\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundRectHelper from '../helper/roundRect.js';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize.js';\nvar RectShape = (function () {\n function RectShape() {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n }\n return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n __extends(Rect, _super);\n function Rect(opts) {\n return _super.call(this, opts) || this;\n }\n Rect.prototype.getDefaultShape = function () {\n return new RectShape();\n };\n Rect.prototype.buildPath = function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n };\n Rect.prototype.isZeroArea = function () {\n return !this.shape.width || !this.shape.height;\n };\n return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n","import { __extends } from \"tslib\";\nimport { parseRichText, parsePlainText } from './helper/parseText.js';\nimport TSpan from './TSpan.js';\nimport { retrieve2, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util.js';\nimport { adjustTextX, adjustTextY } from '../contain/text.js';\nimport ZRImage from './Image.js';\nimport Rect from './shape/Rect.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Displayable, { DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_SIZE } from '../core/platform.js';\nvar DEFAULT_RICH_TEXT_COLOR = {\n fill: '#000'\n};\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\nexport var DEFAULT_TEXT_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineWidth: true,\n fontSize: true,\n lineHeight: true,\n width: true,\n height: true,\n textShadowColor: true,\n textShadowBlur: true,\n textShadowOffsetX: true,\n textShadowOffsetY: true,\n backgroundColor: true,\n padding: true,\n borderColor: true,\n borderWidth: true,\n borderRadius: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar ZRText = (function (_super) {\n __extends(ZRText, _super);\n function ZRText(opts) {\n var _this = _super.call(this) || this;\n _this.type = 'text';\n _this._children = [];\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\n _this.attr(opts);\n return _this;\n }\n ZRText.prototype.childrenRef = function () {\n return this._children;\n };\n ZRText.prototype.update = function () {\n _super.prototype.update.call(this);\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.zlevel = this.zlevel;\n child.z = this.z;\n child.z2 = this.z2;\n child.culling = this.culling;\n child.cursor = this.cursor;\n child.invisible = this.invisible;\n }\n };\n ZRText.prototype.updateTransform = function () {\n var innerTransformable = this.innerTransformable;\n if (innerTransformable) {\n innerTransformable.updateTransform();\n if (innerTransformable.transform) {\n this.transform = innerTransformable.transform;\n }\n }\n else {\n _super.prototype.updateTransform.call(this);\n }\n };\n ZRText.prototype.getLocalTransform = function (m) {\n var innerTransformable = this.innerTransformable;\n return innerTransformable\n ? innerTransformable.getLocalTransform(m)\n : _super.prototype.getLocalTransform.call(this, m);\n };\n ZRText.prototype.getComputedTransform = function () {\n if (this.__hostTarget) {\n this.__hostTarget.getComputedTransform();\n this.__hostTarget.updateInnerText(true);\n }\n return _super.prototype.getComputedTransform.call(this);\n };\n ZRText.prototype._updateSubTexts = function () {\n this._childCursor = 0;\n normalizeTextStyle(this.style);\n this.style.rich\n ? this._updateRichTexts()\n : this._updatePlainTexts();\n this._children.length = this._childCursor;\n this.styleUpdated();\n };\n ZRText.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = zr;\n }\n };\n ZRText.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = null;\n }\n };\n ZRText.prototype.getBoundingRect = function () {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n if (!this._rect) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n this._rect = rect || tmpRect;\n }\n return this._rect;\n };\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n };\n ZRText.prototype.setTextContent = function (textContent) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Can\\'t attach text on another text');\n }\n };\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n if (!sourceStyle) {\n return targetStyle;\n }\n var sourceRich = sourceStyle.rich;\n var targetRich = targetStyle.rich || (sourceRich && {});\n extend(targetStyle, sourceStyle);\n if (sourceRich && targetRich) {\n this._mergeRich(targetRich, sourceRich);\n targetStyle.rich = targetRich;\n }\n else if (targetRich) {\n targetStyle.rich = targetRich;\n }\n return targetStyle;\n };\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\n var richNames = keys(sourceRich);\n for (var i = 0; i < richNames.length; i++) {\n var richName = richNames[i];\n targetRich[richName] = targetRich[richName] || {};\n extend(targetRich[richName], sourceRich[richName]);\n }\n };\n ZRText.prototype.getAnimationStyleProps = function () {\n return DEFAULT_TEXT_ANIMATION_PROPS;\n };\n ZRText.prototype._getOrCreateChild = function (Ctor) {\n var child = this._children[this._childCursor];\n if (!child || !(child instanceof Ctor)) {\n child = new Ctor();\n }\n this._children[this._childCursor++] = child;\n child.__zr = this.__zr;\n child.parent = this;\n return child;\n };\n ZRText.prototype._updatePlainTexts = function () {\n var style = this.style;\n var textFont = style.font || DEFAULT_FONT;\n var textPadding = style.padding;\n var text = getStyleText(style);\n var contentBlock = parsePlainText(text, style);\n var needDrawBg = needDrawBackground(style);\n var bgColorDrawn = !!(style.backgroundColor);\n var outerHeight = contentBlock.outerHeight;\n var outerWidth = contentBlock.outerWidth;\n var contentWidth = contentBlock.contentWidth;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var defaultStyle = this._defaultStyle;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.align || defaultStyle.align || 'left';\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n var textX = baseX;\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n if (needDrawBg || textPadding) {\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n textY += lineHeight / 2;\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n if (verticalAlign === 'top') {\n textY += textPadding[0];\n }\n else if (verticalAlign === 'bottom') {\n textY -= textPadding[2];\n }\n }\n var defaultLineWidth = 0;\n var useDefaultFill = false;\n var textFill = getFill('fill' in style\n ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in style\n ? style.stroke\n : (!bgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill))\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = style.textShadowBlur > 0;\n var fixedBoundingRect = style.width != null\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\n for (var i = 0; i < textLines.length; i++) {\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n subElStyle.text = textLines[i];\n subElStyle.x = textX;\n subElStyle.y = textY;\n if (textAlign) {\n subElStyle.textAlign = textAlign;\n }\n subElStyle.textBaseline = 'middle';\n subElStyle.opacity = style.opacity;\n subElStyle.strokeFirst = true;\n if (hasShadow) {\n subElStyle.shadowBlur = style.textShadowBlur || 0;\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n }\n subElStyle.stroke = textStroke;\n subElStyle.fill = textFill;\n if (textStroke) {\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n subElStyle.lineDash = style.lineDash;\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n }\n subElStyle.font = textFont;\n setSeparateFont(subElStyle, style);\n textY += lineHeight;\n if (fixedBoundingRect) {\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight));\n }\n }\n };\n ZRText.prototype._updateRichTexts = function () {\n var style = this.style;\n var text = getStyleText(style);\n var contentBlock = parseRichText(text, style);\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.padding;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var defaultStyle = this._defaultStyle;\n var textAlign = style.align || defaultStyle.align;\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n var xRight = xLeft + contentWidth;\n if (needDrawBackground(style)) {\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n var bgColorDrawn = !!(style.backgroundColor);\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 remainedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token = void 0;\n while (leftIndex < tokenCount\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n remainedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n while (rightIndex >= 0\n && (token = tokens[rightIndex], token.align === 'right')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n remainedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n }\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex];\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\n lineXLeft += token.width;\n leftIndex++;\n }\n lineTop += lineHeight;\n }\n };\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text;\n var verticalAlign = token.verticalAlign;\n var y = lineTop + lineHeight / 2;\n if (verticalAlign === 'top') {\n y = lineTop + token.height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\n ? x - token.width\n : textAlign === 'center'\n ? x - token.width / 2\n : x, y - token.height / 2, token.width, token.height);\n var bgColorDrawn = !!tokenStyle.backgroundColor;\n var textPadding = token.textPadding;\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n }\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n var defaultStyle = this._defaultStyle;\n var useDefaultFill = false;\n var defaultLineWidth = 0;\n var textFill = getFill('fill' in tokenStyle ? tokenStyle.fill\n : 'fill' in style ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\n : 'stroke' in style ? style.stroke\n : (!bgColorDrawn\n && !parentBgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = tokenStyle.textShadowBlur > 0\n || style.textShadowBlur > 0;\n subElStyle.text = token.text;\n subElStyle.x = x;\n subElStyle.y = y;\n if (hasShadow) {\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n }\n subElStyle.textAlign = textAlign;\n subElStyle.textBaseline = 'middle';\n subElStyle.font = token.font || DEFAULT_FONT;\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n setSeparateFont(subElStyle, tokenStyle);\n if (textStroke) {\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n subElStyle.stroke = textStroke;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n var textWidth = token.contentWidth;\n var textHeight = token.contentHeight;\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\n };\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\n var textBackgroundColor = style.backgroundColor;\n var textBorderWidth = style.borderWidth;\n var textBorderColor = style.borderColor;\n var isImageBg = textBackgroundColor && textBackgroundColor.image;\n var isPlainOrGradientBg = textBackgroundColor && !isImageBg;\n var textBorderRadius = style.borderRadius;\n var self = this;\n var rectEl;\n var imgEl;\n if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) {\n rectEl = this._getOrCreateChild(Rect);\n rectEl.useStyle(rectEl.createStyle());\n rectEl.style.fill = null;\n var rectShape = rectEl.shape;\n rectShape.x = x;\n rectShape.y = y;\n rectShape.width = width;\n rectShape.height = height;\n rectShape.r = textBorderRadius;\n rectEl.dirtyShape();\n }\n if (isPlainOrGradientBg) {\n var rectStyle = rectEl.style;\n rectStyle.fill = textBackgroundColor || null;\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n }\n else if (isImageBg) {\n imgEl = this._getOrCreateChild(ZRImage);\n imgEl.onload = function () {\n self.dirtyStyle();\n };\n var imgStyle = imgEl.style;\n imgStyle.image = textBackgroundColor.image;\n imgStyle.x = x;\n imgStyle.y = y;\n imgStyle.width = width;\n imgStyle.height = height;\n }\n if (textBorderWidth && textBorderColor) {\n var rectStyle = rectEl.style;\n rectStyle.lineWidth = textBorderWidth;\n rectStyle.stroke = textBorderColor;\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n rectStyle.lineDash = style.borderDash;\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\n rectEl.strokeContainThreshold = 0;\n if (rectEl.hasFill() && rectEl.hasStroke()) {\n rectStyle.strokeFirst = true;\n rectStyle.lineWidth *= 2;\n }\n }\n var commonStyle = (rectEl || imgEl).style;\n commonStyle.shadowBlur = style.shadowBlur || 0;\n commonStyle.shadowColor = style.shadowColor || 'transparent';\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n };\n ZRText.makeFont = function (style) {\n var font = '';\n if (hasSeparateFont(style)) {\n font = [\n style.fontStyle,\n style.fontWeight,\n parseFontSize(style.fontSize),\n style.fontFamily || 'sans-serif'\n ].join(' ');\n }\n return font && trim(font) || style.textFont || style.font;\n };\n return ZRText;\n}(Displayable));\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\nvar FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];\nexport function parseFontSize(fontSize) {\n if (typeof fontSize === 'string'\n && (fontSize.indexOf('px') !== -1\n || fontSize.indexOf('rem') !== -1\n || fontSize.indexOf('em') !== -1)) {\n return fontSize;\n }\n else if (!isNaN(+fontSize)) {\n return fontSize + 'px';\n }\n else {\n return DEFAULT_FONT_SIZE + 'px';\n }\n}\nfunction setSeparateFont(targetStyle, sourceStyle) {\n for (var i = 0; i < FONT_PARTS.length; i++) {\n var fontProp = FONT_PARTS[i];\n var val = sourceStyle[fontProp];\n if (val != null) {\n targetStyle[fontProp] = val;\n }\n }\n}\nexport function hasSeparateFont(style) {\n return style.fontSize != null || style.fontFamily || style.fontWeight;\n}\nexport function normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\nfunction normalizeStyle(style) {\n if (style) {\n style.font = ZRText.makeFont(style);\n var textAlign = style.align;\n textAlign === 'middle' && (textAlign = 'center');\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\n var verticalAlign = style.verticalAlign;\n verticalAlign === 'center' && (verticalAlign = 'middle');\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\n var textPadding = style.padding;\n if (textPadding) {\n style.padding = normalizeCssArray(style.padding);\n }\n }\n}\nfunction getStroke(stroke, lineWidth) {\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n ? null\n : (stroke.image || stroke.colorStops)\n ? '#000'\n : stroke;\n}\nfunction getFill(fill) {\n return (fill == null || fill === 'none')\n ? null\n : (fill.image || fill.colorStops)\n ? '#000'\n : fill;\n}\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right'\n ? (x - textPadding[1])\n : textAlign === 'center'\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n : (x + textPadding[3]);\n}\nfunction getStyleText(style) {\n var text = style.text;\n text != null && (text += '');\n return text;\n}\nfunction needDrawBackground(style) {\n return !!(style.backgroundColor\n || style.lineHeight\n || (style.borderWidth && style.borderColor));\n}\nexport default ZRText;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from './model.js';\nexport var getECData = makeInner();\nexport var setCommonECData = function (seriesIndex, dataType, dataIdx, el) {\n if (el) {\n var ecData = getECData(el); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n ecData.dataIndex = dataIdx;\n ecData.dataType = dataType;\n ecData.seriesIndex = seriesIndex; // TODO: not store dataIndex on children.\n\n if (el.type === 'group') {\n el.traverse(function (child) {\n var childECData = getECData(child);\n childECData.seriesIndex = seriesIndex;\n childECData.dataIndex = dataIdx;\n childECData.dataType = dataType;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { extend, indexOf, isArrayLike, isObject, keys, isArray, each, isString, isGradientObject, map } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport * as colorTool from 'zrender/lib/tool/color.js';\nimport { queryDataIndex, makeInner } from './model.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { error } from './log.js'; // Reserve 0 as default.\n\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar getSavedStates = makeInner();\nvar getComponentStates = makeInner();\nexport var HOVER_STATE_NORMAL = 0;\nexport var HOVER_STATE_BLUR = 1;\nexport var HOVER_STATE_EMPHASIS = 2;\nexport var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\nexport var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\nexport var Z2_EMPHASIS_LIFT = 10;\nexport var Z2_SELECT_LIFT = 9;\nexport var HIGHLIGHT_ACTION_TYPE = 'highlight';\nexport var DOWNPLAY_ACTION_TYPE = 'downplay';\nexport var SELECT_ACTION_TYPE = 'select';\nexport var UNSELECT_ACTION_TYPE = 'unselect';\nexport var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\n\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n} // Most lifted color are duplicated.\n\n\nvar liftedColorCache = new LRU(100);\n\nfunction liftColor(color) {\n if (isString(color)) {\n var liftedColor = liftedColorCache.get(color);\n\n if (!liftedColor) {\n liftedColor = colorTool.lift(color, -0.1);\n liftedColorCache.put(color, liftedColor);\n }\n\n return liftedColor;\n } else if (isGradientObject(color)) {\n var ret = extend({}, color);\n ret.colorStops = map(color.colorStops, function (stop) {\n return {\n offset: stop.offset,\n color: colorTool.lift(stop.color, -0.1)\n };\n });\n return ret;\n } // Change nothing.\n\n\n return color;\n}\n\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\n el.onHoverStateChange(stateName);\n }\n\n el.hoverState = hoverStateEnum;\n}\n\nfunction singleEnterEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\n}\n\nfunction singleLeaveEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterBlur(el) {\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\n}\n\nfunction singleLeaveBlur(el) {\n if (el.hoverState === HOVER_STATE_BLUR) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterSelect(el) {\n el.selected = true;\n}\n\nfunction singleLeaveSelect(el) {\n el.selected = false;\n}\n\nfunction updateElementState(el, updater, commonParam) {\n updater(el, commonParam);\n}\n\nfunction traverseUpdateState(el, updater, commonParam) {\n updateElementState(el, updater, commonParam);\n el.isGroup && el.traverse(function (child) {\n updateElementState(child, updater, commonParam);\n });\n}\n\nexport function setStatesFlag(el, stateName) {\n switch (stateName) {\n case 'emphasis':\n el.hoverState = HOVER_STATE_EMPHASIS;\n break;\n\n case 'normal':\n el.hoverState = HOVER_STATE_NORMAL;\n break;\n\n case 'blur':\n el.hoverState = HOVER_STATE_BLUR;\n break;\n\n case 'select':\n el.selected = true;\n }\n}\n/**\r\n * If we reuse elements when rerender.\r\n * DON'T forget to clearStates before we update the style and shape.\r\n * Or we may update on the wrong state instead of normal state.\r\n */\n\nexport function clearStates(el) {\n if (el.isGroup) {\n el.traverse(function (child) {\n child.clearStates();\n });\n } else {\n el.clearStates();\n }\n}\n\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\n var style = el.style;\n var fromState = {};\n\n for (var i = 0; i < props.length; i++) {\n var propName = props[i];\n var val = style[propName];\n fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.__fromStateTransition // Don't consider the animation to emphasis state.\n && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') {\n animator.saveTo(fromState, props);\n }\n }\n\n return fromState;\n}\n\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\n var cloned = false;\n\n if (el instanceof Path) {\n var store = getSavedStates(el);\n var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill;\n var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke;\n\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\n state = state || {};\n var emphasisStyle = state.style || {}; // inherit case\n\n if (emphasisStyle.fill === 'inherit') {\n cloned = true;\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n emphasisStyle.fill = fromFill;\n } // Apply default color lift\n else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\n cloned = true; // Not modify the original value.\n\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times.\n\n emphasisStyle.fill = liftColor(fromFill);\n } // Not highlight stroke if fill has been highlighted.\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\n if (!cloned) {\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n }\n\n emphasisStyle.stroke = liftColor(fromStroke);\n }\n\n state.style = emphasisStyle;\n }\n }\n\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n if (!cloned) {\n state = extend({}, state);\n }\n\n var z2EmphasisLift = el.z2EmphasisLift;\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createSelectDefaultState(el, stateName, state) {\n // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n state = extend({}, state);\n var z2SelectLift = el.z2SelectLift;\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createBlurDefaultState(el, stateName, state) {\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\n var currentOpacity = el.style.opacity;\n var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, {\n opacity: 1\n }) : null;\n state = state || {};\n var blurStyle = state.style || {};\n\n if (blurStyle.opacity == null) {\n // clone state\n state = extend({}, state);\n blurStyle = extend({\n // Already being applied 'emphasis'. DON'T mul opacity multiple times.\n opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1\n }, blurStyle);\n state.style = blurStyle;\n }\n\n return state;\n}\n\nfunction elementStateProxy(stateName, targetStates) {\n var state = this.states[stateName];\n\n if (this.style) {\n if (stateName === 'emphasis') {\n return createEmphasisDefaultState(this, stateName, targetStates, state);\n } else if (stateName === 'blur') {\n return createBlurDefaultState(this, stateName, state);\n } else if (stateName === 'select') {\n return createSelectDefaultState(this, stateName, state);\n }\n }\n\n return state;\n}\n/**\r\n * Set hover style (namely \"emphasis style\") of element.\r\n * @param el Should not be `zrender/graphic/Group`.\r\n * @param focus 'self' | 'selfInSeries' | 'series'\r\n */\n\n\nexport function setDefaultStateProxy(el) {\n el.stateProxy = elementStateProxy;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (textContent) {\n textContent.stateProxy = elementStateProxy;\n }\n\n if (textGuide) {\n textGuide.stateProxy = elementStateProxy;\n }\n}\nexport function enterEmphasisWhenMouseOver(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasisWhenMouseOut(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterEmphasis(el, highlightDigit) {\n el.__highByOuter |= 1 << (highlightDigit || 0);\n traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasis(el, highlightDigit) {\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterBlur(el) {\n traverseUpdateState(el, singleEnterBlur);\n}\nexport function leaveBlur(el) {\n traverseUpdateState(el, singleLeaveBlur);\n}\nexport function enterSelect(el) {\n traverseUpdateState(el, singleEnterSelect);\n}\nexport function leaveSelect(el) {\n traverseUpdateState(el, singleLeaveSelect);\n}\n\nfunction shouldSilent(el, e) {\n return el.__highDownSilentOnTouch && e.zrByTouch;\n}\n\nexport function allLeaveBlur(api) {\n var model = api.getModel();\n var leaveBlurredSeries = [];\n var allComponentViews = [];\n model.eachComponent(function (componentType, componentModel) {\n var componentStates = getComponentStates(componentModel);\n var isSeries = componentType === 'series';\n var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel);\n !isSeries && allComponentViews.push(view);\n\n if (componentStates.isBlured) {\n // Leave blur anyway\n view.group.traverse(function (child) {\n singleLeaveBlur(child);\n });\n isSeries && leaveBlurredSeries.push(componentModel);\n }\n\n componentStates.isBlured = false;\n });\n each(allComponentViews, function (view) {\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(leaveBlurredSeries, false, model);\n }\n });\n}\nexport function blurSeries(targetSeriesIndex, focus, blurScope, api) {\n var ecModel = api.getModel();\n blurScope = blurScope || 'coordinateSystem';\n\n function leaveBlurOfIndices(data, dataIndices) {\n for (var i = 0; i < dataIndices.length; i++) {\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\n itemEl && leaveBlur(itemEl);\n }\n }\n\n if (targetSeriesIndex == null) {\n return;\n }\n\n if (!focus || focus === 'none') {\n return;\n }\n\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\n var targetCoordSys = targetSeriesModel.coordinateSystem;\n\n if (targetCoordSys && targetCoordSys.master) {\n targetCoordSys = targetCoordSys.master;\n }\n\n var blurredSeries = [];\n ecModel.eachSeries(function (seriesModel) {\n var sameSeries = targetSeriesModel === seriesModel;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.master) {\n coordSys = coordSys.master;\n }\n\n var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead.\n\n if (!( // Not blur other series if blurScope series\n blurScope === 'series' && !sameSeries // Not blur other coordinate system if blurScope is coordinateSystem\n || blurScope === 'coordinateSystem' && !sameCoordSys // Not blur self series if focus is series.\n || focus === 'series' && sameSeries // TODO blurScope: coordinate system\n )) {\n var view = api.getViewOfSeriesModel(seriesModel);\n view.group.traverse(function (child) {\n // For the elements that have been triggered by other components,\n // and are still required to be highlighted,\n // because the current is directly forced to blur the element,\n // it will cause the focus self to be unable to highlight, so skip the blur of this element.\n if (child.__highByOuter && sameSeries && focus === 'self') {\n return;\n }\n\n singleEnterBlur(child);\n });\n\n if (isArrayLike(focus)) {\n leaveBlurOfIndices(seriesModel.getData(), focus);\n } else if (isObject(focus)) {\n var dataTypes = keys(focus);\n\n for (var d = 0; d < dataTypes.length; d++) {\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\n }\n }\n\n blurredSeries.push(seriesModel);\n getComponentStates(seriesModel).isBlured = true;\n }\n });\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(blurredSeries, true, ecModel);\n }\n });\n}\nexport function blurComponent(componentMainType, componentIndex, api) {\n if (componentMainType == null || componentIndex == null) {\n return;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return;\n }\n\n getComponentStates(componentModel).isBlured = true;\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.focusBlurEnabled) {\n return;\n }\n\n view.group.traverse(function (child) {\n singleEnterBlur(child);\n });\n}\nexport function blurSeriesFromHighlightPayload(seriesModel, payload, api) {\n var seriesIndex = seriesModel.seriesIndex;\n var data = seriesModel.getData(payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n var dataIndex = queryDataIndex(data, payload); // Pick the first one if there is multiple/none exists.\n\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\n var el = data.getItemGraphicEl(dataIndex);\n\n if (!el) {\n var count = data.count();\n var current = 0; // If data on dataIndex is NaN.\n\n while (!el && current < count) {\n el = data.getItemGraphicEl(current++);\n }\n }\n\n if (el) {\n var ecData = getECData(el);\n blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api);\n } else {\n // If there is no element put on the data. Try getting it from raw option\n // TODO Should put it on seriesModel?\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n\n if (focus_1 != null) {\n blurSeries(seriesIndex, focus_1, blurScope, api);\n }\n }\n}\nexport function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) {\n var ret = {\n focusSelf: false,\n dispatchers: null\n };\n\n if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) {\n return ret;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return ret;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.findHighDownDispatchers) {\n return ret;\n }\n\n var dispatchers = view.findHighDownDispatchers(name); // At presnet, the component (like Geo) only blur inside itself.\n // So we do not use `blurScope` in component.\n\n var focusSelf;\n\n for (var i = 0; i < dispatchers.length; i++) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatchers[i])) {\n error('param should be highDownDispatcher');\n }\n\n if (getECData(dispatchers[i]).focus === 'self') {\n focusSelf = true;\n break;\n }\n }\n\n return {\n focusSelf: focusSelf,\n dispatchers: dispatchers\n };\n}\nexport function handleGlobalMouseOverForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n var ecData = getECData(dispatcher);\n\n var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api),\n dispatchers = _a.dispatchers,\n focusSelf = _a.focusSelf; // If `findHighDownDispatchers` is supported on the component,\n // highlight/downplay elements with the same name.\n\n\n if (dispatchers) {\n if (focusSelf) {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n }\n\n each(dispatchers, function (dispatcher) {\n return enterEmphasisWhenMouseOver(dispatcher, e);\n });\n } else {\n // Try blur all in the related series. Then emphasis the hoverred.\n // TODO. progressive mode.\n blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\n\n if (ecData.focus === 'self') {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n } // Other than series, component that not support `findHighDownDispatcher` will\n // also use it. But in this case, highlight/downplay are only supported in\n // mouse hover but not in dispatchAction.\n\n\n enterEmphasisWhenMouseOver(dispatcher, e);\n }\n}\nexport function handleGlobalMouseOutForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n allLeaveBlur(api);\n var ecData = getECData(dispatcher);\n var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers;\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n return leaveEmphasisWhenMouseOut(dispatcher, e);\n });\n } else {\n leaveEmphasisWhenMouseOut(dispatcher, e);\n }\n}\nexport function toggleSelectionFromPayload(seriesModel, payload, api) {\n if (!isSelectChangePayload(payload)) {\n return;\n }\n\n var dataType = payload.dataType;\n var data = seriesModel.getData(dataType);\n var dataIndex = queryDataIndex(data, payload);\n\n if (!isArray(dataIndex)) {\n dataIndex = [dataIndex];\n }\n\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\n}\nexport function updateSeriesElementSelection(seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n data.eachItemGraphicEl(function (el, idx) {\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\n });\n });\n}\nexport function getAllSelectedIndices(ecModel) {\n var ret = [];\n ecModel.eachSeries(function (seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n var dataIndices = seriesModel.getSelectedDataIndices();\n\n if (dataIndices.length > 0) {\n var item = {\n dataIndex: dataIndices,\n seriesIndex: seriesModel.seriesIndex\n };\n\n if (type != null) {\n item.dataType = type;\n }\n\n ret.push(item);\n }\n });\n });\n return ret;\n}\n/**\r\n * Enable the function that mouseover will trigger the emphasis state.\r\n *\r\n * NOTE:\r\n * This function should be used on the element with dataIndex, seriesIndex.\r\n *\r\n */\n\nexport function enableHoverEmphasis(el, focus, blurScope) {\n setAsHighDownDispatcher(el, true);\n traverseUpdateState(el, setDefaultStateProxy);\n enableHoverFocus(el, focus, blurScope);\n}\nexport function disableHoverEmphasis(el) {\n setAsHighDownDispatcher(el, false);\n}\nexport function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {\n isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope);\n}\nexport function enableHoverFocus(el, focus, blurScope) {\n var ecData = getECData(el);\n\n if (focus != null) {\n // TODO dataIndex may be set after this function. This check is not useful.\n // if (ecData.dataIndex == null) {\n // if (__DEV__) {\n // console.warn('focus can only been set on element with dataIndex');\n // }\n // }\n // else {\n ecData.focus = focus;\n ecData.blurScope = blurScope; // }\n } else if (ecData.focus) {\n ecData.focus = null;\n }\n}\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\nvar defaultStyleGetterMap = {\n itemStyle: 'getItemStyle',\n lineStyle: 'getLineStyle',\n areaStyle: 'getAreaStyle'\n};\n/**\r\n * Set emphasis/blur/selected states of element.\r\n */\n\nexport function setStatesStylesFromModel(el, itemModel, styleType, // default itemStyle\ngetter) {\n styleType = styleType || 'itemStyle';\n\n for (var i = 0; i < OTHER_STATES.length; i++) {\n var stateName = OTHER_STATES[i];\n var model = itemModel.getModel([stateName, styleType]);\n var state = el.ensureState(stateName); // Let it throw error if getterType is not found.\n\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\n }\n}\n/**\r\n *\r\n * Set element as highlight / downplay dispatcher.\r\n * It will be checked when element received mouseover event or from highlight action.\r\n * It's in change of all highlight/downplay behavior of it's children.\r\n *\r\n * @param el\r\n * @param el.highDownSilentOnTouch\r\n * In touch device, mouseover event will be trigger on touchstart event\r\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\r\n * conveniently use hoverStyle when tap on touch screen without additional\r\n * code for compatibility.\r\n * But if the chart/component has select feature, which usually also use\r\n * hoverStyle, there might be conflict between 'select-highlight' and\r\n * 'hover-highlight' especially when roam is enabled (see geo for example).\r\n * In this case, `highDownSilentOnTouch` should be used to disable\r\n * hover-highlight on touch device.\r\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\r\n */\n\nexport function setAsHighDownDispatcher(el, asDispatcher) {\n var disable = asDispatcher === false;\n var extendedEl = el; // Make `highDownSilentOnTouch` and `onStateChange` only work after\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n\n if (el.highDownSilentOnTouch) {\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n } // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n\n if (!disable || extendedEl.__highDownDispatcher) {\n // Emphasis, normal can be triggered manually by API or other components like hover link.\n // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\n // Also keep previous record.\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\n extendedEl.__highDownDispatcher = !disable;\n }\n}\nexport function isHighDownDispatcher(el) {\n return !!(el && el.__highDownDispatcher);\n}\n/**\r\n * Enable component highlight/downplay features:\r\n * + hover link (within the same name)\r\n * + focus blur in component\r\n */\n\nexport function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n var ecData = getECData(el);\n ecData.componentMainType = componentModel.mainType;\n ecData.componentIndex = componentModel.componentIndex;\n ecData.componentHighDownName = componentHighDownName;\n}\n/**\r\n * Support highlight/downplay record on each elements.\r\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\r\n * user triggered highlight/downplay should not conflict.\r\n * Only all of the highlightDigit cleared, return to normal.\r\n * @param {string} highlightKey\r\n * @return {number} highlightDigit\r\n */\n\nexport function getHighlightDigit(highlightKey) {\n var highlightDigit = _highlightKeyMap[highlightKey];\n\n if (highlightDigit == null && _highlightNextDigit <= 32) {\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n }\n\n return highlightDigit;\n}\nexport function isSelectChangePayload(payload) {\n var payloadType = payload.type;\n return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;\n}\nexport function isHighDownPayload(payload) {\n var payloadType = payload.type;\n return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;\n}\nexport function savePathStates(el) {\n var store = getSavedStates(el);\n store.normalFill = el.style.fill;\n store.normalStroke = el.style.stroke;\n var selectState = el.states.select || {};\n store.selectFill = selectState.style && selectState.style.fill || null;\n store.selectStroke = selectState.style && selectState.style.stroke || null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js'; // Stored properties for further transition.\n\nexport var transitionStore = makeInner();\n/**\r\n * Return null if animation is disabled.\r\n */\n\nexport function getAnimationConfig(animationType, animatableModel, dataIndex, // Extra opts can override the option in animatable model.\nextraOpts, // TODO It's only for pictorial bar now.\nextraDelayParams) {\n var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option.\n // If animation is enabled. Will use this animation config in payload.\n // If animation is disabled. Just ignore it.\n\n if (animatableModel && animatableModel.ecModel) {\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\n animationPayload = updatePayload && updatePayload.animation;\n }\n\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n var isUpdate = animationType === 'update';\n\n if (animationEnabled) {\n var duration = void 0;\n var easing = void 0;\n var delay = void 0;\n\n if (extraOpts) {\n duration = retrieve2(extraOpts.duration, 200);\n easing = retrieve2(extraOpts.easing, 'cubicOut');\n delay = 0;\n } else {\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\n easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\n delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\n } // animation from payload has highest priority.\n\n\n if (animationPayload) {\n animationPayload.duration != null && (duration = animationPayload.duration);\n animationPayload.easing != null && (easing = animationPayload.easing);\n animationPayload.delay != null && (delay = animationPayload.delay);\n }\n\n if (isFunction(delay)) {\n delay = delay(dataIndex, extraDelayParams);\n }\n\n if (isFunction(duration)) {\n duration = duration(dataIndex);\n }\n\n var config = {\n duration: duration || 0,\n delay: delay,\n easing: easing\n };\n return config;\n } else {\n return null;\n }\n}\n\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\n var isFrom = false;\n var removeOpt;\n\n if (isFunction(dataIndex)) {\n during = cb;\n cb = dataIndex;\n dataIndex = null;\n } else if (isObject(dataIndex)) {\n cb = dataIndex.cb;\n during = dataIndex.during;\n isFrom = dataIndex.isFrom;\n removeOpt = dataIndex.removeOpt;\n dataIndex = dataIndex.dataIndex;\n }\n\n var isRemove = animationType === 'leave';\n\n if (!isRemove) {\n // Must stop the remove animation.\n el.stopAnimation('leave');\n }\n\n var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n\n if (animationConfig && animationConfig.duration > 0) {\n var duration = animationConfig.duration;\n var animationDelay = animationConfig.delay;\n var animationEasing = animationConfig.easing;\n var animateConfig = {\n duration: duration,\n delay: animationDelay || 0,\n easing: animationEasing,\n done: cb,\n force: !!cb || !!during,\n // Set to final state in update/init animation.\n // So the post processing based on the path shape can be done correctly.\n setToFinal: !isRemove,\n scope: animationType,\n during: during\n };\n isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig);\n } else {\n el.stopAnimation(); // If `isFrom`, the props is the \"from\" props.\n\n !isFrom && el.attr(props); // Call during at least once.\n\n during && during(1);\n cb && cb();\n }\n}\n/**\r\n * Update graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n * @example\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\r\n * // Or\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, function () { console.log('Animation done!'); });\r\n */\n\n\nfunction updateProps(el, props, // TODO: TYPE AnimatableModel\nanimatableModel, dataIndex, cb, during) {\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\n}\n\nexport { updateProps };\n/**\r\n * Init graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n */\n\nexport function initProps(el, props, animatableModel, dataIndex, cb, during) {\n animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during);\n}\n/**\r\n * If element is removed.\r\n * It can determine if element is having remove animation.\r\n */\n\nexport function isElementRemoved(el) {\n if (!el.__zr) {\n return true;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.scope === 'leave') {\n return true;\n }\n }\n\n return false;\n}\n/**\r\n * Remove graphic element\r\n */\n\nexport function removeElement(el, props, animatableModel, dataIndex, cb, during) {\n // Don't do remove animation twice.\n if (isElementRemoved(el)) {\n return;\n }\n\n animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during);\n}\n\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\n el.removeTextContent();\n el.removeTextGuideLine();\n removeElement(el, {\n style: {\n opacity: 0\n }\n }, animatableModel, dataIndex, done);\n}\n\nexport function removeElementWithFadeOut(el, animatableModel, dataIndex) {\n function doRemove() {\n el.parent && el.parent.remove(el);\n } // Hide label and labelLine first\n // TODO Also use fade out animation?\n\n\n if (!el.isGroup) {\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\n } else {\n el.traverse(function (disp) {\n if (!disp.isGroup) {\n // Can invoke doRemove multiple times.\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\n }\n });\n }\n}\n/**\r\n * Save old style for style transition in universalTransition module.\r\n * It's used when element will be reused in each render.\r\n * For chart like map, heatmap, which will always create new element.\r\n * We don't need to save this because universalTransition can get old style from the old element\r\n */\n\nexport function saveOldStyle(el) {\n transitionStore(el).oldStyle = el.style;\n}\nexport function getOldStyle(el) {\n return transitionStore(el).oldStyle;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { isFunction, retrieve2, extend, keys, trim } from 'zrender/lib/core/util.js';\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states.js';\nimport { deprecateReplaceLog } from '../util/log.js';\nimport { makeInner, interpolateRawValues } from '../util/model.js';\nimport { initProps, updateProps } from '../util/graphic.js';\nvar EMPTY_OBJ = {};\nexport function setLabelText(label, labelTexts) {\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var text = labelTexts[stateName];\n var state = label.ensureState(stateName);\n state.style = state.style || {};\n state.style.text = text;\n }\n\n var oldStates = label.currentStates.slice();\n label.clearStates(true);\n label.setStyle({\n text: labelTexts.normal\n });\n label.useStates(oldStates, true);\n}\n\nfunction getLabelText(opt, stateModels, interpolatedValue) {\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex;\n var normalModel = stateModels.normal;\n var baseText;\n\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? {\n interpolatedValue: interpolatedValue\n } : null);\n }\n\n if (baseText == null) {\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;\n }\n\n var statesText = {\n normal: baseText\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = stateModels[stateName];\n statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText);\n }\n\n return statesText;\n}\n\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified // TODO specified position?\n) {\n opt = opt || EMPTY_OBJ;\n var isSetOnText = targetEl instanceof ZRText;\n var needsCreateText = false;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\n\n if (stateModel && stateModel.getShallow('show')) {\n needsCreateText = true;\n break;\n }\n }\n\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\n\n if (needsCreateText) {\n if (!isSetOnText) {\n // Reuse the previous\n if (!textContent) {\n textContent = new ZRText();\n targetEl.setTextContent(textContent);\n } // Use same state proxy\n\n\n if (targetEl.stateProxy) {\n textContent.stateProxy = targetEl.stateProxy;\n }\n }\n\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\n var normalModel = labelStatesModels.normal;\n var showNormal = !!normalModel.getShallow('show');\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\n normalStyle.text = labelStatesTexts.normal;\n\n if (!isSetOnText) {\n // Always create new\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\n }\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = labelStatesModels[stateName];\n\n if (stateModel) {\n var stateObj = textContent.ensureState(stateName);\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\n\n if (stateShow !== showNormal) {\n stateObj.ignore = !stateShow;\n }\n\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\n stateObj.style.text = labelStatesTexts[stateName];\n\n if (!isSetOnText) {\n var targetElEmphasisState = targetEl.ensureState(stateName);\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\n }\n }\n } // PENDING: if there is many requirements that emphasis position\n // need to be different from normal position, we might consider\n // auto silent is those cases.\n\n\n textContent.silent = !!normalModel.getShallow('silent'); // Keep x and y\n\n if (textContent.style.x != null) {\n normalStyle.x = textContent.style.x;\n }\n\n if (textContent.style.y != null) {\n normalStyle.y = textContent.style.y;\n }\n\n textContent.ignore = !showNormal; // Always create new style.\n\n textContent.useStyle(normalStyle);\n textContent.dirty();\n\n if (opt.enableTextSetter) {\n labelInner(textContent).setLabelText = function (interpolatedValue) {\n var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\n setLabelText(textContent, labelStatesTexts);\n };\n }\n } else if (textContent) {\n // Not display rich text.\n textContent.ignore = true;\n }\n\n targetEl.dirty();\n}\n\nexport { setLabelStyle };\nexport function getLabelStatesModels(itemModel, labelName) {\n labelName = labelName || 'label';\n var statesModels = {\n normal: itemModel.getModel(labelName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\n }\n\n return statesModels;\n}\n/**\r\n * Set basic textStyle properties.\r\n */\n\nexport function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n var textStyle = {};\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}\nexport function createTextConfig(textStyleModel, opt, isNotNormal) {\n opt = opt || {};\n var textConfig = {};\n var labelPosition;\n var labelRotate = textStyleModel.getShallow('rotate');\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\n var labelOffset = textStyleModel.getShallow('offset');\n labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\n\n if (labelPosition != null) {\n textConfig.position = labelPosition;\n }\n\n if (labelOffset != null) {\n textConfig.offset = labelOffset;\n }\n\n if (labelRotate != null) {\n labelRotate *= Math.PI / 180;\n textConfig.rotation = labelRotate;\n }\n\n if (labelDistance != null) {\n textConfig.distance = labelDistance;\n } // fill and auto is determined by the color of path fill if it's not specified by developers.\n\n\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto';\n return textConfig;\n}\n/**\r\n * The uniform entry of set text style, that is, retrieve style definitions\r\n * from `model` and set to `textStyle` object.\r\n *\r\n * Never in merge mode, but in overwrite mode, that is, all of the text style\r\n * properties will be set. (Consider the states of normal and emphasis and\r\n * default value can be adopted, merge would make the logic too complicated\r\n * to manage.)\r\n */\n\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\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_1 in richItemNames) {\n if (richItemNames.hasOwnProperty(name_1)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n }\n }\n }\n\n if (richResult) {\n textStyle.rich = richResult;\n }\n\n var overflow = textStyleModel.get('overflow');\n\n if (overflow) {\n textStyle.overflow = overflow;\n }\n\n var margin = textStyleModel.get('minMargin');\n\n if (margin != null) {\n textStyle.margin = margin;\n }\n\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\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// TODO TextStyleModel\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 var richKeys = keys(rich);\n\n for (var i = 0; i < richKeys.length; i++) {\n var richKey = richKeys[i];\n richItemNameMap[richKey] = 1;\n }\n }\n\n textStyleModel = textStyleModel.parentModel;\n }\n\n return richItemNameMap;\n}\n\nvar TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'];\nvar TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis'];\nvar TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\n\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\n var inheritColor = opt && opt.inheritColor;\n var fillColor = textStyleModel.getShallow('color');\n var strokeColor = textStyleModel.getShallow('textBorderColor');\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\n\n if (fillColor === 'inherit' || fillColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (fillColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n fillColor = inheritColor;\n } else {\n fillColor = null;\n }\n }\n\n if (strokeColor === 'inherit' || strokeColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (strokeColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n strokeColor = inheritColor;\n } else {\n strokeColor = null;\n }\n }\n\n if (!isAttached) {\n // Only use default global textStyle.color if text is individual.\n // Otherwise it will use the strategy of attached text color because text may be on a path.\n fillColor = fillColor || globalTextStyle.color;\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\n }\n\n if (fillColor != null) {\n textStyle.fill = fillColor;\n }\n\n if (strokeColor != null) {\n textStyle.stroke = strokeColor;\n }\n\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n\n if (textBorderWidth != null) {\n textStyle.lineWidth = textBorderWidth;\n }\n\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\n\n if (textBorderType != null) {\n textStyle.lineDash = textBorderType;\n }\n\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\n\n if (textBorderDashOffset != null) {\n textStyle.lineDashOffset = textBorderDashOffset;\n }\n\n if (!isNotNormal && opacity == null && !inRich) {\n opacity = opt && opt.defaultOpacity;\n }\n\n if (opacity != null) {\n textStyle.opacity = opacity;\n } // TODO\n\n\n if (!isNotNormal && !isAttached) {\n // Set default finally.\n if (textStyle.fill == null && opt.inheritColor) {\n textStyle.fill = opt.inheritColor;\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 for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\n var key = TEXT_PROPS_WITH_GLOBAL[i];\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\n var key = TEXT_PROPS_SELF[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n if (textStyle.verticalAlign == null) {\n var baseline = textStyleModel.getShallow('baseline');\n\n if (baseline != null) {\n textStyle.verticalAlign = baseline;\n }\n }\n\n if (!isBlock || !opt.disableBox) {\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\n var key = TEXT_PROPS_BOX[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n var borderType = textStyleModel.getShallow('borderType');\n\n if (borderType != null) {\n textStyle.borderDash = borderType;\n }\n\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.backgroundColor === 'auto') {\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\n }\n }\n\n textStyle.backgroundColor = inheritColor;\n }\n\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.borderColor === 'auto') {\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\n }\n }\n\n textStyle.borderColor = inheritColor;\n }\n }\n}\n\nexport function getFont(opt, ecModel) {\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n return 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}\nexport var labelInner = makeInner();\nexport function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\n if (!label) {\n return;\n }\n\n var obj = labelInner(label);\n obj.prevValue = obj.value;\n obj.value = value;\n var normalLabelModel = labelStatesModels.normal;\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\n\n if (obj.valueAnimation) {\n obj.precision = normalLabelModel.get('precision');\n obj.defaultInterpolatedText = getDefaultText;\n obj.statesModels = labelStatesModels;\n }\n}\nexport function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {\n var labelInnerStore = labelInner(textEl);\n\n if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {\n // Value not changed, no new label animation\n return;\n }\n\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; // Consider the case that being animating, do not use the `obj.value`,\n // Otherwise it will jump to the `obj.value` when this new animation started.\n\n var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\n var targetValue = labelInnerStore.value;\n\n function during(percent) {\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);\n labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\n var labelText = getLabelText({\n labelDataIndex: dataIndex,\n labelFetcher: labelFetcher,\n defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ''\n }, labelInnerStore.statesModels, interpolated);\n setLabelText(textEl, labelText);\n }\n\n textEl.percent = 0;\n (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, {\n // percent is used to prevent animation from being aborted #15916\n percent: 1\n }, animatableModel, dataIndex, null, during);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getFont } from '../../label/labelStyle.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nvar PATH_COLOR = ['textStyle', 'color'];\nvar textStyleParams = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding', 'lineHeight', 'rich', 'width', 'height', 'overflow']; // TODO Performance improvement?\n\nvar tmpText = new ZRText();\n\nvar TextStyleMixin =\n/** @class */\nfunction () {\n function TextStyleMixin() {}\n /**\r\n * Get color property or get color from option.textStyle.color\r\n */\n // TODO Callback\n\n\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\n var ecModel = this.ecModel;\n return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n };\n /**\r\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\r\n * @return {string}\r\n */\n\n\n TextStyleMixin.prototype.getFont = function () {\n return getFont({\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily')\n }, this.ecModel);\n };\n\n TextStyleMixin.prototype.getTextRect = function (text) {\n var style = {\n text: text,\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline')\n };\n\n for (var i = 0; i < textStyleParams.length; i++) {\n style[textStyleParams[i]] = this.getShallow(textStyleParams[i]);\n }\n\n tmpText.useStyle(style);\n tmpText.update();\n return tmpText.getBoundingRect();\n };\n\n return TextStyleMixin;\n}();\n\n;\nexport default TextStyleMixin;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\n\nvar LineStyleMixin =\n/** @class */\nfunction () {\n function LineStyleMixin() {}\n\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\n return getLineStyle(this, excludes);\n };\n\n return LineStyleMixin;\n}();\n\n;\nexport { LineStyleMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\n\nvar ItemStyleMixin =\n/** @class */\nfunction () {\n function ItemStyleMixin() {}\n\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\n return getItemStyle(this, excludes, includes);\n };\n\n return ItemStyleMixin;\n}();\n\nexport { ItemStyleMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport env from 'zrender/lib/core/env.js';\nimport { enableClassExtend, enableClassCheck } from '../util/clazz.js';\nimport { AreaStyleMixin } from './mixin/areaStyle.js';\nimport TextStyleMixin from './mixin/textStyle.js';\nimport { LineStyleMixin } from './mixin/lineStyle.js';\nimport { ItemStyleMixin } from './mixin/itemStyle.js';\nimport { mixin, clone, merge } from 'zrender/lib/core/util.js';\n\nvar Model =\n/** @class */\nfunction () {\n function Model(option, parentModel, ecModel) {\n this.parentModel = parentModel;\n this.ecModel = ecModel;\n this.option = option; // Simple optimization\n // if (this.init) {\n // if (arguments.length <= 4) {\n // this.init(option, parentModel, ecModel, extraOpt);\n // }\n // else {\n // this.init.apply(this, arguments);\n // }\n // }\n }\n\n Model.prototype.init = function (option, parentModel, ecModel) {\n var rest = [];\n\n for (var _i = 3; _i < arguments.length; _i++) {\n rest[_i - 3] = arguments[_i];\n }\n };\n /**\r\n * Merge the input option to me.\r\n */\n\n\n Model.prototype.mergeOption = function (option, ecModel) {\n merge(this.option, option, true);\n }; // `path` can be 'a.b.c', so the return value type have to be `ModelOption`\n // TODO: TYPE strict key check?\n // get(path: string | string[], ignoreParent?: boolean): ModelOption;\n\n\n Model.prototype.get = function (path, ignoreParent) {\n if (path == null) {\n return this.option;\n }\n\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\n };\n\n Model.prototype.getShallow = function (key, ignoreParent) {\n var option = this.option;\n var val = option == null ? option : option[key];\n\n if (val == null && !ignoreParent) {\n var parentModel = this.parentModel;\n\n if (parentModel) {\n // FIXME:TS do not know how to make it works\n val = parentModel.getShallow(key);\n }\n }\n\n return val;\n }; // `path` can be 'a.b.c', so the return value type have to be `Model`\n // getModel(path: string | string[], parentModel?: Model): Model;\n // TODO 'a.b.c' is deprecated\n\n\n Model.prototype.getModel = function (path, parentModel) {\n var hasPath = path != null;\n var pathFinal = hasPath ? this.parsePath(path) : null;\n var obj = hasPath ? this._doGet(pathFinal) : this.option;\n parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));\n return new Model(obj, parentModel, this.ecModel);\n };\n /**\r\n * If model has option\r\n */\n\n\n Model.prototype.isEmpty = function () {\n return this.option == null;\n };\n\n Model.prototype.restoreData = function () {}; // Pending\n\n\n Model.prototype.clone = function () {\n var Ctor = this.constructor;\n return new Ctor(clone(this.option));\n }; // setReadOnly(properties): void {\n // clazzUtil.setReadOnly(this, properties);\n // }\n // If path is null/undefined, return null/undefined.\n\n\n Model.prototype.parsePath = function (path) {\n if (typeof path === 'string') {\n return path.split('.');\n }\n\n return path;\n }; // Resolve path for parent. Perhaps useful when parent use a different property.\n // Default to be a identity resolver.\n // Can be modified to a different resolver.\n\n\n Model.prototype.resolveParentPath = function (path) {\n return path;\n }; // FIXME:TS check whether put this method here\n\n\n Model.prototype.isAnimationEnabled = function () {\n if (!env.node && this.option) {\n if (this.option.animation != null) {\n return !!this.option.animation;\n } else if (this.parentModel) {\n return this.parentModel.isAnimationEnabled();\n }\n }\n };\n\n Model.prototype._doGet = function (pathArr, parentModel) {\n var obj = this.option;\n\n if (!pathArr) {\n return obj;\n }\n\n for (var i = 0; i < pathArr.length; i++) {\n // Ignore empty\n if (!pathArr[i]) {\n continue;\n } // obj could be number/string/... (like 0)\n\n\n obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n\n if (obj == null) {\n break;\n }\n }\n\n if (obj == null && parentModel) {\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\n }\n\n return obj;\n };\n\n return Model;\n}();\n\n; // Enable Model.extend.\n\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, LineStyleMixin);\nmixin(Model, ItemStyleMixin);\nmixin(Model, AreaStyleMixin);\nmixin(Model, TextStyleMixin);\nexport default Model;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\nimport { makePrintable } from './log.js'; // A random offset\n\nvar base = Math.round(Math.random() * 10);\n/**\r\n * @public\r\n * @param {string} type\r\n * @return {string}\r\n */\n\nexport function getUID(type) {\n // Considering the case of crossing js context,\n // use Math.random to make id as unique as possible.\n return [type || '', base++].join('_');\n}\n/**\r\n * Implements `SubTypeDefaulterManager` for `target`.\r\n */\n\nexport function enableSubTypeDefaulter(target) {\n var subTypeDefaulters = {};\n\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\n var componentTypeInfo = parseClassType(componentType);\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\n };\n\n target.determineSubType = function (componentType, option) {\n var type = option.type;\n\n if (!type) {\n var componentTypeMain = parseClassType(componentType).main;\n\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n type = subTypeDefaulters[componentTypeMain](option);\n }\n }\n\n return type;\n };\n}\n/**\r\n * Implements `TopologicalTravelable` for `entity`.\r\n *\r\n * Topological travel on Activity Network (Activity On Vertices).\r\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\r\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\r\n * If there is circular dependencey, Error will be thrown.\r\n */\n\nexport function enableTopologicalTravel(entity, dependencyGetter) {\n /**\r\n * @param targetNameList Target Component type list.\r\n * Can be ['aa', 'bb', 'aa.xx']\r\n * @param fullNameList By which we can build dependency graph.\r\n * @param callback Params: componentType, dependencies.\r\n * @param context Scope of callback.\r\n */\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n if (!targetNameList.length) {\n return;\n }\n\n var result = makeDepndencyGraph(fullNameList);\n var graph = result.graph;\n var noEntryList = result.noEntryList;\n var targetNameSet = {};\n zrUtil.each(targetNameList, function (name) {\n targetNameSet[name] = true;\n });\n\n while (noEntryList.length) {\n var currComponentType = noEntryList.pop();\n var currVertex = graph[currComponentType];\n var isInTargetNameSet = !!targetNameSet[currComponentType];\n\n if (isInTargetNameSet) {\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\n delete targetNameSet[currComponentType];\n }\n\n zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n }\n\n zrUtil.each(targetNameSet, function () {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\n }\n\n throw new Error(errMsg);\n });\n\n function removeEdge(succComponentType) {\n graph[succComponentType].entryCount--;\n\n if (graph[succComponentType].entryCount === 0) {\n noEntryList.push(succComponentType);\n }\n } // Consider this case: legend depends on series, and we call\n // chart.setOption({series: [...]}), where only series is in option.\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n // not be called, but only sereis.mergeOption is called. Thus legend\n // have no chance to update its local record about series (like which\n // name of series is available in legend).\n\n\n function removeEdgeAndAdd(succComponentType) {\n targetNameSet[succComponentType] = true;\n removeEdge(succComponentType);\n }\n };\n\n function makeDepndencyGraph(fullNameList) {\n var graph = {};\n var noEntryList = [];\n zrUtil.each(fullNameList, function (name) {\n var thisItem = createDependencyGraphItem(graph, name);\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n thisItem.entryCount = availableDeps.length;\n\n if (thisItem.entryCount === 0) {\n noEntryList.push(name);\n }\n\n zrUtil.each(availableDeps, function (dependentName) {\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n thisItem.predecessor.push(dependentName);\n }\n\n var thatItem = createDependencyGraphItem(graph, dependentName);\n\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n thatItem.successor.push(name);\n }\n });\n });\n return {\n graph: graph,\n noEntryList: noEntryList\n };\n }\n\n function createDependencyGraphItem(graph, name) {\n if (!graph[name]) {\n graph[name] = {\n predecessor: [],\n successor: []\n };\n }\n\n return graph[name];\n }\n\n function getAvailableDependencies(originalDeps, fullNameList) {\n var availableDeps = [];\n zrUtil.each(originalDeps, function (dep) {\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n });\n return availableDeps;\n }\n}\nexport function inheritDefaultOption(superOption, subOption) {\n // See also `model/Component.ts#getDefaultOption`\n return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\n\n/**\r\n * Language: English.\r\n */\nexport default {\n time: {\n month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n },\n legend: {\n selector: {\n all: 'All',\n inverse: 'Inv'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: 'Box Select',\n polygon: 'Lasso Select',\n lineX: 'Horizontally Select',\n lineY: 'Vertically Select',\n keep: 'Keep Selections',\n clear: 'Clear Selections'\n }\n },\n dataView: {\n title: 'Data View',\n lang: ['Data View', 'Close', 'Refresh']\n },\n dataZoom: {\n title: {\n zoom: 'Zoom',\n back: 'Zoom Reset'\n }\n },\n magicType: {\n title: {\n line: 'Switch to Line Chart',\n bar: 'Switch to Bar Chart',\n stack: 'Stack',\n tiled: 'Tile'\n }\n },\n restore: {\n title: 'Restore'\n },\n saveAsImage: {\n title: 'Save as Image',\n lang: ['Right Click to Save Image']\n }\n },\n series: {\n typeNames: {\n pie: 'Pie chart',\n bar: 'Bar chart',\n line: 'Line chart',\n scatter: 'Scatter plot',\n effectScatter: 'Ripple scatter plot',\n radar: 'Radar chart',\n tree: 'Tree',\n treemap: 'Treemap',\n boxplot: 'Boxplot',\n candlestick: 'Candlestick',\n k: 'K line chart',\n heatmap: 'Heat map',\n map: 'Map',\n parallel: 'Parallel coordinate map',\n lines: 'Line graph',\n graph: 'Relationship graph',\n sankey: 'Sankey diagram',\n funnel: 'Funnel chart',\n gauge: 'Gauge',\n pictorialBar: 'Pictorial bar',\n themeRiver: 'Theme River Map',\n sunburst: 'Sunburst'\n }\n },\n aria: {\n general: {\n withTitle: 'This is a chart about \"{title}\"',\n withoutTitle: 'This is a chart'\n },\n series: {\n single: {\n prefix: '',\n withName: ' with type {seriesType} named {seriesName}.',\n withoutName: ' with type {seriesType}.'\n },\n multiple: {\n prefix: '. It consists of {seriesCount} series count.',\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\n withoutName: ' The {seriesId} series is a {seriesType}.',\n separator: {\n middle: '',\n end: ''\n }\n }\n },\n data: {\n allData: 'The data is as follows: ',\n partialData: 'The first {displayCnt} items are: ',\n withName: 'the data for {name} is {value}',\n withoutName: '{value}',\n separator: {\n middle: ', ',\n end: '. '\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\nexport default {\n time: {\n month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],\n dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六']\n },\n legend: {\n selector: {\n all: '全选',\n inverse: '反选'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: '矩形选择',\n polygon: '圈选',\n lineX: '横向选择',\n lineY: '纵向选择',\n keep: '保持选择',\n clear: '清除选择'\n }\n },\n dataView: {\n title: '数据视图',\n lang: ['数据视图', '关闭', '刷新']\n },\n dataZoom: {\n title: {\n zoom: '区域缩放',\n back: '区域缩放还原'\n }\n },\n magicType: {\n title: {\n line: '切换为折线图',\n bar: '切换为柱状图',\n stack: '切换为堆叠',\n tiled: '切换为平铺'\n }\n },\n restore: {\n title: '还原'\n },\n saveAsImage: {\n title: '保存为图片',\n lang: ['右键另存为图片']\n }\n },\n series: {\n typeNames: {\n pie: '饼图',\n bar: '柱状图',\n line: '折线图',\n scatter: '散点图',\n effectScatter: '涟漪散点图',\n radar: '雷达图',\n tree: '树图',\n treemap: '矩形树图',\n boxplot: '箱型图',\n candlestick: 'K线图',\n k: 'K线图',\n heatmap: '热力图',\n map: '地图',\n parallel: '平行坐标图',\n lines: '线图',\n graph: '关系图',\n sankey: '桑基图',\n funnel: '漏斗图',\n gauge: '仪表盘图',\n pictorialBar: '象形柱图',\n themeRiver: '主题河流图',\n sunburst: '旭日图'\n }\n },\n aria: {\n general: {\n withTitle: '这是一个关于“{title}”的图表。',\n withoutTitle: '这是一个图表,'\n },\n series: {\n single: {\n prefix: '',\n withName: '图表类型是{seriesType},表示{seriesName}。',\n withoutName: '图表类型是{seriesType}。'\n },\n multiple: {\n prefix: '它由{seriesCount}个图表系列组成。',\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\n withoutName: '第{seriesId}个系列是一个{seriesType},',\n separator: {\n middle: ';',\n end: '。'\n }\n }\n },\n data: {\n allData: '其数据是——',\n partialData: '其中,前{displayCnt}项是——',\n withName: '{name}的数据是{value}',\n withoutName: '{value}',\n separator: {\n middle: ',',\n end: ''\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Model from '../model/Model.js';\nimport env from 'zrender/lib/core/env.js'; // default import ZH and EN lang\n\nimport langEN from '../i18n/langEN.js';\nimport langZH from '../i18n/langZH.js';\nimport { isString, clone, merge } from 'zrender/lib/core/util.js';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n var langStr = (\n /* eslint-disable-next-line */\n document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n locale = locale.toUpperCase();\n localeModels[locale] = new Model(localeObj);\n localeStorage[locale] = localeObj;\n} // export function getLocale(locale: string) {\n// return localeStorage[locale];\n// }\n\nexport function createLocaleObject(locale) {\n if (isString(locale)) {\n var localeObj = localeStorage[locale.toUpperCase()] || {};\n\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n return clone(localeObj);\n } else {\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n } else {\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n}\nexport function getLocaleModel(lang) {\n return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n return localeModels[DEFAULT_LOCALE];\n} // Default locale\n\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from './number.js';\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG } from '../core/locale.js';\nimport Model from '../model/Model.js';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = ONE_SECOND * 60;\nexport var ONE_HOUR = ONE_MINUTE * 60;\nexport var ONE_DAY = ONE_HOUR * 24;\nexport var ONE_YEAR = ONE_DAY * 365;\nexport var defaultLeveledFormatter = {\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{HH}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}'\n};\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\nexport var fullLeveledFormatter = {\n year: '{yyyy}',\n month: '{yyyy}-{MM}',\n day: fullDayFormatter,\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\n millisecond: defaultLeveledFormatter.none\n};\nexport var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'];\nexport function pad(str, len) {\n str += '';\n return '0000'.substr(0, len - str.length) + str;\n}\nexport function getPrimaryTimeUnit(timeUnit) {\n switch (timeUnit) {\n case 'half-year':\n case 'quarter':\n return 'month';\n\n case 'week':\n case 'half-week':\n return 'day';\n\n case 'half-day':\n case 'quarter-day':\n return 'hour';\n\n default:\n // year, minutes, second, milliseconds\n return timeUnit;\n }\n}\nexport function isPrimaryTimeUnit(timeUnit) {\n return timeUnit === getPrimaryTimeUnit(timeUnit);\n}\nexport function getDefaultFormatPrecisionOfInterval(timeUnit) {\n switch (timeUnit) {\n case 'year':\n case 'month':\n return 'day';\n\n case 'millisecond':\n return 'millisecond';\n\n default:\n // Also for day, hour, minute, second\n return 'second';\n }\n}\nexport function format( // Note: The result based on `isUTC` are totally different, which can not be just simply\n// substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\ntime, template, isUTC, lang) {\n var date = numberUtil.parseDate(time);\n var y = date[fullYearGetterName(isUTC)]();\n var M = date[monthGetterName(isUTC)]() + 1;\n var q = Math.floor((M - 1) / 3) + 1;\n var d = date[dateGetterName(isUTC)]();\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\n var H = date[hoursGetterName(isUTC)]();\n var h = (H - 1) % 12 + 1;\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\n var timeModel = localeModel.getModel('time');\n var month = timeModel.get('month');\n var monthAbbr = timeModel.get('monthAbbr');\n var dayOfWeek = timeModel.get('dayOfWeek');\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\n return (template || '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, pad(y % 100 + '', 2)).replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + '');\n}\nexport function leveledFormat(tick, idx, formatter, lang, isUTC) {\n var template = null;\n\n if (zrUtil.isString(formatter)) {\n // Single formatter for all units at all levels\n template = formatter;\n } else if (zrUtil.isFunction(formatter)) {\n // Callback formatter\n template = formatter(tick.value, idx, {\n level: tick.level\n });\n } else {\n var defaults = zrUtil.extend({}, defaultLeveledFormatter);\n\n if (tick.level > 0) {\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\n defaults[primaryTimeUnits[i]] = \"{primary|\" + defaults[primaryTimeUnits[i]] + \"}\";\n }\n }\n\n var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units\n : zrUtil.defaults(formatter, defaults) : defaults;\n var unit = getUnitFromValue(tick.value, isUTC);\n\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n } else if (mergedFormatter.inherit) {\n // Unit formatter is not defined and should inherit from bigger units\n var targetId = timeUnits.indexOf(unit);\n\n for (var i = targetId - 1; i >= 0; --i) {\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n break;\n }\n }\n\n template = template || defaults.none;\n }\n\n if (zrUtil.isArray(template)) {\n var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level;\n levelId = Math.min(levelId, template.length - 1);\n template = template[levelId];\n }\n }\n\n return format(new Date(tick.value), template, isUTC, lang);\n}\nexport function getUnitFromValue(value, isUTC) {\n var date = numberUtil.parseDate(value);\n var M = date[monthGetterName(isUTC)]() + 1;\n var d = date[dateGetterName(isUTC)]();\n var h = date[hoursGetterName(isUTC)]();\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var isSecond = S === 0;\n var isMinute = isSecond && s === 0;\n var isHour = isMinute && m === 0;\n var isDay = isHour && h === 0;\n var isMonth = isDay && d === 1;\n var isYear = isMonth && M === 1;\n\n if (isYear) {\n return 'year';\n } else if (isMonth) {\n return 'month';\n } else if (isDay) {\n return 'day';\n } else if (isHour) {\n return 'hour';\n } else if (isMinute) {\n return 'minute';\n } else if (isSecond) {\n return 'second';\n } else {\n return 'millisecond';\n }\n}\nexport function getUnitValue(value, unit, isUTC) {\n var date = zrUtil.isNumber(value) ? numberUtil.parseDate(value) : value;\n unit = unit || getUnitFromValue(value, isUTC);\n\n switch (unit) {\n case 'year':\n return date[fullYearGetterName(isUTC)]();\n\n case 'half-year':\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\n\n case 'quarter':\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\n\n case 'month':\n return date[monthGetterName(isUTC)]();\n\n case 'day':\n return date[dateGetterName(isUTC)]();\n\n case 'half-day':\n return date[hoursGetterName(isUTC)]() / 24;\n\n case 'hour':\n return date[hoursGetterName(isUTC)]();\n\n case 'minute':\n return date[minutesGetterName(isUTC)]();\n\n case 'second':\n return date[secondsGetterName(isUTC)]();\n\n case 'millisecond':\n return date[millisecondsGetterName(isUTC)]();\n }\n}\nexport function fullYearGetterName(isUTC) {\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\n}\nexport function monthGetterName(isUTC) {\n return isUTC ? 'getUTCMonth' : 'getMonth';\n}\nexport function dateGetterName(isUTC) {\n return isUTC ? 'getUTCDate' : 'getDate';\n}\nexport function hoursGetterName(isUTC) {\n return isUTC ? 'getUTCHours' : 'getHours';\n}\nexport function minutesGetterName(isUTC) {\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\n}\nexport function secondsGetterName(isUTC) {\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function millisecondsGetterName(isUTC) {\n return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds';\n}\nexport function fullYearSetterName(isUTC) {\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\n}\nexport function monthSetterName(isUTC) {\n return isUTC ? 'setUTCMonth' : 'setMonth';\n}\nexport function dateSetterName(isUTC) {\n return isUTC ? 'setUTCDate' : 'setDate';\n}\nexport function hoursSetterName(isUTC) {\n return isUTC ? 'setUTCHours' : 'setHours';\n}\nexport function minutesSetterName(isUTC) {\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\n}\nexport function secondsSetterName(isUTC) {\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}\nexport function millisecondsSetterName(isUTC) {\n return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds';\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { encodeHTML } from 'zrender/lib/core/dom.js';\nimport { parseDate, isNumeric, numericToNumber } from './number.js';\nimport { format as timeFormat, pad } from './time.js';\nimport { deprecateReplaceLog } from './log.js';\n/**\r\n * Add a comma each three digit.\r\n */\n\nexport function addCommas(x) {\n if (!isNumeric(x)) {\n return zrUtil.isString(x) ? x : '-';\n }\n\n var parts = (x + '').split('.');\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : '');\n}\nexport function toCamelCase(str, upperCaseFirst) {\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n return group1.toUpperCase();\n });\n\n if (upperCaseFirst && str) {\n str = str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n return str;\n}\nexport var normalizeCssArray = zrUtil.normalizeCssArray;\nexport { encodeHTML };\n/**\r\n * Make value user readable for tooltip and label.\r\n * \"User readable\":\r\n * Try to not print programmer-specific text like NaN, Infinity, null, undefined.\r\n * Avoid to display an empty string, which users can not recognize there is\r\n * a value and it might look like a bug.\r\n */\n\nexport function makeValueReadable(value, valueType, useUTC) {\n var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';\n\n function stringToUserReadable(str) {\n return str && zrUtil.trim(str) ? str : '-';\n }\n\n function isNumberUserReadable(num) {\n return !!(num != null && !isNaN(num) && isFinite(num));\n }\n\n var isTypeTime = valueType === 'time';\n var isValueDate = value instanceof Date;\n\n if (isTypeTime || isValueDate) {\n var date = isTypeTime ? parseDate(value) : value;\n\n if (!isNaN(+date)) {\n return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\n } else if (isValueDate) {\n return '-';\n } // In other cases, continue to try to display the value in the following code.\n\n }\n\n if (valueType === 'ordinal') {\n return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';\n } // By default.\n\n\n var numericResult = numericToNumber(value);\n return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-';\n}\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\n\nvar wrapVar = function (varName, seriesIdx) {\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\r\n * Template formatter\r\n * @param {Array.|Object} paramsList\r\n */\n\n\nexport function formatTpl(tpl, paramsList, encode) {\n if (!zrUtil.isArray(paramsList)) {\n paramsList = [paramsList];\n }\n\n var seriesLen = paramsList.length;\n\n if (!seriesLen) {\n return '';\n }\n\n var $vars = paramsList[0].$vars || [];\n\n for (var i = 0; i < $vars.length; i++) {\n var alias = TPL_VAR_ALIAS[i];\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n }\n\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n for (var k = 0; k < $vars.length; k++) {\n var val = paramsList[seriesIdx][$vars[k]];\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n }\n }\n\n return tpl;\n}\n/**\r\n * simple Template formatter\r\n */\n\nexport function formatTplSimple(tpl, param, encode) {\n zrUtil.each(param, function (value, key) {\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n });\n return tpl;\n}\nexport function getTooltipMarker(inOpt, extraCssText) {\n var opt = zrUtil.isString(inOpt) ? {\n color: inOpt,\n extraCssText: extraCssText\n } : inOpt || {};\n var color = opt.color;\n var type = opt.type;\n extraCssText = opt.extraCssText;\n var renderMode = opt.renderMode || 'html';\n\n if (!color) {\n return '';\n }\n\n if (renderMode === 'html') {\n return type === 'subItem' ? '' : '';\n } else {\n // Should better not to auto generate style name by auto-increment number here.\n // Because this util is usually called in tooltip formatter, which is probably\n // called repeatedly when mouse move and the auto-increment number increases fast.\n // Users can make their own style name by theirselves, make it unique and readable.\n var markerId = opt.markerId || 'markerX';\n return {\n renderMode: renderMode,\n content: '{' + markerId + '|} ',\n style: type === 'subItem' ? {\n width: 4,\n height: 4,\n borderRadius: 2,\n backgroundColor: color\n } : {\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: color\n }\n };\n }\n}\n/**\r\n * @deprecated Use `time/format` instead.\r\n * ISO Date format\r\n * @param {string} tpl\r\n * @param {number} value\r\n * @param {boolean} [isUTC=false] Default in local time.\r\n * see `module:echarts/scale/Time`\r\n * and `module:echarts/util/number#parseDate`.\r\n * @inner\r\n */\n\nexport function formatTime(tpl, value, isUTC) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\n }\n\n if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n tpl = 'MM-dd\\nyyyy';\n }\n\n var date = parseDate(value);\n var getUTC = isUTC ? 'getUTC' : 'get';\n var y = date[getUTC + 'FullYear']();\n var M = date[getUTC + 'Month']() + 1;\n var d = date[getUTC + 'Date']();\n var h = date[getUTC + 'Hours']();\n var m = date[getUTC + 'Minutes']();\n var s = date[getUTC + 'Seconds']();\n var S = date[getUTC + 'Milliseconds']();\n tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', pad(y % 100 + '', 2)).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));\n return tpl;\n}\n/**\r\n * Capital first\r\n * @param {string} str\r\n * @return {string}\r\n */\n\nexport function capitalFirst(str) {\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n/**\r\n * @return Never be null/undefined.\r\n */\n\nexport function convertToColorString(color, defaultColor) {\n defaultColor = defaultColor || 'transparent';\n return zrUtil.isString(color) ? color : zrUtil.isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor;\n}\nexport { truncateText } from 'zrender/lib/graphic/helper/parseText.js';\n/**\r\n * open new tab\r\n * @param link url\r\n * @param target blank or self\r\n */\n\nexport function windowOpen(link, target) {\n /* global window */\n if (target === '_blank' || target === 'blank') {\n var blank = window.open();\n blank.opener = null;\n blank.location.href = link;\n } else {\n window.open(link, target);\n }\n}\nexport { getTextRect } from '../legacy/getTextRect.js';","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Layout helpers for each component positioning\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent } from './number.js';\nimport * as formatUtil from './format.js';\nvar each = zrUtil.each;\n/**\r\n * @public\r\n */\n\nexport var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\r\n * @public\r\n */\n\nexport var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\n\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n var x = 0;\n var y = 0;\n\n if (maxWidth == null) {\n maxWidth = Infinity;\n }\n\n if (maxHeight == null) {\n maxHeight = Infinity;\n }\n\n var currentLineMaxSize = 0;\n group.eachChild(function (child, idx) {\n var rect = child.getBoundingRect();\n var nextChild = group.childAt(idx + 1);\n var nextChildRect = nextChild && nextChild.getBoundingRect();\n var nextX;\n var nextY;\n\n if (orient === 'horizontal') {\n var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group\n // FIXME compare before adding gap?\n\n if (nextX > maxWidth || child.newline) {\n x = 0;\n nextX = moveX;\n y += currentLineMaxSize + gap;\n currentLineMaxSize = rect.height;\n } else {\n // FIXME: consider rect.y is not `0`?\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n }\n } else {\n var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group\n\n if (nextY > maxHeight || child.newline) {\n x += currentLineMaxSize + gap;\n y = 0;\n nextY = moveY;\n currentLineMaxSize = rect.width;\n } else {\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n }\n }\n\n if (child.newline) {\n return;\n }\n\n child.x = x;\n child.y = y;\n child.markRedraw();\n orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n });\n}\n/**\r\n * VBox or HBox layouting\r\n * @param {string} orient\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\n\nexport var box = boxLayout;\n/**\r\n * VBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\nexport var vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\r\n * HBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\nexport var hbox = zrUtil.curry(boxLayout, 'horizontal');\n/**\r\n * If x or x2 is not specified or 'center' 'left' 'right',\r\n * the width would be as long as possible.\r\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\r\n * the height would be as long as possible.\r\n */\n\nexport function getAvailableSize(positionInfo, containerRect, margin) {\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var x = parsePercent(positionInfo.left, containerWidth);\n var y = parsePercent(positionInfo.top, containerHeight);\n var x2 = parsePercent(positionInfo.right, containerWidth);\n var y2 = parsePercent(positionInfo.bottom, containerHeight);\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\n margin = formatUtil.normalizeCssArray(margin || 0);\n return {\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\n };\n}\n/**\r\n * Parse position info.\r\n */\n\nexport function getLayoutRect(positionInfo, containerRect, margin) {\n margin = formatUtil.normalizeCssArray(margin || 0);\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var left = parsePercent(positionInfo.left, containerWidth);\n var top = parsePercent(positionInfo.top, containerHeight);\n var right = parsePercent(positionInfo.right, containerWidth);\n var bottom = parsePercent(positionInfo.bottom, containerHeight);\n var width = parsePercent(positionInfo.width, containerWidth);\n var height = parsePercent(positionInfo.height, containerHeight);\n var verticalMargin = margin[2] + margin[0];\n var horizontalMargin = margin[1] + margin[3];\n var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right\n\n if (isNaN(width)) {\n width = containerWidth - right - horizontalMargin - left;\n }\n\n if (isNaN(height)) {\n height = containerHeight - bottom - verticalMargin - top;\n }\n\n if (aspect != null) {\n // If width and height are not given\n // 1. Graph should not exceeds the container\n // 2. Aspect must be keeped\n // 3. Graph should take the space as more as possible\n // FIXME\n // Margin is not considered, because there is no case that both\n // using margin and aspect so far.\n if (isNaN(width) && isNaN(height)) {\n if (aspect > containerWidth / containerHeight) {\n width = containerWidth * 0.8;\n } else {\n height = containerHeight * 0.8;\n }\n } // Calculate width or height with given aspect\n\n\n if (isNaN(width)) {\n width = aspect * height;\n }\n\n if (isNaN(height)) {\n height = width / aspect;\n }\n } // If left is not specified, calculate left from right and width\n\n\n if (isNaN(left)) {\n left = containerWidth - right - width - horizontalMargin;\n }\n\n if (isNaN(top)) {\n top = containerHeight - bottom - height - verticalMargin;\n } // Align left and top\n\n\n switch (positionInfo.left || positionInfo.right) {\n case 'center':\n left = containerWidth / 2 - width / 2 - margin[3];\n break;\n\n case 'right':\n left = containerWidth - width - horizontalMargin;\n break;\n }\n\n switch (positionInfo.top || positionInfo.bottom) {\n case 'middle':\n case 'center':\n top = containerHeight / 2 - height / 2 - margin[0];\n break;\n\n case 'bottom':\n top = containerHeight - height - verticalMargin;\n break;\n } // If something is wrong and left, top, width, height are calculated as NaN\n\n\n left = left || 0;\n top = top || 0;\n\n if (isNaN(width)) {\n // Width may be NaN if only one value is given except width\n width = containerWidth - horizontalMargin - left - (right || 0);\n }\n\n if (isNaN(height)) {\n // Height may be NaN if only one value is given except height\n height = containerHeight - verticalMargin - top - (bottom || 0);\n }\n\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\n rect.margin = margin;\n return rect;\n}\n/**\r\n * Position a zr element in viewport\r\n * Group position is specified by either\r\n * {left, top}, {right, bottom}\r\n * If all properties exists, right and bottom will be igonred.\r\n *\r\n * Logic:\r\n * 1. Scale (against origin point in parent coord)\r\n * 2. Rotate (against origin point in parent coord)\r\n * 3. Translate (with el.position by this method)\r\n * So this method only fixes the last step 'Translate', which does not affect\r\n * scaling and rotating.\r\n *\r\n * If be called repeatedly with the same input el, the same result will be gotten.\r\n *\r\n * Return true if the layout happened.\r\n *\r\n * @param el Should have `getBoundingRect` method.\r\n * @param positionInfo\r\n * @param positionInfo.left\r\n * @param positionInfo.top\r\n * @param positionInfo.right\r\n * @param positionInfo.bottom\r\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\r\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\r\n * @param containerRect\r\n * @param margin\r\n * @param opt\r\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\r\n * @param opt.boundingMode\r\n * Specify how to calculate boundingRect when locating.\r\n * 'all': Position the boundingRect that is transformed and uioned\r\n * both itself and its descendants.\r\n * This mode simplies confine the elements in the bounding\r\n * of their container (e.g., using 'right: 0').\r\n * 'raw': Position the boundingRect that is not transformed and only itself.\r\n * This mode is useful when you want a element can overflow its\r\n * container. (Consider a rotated circle needs to be located in a corner.)\r\n * In this mode positionInfo.width/height can only be number.\r\n */\n\nexport function positionElement(el, positionInfo, containerRect, margin, opt, out) {\n var h = !opt || !opt.hv || opt.hv[0];\n var v = !opt || !opt.hv || opt.hv[1];\n var boundingMode = opt && opt.boundingMode || 'all';\n out = out || el;\n out.x = el.x;\n out.y = el.y;\n\n if (!h && !v) {\n return false;\n }\n\n var rect;\n\n if (boundingMode === 'raw') {\n rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n } else {\n rect = el.getBoundingRect();\n\n if (el.needLocalTransform()) {\n var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el,\n // which should not be modified.\n\n rect = rect.clone();\n rect.applyTransform(transform);\n }\n } // The real width and height can not be specified but calculated by the given el.\n\n\n var layoutRect = getLayoutRect(zrUtil.defaults({\n width: rect.width,\n height: rect.height\n }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform\n // (see zrender/core/Transformable#getLocalTransform),\n // we can just only modify el.position to get final result.\n\n var dx = h ? layoutRect.x - rect.x : 0;\n var dy = v ? layoutRect.y - rect.y : 0;\n\n if (boundingMode === 'raw') {\n out.x = dx;\n out.y = dy;\n } else {\n out.x += dx;\n out.y += dy;\n }\n\n if (out === el) {\n el.markRedraw();\n }\n\n return true;\n}\n/**\r\n * @param option Contains some of the properties in HV_NAMES.\r\n * @param hvIdx 0: horizontal; 1: vertical.\r\n */\n\nexport function sizeCalculable(option, hvIdx) {\n return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\nexport function fetchLayoutMode(ins) {\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\n return zrUtil.isObject(layoutMode) ? layoutMode : layoutMode ? {\n type: layoutMode\n } : null;\n}\n/**\r\n * Consider Case:\r\n * When default option has {left: 0, width: 100}, and we set {right: 0}\r\n * through setOption or media query, using normal zrUtil.merge will cause\r\n * {right: 0} does not take effect.\r\n *\r\n * @example\r\n * ComponentModel.extend({\r\n * init: function () {\r\n * ...\r\n * let inputPositionParams = layout.getLayoutParams(option);\r\n * this.mergeOption(inputPositionParams);\r\n * },\r\n * mergeOption: function (newOption) {\r\n * newOption && zrUtil.merge(thisOption, newOption, true);\r\n * layout.mergeLayoutParam(thisOption, newOption);\r\n * }\r\n * });\r\n *\r\n * @param targetOption\r\n * @param newOption\r\n * @param opt\r\n */\n\nexport function mergeLayoutParam(targetOption, newOption, opt) {\n var ignoreSize = opt && opt.ignoreSize;\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n var hResult = merge(HV_NAMES[0], 0);\n var vResult = merge(HV_NAMES[1], 1);\n copy(HV_NAMES[0], targetOption, hResult);\n copy(HV_NAMES[1], targetOption, vResult);\n\n function merge(names, hvIdx) {\n var newParams = {};\n var newValueCount = 0;\n var merged = {};\n var mergedValueCount = 0;\n var enoughParamNumber = 2;\n each(names, function (name) {\n merged[name] = targetOption[name];\n });\n each(names, function (name) {\n // Consider case: newOption.width is null, which is\n // set by user for removing width setting.\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n hasValue(newParams, name) && newValueCount++;\n hasValue(merged, name) && mergedValueCount++;\n });\n\n if (ignoreSize[hvIdx]) {\n // Only one of left/right is premitted to exist.\n if (hasValue(newOption, names[1])) {\n merged[names[2]] = null;\n } else if (hasValue(newOption, names[2])) {\n merged[names[1]] = null;\n }\n\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // or targetOption: {right: ...} and newOption: {width: ...},\n // There is no conflict when merged only has params count\n // little than enoughParamNumber.\n\n\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // Than we can make sure user only want those two, and ignore\n // all origin params in targetOption.\n else if (newValueCount >= enoughParamNumber) {\n return newParams;\n } else {\n // Chose another param from targetOption by priority.\n for (var i = 0; i < names.length; i++) {\n var name_1 = names[i];\n\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\n newParams[name_1] = targetOption[name_1];\n break;\n }\n }\n\n return newParams;\n }\n }\n\n function hasProp(obj, name) {\n return obj.hasOwnProperty(name);\n }\n\n function hasValue(obj, name) {\n return obj[name] != null && obj[name] !== 'auto';\n }\n\n function copy(names, target, source) {\n each(names, function (name) {\n target[name] = source[name];\n });\n }\n}\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n */\n\nexport function getLayoutParams(source) {\n return copyLayoutParams({}, source);\n}\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n * @param {Object} source\r\n * @return {Object} Result contains those props.\r\n */\n\nexport function copyLayoutParams(target, source) {\n source && target && each(LOCATION_PARAMS, function (name) {\n source.hasOwnProperty(name) && (target[name] = source[name]);\n });\n return target;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from './Model.js';\nimport * as componentUtil from '../util/component.js';\nimport { enableClassManagement, parseClassType, isExtendedClass, mountExtend } from '../util/clazz.js';\nimport { makeInner, queryReferringComponents } from '../util/model.js';\nimport * as layout from '../util/layout.js';\nvar inner = makeInner();\n\nvar ComponentModel =\n/** @class */\nfunction (_super) {\n __extends(ComponentModel, _super);\n\n function ComponentModel(option, parentModel, ecModel) {\n var _this = _super.call(this, option, parentModel, ecModel) || this;\n\n _this.uid = componentUtil.getUID('ec_cpt_model');\n return _this;\n }\n\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = layout.fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n zrUtil.merge(option, themeModel.get(this.mainType));\n zrUtil.merge(option, this.getDefaultOption());\n\n if (layoutMode) {\n layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\n zrUtil.merge(this.option, option, true);\n var layoutMode = layout.fetchLayoutMode(this);\n\n if (layoutMode) {\n layout.mergeLayoutParam(this.option, option, layoutMode);\n }\n };\n /**\r\n * Called immediately after `init` or `mergeOption` of this instance called.\r\n */\n\n\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {};\n /**\r\n * [How to declare defaultOption]:\r\n *\r\n * (A) If using class declaration in typescript (since echarts 5):\r\n * ```ts\r\n * import {ComponentOption} from '../model/option.js';\r\n * export interface XxxOption extends ComponentOption {\r\n * aaa: number\r\n * }\r\n * export class XxxModel extends Component {\r\n * static type = 'xxx';\r\n * static defaultOption: XxxOption = {\r\n * aaa: 123\r\n * }\r\n * }\r\n * Component.registerClass(XxxModel);\r\n * ```\r\n * ```ts\r\n * import {inheritDefaultOption} from '../util/component.js';\r\n * import {XxxModel, XxxOption} from './XxxModel.js';\r\n * export interface XxxSubOption extends XxxOption {\r\n * bbb: number\r\n * }\r\n * class XxxSubModel extends XxxModel {\r\n * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\r\n * bbb: 456\r\n * })\r\n * fn() {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {aaa: 123, bbb: 456}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * (B) If using class extend (previous approach in echarts 3 & 4):\r\n * ```js\r\n * let XxxComponent = Component.extend({\r\n * defaultOption: {\r\n * xx: 123\r\n * }\r\n * })\r\n * ```\r\n * ```js\r\n * let XxxSubComponent = XxxComponent.extend({\r\n * defaultOption: {\r\n * yy: 456\r\n * },\r\n * fn: function () {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {xx: 123, yy: 456}\r\n * }\r\n * })\r\n * ```\r\n */\n\n\n ComponentModel.prototype.getDefaultOption = function () {\n var ctor = this.constructor; // If using class declaration, it is different to travel super class\n // in legacy env and auto merge defaultOption. So if using class\n // declaration, defaultOption should be merged manually.\n\n if (!isExtendedClass(ctor)) {\n // When using ts class, defaultOption must be declared as static.\n return ctor.defaultOption;\n } // FIXME: remove this approach?\n\n\n var fields = inner(this);\n\n if (!fields.defaultOption) {\n var optList = [];\n var clz = ctor;\n\n while (clz) {\n var opt = clz.prototype.defaultOption;\n opt && optList.push(opt);\n clz = clz.superClass;\n }\n\n var defaultOption = {};\n\n for (var i = optList.length - 1; i >= 0; i--) {\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n }\n\n fields.defaultOption = defaultOption;\n }\n\n return fields.defaultOption;\n };\n /**\r\n * Notice: always force to input param `useDefault` in case that forget to consider it.\r\n * The same behavior as `modelUtil.parseFinder`.\r\n *\r\n * @param useDefault In many cases like series refer axis and axis refer grid,\r\n * If axis index / axis id not specified, use the first target as default.\r\n * In other cases like dataZoom refer axis, if not specified, measn no refer.\r\n */\n\n\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\n var indexKey = mainType + 'Index';\n var idKey = mainType + 'Id';\n return queryReferringComponents(this.ecModel, mainType, {\n index: this.get(indexKey, true),\n id: this.get(idKey, true)\n }, opt);\n };\n\n ComponentModel.prototype.getBoxLayoutParams = function () {\n // Consider itself having box layout configs.\n var boxLayoutModel = this;\n return {\n left: boxLayoutModel.get('left'),\n top: boxLayoutModel.get('top'),\n right: boxLayoutModel.get('right'),\n bottom: boxLayoutModel.get('bottom'),\n width: boxLayoutModel.get('width'),\n height: boxLayoutModel.get('height')\n };\n };\n /**\r\n * Get key for zlevel.\r\n * If developers don't configure zlevel. We will assign zlevel to series based on the key.\r\n * For example, lines with trail effect and progressive series will in an individual zlevel.\r\n */\n\n\n ComponentModel.prototype.getZLevelKey = function () {\n return '';\n };\n\n ComponentModel.prototype.setZLevel = function (zlevel) {\n this.option.zlevel = zlevel;\n };\n\n ComponentModel.protoInitialize = function () {\n var proto = ComponentModel.prototype;\n proto.type = 'component';\n proto.id = '';\n proto.name = '';\n proto.mainType = '';\n proto.subType = '';\n proto.componentIndex = 0;\n }();\n\n return ComponentModel;\n}(Model);\n\nmountExtend(ComponentModel, Model);\nenableClassManagement(ComponentModel);\ncomponentUtil.enableSubTypeDefaulter(ComponentModel);\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\n\nfunction getDependencies(componentType) {\n var deps = [];\n zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (clz) {\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\n }); // Ensure main type.\n\n deps = zrUtil.map(deps, function (type) {\n return parseClassType(type).main;\n }); // Hack dataset for convenience.\n\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n deps.unshift('dataset');\n }\n\n return deps;\n}\n\nexport default ComponentModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar platform = ''; // Navigator not exists in node\n\nif (typeof navigator !== 'undefined') {\n /* global navigator */\n platform = navigator.platform || '';\n}\n\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\nexport default {\n darkMode: 'auto',\n // backgroundColor: 'rgba(0,0,0,0)',\n colorBy: 'series',\n color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\n aria: {\n decal: {\n decals: [{\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [2, 5],\n symbolSize: 1,\n rotation: Math.PI / 6\n }, {\n color: decalColor,\n symbol: 'circle',\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\n dashArrayY: [6, 0],\n symbolSize: 0.8\n }, {\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [4, 3],\n rotation: -Math.PI / 4\n }, {\n color: decalColor,\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\n dashArrayY: [6, 0]\n }, {\n color: decalColor,\n dashArrayX: [[1, 0], [1, 6]],\n dashArrayY: [1, 0, 6, 0],\n rotation: Math.PI / 4\n }, {\n color: decalColor,\n symbol: 'triangle',\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\n dashArrayY: [7, 2],\n symbolSize: 0.75\n }]\n }\n },\n // If xAxis and yAxis declared, grid is created by default.\n // grid: {},\n textStyle: {\n // color: '#000',\n // decoration: 'none',\n // PENDING\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n // fontFamily: 'Arial, Verdana, sans-serif',\n fontSize: 12,\n fontStyle: 'normal',\n fontWeight: 'normal'\n },\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n // Default is source-over\n blendMode: null,\n stateAnimation: {\n duration: 300,\n easing: 'cubicOut'\n },\n animation: 'auto',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut',\n animationEasingUpdate: 'cubicInOut',\n animationThreshold: 2000,\n // Configuration for progressive/incremental rendering\n progressiveThreshold: 3000,\n progressive: 400,\n // Threshold of if use single hover layer to optimize.\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n // which is unexpected.\n // see example .\n hoverLayerThreshold: 3000,\n // See: module:echarts/scale/Time\n useUTC: false\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\n;\n;\n;\nexport var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'seriesName']);\nexport var SOURCE_FORMAT_ORIGINAL = 'original';\nexport var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nexport var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nexport var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nexport var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nexport var SOURCE_FORMAT_UNKNOWN = 'unknown';\nexport var SERIES_LAYOUT_BY_COLUMN = 'column';\nexport var SERIES_LAYOUT_BY_ROW = 'row';\n;\n;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model.js';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types.js'; // The result of `guessOrdinal`.\n\nexport var BE_ORDINAL = {\n Must: 1,\n Might: 2,\n Not: 3 // Other cases\n\n};\nvar innerGlobalModel = makeInner();\n/**\r\n * MUST be called before mergeOption of all series.\r\n */\n\nexport function resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\r\n * [The strategy of the arrengment of data dimensions for dataset]:\r\n * \"value way\": all axes are non-category axes. So series one by one take\r\n * several (the number is coordSysDims.length) dimensions from dataset.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\r\n * \"category way\": at least one axis is category axis. So the the first data\r\n * dimension is always mapped to the first category axis and shared by\r\n * all of the series. The other data dimensions are taken by series like\r\n * \"value way\" does.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\n\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when multiple series share one dimension\n // category axis, series name should better use\n // the other dimension name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\r\n * Work for data like [{name: ..., value: ...}, ...].\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\n\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel) {\n return encode;\n }\n\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = []; // 5 is an experience value.\n\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n\n\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n\n if (idxResult) {\n encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority.\n\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label uses itemName in charts.\n // So we don't set encodeLabel here.\n\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n\n return encode;\n}\n/**\r\n * @return If return null/undefined, indicate that should not use datasetModel.\r\n */\n\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n // 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 var thisData = seriesModel.get('data', true);\n\n if (!thisData) {\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n index: seriesModel.get('datasetIndex', true),\n id: seriesModel.get('datasetId', true)\n }, SINGLE_REFERRING).models[0];\n }\n}\n/**\r\n * @return Always return an array event empty.\r\n */\n\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n // Only these attributes declared, we by defualt reference to `datasetIndex: 0`.\n // Otherwise, no reference.\n if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n return [];\n }\n\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n index: datasetModel.get('fromDatasetIndex', true),\n id: datasetModel.get('fromDatasetId', true)\n }, SINGLE_REFERRING).models;\n}\n/**\r\n * The rule should not be complex, otherwise user might not\r\n * be able to known where the data is wrong.\r\n * The code is ugly, but how to make it neat?\r\n */\n\nexport function 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// return {BE_ORDINAL}\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 BE_ORDINAL.Not;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n var dimType;\n\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = dataArrayRows[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 < dataArrayRows.length && i < maxLoop; i++) {\n var row = dataArrayRows[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 var dataObjectRows = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n var item = dataObjectRows[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n var dataKeyedColumns = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n var sample = dataKeyedColumns[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\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 var dataOriginal = data;\n\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n var item = dataOriginal[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n\n if (val != null && isFinite(val) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n\n return BE_ORDINAL.Not;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, assert } from 'zrender/lib/core/util.js';\nimport { isComponentIdInternal } from '../util/model.js';\nvar internalOptionCreatorMap = createHashMap();\nexport function registerInternalOptionCreator(mainType, creator) {\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\n internalOptionCreatorMap.set(mainType, creator);\n}\nexport function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\n\n if (!internalOptionCreator) {\n return newCmptOptionList;\n }\n\n var internalOptions = internalOptionCreator(ecModel);\n\n if (!internalOptions) {\n return newCmptOptionList;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < internalOptions.length; i++) {\n assert(isComponentIdInternal(internalOptions[i]));\n }\n }\n\n return newCmptOptionList.concat(internalOptions);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, normalizeToArray } from '../../util/model.js';\nvar innerColor = makeInner();\nvar innerDecal = makeInner();\n\nvar PaletteMixin =\n/** @class */\nfunction () {\n function PaletteMixin() {}\n\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\n var defaultPalette = normalizeToArray(this.get('color', true));\n var layeredPalette = this.get('colorLayer', true);\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\n };\n\n PaletteMixin.prototype.clearColorPalette = function () {\n clearPalette(this, innerColor);\n };\n\n return PaletteMixin;\n}();\n\nexport function getDecalFromPalette(ecModel, name, scope, requestNum) {\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\n}\n\nfunction getNearestPalette(palettes, requestColorNum) {\n var paletteNum = palettes.length; // TODO palettes must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (palettes[i].length > requestColorNum) {\n return palettes[i];\n }\n }\n\n return palettes[paletteNum - 1];\n}\n/**\r\n * @param name MUST NOT be null/undefined. Otherwise call this function\r\n * twise with the same parameters will get different result.\r\n * @param scope default this.\r\n * @return Can be null/undefined\r\n */\n\n\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\n scope = scope || that;\n var scopeFields = inner(scope);\n var paletteIdx = scopeFields.paletteIdx || 0;\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (paletteNameMap.hasOwnProperty(name)) {\n return paletteNameMap[name];\n }\n\n var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); // In case can't find in layered color palette.\n\n palette = palette || defaultPalette;\n\n if (!palette || !palette.length) {\n return;\n }\n\n var pickedPaletteItem = palette[paletteIdx];\n\n if (name) {\n paletteNameMap[name] = pickedPaletteItem;\n }\n\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\n return pickedPaletteItem;\n}\n\nfunction clearPalette(that, inner) {\n inner(that).paletteIdx = 0;\n inner(that).paletteNameMap = {};\n}\n\nexport { PaletteMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Caution: If the mechanism should be changed some day, these cases\r\n * should be considered:\r\n *\r\n * (1) In `merge option` mode, if using the same option to call `setOption`\r\n * many times, the result should be the same (try our best to ensure that).\r\n * (2) In `merge option` mode, if a component has no id/name specified, it\r\n * will be merged by index, and the result sequence of the components is\r\n * consistent to the original sequence.\r\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\r\n * consistent to the original sequence, even though there might result in \"hole\".\r\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\r\n * `mergeOption` in module:echarts/model/OptionManager.\r\n */\n\nimport { each, filter, isArray, isObject, isString, createHashMap, assert, clone, merge, extend, mixin, isFunction } from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../util/model.js';\nimport Model from './Model.js';\nimport ComponentModel from './Component.js';\nimport globalDefault from './globalDefault.js';\nimport { resetSourceDefaulter } from '../data/helper/sourceHelper.js';\nimport { concatInternalOptions } from './internalComponentCreator.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { error, warn } from '../util/log.js'; // -----------------------\n// Internal method names:\n// -----------------------\n\nvar reCreateSeriesIndices;\nvar assertSeriesInitialized;\nvar initBase;\nvar OPTION_INNER_KEY = '\\0_ec_inner';\nvar OPTION_INNER_VALUE = 1;\nvar BUITIN_COMPONENTS_MAP = {\n grid: 'GridComponent',\n polar: 'PolarComponent',\n geo: 'GeoComponent',\n singleAxis: 'SingleAxisComponent',\n parallel: 'ParallelComponent',\n calendar: 'CalendarComponent',\n graphic: 'GraphicComponent',\n toolbox: 'ToolboxComponent',\n tooltip: 'TooltipComponent',\n axisPointer: 'AxisPointerComponent',\n brush: 'BrushComponent',\n title: 'TitleComponent',\n timeline: 'TimelineComponent',\n markPoint: 'MarkPointComponent',\n markLine: 'MarkLineComponent',\n markArea: 'MarkAreaComponent',\n legend: 'LegendComponent',\n dataZoom: 'DataZoomComponent',\n visualMap: 'VisualMapComponent',\n // aria: 'AriaComponent',\n // dataset: 'DatasetComponent',\n // Dependencies\n xAxis: 'GridComponent',\n yAxis: 'GridComponent',\n angleAxis: 'PolarComponent',\n radiusAxis: 'PolarComponent'\n};\nvar BUILTIN_CHARTS_MAP = {\n line: 'LineChart',\n bar: 'BarChart',\n pie: 'PieChart',\n scatter: 'ScatterChart',\n radar: 'RadarChart',\n map: 'MapChart',\n tree: 'TreeChart',\n treemap: 'TreemapChart',\n graph: 'GraphChart',\n gauge: 'GaugeChart',\n funnel: 'FunnelChart',\n parallel: 'ParallelChart',\n sankey: 'SankeyChart',\n boxplot: 'BoxplotChart',\n candlestick: 'CandlestickChart',\n effectScatter: 'EffectScatterChart',\n lines: 'LinesChart',\n heatmap: 'HeatmapChart',\n pictorialBar: 'PictorialBarChart',\n themeRiver: 'ThemeRiverChart',\n sunburst: 'SunburstChart',\n custom: 'CustomChart'\n};\nvar componetsMissingLogPrinted = {};\n\nfunction checkMissingComponents(option) {\n each(option, function (componentOption, mainType) {\n if (!ComponentModel.hasClass(mainType)) {\n var componentImportName = BUITIN_COMPONENTS_MAP[mainType];\n\n if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\n error(\"Component \" + mainType + \" is used but not imported.\\nimport { \" + componentImportName + \" } from 'echarts/components';\\necharts.use([\" + componentImportName + \"]);\");\n componetsMissingLogPrinted[componentImportName] = true;\n }\n }\n });\n}\n\nvar GlobalModel =\n/** @class */\nfunction (_super) {\n __extends(GlobalModel, _super);\n\n function GlobalModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n this._theme = new Model(theme);\n this._locale = new Model(locale);\n this._optionManager = optionManager;\n };\n\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\n if (process.env.NODE_ENV !== 'production') {\n assert(option != null, 'option is null/undefined');\n assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()');\n }\n\n var innerOpt = normalizeSetOptionInput(opts);\n\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\n\n this._resetOption(null, innerOpt);\n };\n /**\r\n * @param type null/undefined: reset all.\r\n * 'recreate': force recreate all.\r\n * 'timeline': only reset timeline option\r\n * 'media': only reset media query option\r\n * @return Whether option changed.\r\n */\n\n\n GlobalModel.prototype.resetOption = function (type, opt) {\n return this._resetOption(type, normalizeSetOptionInput(opt));\n };\n\n GlobalModel.prototype._resetOption = function (type, opt) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (process.env.NODE_ENV !== 'production') {\n checkMissingComponents(baseOption);\n }\n\n if (!this.option || type === 'recreate') {\n initBase(this, baseOption);\n } else {\n this.restoreData();\n\n this._mergeOption(baseOption, opt);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n } // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\n // it should better not have the same props with `MediaUnit['option']`.\n // Because either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\n // rather than original \"baseOption\". If they both override a prop, the result might be\n // unexpected when media state changed after `setOption` called.\n // If we really need to modify a props in each `MediaUnit['option']`, use the full version\n // (`{baseOption, media}`) in `setOption`.\n // For `timeline`, the case is the same.\n\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n\n if (timelineOption) {\n optionChanged = true;\n\n this._mergeOption(timelineOption, opt);\n }\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n optionChanged = true;\n\n this._mergeOption(mediaOption, opt);\n }, this);\n }\n }\n\n return optionChanged;\n };\n\n GlobalModel.prototype.mergeOption = function (option) {\n this._mergeOption(option, null);\n };\n\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var componentsCount = this._componentsCount;\n var newCmptTypes = [];\n var newCmptTypeMap = createHashMap();\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCmptTypes.push(mainType);\n newCmptTypeMap.set(mainType, true);\n }\n });\n\n if (replaceMergeMainTypeMap) {\n // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\n // we trade it as it is declared in option as `{xxx: []}`. Because:\n // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\n // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\n newCmptTypes.push(mainTypeInReplaceMerge);\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\n }\n });\n }\n\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType) {\n var newCmptOptionList = concatInternalOptions(this, mainType, modelUtil.normalizeToArray(newOption[mainType]));\n var oldCmptList = componentsMap.get(mainType);\n var mergeMode = // `!oldCmptList` means init. See the comment in `mappingToExists`\n !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';\n var mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode); // Set mainType and complete subType.\n\n modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); // Empty it before the travel, in order to prevent `this._componentsMap`\n // from being used in the `init`/`mergeOption`/`optionUpdated` of some\n // components, which is probably incorrect logic.\n\n option[mainType] = null;\n componentsMap.set(mainType, null);\n componentsCount.set(mainType, 0);\n var optionsByMainType = [];\n var cmptsByMainType = [];\n var cmptsCountByMainType = 0;\n var tooltipExists;\n var tooltipWarningLogged;\n each(mappingResult, function (resultItem, index) {\n var componentModel = resultItem.existing;\n var newCmptOption = resultItem.newOption;\n\n if (!newCmptOption) {\n if (componentModel) {\n // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } // If no both `resultItem.exist` and `resultItem.option`,\n // either it is in `replaceMerge` and not matched by any id,\n // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\n\n } else {\n var isSeriesType = mainType === 'series';\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists\n );\n\n if (!ComponentModelClass) {\n if (process.env.NODE_ENV !== 'production') {\n var subType = resultItem.keyInfo.subType;\n var seriesImportName = BUILTIN_CHARTS_MAP[subType];\n\n if (!componetsMissingLogPrinted[subType]) {\n componetsMissingLogPrinted[subType] = true;\n\n if (seriesImportName) {\n error(\"Series \" + subType + \" is used but not imported.\\nimport { \" + seriesImportName + \" } from 'echarts/charts';\\necharts.use([\" + seriesImportName + \"]);\");\n } else {\n error(\"Unknown series \" + subType);\n }\n }\n }\n\n return;\n } // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.\n\n\n if (mainType === 'tooltip') {\n if (tooltipExists) {\n if (process.env.NODE_ENV !== 'production') {\n if (!tooltipWarningLogged) {\n warn('Currently only one tooltip component is allowed.');\n tooltipWarningLogged = true;\n }\n }\n\n return;\n }\n\n tooltipExists = true;\n }\n\n if (componentModel && componentModel.constructor === ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCmptOption, this);\n componentModel.optionUpdated(newCmptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo`\n\n extend(componentModel, extraOpt);\n\n if (resultItem.brandNew) {\n componentModel.__requireNewView = true;\n }\n\n componentModel.init(newCmptOption, this, this); // Call optionUpdated after init.\n // newCmptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n if (componentModel) {\n optionsByMainType.push(componentModel.option);\n cmptsByMainType.push(componentModel);\n cmptsCountByMainType++;\n } else {\n // Always do assign to avoid elided item in array.\n optionsByMainType.push(void 0);\n cmptsByMainType.push(void 0);\n }\n }, this);\n option[mainType] = optionsByMainType;\n componentsMap.set(mainType, cmptsByMainType);\n componentsCount.set(mainType, cmptsCountByMainType); // Backup series for filtering.\n\n if (mainType === 'series') {\n reCreateSeriesIndices(this);\n }\n } // If no series declared, ensure `_seriesIndices` initialized.\n\n\n if (!this._seriesIndices) {\n reCreateSeriesIndices(this);\n }\n };\n /**\r\n * Get option for output (cloned option and inner info removed)\r\n */\n\n\n GlobalModel.prototype.getOption = function () {\n var option = clone(this.option);\n each(option, function (optInMainType, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(optInMainType); // Inner cmpts need to be removed.\n // Inner cmpts might not be at last since ec5.0, but still\n // compatible for users: if inner cmpt at last, splice the returned array.\n\n var realLen = opts.length;\n var metNonInner = false;\n\n for (var i = realLen - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\n metNonInner = true;\n } else {\n opts[i] = null;\n !metNonInner && realLen--;\n }\n }\n\n opts.length = realLen;\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n };\n\n GlobalModel.prototype.getTheme = function () {\n return this._theme;\n };\n\n GlobalModel.prototype.getLocaleModel = function () {\n return this._locale;\n };\n\n GlobalModel.prototype.setUpdatePayload = function (payload) {\n this._payload = payload;\n };\n\n GlobalModel.prototype.getUpdatePayload = function () {\n return this._payload;\n };\n /**\r\n * @param idx If not specified, return the first one.\r\n */\n\n\n GlobalModel.prototype.getComponent = function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n var cmpt = list[idx || 0];\n\n if (cmpt) {\n return cmpt;\n } else if (idx == null) {\n for (var i = 0; i < list.length; i++) {\n if (list[i]) {\n return list[i];\n }\n }\n }\n }\n };\n /**\r\n * @return Never be null/undefined.\r\n */\n\n\n GlobalModel.prototype.queryComponents = function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cmpts = this._componentsMap.get(mainType);\n\n if (!cmpts || !cmpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n result = [];\n each(modelUtil.normalizeToArray(index), function (idx) {\n cmpts[idx] && result.push(cmpts[idx]);\n });\n } else if (id != null) {\n result = queryByIdOrName('id', id, cmpts);\n } else if (name != null) {\n result = queryByIdOrName('name', name, cmpts);\n } else {\n // Return all non-empty components in that mainType\n result = filter(cmpts, function (cmpt) {\n return !!cmpt;\n });\n }\n\n return filterBySubType(result, condition);\n };\n /**\r\n * The interface is different from queryComponents,\r\n * which is convenient for inner usage.\r\n *\r\n * @usage\r\n * let result = findComponents(\r\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series',\r\n * filter: function (model, index) {...}}\r\n * );\r\n * // result like [component0, componnet1, ...]\r\n */\n\n\n GlobalModel.prototype.findComponents = function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) // Retrieve all non-empty components.\n : filter(this._componentsMap.get(mainType), function (cmpt) {\n return !!cmpt;\n });\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n };\n\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (isFunction(mainType)) {\n var ctxForAll_1 = cb;\n var cbForAll_1 = mainType;\n componentsMap.each(function (cmpts, componentType) {\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\n }\n });\n } else {\n var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null;\n\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\n }\n }\n };\n /**\r\n * Get series list before filtered by name.\r\n */\n\n\n GlobalModel.prototype.getSeriesByName = function (name) {\n var nameStr = modelUtil.convertOptionIdName(name, null);\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && nameStr != null && oneSeries.name === nameStr;\n });\n };\n /**\r\n * Get series list before filtered by index.\r\n */\n\n\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n };\n /**\r\n * Get series list before filtered by type.\r\n * FIXME: rename to getRawSeriesByType?\r\n */\n\n\n GlobalModel.prototype.getSeriesByType = function (subType) {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && oneSeries.subType === subType;\n });\n };\n /**\r\n * Get all series before filtered.\r\n */\n\n\n GlobalModel.prototype.getSeries = function () {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries;\n });\n };\n /**\r\n * Count series before filtered.\r\n */\n\n\n GlobalModel.prototype.getSeriesCount = function () {\n return this._componentsCount.get('series');\n };\n /**\r\n * After filtering, series may be different\r\n * from raw series.\r\n */\n\n\n GlobalModel.prototype.eachSeries = function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n };\n /**\r\n * Iterate raw series before filtered.\r\n *\r\n * @param {Function} cb\r\n * @param {*} context\r\n */\n\n\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\n each(this._componentsMap.get('series'), function (series) {\n series && cb.call(context, series, series.componentIndex);\n });\n };\n /**\r\n * After filtering, series may be different.\r\n * from raw series.\r\n */\n\n\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n };\n /**\r\n * Iterate raw series before filtered of given type.\r\n */\n\n\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n };\n\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n };\n\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\n return (this._seriesIndices || []).slice();\n };\n\n GlobalModel.prototype.filterSeries = function (cb, context) {\n assertSeriesInitialized(this);\n var newSeriesIndices = [];\n each(this._seriesIndices, function (seriesRawIdx) {\n var series = this._componentsMap.get('series')[seriesRawIdx];\n\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\n }, this);\n this._seriesIndices = newSeriesIndices;\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\n };\n\n GlobalModel.prototype.restoreData = function (payload) {\n reCreateSeriesIndices(this);\n var componentsMap = this._componentsMap;\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n if (ComponentModel.hasClass(componentType)) {\n componentTypes.push(componentType);\n }\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\n each(componentsMap.get(componentType), function (component) {\n if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) {\n component.restoreData();\n }\n });\n });\n };\n\n GlobalModel.internalField = function () {\n reCreateSeriesIndices = function (ecModel) {\n var seriesIndices = ecModel._seriesIndices = [];\n each(ecModel._componentsMap.get('series'), function (series) {\n // series may have been removed by `replaceMerge`.\n series && seriesIndices.push(series.componentIndex);\n });\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\n };\n\n assertSeriesInitialized = function (ecModel) {\n // Components that use _seriesIndices should depends on series component,\n // which make sure that their initialization is after series.\n if (process.env.NODE_ENV !== 'production') {\n if (!ecModel._seriesIndices) {\n throw new Error('Option should contains series.');\n }\n }\n };\n\n initBase = function (ecModel, baseOption) {\n // Using OPTION_INNER_KEY to mark that this option cannot be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbidden.\n ecModel.option = {};\n ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; // Init with series: [], in case of calling findSeries method\n // before series initialized.\n\n ecModel._componentsMap = createHashMap({\n series: []\n });\n ecModel._componentsCount = createHashMap(); // If user spefied `option.aria`, aria will be enable. This detection should be\n // performed before theme and globalDefault merge.\n\n var airaOption = baseOption.aria;\n\n if (isObject(airaOption) && airaOption.enabled == null) {\n airaOption.enabled = true;\n }\n\n mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n\n ecModel._mergeOption(baseOption, null);\n };\n }();\n\n return GlobalModel;\n}(Model);\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seriesIndex;\n var id = payload.seriesId;\n var name_1 = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;\n }\n}\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // If it is component model mainType, the model handles that merge later.\n // otherwise, merge them here.\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction queryByIdOrName(attr, idOrName, cmpts) {\n // Here is a break from echarts4: string and number are\n // treated as equal.\n if (isArray(idOrName)) {\n var keyMap_1 = createHashMap();\n each(idOrName, function (idOrNameItem) {\n if (idOrNameItem != null) {\n var idName = modelUtil.convertOptionIdName(idOrNameItem, null);\n idName != null && keyMap_1.set(idOrNameItem, true);\n }\n });\n return filter(cmpts, function (cmpt) {\n return cmpt && keyMap_1.get(cmpt[attr]);\n });\n } else {\n var idName_1 = modelUtil.convertOptionIdName(idOrName, null);\n return filter(cmpts, function (cmpt) {\n return cmpt && idName_1 != null && cmpt[attr] === idName_1;\n });\n }\n}\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) {\n return cmpt && cmpt.subType === condition.subType;\n }) : components;\n}\n\nfunction normalizeSetOptionInput(opts) {\n var replaceMergeMainTypeMap = createHashMap();\n opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\n if (process.env.NODE_ENV !== 'production') {\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\n }\n\n replaceMergeMainTypeMap.set(mainType, true);\n });\n return {\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\n };\n}\n\nmixin(GlobalModel, PaletteMixin);\nexport default GlobalModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', // 'getModel',\n'getOption', // 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\n\nvar ExtensionAPI =\n/** @class */\nfunction () {\n function ExtensionAPI(ecInstance) {\n zrUtil.each(availableMethods, function (methodName) {\n this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n }, this);\n }\n\n return ExtensionAPI;\n}();\n\nexport default ExtensionAPI;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar coordinateSystemCreators = {};\n\nvar CoordinateSystemManager =\n/** @class */\nfunction () {\n function CoordinateSystemManager() {\n this._coordinateSystems = [];\n }\n\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creator, type) {\n var list = creator.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n };\n\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n };\n\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n return this._coordinateSystems.slice();\n };\n\n CoordinateSystemManager.register = function (type, creator) {\n coordinateSystemCreators[type] = creator;\n };\n\n CoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n };\n\n return CoordinateSystemManager;\n}();\n\nexport default CoordinateSystemManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { normalizeToArray // , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\n} from '../util/model.js';\nimport { each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject // , HashMap , createHashMap, extend, merge,\n} from 'zrender/lib/core/util.js';\nimport { error } from '../util/log.js';\nvar QUERY_REG = /^(min|max)?(.+)$/; // Key: mainType\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\n\n/**\r\n * TERM EXPLANATIONS:\r\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\r\n */\n\nvar OptionManager =\n/** @class */\nfunction () {\n // timeline.notMerge is not supported in ec3. Firstly there is rearly\n // case that notMerge is needed. Secondly supporting 'notMerge' requires\n // rawOption cloned and backuped when timeline changed, which does no\n // good to performance. What's more, that both timeline and setOption\n // method supply 'notMerge' brings complex and some problems.\n // Consider this case:\n // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n function OptionManager(api) {\n this._timelineOptions = [];\n this._mediaList = [];\n /**\r\n * -1, means default.\r\n * empty means no media.\r\n */\n\n this._currentMediaIndices = [];\n this._api = api;\n }\n\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\n if (rawOption) {\n // That set dat primitive is dangerous if user reuse the data when setOption again.\n each(normalizeToArray(rawOption.series), function (series) {\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\n });\n each(normalizeToArray(rawOption.dataset), function (dataset) {\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\n });\n } // Caution: some series modify option data, if do not clone,\n // it should ensure that the repeat modify correctly\n // (create a new object when modify itself).\n\n\n rawOption = clone(rawOption); // FIXME\n // If some property is set in timeline options or media option but\n // not set in baseOption, a warning should be given.\n\n var optionBackup = this._optionBackup;\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\n this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode);\n\n if (optionBackup) {\n // FIXME\n // the restore merge solution is essentially incorrect.\n // the mapping can not be 100% consistent with ecModel, which probably brings\n // potential bug!\n // The first merge is delayed, because in most cases, users do not call `setOption` twice.\n // let fakeCmptsMap = this._fakeCmptsMap;\n // if (!fakeCmptsMap) {\n // fakeCmptsMap = this._fakeCmptsMap = createHashMap();\n // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\n // }\n // mergeToBackupOption(\n // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\n // );\n // For simplicity, timeline options and media options do not support merge,\n // that is, if you `setOption` twice and both has timeline options, the latter\n // timeline options will not be merged to the former, but just substitute them.\n if (newParsedOption.timelineOptions.length) {\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\n }\n\n if (newParsedOption.mediaList.length) {\n optionBackup.mediaList = newParsedOption.mediaList;\n }\n\n if (newParsedOption.mediaDefault) {\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\n }\n } else {\n this._optionBackup = newParsedOption;\n }\n };\n\n OptionManager.prototype.mountOption = function (isRecreate) {\n var optionBackup = this._optionBackup;\n this._timelineOptions = optionBackup.timelineOptions;\n this._mediaList = optionBackup.mediaList;\n this._mediaDefault = optionBackup.mediaDefault;\n this._currentMediaIndices = [];\n return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption`\n // called, and is merged into every new option by inner method `mergeToBackupOption`\n // each time `setOption` called, can be only used in `isRecreate`, because\n // its reliability is under suspicion. In other cases option merge is\n // performed by `model.mergeOption`.\n ? optionBackup.baseOption : this._newBaseOption);\n };\n\n OptionManager.prototype.getTimelineOption = function (ecModel) {\n var option;\n var timelineOptions = this._timelineOptions;\n\n if (timelineOptions.length) {\n // getTimelineOption can only be called after ecModel inited,\n // so we can get currentIndex from timelineModel.\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel) {\n option = clone( // FIXME:TS as TimelineModel or quivlant interface\n timelineOptions[timelineModel.getCurrentIndex()]);\n }\n }\n\n return option;\n };\n\n OptionManager.prototype.getMediaOption = function (ecModel) {\n var ecWidth = this._api.getWidth();\n\n var ecHeight = this._api.getHeight();\n\n var mediaList = this._mediaList;\n var mediaDefault = this._mediaDefault;\n var indices = [];\n var result = []; // No media defined.\n\n if (!mediaList.length && !mediaDefault) {\n return result;\n } // Multi media may be applied, the latter defined media has higher priority.\n\n\n for (var i = 0, len = mediaList.length; i < len; i++) {\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n indices.push(i);\n }\n } // FIXME\n // Whether mediaDefault should force users to provide? Otherwise\n // the change by media query can not be recorvered.\n\n\n if (!indices.length && mediaDefault) {\n indices = [-1];\n }\n\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n result = map(indices, function (index) {\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n });\n } // Otherwise return nothing.\n\n\n this._currentMediaIndices = indices;\n return result;\n };\n\n return OptionManager;\n}();\n/**\r\n * [RAW_OPTION_PATTERNS]\r\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\r\n *\r\n * (1) No prop \"baseOption\" declared:\r\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\r\n * ```js\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * };\r\n * option = {\r\n * series: [],\r\n * media: {},\r\n * };\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * media: {},\r\n * }\r\n * ```\r\n *\r\n * (2) Prop \"baseOption\" declared:\r\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\r\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\r\n * ```js\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * media: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * media: []\r\n * };\r\n * option = {\r\n * // ec3 compat ec2: allow (only) `timeline` declared\r\n * // outside baseOption. Keep this setting for compat.\r\n * timeline: {},\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * options: [],\r\n * media: []\r\n * };\r\n * ```\r\n */\n\n\nfunction parseRawOption( // `rawOption` May be modified\nrawOption, optionPreprocessorFuncs, isNew) {\n var mediaList = [];\n var mediaDefault;\n var baseOption;\n var declaredBaseOption = rawOption.baseOption; // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\n\n var timelineOnRoot = rawOption.timeline;\n var timelineOptionsOnRoot = rawOption.options;\n var mediaOnRoot = rawOption.media;\n var hasMedia = !!rawOption.media;\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);\n\n if (declaredBaseOption) {\n baseOption = declaredBaseOption; // For merge option.\n\n if (!baseOption.timeline) {\n baseOption.timeline = timelineOnRoot;\n }\n } // For convenience, enable to use the root option as the `baseOption`:\n // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\n else {\n if (hasTimeline || hasMedia) {\n rawOption.options = rawOption.media = null;\n }\n\n baseOption = rawOption;\n }\n\n if (hasMedia) {\n if (isArray(mediaOnRoot)) {\n each(mediaOnRoot, function (singleMedia) {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) {\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\n }\n }\n\n if (singleMedia && singleMedia.option) {\n if (singleMedia.query) {\n mediaList.push(singleMedia);\n } else if (!mediaDefault) {\n // Use the first media default.\n mediaDefault = singleMedia;\n }\n }\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\n }\n }\n }\n\n doPreprocess(baseOption);\n each(timelineOptionsOnRoot, function (option) {\n return doPreprocess(option);\n });\n each(mediaList, function (media) {\n return doPreprocess(media.option);\n });\n\n function doPreprocess(option) {\n each(optionPreprocessorFuncs, function (preProcess) {\n preProcess(option, isNew);\n });\n }\n\n return {\n baseOption: baseOption,\n timelineOptions: timelineOptionsOnRoot || [],\n mediaDefault: mediaDefault,\n mediaList: mediaList\n };\n}\n/**\r\n * @see \r\n * Support: width, height, aspectRatio\r\n * Can use max or min as prefix.\r\n */\n\n\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n var realMap = {\n width: ecWidth,\n height: ecHeight,\n aspectratio: ecWidth / ecHeight // lower case for convenience.\n\n };\n var applicable = true;\n each(query, function (value, attr) {\n var matched = attr.match(QUERY_REG);\n\n if (!matched || !matched[1] || !matched[2]) {\n return;\n }\n\n var operator = matched[1];\n var realAttr = matched[2].toLowerCase();\n\n if (!compare(realMap[realAttr], value, operator)) {\n applicable = false;\n }\n });\n return applicable;\n}\n\nfunction compare(real, expect, operator) {\n if (operator === 'min') {\n return real >= expect;\n } else if (operator === 'max') {\n return real <= expect;\n } else {\n // Equals\n return real === expect;\n }\n}\n\nfunction indicesEquals(indices1, indices2) {\n // indices is always order by asc and has only finite number.\n return indices1.join(',') === indices2.join(',');\n}\n/**\r\n * Consider case:\r\n * `chart.setOption(opt1);`\r\n * Then user do some interaction like dataZoom, dataView changing.\r\n * `chart.setOption(opt2);`\r\n * Then user press 'reset button' in toolbox.\r\n *\r\n * After doing that all of the interaction effects should be reset, the\r\n * chart should be the same as the result of invoke\r\n * `chart.setOption(opt1); chart.setOption(opt2);`.\r\n *\r\n * Although it is not able ensure that\r\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\r\n * `chart.setOption(merge(opt1, opt2));` exactly,\r\n * this might be the only simple way to implement that feature.\r\n *\r\n * MEMO: We've considered some other approaches:\r\n * 1. Each model handles its self restoration but not uniform treatment.\r\n * (Too complex in logic and error-prone)\r\n * 2. Use a shadow ecModel. (Performance expensive)\r\n *\r\n * FIXME: A possible solution:\r\n * Add a extra level of model for each component model. The inheritance chain would be:\r\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\r\n * And all of the actions can only modify the `componentActionModel` rather than\r\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\r\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\r\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\r\n */\n// function mergeToBackupOption(\n// fakeCmptsMap: FakeComponentsMap,\n// // `tarOption` Can be null/undefined, means init\n// tarOption: ECUnitOption,\n// newOption: ECUnitOption,\n// // Can be null/undefined\n// opt: InnerSetOptionOpts\n// ): void {\n// newOption = newOption || {} as ECUnitOption;\n// const notInit = !!tarOption;\n// each(newOption, function (newOptsInMainType, mainType) {\n// if (newOptsInMainType == null) {\n// return;\n// }\n// if (!ComponentModel.hasClass(mainType)) {\n// if (tarOption) {\n// tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\n// }\n// }\n// else {\n// const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\n// const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\n// const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\n// const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\n// const mappingResult = mappingToExists(\n// oldFakeCmptsInMainType,\n// normalizeToArray(newOptsInMainType),\n// (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\n// );\n// setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\n// each(mappingResult, function (resultItem, index) {\n// // The same logic as `Global.ts#_mergeOption`.\n// let fakeCmpt = resultItem.existing;\n// const newOption = resultItem.newOption;\n// const keyInfo = resultItem.keyInfo;\n// let fakeCmptOpt;\n// if (!newOption) {\n// fakeCmptOpt = oldTarOptsInMainType[index];\n// }\n// else {\n// if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\n// fakeCmpt.name = keyInfo.name;\n// if (notInit) {\n// fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\n// }\n// }\n// else {\n// fakeCmpt = extend({}, keyInfo);\n// if (notInit) {\n// fakeCmptOpt = clone(newOption);\n// }\n// }\n// }\n// if (fakeCmpt) {\n// notInit && resultTarOptsInMainType.push(fakeCmptOpt);\n// resultFakeCmptsInMainType.push(fakeCmpt);\n// }\n// else {\n// notInit && resultTarOptsInMainType.push(void 0);\n// resultFakeCmptsInMainType.push(void 0);\n// }\n// });\n// }\n// });\n// }\n\n\nexport default OptionManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\n\nfunction compatEC2ItemStyle(opt) {\n var itemStyleOpt = opt && opt.itemStyle;\n\n if (!itemStyleOpt) {\n return;\n }\n\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n var styleName = POSSIBLE_STYLES[i];\n var normalItemStyleOpt = itemStyleOpt.normal;\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].normal) {\n opt[styleName].normal = normalItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n }\n\n normalItemStyleOpt[styleName] = null;\n }\n\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].emphasis) {\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n }\n\n emphasisItemStyleOpt[styleName] = null;\n }\n }\n}\n\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n var normalOpt = opt[optType].normal;\n var emphasisOpt = opt[optType].emphasis;\n\n if (normalOpt) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\n } // Timeline controlStyle has other properties besides normal and emphasis\n\n\n if (useExtend) {\n opt[optType].normal = opt[optType].emphasis = null;\n zrUtil.defaults(opt[optType], normalOpt);\n } else {\n opt[optType] = normalOpt;\n }\n }\n\n if (emphasisOpt) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\n }\n\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[optType] = emphasisOpt; // Also compat the case user mix the style and focus together in ec3 style\n // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\n\n if (emphasisOpt.focus) {\n opt.emphasis.focus = emphasisOpt.focus;\n }\n\n if (emphasisOpt.blurScope) {\n opt.emphasis.blurScope = emphasisOpt.blurScope;\n }\n }\n }\n}\n\nfunction removeEC3NormalStatus(opt) {\n convertNormalEmphasis(opt, 'itemStyle');\n convertNormalEmphasis(opt, 'lineStyle');\n convertNormalEmphasis(opt, 'areaStyle');\n convertNormalEmphasis(opt, 'label');\n convertNormalEmphasis(opt, 'labelLine'); // treemap\n\n convertNormalEmphasis(opt, 'upperLabel'); // graph\n\n convertNormalEmphasis(opt, 'edgeLabel');\n}\n\nfunction compatTextStyle(opt, propName) {\n // Check whether is not object (string\\null\\undefined ...)\n var labelOptSingle = isObject(opt) && opt[propName];\n var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n\n if (textStyle) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\n }\n\n for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\n\n if (textStyle.hasOwnProperty(textPropName)) {\n labelOptSingle[textPropName] = textStyle[textPropName];\n }\n }\n }\n}\n\nfunction compatEC3CommonStyles(opt) {\n if (opt) {\n removeEC3NormalStatus(opt);\n compatTextStyle(opt, 'label');\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n }\n}\n\nfunction processSeries(seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n compatEC2ItemStyle(seriesOpt);\n removeEC3NormalStatus(seriesOpt);\n compatTextStyle(seriesOpt, 'label'); // treemap\n\n compatTextStyle(seriesOpt, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt, 'edgeLabel');\n\n if (seriesOpt.emphasis) {\n compatTextStyle(seriesOpt.emphasis, 'label'); // treemap\n\n compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n }\n\n var markPoint = seriesOpt.markPoint;\n\n if (markPoint) {\n compatEC2ItemStyle(markPoint);\n compatEC3CommonStyles(markPoint);\n }\n\n var markLine = seriesOpt.markLine;\n\n if (markLine) {\n compatEC2ItemStyle(markLine);\n compatEC3CommonStyles(markLine);\n }\n\n var markArea = seriesOpt.markArea;\n\n if (markArea) {\n compatEC3CommonStyles(markArea);\n }\n\n var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option,\n // then the backward compat based on option type will not be performed.\n\n if (seriesOpt.type === 'graph') {\n data = data || seriesOpt.nodes;\n var edgeData = seriesOpt.links || seriesOpt.edges;\n\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n for (var i = 0; i < edgeData.length; i++) {\n compatEC3CommonStyles(edgeData[i]);\n }\n }\n\n zrUtil.each(seriesOpt.categories, function (opt) {\n removeEC3NormalStatus(opt);\n });\n }\n\n if (data && !zrUtil.isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatEC3CommonStyles(data[i]);\n }\n } // mark point data\n\n\n markPoint = seriesOpt.markPoint;\n\n if (markPoint && markPoint.data) {\n var mpData = markPoint.data;\n\n for (var i = 0; i < mpData.length; i++) {\n compatEC3CommonStyles(mpData[i]);\n }\n } // mark line data\n\n\n markLine = seriesOpt.markLine;\n\n if (markLine && markLine.data) {\n var mlData = markLine.data;\n\n for (var i = 0; i < mlData.length; i++) {\n if (zrUtil.isArray(mlData[i])) {\n compatEC3CommonStyles(mlData[i][0]);\n compatEC3CommonStyles(mlData[i][1]);\n } else {\n compatEC3CommonStyles(mlData[i]);\n }\n }\n } // Series\n\n\n if (seriesOpt.type === 'gauge') {\n compatTextStyle(seriesOpt, 'axisLabel');\n compatTextStyle(seriesOpt, 'title');\n compatTextStyle(seriesOpt, 'detail');\n } else if (seriesOpt.type === 'treemap') {\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n zrUtil.each(seriesOpt.levels, function (opt) {\n removeEC3NormalStatus(opt);\n });\n } else if (seriesOpt.type === 'tree') {\n removeEC3NormalStatus(seriesOpt.leaves);\n } // sunburst starts from ec4, so it does not need to compat levels.\n\n}\n\nfunction toArr(o) {\n return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\n\nfunction toObj(o) {\n return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\n\nexport default function globalCompatStyle(option, isTheme) {\n each(toArr(option.series), function (seriesOpt) {\n isObject(seriesOpt) && processSeries(seriesOpt);\n });\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n each(axes, function (axisName) {\n each(toArr(option[axisName]), function (axisOpt) {\n if (axisOpt) {\n compatTextStyle(axisOpt, 'axisLabel');\n compatTextStyle(axisOpt.axisPointer, 'label');\n }\n });\n });\n each(toArr(option.parallel), function (parallelOpt) {\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n compatTextStyle(parallelAxisDefault, 'axisLabel');\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n });\n each(toArr(option.calendar), function (calendarOpt) {\n convertNormalEmphasis(calendarOpt, 'itemStyle');\n compatTextStyle(calendarOpt, 'dayLabel');\n compatTextStyle(calendarOpt, 'monthLabel');\n compatTextStyle(calendarOpt, 'yearLabel');\n }); // radar.name.textStyle\n\n each(toArr(option.radar), function (radarOpt) {\n compatTextStyle(radarOpt, 'name'); // Use axisName instead of name because component has name property\n\n if (radarOpt.name && radarOpt.axisName == null) {\n radarOpt.axisName = radarOpt.name;\n delete radarOpt.name;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('name property in radar component has been changed to axisName');\n }\n }\n\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\n radarOpt.axisNameGap = radarOpt.nameGap;\n delete radarOpt.nameGap;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n each(radarOpt.indicator, function (indicatorOpt) {\n if (indicatorOpt.text) {\n deprecateReplaceLog('text', 'name', 'radar.indicator');\n }\n });\n }\n });\n each(toArr(option.geo), function (geoOpt) {\n if (isObject(geoOpt)) {\n compatEC3CommonStyles(geoOpt);\n each(toArr(geoOpt.regions), function (regionObj) {\n compatEC3CommonStyles(regionObj);\n });\n }\n });\n each(toArr(option.timeline), function (timelineOpt) {\n compatEC3CommonStyles(timelineOpt);\n convertNormalEmphasis(timelineOpt, 'label');\n convertNormalEmphasis(timelineOpt, 'itemStyle');\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n var data = timelineOpt.data;\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n if (zrUtil.isObject(item)) {\n convertNormalEmphasis(item, 'label');\n convertNormalEmphasis(item, 'itemStyle');\n }\n });\n });\n each(toArr(option.toolbox), function (toolboxOpt) {\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\n each(toolboxOpt.feature, function (featureOpt) {\n convertNormalEmphasis(featureOpt, 'iconStyle');\n });\n });\n compatTextStyle(toObj(option.axisPointer), 'label');\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); // Clean logs\n // storedLogs = {};\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util.js';\nimport compatStyle from './helper/compatStyle.js';\nimport { normalizeToArray } from '../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../util/log.js';\n\nfunction get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}\n\nfunction set(opt, path, val, overwrite) {\n var pathArr = path.split(',');\n var obj = opt;\n var key;\n var i = 0;\n\n for (; i < pathArr.length - 1; i++) {\n key = pathArr[i];\n\n if (obj[key] == null) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n if (overwrite || obj[pathArr[i]] == null) {\n obj[pathArr[i]] = val;\n }\n}\n\nfunction compatLayoutProperties(option) {\n option && each(LAYOUT_PROPERTIES, function (prop) {\n if (prop[0] in option && !(prop[1] in option)) {\n option[prop[1]] = option[prop[0]];\n }\n });\n}\n\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\nvar BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];\n\nfunction compatBarItemStyle(option) {\n var itemStyle = option && option.itemStyle;\n\n if (itemStyle) {\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\n var newName = BAR_ITEM_STYLE_MAP[i][0];\n\n if (itemStyle[oldName] != null) {\n itemStyle[newName] = itemStyle[oldName];\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(oldName, newName);\n }\n }\n }\n }\n}\n\nfunction compatPieLabel(option) {\n if (!option) {\n return;\n }\n\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\n }\n\n option.edgeDistance = option.margin;\n }\n}\n\nfunction compatSunburstState(option) {\n if (!option) {\n return;\n }\n\n if (option.downplay && !option.blur) {\n option.blur = option.downplay;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\n }\n }\n}\n\nfunction compatGraphFocus(option) {\n if (!option) {\n return;\n }\n\n if (option.focusNodeAdjacency != null) {\n option.emphasis = option.emphasis || {};\n\n if (option.emphasis.focus == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\n }\n\n option.emphasis.focus = 'adjacency';\n }\n }\n}\n\nfunction traverseTree(data, cb) {\n if (data) {\n for (var i = 0; i < data.length; i++) {\n cb(data[i]);\n data[i] && traverseTree(data[i].children, cb);\n }\n }\n}\n\nexport default function globalBackwardCompat(option, isTheme) {\n compatStyle(option, isTheme); // Make sure series array for model initialization.\n\n option.series = normalizeToArray(option.series);\n each(option.series, function (seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n var seriesType = seriesOpt.type;\n\n if (seriesType === 'line') {\n if (seriesOpt.clipOverflow != null) {\n seriesOpt.clip = seriesOpt.clipOverflow;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\n }\n }\n } else if (seriesType === 'pie' || seriesType === 'gauge') {\n if (seriesOpt.clockWise != null) {\n seriesOpt.clockwise = seriesOpt.clockWise;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clockWise', 'clockwise');\n }\n }\n\n compatPieLabel(seriesOpt.label);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatPieLabel(data[i]);\n }\n }\n\n if (seriesOpt.hoverOffset != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis.scaleSize = null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\n }\n\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\n }\n }\n } else if (seriesType === 'gauge') {\n var pointerColor = get(seriesOpt, 'pointer.color');\n pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n } else if (seriesType === 'bar') {\n compatBarItemStyle(seriesOpt);\n compatBarItemStyle(seriesOpt.backgroundStyle);\n compatBarItemStyle(seriesOpt.emphasis);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n if (typeof data[i] === 'object') {\n compatBarItemStyle(data[i]);\n compatBarItemStyle(data[i] && data[i].emphasis);\n }\n }\n }\n } else if (seriesType === 'sunburst') {\n var highlightPolicy = seriesOpt.highlightPolicy;\n\n if (highlightPolicy) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (!seriesOpt.emphasis.focus) {\n seriesOpt.emphasis.focus = highlightPolicy;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\n }\n }\n }\n\n compatSunburstState(seriesOpt);\n traverseTree(seriesOpt.data, compatSunburstState);\n } else if (seriesType === 'graph' || seriesType === 'sankey') {\n compatGraphFocus(seriesOpt); // TODO nodes, edges?\n } else if (seriesType === 'map') {\n if (seriesOpt.mapType && !seriesOpt.map) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('mapType', 'map', 'map');\n }\n\n seriesOpt.map = seriesOpt.mapType;\n }\n\n if (seriesOpt.mapLocation) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('`mapLocation` is not used anymore.');\n }\n\n defaults(seriesOpt, seriesOpt.mapLocation);\n }\n }\n\n if (seriesOpt.hoverAnimation != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\n }\n\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\n }\n }\n\n compatLayoutProperties(seriesOpt);\n }); // dataRange has changed to visualMap\n\n if (option.dataRange) {\n option.visualMap = option.dataRange;\n }\n\n each(COMPATITABLE_COMPONENTS, function (componentName) {\n var options = option[componentName];\n\n if (options) {\n if (!isArray(options)) {\n options = [options];\n }\n\n each(options, function (option) {\n compatLayoutProperties(option);\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { addSafe } from '../util/number.js'; // (1) [Caution]: the logic is correct based on the premises:\n// data processing stage is blocked in stream.\n// See \n// (2) Only register once when import repeatedly.\n// Should be executed after series is filtered and before stack calculation.\n\nexport default function dataStack(ecModel) {\n var stackInfoMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var stack = seriesModel.get('stack'); // Compatible: when `stack` is set as '', do not stack.\n\n if (stack) {\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n var data = seriesModel.getData();\n var stackInfo = {\n // Used for calculate axis extent automatically.\n // TODO: Type getCalculationInfo return more specific type?\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n stackedDimension: data.getCalculationInfo('stackedDimension'),\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n data: data,\n seriesModel: seriesModel\n }; // If stacked on axis that do not support data stack.\n\n if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n return;\n }\n\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\n stackInfoList.push(stackInfo);\n }\n });\n stackInfoMap.each(calculateStack);\n}\n\nfunction calculateStack(stackInfoList) {\n each(stackInfoList, function (targetStackInfo, idxInStack) {\n var resultVal = [];\n var resultNaN = [NaN, NaN];\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n var targetData = targetStackInfo.data;\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\n var stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign'; // Should not write on raw data, because stack series model list changes\n // depending on legend selection.\n\n targetData.modify(dims, function (v0, v1, dataIndex) {\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver\n // should also be NaN, to draw a appropriate belt area.\n\n if (isNaN(sum)) {\n return resultNaN;\n }\n\n var byValue;\n var stackedDataRawIndex;\n\n if (isStackedByIndex) {\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n } else {\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n } // If stackOver is NaN, chart view will render point on value start.\n\n\n var stackedOver = NaN;\n\n for (var j = idxInStack - 1; j >= 0; j--) {\n var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`.\n\n if (!isStackedByIndex) {\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n }\n\n if (stackedDataRawIndex >= 0) {\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data\n\n if (stackStrategy === 'all' // single stack group\n || stackStrategy === 'positive' && val > 0 || stackStrategy === 'negative' && val < 0 || stackStrategy === 'samesign' && sum >= 0 && val > 0 // All positive stack\n || stackStrategy === 'samesign' && sum <= 0 && val < 0 // All negative stack\n ) {\n // The sum has to be very small to be affected by the\n // floating arithmetic problem. An incorrect result will probably\n // cause axis min/max to be filtered incorrectly.\n sum = addSafe(sum, val);\n stackedOver = val;\n break;\n }\n }\n }\n\n resultVal[0] = sum;\n resultVal[1] = stackedOver;\n return resultVal;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString, keys } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types.js';\nimport { getDataItemValue } from '../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper.js';\n; // @inner\n\nvar SourceImpl =\n/** @class */\nfunction () {\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.metaRawOption = fields.metaRawOption;\n var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\n\n if (dimensionsDefine) {\n for (var i = 0; i < dimensionsDefine.length; i++) {\n var dim = dimensionsDefine[i];\n\n if (dim.type == null) {\n if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\n dim.type = 'ordinal';\n }\n }\n }\n }\n }\n\n return SourceImpl;\n}();\n\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\n/**\r\n * Create a source from option.\r\n * NOTE: Created source is immutable. Don't change any properties in it.\r\n */\n\nexport function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\r\n * Wrap original series data for some compatibility cases.\r\n */\n\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\r\n * Clone source but excludes source data.\r\n */\n\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount\n });\n}\n/**\r\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\r\n */\n\nexport function detectSourceFormat(data) {\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 (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n\n return sourceFormat;\n}\n/**\r\n * Determine the source definitions from data standalone dimensions definitions\r\n * are not specified.\r\n */\n\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PENDING: Could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data; // 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\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, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : 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, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\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 dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\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 return keys(obj);\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/undefined or string.\n\n\nfunction normalizeDimensionsOption(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 (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We don't auto specify name, otherwise a given name may\n // cause it to be referred 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 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\nexport function shouldRetrieveDataByName(source) {\n var sourceFormat = source.sourceFormat;\n return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === 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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar _a, _b, _c; // TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\n\n\nimport { isTypedArray, extend, assert, each, isObject, bind } from 'zrender/lib/core/util.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types.js';\nvar providerMethods;\nvar mountMethods;\n/**\r\n * If normal array used, mutable chunk size is supported.\r\n * If typed array used, chunk size must be fixed.\r\n */\n\nvar DefaultDataProvider =\n/** @class */\nfunction () {\n function DefaultDataProvider(sourceParam, dimSize) {\n // let source: Source;\n var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source;\n\n this._source = source;\n var data = this._data = source.data; // Typed array. TODO IE10+?\n\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n if (dimSize == null) {\n throw new Error('Typed array data must specify dimension size');\n }\n }\n\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n\n mountMethods(this, data, source);\n }\n\n DefaultDataProvider.prototype.getSource = function () {\n return this._source;\n };\n\n DefaultDataProvider.prototype.count = function () {\n return 0;\n };\n\n DefaultDataProvider.prototype.getItem = function (idx, out) {\n return;\n };\n\n DefaultDataProvider.prototype.appendData = function (newData) {};\n\n DefaultDataProvider.prototype.clean = function () {};\n\n DefaultDataProvider.protoInitialize = function () {\n // PENDING: To avoid potential incompat (e.g., prototype\n // is visited somewhere), still init them on prototype.\n var proto = DefaultDataProvider.prototype;\n proto.pure = false;\n proto.persistent = true;\n }();\n\n DefaultDataProvider.internalField = function () {\n var _a;\n\n mountMethods = function (provider, data, source) {\n var sourceFormat = source.sourceFormat;\n var seriesLayoutBy = source.seriesLayoutBy;\n var startIndex = source.startIndex;\n var dimsDef = source.dimensionsDefine;\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n }\n\n extend(provider, methods);\n\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n provider.getItem = getItemForTypedArray;\n provider.count = countForTypedArray;\n provider.fillStorage = fillStorageForTypedArray;\n } else {\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n }\n };\n\n var getItemForTypedArray = function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var data = this._data;\n var dimSize = this._dimSize;\n var offset = dimSize * idx;\n\n for (var i = 0; i < dimSize; i++) {\n out[i] = data[offset + i];\n }\n\n return out;\n };\n\n var fillStorageForTypedArray = function (start, end, storage, extent) {\n var data = this._data;\n var dimSize = this._dimSize;\n\n for (var dim = 0; dim < dimSize; dim++) {\n var dimExtent = extent[dim];\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n var count = end - start;\n var arr = storage[dim];\n\n for (var i = 0; i < count; i++) {\n // appendData with TypedArray will always do replace in provider.\n var val = data[i * dimSize + dim];\n arr[start + i] = val;\n val < min && (min = val);\n val > max && (max = val);\n }\n\n dimExtent[0] = min;\n dimExtent[1] = max;\n }\n };\n\n var countForTypedArray = function () {\n return this._data ? this._data.length / this._dimSize : 0;\n };\n\n providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n pure: true,\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n pure: true,\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n }, _a[SOURCE_FORMAT_ORIGINAL] = {\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n persistent: false,\n pure: true,\n appendData: function (newData) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n }\n\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }, _a);\n\n function appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n }\n }();\n\n return DefaultDataProvider;\n}();\n\nexport { DefaultDataProvider };\n\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx];\n};\n\nvar rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx + startIndex];\n}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) {\n idx += startIndex;\n var item = out || [];\n var data = rawData;\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item[i] = row ? row[idx] : null;\n }\n\n return item;\n}, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) {\n var item = out || [];\n\n for (var i = 0; i < dimsDef.length; i++) {\n var dimName = dimsDef[i].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n item[i] = col ? col[idx] : null;\n }\n\n return item;\n}, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar countSimply = function (rawData, startIndex, dimsDef) {\n return rawData.length;\n};\n\nvar rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n return Math.max(0, rawData.length - startIndex);\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n var row = rawData[0];\n return row ? Math.max(0, row.length - startIndex) : 0;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n var dimName = dimsDef[0].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n return col ? col.length : 0;\n}, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar getRawValueSimply = function (dataItem, dimIndex, property) {\n return dataItem[dimIndex];\n};\n\nvar rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) {\n return dataItem[property];\n}, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) {\n // FIXME: In some case (markpoint in geo (geo-map.html)),\n // dataItem is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return !(value instanceof Array) ? value : value[dimIndex];\n}, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);\nexport function getRawSourceValueGetter(sourceFormat) {\n var method = rawSourceValueGetterMap[sourceFormat];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get value on \"' + sourceFormat + '\".');\n }\n\n return method;\n}\n\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n} // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\n\n\nexport function retrieveRawValue(data, dataIndex, // If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\ndim) {\n if (!data) {\n return;\n } // Consider data may be not persistent.\n\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (dataItem == null) {\n return;\n }\n\n var store = data.getStore();\n var sourceFormat = store.getSource().sourceFormat;\n\n if (dim != null) {\n var dimIndex = data.getDimensionIndex(dim);\n var property = store.getDimensionProperty(dimIndex);\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property);\n } else {\n var result = dataItem;\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n result = getDataItemValue(dataItem);\n }\n\n return result;\n }\n}\n/**\r\n * Compatible with some cases (in pie, map) like:\r\n * data: [{name: 'xx', value: 5, selected: true}, ...]\r\n * where only sourceFormat is 'original' and 'objectRows' supported.\r\n *\r\n * // TODO\r\n * Supported detail options in data item when using 'arrayRows'.\r\n *\r\n * @param data\r\n * @param dataIndex\r\n * @param attr like 'selected'\r\n */\n\nexport function retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n\n var sourceFormat = data.getStore().getSource().sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n\n if (dataItem) {\n return dataItem[attr];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { formatTpl } from '../../util/format.js';\nimport { error, makePrintable } from '../../util/log.js';\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\n\nvar DataFormatMixin =\n/** @class */\nfunction () {\n function DataFormatMixin() {}\n /**\r\n * Get params for formatter\r\n */\n\n\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\n var data = this.getData(dataType);\n var rawValue = this.getRawValue(dataIndex, dataType);\n var rawDataIndex = data.getRawIndex(dataIndex);\n var name = data.getName(dataIndex);\n var itemOpt = data.getRawDataItem(dataIndex);\n var style = data.getItemVisual(dataIndex, 'style');\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\n var borderColor = style && style.stroke;\n var mainType = this.mainType;\n var isSeries = mainType === 'series';\n var userOutput = data.userOutput && data.userOutput.get();\n return {\n componentType: mainType,\n componentSubType: this.subType,\n componentIndex: this.componentIndex,\n seriesType: isSeries ? this.subType : null,\n seriesIndex: this.seriesIndex,\n seriesId: isSeries ? this.id : null,\n seriesName: isSeries ? this.name : null,\n name: name,\n dataIndex: rawDataIndex,\n data: itemOpt,\n dataType: dataType,\n value: rawValue,\n color: color,\n borderColor: borderColor,\n dimensionNames: userOutput ? userOutput.fullDimensions : null,\n encode: userOutput ? userOutput.encode : null,\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n $vars: ['seriesName', 'name', 'value']\n };\n };\n /**\r\n * Format label\r\n * @param dataIndex\r\n * @param status 'normal' by default\r\n * @param dataType\r\n * @param labelDimIndex Only used in some chart that\r\n * use formatter in different dimensions, like radar.\r\n * @param formatter Formatter given outside.\r\n * @return return null/undefined if no formatter\r\n */\n\n\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\n status = status || 'normal';\n var data = this.getData(dataType);\n var params = this.getDataParams(dataIndex, dataType);\n\n if (extendParams) {\n params.value = extendParams.interpolatedValue;\n }\n\n if (labelDimIndex != null && zrUtil.isArray(params.value)) {\n params.value = params.value[labelDimIndex];\n }\n\n if (!formatter) {\n var itemModel = data.getItemModel(dataIndex); // @ts-ignore\n\n formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']);\n }\n\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n params.dimensionIndex = labelDimIndex;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'.\n // Do not support '}' in dim name util have to.\n\n return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) {\n var len = dimStr.length;\n var dimLoose = dimStr;\n\n if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') {\n dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(dimLoose)) {\n error(\"Invalide label formatter: @\" + dimStr + \", only support @[0], @[1], @[2], ...\");\n }\n }\n }\n\n var val = retrieveRawValue(data, dataIndex, dimLoose);\n\n if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\n var dimIndex = data.getDimensionIndex(dimLoose);\n\n if (dimIndex >= 0) {\n val = extendParams.interpolatedValue[dimIndex];\n }\n }\n\n return val != null ? val + '' : '';\n });\n }\n };\n /**\r\n * Get raw value in option\r\n */\n\n\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\n return retrieveRawValue(this.getData(dataType), idx);\n };\n /**\r\n * Should be implemented.\r\n * @param {number} dataIndex\r\n * @param {boolean} [multipleSeries=false]\r\n * @param {string} [dataType]\r\n */\n\n\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // Empty function\n return;\n };\n\n return DataFormatMixin;\n}();\n\nexport { DataFormatMixin };\n; // PENDING: previously we accept this type when calling `formatTooltip`,\n// but guess little chance has been used outside. Do we need to backward\n// compat it?\n// type TooltipFormatResultLegacyObject = {\n// // `html` means the markup language text, either in 'html' or 'richText'.\n// // The name `html` is not appropriate because in 'richText' it is not a HTML\n// // string. But still support it for backward compatibility.\n// html: string;\n// markers: Dictionary;\n// };\n\n/**\r\n * For backward compat, normalize the return from `formatTooltip`.\r\n */\n\nexport function normalizeTooltipFormatResult(result) {\n var markupText; // let markers: Dictionary;\n\n var markupFragment;\n\n if (zrUtil.isObject(result)) {\n if (result.type) {\n markupFragment = result;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\n }\n } // else {\n // markupText = (result as TooltipFormatResultLegacyObject).html;\n // markers = (result as TooltipFormatResultLegacyObject).markers;\n // if (markersExisting) {\n // markers = zrUtil.merge(markersExisting, markers);\n // }\n // }\n\n } else {\n markupText = result;\n }\n\n return {\n text: markupText,\n // markers: markers || markersExisting,\n frag: markupFragment\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, isArray } from 'zrender/lib/core/util.js';\n;\n/**\r\n * @param {Object} define\r\n * @return See the return of `createTask`.\r\n */\n\nexport function createTask(define) {\n return new Task(define);\n}\n\nvar Task =\n/** @class */\nfunction () {\n function Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true;\n }\n /**\r\n * @param step Specified step.\r\n * @param skip Skip customer perform call.\r\n * @param modBy Sampling window size.\r\n * @param modDataCount Sampling count.\r\n * @return whether unfinished.\r\n */\n\n\n Task.prototype.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip; // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n\n var planResult;\n\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n } // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n\n\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n\n return val;\n }\n\n var forceFirstProgress;\n\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = this._doReset(skip);\n }\n\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n\n if (upTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(upTask._outputDueEnd != null);\n }\n\n this._dueEnd = upTask._outputDueEnd;\n } // DataTask or overallTask\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._progress || this._count);\n }\n\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n } // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n\n\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n this._doProgress(progress[i], start, end, modBy, modDataCount);\n }\n } else {\n this._doProgress(progress, start, end, modBy, modDataCount);\n }\n }\n\n this._dueIndex = end; // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n\n if (process.env.NODE_ENV !== 'production') {\n // ??? Can not rollback.\n assert(outputDueEnd >= this._outputDueEnd);\n }\n\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n\n return this.unfinished();\n };\n\n Task.prototype.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n };\n\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n this._callingProgress = progress;\n\n this._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, this.context);\n };\n\n Task.prototype._doReset = function (skip) {\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n this._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n\n if (!skip && this._reset) {\n progress = this._reset(this.context);\n\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n } // To simplify no progress checking, array must has item.\n\n\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n\n this._progress = progress;\n this._modBy = this._modDataCount = null;\n var downstream = this._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n };\n\n Task.prototype.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n };\n /**\r\n * @param downTask The downstream task.\r\n * @return The downstream task.\r\n */\n\n\n Task.prototype.pipe = function (downTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(downTask && !downTask._disposed && downTask !== this);\n } // If already downstream, do not dirty downTask.\n\n\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n };\n\n Task.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n };\n\n Task.prototype.getUpstream = function () {\n return this._upstream;\n };\n\n Task.prototype.getDownstream = function () {\n return this._downstream;\n };\n\n Task.prototype.setOutputEnd = function (end) {\n // This only happens in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the set end, in case\n // that the stub of dataZoom perform again and earse the\n // set end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n };\n\n return Task;\n}();\n\nexport { Task };\n\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}(); // -----------------------------------------------------------------------------\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// let props = [];\n// if (task.__pipeline) {\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: '__idxInPipeline/total', value: val});\n// } else {\n// let stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// let args = ['color: blue'];\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: green', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n// const pipeline = task.__pipeline;\n// let currTask = pipeline.head;\n// while (currTask) {\n// window.printTask(currTask, prefix);\n// currTask = currTask._downstream;\n// }\n// };\n// window.showChain = function (chainHeadTask) {\n// var chain = [];\n// var task = chainHeadTask;\n// while (task) {\n// chain.push({\n// task: task,\n// up: task._upstream,\n// down: task._downstream,\n// idxInPipeline: task.__idxInPipeline\n// });\n// task = task._downstream;\n// }\n// return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n// let chain = window.showChain(chainHeadTask);\n// let result = [];\n// for (let i = 0; i < chain.length; i++) {\n// let chainItem = chain[i];\n// if (chainItem.task === task) {\n// result.push(i);\n// }\n// }\n// return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n// let chainA = window.showChain(chainHeadTaskA);\n// for (let i = 0; i < chainA.length; i++) {\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/lib/core/util.js';\nvar ECHARTS_PREFIX = '[ECharts] ';\nvar storedLogs = {};\nvar hasConsole = typeof console !== 'undefined' // eslint-disable-next-line\n&& console.warn && console.log;\n\nfunction outputLog(type, str, onlyOnce) {\n if (hasConsole) {\n if (onlyOnce) {\n if (storedLogs[str]) {\n return;\n }\n\n storedLogs[str] = true;\n } // eslint-disable-next-line\n\n\n console[type](ECHARTS_PREFIX + str);\n }\n}\n\nexport function log(str, onlyOnce) {\n outputLog('log', str, onlyOnce);\n}\nexport function warn(str, onlyOnce) {\n outputLog('warn', str, onlyOnce);\n}\nexport function error(str, onlyOnce) {\n outputLog('error', str, onlyOnce);\n}\nexport function deprecateLog(str) {\n if (process.env.NODE_ENV !== 'production') {\n // Not display duplicate message.\n outputLog('warn', 'DEPRECATED: ' + str, true);\n }\n}\nexport function deprecateReplaceLog(oldOpt, newOpt, scope) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\n }\n}\n/**\r\n * If in __DEV__ environment, get console printable message for users hint.\r\n * Parameters are separated by ' '.\r\n * @usage\r\n * makePrintable('This is an error on', someVar, someObj);\r\n *\r\n * @param hintInfo anything about the current execution context to hint users.\r\n * @throws Error\r\n */\n\nexport function makePrintable() {\n var hintInfo = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n hintInfo[_i] = arguments[_i];\n }\n\n var msg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Fuzzy stringify for print.\n // This code only exist in dev environment.\n var makePrintableStringIfPossible_1 = function (val) {\n return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null;\n };\n\n msg = map(hintInfo, function (arg) {\n if (isString(arg)) {\n // Print without quotation mark for some statement.\n return arg;\n } else {\n var printableStr = makePrintableStringIfPossible_1(arg);\n\n if (printableStr != null) {\n return printableStr;\n } else if (typeof JSON !== 'undefined' && JSON.stringify) {\n try {\n return JSON.stringify(arg, function (n, val) {\n var printableStr = makePrintableStringIfPossible_1(val);\n return printableStr == null ? val : printableStr;\n }); // In most cases the info object is small, so do not line break.\n } catch (err) {\n return '?';\n }\n } else {\n return '?';\n }\n }\n }).join(' ');\n }\n\n return msg;\n}\n/**\r\n * @throws Error\r\n */\n\nexport function throwError(msg) {\n throw new Error(msg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseDate, numericToNumber } from '../../util/number.js';\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError } from '../../util/log.js';\n/**\r\n * Convert raw the value in to inner value in List.\r\n *\r\n * [Performance sensitive]\r\n *\r\n * [Caution]: this is the key logic of user value parser.\r\n * For backward compatibility, do not modify it until you have to!\r\n */\n\nexport function parseDataValue(value, // For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n return value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && !isNumber(value) && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have `numericToNumber` by default.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return isString(val) ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\n\nvar FilterOrderComparator =\n/** @class */\nfunction () {\n function FilterOrderComparator(op, rval) {\n if (!isNumber(rval)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n\n throwError(errMsg);\n }\n\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n\n return FilterOrderComparator;\n}();\n\nvar SortOrderComparator =\n/** @class */\nfunction () {\n /**\r\n * @param order by default: 'asc'\r\n * @param incomparable by default: Always on the tail.\r\n * That is, if 'asc' => 'max', if 'desc' => 'min'\r\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE].\r\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n } // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n\n\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\n var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = isString(lval);\n var rvalIsStr = isString(rval);\n\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n\n return SortOrderComparator;\n}();\n\nexport { SortOrderComparator };\n\nvar FilterEqualityComparator =\n/** @class */\nfunction () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n\n return this._isEQ ? eqResult : !eqResult;\n };\n\n return FilterEqualityComparator;\n}();\n/**\r\n * [FILTER_COMPARISON_RULE]\r\n * `lt`|`lte`|`gt`|`gte`:\r\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\r\n * `eq`:\r\n * + If same type, compare with `===`.\r\n * + If there is one number, convert to number (`numericToNumber`) to compare.\r\n * + Else return `false`.\r\n * `ne`:\r\n * + Not `eq`.\r\n *\r\n *\r\n * [SORT_COMPARISON_RULE]\r\n * All the values are grouped into three categories:\r\n * + \"numeric\" (number and numeric string)\r\n * + \"non-numeric-string\" (string that excluding numeric string)\r\n * + \"others\"\r\n * \"numeric\" vs \"numeric\": values are ordered by number order.\r\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\r\n * \"others\" vs \"others\": do not change order (always return 0).\r\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\r\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\r\n * MEMO:\r\n * Non-numeric string sort makes sense when we need to put the items with the same tag together.\r\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\r\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\r\n *\r\n *\r\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\r\n * + Do not support string comparison until required. And also need to\r\n * avoid the misleading of \"2\" > \"12\".\r\n * + Should avoid the misleading case:\r\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\r\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\r\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\r\n * See `util/number.ts#numericToNumber`.\r\n *\r\n * @return If `op` is not `RelationalOperator`, return null;\r\n */\n\n\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend, isNumber } from 'zrender/lib/core/util.js';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider.js';\nimport { parseDataValue } from './dataValueHelper.js';\nimport { log, makePrintable, throwError } from '../../util/log.js';\nimport { createSource, detectSourceFormat } from '../Source.js';\n/**\r\n * TODO: disable writable.\r\n * This structure will be exposed to users.\r\n */\n\nvar ExternalSource =\n/** @class */\nfunction () {\n function ExternalSource() {}\n\n ExternalSource.prototype.getRawData = function () {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.cloneRawData = function () {\n return;\n };\n /**\r\n * @return If dimension not found, return null/undefined.\r\n */\n\n\n ExternalSource.prototype.getDimensionInfo = function (dim) {\n return;\n };\n /**\r\n * dimensions defined if and only if either:\r\n * (a) dataset.dimensions are declared.\r\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\r\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\r\n * the defined dimensions.\r\n * Otherwise, `dimensionInfoAll` is determined by data columns.\r\n * @return Always return an array (even empty array).\r\n */\n\n\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\n return;\n };\n\n ExternalSource.prototype.count = function () {\n return;\n };\n /**\r\n * Only support by dimension index.\r\n * No need to support by dimension name in transform function,\r\n * because transform function is not case-specific, no need to use name literally.\r\n */\n\n\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n return parseDataValue(rawVal, dimInfo);\n };\n\n return ExternalSource;\n}();\n\nexport { ExternalSource };\n\nfunction createExternalSource(internalSource, externalTransform) {\n var extSource = new ExternalSource();\n var data = internalSource.data;\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n var sourceHeaderCount = internalSource.startIndex;\n var errMsg = '';\n\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n // For the logic simplicity in transformer, only 'culumn' is\n // supported in data transform. Otherwise, the `dimensionsDefine`\n // might be detected by 'row', which probably confuses users.\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n }\n\n throwError(errMsg);\n } // [MEMO]\n // Create a new dimensions structure for exposing.\n // Do not expose all dimension info to users directly.\n // Because the dimension is probably auto detected from data and not might reliable.\n // Should not lead the transformers to think that is reliable and return it.\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n\n\n var dimensions = [];\n var dimsByName = {};\n var dimsDef = internalSource.dimensionsDefine;\n\n if (dimsDef) {\n each(dimsDef, function (dimDef, idx) {\n var name = dimDef.name;\n var dimDefExt = {\n index: idx,\n name: name,\n displayName: dimDef.displayName\n };\n dimensions.push(dimDefExt); // Users probably do not specify dimension name. For simplicity, data transform\n // does not generate dimension name.\n\n if (name != null) {\n // Dimension name should not be duplicated.\n // For simplicity, data transform forbids name duplication, do not generate\n // new name like module `completeDimensions.ts` did, but just tell users.\n var errMsg_1 = '';\n\n if (hasOwn(dimsByName, name)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n }\n\n throwError(errMsg_1);\n }\n\n dimsByName[name] = dimDefExt;\n }\n });\n } // If dimension definitions are not defined and can not be detected.\n // e.g., pure data `[[11, 22], ...]`.\n else {\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n // Do not generete name or anything others. The consequence process in\n // `transform` or `series` probably have there own name generation strategry.\n dimensions.push({\n index: i\n });\n }\n } // Implement public methods:\n\n\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n\n if (externalTransform.__isBuiltIn) {\n extSource.getRawDataItem = function (dataIndex) {\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n };\n\n extSource.getRawData = bind(getRawData, null, internalSource);\n }\n\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n\n extSource.retrieveValue = function (dataIndex, dimIndex) {\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n return retrieveValueFromItem(rawItem, dimIndex);\n };\n\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n if (dataItem == null) {\n return;\n }\n\n var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n\n if (dimDef) {\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\n }\n };\n\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n return extSource;\n}\n\nfunction getRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n return upstream.data;\n}\n\nfunction cloneRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n var data = upstream.data;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(data[i].slice());\n }\n\n return result;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(extend({}, data[i]));\n }\n\n return result;\n }\n}\n\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n if (dim == null) {\n return;\n } // Keep the same logic as `List::getDimension` did.\n\n\n if (isNumber(dim) // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n return dimensions[dim];\n } else if (hasOwn(dimsByName, dim)) {\n return dimsByName[dim];\n }\n}\n\nfunction cloneAllDimensionInfo(dimensions) {\n return clone(dimensions);\n}\n\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n externalTransform = clone(externalTransform);\n var type = externalTransform.type;\n var errMsg = '';\n\n if (!type) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have a `type` when `registerTransform`.';\n }\n\n throwError(errMsg);\n }\n\n var typeParsed = type.split(':');\n\n if (typeParsed.length !== 2) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Name must include namespace like \"ns:regression\".';\n }\n\n throwError(errMsg);\n } // Namespace 'echarts:xxx' is official namespace, where the transforms should\n // be called directly via 'xxx' rather than 'echarts:xxx'.\n\n\n var isBuiltIn = false;\n\n if (typeParsed[0] === 'echarts') {\n type = typeParsed[1];\n isBuiltIn = true;\n }\n\n externalTransform.__isBuiltIn = isBuiltIn;\n externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n var pipedTransOption = normalizeToArray(rawTransOption);\n var pipeLen = pipedTransOption.length;\n var errMsg = '';\n\n if (!pipeLen) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'If `transform` declared, it should at least contain one transform.';\n }\n\n throwError(errMsg);\n }\n\n for (var i = 0, len = pipeLen; i < len; i++) {\n var transOption = pipedTransOption[i];\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one.\n // piped transform only support single output, except the last one.\n\n if (i !== len - 1) {\n sourceList.length = Math.max(sourceList.length, 1);\n }\n }\n\n return sourceList;\n}\n\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, // If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n var errMsg = '';\n\n if (!upSourceList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have at least one upstream dataset.';\n }\n\n throwError(errMsg);\n }\n\n if (!isObject(transOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n }\n\n throwError(errMsg);\n }\n\n var transType = transOption.type;\n var externalTransform = externalTransformMap.get(transType);\n\n if (!externalTransform) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not find transform on type \"' + transType + '\".';\n }\n\n throwError(errMsg);\n } // Prepare source\n\n\n var extUpSourceList = map(upSourceList, function (upSource) {\n return createExternalSource(upSource, externalTransform);\n });\n var resultList = normalizeToArray(externalTransform.transform({\n upstream: extUpSourceList[0],\n upstreamList: extUpSourceList,\n config: clone(transOption.config)\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n if (transOption.print) {\n var printStrArr = map(resultList, function (extSource) {\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n }).join('\\n');\n log(printStrArr);\n }\n }\n\n return map(resultList, function (result, resultIndex) {\n var errMsg = '';\n\n if (!isObject(result)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'A transform should not return some empty results.';\n }\n\n throwError(errMsg);\n }\n\n if (!result.data) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be not be null or undefined';\n }\n\n throwError(errMsg);\n }\n\n var sourceFormat = detectSourceFormat(result.data);\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be array rows or object rows.';\n }\n\n throwError(errMsg);\n }\n\n var resultMetaRawOption;\n var firstUpSource = upSourceList[0];\n /**\r\n * Intuitively, the end users known the content of the original `dataset.source`,\r\n * calucating the transform result in mind.\r\n * Suppose the original `dataset.source` is:\r\n * ```js\r\n * [\r\n * ['product', '2012', '2013', '2014', '2015'],\r\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\r\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\r\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\r\n * ]\r\n * ```\r\n * The dimension info have to be detected from the source data.\r\n * Some of the transformers (like filter, sort) will follow the dimension info\r\n * of upstream, while others use new dimensions (like aggregate).\r\n * Transformer can output a field `dimensions` to define the its own output dimensions.\r\n * We also allow transformers to ignore the output `dimensions` field, and\r\n * inherit the upstream dimensions definition. It can reduce the burden of handling\r\n * dimensions in transformers.\r\n *\r\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\r\n */\n\n if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different\n // dimensions definitions. We do not inherit anything from upstream.\n && !result.dimensions) {\n var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result, because:\n // (1) The returned data always does not contain header line and can not be used\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n // So the original detected header should be add to the result, otherwise they can not be read.\n\n if (startIndex) {\n result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n }\n\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: startIndex,\n dimensions: firstUpSource.metaRawOption.dimensions\n };\n } else {\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: 0,\n dimensions: result.dimensions\n };\n }\n\n return createSource(result.data, resultMetaRawOption, null);\n });\n}\n\nfunction isSupportedSourceFormat(sourceFormat) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from './helper/dataValueHelper.js';\nimport { shouldRetrieveDataByName } from './Source.js';\nvar UNDEFINED = 'undefined';\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nexport var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nexport var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nexport var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nexport var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\n/**\r\n * Multi dimensional data store\r\n */\n\nvar dataCtors = {\n 'float': CtorFloat64Array,\n 'int': CtorInt32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': CtorFloat64Array\n};\nvar defaultDimValueGetters;\n\nfunction getIndicesCtor(rawCount) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n\n;\n\nfunction getInitialExtent() {\n return [Infinity, -Infinity];\n}\n\n;\n\nfunction cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\n\nfunction prepareStore(store, dimIdx, dimType, end, append) {\n var DataCtor = dataCtors[dimType || 'float'];\n\n if (append) {\n var oldStore = store[dimIdx];\n var oldLen = oldStore && oldStore.length;\n\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n\n store[dimIdx] = newStore;\n }\n } else {\n store[dimIdx] = new DataCtor(end);\n }\n}\n\n;\n/**\r\n * Basically, DataStore API keep immutable.\r\n */\n\nvar DataStore =\n/** @class */\nfunction () {\n function DataStore() {\n this._chunks = []; // It will not be calculated until needed.\n\n this._rawExtent = [];\n this._extent = [];\n this._count = 0;\n this._rawCount = 0;\n this._calcDimNameToIdx = createHashMap();\n }\n /**\r\n * Initialize from data\r\n */\n\n\n DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isFunction(provider.getItem) && isFunction(provider.count), 'Invalid data provider.');\n }\n\n this._provider = provider; // Clear\n\n this._chunks = [];\n this._indices = null;\n this.getRawIndex = this._getRawIdxIdentity;\n var source = provider.getSource();\n var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter || defaultGetter; // Reset raw extent.\n\n this._rawExtent = [];\n var willRetrieveDataByName = shouldRetrieveDataByName(source);\n this._dimensions = map(inputDimensions, function (dim) {\n if (process.env.NODE_ENV !== 'production') {\n if (willRetrieveDataByName) {\n assert(dim.property != null);\n }\n }\n\n return {\n // Only pick these two props. Not leak other properties like orderMeta.\n type: dim.type,\n property: dim.property\n };\n });\n\n this._initDataFromProvider(0, provider.count());\n };\n\n DataStore.prototype.getProvider = function () {\n return this._provider;\n };\n /**\r\n * Caution: even when a `source` instance owned by a series, the created data store\r\n * may still be shared by different sereis (the source hash does not use all `source`\r\n * props, see `sourceManager`). In this case, the `source` props that are not used in\r\n * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\r\n * thus should not be fetch here.\r\n */\n\n\n DataStore.prototype.getSource = function () {\n return this._provider.getSource();\n };\n /**\r\n * @caution Only used in dataStack.\r\n */\n\n\n DataStore.prototype.ensureCalculationDimension = function (dimName, type) {\n var calcDimNameToIdx = this._calcDimNameToIdx;\n var dimensions = this._dimensions;\n var calcDimIdx = calcDimNameToIdx.get(dimName);\n\n if (calcDimIdx != null) {\n if (dimensions[calcDimIdx].type === type) {\n return calcDimIdx;\n }\n } else {\n calcDimIdx = dimensions.length;\n }\n\n dimensions[calcDimIdx] = {\n type: type\n };\n calcDimNameToIdx.set(dimName, calcDimIdx);\n this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\n this._rawExtent[calcDimIdx] = getInitialExtent();\n return calcDimIdx;\n };\n\n DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) {\n var chunk = this._chunks[dimIdx];\n var dim = this._dimensions[dimIdx];\n var rawExtents = this._rawExtent;\n var offset = dim.ordinalOffset || 0;\n var len = chunk.length;\n\n if (offset === 0) {\n // We need to reset the rawExtent if collect is from start.\n // Because this dimension may be guessed as number and calcuating a wrong extent.\n rawExtents[dimIdx] = getInitialExtent();\n }\n\n var dimRawExtent = rawExtents[dimIdx]; // Parse from previous data offset. len may be changed after appendData\n\n for (var i = offset; i < len; i++) {\n var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]);\n\n if (!isNaN(val)) {\n dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\n dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\n }\n }\n\n dim.ordinalMeta = ordinalMeta;\n dim.ordinalOffset = len;\n dim.type = 'ordinal'; // Force to be ordinal\n };\n\n DataStore.prototype.getOrdinalMeta = function (dimIdx) {\n var dimInfo = this._dimensions[dimIdx];\n var ordinalMeta = dimInfo.ordinalMeta;\n return ordinalMeta;\n };\n\n DataStore.prototype.getDimensionProperty = function (dimIndex) {\n var item = this._dimensions[dimIndex];\n return item && item.property;\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\n\n\n DataStore.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._indices, 'appendData can only be called on raw data.');\n }\n\n var provider = this._provider;\n var start = this.count();\n provider.appendData(data);\n var end = provider.count();\n\n if (!provider.persistent) {\n end += start;\n }\n\n if (start < end) {\n this._initDataFromProvider(start, end, true);\n }\n\n return [start, end];\n };\n\n DataStore.prototype.appendValues = function (values, minFillLen) {\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, minFillLen || 0);\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n prepareStore(chunks, i, dim.type, end, true);\n }\n\n var emptyDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start; // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);\n chunks[dimIdx][idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n\n this._rawCount = this._count = end;\n return {\n start: start,\n end: end\n };\n };\n\n DataStore.prototype._initDataFromProvider = function (start, end, append) {\n var provider = this._provider;\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var dimNames = map(dimensions, function (dim) {\n return dim.property;\n });\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[i]) {\n rawExtent[i] = getInitialExtent();\n }\n\n prepareStore(chunks, i, dim.type, end, append);\n }\n\n if (provider.fillStorage) {\n provider.fillStorage(start, end, chunks, rawExtent);\n } else {\n var dataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = provider.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dimStorage = chunks[dimIdx]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);\n\n dimStorage[idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n }\n\n if (!provider.persistent && provider.clean) {\n // Clean unused data if data source is typed array.\n provider.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = [];\n };\n\n DataStore.prototype.count = function () {\n return this._count;\n };\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n */\n\n\n DataStore.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n\n DataStore.prototype.getValues = function (dimensions, idx) {\n var values = [];\n var dimArr = [];\n\n if (idx == null) {\n idx = dimensions; // TODO get all from store?\n\n dimensions = []; // All dimensions\n\n for (var i = 0; i < this._dimensions.length; i++) {\n dimArr.push(i);\n }\n } else {\n dimArr = dimensions;\n }\n\n for (var i = 0, len = dimArr.length; i < len; i++) {\n values.push(this.get(dimArr[i], idx));\n }\n\n return values;\n };\n /**\r\n * @param dim concrete dim\r\n */\n\n\n DataStore.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n /**\r\n * Get sum of data in one dimension\r\n */\n\n\n DataStore.prototype.getSum = function (dim) {\n var dimData = this._chunks[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n };\n /**\r\n * Get median of data in one dimension\r\n */\n\n\n DataStore.prototype.getMedian = function (dim) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each([dim], function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n };\n /**\r\n * Retrieve the index with given raw data index.\r\n */\n\n\n DataStore.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n };\n /**\r\n * Retrieve the index of nearest value.\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices have\r\n * the same value, they are put to the result.\r\n */\n\n\n DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var chunks = this._chunks;\n var dimData = chunks[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/SeriesData.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we choose the one that `diff >= 0` in this case.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n\n DataStore.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this._rawCount);\n newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n };\n /**\r\n * Data filter.\r\n */\n\n\n DataStore.prototype.filter = function (dims, cb) {\n if (!this._count) {\n return this;\n }\n\n var newStore = this.clone();\n var count = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dims.length;\n var offset = 0;\n var dim0 = dims[0];\n var chunks = newStore._chunks;\n\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = newStore.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb(i);\n } else if (dimSize === 1) {\n var val = chunks[dim0][rawIdx];\n keep = cb(val, i);\n } else {\n var k = 0;\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n }\n\n value[k] = i;\n keep = cb.apply(null, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n };\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\n\n\n DataStore.prototype.selectRange = function (range) {\n var newStore = this.clone();\n var len = newStore._count;\n\n if (!len) {\n return this;\n }\n\n var dims = keys(range);\n var dimSize = dims.length;\n\n if (!dimSize) {\n return this;\n }\n\n var originalCount = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dims[0];\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storeArr = newStore._chunks;\n var quickFinished = false;\n\n if (!newStore._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = storeArr[dims[0]];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storeArr[dims[0]];\n var dimStorage2 = storeArr[dims[1]];\n var min2 = range[dims[1]][0];\n var max2 = range[dims[1]][1];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = newStore.getRawIndex(i);\n var val = storeArr[dims[0]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = newStore.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dims[k];\n var val = storeArr[dimk][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = newStore.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n }; // /**\n // * Data mapping to a plain array\n // */\n // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\n // const result: any[] = [];\n // this.each(dims, function () {\n // result.push(cb && (cb as MapArrayCb).apply(null, arguments));\n // });\n // return result;\n // }\n\n /**\r\n * Data mapping to a new List with given dimensions\r\n */\n\n\n DataStore.prototype.map = function (dims, cb) {\n // TODO only clone picked chunks.\n var target = this.clone(dims);\n\n this._updateDims(target, dims, cb);\n\n return target;\n };\n /**\r\n * @caution Danger!! Only used in dataStack.\r\n */\n\n\n DataStore.prototype.modify = function (dims, cb) {\n this._updateDims(this, dims, cb);\n };\n\n DataStore.prototype._updateDims = function (target, dims, cb) {\n var targetChunks = target._chunks;\n var tmpRetValue = [];\n var dimSize = dims.length;\n var dataCount = target.count();\n var values = [];\n var rawExtent = target._rawExtent;\n\n for (var i = 0; i < dims.length; i++) {\n rawExtent[dims[i]] = getInitialExtent();\n }\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n var rawIndex = target.getRawIndex(dataIndex);\n\n for (var k = 0; k < dimSize; k++) {\n values[k] = targetChunks[dims[k]][rawIndex];\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(null, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dims[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = targetChunks[dim];\n\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n };\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\n\n\n DataStore.prototype.lttbDownSample = function (valueDimension, rate) {\n var target = this.clone([valueDimension], true);\n var targetStorage = target._chunks;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var sampledIndex = 0;\n var frameSize = Math.floor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex;\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len)); // First frame use the first data.\n\n newIndices[sampledIndex++] = currentRawIndex;\n\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n }\n\n avgY += y;\n }\n\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart;\n var firstNaNIndex = -1;\n var countNaN = 0; // Find a point from current frame that construct a triangle with largest area with previous selected point\n // And the average of next frame.\n\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n countNaN++;\n\n if (firstNaNIndex < 0) {\n firstNaNIndex = rawIndex;\n }\n\n continue;\n } // Calculate triangle area over three buckets\n\n\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n if (countNaN > 0 && countNaN < frameEnd - frameStart) {\n // Append first NaN point in every bucket.\n // It is necessary to ensure the correct order of indices.\n newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);\n nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);\n }\n\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n } // First frame use the last data.\n\n\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n target._count = sampledIndex;\n target._indices = newIndices;\n target.getRawIndex = this._getRawIdx;\n return target;\n };\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\n\n\n DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var target = this.clone([dimension], true);\n var targetStorage = target._chunks;\n var frameValues = [];\n var frameSize = Math.floor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data\n\n dimStore[sampleFrameIdx] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n target._count = offset;\n target._indices = newIndices;\n\n target._updateGetRawIdx();\n\n return target;\n };\n /**\r\n * Data iteration\r\n * @param ctx default this\r\n * @example\r\n * list.each('x', function (x, idx) {});\r\n * list.each(['x', 'y'], function (x, y, idx) {});\r\n * list.each(function (idx) {})\r\n */\n\n\n DataStore.prototype.each = function (dims, cb) {\n if (!this._count) {\n return;\n }\n\n var dimSize = dims.length;\n var chunks = this._chunks;\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n switch (dimSize) {\n case 0:\n cb(i);\n break;\n\n case 1:\n cb(chunks[dims[0]][rawIdx], i);\n break;\n\n case 2:\n cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n } // Index\n\n\n value[k] = i;\n cb.apply(null, value);\n }\n }\n };\n /**\r\n * Get extent of data in one dimension\r\n */\n\n\n DataStore.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n var dimData = this._chunks[dim];\n var initialExtent = getInitialExtent();\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices;\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\r\n * Get raw data item\r\n */\n\n\n DataStore.prototype.getRawDataItem = function (idx) {\n var rawIdx = this.getRawIndex(idx);\n\n if (!this._provider.persistent) {\n var val = [];\n var chunks = this._chunks;\n\n for (var i = 0; i < chunks.length; i++) {\n val.push(chunks[i][rawIdx]);\n }\n\n return val;\n } else {\n return this._provider.getItem(rawIdx);\n }\n };\n /**\r\n * Clone shallow.\r\n *\r\n * @param clonedDims Determine which dims to clone. Will share the data if not specified.\r\n */\n\n\n DataStore.prototype.clone = function (clonedDims, ignoreIndices) {\n var target = new DataStore();\n var chunks = this._chunks;\n var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) {\n obj[dimIdx] = true;\n return obj;\n }, {});\n\n if (clonedDimsMap) {\n for (var i = 0; i < chunks.length; i++) {\n // Not clone if dim is not picked.\n target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\n }\n } else {\n target._chunks = chunks;\n }\n\n this._copyCommonProps(target);\n\n if (!ignoreIndices) {\n target._indices = this._cloneIndices();\n }\n\n target._updateGetRawIdx();\n\n return target;\n };\n\n DataStore.prototype._copyCommonProps = function (target) {\n target._count = this._count;\n target._rawCount = this._rawCount;\n target._provider = this._provider;\n target._dimensions = this._dimensions;\n target._extent = clone(this._extent);\n target._rawExtent = clone(this._rawExtent);\n };\n\n DataStore.prototype._cloneIndices = function () {\n if (this._indices) {\n var Ctor = this._indices.constructor;\n var indices = void 0;\n\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n indices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n indices[i] = this._indices[i];\n }\n } else {\n indices = new Ctor(this._indices);\n }\n\n return indices;\n }\n\n return null;\n };\n\n DataStore.prototype._getRawIdxIdentity = function (idx) {\n return idx;\n };\n\n DataStore.prototype._getRawIdx = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n };\n\n DataStore.prototype._updateGetRawIdx = function () {\n this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\n };\n\n DataStore.internalField = function () {\n function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\n }\n\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, property, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\n return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensions[dimIndex]);\n },\n typedArray: function (dataItem, property, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n }();\n\n return DataStore;\n}();\n\nexport default DataStore;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\r\n * [REQUIREMENT_MEMO]:\r\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\r\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\r\n * `root-dataset`. Them on `series` has higher priority.\r\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\r\n * confuse users: whether those props indicate how to visit the upstream source or visit\r\n * the transform result source, and some transforms has nothing to do with these props,\r\n * and some transforms might have multiple upstream.\r\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\r\n * declared in `root-dataset`.\r\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\r\n * That is for reducing complexity in transforms.\r\n * PENDING: Whether to provide transposition transform?\r\n *\r\n * [IMPLEMENTAION_MEMO]:\r\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\r\n * They will not be calculated until `source` is about to be visited (to prevent from\r\n * duplicate calcuation). `source` is visited only in series and input to transforms.\r\n *\r\n * [DIMENSION_INHERIT_RULE]:\r\n * By default the dimensions are inherited from ancestors, unless a transform return\r\n * a new dimensions definition.\r\n * Consider the case:\r\n * ```js\r\n * dataset: [{\r\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * dataset: [{\r\n * dimension: ['Product', 'Sales', 'Prise'],\r\n * source: [ ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * ```\r\n * The two types of option should have the same behavior after transform.\r\n *\r\n *\r\n * [SCENARIO]:\r\n * (1) Provide source data directly:\r\n * ```js\r\n * series: {\r\n * encode: {...},\r\n * dimensions: [...]\r\n * seriesLayoutBy: 'row',\r\n * data: [[...]]\r\n * }\r\n * ```\r\n * (2) Series refer to dataset.\r\n * ```js\r\n * series: [{\r\n * encode: {...}\r\n * // Ignore datasetIndex means `datasetIndex: 0`\r\n * // and the dimensions defination in dataset is used\r\n * }, {\r\n * encode: {...},\r\n * seriesLayoutBy: 'column',\r\n * datasetIndex: 1\r\n * }]\r\n * ```\r\n * (3) dataset transform\r\n * ```js\r\n * dataset: [{\r\n * source: [...]\r\n * }, {\r\n * source: [...]\r\n * }, {\r\n * // By default from 0.\r\n * transform: { type: 'filter', config: {...} }\r\n * }, {\r\n * // Piped.\r\n * transform: [\r\n * { type: 'filter', config: {...} },\r\n * { type: 'sort', config: {...} }\r\n * ]\r\n * }, {\r\n * id: 'regressionData',\r\n * fromDatasetIndex: 1,\r\n * // Third-party transform\r\n * transform: { type: 'ecStat:regression', config: {...} }\r\n * }, {\r\n * // retrieve the extra result.\r\n * id: 'regressionFormula',\r\n * fromDatasetId: 'regressionData',\r\n * fromTransformResult: 1\r\n * }]\r\n * ```\r\n */\n\nvar SourceManager =\n/** @class */\nfunction () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = [];\n this._storeList = []; // version sign of each upstream source manager.\n\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._dirty = true;\n this._sourceHost = sourceHost;\n }\n /**\r\n * Mark dirty.\r\n */\n\n\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n\n this._storeList = [];\n this._dirty = true;\n };\n\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\r\n * For detecting whether the upstream source is dirty, so that\r\n * the local cached source (in `_sourceList`) should be discarded.\r\n */\n\n\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\r\n * Always return a source instance. Otherwise throw error.\r\n */\n\n\n SourceManager.prototype.prepareSource = function () {\n // For the case that call `setOption` multiple time but no data changed,\n // cache the result source to prevent from repeating transform.\n if (this._isDirty()) {\n this._createSource();\n\n this._dirty = false;\n }\n };\n\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n\n var sourceHost = this._sourceHost;\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0; // Has upstream dataset\n\n if (hasUpstream) {\n var upSourceMgr = upSourceMgrList[0];\n upSourceMgr.prepareSource();\n upSource = upSourceMgr.getSource();\n data = upSource.data;\n sourceFormat = upSource.sourceFormat;\n upstreamSignList = [upSourceMgr._getVersionSign()];\n } // Series data is from own.\n else {\n data = seriesModel.get('data', true);\n sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n upstreamSignList = [];\n } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n\n\n var newMetaRawOption = this._getSourceMetaRawOption() || {};\n var upMetaRawOption = upSource && upSource.metaRawOption || {};\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n // but series need `seriesLayoutBy: 'row'`.\n\n var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); // We share source with dataset as much as possible\n // to avoid extra memory cost of high dimensional data.\n\n var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n resultSourceList = needsCreateSource ? [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat)] : [];\n } else {\n var datasetModel = sourceHost; // Has upstream dataset.\n\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n } // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n upstreamSignList = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n\n this._setLocalSource(resultSourceList, upstreamSignList);\n };\n\n SourceManager.prototype._applyTransform = function (upMgrList) {\n var datasetModel = this._sourceHost;\n var transformOption = datasetModel.get('transform', true);\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n\n if (fromTransformResult != null) {\n var errMsg = '';\n\n if (upMgrList.length !== 1) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n }\n\n doThrow(errMsg);\n }\n }\n\n var sourceList;\n var upSourceList = [];\n var upstreamSignList = [];\n each(upMgrList, function (upMgr) {\n upMgr.prepareSource();\n var upSource = upMgr.getSource(fromTransformResult || 0);\n var errMsg = '';\n\n if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n\n doThrow(errMsg);\n }\n\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\n });\n\n if (transformOption) {\n sourceList = applyDataTransform(transformOption, upSourceList, {\n datasetIndex: datasetModel.componentIndex\n });\n } else if (fromTransformResult != null) {\n sourceList = [cloneSourceShallow(upSourceList[0])];\n }\n\n return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n\n SourceManager.prototype._isDirty = function () {\n if (this._dirty) {\n return true;\n } // All sourceList is from the some upstream.\n\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n\n if ( // Consider the case that there is ancestor diry, call it recursively.\n // The performance is probably not an issue because usually the chain is not long.\n upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n return true;\n }\n }\n };\n /**\r\n * @param sourceIndex By default 0, means \"main source\".\r\n * In most cases there is only one source.\r\n */\n\n\n SourceManager.prototype.getSource = function (sourceIndex) {\n sourceIndex = sourceIndex || 0;\n var source = this._sourceList[sourceIndex];\n\n if (!source) {\n // Series may share source instance with dataset.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n }\n\n return source;\n };\n /**\r\n *\r\n * Get a data store which can be shared across series.\r\n * Only available for series.\r\n *\r\n * @param seriesDimRequest Dimensions that are generated in series.\r\n * Should have been sorted by `storeDimIndex` asc.\r\n */\n\n\n SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n }\n\n var schema = seriesDimRequest.makeStoreSchema();\n return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n };\n\n SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n // TODO Can use other sourceIndex?\n var sourceIndex = 0;\n var storeList = this._storeList;\n var cachedStoreMap = storeList[sourceIndex];\n\n if (!cachedStoreMap) {\n cachedStoreMap = storeList[sourceIndex] = {};\n }\n\n var cachedStore = cachedStoreMap[sourceReadKey];\n\n if (!cachedStore) {\n var upSourceMgr = this._getUpstreamSourceManagers()[0];\n\n if (isSeries(this._sourceHost) && upSourceMgr) {\n cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n } else {\n cachedStore = new DataStore(); // Always create store from source of series.\n\n cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n }\n\n cachedStoreMap[sourceReadKey] = cachedStore;\n }\n\n return cachedStore;\n };\n /**\r\n * PENDING: Is it fast enough?\r\n * If no upstream, return empty array.\r\n */\n\n\n SourceManager.prototype._getUpstreamSourceManagers = function () {\n // Always get the relationship from the raw option.\n // Do not cache the link of the dependency graph, so that\n // there is no need to update them when change happens.\n var sourceHost = this._sourceHost;\n\n if (isSeries(sourceHost)) {\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\n } else {\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n return datasetModel.getSourceManager();\n });\n }\n };\n\n SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n else if (!this._getUpstreamSourceManagers().length) {\n var model = sourceHost;\n seriesLayoutBy = model.get('seriesLayoutBy', true);\n sourceHeader = model.get('sourceHeader', true);\n dimensions = model.get('dimensions', true);\n }\n\n return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n\n return SourceManager;\n}();\n\nexport { SourceManager }; // Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\n\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\n\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\n\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getTooltipMarker, encodeHTML, makeValueReadable, convertToColorString } from '../../util/format.js';\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/lib/core/util.js';\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nimport { getRandomIdBase } from '../../util/number.js';\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; // TODO: more textStyle option\n\nfunction getTooltipTextStyle(textStyle, renderMode) {\n var nameFontColor = textStyle.color || '#6e7079';\n var nameFontSize = textStyle.fontSize || 12;\n var nameFontWeight = textStyle.fontWeight || '400';\n var valueFontColor = textStyle.color || '#464646';\n var valueFontSize = textStyle.fontSize || 14;\n var valueFontWeight = textStyle.fontWeight || '900';\n\n if (renderMode === 'html') {\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\n return {\n // eslint-disable-next-line max-len\n nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n // eslint-disable-next-line max-len\n valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n };\n } else {\n return {\n nameStyle: {\n fontSize: nameFontSize,\n fill: nameFontColor,\n fontWeight: nameFontWeight\n },\n valueStyle: {\n fontSize: valueFontSize,\n fill: valueFontColor,\n fontWeight: valueFontWeight\n }\n };\n }\n} // See `TooltipMarkupLayoutIntent['innerGapLevel']`.\n// (value from UI design)\n\n\nvar HTML_GAPS = [0, 10, 20, 30];\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n']; // eslint-disable-next-line max-len\n\nexport function createTooltipMarkup(type, option) {\n option.type = type;\n return option;\n}\n\nfunction isSectionFragment(frag) {\n return frag.type === 'section';\n}\n\nfunction getBuilder(frag) {\n return isSectionFragment(frag) ? buildSection : buildNameValue;\n}\n\nfunction getBlockGapLevel(frag) {\n if (isSectionFragment(frag)) {\n var gapLevel_1 = 0;\n var subBlockLen = frag.blocks.length;\n var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader;\n each(frag.blocks, function (subBlock) {\n var subGapLevel = getBlockGapLevel(subBlock); // If the some of the sub-blocks have some gaps (like 10px) inside, this block\n // should use a larger gap (like 20px) to distinguish those sub-blocks.\n\n if (subGapLevel >= gapLevel_1) {\n gapLevel_1 = subGapLevel + +(hasInnerGap_1 && ( // 0 always can not be readable gap level.\n !subGapLevel // If no header, always keep the sub gap level. Otherwise\n // look weird in case `multipleSeries`.\n || isSectionFragment(subBlock) && !subBlock.noHeader));\n }\n });\n return gapLevel_1;\n }\n\n return 0;\n}\n\nfunction buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var noHeader = fragment.noHeader;\n var gaps = getGap(getBlockGapLevel(fragment));\n var subMarkupTextList = [];\n var subBlocks = fragment.blocks || [];\n assert(!subBlocks || isArray(subBlocks));\n subBlocks = subBlocks || [];\n var orderMode = ctx.orderMode;\n\n if (fragment.sortBlocks && orderMode) {\n subBlocks = subBlocks.slice();\n var orderMap = {\n valueAsc: 'asc',\n valueDesc: 'desc'\n };\n\n if (hasOwn(orderMap, orderMode)) {\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\n subBlocks.sort(function (a, b) {\n return comparator_1.evaluate(a.sortParam, b.sortParam);\n });\n } // FIXME 'seriesDesc' necessary?\n else if (orderMode === 'seriesDesc') {\n subBlocks.reverse();\n }\n }\n\n each(subBlocks, function (subBlock, idx) {\n var valueFormatter = fragment.valueFormatter;\n var subMarkupText = getBuilder(subBlock)( // Inherit valueFormatter\n valueFormatter ? extend(extend({}, ctx), {\n valueFormatter: valueFormatter\n }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle);\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\n });\n var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html);\n\n if (noHeader) {\n return subMarkupText;\n }\n\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\n var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;\n\n if (ctx.renderMode === 'richText') {\n return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;\n } else {\n return wrapBlockHTML(\"
\" + encodeHTML(displayableHeader) + '
' + subMarkupText, topMarginForOuterGap);\n }\n}\n\nfunction buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var renderMode = ctx.renderMode;\n var noName = fragment.noName;\n var noValue = fragment.noValue;\n var noMarker = !fragment.markerType;\n var name = fragment.name;\n var useUTC = ctx.useUTC;\n\n var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) {\n value = isArray(value) ? value : [value];\n return map(value, function (val, idx) {\n return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);\n });\n };\n\n if (noName && noValue) {\n return;\n }\n\n var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\n var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC);\n var valueTypeOption = fragment.valueType;\n var readableValueList = noValue ? [] : valueFormatter(fragment.value);\n var valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker.\n\n var valueCloseToMarker = !noMarker && noName;\n\n var _a = getTooltipTextStyle(toolTipTextStyle, renderMode),\n nameStyle = _a.nameStyle,\n valueStyle = _a.valueStyle;\n\n return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) // Value has commas inside, so use ' ' as delimiter for multiple values.\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);\n}\n/**\r\n * @return markupText. null/undefined means no content.\r\n */\n\n\nexport function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {\n if (!fragment) {\n return;\n }\n\n var builder = getBuilder(fragment);\n var ctx = {\n useUTC: useUTC,\n renderMode: renderMode,\n orderMode: orderMode,\n markupStyleCreator: markupStyleCreator,\n valueFormatter: fragment.valueFormatter\n };\n return builder(ctx, fragment, 0, toolTipTextStyle);\n}\n\nfunction getGap(gapLevel) {\n return {\n html: HTML_GAPS[gapLevel],\n richText: RICH_TEXT_GAPS[gapLevel]\n };\n}\n\nfunction wrapBlockHTML(encodedContent, topGap) {\n var clearfix = '
';\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\n return \"
\" + encodedContent + clearfix + '
';\n}\n\nfunction wrapInlineNameHTML(name, leftHasMarker, style) {\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\n return \"\" + encodeHTML(name) + '';\n}\n\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {\n // Do not too close to marker, considering there are multiple values separated by spaces.\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\n valueList = isArray(valueList) ? valueList : [valueList];\n return \"\" // Value has commas inside, so use ' ' as delimiter for multiple values.\n + map(valueList, function (value) {\n return encodeHTML(value);\n }).join('  ') + '';\n}\n\nfunction wrapInlineNameRichText(ctx, name, style) {\n return ctx.markupStyleCreator.wrapRichTextStyle(name, style);\n}\n\nfunction wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) {\n var styles = [style];\n var paddingLeft = valueCloseToMarker ? 10 : 20;\n alignRight && styles.push({\n padding: [0, 0, 0, paddingLeft],\n align: 'right'\n }); // Value has commas inside, so use ' ' as delimiter for multiple values.\n\n return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles);\n}\n\nexport function retrieveVisualColorForTooltipMarker(series, dataIndex) {\n var style = series.getData().getItemVisual(dataIndex, 'style');\n var color = style[series.visualDrawType];\n return convertToColorString(color);\n}\nexport function getPaddingFromTooltipModel(model, renderMode) {\n var padding = model.get('padding');\n return padding != null ? padding // We give slightly different to look pretty.\n : renderMode === 'richText' ? [8, 10] : 10;\n}\n/**\r\n * The major feature is generate styles for `renderMode: 'richText'`.\r\n * But it also serves `renderMode: 'html'` to provide\r\n * \"renderMode-independent\" API.\r\n */\n\nvar TooltipMarkupStyleCreator =\n/** @class */\nfunction () {\n function TooltipMarkupStyleCreator() {\n this.richTextStyles = {}; // Notice that \"generate a style name\" usually happens repeatedly when mouse is moving and\n // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator\n // rather than static shared by all creators (which will cause it increase to fast).\n\n this._nextStyleNameId = getRandomIdBase();\n }\n\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\n return '__EC_aUTo_' + this._nextStyleNameId++;\n };\n\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\n var markerId = renderMode === 'richText' ? this._generateStyleName() : null;\n var marker = getTooltipMarker({\n color: colorStr,\n type: markerType,\n renderMode: renderMode,\n markerId: markerId\n });\n\n if (isString(marker)) {\n return marker;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(markerId);\n }\n\n this.richTextStyles[markerId] = marker.style;\n return marker.content;\n }\n };\n /**\r\n * @usage\r\n * ```ts\r\n * const styledText = markupStyleCreator.wrapRichTextStyle([\r\n * // The styles will be auto merged.\r\n * {\r\n * fontSize: 12,\r\n * color: 'blue'\r\n * },\r\n * {\r\n * padding: 20\r\n * }\r\n * ]);\r\n * ```\r\n */\n\n\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\n var finalStl = {};\n\n if (isArray(styles)) {\n each(styles, function (stl) {\n return extend(finalStl, stl);\n });\n } else {\n extend(finalStl, styles);\n }\n\n var styleName = this._generateStyleName();\n\n this.richTextStyles[styleName] = finalStl;\n return \"{\" + styleName + \"|\" + text + \"}\";\n };\n\n return TooltipMarkupStyleCreator;\n}();\n\nexport { TooltipMarkupStyleCreator };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { trim, isArray, each, reduce } from 'zrender/lib/core/util.js';\nimport { retrieveVisualColorForTooltipMarker, createTooltipMarkup } from './tooltipMarkup.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isNameSpecified } from '../../util/model.js';\nexport function defaultSeriesFormatTooltip(opt) {\n var series = opt.series;\n var dataIndex = opt.dataIndex;\n var multipleSeries = opt.multipleSeries;\n var data = series.getData();\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\n var tooltipDimLen = tooltipDims.length;\n var value = series.getRawValue(dataIndex);\n var isValueArr = isArray(value);\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); // Complicated rule for pretty tooltip.\n\n var inlineValue;\n var inlineValueType;\n var subBlocks;\n var sortParam;\n\n if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\n inlineValue = formatArrResult.inlineValues;\n inlineValueType = formatArrResult.inlineValueTypes;\n subBlocks = formatArrResult.blocks; // Only support tooltip sort by the first inline value. It's enough in most cases.\n\n sortParam = formatArrResult.inlineValues[0];\n } else if (tooltipDimLen) {\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\n inlineValueType = dimInfo.type;\n } else {\n sortParam = inlineValue = isValueArr ? value[0] : value;\n } // Do not show generated series name. It might not be readable.\n\n\n var seriesNameSpecified = isNameSpecified(series);\n var seriesName = seriesNameSpecified && series.name || '';\n var itemName = data.getName(dataIndex);\n var inlineName = multipleSeries ? seriesName : itemName;\n return createTooltipMarkup('section', {\n header: seriesName,\n // When series name is not specified, do not show a header line with only '-'.\n // This case always happens in tooltip.trigger: 'item'.\n noHeader: multipleSeries || !seriesNameSpecified,\n sortParam: sortParam,\n blocks: [createTooltipMarkup('nameValue', {\n markerType: 'item',\n markerColor: markerColor,\n // Do not mix display seriesName and itemName in one tooltip,\n // which might confuses users.\n name: inlineName,\n // name dimension might be auto assigned, where the name might\n // be not readable. So we check trim here.\n noName: !trim(inlineName),\n value: inlineValue,\n valueType: inlineValueType\n })].concat(subBlocks || [])\n });\n}\n\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\n // check: category-no-encode-has-axis-data in dataset.html\n var data = series.getData();\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\n var dimItem = data.getDimensionInfo(idx);\n return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n }, false);\n var inlineValues = [];\n var inlineValueTypes = [];\n var blocks = [];\n tooltipDims.length ? each(tooltipDims, function (dim) {\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n }) // By default, all dims is used on tooltip.\n : each(value, setEachItem);\n\n function setEachItem(val, dim) {\n var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip.\n\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n return;\n }\n\n if (isValueMultipleLine) {\n blocks.push(createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: colorStr,\n name: dimInfo.displayName,\n value: val,\n valueType: dimInfo.type\n }));\n } else {\n inlineValues.push(val);\n inlineValueTypes.push(dimInfo.type);\n }\n }\n\n return {\n inlineValues: inlineValues,\n inlineValueTypes: inlineValueTypes,\n blocks: blocks\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport * as modelUtil from '../util/model.js';\nimport ComponentModel from './Component.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { DataFormatMixin } from '../model/mixin/dataFormat.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport { createTask } from '../core/task.js';\nimport { mountExtend } from '../util/clazz.js';\nimport { SourceManager } from '../data/helper/sourceManager.js';\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip.js';\nvar inner = modelUtil.makeInner();\n\nfunction getSelectionKey(data, dataIndex) {\n return data.getName(dataIndex) || data.getId(dataIndex);\n}\n\nexport var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';\n\nvar SeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SeriesModel, _super);\n\n function SeriesModel() {\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\n // the class members must not be initialized in constructor or declaration place.\n // Otherwise there is bad case:\n // class A {xxx = 1;}\n // enableClassExtend(A);\n // class B extends A {}\n // var C = B.extend({xxx: 5});\n // var c = new C();\n // console.log(c.xxx); // expect 5 but always 1.\n var _this = _super !== null && _super.apply(this, arguments) || this; // ---------------------------------------\n // Props about data selection\n // ---------------------------------------\n\n\n _this._selectedDataIndicesMap = {};\n return _this;\n }\n\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\n this.seriesIndex = this.componentIndex;\n this.dataTask = createTask({\n count: dataTaskCount,\n reset: dataTaskReset\n });\n this.dataTask.context = {\n model: this\n };\n this.mergeDefaultAndTheme(option, ecModel);\n var sourceManager = inner(this).sourceManager = new SourceManager(this);\n sourceManager.prepareSource();\n var data = this.getInitialData(option, ecModel);\n wrapData(data, this);\n this.dataTask.context.data = data;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(data, 'getInitialData returned invalid data.');\n }\n\n inner(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make\n // dataBeforeProcessed by cloneShallow), cloneShallow will\n // cause data.graph.data !== data when using\n // module:echarts/data/Graph or module:echarts/data/Tree.\n // See module:echarts/data/helper/linkSeriesData\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n // init or merge stage, because the data can be restored. So we do not `restoreData`\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n // Call `seriesModel.getRawData()` instead.\n // this.restoreData();\n\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n /**\r\n * Util for merge default and theme to option\r\n */\n\n\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme.\n // But if name duplicate between series subType\n // (for example: parallel) add component mainType,\n // add suffix 'Series'.\n\n var themeSubType = this.subType;\n\n if (ComponentModel.hasClass(themeSubType)) {\n themeSubType += 'Series';\n }\n\n zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n zrUtil.merge(option, this.getDefaultOption()); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n this.fillDataTextStyle(option.data);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\n // this.settingTask.dirty();\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n this.fillDataTextStyle(newSeriesOption.data);\n var layoutMode = fetchLayoutMode(this);\n\n if (layoutMode) {\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n }\n\n var sourceManager = inner(this).sourceManager;\n sourceManager.dirty();\n sourceManager.prepareSource();\n var data = this.getInitialData(newSeriesOption, ecModel);\n wrapData(data, this);\n this.dataTask.dirty();\n this.dataTask.context.data = data;\n inner(this).dataBeforeProcessed = data;\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n\n SeriesModel.prototype.fillDataTextStyle = function (data) {\n // Default data label emphasis `show`\n // FIXME Tree structure data ?\n // FIXME Performance ?\n if (data && !zrUtil.isTypedArray(data)) {\n var props = ['show'];\n\n for (var i = 0; i < data.length; i++) {\n if (data[i] && data[i].label) {\n modelUtil.defaultEmphasis(data[i], 'label', props);\n }\n }\n }\n };\n /**\r\n * Init a data structure from data related option in series\r\n * Must be overridden.\r\n */\n\n\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\n return;\n };\n /**\r\n * Append data to list\r\n */\n\n\n SeriesModel.prototype.appendData = function (params) {\n // FIXME ???\n // (1) If data from dataset, forbidden append.\n // (2) support append data of dataset.\n var data = this.getRawData();\n data.appendData(params.data);\n };\n /**\r\n * Consider some method like `filter`, `map` need make new data,\r\n * We should make sure that `seriesModel.getData()` get correct\r\n * data in the stream procedure. So we fetch data from upstream\r\n * each time `task.perform` called.\r\n */\n\n\n SeriesModel.prototype.getData = function (dataType) {\n var task = getCurrentTask(this);\n\n if (task) {\n var data = task.context.data;\n return dataType == null ? data : data.getLinkedData(dataType);\n } else {\n // When series is not alive (that may happen when click toolbox\n // restore or setOption with not merge mode), series data may\n // be still need to judge animation or something when graphic\n // elements want to know whether fade out.\n return inner(this).data;\n }\n };\n\n SeriesModel.prototype.getAllData = function () {\n var mainData = this.getData();\n return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{\n data: mainData\n }];\n };\n\n SeriesModel.prototype.setData = function (data) {\n var task = getCurrentTask(this);\n\n if (task) {\n var context = task.context; // Consider case: filter, data sample.\n // FIXME:TS never used, so comment it\n // if (context.data !== data && task.modifyOutputEnd) {\n // task.setOutputEnd(data.count());\n // }\n\n context.outputData = data; // Caution: setData should update context.data,\n // Because getData may be called multiply in a\n // single stage and expect to get the data just\n // set. (For example, AxisProxy, x y both call\n // getData and setDate sequentially).\n // So the context.data should be fetched from\n // upstream each time when a stage starts to be\n // performed.\n\n if (task !== this.dataTask) {\n context.data = data;\n }\n }\n\n inner(this).data = data;\n };\n\n SeriesModel.prototype.getEncode = function () {\n var encode = this.get('encode', true);\n\n if (encode) {\n return zrUtil.createHashMap(encode);\n }\n };\n\n SeriesModel.prototype.getSourceManager = function () {\n return inner(this).sourceManager;\n };\n\n SeriesModel.prototype.getSource = function () {\n return this.getSourceManager().getSource();\n };\n /**\r\n * Get data before processed\r\n */\n\n\n SeriesModel.prototype.getRawData = function () {\n return inner(this).dataBeforeProcessed;\n };\n\n SeriesModel.prototype.getColorBy = function () {\n var colorBy = this.get('colorBy');\n return colorBy || 'series';\n };\n\n SeriesModel.prototype.isColorBySeries = function () {\n return this.getColorBy() === 'series';\n };\n /**\r\n * Get base axis if has coordinate system and has axis.\r\n * By default use coordSys.getBaseAxis();\r\n * Can be overridden for some chart.\r\n * @return {type} description\r\n */\n\n\n SeriesModel.prototype.getBaseAxis = function () {\n var coordSys = this.coordinateSystem; // @ts-ignore\n\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n };\n /**\r\n * Default tooltip formatter\r\n *\r\n * @param dataIndex\r\n * @param multipleSeries\r\n * @param dataType\r\n * @param renderMode valid values: 'html'(by default) and 'richText'.\r\n * 'html' is used for rendering tooltip in extra DOM form, and the result\r\n * string is used as DOM HTML content.\r\n * 'richText' is used for rendering tooltip in rich text form, for those where\r\n * DOM operation is not supported.\r\n * @return formatted tooltip with `html` and `markers`\r\n * Notice: The override method can also return string\r\n */\n\n\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n return defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n };\n\n SeriesModel.prototype.isAnimationEnabled = function () {\n var ecModel = this.ecModel; // Disable animation if using echarts in node but not give ssr flag.\n // In ssr mode, renderToString will generate svg with css animation.\n\n if (env.node && !(ecModel && ecModel.ssr)) {\n return false;\n }\n\n var animationEnabled = this.getShallow('animation');\n\n if (animationEnabled) {\n if (this.getData().count() > this.getShallow('animationThreshold')) {\n animationEnabled = false;\n }\n }\n\n return !!animationEnabled;\n };\n\n SeriesModel.prototype.restoreData = function () {\n this.dataTask.dirty();\n };\n\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\n var ecModel = this.ecModel; // PENDING\n\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\n\n if (!color) {\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n }\n\n return color;\n };\n /**\r\n * Use `data.mapDimensionsAll(coordDim)` instead.\r\n * @deprecated\r\n */\n\n\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\n return this.getRawData().mapDimensionsAll(coordDim);\n };\n /**\r\n * Get progressive rendering count each step\r\n */\n\n\n SeriesModel.prototype.getProgressive = function () {\n return this.get('progressive');\n };\n /**\r\n * Get progressive rendering count each step\r\n */\n\n\n SeriesModel.prototype.getProgressiveThreshold = function () {\n return this.get('progressiveThreshold');\n }; // PENGING If selectedMode is null ?\n\n\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\n this._innerSelect(this.getData(dataType), innerDataIndices);\n };\n\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return;\n }\n\n var selectedMode = this.option.selectedMode;\n var data = this.getData(dataType);\n\n if (selectedMode === 'series' || selectedMap === 'all') {\n this.option.selectedMap = {};\n this._selectedDataIndicesMap = {};\n return;\n }\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n var dataIndex = innerDataIndices[i];\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = false;\n this._selectedDataIndicesMap[nameOrId] = -1;\n }\n };\n\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\n var tmpArr = [];\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n tmpArr[0] = innerDataIndices[i];\n this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType);\n }\n };\n\n SeriesModel.prototype.getSelectedDataIndices = function () {\n if (this.option.selectedMap === 'all') {\n return [].slice.call(this.getData().getIndices());\n }\n\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\n var nameOrIds = zrUtil.keys(selectedDataIndicesMap);\n var dataIndices = [];\n\n for (var i = 0; i < nameOrIds.length; i++) {\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\n\n if (dataIndex >= 0) {\n dataIndices.push(dataIndex);\n }\n }\n\n return dataIndices;\n };\n\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return false;\n }\n\n var data = this.getData(dataType);\n return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']);\n };\n\n SeriesModel.prototype.isUniversalTransitionEnabled = function () {\n if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n return true;\n }\n\n var universalTransitionOpt = this.option.universalTransition; // Quick reject\n\n if (!universalTransitionOpt) {\n return false;\n }\n\n if (universalTransitionOpt === true) {\n return true;\n } // Can be simply 'universalTransition: true'\n\n\n return universalTransitionOpt && universalTransitionOpt.enabled;\n };\n\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\n var _a, _b;\n\n var option = this.option;\n var selectedMode = option.selectedMode;\n var len = innerDataIndices.length;\n\n if (!selectedMode || !len) {\n return;\n }\n\n if (selectedMode === 'series') {\n option.selectedMap = 'all';\n } else if (selectedMode === 'multiple') {\n if (!zrUtil.isObject(option.selectedMap)) {\n option.selectedMap = {};\n }\n\n var selectedMap = option.selectedMap;\n\n for (var i = 0; i < len; i++) {\n var dataIndex = innerDataIndices[i]; // TODO different types of data share same object.\n\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = true;\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\n }\n } else if (selectedMode === 'single' || selectedMode === true) {\n var lastDataIndex = innerDataIndices[len - 1];\n var nameOrId = getSelectionKey(data, lastDataIndex);\n option.selectedMap = (_a = {}, _a[nameOrId] = true, _a);\n this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b);\n }\n };\n\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\n // Ignore select info in data if selectedMap exists.\n // NOTE It's only for legacy usage. edge data is not supported.\n if (this.option.selectedMap) {\n return;\n }\n\n var dataIndices = [];\n\n if (data.hasItemOption) {\n data.each(function (idx) {\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem.selected) {\n dataIndices.push(idx);\n }\n });\n }\n\n if (dataIndices.length > 0) {\n this._innerSelect(data, dataIndices);\n }\n }; // /**\n // * @see {module:echarts/stream/Scheduler}\n // */\n // abstract pipeTask: null\n\n\n SeriesModel.registerClass = function (clz) {\n return ComponentModel.registerClass(clz);\n };\n\n SeriesModel.protoInitialize = function () {\n var proto = SeriesModel.prototype;\n proto.type = 'series.__base__';\n proto.seriesIndex = 0;\n proto.ignoreStyleOnData = false;\n proto.hasSymbolVisual = false;\n proto.defaultSymbol = 'circle'; // Make sure the values can be accessed!\n\n proto.visualStyleAccessPath = 'itemStyle';\n proto.visualDrawType = 'fill';\n }();\n\n return SeriesModel;\n}(ComponentModel);\n\nzrUtil.mixin(SeriesModel, DataFormatMixin);\nzrUtil.mixin(SeriesModel, PaletteMixin);\nmountExtend(SeriesModel, ComponentModel);\n/**\r\n * MUST be called after `prepareSource` called\r\n * Here we need to make auto series, especially for auto legend. But we\r\n * do not modify series.name in option to avoid side effects.\r\n */\n\nfunction autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}\n\nfunction getSeriesAutoName(seriesModel) {\n var data = seriesModel.getRawData();\n var dataDims = data.mapDimensionsAll('seriesName');\n var nameArr = [];\n zrUtil.each(dataDims, function (dataDim) {\n var dimInfo = data.getDimensionInfo(dataDim);\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\n });\n return nameArr.join(' ');\n}\n\nfunction dataTaskCount(context) {\n return context.model.getRawData().count();\n}\n\nfunction dataTaskReset(context) {\n var seriesModel = context.model;\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\n return dataTaskProgress;\n}\n\nfunction dataTaskProgress(param, context) {\n // Avoid repeat cloneShallow when data just created in reset.\n if (context.outputData && param.end > context.outputData.count()) {\n context.model.getRawData().cloneShallow(context.outputData);\n }\n} // TODO refactor\n\n\nfunction wrapData(data, seriesModel) {\n zrUtil.each(zrUtil.concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(onDataChange, seriesModel));\n });\n}\n\nfunction onDataChange(seriesModel, newList) {\n var task = getCurrentTask(seriesModel);\n\n if (task) {\n // Consider case: filter, selectRange\n task.setOutputEnd((newList || this).count());\n }\n\n return newList;\n}\n\nfunction getCurrentTask(seriesModel) {\n var scheduler = (seriesModel.ecModel || {}).scheduler;\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n\n if (pipeline) {\n // When pipline finished, the currrentTask keep the last\n // task (renderTask).\n var task = pipeline.currentTask;\n\n if (task) {\n var agentStubMap = task.agentStubMap;\n\n if (agentStubMap) {\n task = agentStubMap.get(seriesModel.uid);\n }\n }\n\n return task;\n }\n}\n\nexport default SeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\n\nvar ComponentView =\n/** @class */\nfunction () {\n function ComponentView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewComponent');\n }\n\n ComponentView.prototype.init = function (ecModel, api) {};\n\n ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n\n ComponentView.prototype.dispose = function (ecModel, api) {};\n\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing;\n };\n /**\r\n * Hook for toggle blur target series.\r\n * Can be used in marker for blur or leave blur the markers\r\n */\n\n\n ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {// Do nothing;\n };\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\n\n\n ComponentView.prototype.eachRendered = function (cb) {\n var group = this.group;\n\n if (group) {\n group.traverse(cb);\n }\n };\n\n return ComponentView;\n}();\n\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\n/**\r\n * @return {string} If large mode changed, return string 'reset';\r\n */\n\nexport default function createRenderPlanner() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = !!fields.large;\n var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n };\n}","import PathProxy from '../core/PathProxy.js';\nimport { applyTransform as v2ApplyTransform } from '../core/vector.js';\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\nexport default function transformPath(path, m) {\n if (!m) {\n return;\n }\n var data = path.data;\n var len = path.len();\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 for (i = 0, j = 0; i < len;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n case L:\n nPoint = 1;\n break;\n case C:\n nPoint = 3;\n break;\n case Q:\n nPoint = 2;\n break;\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);\n data[i] *= sx;\n data[i++] += x;\n data[i] *= sy;\n data[i++] += y;\n data[i++] *= sx;\n data[i++] *= sy;\n data[i++] += angle;\n data[i++] += angle;\n i += 2;\n j = i;\n break;\n case R:\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 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 for (k = 0; k < nPoint; k++) {\n var p_1 = points[k];\n p_1[0] = data[i++];\n p_1[1] = data[i++];\n v2ApplyTransform(p_1, p_1, m);\n data[j++] = p_1[0];\n data[j++] = p_1[1];\n }\n }\n path.increaseVersion();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../graphic/Path.js';\nimport PathProxy from '../core/PathProxy.js';\nimport transformPath from './transformPath.js';\nimport { extend } from '../core/util.js';\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n;\nfunction vRatio(u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n}\n;\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n * 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\n + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n var f = (fa === fs ? -1 : 1)\n * mathSqrt((((rx * rx) * (ry * ry))\n - ((rx * rx) * (yp * yp))\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n + (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\n + mathCos(psi) * cxp\n - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0\n + mathSin(psi) * cxp\n + 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 if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (dTheta < 0) {\n var n = Math.round(dTheta / PI * 1e6) / 1e6;\n dTheta = PI * 2 + (n % 2) * PI;\n }\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction createPathProxyFromString(data) {\n var path = new PathProxy();\n if (!data) {\n return path;\n }\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var CMD = PathProxy.CMD;\n var cmdList = data.match(commandReg);\n if (!cmdList) {\n return path;\n }\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd = void 0;\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n var off = 0;\n while (off < pLen) {\n var ctlPtx = void 0;\n var ctlPty = void 0;\n var rx = void 0;\n var ry = void 0;\n var psi = void 0;\n var fa = void 0;\n var fs = void 0;\n var x1 = cpx;\n var y1 = cpy;\n var len = void 0;\n var pathData = void 0;\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 case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\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 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 case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\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 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 case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\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 case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\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 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 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 case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\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 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 if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd);\n cpx = subpathX;\n cpy = subpathY;\n }\n prevCmd = cmd;\n }\n path.toStatic();\n return path;\n}\nvar SVGPath = (function (_super) {\n __extends(SVGPath, _super);\n function SVGPath() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SVGPath.prototype.applyTransform = function (m) { };\n return SVGPath;\n}(Path));\nfunction isPathProxy(path) {\n return path.setData != null;\n}\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n var innerOpts = extend({}, opts);\n innerOpts.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.setData(pathProxy.data);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n else {\n var ctx = path;\n pathProxy.rebuildPath(ctx, 1);\n }\n };\n innerOpts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirtyShape();\n };\n return innerOpts;\n}\nexport function createFromString(str, opts) {\n return new SVGPath(createPathOptions(str, opts));\n}\nexport function extendFromString(str, defaultOpts) {\n var innerOpts = createPathOptions(str, defaultOpts);\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n _this.applyTransform = innerOpts.applyTransform;\n _this.buildPath = innerOpts.buildPath;\n return _this;\n }\n return Sub;\n }(SVGPath));\n return Sub;\n}\nexport function mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n pathList.push(pathEl.getUpdatedPathProxy(true));\n }\n var pathBundle = new Path(opts);\n pathBundle.createPathProxy();\n pathBundle.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.appendPath(pathList);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n };\n return pathBundle;\n}\nexport function clonePath(sourcePath, opts) {\n opts = opts || {};\n var path = new Path();\n if (sourcePath.shape) {\n path.setShape(sourcePath.shape);\n }\n path.setStyle(sourcePath.style);\n if (opts.bakeTransform) {\n transformPath(path.path, sourcePath.getComputedTransform());\n }\n else {\n if (opts.toLocal) {\n path.setLocalTransform(sourcePath.getComputedTransform());\n }\n else {\n path.copyTransform(sourcePath);\n }\n }\n path.buildPath = sourcePath.buildPath;\n path.applyTransform = path.applyTransform;\n path.z = sourcePath.z;\n path.z2 = sourcePath.z2;\n path.zlevel = sourcePath.zlevel;\n return path;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar CircleShape = (function () {\n function CircleShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n }\n return CircleShape;\n}());\nexport { CircleShape };\nvar Circle = (function (_super) {\n __extends(Circle, _super);\n function Circle(opts) {\n return _super.call(this, opts) || this;\n }\n Circle.prototype.getDefaultShape = function () {\n return new CircleShape();\n };\n Circle.prototype.buildPath = function (ctx, shape) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n };\n return Circle;\n}(Path));\n;\nCircle.prototype.type = 'circle';\nexport default Circle;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar EllipseShape = (function () {\n function EllipseShape() {\n this.cx = 0;\n this.cy = 0;\n this.rx = 0;\n this.ry = 0;\n }\n return EllipseShape;\n}());\nexport { EllipseShape };\nvar Ellipse = (function (_super) {\n __extends(Ellipse, _super);\n function Ellipse(opts) {\n return _super.call(this, opts) || this;\n }\n Ellipse.prototype.getDefaultShape = function () {\n return new EllipseShape();\n };\n Ellipse.prototype.buildPath = function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k;\n var oy = b * k;\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n };\n return Ellipse;\n}(Path));\nEllipse.prototype.type = 'ellipse';\nexport default Ellipse;\n","import { isArray } from '../../core/util.js';\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar mathACos = Math.acos;\nvar mathATan2 = Math.atan2;\nvar mathAbs = Math.abs;\nvar mathSqrt = Math.sqrt;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar e = 1e-4;\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var dx10 = x1 - x0;\n var dy10 = y1 - y0;\n var dx32 = x3 - x2;\n var dy32 = y3 - y2;\n var t = dy32 * dx10 - dx32 * dy10;\n if (t * t < e) {\n return;\n }\n t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;\n return [x0 + t * dx10, y0 + t * dy10];\n}\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\n var x01 = x0 - x1;\n var y01 = y0 - y1;\n var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n var ox = lo * y01;\n var oy = -lo * x01;\n var x11 = x0 + ox;\n var y11 = y0 + oy;\n var x10 = x1 + ox;\n var y10 = y1 + oy;\n var x00 = (x11 + x10) / 2;\n var y00 = (y11 + y10) / 2;\n var dx = x10 - x11;\n var dy = y10 - y11;\n var d2 = dx * dx + dy * dy;\n var r = radius - cr;\n var s = x11 * y10 - x10 * y11;\n var d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n var cx0 = (s * dy - dx * d) / d2;\n var cy0 = (-s * dx - dy * d) / d2;\n var cx1 = (s * dy + dx * d) / d2;\n var cy1 = (-s * dx + dy * d) / d2;\n var dx0 = cx0 - x00;\n var dy0 = cy0 - y00;\n var dx1 = cx1 - x00;\n var dy1 = cy1 - y00;\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1;\n cy0 = cy1;\n }\n return {\n cx: cx0,\n cy: cy0,\n x0: -ox,\n y0: -oy,\n x1: cx0 * (radius / r - 1),\n y1: cy0 * (radius / r - 1)\n };\n}\nfunction normalizeCornerRadius(cr) {\n var arr;\n if (isArray(cr)) {\n var len = cr.length;\n if (!len) {\n return cr;\n }\n if (len === 1) {\n arr = [cr[0], cr[0], 0, 0];\n }\n else if (len === 2) {\n arr = [cr[0], cr[0], cr[1], cr[1]];\n }\n else if (len === 3) {\n arr = cr.concat(cr[2]);\n }\n else {\n arr = cr;\n }\n }\n else {\n arr = [cr, cr, cr, cr];\n }\n return arr;\n}\nexport function buildPath(ctx, shape) {\n var _a;\n var radius = mathMax(shape.r, 0);\n var innerRadius = mathMax(shape.r0 || 0, 0);\n var hasRadius = radius > 0;\n var hasInnerRadius = innerRadius > 0;\n if (!hasRadius && !hasInnerRadius) {\n return;\n }\n if (!hasRadius) {\n radius = innerRadius;\n innerRadius = 0;\n }\n if (innerRadius > radius) {\n var tmp = radius;\n radius = innerRadius;\n innerRadius = tmp;\n }\n var startAngle = shape.startAngle, endAngle = shape.endAngle;\n if (isNaN(startAngle) || isNaN(endAngle)) {\n return;\n }\n var cx = shape.cx, cy = shape.cy;\n var clockwise = !!shape.clockwise;\n var arc = mathAbs(endAngle - startAngle);\n var mod = arc > PI2 && arc % PI2;\n mod > e && (arc = mod);\n if (!(radius > e)) {\n ctx.moveTo(cx, cy);\n }\n else if (arc > PI2 - e) {\n ctx.moveTo(cx + radius * mathCos(startAngle), cy + radius * mathSin(startAngle));\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n if (innerRadius > e) {\n ctx.moveTo(cx + innerRadius * mathCos(endAngle), cy + innerRadius * mathSin(endAngle));\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n else {\n var icrStart = void 0;\n var icrEnd = void 0;\n var ocrStart = void 0;\n var ocrEnd = void 0;\n var ocrs = void 0;\n var ocre = void 0;\n var icrs = void 0;\n var icre = void 0;\n var ocrMax = void 0;\n var icrMax = void 0;\n var limitedOcrMax = void 0;\n var limitedIcrMax = void 0;\n var xre = void 0;\n var yre = void 0;\n var xirs = void 0;\n var yirs = void 0;\n var xrs = radius * mathCos(startAngle);\n var yrs = radius * mathSin(startAngle);\n var xire = innerRadius * mathCos(endAngle);\n var yire = innerRadius * mathSin(endAngle);\n var hasArc = arc > e;\n if (hasArc) {\n var cornerRadius = shape.cornerRadius;\n if (cornerRadius) {\n _a = normalizeCornerRadius(cornerRadius), icrStart = _a[0], icrEnd = _a[1], ocrStart = _a[2], ocrEnd = _a[3];\n }\n var halfRd = mathAbs(radius - innerRadius) / 2;\n ocrs = mathMin(halfRd, ocrStart);\n ocre = mathMin(halfRd, ocrEnd);\n icrs = mathMin(halfRd, icrStart);\n icre = mathMin(halfRd, icrEnd);\n limitedOcrMax = ocrMax = mathMax(ocrs, ocre);\n limitedIcrMax = icrMax = mathMax(icrs, icre);\n if (ocrMax > e || icrMax > e) {\n xre = radius * mathCos(endAngle);\n yre = radius * mathSin(endAngle);\n xirs = innerRadius * mathCos(startAngle);\n yirs = innerRadius * mathSin(startAngle);\n if (arc < PI) {\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n if (it_1) {\n var x0 = xrs - it_1[0];\n var y0 = yrs - it_1[1];\n var x1 = xre - it_1[0];\n var y1 = yre - it_1[1];\n var a = 1 / mathSin(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);\n var b = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\n limitedOcrMax = mathMin(ocrMax, (radius - b) / (a + 1));\n limitedIcrMax = mathMin(icrMax, (innerRadius - b) / (a - 1));\n }\n }\n }\n }\n if (!hasArc) {\n ctx.moveTo(cx + xrs, cy + yrs);\n }\n else if (limitedOcrMax > e) {\n var crStart = mathMin(ocrStart, limitedOcrMax);\n var crEnd = mathMin(ocrEnd, limitedOcrMax);\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);\n ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedOcrMax < ocrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);\n crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.moveTo(cx + xrs, cy + yrs);\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n }\n if (!(innerRadius > e) || !hasArc) {\n ctx.lineTo(cx + xire, cy + yire);\n }\n else if (limitedIcrMax > e) {\n var crStart = mathMin(icrStart, limitedIcrMax);\n var crEnd = mathMin(icrEnd, limitedIcrMax);\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);\n ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedIcrMax < icrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);\n crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.lineTo(cx + xire, cy + yire);\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n ctx.closePath();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundSectorHelper from '../helper/roundSector.js';\nvar SectorShape = (function () {\n function SectorShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n this.cornerRadius = 0;\n }\n return SectorShape;\n}());\nexport { SectorShape };\nvar Sector = (function (_super) {\n __extends(Sector, _super);\n function Sector(opts) {\n return _super.call(this, opts) || this;\n }\n Sector.prototype.getDefaultShape = function () {\n return new SectorShape();\n };\n Sector.prototype.buildPath = function (ctx, shape) {\n roundSectorHelper.buildPath(ctx, shape);\n };\n Sector.prototype.isZeroArea = function () {\n return this.shape.startAngle === this.shape.endAngle\n || this.shape.r === this.shape.r0;\n };\n return Sector;\n}(Path));\nSector.prototype.type = 'sector';\nexport default Sector;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar RingShape = (function () {\n function RingShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.r0 = 0;\n }\n return RingShape;\n}());\nexport { RingShape };\nvar Ring = (function (_super) {\n __extends(Ring, _super);\n function Ring(opts) {\n return _super.call(this, opts) || this;\n }\n Ring.prototype.getDefaultShape = function () {\n return new RingShape();\n };\n Ring.prototype.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 return Ring;\n}(Path));\nRing.prototype.type = 'ring';\nexport default Ring;\n","import { min as v2Min, max as v2Max, scale as v2Scale, distance as v2Distance, add as v2Add, clone as v2Clone, sub as v2Sub } from '../../core/vector.js';\nexport default function smoothBezier(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 if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\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 v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n }\n else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n }\n else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n v2Sub(v, nextPoint, prevPoint);\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\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 cps.push(cp0);\n cps.push(cp1);\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n","import smoothBezier from './smoothBezier.js';\nexport function buildPath(ctx, shape, closePath) {\n var smooth = shape.smooth;\n var points = shape.points;\n if (points && points.length >= 2) {\n if (smooth) {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\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 }\n else {\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n closePath && ctx.closePath();\n }\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolygonShape = (function () {\n function PolygonShape() {\n this.points = null;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolygonShape;\n}());\nexport { PolygonShape };\nvar Polygon = (function (_super) {\n __extends(Polygon, _super);\n function Polygon(opts) {\n return _super.call(this, opts) || this;\n }\n Polygon.prototype.getDefaultShape = function () {\n return new PolygonShape();\n };\n Polygon.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n };\n return Polygon;\n}(Path));\n;\nPolygon.prototype.type = 'polygon';\nexport default Polygon;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolylineShape = (function () {\n function PolylineShape() {\n this.points = null;\n this.percent = 1;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolylineShape;\n}());\nexport { PolylineShape };\nvar Polyline = (function (_super) {\n __extends(Polyline, _super);\n function Polyline(opts) {\n return _super.call(this, opts) || this;\n }\n Polyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Polyline.prototype.getDefaultShape = function () {\n return new PolylineShape();\n };\n Polyline.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n };\n return Polyline;\n}(Path));\nPolyline.prototype.type = 'polyline';\nexport default Polyline;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize.js';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n function LineShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n __extends(Line, _super);\n function Line(opts) {\n return _super.call(this, opts) || this;\n }\n Line.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Line.prototype.getDefaultShape = function () {\n return new LineShape();\n };\n Line.prototype.buildPath = function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n };\n Line.prototype.pointAt = function (p) {\n var shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n };\n return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as vec2 from '../../core/vector.js';\nimport { quadraticSubdivide, cubicSubdivide, quadraticAt, cubicAt, quadraticDerivativeAt, cubicDerivativeAt } from '../../core/curve.js';\nvar out = [];\nvar BezierCurveShape = (function () {\n function BezierCurveShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.percent = 1;\n }\n return BezierCurveShape;\n}());\nexport { BezierCurveShape };\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n if (cpx2 != null || cpy2 != null) {\n return [\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n ];\n }\n else {\n return [\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n ];\n }\n}\nvar BezierCurve = (function (_super) {\n __extends(BezierCurve, _super);\n function BezierCurve(opts) {\n return _super.call(this, opts) || this;\n }\n BezierCurve.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n BezierCurve.prototype.getDefaultShape = function () {\n return new BezierCurveShape();\n };\n BezierCurve.prototype.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 if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\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 ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n }\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 ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n };\n BezierCurve.prototype.pointAt = function (t) {\n return someVectorAt(this.shape, t, false);\n };\n BezierCurve.prototype.tangentAt = function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n };\n return BezierCurve;\n}(Path));\n;\nBezierCurve.prototype.type = 'bezier-curve';\nexport default BezierCurve;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar ArcShape = (function () {\n function ArcShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n return ArcShape;\n}());\nexport { ArcShape };\nvar Arc = (function (_super) {\n __extends(Arc, _super);\n function Arc(opts) {\n return _super.call(this, opts) || this;\n }\n Arc.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Arc.prototype.getDefaultShape = function () {\n return new ArcShape();\n };\n Arc.prototype.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 return Arc;\n}(Path));\nArc.prototype.type = 'arc';\nexport default Arc;\n","import { __extends } from \"tslib\";\nimport Path from './Path.js';\nvar CompoundPath = (function (_super) {\n __extends(CompoundPath, _super);\n function CompoundPath() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'compound';\n return _this;\n }\n CompoundPath.prototype._updatePathDirty = function () {\n var paths = this.shape.paths;\n var dirtyPath = this.shapeChanged();\n for (var i = 0; i < paths.length; i++) {\n dirtyPath = dirtyPath || paths[i].shapeChanged();\n }\n if (dirtyPath) {\n this.dirtyShape();\n }\n };\n CompoundPath.prototype.beforeBrush = function () {\n this._updatePathDirty();\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale();\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n };\n CompoundPath.prototype.buildPath = function (ctx, shape) {\n var paths = shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n };\n CompoundPath.prototype.afterBrush = function () {\n var paths = this.shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].pathUpdated();\n }\n };\n CompoundPath.prototype.getBoundingRect = function () {\n this._updatePathDirty.call(this);\n return Path.prototype.getBoundingRect.call(this);\n };\n return CompoundPath;\n}(Path));\nexport default CompoundPath;\n","var Gradient = (function () {\n function Gradient(colorStops) {\n this.colorStops = colorStops || [];\n }\n Gradient.prototype.addColorStop = function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n };\n return Gradient;\n}());\nexport default Gradient;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar LinearGradient = (function (_super) {\n __extends(LinearGradient, _super);\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\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;\n _this.type = 'linear';\n _this.global = globalCoord || false;\n return _this;\n }\n return LinearGradient;\n}(Gradient));\nexport default LinearGradient;\n;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar RadialGradient = (function (_super) {\n __extends(RadialGradient, _super);\n function RadialGradient(x, y, r, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0.5 : x;\n _this.y = y == null ? 0.5 : y;\n _this.r = r == null ? 0.5 : r;\n _this.type = 'radial';\n _this.global = globalCoord || false;\n return _this;\n }\n return RadialGradient;\n}(Gradient));\nexport default RadialGradient;\n","import Point from './Point.js';\nvar extent = [0, 0];\nvar extent2 = [0, 0];\nvar minTv = new Point();\nvar maxTv = new Point();\nvar OrientedBoundingRect = (function () {\n function OrientedBoundingRect(rect, transform) {\n this._corners = [];\n this._axes = [];\n this._origin = [0, 0];\n for (var i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (var i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n var corners = this._corners;\n var axes = this._axes;\n var x = rect.x;\n var y = rect.y;\n var x2 = x + rect.width;\n var y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n if (transform) {\n for (var i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n for (var i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n };\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\n var overlapped = true;\n var noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\n var overlapped = true;\n for (var i = 0; i < 2; i++) {\n var axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n var axis = this._axes[dim];\n var origin = this._origin;\n var proj = corners[0].dot(axis) + origin[dim];\n var min = proj;\n var max = proj;\n for (var i = 1; i < corners.length; i++) {\n var proj_1 = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj_1, min);\n max = Math.max(proj_1, max);\n }\n out[0] = min;\n out[1] = max;\n };\n return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n","import { __extends } from \"tslib\";\nimport Displayble from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar m = [];\nvar IncrementalDisplayable = (function (_super) {\n __extends(IncrementalDisplayable, _super);\n function IncrementalDisplayable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.notClear = true;\n _this.incremental = true;\n _this._displayables = [];\n _this._temporaryDisplayables = [];\n _this._cursor = 0;\n return _this;\n }\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n IncrementalDisplayable.prototype.useStyle = function () {\n this.style = {};\n };\n IncrementalDisplayable.prototype.getCursor = function () {\n return this._cursor;\n };\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\n this._cursor = this._displayables.length;\n };\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n this.notClear = false;\n };\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n this._temporaryDisplayables = [];\n };\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n }\n else {\n this._displayables.push(displayable);\n }\n this.markRedraw();\n };\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n };\n IncrementalDisplayable.prototype.getDisplayables = function () {\n return this._displayables;\n };\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n return this._temporaryDisplayables;\n };\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n };\n IncrementalDisplayable.prototype.update = function () {\n this.updateTransform();\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n };\n IncrementalDisplayable.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n rect.union(childRect);\n }\n this._rect = rect;\n }\n return this._rect;\n };\n IncrementalDisplayable.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\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 if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n return false;\n };\n return IncrementalDisplayable;\n}(Displayble));\nexport default 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*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as pathTool from 'zrender/lib/tool/path.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport Circle from 'zrender/lib/graphic/shape/Circle.js';\nimport Ellipse from 'zrender/lib/graphic/shape/Ellipse.js';\nimport Sector from 'zrender/lib/graphic/shape/Sector.js';\nimport Ring from 'zrender/lib/graphic/shape/Ring.js';\nimport Polygon from 'zrender/lib/graphic/shape/Polygon.js';\nimport Polyline from 'zrender/lib/graphic/shape/Polyline.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport Line from 'zrender/lib/graphic/shape/Line.js';\nimport BezierCurve from 'zrender/lib/graphic/shape/BezierCurve.js';\nimport Arc from 'zrender/lib/graphic/shape/Arc.js';\nimport CompoundPath from 'zrender/lib/graphic/CompoundPath.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport RadialGradient from 'zrender/lib/graphic/RadialGradient.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport OrientedBoundingRect from 'zrender/lib/core/OrientedBoundingRect.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable.js';\nimport * as subPixelOptimizeUtil from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { extend, isArrayLike, map, defaults, isString, keys, each, hasOwn, isArray } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved } from '../animation/basicTransition.js';\n/**\r\n * @deprecated export for compatitable reason\r\n */\n\nexport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved };\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar _customShapeMap = {};\n/**\r\n * Extend shape with parameters\r\n */\n\nexport function extendShape(opts) {\n return Path.extend(opts);\n}\nvar extendPathFromString = pathTool.extendFromString;\n/**\r\n * Extend path\r\n */\n\nexport function extendPath(pathData, opts) {\n return extendPathFromString(pathData, opts);\n}\n/**\r\n * Register a user defined shape.\r\n * The shape class can be fetched by `getShapeClass`\r\n * This method will overwrite the registered shapes, including\r\n * the registered built-in shapes, if using the same `name`.\r\n * The shape can be used in `custom series` and\r\n * `graphic component` by declaring `{type: name}`.\r\n *\r\n * @param name\r\n * @param ShapeClass Can be generated by `extendShape`.\r\n */\n\nexport function registerShape(name, ShapeClass) {\n _customShapeMap[name] = ShapeClass;\n}\n/**\r\n * Find shape class registered by `registerShape`. Usually used in\r\n * fetching user defined shape.\r\n *\r\n * [Caution]:\r\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\r\n * to use user registered shapes.\r\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\r\n * `registerShape` by default. That enables users to get both built-in\r\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\r\n * the built-in shapes by using names like 'circle', 'rect' via calling\r\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\r\n * in case that it is overwritten by users, except that some features, like\r\n * `custom series`, `graphic component`, do it deliberately.\r\n *\r\n * (2) In the features like `custom series`, `graphic component`, the user input\r\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\r\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\r\n * are reserved names, that is, if some user registers a shape named `'image'`,\r\n * the shape will not be used. If we intending to add some more reserved names\r\n * in feature, that might bring break changes (disable some existing user shape\r\n * names). But that case probably rarely happens. So we don't make more mechanism\r\n * to resolve this issue here.\r\n *\r\n * @param name\r\n * @return The shape class. If not found, return nothing.\r\n */\n\nexport function getShapeClass(name) {\n if (_customShapeMap.hasOwnProperty(name)) {\n return _customShapeMap[name];\n }\n}\n/**\r\n * Create a path element from path data string\r\n * @param pathData\r\n * @param opts\r\n * @param rect\r\n * @param layout 'center' or 'cover' default to be cover\r\n */\n\nexport function 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/**\r\n * Create a image element from image url\r\n * @param imageUrl image url\r\n * @param opts options\r\n * @param rect constrain rect\r\n * @param layout 'center' or 'cover'. Default to be 'cover'\r\n */\n\nexport function makeImage(imageUrl, rect, layout) {\n var zrImg = new ZRImage({\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 zrImg.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return zrImg;\n}\n/**\r\n * Get position of centered element in bounding box.\r\n *\r\n * @param rect element local bounding box\r\n * @param boundingRect constraint bounding box\r\n * @return element position containing x, y, width, and height\r\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\nexport var mergePath = pathTool.mergePath;\n/**\r\n * Resize a path to fit the rect\r\n * @param path\r\n * @param rect\r\n */\n\nexport function 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/**\r\n * Sub pixel optimize line for canvas\r\n */\n\nexport function subPixelOptimizeLine(shape, lineWidth) {\n subPixelOptimizeUtil.subPixelOptimizeLine(shape, shape, {\n lineWidth: lineWidth\n });\n return shape;\n}\n/**\r\n * Sub pixel optimize rect for canvas\r\n */\n\nexport function subPixelOptimizeRect(param) {\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\n return param;\n}\n/**\r\n * Sub pixel optimize for canvas\r\n *\r\n * @param position Coordinate, such as x, y\r\n * @param lineWidth Should be nonnegative integer.\r\n * @param positiveOrNegative Default false (negative).\r\n * @return Optimized position.\r\n */\n\nexport var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n/**\r\n * Get transform matrix of target (param target),\r\n * in coordinate of its ancestor (param ancestor)\r\n *\r\n * @param target\r\n * @param [ancestor]\r\n */\n\nexport function 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/**\r\n * Apply transform to an vertex.\r\n * @param target [x, y]\r\n * @param transform Can be:\r\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\r\n * @param invert Whether use invert matrix.\r\n * @return [x, y]\r\n */\n\nexport function applyTransform(target, transform, invert) {\n if (transform && !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/**\r\n * @param direction 'left' 'right' 'top' 'bottom'\r\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * @param invert Whether use invert matrix.\r\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\r\n */\n\nexport function 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\nfunction isNotGroup(el) {\n return !el.isGroup;\n}\n\nfunction isPath(el) {\n return el.shape != null;\n}\n/**\r\n * Apply group transition animation from g1 to g2.\r\n * If no animatableModel, no animation.\r\n */\n\n\nexport function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n\n if (isPath(el)) {\n obj.shape = extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && 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, getECData(el).dataIndex);\n }\n }\n });\n}\nexport function clipPointsByRect(points, rect) {\n // FIXME: This way might be incorrect when graphic clipped by a corner\n // and when element has a border.\n return 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/**\r\n * Return a new clipped rect. If rect size are negative, return undefined.\r\n */\n\nexport function 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}\nexport function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path.\nopt, rect) {\n var innerOpts = extend({\n rectHover: true\n }, opt);\n var style = innerOpts.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), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');\n }\n}\n/**\r\n * Return `true` if the given line (line `a`) and the given polygon\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\n\nexport function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n var p = points[i];\n\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n return true;\n }\n\n p2 = p;\n }\n}\n/**\r\n * Return `true` if the given two lines (line `a` and line `b`)\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\n\nexport function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // existing `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n}\n/**\r\n * Cross product of 2-dimension vector.\r\n */\n\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction nearZero(val) {\n return val <= 1e-6 && val >= -1e-6;\n}\n\nexport function setTooltipConfig(opt) {\n var itemTooltipOption = opt.itemTooltipOption;\n var componentModel = opt.componentModel;\n var itemName = opt.itemName;\n var itemTooltipOptionObj = isString(itemTooltipOption) ? {\n formatter: itemTooltipOption\n } : itemTooltipOption;\n var mainType = componentModel.mainType;\n var componentIndex = componentModel.componentIndex;\n var formatterParams = {\n componentType: mainType,\n name: itemName,\n $vars: ['name']\n };\n formatterParams[mainType + 'Index'] = componentIndex;\n var formatterParamsExtra = opt.formatterParamsExtra;\n\n if (formatterParamsExtra) {\n each(keys(formatterParamsExtra), function (key) {\n if (!hasOwn(formatterParams, key)) {\n formatterParams[key] = formatterParamsExtra[key];\n formatterParams.$vars.push(key);\n }\n });\n }\n\n var ecData = getECData(opt.el);\n ecData.componentMainType = mainType;\n ecData.componentIndex = componentIndex;\n ecData.tooltipConfig = {\n name: itemName,\n option: defaults({\n content: itemName,\n formatterParams: formatterParams\n }, itemTooltipOptionObj)\n };\n}\n\nfunction traverseElement(el, cb) {\n var stopped; // TODO\n // Polyfill for fixing zrender group traverse don't visit it's root issue.\n\n if (el.isGroup) {\n stopped = cb(el);\n }\n\n if (!stopped) {\n el.traverse(cb);\n }\n}\n\nexport function traverseElements(els, cb) {\n if (els) {\n if (isArray(els)) {\n for (var i = 0; i < els.length; i++) {\n traverseElement(els[i], cb);\n }\n } else {\n traverseElement(els, cb);\n }\n }\n} // Register built-in shapes. These shapes might be overwritten\n// by users, although we do not recommend that.\n\nregisterShape('circle', Circle);\nregisterShape('ellipse', Ellipse);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexport { Group, ZRImage as Image, ZRText as Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect, OrientedBoundingRect, Point, Path };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nimport * as modelUtil from '../util/model.js';\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit, isHighDownDispatcher } from '../util/states.js';\nimport { createTask } from '../core/task.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { traverseElements } from '../util/graphic.js';\nimport { error } from '../util/log.js';\nvar inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\n\nvar ChartView =\n/** @class */\nfunction () {\n function ChartView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewChart');\n this.renderTask = createTask({\n plan: renderTaskPlan,\n reset: renderTaskReset\n });\n this.renderTask.context = {\n view: this\n };\n }\n\n ChartView.prototype.init = function (ecModel, api) {};\n\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('render method must been implemented');\n }\n };\n /**\r\n * Highlight series or specified data item.\r\n */\n\n\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n toggleHighlight(data, payload, 'emphasis');\n };\n /**\r\n * Downplay series or specified data item.\r\n */\n\n\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n toggleHighlight(data, payload, 'normal');\n };\n /**\r\n * Remove self.\r\n */\n\n\n ChartView.prototype.remove = function (ecModel, api) {\n this.group.removeAll();\n };\n /**\r\n * Dispose self.\r\n */\n\n\n ChartView.prototype.dispose = function (ecModel, api) {};\n\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\n\n\n ChartView.prototype.eachRendered = function (cb) {\n traverseElements(this.group, cb);\n };\n\n ChartView.markUpdateMethod = function (payload, methodName) {\n inner(payload).updateMethod = methodName;\n };\n\n ChartView.protoInitialize = function () {\n var proto = ChartView.prototype;\n proto.type = 'chart';\n }();\n\n return ChartView;\n}();\n\n;\n/**\r\n * Set state of single element\r\n */\n\nfunction elSetState(el, state, highlightDigit) {\n if (el && isHighDownDispatcher(el)) {\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\n }\n}\n\nfunction toggleHighlight(data, payload, state) {\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;\n\n if (dataIndex != null) {\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n });\n } else {\n data.eachItemGraphicEl(function (el) {\n elSetState(el, state, highlightDigit);\n });\n }\n}\n\nclazzUtil.enableClassExtend(ChartView, ['dispose']);\nclazzUtil.enableClassManagement(ChartView);\n\nfunction renderTaskPlan(context) {\n return renderPlanner(context.model);\n}\n\nfunction renderTaskReset(context) {\n var seriesModel = context.model;\n var ecModel = context.ecModel;\n var api = context.api;\n var payload = context.payload; // FIXME: remove updateView updateVisual\n\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n var view = context.view;\n var updateMethod = payload && inner(payload).updateMethod;\n var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount\n // is less than progressive threshold.\n : 'render';\n\n if (methodName !== 'render') {\n view[methodName](seriesModel, ecModel, api, payload);\n }\n\n return progressMethodMap[methodName];\n}\n\nvar progressMethodMap = {\n incrementalPrepareRender: {\n progress: function (params, context) {\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n }\n },\n render: {\n // Put view.render in `progress` to support appendData. But in this case\n // view.render should not be called in reset, otherwise it will be called\n // twise. Use `forceFirstProgress` to make sure that view.render is called\n // in any cases.\n forceFirstProgress: true,\n progress: function (params, context) {\n context.view.render(context.model, context.ecModel, context.api, context.payload);\n }\n }\n};\nexport default ChartView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n;\n/**\r\n * @public\r\n * @param {(Function)} fn\r\n * @param {number} [delay=0] Unit: ms.\r\n * @param {boolean} [debounce=false]\r\n * true: If call interval less than `delay`, only the last call works.\r\n * false: If call interval less than `delay, call works on fixed rate.\r\n * @return {(Function)} throttled fn.\r\n */\n\nexport function throttle(fn, delay, debounce) {\n var currCall;\n var lastCall = 0;\n var lastExec = 0;\n var timer = null;\n var diff;\n var scope;\n var args;\n var debounceNextCall;\n delay = delay || 0;\n\n function exec() {\n lastExec = new Date().getTime();\n timer = null;\n fn.apply(scope, args || []);\n }\n\n var cb = function () {\n var cbArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n cbArgs[_i] = arguments[_i];\n }\n\n currCall = new Date().getTime();\n scope = this;\n args = cbArgs;\n var thisDelay = debounceNextCall || delay;\n var thisDebounce = debounceNextCall || debounce;\n debounceNextCall = null;\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later\n // than a new call of `cb`, that is, preserving the command order. Consider\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n // happens, either the `exec` is called dierectly, or the call is delayed.\n // But the delayed call should never be later than next call of `cb`. Under\n // this assurance, we can simply update view state each time `dispatchAction`\n // triggered by user roaming, but not need to add extra code to avoid the\n // state being \"rolled-back\".\n\n if (thisDebounce) {\n timer = setTimeout(exec, thisDelay);\n } else {\n if (diff >= 0) {\n exec();\n } else {\n timer = setTimeout(exec, -diff);\n }\n }\n\n lastCall = currCall;\n };\n /**\r\n * Clear throttle.\r\n * @public\r\n */\n\n\n cb.clear = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n };\n /**\r\n * Enable debounce once.\r\n */\n\n\n cb.debounceNextCall = function (debounceDelay) {\n debounceNextCall = debounceDelay;\n };\n\n return cb;\n}\n/**\r\n * Create throttle method or update throttle rate.\r\n *\r\n * @example\r\n * ComponentView.prototype.render = function () {\r\n * ...\r\n * throttle.createOrUpdate(\r\n * this,\r\n * '_dispatchAction',\r\n * this.model.get('throttle'),\r\n * 'fixRate'\r\n * );\r\n * };\r\n * ComponentView.prototype.remove = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n * ComponentView.prototype.dispose = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n *\r\n */\n\nexport function createOrUpdate(obj, fnAttr, rate, throttleType) {\n var fn = obj[fnAttr];\n\n if (!fn) {\n return;\n }\n\n var originFn = fn[ORIGIN_METHOD] || fn;\n var lastThrottleType = fn[THROTTLE_TYPE];\n var lastRate = fn[RATE];\n\n if (lastRate !== rate || lastThrottleType !== throttleType) {\n if (rate == null || !throttleType) {\n return obj[fnAttr] = originFn;\n }\n\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n fn[ORIGIN_METHOD] = originFn;\n fn[THROTTLE_TYPE] = throttleType;\n fn[RATE] = rate;\n }\n\n return fn;\n}\n/**\r\n * Clear throttle. Example see throttle.createOrUpdate.\r\n */\n\nexport function clear(obj, fnAttr) {\n var fn = obj[fnAttr];\n\n if (fn && fn[ORIGIN_METHOD]) {\n // Clear throttle\n fn.clear && fn.clear();\n obj[fnAttr] = fn[ORIGIN_METHOD];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, extend, createHashMap } from 'zrender/lib/core/util.js';\nimport makeStyleMapper from '../model/mixin/makeStyleMapper.js';\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle.js';\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle.js';\nimport Model from '../model/Model.js';\nimport { makeInner } from '../util/model.js';\nvar inner = makeInner();\nvar defaultStyleMappers = {\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\n};\nvar defaultColorKey = {\n lineStyle: 'stroke',\n itemStyle: 'fill'\n};\n\nfunction getStyleMapper(seriesModel, stylePath) {\n var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];\n\n if (!styleMapper) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return defaultStyleMappers.itemStyle;\n }\n\n return styleMapper;\n}\n\nfunction getDefaultColorKey(seriesModel, stylePath) {\n // return defaultColorKey[stylePath] ||\n var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];\n\n if (!colorKey) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return 'fill';\n }\n\n return colorKey;\n}\n\nvar seriesStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var styleModel = seriesModel.getModel(stylePath);\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var globalStyle = getStyle(styleModel);\n var decalOption = styleModel.getShallow('decal');\n\n if (decalOption) {\n data.setVisual('decal', decalOption);\n decalOption.dirty = true;\n } // TODO\n\n\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n var color = globalStyle[colorKey]; // TODO style callback\n\n var colorCallback = isFunction(color) ? color : null;\n var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default.\n\n if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\n // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT\n // make it effect palette. Because some scenarios users need to make some series\n // transparent or as background, which should better not effect the palette.\n var colorPalette = seriesModel.getColorFromPalette( // TODO series count changed.\n seriesModel.name, null, ecModel.getSeriesCount());\n\n if (!globalStyle[colorKey]) {\n globalStyle[colorKey] = colorPalette;\n data.setVisual('colorFromPalette', true);\n }\n\n globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill;\n globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke;\n }\n\n data.setVisual('style', globalStyle);\n data.setVisual('drawType', colorKey); // Only visible series has each data be visual encoded\n\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\n data.setVisual('colorFromPalette', false);\n return {\n dataEach: function (data, idx) {\n var dataParams = seriesModel.getDataParams(idx);\n var itemStyle = extend({}, globalStyle);\n itemStyle[colorKey] = colorCallback(dataParams);\n data.setItemVisual(idx, 'style', itemStyle);\n }\n };\n }\n }\n};\nvar sharedModel = new Model();\nvar dataStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var colorKey = data.getVisual('drawType');\n return {\n dataEach: data.hasItemOption ? function (data, idx) {\n // Not use getItemModel for performance considuration\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem[stylePath]) {\n sharedModel.option = rawItem[stylePath];\n var style = getStyle(sharedModel);\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n if (sharedModel.option.decal) {\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\n sharedModel.option.decal.dirty = true;\n }\n\n if (colorKey in style) {\n data.setItemVisual(idx, 'colorFromPalette', false);\n }\n }\n } : null\n };\n }\n}; // Pick color from palette for the data which has not been set with color yet.\n// Note: do not support stream rendering. No such cases yet.\n\nvar dataColorPaletteTask = {\n performRawSeries: true,\n overallReset: function (ecModel) {\n // Each type of series uses one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var colorBy = seriesModel.getColorBy();\n\n if (seriesModel.isColorBySeries()) {\n return;\n }\n\n var key = seriesModel.type + '-' + colorBy;\n var colorScope = paletteScopeGroupByType.get(key);\n\n if (!colorScope) {\n colorScope = {};\n paletteScopeGroupByType.set(key, colorScope);\n }\n\n inner(seriesModel).scope = colorScope;\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n var colorScope = inner(seriesModel).scope;\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n }); // Iterate on data before filtered. To make sure color from palette can be\n // Consistent when toggling legend.\n\n dataAll.each(function (rawIdx) {\n var idx = idxMap[rawIdx];\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); // Get color from palette for each data only when the color is inherited from series color, which is\n // also picked from color palette. So following situation is not in the case:\n // 1. series.itemStyle.color is set\n // 2. color is encoded by visualMap\n\n if (fromPalette) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n var name_1 = dataAll.getName(rawIdx) || rawIdx + '';\n var dataCount = dataAll.count();\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\n }\n });\n });\n }\n};\nexport { seriesStyleTask, dataStyleTask, dataColorPaletteTask };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../util/graphic.js';\nvar PI = Math.PI;\n/**\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Object} [opts]\r\n * @param {string} [opts.text]\r\n * @param {string} [opts.color]\r\n * @param {string} [opts.textColor]\r\n * @return {module:zrender/Element}\r\n */\n\nexport default function defaultLoading(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: 12,\n fontWeight: 'normal',\n fontStyle: 'normal',\n fontFamily: 'sans-serif',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#5470c6',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var textContent = new graphic.Text({\n style: {\n text: opts.text,\n fill: opts.textColor,\n fontSize: opts.fontSize,\n fontWeight: opts.fontWeight,\n fontStyle: opts.fontStyle,\n fontFamily: opts.fontFamily\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none'\n },\n textContent: textContent,\n textConfig: {\n position: 'right',\n distance: 10\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n var arc;\n\n if (opts.showSpinner) {\n arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n } // Inject resize\n\n\n group.resize = function () {\n var textWidth = textContent.getBoundingRect().width;\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\n + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\n + (textWidth ? 0 : r);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n group.resize();\n return group;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util.js';\nimport { createTask } from './task.js';\nimport { getUID } from '../util/component.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport { normalizeToArray } from '../util/model.js';\n;\n\nvar Scheduler =\n/** @class */\nfunction () {\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n // key: handlerUID\n this._stageTaskMap = createHashMap();\n this.ecInstance = ecInstance;\n this.api = api; // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n }\n\n Scheduler.prototype.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n }; // If seriesModel provided, incremental threshold is check by series data.\n\n\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n };\n\n Scheduler.prototype.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n };\n /**\r\n * Current, progressive rendering starts from visual and layout.\r\n * Always detect render mode in the same stage, avoiding that incorrect\r\n * detection caused by data filtering.\r\n * Caution:\r\n * `updateStreamModes` use `seriesModel.getData()`.\r\n */\n\n\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n\n var data = seriesModel.getData();\n var dataLen = data.count(); // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n };\n\n Scheduler.prototype.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n\n scheduler._pipe(seriesModel, seriesModel.dataTask);\n });\n };\n\n Scheduler.prototype.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.api.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Currently do not need to support to sepecify them both.\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n }\n\n assert(!(handler.reset && handler.overallReset), errMsg);\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n }, this);\n };\n\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n\n this._pipe(model, renderTask);\n };\n\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n };\n\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n };\n\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished = false;\n var scheduler = this;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n\n if (overallTask) {\n var overallNeedDirty_1;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty_1 = true;\n }\n });\n overallNeedDirty_1 && overallTask.dirty();\n scheduler.updatePayload(overallTask, payload);\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n\n agentStubMap.each(function (stub) {\n stub.perform(performArgs_1);\n });\n\n if (overallTask.perform(performArgs_1)) {\n unfinished = true;\n }\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n\n var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME\n // if intending to declare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because if a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operations\n // and stream-independent operations should better not be mixed.\n\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n scheduler.updatePayload(task, payload);\n\n if (task.perform(performArgs)) {\n unfinished = true;\n }\n });\n }\n });\n\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished = seriesModel.dataTask.perform() || unfinished;\n });\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n\n task = task.getUpstream();\n } while (task);\n });\n };\n\n Scheduler.prototype.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n };\n\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n\n function create(seriesModel) {\n var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n // PENDING: `useClearVisual` not used?\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n\n scheduler._pipe(seriesModel, task);\n }\n };\n\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n };\n var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '\"createOnAllSeries\" is not supported for \"overallReset\", ' + 'because it will block all streams.';\n }\n\n assert(!stageHandler.createOnAllSeries, errMsg);\n\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n } // Otherwise, (usually it is legacy case), the overall task will only be\n // executed when upstream is dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upstream.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n shouldOverallTaskDirty = true, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })));\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress // FIXME:TS never used, so comment it\n // modifyOutputEnd: modifyOutputEnd\n\n };\n stub.agent = overallTask;\n stub.__block = overallProgress;\n\n scheduler._pipe(seriesModel, stub);\n }\n\n if (shouldOverallTaskDirty) {\n overallTask.dirty();\n }\n };\n\n Scheduler.prototype._pipe = function (seriesModel, task) {\n var pipelineId = seriesModel.uid;\n\n var pipeline = this._pipelineMap.get(pipelineId);\n\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n };\n\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n };\n\n ;\n return Scheduler;\n}();\n\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\n\nfunction stubReset(context) {\n return context.overallProgress && stubProgress;\n}\n\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\n\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\n\nfunction seriesTaskPlan(context) {\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\n\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\n\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\n\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\n\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n/**\r\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\r\n * To ensure that they can work normally, they should work in block mode, that is,\r\n * they should not be started util the previous tasks finished. So they cause the\r\n * progressive rendering disabled. We try to detect the series type, to narrow down\r\n * the block range to only the series type they concern, but not all series.\r\n */\n\n\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return seriesType;\n}\n\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\n\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\n\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\n\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name_1 in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name_1] = noop;\n }\n /* eslint-enable */\n\n}\n\nexport default Scheduler;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];\nexport default {\n color: colorAll,\n colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll]\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar contrastColor = '#B9B8CE';\nvar backgroundColor = '#100C2A';\n\nvar axisCommon = function () {\n return {\n axisLine: {\n lineStyle: {\n color: contrastColor\n }\n },\n splitLine: {\n lineStyle: {\n color: '#484753'\n }\n },\n splitArea: {\n areaStyle: {\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\n }\n },\n minorSplitLine: {\n lineStyle: {\n color: '#20203B'\n }\n }\n };\n};\n\nvar colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff'];\nvar theme = {\n darkMode: true,\n color: colorPalette,\n backgroundColor: backgroundColor,\n axisPointer: {\n lineStyle: {\n color: '#817f91'\n },\n crossStyle: {\n color: '#817f91'\n },\n label: {\n // TODO Contrast of label backgorundColor\n color: '#fff'\n }\n },\n legend: {\n textStyle: {\n color: contrastColor\n }\n },\n textStyle: {\n color: contrastColor\n },\n title: {\n textStyle: {\n color: '#EEF1FA'\n },\n subtextStyle: {\n color: '#B9B8CE'\n }\n },\n toolbox: {\n iconStyle: {\n borderColor: contrastColor\n }\n },\n dataZoom: {\n borderColor: '#71708A',\n textStyle: {\n color: contrastColor\n },\n brushStyle: {\n color: 'rgba(135,163,206,0.3)'\n },\n handleStyle: {\n color: '#353450',\n borderColor: '#C5CBE3'\n },\n moveHandleStyle: {\n color: '#B0B6C3',\n opacity: 0.3\n },\n fillerColor: 'rgba(135,163,206,0.2)',\n emphasis: {\n handleStyle: {\n borderColor: '#91B7F2',\n color: '#4D587D'\n },\n moveHandleStyle: {\n color: '#636D9A',\n opacity: 0.7\n }\n },\n dataBackground: {\n lineStyle: {\n color: '#71708A',\n width: 1\n },\n areaStyle: {\n color: '#71708A'\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#87A3CE'\n },\n areaStyle: {\n color: '#87A3CE'\n }\n }\n },\n visualMap: {\n textStyle: {\n color: contrastColor\n }\n },\n timeline: {\n lineStyle: {\n color: contrastColor\n },\n label: {\n color: contrastColor\n },\n controlStyle: {\n color: contrastColor,\n borderColor: contrastColor\n }\n },\n calendar: {\n itemStyle: {\n color: backgroundColor\n },\n dayLabel: {\n color: contrastColor\n },\n monthLabel: {\n color: contrastColor\n },\n yearLabel: {\n color: contrastColor\n }\n },\n timeAxis: axisCommon(),\n logAxis: axisCommon(),\n valueAxis: axisCommon(),\n categoryAxis: axisCommon(),\n line: {\n symbol: 'circle'\n },\n graph: {\n color: colorPalette\n },\n gauge: {\n title: {\n color: contrastColor\n },\n axisLine: {\n lineStyle: {\n color: [[1, 'rgba(207,212,219,0.2)']]\n }\n },\n axisLabel: {\n color: contrastColor\n },\n detail: {\n color: '#EEF1FA'\n }\n },\n candlestick: {\n itemStyle: {\n color: '#f64e56',\n color0: '#54ea92',\n borderColor: '#f64e56',\n borderColor0: '#54ea92' // borderColor: '#ca2824',\n // borderColor0: '#09a443'\n\n }\n }\n};\ntheme.categoryAxis.splitLine.show = false;\nexport default theme;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\n/**\r\n * Usage of query:\r\n * `chart.on('click', query, handler);`\r\n * The `query` can be:\r\n * + The component type query string, only `mainType` or `mainType.subType`,\r\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\r\n * + The component query object, like:\r\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\r\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\r\n * + The data query object, like:\r\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\r\n * + The other query object (cmponent customized query), like:\r\n * `{element: 'some'}` (only available in custom series).\r\n *\r\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\r\n * same as there is no such prop in the `query` object.\r\n */\n\nvar ECEventProcessor =\n/** @class */\nfunction () {\n function ECEventProcessor() {}\n\n ECEventProcessor.prototype.normalizeQuery = function (query) {\n var cptQuery = {};\n var dataQuery = {};\n var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component.\n\n if (zrUtil.isString(query)) {\n var condCptType = parseClassType(query); // `.main` and `.sub` may be ''.\n\n cptQuery.mainType = condCptType.main || null;\n cptQuery.subType = condCptType.sub || null;\n } // `query` is an object, convert to {mainType, index, name, id}.\n else {\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n // can not be used in `compomentModel.filterForExposedEvent`.\n var suffixes_1 = ['Index', 'Name', 'Id'];\n var dataKeys_1 = {\n name: 1,\n dataIndex: 1,\n dataType: 1\n };\n zrUtil.each(query, function (val, key) {\n var reserved = false;\n\n for (var i = 0; i < suffixes_1.length; i++) {\n var propSuffix = suffixes_1[i];\n var suffixPos = key.lastIndexOf(propSuffix);\n\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n var mainType = key.slice(0, suffixPos); // Consider `dataIndex`.\n\n if (mainType !== 'data') {\n cptQuery.mainType = mainType;\n cptQuery[propSuffix.toLowerCase()] = val;\n reserved = true;\n }\n }\n }\n\n if (dataKeys_1.hasOwnProperty(key)) {\n dataQuery[key] = val;\n reserved = true;\n }\n\n if (!reserved) {\n otherQuery[key] = val;\n }\n });\n }\n\n return {\n cptQuery: cptQuery,\n dataQuery: dataQuery,\n otherQuery: otherQuery\n };\n };\n\n ECEventProcessor.prototype.filter = function (eventType, query) {\n // They should be assigned before each trigger call.\n var eventInfo = this.eventInfo;\n\n if (!eventInfo) {\n return true;\n }\n\n var targetEl = eventInfo.targetEl;\n var packedEvent = eventInfo.packedEvent;\n var model = eventInfo.model;\n var view = eventInfo.view; // For event like 'globalout'.\n\n if (!model || !view) {\n return true;\n }\n\n var cptQuery = query.cptQuery;\n var dataQuery = query.dataQuery;\n 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));\n\n function check(query, host, prop, propOnHost) {\n return query[prop] == null || host[propOnHost || prop] === query[prop];\n }\n };\n\n ECEventProcessor.prototype.afterTrigger = function () {\n // Make sure the eventInfo won't be used in next trigger.\n this.eventInfo = null;\n };\n\n return ECEventProcessor;\n}();\n\nexport { ECEventProcessor };\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, isFunction, keys } from 'zrender/lib/core/util.js';\nvar SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset'];\nvar SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']); // Encoding visual for all series include which is filtered for legend drawing\n\nvar seriesSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n\n if (seriesModel.legendIcon) {\n data.setVisual('legendIcon', seriesModel.legendIcon);\n }\n\n if (!seriesModel.hasSymbolVisual) {\n return;\n }\n\n var symbolOptions = {};\n var symbolOptionsCb = {};\n var hasCallback = false;\n\n for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) {\n var symbolPropName = SYMBOL_PROPS_WITH_CB[i];\n var val = seriesModel.get(symbolPropName);\n\n if (isFunction(val)) {\n hasCallback = true;\n symbolOptionsCb[symbolPropName] = val;\n } else {\n symbolOptions[symbolPropName] = val;\n }\n }\n\n symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;\n data.setVisual(extend({\n legendIcon: seriesModel.legendIcon || symbolOptions.symbol,\n symbolKeepAspect: seriesModel.get('symbolKeepAspect')\n }, symbolOptions)); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var symbolPropsCb = keys(symbolOptionsCb);\n\n function dataEach(data, idx) {\n var rawValue = seriesModel.getRawValue(idx);\n var params = seriesModel.getDataParams(idx);\n\n for (var i = 0; i < symbolPropsCb.length; i++) {\n var symbolPropName = symbolPropsCb[i];\n data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params));\n }\n }\n\n return {\n dataEach: hasCallback ? dataEach : null\n };\n }\n};\nvar dataSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (!seriesModel.hasSymbolVisual) {\n return;\n } // Only visible series has each data be visual encoded\n\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n\n for (var i = 0; i < SYMBOL_PROPS.length; i++) {\n var symbolPropName = SYMBOL_PROPS[i];\n var val = itemModel.getShallow(symbolPropName, true);\n\n if (val != null) {\n data.setItemVisual(idx, symbolPropName, val);\n }\n }\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport { seriesSymbolTask, dataSymbolTask };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function getItemVisualFromData(data, dataIndex, key) {\n switch (key) {\n case 'color':\n var style = data.getItemVisual(dataIndex, 'style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getItemVisual(dataIndex, 'style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getItemVisual(dataIndex, key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function getVisualFromData(data, key) {\n switch (key) {\n case 'color':\n var style = data.getVisual('style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getVisual('style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getVisual(key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function setItemVisualFromData(data, dataIndex, key, value) {\n switch (key) {\n case 'color':\n // Make sure not sharing style object.\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\n style[data.getVisual('drawType')] = value; // Mark the color has been changed, not from palette anymore\n\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\n break;\n\n case 'opacity':\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\n break;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n data.setItemVisual(dataIndex, key, value);\n break;\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, each, isArray, isString } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog, deprecateLog } from '../util/log.js';\nimport { queryDataIndex } from '../util/model.js'; // Legacy data selection action.\n// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\n\nexport function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\n function getSeriesIndices(ecModel, payload) {\n var seriesIndices = [];\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n seriesIndices.push(seriesModel.seriesIndex);\n });\n return seriesIndices;\n }\n\n each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(payload.type, eventsMap[1]);\n }\n\n api.dispatchAction(extend(payload, {\n type: eventsMap[1],\n seriesIndex: getSeriesIndices(ecModel, payload)\n }));\n });\n });\n}\n\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\n var legacyEventName = type + eventPostfix;\n\n if (!ecIns.isSilent(legacyEventName)) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\n }\n\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'pie'\n }, function (seriesModel) {\n var seriesIndex = seriesModel.seriesIndex;\n var selectedMap = seriesModel.option.selectedMap;\n var selected = payload.selected;\n\n for (var i = 0; i < selected.length; i++) {\n if (selected[i].seriesIndex === seriesIndex) {\n var data = seriesModel.getData();\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\n ecIns.trigger(legacyEventName, {\n type: legacyEventName,\n seriesId: seriesModel.id,\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\n selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)\n });\n }\n }\n });\n }\n}\n\nexport function handleLegacySelectEvents(messageCenter, ecIns, api) {\n messageCenter.on('selectchanged', function (params) {\n var ecModel = api.getModel();\n\n if (params.isFromClick) {\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\n } else if (params.fromAction === 'select') {\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\n } else if (params.fromAction === 'unselect') {\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function findEventDispatcher(target, det, returnFirstMatch) {\n var found;\n\n while (target) {\n if (det(target)) {\n found = target;\n\n if (returnFirstMatch) {\n break;\n }\n }\n\n target = target.__hostTarget || target.parent;\n }\n\n return found;\n}","var wmUniqueIndex = Math.round(Math.random() * 9);\nvar supportDefineProperty = typeof Object.defineProperty === 'function';\nvar WeakMap = (function () {\n function WeakMap() {\n this._id = '__ec_inner_' + wmUniqueIndex++;\n }\n WeakMap.prototype.get = function (key) {\n return this._guard(key)[this._id];\n };\n WeakMap.prototype.set = function (key, value) {\n var target = this._guard(key);\n if (supportDefineProperty) {\n Object.defineProperty(target, this._id, {\n value: value,\n enumerable: false,\n configurable: true\n });\n }\n else {\n target[this._id] = value;\n }\n return this;\n };\n WeakMap.prototype[\"delete\"] = function (key) {\n if (this.has(key)) {\n delete this._guard(key)[this._id];\n return true;\n }\n return false;\n };\n WeakMap.prototype.has = function (key) {\n return !!this._guard(key)[this._id];\n };\n WeakMap.prototype._guard = function (key) {\n if (key !== Object(key)) {\n throw TypeError('Value of WeakMap is not a non-null object.');\n }\n return key;\n };\n return WeakMap;\n}());\nexport default WeakMap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Symbol factory\nimport { each, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from './graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { parsePercent } from './number.js';\n/**\r\n * Triangle shape\r\n * @inner\r\n */\n\nvar Triangle = graphic.Path.extend({\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/**\r\n * Diamond shape\r\n * @inner\r\n */\n\nvar Diamond = graphic.Path.extend({\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/**\r\n * Pin shape\r\n * @inner\r\n */\n\nvar Pin = graphic.Path.extend({\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/**\r\n * Arrow shape\r\n * @inner\r\n */\n\nvar Arrow = graphic.Path.extend({\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/**\r\n * Map of path constructors\r\n */\n// TODO Use function to build symbol path.\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 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};\nexport var symbolBuildProxies = {};\neach(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, config, rect) {\n var res = calculateTextPosition(out, config, rect);\n var shape = this.shape;\n\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n\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\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView\n\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n\n this.markRedraw();\n }\n}\n/**\r\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\r\n */\n\n\nexport function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\nkeepAspect) {\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; // TODO Should deprecate setColor\n\n symbolPath.setColor = symbolPathSetColor;\n\n if (color) {\n symbolPath.setColor(color);\n }\n\n return symbolPath;\n}\nexport function normalizeSymbolSize(symbolSize) {\n if (!isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return [symbolSize[0] || 0, symbolSize[1] || 0];\n}\nexport function normalizeSymbolOffset(symbolOffset, symbolSize) {\n if (symbolOffset == null) {\n return;\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n\n return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];\n}","function isSafeNum(num) {\n return isFinite(num);\n}\nexport function 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 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 }\n x = isSafeNum(x) ? x : 0;\n x2 = isSafeNum(x2) ? x2 : 1;\n y = isSafeNum(y) ? y : 0;\n y2 = isSafeNum(y2) ? y2 : 0;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\nexport function 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 if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n x = isSafeNum(x) ? x : 0.5;\n y = isSafeNum(y) ? y : 0.5;\n r = r >= 0 && isSafeNum(r) ? r : 0.5;\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\nexport function getCanvasGradient(ctx, obj, rect) {\n var canvasGradient = obj.type === 'radial'\n ? createRadialGradient(ctx, obj, rect)\n : createLinearGradient(ctx, obj, rect);\n var colorStops = obj.colorStops;\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n return canvasGradient;\n}\nexport function isClipPathChanged(clipPaths, prevClipPaths) {\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n return false;\n }\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n return true;\n }\n for (var i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n return false;\n}\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\nexport function getSize(root, whIdx, opts) {\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n var stl = document.defaultView.getComputedStyle(root);\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)) | 0;\n}\n","import { isArray, isNumber, map } from '../core/util.js';\nexport function normalizeLineDash(lineType, lineWidth) {\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n return null;\n }\n return lineType === 'dashed'\n ? [4 * lineWidth, 2 * lineWidth]\n : lineType === 'dotted'\n ? [lineWidth]\n : isNumber(lineType)\n ? [lineType] : isArray(lineType) ? lineType : null;\n}\nexport function getLineDash(el) {\n var style = el.style;\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n var lineDashOffset = style.lineDashOffset;\n if (lineDash) {\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale_1 && lineScale_1 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale_1;\n });\n lineDashOffset /= lineScale_1;\n }\n }\n return [lineDash, lineDashOffset];\n}\n","import { DEFAULT_COMMON_STYLE } from '../graphic/Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image.js';\nimport { getCanvasGradient, isClipPathChanged } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { RADIAN_TO_DEGREE } from '../core/util.js';\nimport { getLineDash } from './dashStyle.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT } from '../graphic/constants.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nvar pathProxyForDraw = new PathProxy(true);\nfunction styleHasStroke(style) {\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\nfunction isValidStrokeFillStyle(strokeOrFill) {\n return typeof strokeOrFill === 'string' && strokeOrFill !== 'none';\n}\nfunction styleHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx, style) {\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.fill();\n }\n}\nfunction doStrokePath(ctx, style) {\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.stroke();\n }\n}\nexport function createCanvasPattern(ctx, pattern, el) {\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\n if (isImageReady(image)) {\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n if (typeof DOMMatrix === 'function'\n && canvasPattern\n && canvasPattern.setTransform) {\n var matrix = new DOMMatrix();\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n canvasPattern.setTransform(matrix);\n }\n return canvasPattern;\n }\n}\nfunction brushPath(ctx, el, style, inBatch) {\n var _a;\n var hasStroke = styleHasStroke(style);\n var hasFill = styleHasFill(style);\n var strokePercent = style.strokePercent;\n var strokePart = strokePercent < 1;\n var firstDraw = !el.path;\n if ((!el.silent || strokePart) && firstDraw) {\n el.createPathProxy();\n }\n var path = el.path || pathProxyForDraw;\n var dirtyFlag = el.__dirty;\n if (!inBatch) {\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 var fillGradient = void 0;\n var strokeGradient = void 0;\n var fillPattern = void 0;\n var strokePattern = void 0;\n var rect = void 0;\n if (hasFillGradient || hasStrokeGradient) {\n rect = el.getBoundingRect();\n }\n if (hasFillGradient) {\n fillGradient = dirtyFlag\n ? getCanvasGradient(ctx, fill, rect)\n : el.__canvasFillGradient;\n el.__canvasFillGradient = fillGradient;\n }\n if (hasStrokeGradient) {\n strokeGradient = dirtyFlag\n ? getCanvasGradient(ctx, stroke, rect)\n : el.__canvasStrokeGradient;\n el.__canvasStrokeGradient = strokeGradient;\n }\n if (hasFillPattern) {\n fillPattern = (dirtyFlag || !el.__canvasFillPattern)\n ? createCanvasPattern(ctx, fill, el)\n : el.__canvasFillPattern;\n el.__canvasFillPattern = fillPattern;\n }\n if (hasStrokePattern) {\n strokePattern = (dirtyFlag || !el.__canvasStrokePattern)\n ? createCanvasPattern(ctx, stroke, el)\n : el.__canvasStrokePattern;\n el.__canvasStrokePattern = fillPattern;\n }\n if (hasFillGradient) {\n ctx.fillStyle = fillGradient;\n }\n else if (hasFillPattern) {\n if (fillPattern) {\n ctx.fillStyle = fillPattern;\n }\n else {\n hasFill = false;\n }\n }\n if (hasStrokeGradient) {\n ctx.strokeStyle = strokeGradient;\n }\n else if (hasStrokePattern) {\n if (strokePattern) {\n ctx.strokeStyle = strokePattern;\n }\n else {\n hasStroke = false;\n }\n }\n }\n var scale = el.getGlobalScale();\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n var lineDash;\n var lineDashOffset;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n var needsRebuild = true;\n if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) {\n path.setDPR(ctx.dpr);\n if (strokePart) {\n path.setContext(null);\n }\n else {\n path.setContext(ctx);\n needsRebuild = false;\n }\n path.reset();\n el.buildPath(path, el.shape, inBatch);\n path.toStatic();\n el.pathUpdated();\n }\n if (needsRebuild) {\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (!inBatch) {\n if (style.strokeFirst) {\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n if (hasFill) {\n doFillPath(ctx, style);\n }\n }\n else {\n if (hasFill) {\n doFillPath(ctx, style);\n }\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n}\nfunction brushImage(ctx, el, style) {\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\n if (!image || !isImageReady(image)) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var width = el.getWidth();\n var height = el.getHeight();\n var aspect = image.width / image.height;\n if (width == null && height != null) {\n width = height * aspect;\n }\n else if (height == null && width != null) {\n height = width / aspect;\n }\n else if (width == null && height == null) {\n width = image.width;\n height = image.height;\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 }\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 }\n else {\n ctx.drawImage(image, x, y, width, height);\n }\n}\nfunction brushText(ctx, el, style) {\n var _a;\n var text = style.text;\n text != null && (text += '');\n if (text) {\n ctx.font = style.font || DEFAULT_FONT;\n ctx.textAlign = style.textAlign;\n ctx.textBaseline = style.textBaseline;\n var lineDash = void 0;\n var lineDashOffset = void 0;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (style.strokeFirst) {\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n }\n else {\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n }\n}\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nvar STROKE_PROPS = [\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n];\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\n var styleChanged = false;\n if (!forceSetAll) {\n prevStyle = prevStyle || {};\n if (style === prevStyle) {\n return false;\n }\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n var opacity = Math.max(Math.min(style.opacity, 1), 0);\n ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n }\n if (forceSetAll || style.blend !== prevStyle.blend) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n }\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n var propName = SHADOW_NUMBER_PROPS[i];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = ctx.dpr * (style[propName] || 0);\n }\n }\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n }\n return styleChanged;\n}\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\n var style = getStyle(el, scope.inHover);\n var prevStyle = forceSetAll\n ? null\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\n if (style === prevStyle) {\n return false;\n }\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n if (forceSetAll || style.fill !== prevStyle.fill) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);\n }\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n if (el.hasStroke()) {\n var lineWidth = style.lineWidth;\n var newLineWidth = lineWidth / ((style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1);\n if (ctx.lineWidth !== newLineWidth) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.lineWidth = newLineWidth;\n }\n }\n for (var i = 0; i < STROKE_PROPS.length; i++) {\n var prop = STROKE_PROPS[i];\n var propName = prop[0];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = style[propName] || prop[1];\n }\n }\n return styleChanged;\n}\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\n}\nfunction setContextTransform(ctx, el) {\n var m = el.transform;\n var dpr = ctx.dpr || 1;\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 }\n else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n}\nfunction updateClipStatus(clipPaths, ctx, scope) {\n var allClipped = false;\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n allClipped = allClipped || clipPath.isZeroArea();\n setContextTransform(ctx, clipPath);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip();\n }\n scope.allClipped = allClipped;\n}\nfunction isTransformChanged(m0, m1) {\n if (m0 && m1) {\n return m0[0] !== m1[0]\n || m0[1] !== m1[1]\n || m0[2] !== m1[2]\n || m0[3] !== m1[3]\n || m0[4] !== m1[4]\n || m0[5] !== m1[5];\n }\n else if (!m0 && !m1) {\n return false;\n }\n return true;\n}\nvar DRAW_TYPE_PATH = 1;\nvar DRAW_TYPE_IMAGE = 2;\nvar DRAW_TYPE_TEXT = 3;\nvar DRAW_TYPE_INCREMENTAL = 4;\nfunction canPathBatch(style) {\n var hasFill = styleHasFill(style);\n var hasStroke = styleHasStroke(style);\n return !(style.lineDash\n || !(+hasFill ^ +hasStroke)\n || (hasFill && typeof style.fill !== 'string')\n || (hasStroke && typeof style.stroke !== 'string')\n || style.strokePercent < 1\n || style.strokeOpacity < 1\n || style.fillOpacity < 1);\n}\nfunction flushPathDrawn(ctx, scope) {\n scope.batchFill && ctx.fill();\n scope.batchStroke && ctx.stroke();\n scope.batchFill = '';\n scope.batchStroke = '';\n}\nfunction getStyle(el, inHover) {\n return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\nexport function brushSingle(ctx, el) {\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\nexport function brush(ctx, el, scope, isLast) {\n var m = el.transform;\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n el.__dirty &= ~REDRAW_BIT;\n el.__isRendered = false;\n return;\n }\n var clipPaths = el.__clipPaths;\n var prevElClipPaths = scope.prevElClipPaths;\n var forceSetTransform = false;\n var forceSetStyle = false;\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n if (prevElClipPaths && prevElClipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.restore();\n forceSetStyle = forceSetTransform = true;\n scope.prevElClipPaths = null;\n scope.allClipped = false;\n scope.prevEl = null;\n }\n if (clipPaths && clipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.save();\n updateClipStatus(clipPaths, ctx, scope);\n forceSetTransform = true;\n }\n scope.prevElClipPaths = clipPaths;\n }\n if (scope.allClipped) {\n el.__isRendered = false;\n return;\n }\n el.beforeBrush && el.beforeBrush();\n el.innerBeforeBrush();\n var prevEl = scope.prevEl;\n if (!prevEl) {\n forceSetStyle = forceSetTransform = true;\n }\n var canBatchPath = el instanceof Path\n && el.autoBatch\n && canPathBatch(el.style);\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n flushPathDrawn(ctx, scope);\n setContextTransform(ctx, el);\n }\n else if (!canBatchPath) {\n flushPathDrawn(ctx, scope);\n }\n var style = getStyle(el, scope.inHover);\n if (el instanceof Path) {\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_PATH;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n ctx.beginPath();\n }\n brushPath(ctx, el, style, canBatchPath);\n if (canBatchPath) {\n scope.batchFill = style.fill || '';\n scope.batchStroke = style.stroke || '';\n }\n }\n else {\n if (el instanceof TSpan) {\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_TEXT;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushText(ctx, el, style);\n }\n else if (el instanceof ZRImage) {\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_IMAGE;\n }\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushImage(ctx, el, style);\n }\n else if (el.getTemporalDisplayables) {\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n }\n brushIncremental(ctx, el, scope);\n }\n }\n if (canBatchPath && isLast) {\n flushPathDrawn(ctx, scope);\n }\n el.innerAfterBrush();\n el.afterBrush && el.afterBrush();\n scope.prevEl = el;\n el.__dirty = 0;\n el.__isRendered = true;\n}\nfunction brushIncremental(ctx, el, scope) {\n var displayables = el.getDisplayables();\n var temporalDisplayables = el.getTemporalDisplayables();\n ctx.save();\n var innerScope = {\n prevElClipPaths: null,\n prevEl: null,\n allClipped: false,\n viewWidth: scope.viewWidth,\n viewHeight: scope.viewHeight,\n inHover: scope.inHover\n };\n var i;\n var len;\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n var displayable = displayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\n var displayable = temporalDisplayables[i_1];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n el.clearTemporalDisplayables();\n el.notClear = true;\n ctx.restore();\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport WeakMap from 'zrender/lib/core/WeakMap.js';\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { defaults, map, isArray, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { getLeastCommonMultiple } from './number.js';\nimport { createSymbol } from './symbol.js';\nimport { brushSingle } from 'zrender/lib/canvas/graphic.js';\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar decalMap = new WeakMap();\nvar decalCache = new LRU(100);\nvar decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight'];\n/**\r\n * Create or update pattern image from decal options\r\n *\r\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\r\n * @return {Pattern} pattern with generated image, null if no decal\r\n */\n\nexport function createOrUpdatePatternFromDecal(decalObject, api) {\n if (decalObject === 'none') {\n return null;\n }\n\n var dpr = api.getDevicePixelRatio();\n var zr = api.getZr();\n var isSVG = zr.painter.type === 'svg';\n\n if (decalObject.dirty) {\n decalMap[\"delete\"](decalObject);\n }\n\n var oldPattern = decalMap.get(decalObject);\n\n if (oldPattern) {\n return oldPattern;\n }\n\n var decalOpt = defaults(decalObject, {\n symbol: 'rect',\n symbolSize: 1,\n symbolKeepAspect: true,\n color: 'rgba(0, 0, 0, 0.2)',\n backgroundColor: null,\n dashArrayX: 5,\n dashArrayY: 5,\n rotation: 0,\n maxTileWidth: 512,\n maxTileHeight: 512\n });\n\n if (decalOpt.backgroundColor === 'none') {\n decalOpt.backgroundColor = null;\n }\n\n var pattern = {\n repeat: 'repeat'\n };\n setPatternnSource(pattern);\n pattern.rotation = decalOpt.rotation;\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\n decalMap.set(decalObject, pattern);\n decalObject.dirty = false;\n return pattern;\n\n function setPatternnSource(pattern) {\n var keys = [dpr];\n var isValidKey = true;\n\n for (var i = 0; i < decalKeys.length; ++i) {\n var value = decalOpt[decalKeys[i]];\n\n if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') {\n isValidKey = false;\n break;\n }\n\n keys.push(value);\n }\n\n var cacheKey;\n\n if (isValidKey) {\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\n var cache = decalCache.get(cacheKey);\n\n if (cache) {\n isSVG ? pattern.svgElement = cache : pattern.image = cache;\n }\n }\n\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\n var canvas = !isSVG && platformApi.createCanvas();\n var svgRoot = isSVG && {\n tag: 'g',\n attrs: {},\n key: 'dcl',\n children: []\n };\n var pSize = getPatternSize();\n var ctx;\n\n if (canvas) {\n canvas.width = pSize.width * dpr;\n canvas.height = pSize.height * dpr;\n ctx = canvas.getContext('2d');\n }\n\n brushDecal();\n\n if (isValidKey) {\n decalCache.put(cacheKey, canvas || svgRoot);\n }\n\n pattern.image = canvas;\n pattern.svgElement = svgRoot;\n pattern.svgWidth = pSize.width;\n pattern.svgHeight = pSize.height;\n /**\r\n * Get minimum length that can make a repeatable pattern.\r\n *\r\n * @return {Object} pattern width and height\r\n */\n\n function getPatternSize() {\n /**\r\n * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * So the minimum length of X is 15,\r\n * which is the least common multiple of `3 + 2` and `2 + 1`\r\n * |--- --- --- |--- --- ...\r\n * |-- -- -- -- -- |-- -- -- ...\r\n */\n var width = 1;\n\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\n }\n\n var symbolRepeats = 1;\n\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\n }\n\n width *= symbolRepeats;\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\n\n if (process.env.NODE_ENV !== 'production') {\n var warn = function (attrName) {\n /* eslint-disable-next-line */\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\n };\n\n if (width > decalOpt.maxTileWidth) {\n warn('maxTileWidth');\n }\n\n if (height > decalOpt.maxTileHeight) {\n warn('maxTileHeight');\n }\n }\n\n return {\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\n };\n }\n\n function brushDecal() {\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (decalOpt.backgroundColor) {\n ctx.fillStyle = decalOpt.backgroundColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n }\n\n var ySum = 0;\n\n for (var i = 0; i < dashArrayY.length; ++i) {\n ySum += dashArrayY[i];\n }\n\n if (ySum <= 0) {\n // dashArrayY is 0, draw nothing\n return;\n }\n\n var y = -lineBlockLengthY;\n var yId = 0;\n var yIdTotal = 0;\n var xId0 = 0;\n\n while (y < pSize.height) {\n if (yId % 2 === 0) {\n var symbolYId = yIdTotal / 2 % symbolArray.length;\n var x = 0;\n var xId1 = 0;\n var xId1Total = 0;\n\n while (x < pSize.width * 2) {\n var xSum = 0;\n\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\n xSum += dashArrayX[xId0][i];\n }\n\n if (xSum <= 0) {\n // Skip empty line\n break;\n } // E.g., [15, 5, 20, 5] draws only for 15 and 20\n\n\n if (xId1 % 2 === 0) {\n var size = (1 - decalOpt.symbolSize) * 0.5;\n var left = x + dashArrayX[xId0][xId1] * size;\n var top_1 = y + dashArrayY[yId] * size;\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\n var height = dashArrayY[yId] * decalOpt.symbolSize;\n var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\n }\n\n x += dashArrayX[xId0][xId1];\n ++xId1Total;\n ++xId1;\n\n if (xId1 === dashArrayX[xId0].length) {\n xId1 = 0;\n }\n }\n\n ++xId0;\n\n if (xId0 === dashArrayX.length) {\n xId0 = 0;\n }\n }\n\n y += dashArrayY[yId];\n ++yIdTotal;\n ++yId;\n\n if (yId === dashArrayY.length) {\n yId = 0;\n }\n }\n\n function brushSymbol(x, y, width, height, symbolType) {\n var scale = isSVG ? 1 : dpr;\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\n\n if (isSVG) {\n var symbolVNode = zr.painter.renderOneToVNode(symbol);\n\n if (symbolVNode) {\n svgRoot.children.push(symbolVNode);\n }\n } else {\n // Paint to canvas for all other renderers.\n brushSingle(ctx, symbol);\n }\n }\n }\n }\n}\n/**\r\n * Convert symbol array into normalized array\r\n *\r\n * @param {string | (string | string[])[]} symbol symbol input\r\n * @return {string[][]} normolized symbol array\r\n */\n\nfunction normalizeSymbolArray(symbol) {\n if (!symbol || symbol.length === 0) {\n return [['rect']];\n }\n\n if (isString(symbol)) {\n return [[symbol]];\n }\n\n var isAllString = true;\n\n for (var i = 0; i < symbol.length; ++i) {\n if (!isString(symbol[i])) {\n isAllString = false;\n break;\n }\n }\n\n if (isAllString) {\n return normalizeSymbolArray([symbol]);\n }\n\n var result = [];\n\n for (var i = 0; i < symbol.length; ++i) {\n if (isString(symbol[i])) {\n result.push([symbol[i]]);\n } else {\n result.push(symbol[i]);\n }\n }\n\n return result;\n}\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayX} dash dash input\r\n * @return {number[][]} normolized dash array\r\n */\n\n\nfunction normalizeDashArrayX(dash) {\n if (!dash || dash.length === 0) {\n return [[0, 0]];\n }\n\n if (isNumber(dash)) {\n var dashValue = Math.ceil(dash);\n return [[dashValue, dashValue]];\n }\n /**\r\n * [20, 5] should be normalized into [[20, 5]],\r\n * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\r\n */\n\n\n var isAllNumber = true;\n\n for (var i = 0; i < dash.length; ++i) {\n if (!isNumber(dash[i])) {\n isAllNumber = false;\n break;\n }\n }\n\n if (isAllNumber) {\n return normalizeDashArrayX([dash]);\n }\n\n var result = [];\n\n for (var i = 0; i < dash.length; ++i) {\n if (isNumber(dash[i])) {\n var dashValue = Math.ceil(dash[i]);\n result.push([dashValue, dashValue]);\n } else {\n var dashValue = map(dash[i], function (n) {\n return Math.ceil(n);\n });\n\n if (dashValue.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // so normalize it to be [4, 2, 1, 4, 2, 1]\n result.push(dashValue.concat(dashValue));\n } else {\n result.push(dashValue);\n }\n }\n }\n\n return result;\n}\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayY} dash dash input\r\n * @return {number[]} normolized dash array\r\n */\n\n\nfunction normalizeDashArrayY(dash) {\n if (!dash || typeof dash === 'object' && dash.length === 0) {\n return [0, 0];\n }\n\n if (isNumber(dash)) {\n var dashValue_1 = Math.ceil(dash);\n return [dashValue_1, dashValue_1];\n }\n\n var dashValue = map(dash, function (n) {\n return Math.ceil(n);\n });\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\n}\n/**\r\n * Get block length of each line. A block is the length of dash line and space.\r\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\r\n * that, so the block length of this line is 5.\r\n *\r\n * @param {number[][]} dash dash array of X or Y\r\n * @return {number[]} block length of each line\r\n */\n\n\nfunction getLineBlockLengthX(dash) {\n return map(dash, function (line) {\n return getLineBlockLengthY(line);\n });\n}\n\nfunction getLineBlockLengthY(dash) {\n var blockLength = 0;\n\n for (var i = 0; i < dash.length; ++i) {\n blockLength += dash[i];\n }\n\n if (dash.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // So total length is (4 + 2 + 1) * 2\n return blockLength * 2;\n }\n\n return blockLength;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createOrUpdatePatternFromDecal } from '../util/decal.js';\nexport default function decalVisual(ecModel, api) {\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n if (data.hasItemVisual()) {\n data.each(function (idx) {\n var decal = data.getItemVisual(idx, 'decal');\n\n if (decal) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n }\n\n var decal = data.getVisual('decal');\n\n if (decal) {\n var style = data.getVisual('style');\n style.decal = createOrUpdatePatternFromDecal(decal, api);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Eventful from 'zrender/lib/core/Eventful.js';\n;\nvar lifecycle = new Eventful();\nexport default lifecycle;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { error } from '../util/log.js'; // Implementation of exported APIs. For example registerMap, getMap.\n// The implementations will be registered when installing the component.\n// Avoid these code being bundled to the core module.\n\nvar implsStore = {}; // TODO Type\n\nexport function registerImpl(name, impl) {\n if (process.env.NODE_ENV !== 'production') {\n if (implsStore[name]) {\n error(\"Already has an implementation of \" + name + \".\");\n }\n }\n\n implsStore[name] = impl;\n}\nexport function getImpl(name) {\n if (process.env.NODE_ENV !== 'production') {\n if (!implsStore[name]) {\n error(\"Implementation of \" + name + \" doesn't exists.\");\n }\n }\n\n return implsStore[name];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\nimport * as zrender from 'zrender/lib/zrender.js';\nimport { assert, each, isFunction, isObject, indexOf, bind, clone, setAsPrimitive, extend, createHashMap, map, defaults, isDom, isArray, noop, isString, retrieve2 } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport timsort from 'zrender/lib/core/timsort.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport CoordinateSystemManager from './CoordinateSystem.js';\nimport OptionManager from '../model/OptionManager.js';\nimport backwardCompat from '../preprocessor/backwardCompat.js';\nimport dataStack from '../processor/dataStack.js';\nimport SeriesModel from '../model/Series.js';\nimport ComponentView from '../view/Component.js';\nimport ChartView from '../view/Chart.js';\nimport * as graphic from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlobalMouseOutForHighDown } from '../util/states.js';\nimport * as modelUtil from '../util/model.js';\nimport { throttle } from '../util/throttle.js';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style.js';\nimport loadingDefault from '../loading/default.js';\nimport Scheduler from './Scheduler.js';\nimport lightTheme from '../theme/light.js';\nimport darkTheme from '../theme/dark.js';\nimport { parseClassType } from '../util/clazz.js';\nimport { ECEventProcessor } from '../util/ECEventProcessor.js';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol.js';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper.js';\nimport { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log.js';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction.js';\nimport { registerExternalTransform } from '../data/helper/transform.js';\nimport { createLocaleObject, SYSTEM_LANG } from './locale.js';\nimport { findEventDispatcher } from '../util/event.js';\nimport decal from '../visual/decal.js';\nimport lifecycle from './lifecycle.js';\nimport { platformApi, setPlatformAPI } from 'zrender/lib/core/platform.js';\nimport { getImpl } from './impl.js';\nexport var version = '5.4.3';\nexport var dependencies = {\n zrender: '5.4.4'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800; // Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\n\nvar PRIORITY_PROCESSOR_DATASTACK = 900; // \"Data filter\" will block the stream, so it should be\n// put at the beginning of data processing.\n\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000; // Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\n\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; // Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\n\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH,\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n ARIA: PRIORITY_VISUAL_ARIA,\n DECAL: PRIORITY_VISUAL_DECAL\n }\n}; // Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\n\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\nvar PENDING_UPDATE = '__pendingUpdate';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\n\nfunction createRegisterEventWithLowercaseECharts(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.isDisposed()) {\n disposedWarning(this.id);\n return;\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n // `args[0]` is event name. Event name is all lowercase.\n args[0] = args[0] && args[0].toLowerCase();\n return Eventful.prototype[method].apply(host, args);\n}\n\nvar MessageCenter =\n/** @class */\nfunction (_super) {\n __extends(MessageCenter, _super);\n\n function MessageCenter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return MessageCenter;\n}(Eventful);\n\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off'); // ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\n\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar createExtensionAPI;\nvar enableConnect;\nvar markStatusToUpdate;\nvar applyChangedStates;\n\nvar ECharts =\n/** @class */\nfunction (_super) {\n __extends(ECharts, _super);\n\n function ECharts(dom, // Theme name or themeOption.\n theme, opts) {\n var _this = _super.call(this, new ECEventProcessor()) || this;\n\n _this._chartsViews = [];\n _this._chartsMap = {};\n _this._componentsViews = [];\n _this._componentsMap = {}; // Can't dispatch action during rendering procedure\n\n _this._pendingActions = [];\n opts = opts || {}; // Get theme by name\n\n if (isString(theme)) {\n theme = themeStorage[theme];\n }\n\n _this._dom = dom;\n var defaultRenderer = 'canvas';\n var defaultCoarsePointer = 'auto';\n var defaultUseDirtyRect = false;\n\n if (process.env.NODE_ENV !== 'production') {\n var root =\n /* eslint-disable-next-line */\n env.hasGlobalWindow ? window : global;\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\n defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer);\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\n defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect;\n }\n\n var zr = _this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height,\n ssr: opts.ssr,\n useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),\n useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),\n pointerSize: opts.pointerSize\n });\n _this._ssr = opts.ssr; // Expect 60 fps.\n\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\n theme = clone(theme);\n theme && backwardCompat(theme, true);\n _this._theme = theme;\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n _this._coordSysMgr = new CoordinateSystemManager();\n var api = _this._api = createExtensionAPI(_this); // Sort on demand\n\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n _this._messageCenter = new MessageCenter(); // Init mouse events\n\n _this._initEvents(); // In case some people write `window.onresize = chart.resize`\n\n\n _this.resize = bind(_this.resize, _this);\n zr.animation.on('frame', _this._onframe, _this);\n bindRenderedEvent(zr, _this);\n bindMouseEvent(zr, _this); // ECharts instance can be used as value.\n\n setAsPrimitive(_this);\n return _this;\n }\n\n ECharts.prototype._onframe = function () {\n if (this._disposed) {\n return;\n }\n\n applyChangedStates(this);\n var scheduler = this._scheduler; // Lazy update\n\n if (this[PENDING_UPDATE]) {\n var silent = this[PENDING_UPDATE].silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n\n try {\n prepare(this);\n updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n throw e;\n } // At present, in each frame, zrender performs:\n // (1) animation step forward.\n // (2) trigger('frame') (where this `_onframe` is called)\n // (3) zrender flush (render).\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n // will render the final state of the elements before the real animation started.\n\n\n this._zr.flush();\n\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n } // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold.\n\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determined in the first frame (the\n // frame is executed immediately after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain', {});\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event.\n\n\n if (!scheduler.unfinished) {\n this._zr.flush();\n } // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n\n }\n };\n\n ECharts.prototype.getDom = function () {\n return this._dom;\n };\n\n ECharts.prototype.getId = function () {\n return this.id;\n };\n\n ECharts.prototype.getZr = function () {\n return this._zr;\n };\n\n ECharts.prototype.isSSR = function () {\n return this._ssr;\n };\n /* eslint-disable-next-line */\n\n\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`setOption` should not be called during main process.');\n }\n\n return;\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var silent;\n var replaceMerge;\n var transitionOpt;\n\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n replaceMerge = notMerge.replaceMerge;\n transitionOpt = notMerge.transition;\n notMerge = notMerge.notMerge;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.ssr = this._ssr;\n ecModel.init(null, null, null, theme, this._locale, optionManager);\n }\n\n this._model.setOption(option, {\n replaceMerge: replaceMerge\n }, optionPreprocessorFuncs);\n\n var updateParams = {\n seriesTransition: transitionOpt,\n optionChanged: true\n };\n\n if (lazyUpdate) {\n this[PENDING_UPDATE] = {\n silent: silent,\n updateParams: updateParams\n };\n this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n // It should wake it up to make sure zrender start to render at the next frame.\n\n this.getZr().wakeUp();\n } else {\n try {\n prepare(this);\n updateMethods.update.call(this, null, updateParams);\n } catch (e) {\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n } // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n\n\n if (!this._ssr) {\n // not use flush when using ssr mode.\n this._zr.flush();\n }\n\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n };\n /**\r\n * @deprecated\r\n */\n\n\n ECharts.prototype.setTheme = function () {\n deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n }; // We don't want developers to use getModel directly.\n\n\n ECharts.prototype.getModel = function () {\n return this._model;\n };\n\n ECharts.prototype.getOption = function () {\n return this._model && this._model.getOption();\n };\n\n ECharts.prototype.getWidth = function () {\n return this._zr.getWidth();\n };\n\n ECharts.prototype.getHeight = function () {\n return this._zr.getHeight();\n };\n\n ECharts.prototype.getDevicePixelRatio = function () {\n return this._zr.painter.dpr\n /* eslint-disable-next-line */\n || env.hasGlobalWindow && window.devicePixelRatio || 1;\n };\n /**\r\n * Get canvas which has all thing rendered\r\n * @deprecated Use renderToCanvas instead.\r\n */\n\n\n ECharts.prototype.getRenderedCanvas = function (opts) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas');\n }\n\n return this.renderToCanvas(opts);\n };\n\n ECharts.prototype.renderToCanvas = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'canvas') {\n throw new Error('renderToCanvas can only be used in the canvas renderer.');\n }\n }\n\n return painter.getRenderedCanvas({\n backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'),\n pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\n });\n };\n\n ECharts.prototype.renderToSVGString = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'svg') {\n throw new Error('renderToSVGString can only be used in the svg renderer.');\n }\n }\n\n return painter.renderToString({\n useViewBox: opts.useViewBox\n });\n };\n /**\r\n * Get svg data url\r\n */\n\n\n ECharts.prototype.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n\n var zr = this._zr;\n var list = zr.storage.getDisplayList(); // Stop animations\n\n each(list, function (el) {\n el.stopAnimation(null, true);\n });\n return zr.painter.toDataURL();\n };\n\n ECharts.prototype.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n };\n\n ECharts.prototype.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n\n if (connectedGroups[groupId]) {\n var left_1 = MAX_NUMBER;\n var top_1 = MAX_NUMBER;\n var right_1 = -MAX_NUMBER;\n var bottom_1 = -MAX_NUMBER;\n var canvasList_1 = [];\n var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left_1 = mathMin(boundingRect.left, left_1);\n top_1 = mathMin(boundingRect.top, top_1);\n right_1 = mathMax(boundingRect.right, right_1);\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n canvasList_1.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left_1 *= dpr_1;\n top_1 *= dpr_1;\n right_1 *= dpr_1;\n bottom_1 *= dpr_1;\n var width = right_1 - left_1;\n var height = bottom_1 - top_1;\n var targetCanvas = platformApi.createCanvas();\n var zr_1 = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr_1.resize({\n width: width,\n height: height\n });\n\n if (isSvg) {\n var content_1 = '';\n each(canvasList_1, function (item) {\n var x = item.left - left_1;\n var y = item.top - top_1;\n content_1 += '' + item.dom + '';\n });\n zr_1.painter.getSvgRoot().innerHTML = content_1;\n\n if (opts.connectedBackgroundColor) {\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n\n zr_1.refreshImmediately();\n return zr_1.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr_1.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n\n each(canvasList_1, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr_1 - left_1,\n y: item.top * dpr_1 - top_1,\n image: item.dom\n }\n });\n zr_1.add(img);\n });\n zr_1.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n };\n\n ECharts.prototype.convertToPixel = function (finder, value) {\n return doConvertPixel(this, 'convertToPixel', finder, value);\n };\n\n ECharts.prototype.convertFromPixel = function (finder, value) {\n return doConvertPixel(this, 'convertFromPixel', finder, value);\n };\n /**\r\n * Is the specified coordinate systems or components contain the given pixel point.\r\n * @param {Array|number} value\r\n * @return {boolean} result\r\n */\n\n\n ECharts.prototype.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n var result;\n var findResult = modelUtil.parseFinder(ecModel, finder);\n each(findResult, function (models, key) {\n key.indexOf('Models') >= 0 && each(models, function (model) {\n var coordSys = model.coordinateSystem;\n\n if (coordSys && coordSys.containPoint) {\n result = result || !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n\n if (view && view.containPoint) {\n result = result || view.containPoint(value, model);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n }\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': containPoint is not supported');\n }\n }\n }, this);\n }, this);\n return !!result;\n };\n /**\r\n * Get visual from series or data.\r\n * @param finder\r\n * If string, e.g., 'series', means {seriesIndex: 0}.\r\n * If Object, could contain some of these properties below:\r\n * {\r\n * seriesIndex / seriesId / seriesName,\r\n * dataIndex / dataIndexInside\r\n * }\r\n * If dataIndex is not specified, series visual will be fetched,\r\n * but not data item visual.\r\n * If all of seriesIndex, seriesId, seriesName are not specified,\r\n * visual will be fetched from first series.\r\n * @param visualType 'color', 'symbol', 'symbolSize'\r\n */\n\n\n ECharts.prototype.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = parsedFinder.seriesModel;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!seriesModel) {\n warn('There is no specified series model');\n }\n }\n\n var data = seriesModel.getData();\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n };\n /**\r\n * Get view of corresponding component model\r\n */\n\n\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n };\n /**\r\n * Get view of corresponding series model\r\n */\n\n\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n };\n\n ECharts.prototype._initEvents = function () {\n var _this = this;\n\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = _this.getModel();\n\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'.\n\n if (isGlobalOut) {\n params = {};\n } else {\n el && findEventDispatcher(el, function (parent) {\n var ecData = getECData(parent);\n\n if (ecData && ecData.dataIndex != null) {\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {};\n return true;\n } // If element has custom eventData of components\n else if (ecData.eventData) {\n params = extend({}, ecData.eventData);\n return true;\n }\n }, true);\n } // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n\n\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n\n if (process.env.NODE_ENV !== 'production') {\n // `event.componentType` and `event[componentTpype + 'Index']` must not\n // be missed, otherwise there is no way to distinguish source component.\n // See `dataFormat.getDataParams`.\n if (!isGlobalOut && !(model && view)) {\n warn('model or view can not be found by params');\n }\n }\n\n params.event = e;\n params.type = eveName;\n _this._$eventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n\n _this.trigger(eveName, params);\n }\n }; // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n\n\n handler.zrEventfulCallAtLast = true;\n\n _this._zr.on(eveName, handler, _this);\n });\n each(eventActionMap, function (actionType, eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n }); // Extra events\n // TODO register?\n\n each(['selectchanged'], function (eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n handleLegacySelectEvents(this._messageCenter, this, this._api);\n };\n\n ECharts.prototype.isDisposed = function () {\n return this._disposed;\n };\n\n ECharts.prototype.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this.setOption({\n series: []\n }, true);\n };\n\n ECharts.prototype.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._disposed = true;\n var dom = this.getDom();\n\n if (dom) {\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n }\n\n var chart = this;\n var api = chart._api;\n var ecModel = chart._model;\n each(chart._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(chart._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n }); // Dispose after all views disposed\n\n chart._zr.dispose(); // Set properties to null.\n // To reduce the memory cost in case the top code still holds this instance unexpectedly.\n\n\n chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;\n delete instances[chart.id];\n };\n /**\r\n * Resize the chart\r\n */\n\n\n ECharts.prototype.resize = function (opts) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`resize` should not be called during main process.');\n }\n\n return;\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._zr.resize(opts);\n\n var ecModel = this._model; // Resize loading effect\n\n this._loadingFX && this._loadingFX.resize();\n\n if (!ecModel) {\n return;\n }\n\n var needPrepare = ecModel.resetOption('media');\n var silent = opts && opts.silent; // There is some real cases that:\n // chart.setOption(option, { lazyUpdate: true });\n // chart.resize();\n\n if (this[PENDING_UPDATE]) {\n if (silent == null) {\n silent = this[PENDING_UPDATE].silent;\n }\n\n needPrepare = true;\n this[PENDING_UPDATE] = null;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n try {\n needPrepare && prepare(this);\n updateMethods.update.call(this, {\n type: 'resize',\n animation: extend({\n // Disable animation\n duration: 0\n }, opts && opts.animation)\n });\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n\n name = name || 'default';\n this.hideLoading();\n\n if (!loadingEffects[name]) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Loading effects ' + name + ' not exists.');\n }\n\n return;\n }\n\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n };\n /**\r\n * Hide loading effect\r\n */\n\n\n ECharts.prototype.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n };\n\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\n var payload = extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n };\n /**\r\n * @param opt If pass boolean, means opt.silent\r\n * @param opt.silent Default `false`. Whether trigger events.\r\n * @param opt.flush Default `undefined`.\r\n * true: Flush immediately, and then pixel in canvas can be fetched\r\n * immediately. Caution: it might affect performance.\r\n * false: Not flush.\r\n * undefined: Auto decide whether perform flush.\r\n */\n\n\n ECharts.prototype.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n\n if (!actions[payload.type]) {\n return;\n } // Avoid dispatch action before setOption. Especially in `connect`.\n\n\n if (!this._model) {\n return;\n } // May dispatchAction in rendering procedure\n\n\n if (this[IN_MAIN_PROCESS_KEY]) {\n this._pendingActions.push(payload);\n\n return;\n }\n\n var silent = opt.silent;\n doDispatchAction.call(this, payload, silent);\n var flush = opt.flush;\n\n if (flush) {\n this._zr.flush();\n } else if (flush !== false && env.browser.weChat) {\n // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh until user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.updateLabelLayout = function () {\n lifecycle.trigger('series:layoutlabels', this._model, this._api, {\n // Not adding series labels.\n // TODO\n updatedSeries: []\n });\n };\n\n ECharts.prototype.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(params.data && seriesModel);\n }\n\n seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n\n this._scheduler.unfinished = true;\n this.getZr().wakeUp();\n }; // A work around for no `internal` modifier in ts yet but\n // need to strictly hide private methods to JS users.\n\n\n ECharts.internalField = function () {\n prepare = function (ecIns) {\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecIns._model);\n scheduler.prepareStageTasks();\n prepareView(ecIns, true);\n prepareView(ecIns, false);\n scheduler.plan();\n };\n /**\r\n * Prepare view instances of charts and components\r\n */\n\n\n prepareView = function (ecIns, isComponent) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n\n function doPrepare(model) {\n // By default view will be reused if possible for the case that `setOption` with \"notMerge\"\n // mode and need to enable transition animation. (Usually, when they have the same id, or\n // especially no id but have the same type & name & index. See the `model.id` generation\n // rule in `makeIdAndName` and `viewId` generation rule here).\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n // the new model has nothing to do with the old model.\n var requireNewView = model.__requireNewView; // This command should not work twice.\n\n model.__requireNewView = false; // Consider: id same and type changed.\n\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = !requireNewView && viewMap[viewId];\n\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n // For backward compat, still support a chart type declared as only subType\n // like \"liquidfill\", but recommend \"series.liquidfill\"\n // But need a base class to make a type series.\n ChartView.getClass(classType.sub);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(Clazz, classType.sub + ' does not exist.');\n }\n\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n\n if (viewMap[view.__id] === view) {\n delete viewMap[view.__id];\n }\n\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n };\n\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model;\n ecModel.setUpdatePayload(payload); // broadcast\n\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n return;\n }\n\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n\n var excludeSeriesId = payload.excludeSeriesId;\n var excludeSeriesIdMap;\n\n if (excludeSeriesId != null) {\n excludeSeriesIdMap = createHashMap();\n each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n var modelId = modelUtil.convertOptionIdName(id, null);\n\n if (modelId != null) {\n excludeSeriesIdMap.set(modelId, true);\n }\n });\n } // If dispatchAction before setOption, do nothing.\n\n\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n\n if (isHighDownPayload(payload)) {\n if (model instanceof SeriesModel) {\n if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) {\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n }\n } else {\n var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n focusSelf = _a.focusSelf,\n dispatchers = _a.dispatchers;\n\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\n } // PENDING:\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\n // which will be the same as `ChartView` but might be not necessary\n // and will be far from this logic.\n\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n });\n }\n }\n } else if (isSelectChangePayload(payload)) {\n // TODO geo\n if (model instanceof SeriesModel) {\n toggleSelectionFromPayload(model, payload, ecIns._api);\n updateSeriesElementSelection(model);\n markStatusToUpdate(ecIns);\n }\n }\n }, ecIns);\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }, ecIns);\n\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n };\n\n updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload, {\n // Needs to mark option changed if newOption is given.\n // It's from MagicType.\n // TODO If use a separate flag optionChanged in payload?\n optionChanged: payload.newOption != null\n });\n },\n update: function (payload, updateParams) {\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel); // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the original point.\n\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // determine whether to use progressive rendering.\n\n updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not required in stream mode updater currently.\n\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload, updateParams); // Set background\n\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n var darkMode = ecModel.get('darkMode');\n zr.setBackgroundColor(backgroundColor); // Force set dark mode.\n\n if (darkMode != null && darkMode !== 'auto') {\n zr.setDarkMode(darkMode);\n }\n\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateTransform: function (payload) {\n var _this = this;\n\n var ecModel = this._model;\n var api = this._api; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform');\n\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n }); // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n\n\n renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateView: function (payload) {\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n\n render(this, ecModel, this._api, payload, {});\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateVisual: function (payload) {\n // updateMethods.update.call(this, payload);\n var _this = this;\n\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // clear all visual\n\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.getData().clearAllVisual();\n }); // Perform visual\n\n ChartView.markUpdateMethod(payload, 'updateVisual');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n visualType: 'visual',\n setDirty: true\n });\n\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType !== 'series') {\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n });\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload);\n }\n };\n\n doConvertPixel = function (ecIns, methodName, finder, value) {\n if (ecIns._disposed) {\n disposedWarning(ecIns.id);\n return;\n }\n\n var ecModel = ecIns._model;\n\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n\n var result;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\n return result;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n }\n };\n\n updateStreamModes = function (ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n };\n\n doDispatchAction = function (payload, silent) {\n var _this = this;\n\n var ecModel = this.getModel();\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\n var updateMethod = cptTypeTmp.pop();\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n this[IN_MAIN_PROCESS_KEY] = true;\n var payloads = [payload];\n var batched = false; // Batch action\n\n if (payload.batch) {\n batched = true;\n payloads = map(payload.batch, function (item) {\n item = defaults(extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n\n var eventObjBatch = [];\n var eventObj;\n var isSelectChange = isSelectChangePayload(payload);\n var isHighDown = isHighDownPayload(payload); // Only leave blur once if there are multiple batches.\n\n if (isHighDown) {\n allLeaveBlur(this._api);\n }\n\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside\n\n eventObj = eventObj || extend({}, batchItem); // Convert type to eventType\n\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.\n\n if (isHighDown) {\n var _a = modelUtil.preParseFinder(payload),\n queryOptionMap = _a.queryOptionMap,\n mainTypeSpecified = _a.mainTypeSpecified;\n\n var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n updateDirectly(_this, updateMethod, batchItem, componentMainType);\n markStatusToUpdate(_this);\n } else if (isSelectChange) {\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n // geo still use 'geoselect'.\n updateDirectly(_this, updateMethod, batchItem, 'series');\n markStatusToUpdate(_this);\n } else if (cptType) {\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n });\n\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n try {\n // Still dirty\n if (this[PENDING_UPDATE]) {\n prepare(this);\n updateMethods.update.call(this, payload);\n this[PENDING_UPDATE] = null;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n } // Follow the rule of action batch\n\n\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n\n if (!silent) {\n var messageCenter = this._messageCenter;\n messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event\n\n if (isSelectChange) {\n var newObj = {\n type: 'selectchanged',\n escapeConnect: escapeConnect,\n selected: getAllSelectedIndices(ecModel),\n isFromClick: payload.isFromClick || false,\n fromAction: payload.type,\n fromActionPayload: payload\n };\n messageCenter.trigger(newObj.type, newObj);\n }\n }\n };\n\n flushPendingActions = function (silent) {\n var pendingActions = this._pendingActions;\n\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n };\n\n triggerUpdatedEvent = function (silent) {\n !silent && this.trigger('updated');\n };\n /**\r\n * Event `rendered` is triggered when zr\r\n * rendered. It is useful for realtime\r\n * snapshot (reflect animation).\r\n *\r\n * Event `finished` is triggered when:\r\n * (1) zrender rendering finished.\r\n * (2) initial animation finished.\r\n * (3) progressive rendering finished.\r\n * (4) no pending action.\r\n * (5) no delayed setOption needs to be processed.\r\n */\n\n\n bindRenderedEvent = function (zr, ecIns) {\n zr.on('rendered', function (params) {\n ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatedly,\n // so it should only be triggered when rendering indeed happens\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n };\n\n bindMouseEvent = function (zr, ecIns) {\n zr.on('mouseover', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('mouseout', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('click', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, function (target) {\n return getECData(target).dataIndex != null;\n }, true);\n\n if (dispatcher) {\n var actionType = dispatcher.selected ? 'unselect' : 'select';\n var ecData = getECData(dispatcher);\n\n ecIns._api.dispatchAction({\n type: actionType,\n dataType: ecData.dataType,\n dataIndexInside: ecData.dataIndex,\n seriesIndex: ecData.seriesIndex,\n isFromClick: true\n });\n }\n });\n };\n\n function clearColorPalette(ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n }\n\n ; // Allocate zlevels for series and components\n\n function allocateZlevels(ecModel) {\n ;\n var componentZLevels = [];\n var seriesZLevels = [];\n var hasSeperateZLevel = false;\n ecModel.eachComponent(function (componentType, componentModel) {\n var zlevel = componentModel.get('zlevel') || 0;\n var z = componentModel.get('z') || 0;\n var zlevelKey = componentModel.getZLevelKey();\n hasSeperateZLevel = hasSeperateZLevel || !!zlevelKey;\n (componentType === 'series' ? seriesZLevels : componentZLevels).push({\n zlevel: zlevel,\n z: z,\n idx: componentModel.componentIndex,\n type: componentType,\n key: zlevelKey\n });\n });\n\n if (hasSeperateZLevel) {\n // Series after component\n var zLevels = componentZLevels.concat(seriesZLevels);\n var lastSeriesZLevel_1;\n var lastSeriesKey_1;\n timsort(zLevels, function (a, b) {\n if (a.zlevel === b.zlevel) {\n return a.z - b.z;\n }\n\n return a.zlevel - b.zlevel;\n });\n each(zLevels, function (item) {\n var componentModel = ecModel.getComponent(item.type, item.idx);\n var zlevel = item.zlevel;\n var key = item.key;\n\n if (lastSeriesZLevel_1 != null) {\n zlevel = Math.max(lastSeriesZLevel_1, zlevel);\n }\n\n if (key) {\n if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) {\n zlevel++;\n }\n\n lastSeriesKey_1 = key;\n } else if (lastSeriesKey_1) {\n if (zlevel === lastSeriesZLevel_1) {\n zlevel++;\n }\n\n lastSeriesKey_1 = '';\n }\n\n lastSeriesZLevel_1 = zlevel;\n componentModel.setZLevel(zlevel);\n });\n }\n }\n\n render = function (ecIns, ecModel, api, payload, updateParams) {\n allocateZlevels(ecModel);\n renderComponents(ecIns, ecModel, api, payload, updateParams);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload, updateParams); // Remove groups of unrendered charts\n\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n };\n\n renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n clearStates(componentModel, componentView);\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n updateStates(componentModel, componentView);\n });\n };\n /**\r\n * Render each chart and component\r\n */\n\n\n renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n updateParams = extend(updateParams || {}, {\n updatedSeries: ecModel.getSeries()\n }); // TODO progressive?\n\n lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\n var unfinished = false;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload); // TODO states on marker.\n\n clearStates(seriesModel, chartView);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n unfinished = true;\n }\n\n chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender\n // incremental render (always render from the __startIndex each frame)\n // chartView.group.markRedraw();\n\n updateBlend(seriesModel, chartView);\n updateSeriesElementSelection(seriesModel);\n });\n scheduler.unfinished = unfinished || scheduler.unfinished;\n lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); // transition after label is layouted.\n\n lifecycle.trigger('series:transition', ecModel, api, updateParams);\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states.\n\n updateZ(seriesModel, chartView); // NOTE: Update states after label is updated.\n // label should be in normal status when layouting.\n\n updateStates(seriesModel, chartView);\n }); // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel);\n lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\n };\n\n markStatusToUpdate = function (ecIns) {\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame.\n\n ecIns.getZr().wakeUp();\n };\n\n applyChangedStates = function (ecIns) {\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n return;\n }\n\n ecIns.getZr().storage.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n applyElementStates(el);\n });\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n };\n\n function applyElementStates(el) {\n var newStates = [];\n var oldStates = el.currentStates; // Keep other states.\n\n for (var i = 0; i < oldStates.length; i++) {\n var stateName = oldStates[i];\n\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n newStates.push(stateName);\n }\n } // Only use states when it's exists.\n\n\n if (el.selected && el.states.select) {\n newStates.push('select');\n }\n\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n newStates.push('emphasis');\n } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n newStates.push('blur');\n }\n\n el.useStates(newStates);\n }\n\n function updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n if (!el.isGroup) {\n elCount++;\n }\n });\n\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.__alive) {\n chartView.eachRendered(function (el) {\n if (el.states.emphasis) {\n el.states.emphasis.hoverLayer = true;\n }\n });\n }\n });\n }\n }\n\n ;\n /**\r\n * Update chart and blend.\r\n */\n\n function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n chartView.eachRendered(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DON'T mark the element dirty. In case element is incremental and don't want to rerender.\n el.style.blend = blendMode;\n }\n });\n }\n\n ;\n\n function updateZ(model, view) {\n if (model.preventAutoZ) {\n return;\n }\n\n var z = model.get('z') || 0;\n var zlevel = model.get('zlevel') || 0; // Set z and zlevel\n\n view.eachRendered(function (el) {\n doUpdateZ(el, z, zlevel, -Infinity); // Don't traverse the children because it has been traversed in _updateZ.\n\n return true;\n });\n }\n\n ;\n\n function doUpdateZ(el, z, zlevel, maxZ2) {\n // Group may also have textContent\n var label = el.getTextContent();\n var labelLine = el.getTextGuideLine();\n var isGroup = el.isGroup;\n\n if (isGroup) {\n // set z & zlevel of children elements of Group\n var children = el.childrenRef();\n\n for (var i = 0; i < children.length; i++) {\n maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2);\n }\n } else {\n // not Group\n el.z = z;\n el.zlevel = zlevel;\n maxZ2 = Math.max(el.z2, maxZ2);\n } // always set z and zlevel if label/labelLine exists\n\n\n if (label) {\n label.z = z;\n label.zlevel = zlevel; // lift z2 of text content\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\n\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n }\n\n if (labelLine) {\n var textGuideLineConfig = el.textGuideLineConfig;\n labelLine.z = z;\n labelLine.zlevel = zlevel;\n isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n }\n\n return maxZ2;\n } // Clear states without animation.\n // TODO States on component.\n\n\n function clearStates(model, view) {\n view.eachRendered(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n } // TODO If el is incremental.\n\n\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }\n\n function updateStates(model, view) {\n var stateAnimationModel = model.getModel('stateAnimation');\n var enableAnimation = model.isAnimationEnabled();\n var duration = stateAnimationModel.get('duration');\n var stateTransition = duration > 0 ? {\n duration: duration,\n delay: stateAnimationModel.get('delay'),\n easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive')\n\n } : null;\n view.eachRendered(function (el) {\n if (el.states && el.states.emphasis) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n if (el instanceof graphic.Path) {\n savePathStates(el);\n } // Only updated on changed element. In case element is incremental and don't want to rerender.\n // TODO, a more proper way?\n\n\n if (el.__dirty) {\n var prevStates = el.prevStates; // Restore states without animation\n\n if (prevStates) {\n el.useStates(prevStates);\n }\n } // Update state transition and enable animation again.\n\n\n if (enableAnimation) {\n el.stateTransition = stateTransition;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label?\n\n if (textContent) {\n textContent.stateTransition = stateTransition;\n }\n\n if (textGuide) {\n textGuide.stateTransition = stateTransition;\n }\n } // Use highlighted and selected flag to toggle states.\n\n\n if (el.__dirty) {\n applyElementStates(el);\n }\n }\n });\n }\n\n ;\n\n createExtensionAPI = function (ecIns) {\n return new (\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n class_1.prototype.getCoordinateSystems = function () {\n return ecIns._coordSysMgr.getCoordinateSystems();\n };\n\n class_1.prototype.getComponentByElement = function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n\n if (modelInfo != null) {\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n\n el = el.parent;\n }\n };\n\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n enterEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n leaveEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterBlur = function (el) {\n enterBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveBlur = function (el) {\n leaveBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterSelect = function (el) {\n enterSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveSelect = function (el) {\n leaveSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.getModel = function () {\n return ecIns.getModel();\n };\n\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\n return ecIns.getViewOfComponentModel(componentModel);\n };\n\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n return ecIns.getViewOfSeriesModel(seriesModel);\n };\n\n return class_1;\n }(ExtensionAPI))(ecIns);\n };\n\n enableConnect = function (chart) {\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[CONNECT_STATUS_KEY] = status;\n }\n }\n\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n\n var action_1 = chart.makeActionFromEvent(event);\n var otherCharts_1 = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts_1.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n each(otherCharts_1, function (otherChart) {\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n otherChart.dispatchAction(action_1);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n }\n });\n });\n };\n }();\n\n return ECharts;\n}(Eventful);\n\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\r\n * @deprecated\r\n */\n// @ts-ignore\n\nechartsProto.one = function (eventName, cb, ctx) {\n var self = this;\n deprecateLog('ECharts#one is deprecated.');\n\n function wrapped() {\n var args2 = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args2[_i] = arguments[_i];\n }\n\n cb && cb.apply && cb.apply(this, args2); // @ts-ignore\n\n self.off(eventName, wrapped);\n }\n\n ; // @ts-ignore\n\n this.on.call(this, eventName, wrapped, ctx);\n};\n\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\n\nfunction disposedWarning(id) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Instance ' + id + ' has been disposed');\n }\n}\n\nvar actions = {};\n/**\r\n * Map eventType to actionType\r\n */\n\nvar eventActionMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\r\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\r\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\r\n * @param opts.width Use clientWidth of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.height Use clientHeight of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.locale Specify the locale.\r\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\r\n */\n\nexport function init(dom, theme, opts) {\n var isClient = !(opts && opts.ssr);\n\n if (isClient) {\n if (process.env.NODE_ENV !== 'production') {\n if (!dom) {\n throw new Error('Initialize failed: invalid dom.');\n }\n }\n\n var existInstance = getInstanceByDom(dom);\n\n if (existInstance) {\n if (process.env.NODE_ENV !== 'production') {\n warn('There is a chart instance already initialized on the dom.');\n }\n\n return existInstance;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n }\n }\n }\n\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n isClient && modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n lifecycle.trigger('afterinit', chart);\n return chart;\n}\n/**\r\n * @usage\r\n * (A)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * chart1.group = 'xxx';\r\n * chart2.group = 'xxx';\r\n * echarts.connect('xxx');\r\n * ```\r\n * (B)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * echarts.connect('xxx', [chart1, chart2]);\r\n * ```\r\n */\n\nexport function connect(groupId) {\n // Is array of charts\n if (isArray(groupId)) {\n var charts = groupId;\n groupId = null; // If any chart has group\n\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n\n connectedGroups[groupId] = true;\n return groupId;\n}\nexport function disconnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\r\n * Alias and backward compatibility\r\n * @deprecated\r\n */\n\nexport var disConnect = disconnect;\n/**\r\n * Dispose a chart instance\r\n */\n\nexport function dispose(chart) {\n if (isString(chart)) {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\nexport function getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n return instances[key];\n}\n/**\r\n * Register theme\r\n */\n\nexport function registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\r\n * Register option preprocessor\r\n */\n\nexport function registerPreprocessor(preprocessorFunc) {\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n }\n}\nexport function registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\r\n * Register postIniter\r\n * @param {Function} postInitFunc\r\n */\n\nexport function registerPostInit(postInitFunc) {\n registerUpdateLifecycle('afterinit', postInitFunc);\n}\n/**\r\n * Register postUpdater\r\n * @param {Function} postUpdateFunc\r\n */\n\nexport function registerPostUpdate(postUpdateFunc) {\n registerUpdateLifecycle('afterupdate', postUpdateFunc);\n}\nexport function registerUpdateLifecycle(name, cb) {\n lifecycle.on(name, cb);\n}\nexport function registerAction(actionInfo, eventName, action) {\n if (isFunction(eventName)) {\n action = eventName;\n eventName = '';\n }\n\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0]; // Event name is all lowercase\n\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event;\n\n if (eventActionMap[eventName]) {\n // Already registered.\n return;\n } // Validate action type and event name.\n\n\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n\n eventActionMap[eventName] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\r\n * Get dimensions of specified coordinate system.\r\n * @param {string} type\r\n * @return {Array.}\r\n */\n\nexport function getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\nexport { registerLocale } from './locale.js';\n\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\n\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\n\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\n\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(priority) || priority == null) {\n throw new Error('Illegal priority');\n } // Check duplicate\n\n\n each(targetList, function (wrap) {\n assert(wrap.__raw !== fn);\n });\n } // Already registered\n\n\n if (indexOf(registeredTasks, fn) >= 0) {\n return;\n }\n\n registeredTasks.push(fn);\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n}\n\nexport function registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\r\n * ZRender need a canvas context to do measureText.\r\n * But in node environment canvas may be created by node-canvas.\r\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\r\n *\r\n *\r\n * @deprecated use setPlatformAPI({ createCanvas }) instead.\r\n *\r\n * @example\r\n * let Canvas = require('canvas');\r\n * let echarts = require('echarts');\r\n * echarts.setCanvasCreator(function () {\r\n * // Small size is enough.\r\n * return new Canvas(32, 32);\r\n * });\r\n */\n\nexport function setCanvasCreator(creator) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.');\n }\n\n setPlatformAPI({\n createCanvas: creator\n });\n}\n/**\r\n * The parameters and usage: see `geoSourceManager.registerMap`.\r\n * Compatible with previous `echarts.registerMap`.\r\n */\n\nexport function registerMap(mapName, geoJson, specialAreas) {\n var registerMap = getImpl('registerMap');\n registerMap && registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n var getMap = getImpl('getMap');\n return getMap && getMap(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\r\n * Globa dispatchAction to a specified chart instance.\r\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) {\n// if (!payload || !payload.chartId) {\n// // Must have chartId to find chart\n// return;\n// }\n// const chart = instances[payload.chartId];\n// if (chart) {\n// chart.dispatchAction(payload, opt);\n// }\n// }\n// Builtin global visual\n\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault); // Default actions\n\nregisterAction({\n type: HIGHLIGHT_ACTION_TYPE,\n event: HIGHLIGHT_ACTION_TYPE,\n update: HIGHLIGHT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: DOWNPLAY_ACTION_TYPE,\n event: DOWNPLAY_ACTION_TYPE,\n update: DOWNPLAY_ACTION_TYPE\n}, noop);\nregisterAction({\n type: SELECT_ACTION_TYPE,\n event: SELECT_ACTION_TYPE,\n update: SELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: UNSELECT_ACTION_TYPE,\n event: UNSELECT_ACTION_TYPE,\n update: UNSELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: TOGGLE_SELECT_ACTION_TYPE,\n event: TOGGLE_SELECT_ACTION_TYPE,\n update: TOGGLE_SELECT_ACTION_TYPE\n}, noop); // Default theme\n\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\n\nexport var dataTool = {};","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, registerUpdateLifecycle, PRIORITY } from './core/echarts.js';\nimport ComponentView from './view/Component.js';\nimport ChartView from './view/Chart.js';\nimport ComponentModel from './model/Component.js';\nimport SeriesModel from './model/Series.js';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util.js';\nimport { registerImpl } from './core/impl.js';\nimport { registerPainter } from 'zrender/lib/zrender.js';\nvar extensions = [];\nvar extensionRegisters = {\n registerPreprocessor: registerPreprocessor,\n registerProcessor: registerProcessor,\n registerPostInit: registerPostInit,\n registerPostUpdate: registerPostUpdate,\n registerUpdateLifecycle: registerUpdateLifecycle,\n registerAction: registerAction,\n registerCoordinateSystem: registerCoordinateSystem,\n registerLayout: registerLayout,\n registerVisual: registerVisual,\n registerTransform: registerTransform,\n registerLoading: registerLoading,\n registerMap: registerMap,\n registerImpl: registerImpl,\n PRIORITY: PRIORITY,\n ComponentModel: ComponentModel,\n ComponentView: ComponentView,\n SeriesModel: SeriesModel,\n ChartView: ChartView,\n // TODO Use ComponentModel and SeriesModel instead of Constructor\n registerComponentModel: function (ComponentModelClass) {\n ComponentModel.registerClass(ComponentModelClass);\n },\n registerComponentView: function (ComponentViewClass) {\n ComponentView.registerClass(ComponentViewClass);\n },\n registerSeriesModel: function (SeriesModelClass) {\n SeriesModel.registerClass(SeriesModelClass);\n },\n registerChartView: function (ChartViewClass) {\n ChartView.registerClass(ChartViewClass);\n },\n registerSubTypeDefaulter: function (componentType, defaulter) {\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n },\n registerPainter: function (painterType, PainterCtor) {\n registerPainter(painterType, PainterCtor);\n }\n};\nexport function use(ext) {\n if (isArray(ext)) {\n // use([ChartLine, ChartBar]);\n each(ext, function (singleExt) {\n use(singleExt);\n });\n return;\n }\n\n if (indexOf(extensions, ext) >= 0) {\n return;\n }\n\n extensions.push(ext);\n\n if (isFunction(ext)) {\n ext = {\n install: ext\n };\n }\n\n ext.install(extensionRegisters);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { Point, Path, Polyline } from '../util/graphic.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/lib/core/curve.js';\nimport { defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states.js';\nvar PI2 = Math.PI * 2;\nvar CMD = PathProxy.CMD;\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\n\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\n var width = rect.width;\n var height = rect.height;\n\n switch (pos) {\n case 'top':\n outPt.set(rect.x + width / 2, rect.y - distance);\n outDir.set(0, -1);\n break;\n\n case 'bottom':\n outPt.set(rect.x + width / 2, rect.y + height + distance);\n outDir.set(0, 1);\n break;\n\n case 'left':\n outPt.set(rect.x - distance, rect.y + height / 2);\n outDir.set(-1, 0);\n break;\n\n case 'right':\n outPt.set(rect.x + width + distance, rect.y + height / 2);\n outDir.set(1, 0);\n break;\n }\n}\n\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n x /= d;\n y /= d; // Intersect point.\n\n var ox = x * r + cx;\n var oy = y * r + cy;\n\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n out[0] = ox;\n out[1] = oy;\n return d - r;\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 if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n // Project point is on the arc.\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n\n var x1 = r * Math.cos(startAngle) + cx;\n var y1 = r * Math.sin(startAngle) + cy;\n var x2 = r * Math.cos(endAngle) + cx;\n var y2 = r * Math.sin(endAngle) + cy;\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\n\n if (d1 < d2) {\n out[0] = x1;\n out[1] = y1;\n return Math.sqrt(d1);\n } else {\n out[0] = x2;\n out[1] = y2;\n return Math.sqrt(d2);\n }\n}\n\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\n var dx = x - x1;\n var dy = y - y1;\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n dx1 /= lineLen;\n dy1 /= lineLen; // dot product\n\n var projectedLen = dx * dx1 + dy * dy1;\n var t = projectedLen / lineLen;\n\n if (limitToEnds) {\n t = Math.min(Math.max(t, 0), 1);\n }\n\n t *= lineLen;\n var ox = out[0] = x1 + t * dx1;\n var oy = out[1] = y1 + t * dy1;\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\n if (width < 0) {\n x1 = x1 + width;\n width = -width;\n }\n\n if (height < 0) {\n y1 = y1 + height;\n height = -height;\n }\n\n var x2 = x1 + width;\n var y2 = y1 + height;\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nvar tmpPt = [];\n\nfunction nearestPointOnRect(pt, rect, out) {\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\n out.set(tmpPt[0], tmpPt[1]);\n return dist;\n}\n/**\r\n * Calculate min distance corresponding point.\r\n * This method won't evaluate if point is in the path.\r\n */\n\n\nfunction nearestPointOnPath(pt, path, out) {\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n var minDist = Infinity;\n var data = path.data;\n var x = pt.x;\n var y = pt.y;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n\n if (i === 1) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n var d = minDist;\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 d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\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 x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令\n\n if (i <= 1) {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n\n\n var _x = (x - cx) * ry / rx + cx;\n\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\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 d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\n break;\n\n case CMD.Z:\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\n xi = x0;\n yi = y0;\n break;\n }\n\n if (d < minDist) {\n minDist = d;\n out.set(tmpPt[0], tmpPt[1]);\n }\n }\n\n return minDist;\n} // Temporal variable for intermediate usage.\n\n\nvar pt0 = new Point();\nvar pt1 = new Point();\nvar pt2 = new Point();\nvar dir = new Point();\nvar dir2 = new Point();\n/**\r\n * Calculate a proper guide line based on the label position and graphic element definition\r\n * @param label\r\n * @param labelRect\r\n * @param target\r\n * @param targetRect\r\n */\n\nexport function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent(); // Needs to create text guide in each charts.\n\n if (!(label && labelLine)) {\n return;\n }\n\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && invert([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\n pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\n if (dist < minDist) {\n minDist = dist; // Transform back to global space.\n\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n} // Temporal variable for the limitTurnAngle function\n\nvar tmpArr = [];\nvar tmpProjPoint = new Point();\n/**\r\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\r\n * @param linePoints\r\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\r\n */\n\nexport function limitTurnAngle(linePoints, minTurnAngle) {\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\n return;\n }\n\n minTurnAngle = minTurnAngle / 180 * Math.PI; // The line points can be\n // /pt1----pt2 (label)\n // /\n // pt0/\n\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt0, pt1);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(dir2);\n var minTurnAngleCos = Math.cos(minTurnAngle);\n\n if (minTurnAngleCos < angleCos) {\n // Smaller than minTurnAngle\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr); // Calculate new projected length with limited minTurnAngle and get the new connect point\n\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n/**\r\n * Limit the angle of line and the surface\r\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\r\n */\n\nexport function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\n return;\n }\n\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt1, pt0);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(surfaceNormal);\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\n\n if (angleCos < maxSurfaceAngleCos) {\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr);\n var HALF_PI = Math.PI / 2;\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\n\n if (newAngle >= HALF_PI) {\n // parallel\n Point.copy(tmpProjPoint, pt2);\n } else {\n // Calculate new projected length with limited minTurnAngle and get the new connect point\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\n var isNormal = stateName === 'normal';\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); // Make sure display.\n\n stateObj.ignore = ignore; // Set smooth\n\n var smooth = stateModel.get('smooth');\n\n if (smooth && smooth === true) {\n smooth = 0.3;\n }\n\n stateObj.shape = stateObj.shape || {};\n\n if (smooth > 0) {\n stateObj.shape.smooth = smooth;\n }\n\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\n}\n\nfunction buildLabelLinePath(path, shape) {\n var smooth = shape.smooth;\n var points = shape.points;\n\n if (!points) {\n return;\n }\n\n path.moveTo(points[0][0], points[0][1]);\n\n if (smooth > 0 && points.length >= 3) {\n var len1 = vector.dist(points[0], points[1]);\n var len2 = vector.dist(points[1], points[2]);\n\n if (!len1 || !len2) {\n path.lineTo(points[1][0], points[1][1]);\n path.lineTo(points[2][0], points[2][1]);\n return;\n }\n\n var moveLen = Math.min(len1, len2) * smooth;\n var midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\n var midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\n var midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\n } else {\n for (var i = 1; i < points.length; i++) {\n path.lineTo(points[i][0], points[i][1]);\n }\n }\n}\n/**\r\n * Create a label line if necessary and set it's style.\r\n */\n\n\nexport function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n\n return;\n }\n\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateName = DISPLAY_STATES[i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName];\n\n if (stateObj) {\n stateObj.ignore = true;\n }\n\n continue;\n } // Create labelLine if not exists\n\n\n if (!labelLine) {\n labelLine = new Polyline();\n targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n } // Use same state proxy.\n\n\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n\n if (labelLine) {\n defaults(labelLine.style, defaultStyle); // Not fill.\n\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\n labelLine.buildPath = buildLabelLinePath;\n }\n}\nexport function getLabelLineStatesModels(itemModel, labelLineName) {\n labelLineName = labelLineName || 'labelLine';\n var statesModels = {\n normal: itemModel.getModel(labelLineName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\n }\n\n return statesModels;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { BoundingRect, OrientedBoundingRect } from '../util/graphic.js';\nexport function prepareLayoutList(input) {\n var list = [];\n\n for (var i = 0; i < input.length; i++) {\n var rawItem = input[i];\n\n if (rawItem.defaultAttr.ignore) {\n continue;\n }\n\n var label = rawItem.label;\n var transform = label.getComputedTransform(); // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el.\n\n var localRect = label.getBoundingRect();\n var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5;\n var minMargin = label.style.margin || 0;\n var globalRect = localRect.clone();\n globalRect.applyTransform(transform);\n globalRect.x -= minMargin / 2;\n globalRect.y -= minMargin / 2;\n globalRect.width += minMargin;\n globalRect.height += minMargin;\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\n list.push({\n label: label,\n labelLine: rawItem.labelLine,\n rect: globalRect,\n localRect: localRect,\n obb: obb,\n priority: rawItem.priority,\n defaultAttr: rawItem.defaultAttr,\n layoutOption: rawItem.computedLayoutOption,\n axisAligned: isAxisAligned,\n transform: transform\n });\n }\n\n return list;\n}\n\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\n var len = list.length;\n\n if (len < 2) {\n return;\n }\n\n list.sort(function (a, b) {\n return a.rect[xyDim] - b.rect[xyDim];\n });\n var lastPos = 0;\n var delta;\n var adjusted = false;\n var shifts = [];\n var totalShifts = 0;\n\n for (var i = 0; i < len; i++) {\n var item = list[i];\n var rect = item.rect;\n delta = rect[xyDim] - lastPos;\n\n if (delta < 0) {\n // shiftForward(i, len, -delta);\n rect[xyDim] -= delta;\n item.label[xyDim] -= delta;\n adjusted = true;\n }\n\n var shift = Math.max(-delta, 0);\n shifts.push(shift);\n totalShifts += shift;\n lastPos = rect[xyDim] + rect[sizeDim];\n }\n\n if (totalShifts > 0 && balanceShift) {\n // Shift back to make the distribution more equally.\n shiftList(-totalShifts / len, 0, len);\n } // TODO bleedMargin?\n\n\n var first = list[0];\n var last = list[len - 1];\n var minGap;\n var maxGap;\n updateMinMaxGap(); // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\n\n minGap < 0 && squeezeGaps(-minGap, 0.8);\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\n updateMinMaxGap();\n takeBoundsGap(minGap, maxGap, 1);\n takeBoundsGap(maxGap, minGap, -1); // Handle bailout when there is not enough space.\n\n updateMinMaxGap();\n\n if (minGap < 0) {\n squeezeWhenBailout(-minGap);\n }\n\n if (maxGap < 0) {\n squeezeWhenBailout(maxGap);\n }\n\n function updateMinMaxGap() {\n minGap = first.rect[xyDim] - minBound;\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\n }\n\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\n if (gapThisBound < 0) {\n // Move from other gap if can.\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\n\n if (moveFromMaxGap > 0) {\n shiftList(moveFromMaxGap * moveDir, 0, len);\n var remained = moveFromMaxGap + gapThisBound;\n\n if (remained < 0) {\n squeezeGaps(-remained * moveDir, 1);\n }\n } else {\n squeezeGaps(-gapThisBound * moveDir, 1);\n }\n }\n }\n\n function shiftList(delta, start, end) {\n if (delta !== 0) {\n adjusted = true;\n }\n\n for (var i = start; i < end; i++) {\n var item = list[i];\n var rect = item.rect;\n rect[xyDim] += delta;\n item.label[xyDim] += delta;\n }\n } // Squeeze gaps if the labels exceed margin.\n\n\n function squeezeGaps(delta, maxSqeezePercent) {\n var gaps = [];\n var totalGaps = 0;\n\n for (var i = 1; i < len; i++) {\n var prevItemRect = list[i - 1].rect;\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\n gaps.push(gap);\n totalGaps += gap;\n }\n\n if (!totalGaps) {\n return;\n }\n\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\n\n if (delta > 0) {\n for (var i = 0; i < len - 1; i++) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i] * squeezePercent; // Forward\n\n shiftList(movement, 0, i + 1);\n }\n } else {\n // Backward\n for (var i = len - 1; i > 0; i--) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i - 1] * squeezePercent;\n shiftList(-movement, i, len);\n }\n }\n }\n /**\r\n * Squeeze to allow overlap if there is no more space available.\r\n * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\r\n */\n\n\n function squeezeWhenBailout(delta) {\n var dir = delta < 0 ? -1 : 1;\n delta = Math.abs(delta);\n var moveForEachLabel = Math.ceil(delta / (len - 1));\n\n for (var i = 0; i < len - 1; i++) {\n if (dir > 0) {\n // Forward\n shiftList(moveForEachLabel, 0, i + 1);\n } else {\n // Backward\n shiftList(-moveForEachLabel, len - i - 1, len);\n }\n\n delta -= moveForEachLabel;\n\n if (delta <= 0) {\n return;\n }\n }\n }\n\n return adjusted;\n}\n/**\r\n * Adjust labels on x direction to avoid overlap.\r\n */\n\n\nexport function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n}\n/**\r\n * Adjust labels on y direction to avoid overlap.\r\n */\n\nexport function shiftLayoutOnY(list, topBound, bottomBound, // If average the shifts on all labels and add them to 0\nbalanceShift) {\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\n}\nexport function hideOverlap(labelList) {\n var displayedLabels = []; // TODO, render overflow visible first, put in the displayedLabels.\n\n labelList.sort(function (a, b) {\n return b.priority - a.priority;\n });\n var globalRect = new BoundingRect(0, 0, 0, 0);\n\n function hideEl(el) {\n if (!el.ignore) {\n // Show on emphasis.\n var emphasisState = el.ensureState('emphasis');\n\n if (emphasisState.ignore == null) {\n emphasisState.ignore = false;\n }\n }\n\n el.ignore = true;\n }\n\n for (var i = 0; i < labelList.length; i++) {\n var labelItem = labelList[i];\n var isAxisAligned = labelItem.axisAligned;\n var localRect = labelItem.localRect;\n var transform = labelItem.transform;\n var label = labelItem.label;\n var labelLine = labelItem.labelLine;\n globalRect.copy(labelItem.rect); // Add a threshold because layout may be aligned precisely.\n\n globalRect.width -= 0.1;\n globalRect.height -= 0.1;\n globalRect.x += 0.05;\n globalRect.y += 0.05;\n var obb = labelItem.obb;\n var overlapped = false;\n\n for (var j = 0; j < displayedLabels.length; j++) {\n var existsTextCfg = displayedLabels[j]; // Fast rejection.\n\n if (!globalRect.intersect(existsTextCfg.rect)) {\n continue;\n }\n\n if (isAxisAligned && existsTextCfg.axisAligned) {\n // Is overlapped\n overlapped = true;\n break;\n }\n\n if (!existsTextCfg.obb) {\n // If self is not axis aligned. But other is.\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\n }\n\n if (!obb) {\n // If self is axis aligned. But other is not.\n obb = new OrientedBoundingRect(localRect, transform);\n }\n\n if (obb.intersect(existsTextCfg.obb)) {\n overlapped = true;\n break;\n }\n } // TODO Callback to determine if this overlap should be handled?\n\n\n if (overlapped) {\n hideEl(label);\n labelLine && hideEl(labelLine);\n } else {\n label.attr('ignore', labelItem.defaultAttr.ignore);\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\n displayedLabels.push(labelItem);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO: move labels out of viewport.\nimport { BoundingRect, updateProps, initProps, isElementRemoved } from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { parsePercent } from '../util/number.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper.js';\nimport { makeInner } from '../util/model.js';\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/lib/core/util.js';\nimport { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper.js';\nimport { labelInner, animateLabelValue } from './labelStyle.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\n\nfunction cloneArr(points) {\n if (points) {\n var newPoints = [];\n\n for (var i = 0; i < points.length; i++) {\n newPoints.push(points[i].slice());\n }\n\n return newPoints;\n }\n}\n\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\n var label = labelItem.label;\n var labelLine = hostEl && hostEl.getTextGuideLine();\n return {\n dataIndex: labelItem.dataIndex,\n dataType: labelItem.dataType,\n seriesIndex: labelItem.seriesModel.seriesIndex,\n text: labelItem.label.style.text,\n rect: labelItem.hostRect,\n labelRect: labelItem.rect,\n // x: labelAttr.x,\n // y: labelAttr.y,\n align: label.style.align,\n verticalAlign: label.style.verticalAlign,\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\n };\n}\n\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\nvar dummyTransformable = new Transformable();\nvar labelLayoutInnerStore = makeInner();\nvar labelLineAnimationStore = makeInner();\n\nfunction extendWithKeys(target, source, keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (source[key] != null) {\n target[key] = source[key];\n }\n }\n}\n\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\n\nvar LabelManager =\n/** @class */\nfunction () {\n function LabelManager() {\n this._labelList = [];\n this._chartViewList = [];\n }\n\n LabelManager.prototype.clearLabels = function () {\n this._labelList = [];\n this._chartViewList = [];\n };\n /**\r\n * Add label to manager\r\n */\n\n\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\n var labelStyle = label.style;\n var hostEl = label.__hostTarget;\n var textConfig = hostEl.textConfig || {}; // TODO: If label is in other state.\n\n var labelTransform = label.getComputedTransform();\n var labelRect = label.getBoundingRect().plain();\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\n\n if (labelTransform) {\n dummyTransformable.setLocalTransform(labelTransform);\n } else {\n // Identity transform.\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\n }\n\n dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);\n var host = label.__hostTarget;\n var hostRect;\n\n if (host) {\n hostRect = host.getBoundingRect().plain();\n var transform = host.getComputedTransform();\n BoundingRect.applyTransform(hostRect, hostRect, transform);\n }\n\n var labelGuide = hostRect && host.getTextGuideLine();\n\n this._labelList.push({\n label: label,\n labelLine: labelGuide,\n seriesModel: seriesModel,\n dataIndex: dataIndex,\n dataType: dataType,\n layoutOption: layoutOption,\n computedLayoutOption: null,\n rect: labelRect,\n hostRect: hostRect,\n // Label with lower priority will be hidden when overlapped\n // Use rect size as default priority\n priority: hostRect ? hostRect.width * hostRect.height : 0,\n // Save default label attributes.\n // For restore if developers want get back to default value in callback.\n defaultAttr: {\n ignore: label.ignore,\n labelGuideIgnore: labelGuide && labelGuide.ignore,\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY,\n rotation: dummyTransformable.rotation,\n style: {\n x: labelStyle.x,\n y: labelStyle.y,\n align: labelStyle.align,\n verticalAlign: labelStyle.verticalAlign,\n width: labelStyle.width,\n height: labelStyle.height,\n fontSize: labelStyle.fontSize\n },\n cursor: label.cursor,\n attachedPos: textConfig.position,\n attachedRot: textConfig.rotation\n }\n });\n };\n\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\n var _this = this;\n\n this._chartViewList.push(chartView);\n\n var seriesModel = chartView.__model;\n var layoutOption = seriesModel.get('labelLayout');\n /**\r\n * Ignore layouting if it's not specified anything.\r\n */\n\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\n return;\n }\n\n chartView.group.traverse(function (child) {\n if (child.ignore) {\n return true; // Stop traverse descendants.\n } // Only support label being hosted on graphic elements.\n\n\n var textEl = child.getTextContent();\n var ecData = getECData(child); // Can only attach the text on the element with dataIndex\n\n if (textEl && !textEl.disableLabelLayout) {\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\n }\n });\n };\n\n LabelManager.prototype.updateLayoutConfig = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n\n function createDragHandler(el, labelLineModel) {\n return function () {\n updateLabelLinePoints(el, labelLineModel);\n };\n }\n\n for (var i = 0; i < this._labelList.length; i++) {\n var labelItem = this._labelList[i];\n var label = labelItem.label;\n var hostEl = label.__hostTarget;\n var defaultLabelAttr = labelItem.defaultAttr;\n var layoutOption = void 0; // TODO A global layout option?\n\n if (isFunction(labelItem.layoutOption)) {\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\n } else {\n layoutOption = labelItem.layoutOption;\n }\n\n layoutOption = layoutOption || {};\n labelItem.computedLayoutOption = layoutOption;\n var degreeToRadian = Math.PI / 180; // TODO hostEl should always exists.\n // Or label should not have parent because the x, y is all in global space.\n\n if (hostEl) {\n hostEl.setTextConfig({\n // Force to set local false.\n local: false,\n // Ignore position and rotation config on the host el if x or y is changed.\n position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,\n // Ignore rotation config on the host el if rotation is changed.\n rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\n });\n }\n\n var needsUpdateLabelLine = false;\n\n if (layoutOption.x != null) {\n // TODO width of chart view.\n label.x = parsePercent(layoutOption.x, width);\n label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\n\n needsUpdateLabelLine = true;\n } else {\n label.x = defaultLabelAttr.x;\n label.setStyle('x', defaultLabelAttr.style.x);\n }\n\n if (layoutOption.y != null) {\n // TODO height of chart view.\n label.y = parsePercent(layoutOption.y, height);\n label.setStyle('y', 0); // Ignore movement in style.\n\n needsUpdateLabelLine = true;\n } else {\n label.y = defaultLabelAttr.y;\n label.setStyle('y', defaultLabelAttr.style.y);\n }\n\n if (layoutOption.labelLinePoints) {\n var guideLine = hostEl.getTextGuideLine();\n\n if (guideLine) {\n guideLine.setShape({\n points: layoutOption.labelLinePoints\n }); // Not update\n\n needsUpdateLabelLine = false;\n }\n }\n\n var labelLayoutStore = labelLayoutInnerStore(label);\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\n label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\n label.scaleX = defaultLabelAttr.scaleX;\n label.scaleY = defaultLabelAttr.scaleY;\n\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\n }\n\n if (layoutOption.draggable) {\n label.draggable = true;\n label.cursor = 'move';\n\n if (hostEl) {\n var hostModel = labelItem.seriesModel;\n\n if (labelItem.dataIndex != null) {\n var data = labelItem.seriesModel.getData(labelItem.dataType);\n hostModel = data.getItemModel(labelItem.dataIndex);\n }\n\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\n }\n } else {\n // TODO Other drag functions?\n label.off('drag');\n label.cursor = defaultLabelAttr.cursor;\n }\n }\n };\n\n LabelManager.prototype.layout = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n var labelList = prepareLayoutList(this._labelList);\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftX';\n });\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftY';\n });\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\n return item.layoutOption.hideOverlap;\n });\n hideOverlap(labelsNeedsHideOverlap);\n };\n /**\r\n * Process all labels. Not only labels with layoutOption.\r\n */\n\n\n LabelManager.prototype.processLabelsOverall = function () {\n var _this = this;\n\n each(this._chartViewList, function (chartView) {\n var seriesModel = chartView.__model;\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\n var animationEnabled = seriesModel.isAnimationEnabled();\n chartView.group.traverse(function (child) {\n if (child.ignore && !child.forceLabelAnimation) {\n return true; // Stop traverse descendants.\n }\n\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\n var label = child.getTextContent();\n\n if (!needsUpdateLabelLine && label) {\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\n }\n\n if (needsUpdateLabelLine) {\n _this._updateLabelLine(child, seriesModel);\n }\n\n if (animationEnabled) {\n _this._animateLabels(child, seriesModel);\n }\n });\n });\n };\n\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\n // Only support label being hosted on graphic elements.\n var textEl = el.getTextContent(); // Update label line style.\n\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex; // Only support labelLine on the labels represent data.\n\n if (textEl && dataIndex != null) {\n var data = seriesModel.getData(ecData.dataType);\n var itemModel = data.getItemModel(dataIndex);\n var defaultStyle = {};\n var visualStyle = data.getItemVisual(dataIndex, 'style');\n\n if (visualStyle) {\n var visualType = data.getVisual('drawType'); // Default to be same with main color\n\n defaultStyle.stroke = visualStyle[visualType];\n }\n\n var labelLineModel = itemModel.getModel('labelLine');\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\n updateLabelLinePoints(el, labelLineModel);\n }\n };\n\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\n var textEl = el.getTextContent();\n var guideLine = el.getTextGuideLine(); // Animate\n\n if (textEl // `forceLabelAnimation` has the highest priority\n && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) {\n var layoutStore = labelLayoutInnerStore(textEl);\n var oldLayout = layoutStore.oldLayout;\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n var newProps = {\n x: textEl.x,\n y: textEl.y,\n rotation: textEl.rotation\n };\n var data = seriesModel.getData(ecData.dataType);\n\n if (!oldLayout) {\n textEl.attr(newProps); // Disable fade in animation if value animation is enabled.\n\n if (!labelInner(textEl).valueAnimation) {\n var oldOpacity = retrieve2(textEl.style.opacity, 1); // Fade in animation\n\n textEl.style.opacity = 0;\n initProps(textEl, {\n style: {\n opacity: oldOpacity\n }\n }, seriesModel, dataIndex);\n }\n } else {\n textEl.attr(oldLayout); // Make sure the animation from is in the right status.\n\n var prevStates = el.prevStates;\n\n if (prevStates) {\n if (indexOf(prevStates, 'select') >= 0) {\n textEl.attr(layoutStore.oldLayoutSelect);\n }\n\n if (indexOf(prevStates, 'emphasis') >= 0) {\n textEl.attr(layoutStore.oldLayoutEmphasis);\n }\n }\n\n updateProps(textEl, newProps, seriesModel, dataIndex);\n }\n\n layoutStore.oldLayout = newProps;\n\n if (textEl.states.select) {\n var layoutSelect = layoutStore.oldLayoutSelect = {};\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\n }\n\n if (textEl.states.emphasis) {\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\n }\n\n animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\n }\n\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\n var layoutStore = labelLineAnimationStore(guideLine);\n var oldLayout = layoutStore.oldLayout;\n var newLayout = {\n points: guideLine.shape.points\n };\n\n if (!oldLayout) {\n guideLine.setShape(newLayout);\n guideLine.style.strokePercent = 0;\n initProps(guideLine, {\n style: {\n strokePercent: 1\n }\n }, seriesModel);\n } else {\n guideLine.attr({\n shape: oldLayout\n });\n updateProps(guideLine, {\n shape: newLayout\n }, seriesModel);\n }\n\n layoutStore.oldLayout = newLayout;\n }\n };\n\n return LabelManager;\n}();\n\nexport default LabelManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../util/model.js';\nimport LabelManager from './LabelManager.js';\nvar getLabelManager = makeInner();\nexport function installLabelLayout(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var labelManager = getLabelManager(api).labelManager;\n\n if (!labelManager) {\n labelManager = getLabelManager(api).labelManager = new LabelManager();\n }\n\n labelManager.clearLabels();\n });\n registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) {\n var labelManager = getLabelManager(api).labelManager;\n params.updatedSeries.forEach(function (series) {\n labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series));\n });\n labelManager.updateLayoutConfig(api);\n labelManager.layout(api);\n labelManager.processLabelsOverall();\n });\n}","import { __extends } from \"tslib\";\nimport * as util from '../core/util.js';\nimport { devicePixelRatio } from '../config.js';\nimport Eventful from '../core/Eventful.js';\nimport { getCanvasGradient } from './helper.js';\nimport { createCanvasPattern } from './graphic.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { platformApi } from '../core/platform.js';\nfunction createDom(id, painter, dpr) {\n var newDom = platformApi.createCanvas();\n var width = painter.getWidth();\n var height = painter.getHeight();\n var newDomStyle = newDom.style;\n if (newDomStyle) {\n newDomStyle.position = 'absolute';\n newDomStyle.left = '0';\n newDomStyle.top = '0';\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n newDom.setAttribute('data-zr-dom-id', id);\n }\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n return newDom;\n}\n;\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, painter, dpr) {\n var _this = _super.call(this) || this;\n _this.motionBlur = false;\n _this.lastFrameAlpha = 0.7;\n _this.dpr = 1;\n _this.virtual = false;\n _this.config = {};\n _this.incremental = false;\n _this.zlevel = 0;\n _this.maxRepaintRectCount = 5;\n _this.__dirty = true;\n _this.__firstTimePaint = true;\n _this.__used = false;\n _this.__drawIndex = 0;\n _this.__startIndex = 0;\n _this.__endIndex = 0;\n _this.__prevStartIndex = null;\n _this.__prevEndIndex = null;\n var dom;\n dpr = dpr || devicePixelRatio;\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n }\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n _this.id = id;\n _this.dom = dom;\n var domStyle = dom.style;\n if (domStyle) {\n util.disableUserSelect(dom);\n dom.onselectstart = function () { return false; };\n domStyle.padding = '0';\n domStyle.margin = '0';\n domStyle.borderWidth = '0';\n }\n _this.painter = painter;\n _this.dpr = dpr;\n return _this;\n }\n Layer.prototype.getElementCount = function () {\n return this.__endIndex - this.__startIndex;\n };\n Layer.prototype.afterBrush = function () {\n this.__prevStartIndex = this.__startIndex;\n this.__prevEndIndex = this.__endIndex;\n };\n Layer.prototype.initContext = function () {\n this.ctx = this.dom.getContext('2d');\n this.ctx.dpr = this.dpr;\n };\n Layer.prototype.setUnpainted = function () {\n this.__firstTimePaint = true;\n };\n Layer.prototype.createBackBuffer = function () {\n var dpr = this.dpr;\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n };\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\n if (this.__firstTimePaint) {\n this.__firstTimePaint = false;\n return null;\n }\n var mergedRepaintRects = [];\n var maxRepaintRectCount = this.maxRepaintRectCount;\n var full = false;\n var pendingRect = new BoundingRect(0, 0, 0, 0);\n function addRectToMergePool(rect) {\n if (!rect.isFinite() || rect.isZero()) {\n return;\n }\n if (mergedRepaintRects.length === 0) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n else {\n var isMerged = false;\n var minDeltaArea = Infinity;\n var bestRectToMergeIdx = 0;\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\n var mergedRect = mergedRepaintRects[i];\n if (mergedRect.intersect(rect)) {\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\n pendingRect_1.copy(mergedRect);\n pendingRect_1.union(rect);\n mergedRepaintRects[i] = pendingRect_1;\n isMerged = true;\n break;\n }\n else if (full) {\n pendingRect.copy(rect);\n pendingRect.union(mergedRect);\n var aArea = rect.width * rect.height;\n var bArea = mergedRect.width * mergedRect.height;\n var pendingArea = pendingRect.width * pendingRect.height;\n var deltaArea = pendingArea - aArea - bArea;\n if (deltaArea < minDeltaArea) {\n minDeltaArea = deltaArea;\n bestRectToMergeIdx = i;\n }\n }\n }\n if (full) {\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\n isMerged = true;\n }\n if (!isMerged) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n if (!full) {\n full = mergedRepaintRects.length >= maxRepaintRectCount;\n }\n }\n }\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\n var el = displayList[i];\n if (el) {\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n var prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint)\n ? el.getPrevPaintRect()\n : null;\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n var curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered)\n ? el.getPaintRect()\n : null;\n if (curRect) {\n addRectToMergePool(curRect);\n }\n }\n }\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n var el = prevList[i];\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n var prevRect = el.getPrevPaintRect();\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n }\n }\n var hasIntersections;\n do {\n hasIntersections = false;\n for (var i = 0; i < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].isZero()) {\n mergedRepaintRects.splice(i, 1);\n continue;\n }\n for (var j = i + 1; j < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n hasIntersections = true;\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\n mergedRepaintRects.splice(j, 1);\n }\n else {\n j++;\n }\n }\n i++;\n }\n } while (hasIntersections);\n this._paintRects = mergedRepaintRects;\n return mergedRepaintRects;\n };\n Layer.prototype.debugGetPaintRects = function () {\n return (this._paintRects || []).slice();\n };\n Layer.prototype.resize = function (width, height) {\n var dpr = this.dpr;\n var dom = this.dom;\n var domStyle = dom.style;\n var domBack = this.domBack;\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n dom.width = width * dpr;\n dom.height = height * dpr;\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n };\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\n var dom = this.dom;\n var ctx = this.ctx;\n var width = dom.width;\n var height = dom.height;\n clearColor = clearColor || this.clearColor;\n var haveMotionBLur = this.motionBlur && !clearAll;\n var lastFrameAlpha = this.lastFrameAlpha;\n var dpr = this.dpr;\n var self = this;\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n }\n var domBack = this.domBack;\n function doClear(x, y, width, height) {\n ctx.clearRect(x, y, width, height);\n if (clearColor && clearColor !== 'transparent') {\n var clearColorGradientOrPattern = void 0;\n if (util.isGradientObject(clearColor)) {\n var shouldCache = clearColor.global || (clearColor.__width === width\n && clearColor.__height === height);\n clearColorGradientOrPattern = shouldCache\n && clearColor.__canvasGradient\n || getCanvasGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n clearColor.__canvasGradient = clearColorGradientOrPattern;\n clearColor.__width = width;\n clearColor.__height = height;\n }\n else if (util.isImagePatternObject(clearColor)) {\n clearColor.scaleX = clearColor.scaleX || dpr;\n clearColor.scaleY = clearColor.scaleY || dpr;\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\n dirty: function () {\n self.setUnpainted();\n self.__painter.refresh();\n }\n });\n }\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n ctx.fillRect(x, y, width, height);\n ctx.restore();\n }\n if (haveMotionBLur) {\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, x, y, width, height);\n ctx.restore();\n }\n }\n ;\n if (!repaintRects || haveMotionBLur) {\n doClear(0, 0, width, height);\n }\n else if (repaintRects.length) {\n util.each(repaintRects, function (rect) {\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n });\n }\n };\n return Layer;\n}(Eventful));\nexport default Layer;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Core API from echarts/src/echarts\nexport * from '../core/echarts.js';\nexport * from './api.js';\nimport { use } from '../extension.js'; // Import label layout by default.\n// TODO will be treeshaked.\n\nimport { installLabelLayout } from '../label/installLabelLayout.js';\nuse(installLabelLayout);","import { devicePixelRatio } from '../config.js';\nimport * as util from '../core/util.js';\nimport Layer from './Layer.js';\nimport requestAnimationFrame from '../animation/requestAnimationFrame.js';\nimport env from '../core/env.js';\nimport { brush, brushSingle } from './graphic.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { getSize } from './helper.js';\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\nfunction isLayerValid(layer) {\n if (!layer) {\n return false;\n }\n if (layer.__builtin__) {\n return true;\n }\n if (typeof (layer.resize) !== 'function'\n || typeof (layer.refresh) !== 'function') {\n return false;\n }\n return true;\n}\nfunction createRoot(width, height) {\n var domRoot = document.createElement('div');\n domRoot.style.cssText = [\n 'position:relative',\n 'width:' + width + 'px',\n 'height:' + height + 'px',\n 'padding:0',\n 'margin:0',\n 'border-width:0'\n ].join(';') + ';';\n return domRoot;\n}\nvar CanvasPainter = (function () {\n function CanvasPainter(root, storage, opts, id) {\n this.type = 'canvas';\n this._zlevelList = [];\n this._prevDisplayList = [];\n this._layers = {};\n this._layerConfig = {};\n this._needsManuallyCompositing = false;\n this.type = 'canvas';\n var singleCanvas = !root.nodeName\n || root.nodeName.toUpperCase() === 'CANVAS';\n this._opts = opts = util.extend({}, opts || {});\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n this._singleCanvas = singleCanvas;\n this.root = root;\n var rootStyle = root.style;\n if (rootStyle) {\n util.disableUserSelect(root);\n root.innerHTML = '';\n }\n this.storage = storage;\n var zlevelList = this._zlevelList;\n this._prevDisplayList = [];\n var layers = this._layers;\n if (!singleCanvas) {\n this._width = getSize(root, 0, opts);\n this._height = getSize(root, 1, opts);\n var domRoot = this._domRoot = createRoot(this._width, this._height);\n root.appendChild(domRoot);\n }\n else {\n var rootCanvas = root;\n var width = rootCanvas.width;\n var height = rootCanvas.height;\n if (opts.width != null) {\n width = opts.width;\n }\n if (opts.height != null) {\n height = opts.height;\n }\n this.dpr = opts.devicePixelRatio || 1;\n rootCanvas.width = width * this.dpr;\n rootCanvas.height = height * this.dpr;\n this._width = width;\n this._height = height;\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext();\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL;\n zlevelList.push(CANVAS_ZLEVEL);\n this._domRoot = root;\n }\n }\n CanvasPainter.prototype.getType = function () {\n return 'canvas';\n };\n CanvasPainter.prototype.isSingleCanvas = function () {\n return this._singleCanvas;\n };\n CanvasPainter.prototype.getViewportRoot = function () {\n return this._domRoot;\n };\n CanvasPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n CanvasPainter.prototype.refresh = function (paintAll) {\n var list = this.storage.getDisplayList(true);\n var prevList = this._prevDisplayList;\n var zlevelList = this._zlevelList;\n this._redrawId = Math.random();\n this._paintList(list, prevList, paintAll, this._redrawId);\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__ && layer.refresh) {\n var clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n if (this._opts.useDirtyRect) {\n this._prevDisplayList = list.slice();\n }\n return this;\n };\n CanvasPainter.prototype.refreshHover = function () {\n this._paintHoverList(this.storage.getDisplayList(false));\n };\n CanvasPainter.prototype._paintHoverList = function (list) {\n var len = list.length;\n var hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n if (!len) {\n return;\n }\n var scope = {\n inHover: true,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var ctx;\n for (var i = 0; i < len; i++) {\n var el = list[i];\n if (el.__inHover) {\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n if (!ctx) {\n ctx = hoverLayer.ctx;\n ctx.save();\n }\n brush(ctx, el, scope, i === len - 1);\n }\n }\n if (ctx) {\n ctx.restore();\n }\n };\n CanvasPainter.prototype.getHoverLayer = function () {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n };\n CanvasPainter.prototype.paintOne = function (ctx, el) {\n brushSingle(ctx, el);\n };\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\n if (this._redrawId !== redrawId) {\n return;\n }\n paintAll = paintAll || false;\n this._updateLayerStatus(list);\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n if (needsRefreshHover) {\n this._paintHoverList(list);\n }\n if (!finished) {\n var self_1 = this;\n requestAnimationFrame(function () {\n self_1._paintList(list, prevList, paintAll, redrawId);\n });\n }\n else {\n this.eachLayer(function (layer) {\n layer.afterBrush && layer.afterBrush();\n });\n }\n };\n CanvasPainter.prototype._compositeManually = function () {\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n var width = this._domRoot.width;\n var height = this._domRoot.height;\n ctx.clearRect(0, 0, width, height);\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n };\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\n var _this = this;\n var layerList = [];\n var useDirtyRect = this._opts.useDirtyRect;\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\n var zlevel = this._zlevelList[zi];\n var layer = this._layers[zlevel];\n if (layer.__builtin__\n && layer !== this._hoverlayer\n && (layer.__dirty || paintAll)) {\n layerList.push(layer);\n }\n }\n var finished = true;\n var needsRefreshHover = false;\n var _loop_1 = function (k) {\n var layer = layerList[k];\n var ctx = layer.ctx;\n var repaintRects = useDirtyRect\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n var useTimer = !paintAll && layer.incremental && Date.now;\n var startTime = useTimer && Date.now();\n var clearColor = layer.zlevel === this_1._zlevelList[0]\n ? this_1._backgroundColor : null;\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor, repaintRects);\n }\n else if (start === layer.__startIndex) {\n var firstEl = list[start];\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n layer.clear(false, clearColor, repaintRects);\n }\n }\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n var i;\n var repaint = function (repaintRect) {\n var scope = {\n inHover: false,\n allClipped: false,\n prevEl: null,\n viewWidth: _this._width,\n viewHeight: _this._height\n };\n for (i = start; i < layer.__endIndex; i++) {\n var el = list[i];\n if (el.__inHover) {\n needsRefreshHover = true;\n }\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n if (useTimer) {\n var dTime = Date.now() - startTime;\n if (dTime > 15) {\n break;\n }\n }\n }\n if (scope.prevElClipPaths) {\n ctx.restore();\n }\n };\n if (repaintRects) {\n if (repaintRects.length === 0) {\n i = layer.__endIndex;\n }\n else {\n var dpr = this_1.dpr;\n for (var r = 0; r < repaintRects.length; ++r) {\n var rect = repaintRects[r];\n ctx.save();\n ctx.beginPath();\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n ctx.clip();\n repaint(rect);\n ctx.restore();\n }\n }\n }\n else {\n ctx.save();\n repaint();\n ctx.restore();\n }\n layer.__drawIndex = i;\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n };\n var this_1 = this;\n for (var k = 0; k < layerList.length; k++) {\n _loop_1(k);\n }\n if (env.wxa) {\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && layer.ctx.draw) {\n layer.ctx.draw();\n }\n });\n }\n return {\n finished: finished,\n needsRefreshHover: needsRefreshHover\n };\n };\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\n var ctx = currentLayer.ctx;\n if (useDirtyRect) {\n var paintRect = el.getPaintRect();\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n brush(ctx, el, scope, isLast);\n el.setPrevPaintRect(paintRect);\n }\n }\n else {\n brush(ctx, el, scope, isLast);\n }\n };\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n var layer = this._layers[zlevel];\n if (!layer) {\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n }\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n if (virtual) {\n layer.virtual = virtual;\n }\n this.insertLayer(zlevel, layer);\n layer.initContext();\n }\n return layer;\n };\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\n var layersMap = this._layers;\n var zlevelList = this._zlevelList;\n var len = zlevelList.length;\n var domRoot = this._domRoot;\n var prevLayer = null;\n var i = -1;\n if (layersMap[zlevel]) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('ZLevel ' + zlevel + ' has been used already');\n }\n return;\n }\n if (!isLayerValid(layer)) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n }\n return;\n }\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (zlevelList[i] < zlevel\n && zlevelList[i + 1] > zlevel) {\n break;\n }\n }\n prevLayer = layersMap[zlevelList[i]];\n }\n zlevelList.splice(i + 1, 0, zlevel);\n layersMap[zlevel] = layer;\n if (!layer.virtual) {\n if (prevLayer) {\n var prevDom = prevLayer.dom;\n if (prevDom.nextSibling) {\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n layer.__painter = this;\n };\n CanvasPainter.prototype.eachLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n };\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.getLayers = function () {\n return this._layers;\n };\n CanvasPainter.prototype._updateLayerStatus = function (list) {\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n function updatePrevLayer(idx) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n prevLayer.__endIndex = idx;\n }\n }\n if (this._singleCanvas) {\n for (var i_1 = 1; i_1 < list.length; i_1++) {\n var el = list[i_1];\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n var prevLayer = null;\n var incrementalLayerCount = 0;\n var prevZlevel;\n var i;\n for (i = 0; i < list.length; i++) {\n var el = list[i];\n var zlevel = el.zlevel;\n var layer = void 0;\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n }\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n }\n else {\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n }\n if (!layer.__builtin__) {\n util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n if (layer !== prevLayer) {\n layer.__used = true;\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n layer.__startIndex = i;\n if (!layer.incremental) {\n layer.__drawIndex = i;\n }\n else {\n layer.__drawIndex = -1;\n }\n updatePrevLayer(i);\n prevLayer = layer;\n }\n if ((el.__dirty & REDRAW_BIT) && !el.__inHover) {\n layer.__dirty = true;\n if (layer.incremental && layer.__drawIndex < 0) {\n layer.__drawIndex = i;\n }\n }\n }\n updatePrevLayer(i);\n this.eachBuiltinLayer(function (layer, z) {\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n }\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n };\n CanvasPainter.prototype.clear = function () {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n };\n CanvasPainter.prototype._clearLayer = function (layer) {\n layer.clear();\n };\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n util.each(this._layers, function (layer) {\n layer.setUnpainted();\n });\n };\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\n if (config) {\n var layerConfig = this._layerConfig;\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n }\n else {\n util.merge(layerConfig[zlevel], config, true);\n }\n for (var i = 0; i < this._zlevelList.length; i++) {\n var _zlevel = this._zlevelList[i];\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n var layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n };\n CanvasPainter.prototype.delLayer = function (zlevel) {\n var layers = this._layers;\n var zlevelList = this._zlevelList;\n var layer = layers[zlevel];\n if (!layer) {\n return;\n }\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n };\n CanvasPainter.prototype.resize = function (width, height) {\n if (!this._domRoot.style) {\n if (width == null || height == null) {\n return;\n }\n this._width = width;\n this._height = height;\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n }\n else {\n var domRoot = this._domRoot;\n domRoot.style.display = 'none';\n var opts = this._opts;\n var root = this.root;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n domRoot.style.display = '';\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n for (var id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n this.refresh(true);\n }\n this._width = width;\n this._height = height;\n }\n return this;\n };\n CanvasPainter.prototype.clearLayer = function (zlevel) {\n var layer = this._layers[zlevel];\n if (layer) {\n layer.clear();\n }\n };\n CanvasPainter.prototype.dispose = function () {\n this.root.innerHTML = '';\n this.root =\n this.storage =\n this._domRoot =\n this._layers = null;\n };\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\n opts = opts || {};\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n var ctx = imageLayer.ctx;\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n var width_1 = imageLayer.dom.width;\n var height_1 = imageLayer.dom.height;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width_1, height_1);\n }\n else if (layer.renderToCanvas) {\n ctx.save();\n layer.renderToCanvas(ctx);\n ctx.restore();\n }\n });\n }\n else {\n var scope = {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var displayList = this.storage.getDisplayList(true);\n for (var i = 0, len = displayList.length; i < len; i++) {\n var el = displayList[i];\n brush(ctx, el, scope, i === len - 1);\n }\n }\n return imageLayer.dom;\n };\n CanvasPainter.prototype.getWidth = function () {\n return this._width;\n };\n CanvasPainter.prototype.getHeight = function () {\n return this._height;\n };\n return CanvasPainter;\n}());\nexport default CanvasPainter;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CanvasPainter from 'zrender/lib/canvas/Painter.js';\nexport function install(registers) {\n registers.registerPainter('canvas', CanvasPainter);\n}","import { isAroundZero } from './helper.js';\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\nvar SVGPathRebuilder = (function () {\n function SVGPathRebuilder() {\n }\n SVGPathRebuilder.prototype.reset = function (precision) {\n this._start = true;\n this._d = [];\n this._str = '';\n this._p = Math.pow(10, precision || 4);\n };\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\n this._add('M', x, y);\n };\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\n this._add('L', x, y);\n };\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n this._add('C', x, y, x2, y2, x3, y3);\n };\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n this._add('Q', x, y, x2, y2);\n };\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n };\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n var dTheta = endAngle - startAngle;\n var clockwise = !anticlockwise;\n var dThetaPositive = Math.abs(dTheta);\n var isCircle = isAroundZero(dThetaPositive - PI2)\n || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n var unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n var large = false;\n if (isCircle) {\n large = true;\n }\n else if (isAroundZero(dThetaPositive)) {\n large = false;\n }\n else {\n large = (unifiedTheta >= PI) === !!clockwise;\n }\n var x0 = cx + rx * mathCos(startAngle);\n var y0 = cy + ry * mathSin(startAngle);\n if (this._start) {\n this._add('M', x0, y0);\n }\n var xRot = Math.round(psi * degree);\n if (isCircle) {\n var p = 1 / this._p;\n var dTheta_1 = (clockwise ? 1 : -1) * (PI2 - p);\n this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));\n if (p > 1e-2) {\n this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n }\n }\n else {\n var x = cx + rx * mathCos(endAngle);\n var y = cy + ry * mathSin(endAngle);\n this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n }\n };\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n this._add('M', x, y);\n this._add('l', w, 0);\n this._add('l', 0, h);\n this._add('l', -w, 0);\n this._add('Z');\n };\n SVGPathRebuilder.prototype.closePath = function () {\n if (this._d.length > 0) {\n this._add('Z');\n }\n };\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n var vals = [];\n var p = this._p;\n for (var i = 1; i < arguments.length; i++) {\n var val = arguments[i];\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n vals.push(Math.round(val * p) / p);\n }\n this._d.push(cmd + vals.join(' '));\n this._start = cmd === 'Z';\n };\n SVGPathRebuilder.prototype.generateStr = function () {\n this._str = this._invalid ? '' : this._d.join('');\n this._d = [];\n };\n SVGPathRebuilder.prototype.getStr = function () {\n return this._str;\n };\n return SVGPathRebuilder;\n}());\nexport default SVGPathRebuilder;\n","import { DEFAULT_PATH_STYLE } from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineDash } from '../canvas/dashStyle.js';\nimport { map } from '../core/util.js';\nimport { normalizeColor } from './helper.js';\nvar NONE = 'none';\nvar mathRound = Math.round;\nfunction pathHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== NONE;\n}\nfunction pathHasStroke(style) {\n var stroke = style.stroke;\n return stroke != null && stroke !== NONE;\n}\nvar strokeProps = ['lineCap', 'miterLimit', 'lineJoin'];\nvar svgStrokeProps = map(strokeProps, function (prop) { return \"stroke-\" + prop.toLowerCase(); });\nexport default function mapStyleToAttrs(updateAttr, style, el, forceUpdate) {\n var opacity = style.opacity == null ? 1 : style.opacity;\n if (el instanceof ZRImage) {\n updateAttr('opacity', opacity);\n return;\n }\n if (pathHasFill(style)) {\n var fill = normalizeColor(style.fill);\n updateAttr('fill', fill.color);\n var fillOpacity = style.fillOpacity != null\n ? style.fillOpacity * fill.opacity * opacity\n : fill.opacity * opacity;\n if (forceUpdate || fillOpacity < 1) {\n updateAttr('fill-opacity', fillOpacity);\n }\n }\n else {\n updateAttr('fill', NONE);\n }\n if (pathHasStroke(style)) {\n var stroke = normalizeColor(style.stroke);\n updateAttr('stroke', stroke.color);\n var strokeScale = style.strokeNoScale\n ? el.getLineScale()\n : 1;\n var strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0);\n var strokeOpacity = style.strokeOpacity != null\n ? style.strokeOpacity * stroke.opacity * opacity\n : stroke.opacity * opacity;\n var strokeFirst = style.strokeFirst;\n if (forceUpdate || strokeWidth !== 1) {\n updateAttr('stroke-width', strokeWidth);\n }\n if (forceUpdate || strokeFirst) {\n updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n }\n if (forceUpdate || strokeOpacity < 1) {\n updateAttr('stroke-opacity', strokeOpacity);\n }\n if (style.lineDash) {\n var _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n if (lineDash) {\n lineDashOffset = mathRound(lineDashOffset || 0);\n updateAttr('stroke-dasharray', lineDash.join(','));\n if (lineDashOffset || forceUpdate) {\n updateAttr('stroke-dashoffset', lineDashOffset);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke-dasharray', NONE);\n }\n for (var i = 0; i < strokeProps.length; i++) {\n var propName = strokeProps[i];\n if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n var val = style[propName] || DEFAULT_PATH_STYLE[propName];\n val && updateAttr(svgStrokeProps[i], val);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke', NONE);\n }\n}\n","import { keys, map } from '../core/util.js';\nimport { encodeHTML } from '../core/dom.js';\nexport var SVGNS = 'http://www.w3.org/2000/svg';\nexport var XLINKNS = 'http://www.w3.org/1999/xlink';\nexport var XMLNS = 'http://www.w3.org/2000/xmlns/';\nexport var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\nexport function createElement(name) {\n return document.createElementNS(SVGNS, name);\n}\n;\nexport function createVNode(tag, key, attrs, children, text) {\n return {\n tag: tag,\n attrs: attrs || {},\n children: children,\n text: text,\n key: key\n };\n}\nfunction createElementOpen(name, attrs) {\n var attrsStr = [];\n if (attrs) {\n for (var key in attrs) {\n var val = attrs[key];\n var part = key;\n if (val === false) {\n continue;\n }\n else if (val !== true && val != null) {\n part += \"=\\\"\" + val + \"\\\"\";\n }\n attrsStr.push(part);\n }\n }\n return \"<\" + name + \" \" + attrsStr.join(' ') + \">\";\n}\nfunction createElementClose(name) {\n return \"\";\n}\nexport function vNodeToString(el, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n function convertElToString(el) {\n var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text;\n return createElementOpen(tag, attrs)\n + (tag !== 'style' ? encodeHTML(text) : text || '')\n + (children ? \"\" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '')\n + createElementClose(tag);\n }\n return convertElToString(el);\n}\nexport function getCssString(selectorNodes, animationNodes, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n var bracketBegin = \" {\" + S;\n var bracketEnd = S + \"}\";\n var selectors = map(keys(selectorNodes), function (className) {\n return className + bracketBegin + map(keys(selectorNodes[className]), function (attrName) {\n return attrName + \":\" + selectorNodes[className][attrName] + \";\";\n }).join(S) + bracketEnd;\n }).join(S);\n var animations = map(keys(animationNodes), function (animationName) {\n return \"@keyframes \" + animationName + bracketBegin + map(keys(animationNodes[animationName]), function (percent) {\n return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), function (attrName) {\n var val = animationNodes[animationName][percent][attrName];\n if (attrName === 'd') {\n val = \"path(\\\"\" + val + \"\\\")\";\n }\n return attrName + \":\" + val + \";\";\n }).join(S) + bracketEnd;\n }).join(S) + bracketEnd;\n }).join(S);\n if (!selectors && !animations) {\n return '';\n }\n return [''].join(S);\n}\nexport function createBrushScope(zrId) {\n return {\n zrId: zrId,\n shadowCache: {},\n patternCache: {},\n gradientCache: {},\n clipPathCache: {},\n defs: {},\n cssNodes: {},\n cssAnims: {},\n cssClassIdx: 0,\n cssAnimIdx: 0,\n shadowIdx: 0,\n gradientIdx: 0,\n patternIdx: 0,\n clipPathIdx: 0\n };\n}\nexport function createSVGVNode(width, height, children, useViewBox) {\n return createVNode('svg', 'root', {\n 'width': width,\n 'height': height,\n 'xmlns': SVGNS,\n 'xmlns:xlink': XLINKNS,\n 'version': '1.1',\n 'baseProfile': 'full',\n 'viewBox': useViewBox ? \"0 0 \" + width + \" \" + height : false\n }, children);\n}\n","import { copyTransform } from '../core/Transformable.js';\nimport { createBrushScope } from './core.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { getPathPrecision, getSRTTransformString } from './helper.js';\nimport { each, extend, filter, isNumber, isString, keys } from '../core/util.js';\nimport CompoundPath from '../graphic/CompoundPath.js';\nimport { createCubicEasingFunc } from '../animation/cubicEasing.js';\nexport var EASING_MAP = {\n cubicIn: '0.32,0,0.67,0',\n cubicOut: '0.33,1,0.68,1',\n cubicInOut: '0.65,0,0.35,1',\n quadraticIn: '0.11,0,0.5,0',\n quadraticOut: '0.5,1,0.89,1',\n quadraticInOut: '0.45,0,0.55,1',\n quarticIn: '0.5,0,0.75,0',\n quarticOut: '0.25,1,0.5,1',\n quarticInOut: '0.76,0,0.24,1',\n quinticIn: '0.64,0,0.78,0',\n quinticOut: '0.22,1,0.36,1',\n quinticInOut: '0.83,0,0.17,1',\n sinusoidalIn: '0.12,0,0.39,0',\n sinusoidalOut: '0.61,1,0.88,1',\n sinusoidalInOut: '0.37,0,0.63,1',\n exponentialIn: '0.7,0,0.84,0',\n exponentialOut: '0.16,1,0.3,1',\n exponentialInOut: '0.87,0,0.13,1',\n circularIn: '0.55,0,1,0.45',\n circularOut: '0,0.55,0.45,1',\n circularInOut: '0.85,0,0.15,1'\n};\nvar transformOriginKey = 'transform-origin';\nfunction buildPathString(el, kfShape, path) {\n var shape = extend({}, el.shape);\n extend(shape, kfShape);\n el.buildPath(path, shape);\n var svgPathBuilder = new SVGPathRebuilder();\n svgPathBuilder.reset(getPathPrecision(el));\n path.rebuildPath(svgPathBuilder, 1);\n svgPathBuilder.generateStr();\n return svgPathBuilder.getStr();\n}\nfunction setTransformOrigin(target, transform) {\n var originX = transform.originX, originY = transform.originY;\n if (originX || originY) {\n target[transformOriginKey] = originX + \"px \" + originY + \"px\";\n }\n}\nexport var ANIMATE_STYLE_MAP = {\n fill: 'fill',\n opacity: 'opacity',\n lineWidth: 'stroke-width',\n lineDashOffset: 'stroke-dashoffset'\n};\nfunction addAnimation(cssAnim, scope) {\n var animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++;\n scope.cssAnims[animationName] = cssAnim;\n return animationName;\n}\nfunction createCompoundPathCSSAnimation(el, attrs, scope) {\n var paths = el.shape.paths;\n var composedAnim = {};\n var cssAnimationCfg;\n var cssAnimationName;\n each(paths, function (path) {\n var subScope = createBrushScope(scope.zrId);\n subScope.animation = true;\n createCSSAnimation(path, {}, subScope, true);\n var cssAnims = subScope.cssAnims;\n var cssNodes = subScope.cssNodes;\n var animNames = keys(cssAnims);\n var len = animNames.length;\n if (!len) {\n return;\n }\n cssAnimationName = animNames[len - 1];\n var lastAnim = cssAnims[cssAnimationName];\n for (var percent in lastAnim) {\n var kf = lastAnim[percent];\n composedAnim[percent] = composedAnim[percent] || { d: '' };\n composedAnim[percent].d += kf.d || '';\n }\n for (var className in cssNodes) {\n var val = cssNodes[className].animation;\n if (val.indexOf(cssAnimationName) >= 0) {\n cssAnimationCfg = val;\n }\n }\n });\n if (!cssAnimationCfg) {\n return;\n }\n attrs.d = false;\n var animationName = addAnimation(composedAnim, scope);\n return cssAnimationCfg.replace(cssAnimationName, animationName);\n}\nfunction getEasingFunc(easing) {\n return isString(easing)\n ? EASING_MAP[easing]\n ? \"cubic-bezier(\" + EASING_MAP[easing] + \")\"\n : createCubicEasingFunc(easing) ? easing : ''\n : '';\n}\nexport function createCSSAnimation(el, attrs, scope, onlyShape) {\n var animators = el.animators;\n var len = animators.length;\n var cssAnimations = [];\n if (el instanceof CompoundPath) {\n var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n else if (!len) {\n return;\n }\n }\n else if (!len) {\n return;\n }\n var groupAnimators = {};\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var cfgArr = [animator.getMaxTime() / 1000 + 's'];\n var easing = getEasingFunc(animator.getClip().easing);\n var delay = animator.getDelay();\n if (easing) {\n cfgArr.push(easing);\n }\n else {\n cfgArr.push('linear');\n }\n if (delay) {\n cfgArr.push(delay / 1000 + 's');\n }\n if (animator.getLoop()) {\n cfgArr.push('infinite');\n }\n var cfg = cfgArr.join(' ');\n groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []];\n groupAnimators[cfg][1].push(animator);\n }\n function createSingleCSSAnimation(groupAnimator) {\n var animators = groupAnimator[1];\n var len = animators.length;\n var transformKfs = {};\n var shapeKfs = {};\n var finalKfs = {};\n var animationTimingFunctionAttrName = 'animation-timing-function';\n function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) {\n var tracks = animator.getTracks();\n var maxTime = animator.getMaxTime();\n for (var k = 0; k < tracks.length; k++) {\n var track = tracks[k];\n if (track.needsAnimate()) {\n var kfs = track.keyframes;\n var attrName = track.propName;\n toCssAttrName && (attrName = toCssAttrName(attrName));\n if (attrName) {\n for (var i = 0; i < kfs.length; i++) {\n var kf = kfs[i];\n var percent = Math.round(kf.time / maxTime * 100) + '%';\n var kfEasing = getEasingFunc(kf.easing);\n var rawValue = kf.rawValue;\n if (isString(rawValue) || isNumber(rawValue)) {\n cssKfs[percent] = cssKfs[percent] || {};\n cssKfs[percent][attrName] = kf.rawValue;\n if (kfEasing) {\n cssKfs[percent][animationTimingFunctionAttrName] = kfEasing;\n }\n }\n }\n }\n }\n }\n }\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (!targetProp) {\n !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs);\n }\n else if (targetProp === 'shape') {\n saveAnimatorTrackToCssKfs(animator, shapeKfs);\n }\n }\n for (var percent in transformKfs) {\n var transform = {};\n copyTransform(transform, el);\n extend(transform, transformKfs[percent]);\n var str = getSRTTransformString(transform);\n var timingFunction = transformKfs[percent][animationTimingFunctionAttrName];\n finalKfs[percent] = str ? {\n transform: str\n } : {};\n setTransformOrigin(finalKfs[percent], transform);\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n var path;\n var canAnimateShape = true;\n for (var percent in shapeKfs) {\n finalKfs[percent] = finalKfs[percent] || {};\n var isFirst = !path;\n var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];\n if (isFirst) {\n path = new PathProxy();\n }\n var len_1 = path.len();\n path.reset();\n finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path);\n var newLen = path.len();\n if (!isFirst && len_1 !== newLen) {\n canAnimateShape = false;\n break;\n }\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n if (!canAnimateShape) {\n for (var percent in finalKfs) {\n delete finalKfs[percent].d;\n }\n }\n if (!onlyShape) {\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (targetProp === 'style') {\n saveAnimatorTrackToCssKfs(animator, finalKfs, function (propName) { return ANIMATE_STYLE_MAP[propName]; });\n }\n }\n }\n var percents = keys(finalKfs);\n var allTransformOriginSame = true;\n var transformOrigin;\n for (var i = 1; i < percents.length; i++) {\n var p0 = percents[i - 1];\n var p1 = percents[i];\n if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {\n allTransformOriginSame = false;\n break;\n }\n transformOrigin = finalKfs[p0][transformOriginKey];\n }\n if (allTransformOriginSame && transformOrigin) {\n for (var percent in finalKfs) {\n if (finalKfs[percent][transformOriginKey]) {\n delete finalKfs[percent][transformOriginKey];\n }\n }\n attrs[transformOriginKey] = transformOrigin;\n }\n if (filter(percents, function (percent) { return keys(finalKfs[percent]).length > 0; }).length) {\n var animationName = addAnimation(finalKfs, scope);\n return animationName + \" \" + groupAnimator[0] + \" both\";\n }\n }\n for (var key in groupAnimators) {\n var animationCfg = createSingleCSSAnimation(groupAnimators[key]);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n }\n if (cssAnimations.length) {\n var className = scope.zrId + '-cls-' + scope.cssClassIdx++;\n scope.cssNodes['.' + className] = {\n animation: cssAnimations.join(',')\n };\n attrs[\"class\"] = className;\n }\n}\n","import { adjustTextY, getIdURL, getMatrixStr, getPathPrecision, getShadowKey, getSRTTransformString, hasShadow, isAroundZero, isGradient, isImagePattern, isLinearGradient, isPattern, isRadialGradient, normalizeColor, round4, TEXT_ALIGN_TO_ANCHOR } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineHeight } from '../contain/text.js';\nimport TSpan from '../graphic/TSpan.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport mapStyleToAttrs from './mapStyleToAttrs.js';\nimport { createVNode, vNodeToString } from './core.js';\nimport { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util.js';\nimport { createOrUpdateImage } from '../graphic/helper/image.js';\nimport { createCSSAnimation } from './cssAnimation.js';\nimport { hasSeparateFont, parseFontSize } from '../graphic/Text.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_FAMILY } from '../core/platform.js';\nvar round = Math.round;\nfunction isImageLike(val) {\n return val && isString(val.src);\n}\nfunction isCanvasLike(val) {\n return val && isFunction(val.toDataURL);\n}\nfunction setStyleAttrs(attrs, style, el, scope) {\n mapStyleToAttrs(function (key, val) {\n var isFillStroke = key === 'fill' || key === 'stroke';\n if (isFillStroke && isGradient(val)) {\n setGradient(style, attrs, key, scope);\n }\n else if (isFillStroke && isPattern(val)) {\n setPattern(el, attrs, key, scope);\n }\n else {\n attrs[key] = val;\n }\n }, style, el, false);\n setShadow(el, attrs, scope);\n}\nfunction noRotateScale(m) {\n return isAroundZero(m[0] - 1)\n && isAroundZero(m[1])\n && isAroundZero(m[2])\n && isAroundZero(m[3] - 1);\n}\nfunction noTranslate(m) {\n return isAroundZero(m[4]) && isAroundZero(m[5]);\n}\nfunction setTransform(attrs, m, compress) {\n if (m && !(noTranslate(m) && noRotateScale(m))) {\n var mul = compress ? 10 : 1e4;\n attrs.transform = noRotateScale(m)\n ? \"translate(\" + round(m[4] * mul) / mul + \" \" + round(m[5] * mul) / mul + \")\" : getMatrixStr(m);\n }\n}\nfunction convertPolyShape(shape, attrs, mul) {\n var points = shape.points;\n var strArr = [];\n for (var i = 0; i < points.length; i++) {\n strArr.push(round(points[i][0] * mul) / mul);\n strArr.push(round(points[i][1] * mul) / mul);\n }\n attrs.points = strArr.join(' ');\n}\nfunction validatePolyShape(shape) {\n return !shape.smooth;\n}\nfunction createAttrsConvert(desc) {\n var normalizedDesc = map(desc, function (item) {\n return (typeof item === 'string' ? [item, item] : item);\n });\n return function (shape, attrs, mul) {\n for (var i = 0; i < normalizedDesc.length; i++) {\n var item = normalizedDesc[i];\n var val = shape[item[0]];\n if (val != null) {\n attrs[item[1]] = round(val * mul) / mul;\n }\n }\n };\n}\nvar builtinShapesDef = {\n circle: [createAttrsConvert(['cx', 'cy', 'r'])],\n polyline: [convertPolyShape, validatePolyShape],\n polygon: [convertPolyShape, validatePolyShape]\n};\nfunction hasShapeAnimation(el) {\n var animators = el.animators;\n for (var i = 0; i < animators.length; i++) {\n if (animators[i].targetName === 'shape') {\n return true;\n }\n }\n return false;\n}\nexport function brushSVGPath(el, scope) {\n var style = el.style;\n var shape = el.shape;\n var builtinShpDef = builtinShapesDef[el.type];\n var attrs = {};\n var needsAnimate = scope.animation;\n var svgElType = 'path';\n var strokePercent = el.style.strokePercent;\n var precision = (scope.compress && getPathPrecision(el)) || 4;\n if (builtinShpDef\n && !scope.willUpdate\n && !(builtinShpDef[1] && !builtinShpDef[1](shape))\n && !(needsAnimate && hasShapeAnimation(el))\n && !(strokePercent < 1)) {\n svgElType = el.type;\n var mul = Math.pow(10, precision);\n builtinShpDef[0](shape, attrs, mul);\n }\n else {\n var needBuildPath = !el.path || el.shapeChanged();\n if (!el.path) {\n el.createPathProxy();\n }\n var path = el.path;\n if (needBuildPath) {\n path.beginPath();\n el.buildPath(path, el.shape);\n el.pathUpdated();\n }\n var pathVersion = path.getVersion();\n var elExt = el;\n var svgPathBuilder = elExt.__svgPathBuilder;\n if (elExt.__svgPathVersion !== pathVersion\n || !svgPathBuilder\n || strokePercent !== elExt.__svgPathStrokePercent) {\n if (!svgPathBuilder) {\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n }\n svgPathBuilder.reset(precision);\n path.rebuildPath(svgPathBuilder, strokePercent);\n svgPathBuilder.generateStr();\n elExt.__svgPathVersion = pathVersion;\n elExt.__svgPathStrokePercent = strokePercent;\n }\n attrs.d = svgPathBuilder.getStr();\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode(svgElType, el.id + '', attrs);\n}\nexport function brushSVGImage(el, scope) {\n var style = el.style;\n var image = style.image;\n if (image && !isString(image)) {\n if (isImageLike(image)) {\n image = image.src;\n }\n else if (isCanvasLike(image)) {\n image = image.toDataURL();\n }\n }\n if (!image) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var dw = style.width;\n var dh = style.height;\n var attrs = {\n href: image,\n width: dw,\n height: dh\n };\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('image', el.id + '', attrs);\n}\n;\nexport function brushSVGTSpan(el, scope) {\n var style = el.style;\n var text = style.text;\n text != null && (text += '');\n if (!text || isNaN(style.x) || isNaN(style.y)) {\n return;\n }\n var font = style.font || DEFAULT_FONT;\n var x = style.x || 0;\n var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\n || style.textAlign;\n var attrs = {\n 'dominant-baseline': 'central',\n 'text-anchor': textAlign\n };\n if (hasSeparateFont(style)) {\n var separatedFontStr = '';\n var fontStyle = style.fontStyle;\n var fontSize = parseFontSize(style.fontSize);\n if (!parseFloat(fontSize)) {\n return;\n }\n var fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY;\n var fontWeight = style.fontWeight;\n separatedFontStr += \"font-size:\" + fontSize + \";font-family:\" + fontFamily + \";\";\n if (fontStyle && fontStyle !== 'normal') {\n separatedFontStr += \"font-style:\" + fontStyle + \";\";\n }\n if (fontWeight && fontWeight !== 'normal') {\n separatedFontStr += \"font-weight:\" + fontWeight + \";\";\n }\n attrs.style = separatedFontStr;\n }\n else {\n attrs.style = \"font: \" + font;\n }\n if (text.match(/\\s/)) {\n attrs['xml:space'] = 'preserve';\n }\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('text', el.id + '', attrs, undefined, text);\n}\nexport function brush(el, scope) {\n if (el instanceof Path) {\n return brushSVGPath(el, scope);\n }\n else if (el instanceof ZRImage) {\n return brushSVGImage(el, scope);\n }\n else if (el instanceof TSpan) {\n return brushSVGTSpan(el, scope);\n }\n}\nfunction setShadow(el, attrs, scope) {\n var style = el.style;\n if (hasShadow(style)) {\n var shadowKey = getShadowKey(el);\n var shadowCache = scope.shadowCache;\n var shadowId = shadowCache[shadowKey];\n if (!shadowId) {\n var globalScale = el.getGlobalScale();\n var scaleX = globalScale[0];\n var scaleY = globalScale[1];\n if (!scaleX || !scaleY) {\n return;\n }\n var offsetX = style.shadowOffsetX || 0;\n var offsetY = style.shadowOffsetY || 0;\n var blur_1 = style.shadowBlur;\n var _a = normalizeColor(style.shadowColor), opacity = _a.opacity, color = _a.color;\n var stdDx = blur_1 / 2 / scaleX;\n var stdDy = blur_1 / 2 / scaleY;\n var stdDeviation = stdDx + ' ' + stdDy;\n shadowId = scope.zrId + '-s' + scope.shadowIdx++;\n scope.defs[shadowId] = createVNode('filter', shadowId, {\n 'id': shadowId,\n 'x': '-100%',\n 'y': '-100%',\n 'width': '300%',\n 'height': '300%'\n }, [\n createVNode('feDropShadow', '', {\n 'dx': offsetX / scaleX,\n 'dy': offsetY / scaleY,\n 'stdDeviation': stdDeviation,\n 'flood-color': color,\n 'flood-opacity': opacity\n })\n ]);\n shadowCache[shadowKey] = shadowId;\n }\n attrs.filter = getIdURL(shadowId);\n }\n}\nexport function setGradient(style, attrs, target, scope) {\n var val = style[target];\n var gradientTag;\n var gradientAttrs = {\n 'gradientUnits': val.global\n ? 'userSpaceOnUse'\n : 'objectBoundingBox'\n };\n if (isLinearGradient(val)) {\n gradientTag = 'linearGradient';\n gradientAttrs.x1 = val.x;\n gradientAttrs.y1 = val.y;\n gradientAttrs.x2 = val.x2;\n gradientAttrs.y2 = val.y2;\n }\n else if (isRadialGradient(val)) {\n gradientTag = 'radialGradient';\n gradientAttrs.cx = retrieve2(val.x, 0.5);\n gradientAttrs.cy = retrieve2(val.y, 0.5);\n gradientAttrs.r = retrieve2(val.r, 0.5);\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logError('Illegal gradient type.');\n }\n return;\n }\n var colors = val.colorStops;\n var colorStops = [];\n for (var i = 0, len = colors.length; i < len; ++i) {\n var offset = round4(colors[i].offset) * 100 + '%';\n var stopColor = colors[i].color;\n var _a = normalizeColor(stopColor), color = _a.color, opacity = _a.opacity;\n var stopsAttrs = {\n 'offset': offset\n };\n stopsAttrs['stop-color'] = color;\n if (opacity < 1) {\n stopsAttrs['stop-opacity'] = opacity;\n }\n colorStops.push(createVNode('stop', i + '', stopsAttrs));\n }\n var gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops);\n var gradientKey = vNodeToString(gradientVNode);\n var gradientCache = scope.gradientCache;\n var gradientId = gradientCache[gradientKey];\n if (!gradientId) {\n gradientId = scope.zrId + '-g' + scope.gradientIdx++;\n gradientCache[gradientKey] = gradientId;\n gradientAttrs.id = gradientId;\n scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops);\n }\n attrs[target] = getIdURL(gradientId);\n}\nexport function setPattern(el, attrs, target, scope) {\n var val = el.style[target];\n var boundingRect = el.getBoundingRect();\n var patternAttrs = {};\n var repeat = val.repeat;\n var noRepeat = repeat === 'no-repeat';\n var repeatX = repeat === 'repeat-x';\n var repeatY = repeat === 'repeat-y';\n var child;\n if (isImagePattern(val)) {\n var imageWidth_1 = val.imageWidth;\n var imageHeight_1 = val.imageHeight;\n var imageSrc = void 0;\n var patternImage = val.image;\n if (isString(patternImage)) {\n imageSrc = patternImage;\n }\n else if (isImageLike(patternImage)) {\n imageSrc = patternImage.src;\n }\n else if (isCanvasLike(patternImage)) {\n imageSrc = patternImage.toDataURL();\n }\n if (typeof Image === 'undefined') {\n var errMsg = 'Image width/height must been given explictly in svg-ssr renderer.';\n assert(imageWidth_1, errMsg);\n assert(imageHeight_1, errMsg);\n }\n else if (imageWidth_1 == null || imageHeight_1 == null) {\n var setSizeToVNode_1 = function (vNode, img) {\n if (vNode) {\n var svgEl = vNode.elm;\n var width = imageWidth_1 || img.width;\n var height = imageHeight_1 || img.height;\n if (vNode.tag === 'pattern') {\n if (repeatX) {\n height = 1;\n width /= boundingRect.width;\n }\n else if (repeatY) {\n width = 1;\n height /= boundingRect.height;\n }\n }\n vNode.attrs.width = width;\n vNode.attrs.height = height;\n if (svgEl) {\n svgEl.setAttribute('width', width);\n svgEl.setAttribute('height', height);\n }\n }\n };\n var createdImage = createOrUpdateImage(imageSrc, null, el, function (img) {\n noRepeat || setSizeToVNode_1(patternVNode, img);\n setSizeToVNode_1(child, img);\n });\n if (createdImage && createdImage.width && createdImage.height) {\n imageWidth_1 = imageWidth_1 || createdImage.width;\n imageHeight_1 = imageHeight_1 || createdImage.height;\n }\n }\n child = createVNode('image', 'img', {\n href: imageSrc,\n width: imageWidth_1,\n height: imageHeight_1\n });\n patternAttrs.width = imageWidth_1;\n patternAttrs.height = imageHeight_1;\n }\n else if (val.svgElement) {\n child = clone(val.svgElement);\n patternAttrs.width = val.svgWidth;\n patternAttrs.height = val.svgHeight;\n }\n if (!child) {\n return;\n }\n var patternWidth;\n var patternHeight;\n if (noRepeat) {\n patternWidth = patternHeight = 1;\n }\n else if (repeatX) {\n patternHeight = 1;\n patternWidth = patternAttrs.width / boundingRect.width;\n }\n else if (repeatY) {\n patternWidth = 1;\n patternHeight = patternAttrs.height / boundingRect.height;\n }\n else {\n patternAttrs.patternUnits = 'userSpaceOnUse';\n }\n if (patternWidth != null && !isNaN(patternWidth)) {\n patternAttrs.width = patternWidth;\n }\n if (patternHeight != null && !isNaN(patternHeight)) {\n patternAttrs.height = patternHeight;\n }\n var patternTransform = getSRTTransformString(val);\n patternTransform && (patternAttrs.patternTransform = patternTransform);\n var patternVNode = createVNode('pattern', '', patternAttrs, [child]);\n var patternKey = vNodeToString(patternVNode);\n var patternCache = scope.patternCache;\n var patternId = patternCache[patternKey];\n if (!patternId) {\n patternId = scope.zrId + '-p' + scope.patternIdx++;\n patternCache[patternKey] = patternId;\n patternAttrs.id = patternId;\n patternVNode = scope.defs[patternId] = createVNode('pattern', patternId, patternAttrs, [child]);\n }\n attrs[target] = getIdURL(patternId);\n}\nexport function setClipPath(clipPath, attrs, scope) {\n var clipPathCache = scope.clipPathCache, defs = scope.defs;\n var clipPathId = clipPathCache[clipPath.id];\n if (!clipPathId) {\n clipPathId = scope.zrId + '-c' + scope.clipPathIdx++;\n var clipPathAttrs = {\n id: clipPathId\n };\n clipPathCache[clipPath.id] = clipPathId;\n defs[clipPathId] = createVNode('clipPath', clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]);\n }\n attrs['clip-path'] = getIdURL(clipPathId);\n}\n","export function createTextNode(text) {\n return document.createTextNode(text);\n}\nexport function createComment(text) {\n return document.createComment(text);\n}\nexport function insertBefore(parentNode, newNode, referenceNode) {\n parentNode.insertBefore(newNode, referenceNode);\n}\nexport function removeChild(node, child) {\n node.removeChild(child);\n}\nexport function appendChild(node, child) {\n node.appendChild(child);\n}\nexport function parentNode(node) {\n return node.parentNode;\n}\nexport function nextSibling(node) {\n return node.nextSibling;\n}\nexport function tagName(elm) {\n return elm.tagName;\n}\nexport function setTextContent(node, text) {\n node.textContent = text;\n}\nexport function getTextContent(node) {\n return node.textContent;\n}\nexport function isElement(node) {\n return node.nodeType === 1;\n}\nexport function isText(node) {\n return node.nodeType === 3;\n}\nexport function isComment(node) {\n return node.nodeType === 8;\n}\n","import { isArray, isObject } from '../core/util.js';\nimport { createElement, createVNode, XMLNS, XML_NAMESPACE, XLINKNS } from './core.js';\nimport * as api from './domapi.js';\nvar colonChar = 58;\nvar xChar = 120;\nvar emptyNode = createVNode('', '');\nfunction isUndef(s) {\n return s === undefined;\n}\nfunction isDef(s) {\n return s !== undefined;\n}\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n var map = {};\n for (var i = beginIdx; i <= endIdx; ++i) {\n var key = children[i].key;\n if (key !== undefined) {\n if (process.env.NODE_ENV !== 'production') {\n if (map[key] != null) {\n console.error(\"Duplicate key \" + key);\n }\n }\n map[key] = i;\n }\n }\n return map;\n}\nfunction sameVnode(vnode1, vnode2) {\n var isSameKey = vnode1.key === vnode2.key;\n var isSameTag = vnode1.tag === vnode2.tag;\n return isSameTag && isSameKey;\n}\nfunction createElm(vnode) {\n var i;\n var children = vnode.children;\n var tag = vnode.tag;\n if (isDef(tag)) {\n var elm = (vnode.elm = createElement(tag));\n updateAttrs(emptyNode, vnode);\n if (isArray(children)) {\n for (i = 0; i < children.length; ++i) {\n var ch = children[i];\n if (ch != null) {\n api.appendChild(elm, createElm(ch));\n }\n }\n }\n else if (isDef(vnode.text) && !isObject(vnode.text)) {\n api.appendChild(elm, api.createTextNode(vnode.text));\n }\n }\n else {\n vnode.elm = api.createTextNode(vnode.text);\n }\n return vnode.elm;\n}\nfunction addVnodes(parentElm, before, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n api.insertBefore(parentElm, createElm(ch), before);\n }\n }\n}\nfunction removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n if (isDef(ch.tag)) {\n var parent_1 = api.parentNode(ch.elm);\n api.removeChild(parent_1, ch.elm);\n }\n else {\n api.removeChild(parentElm, ch.elm);\n }\n }\n }\n}\nexport function updateAttrs(oldVnode, vnode) {\n var key;\n var elm = vnode.elm;\n var oldAttrs = oldVnode && oldVnode.attrs || {};\n var attrs = vnode.attrs || {};\n if (oldAttrs === attrs) {\n return;\n }\n for (key in attrs) {\n var cur = attrs[key];\n var old = oldAttrs[key];\n if (old !== cur) {\n if (cur === true) {\n elm.setAttribute(key, '');\n }\n else if (cur === false) {\n elm.removeAttribute(key);\n }\n else {\n if (key.charCodeAt(0) !== xChar) {\n elm.setAttribute(key, cur);\n }\n else if (key === 'xmlns:xlink' || key === 'xmlns') {\n elm.setAttributeNS(XMLNS, key, cur);\n }\n else if (key.charCodeAt(3) === colonChar) {\n elm.setAttributeNS(XML_NAMESPACE, key, cur);\n }\n else if (key.charCodeAt(5) === colonChar) {\n elm.setAttributeNS(XLINKNS, key, cur);\n }\n else {\n elm.setAttribute(key, cur);\n }\n }\n }\n }\n for (key in oldAttrs) {\n if (!(key in attrs)) {\n elm.removeAttribute(key);\n }\n }\n}\nfunction updateChildren(parentElm, oldCh, newCh) {\n var oldStartIdx = 0;\n var newStartIdx = 0;\n var oldEndIdx = oldCh.length - 1;\n var oldStartVnode = oldCh[0];\n var oldEndVnode = oldCh[oldEndIdx];\n var newEndIdx = newCh.length - 1;\n var newStartVnode = newCh[0];\n var newEndVnode = newCh[newEndIdx];\n var oldKeyToIdx;\n var idxInOld;\n var elmToMove;\n var before;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n }\n else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n }\n else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n }\n else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newEndVnode)) {\n patchVnode(oldStartVnode, newEndVnode);\n api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldEndVnode, newStartVnode)) {\n patchVnode(oldEndVnode, newStartVnode);\n api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else {\n if (isUndef(oldKeyToIdx)) {\n oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n }\n idxInOld = oldKeyToIdx[newStartVnode.key];\n if (isUndef(idxInOld)) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.tag !== newStartVnode.tag) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n patchVnode(elmToMove, newStartVnode);\n oldCh[idxInOld] = undefined;\n api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);\n }\n }\n newStartVnode = newCh[++newStartIdx];\n }\n }\n if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {\n if (oldStartIdx > oldEndIdx) {\n before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;\n addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);\n }\n else {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n}\nfunction patchVnode(oldVnode, vnode) {\n var elm = (vnode.elm = oldVnode.elm);\n var oldCh = oldVnode.children;\n var ch = vnode.children;\n if (oldVnode === vnode) {\n return;\n }\n updateAttrs(oldVnode, vnode);\n if (isUndef(vnode.text)) {\n if (isDef(oldCh) && isDef(ch)) {\n if (oldCh !== ch) {\n updateChildren(elm, oldCh, ch);\n }\n }\n else if (isDef(ch)) {\n if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n addVnodes(elm, null, ch, 0, ch.length - 1);\n }\n else if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n else if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n }\n else if (oldVnode.text !== vnode.text) {\n if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n api.setTextContent(elm, vnode.text);\n }\n}\nexport default function patch(oldVnode, vnode) {\n if (sameVnode(oldVnode, vnode)) {\n patchVnode(oldVnode, vnode);\n }\n else {\n var elm = oldVnode.elm;\n var parent_2 = api.parentNode(elm);\n createElm(vnode);\n if (parent_2 !== null) {\n api.insertBefore(parent_2, vnode.elm, api.nextSibling(elm));\n removeVnodes(parent_2, [oldVnode], 0, 0);\n }\n }\n return vnode;\n}\n","import { brush, setClipPath, setGradient, setPattern } from './graphic.js';\nimport { createElement, createVNode, vNodeToString, getCssString, createBrushScope, createSVGVNode } from './core.js';\nimport { normalizeColor, encodeBase64, isGradient, isPattern } from './helper.js';\nimport { extend, keys, logError, map, noop, retrieve2 } from '../core/util.js';\nimport patch, { updateAttrs } from './patch.js';\nimport { getSize } from '../canvas/helper.js';\nvar svgId = 0;\nvar SVGPainter = (function () {\n function SVGPainter(root, storage, opts) {\n this.type = 'svg';\n this.refreshHover = createMethodNotSupport('refreshHover');\n this.configLayer = createMethodNotSupport('configLayer');\n this.storage = storage;\n this._opts = opts = extend({}, opts);\n this.root = root;\n this._id = 'zr' + svgId++;\n this._oldVNode = createSVGVNode(opts.width, opts.height);\n if (root && !opts.ssr) {\n var viewport = this._viewport = document.createElement('div');\n viewport.style.cssText = 'position:relative;overflow:hidden';\n var svgDom = this._svgDom = this._oldVNode.elm = createElement('svg');\n updateAttrs(null, this._oldVNode);\n viewport.appendChild(svgDom);\n root.appendChild(viewport);\n }\n this.resize(opts.width, opts.height);\n }\n SVGPainter.prototype.getType = function () {\n return this.type;\n };\n SVGPainter.prototype.getViewportRoot = function () {\n return this._viewport;\n };\n SVGPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n SVGPainter.prototype.getSvgDom = function () {\n return this._svgDom;\n };\n SVGPainter.prototype.refresh = function () {\n if (this.root) {\n var vnode = this.renderToVNode({\n willUpdate: true\n });\n vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none';\n patch(this._oldVNode, vnode);\n this._oldVNode = vnode;\n }\n };\n SVGPainter.prototype.renderOneToVNode = function (el) {\n return brush(el, createBrushScope(this._id));\n };\n SVGPainter.prototype.renderToVNode = function (opts) {\n opts = opts || {};\n var list = this.storage.getDisplayList(true);\n var width = this._width;\n var height = this._height;\n var scope = createBrushScope(this._id);\n scope.animation = opts.animation;\n scope.willUpdate = opts.willUpdate;\n scope.compress = opts.compress;\n var children = [];\n var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);\n bgVNode && children.push(bgVNode);\n var mainVNode = !opts.compress\n ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null;\n this._paintList(list, scope, mainVNode ? mainVNode.children : children);\n mainVNode && children.push(mainVNode);\n var defs = map(keys(scope.defs), function (id) { return scope.defs[id]; });\n if (defs.length) {\n children.push(createVNode('defs', 'defs', {}, defs));\n }\n if (opts.animation) {\n var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });\n if (animationCssStr) {\n var styleNode = createVNode('style', 'stl', {}, [], animationCssStr);\n children.push(styleNode);\n }\n }\n return createSVGVNode(width, height, children, opts.useViewBox);\n };\n SVGPainter.prototype.renderToString = function (opts) {\n opts = opts || {};\n return vNodeToString(this.renderToVNode({\n animation: retrieve2(opts.cssAnimation, true),\n willUpdate: false,\n compress: true,\n useViewBox: retrieve2(opts.useViewBox, true)\n }), { newline: true });\n };\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n };\n SVGPainter.prototype.getSvgRoot = function () {\n return this._mainVNode && this._mainVNode.elm;\n };\n SVGPainter.prototype._paintList = function (list, scope, out) {\n var listLen = list.length;\n var clipPathsGroupsStack = [];\n var clipPathsGroupsStackDepth = 0;\n var currentClipPathGroup;\n var prevClipPaths;\n var clipGroupNodeIdx = 0;\n for (var i = 0; i < listLen; i++) {\n var displayable = list[i];\n if (!displayable.invisible) {\n var clipPaths = displayable.__clipPaths;\n var len = clipPaths && clipPaths.length || 0;\n var prevLen = prevClipPaths && prevClipPaths.length || 0;\n var lca = void 0;\n for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) {\n if (clipPaths && prevClipPaths\n && clipPaths[lca] === prevClipPaths[lca]) {\n break;\n }\n }\n for (var i_1 = prevLen - 1; i_1 > lca; i_1--) {\n clipPathsGroupsStackDepth--;\n currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];\n }\n for (var i_2 = lca + 1; i_2 < len; i_2++) {\n var groupAttrs = {};\n setClipPath(clipPaths[i_2], groupAttrs, scope);\n var g = createVNode('g', 'clip-g-' + clipGroupNodeIdx++, groupAttrs, []);\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(g);\n clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;\n currentClipPathGroup = g;\n }\n prevClipPaths = clipPaths;\n var ret = brush(displayable, scope);\n if (ret) {\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret);\n }\n }\n }\n };\n SVGPainter.prototype.resize = function (width, height) {\n var opts = this._opts;\n var root = this.root;\n var viewport = this._viewport;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n if (root && viewport) {\n viewport.style.display = 'none';\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n viewport.style.display = '';\n }\n if (this._width !== width || this._height !== height) {\n this._width = width;\n this._height = height;\n if (viewport) {\n var viewportStyle = viewport.style;\n viewportStyle.width = width + 'px';\n viewportStyle.height = height + 'px';\n }\n if (!isPattern(this._backgroundColor)) {\n var svgDom = this._svgDom;\n if (svgDom) {\n svgDom.setAttribute('width', width);\n svgDom.setAttribute('height', height);\n }\n var bgEl = this._bgVNode && this._bgVNode.elm;\n if (bgEl) {\n bgEl.setAttribute('width', width);\n bgEl.setAttribute('height', height);\n }\n }\n else {\n this.refresh();\n }\n }\n };\n SVGPainter.prototype.getWidth = function () {\n return this._width;\n };\n SVGPainter.prototype.getHeight = function () {\n return this._height;\n };\n SVGPainter.prototype.dispose = function () {\n if (this.root) {\n this.root.innerHTML = '';\n }\n this._svgDom =\n this._viewport =\n this.storage =\n this._oldVNode =\n this._bgVNode =\n this._mainVNode = null;\n };\n SVGPainter.prototype.clear = function () {\n if (this._svgDom) {\n this._svgDom.innerHTML = null;\n }\n this._oldVNode = null;\n };\n SVGPainter.prototype.toDataURL = function (base64) {\n var str = this.renderToString();\n var prefix = 'data:image/svg+xml;';\n if (base64) {\n str = encodeBase64(str);\n return str && prefix + 'base64,' + str;\n }\n return prefix + 'charset=UTF-8,' + encodeURIComponent(str);\n };\n return SVGPainter;\n}());\nfunction createMethodNotSupport(method) {\n return function () {\n if (process.env.NODE_ENV !== 'production') {\n logError('In SVG mode painter not support method \"' + method + '\"');\n }\n };\n}\nfunction createBackgroundVNode(width, height, backgroundColor, scope) {\n var bgVNode;\n if (backgroundColor && backgroundColor !== 'none') {\n bgVNode = createVNode('rect', 'bg', {\n width: width,\n height: height,\n x: '0',\n y: '0',\n id: '0'\n });\n if (isGradient(backgroundColor)) {\n setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope);\n }\n else if (isPattern(backgroundColor)) {\n setPattern({\n style: {\n fill: backgroundColor\n },\n dirty: noop,\n getBoundingRect: function () { return ({ width: width, height: height }); }\n }, bgVNode.attrs, 'fill', scope);\n }\n else {\n var _a = normalizeColor(backgroundColor), color = _a.color, opacity = _a.opacity;\n bgVNode.attrs.fill = color;\n opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity);\n }\n }\n return bgVNode;\n}\nexport default SVGPainter;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SVGPainter from 'zrender/lib/svg/Painter.js';\nexport function install(registers) {\n registers.registerPainter('svg', SVGPainter);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\n\nfunction defaultKeyGetter(item) {\n return item;\n}\n\nvar DataDiffer =\n/** @class */\nfunction () {\n /**\r\n * @param context Can be visited by this.context in callback.\r\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`;\n\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\r\n * Callback function when add a data\r\n */\n\n\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\r\n * Callback function when update a data\r\n */\n\n\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToMany = function (func) {\n this._updateManyToMany = func;\n return this;\n };\n /**\r\n * Callback function when remove a data\r\n */\n\n\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below.\n\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\r\n * For example, consider the case:\r\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\r\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\r\n * Where:\r\n * o0, o1, n0 has key 'a' (many to one)\r\n * o5, n4, n5, n6 has key 'b' (one to many)\r\n * o2, n1 has key 'c' (one to one)\r\n * n2, n3 has key 'd' (add)\r\n * o3, o4 has key 'e' (remove)\r\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\r\n * Then:\r\n * (The order of the following directives are not ensured.)\r\n * this._updateManyToOne(n0, [o0, o1]);\r\n * this._updateOneToMany([n4, n5, n6], o5);\r\n * this._update(n1, o2);\r\n * this._remove(o3);\r\n * this._remove(o4);\r\n * this._remove(o6);\r\n * this._remove(o7);\r\n * this._add(n2);\r\n * this._add(n3);\r\n * this._add(n7);\r\n * this._add(n8);\r\n */\n\n\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n } // Support both `newDataKeyArr` are duplication removed or not removed.\n\n\n newDataIndexMap[newKey] = null;\n }\n };\n\n DataDiffer.prototype._initIndexMap = function (arr, // Can be null.\n map, // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n\n if (!map) {\n continue;\n }\n\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n\n return DataDiffer;\n}();\n\nexport default DataDiffer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, createHashMap, assert, map } from 'zrender/lib/core/util.js';\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\n\nvar DimensionUserOuput =\n/** @class */\nfunction () {\n function DimensionUserOuput(encode, dimRequest) {\n this._encode = encode;\n this._schema = dimRequest;\n }\n\n DimensionUserOuput.prototype.get = function () {\n return {\n // Do not generate full dimension name until fist used.\n fullDimensions: this._getFullDimensionNames(),\n encode: this._encode\n };\n };\n /**\r\n * Get all data store dimension names.\r\n * Theoretically a series data store is defined both by series and used dataset (if any).\r\n * If some dimensions are omitted for performance reason in `this.dimensions`,\r\n * the dimension name may not be auto-generated if user does not specify a dimension name.\r\n * In this case, the dimension name is `null`/`undefined`.\r\n */\n\n\n DimensionUserOuput.prototype._getFullDimensionNames = function () {\n if (!this._cachedDimNames) {\n this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : [];\n }\n\n return this._cachedDimNames;\n };\n\n return DimensionUserOuput;\n}();\n\n;\nexport function summarizeDimensions(data, schema) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = [];\n var userOutputEncode = {};\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n }\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[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 } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name);\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\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.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) {\n return data.getDimensionInfo(dimName).storeDimIndex;\n });\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommended, because formatter cannot be set\n // in this way. Use label.formatter instead. Maybe 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 summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);\n return summary;\n}\n\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n\n return encode[dim];\n} // FIXME:TS should be type `AxisType`\n\n\nexport function 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// let dimensions = data.dimensions.slice();\n// let valueType;\n// let 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* 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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nvar SeriesDimensionDefine =\n/** @class */\nfunction () {\n /**\r\n * @param opt All of the fields will be shallow copied.\r\n */\n function SeriesDimensionDefine(opt) {\n /**\r\n * The format of `otherDims` is:\r\n * ```js\r\n * {\r\n * tooltip?: number\r\n * label?: number\r\n * itemName?: number\r\n * seriesName?: number\r\n * }\r\n * ```\r\n *\r\n * A `series.encode` can specified these fields:\r\n * ```js\r\n * encode: {\r\n * // \"3, 1, 5\" is the index of data dimension.\r\n * tooltip: [3, 1, 5],\r\n * label: [0, 3],\r\n * ...\r\n * }\r\n * ```\r\n * `otherDims` is the parse result of the `series.encode` above, like:\r\n * ```js\r\n * // Suppose the index of this data dimension is `3`.\r\n * this.otherDims = {\r\n * // `3` is at the index `0` of the `encode.tooltip`\r\n * tooltip: 0,\r\n * // `3` is at the index `1` of the `encode.label`\r\n * label: 1\r\n * };\r\n * ```\r\n *\r\n * This prop should never be `null`/`undefined` after initialized.\r\n */\n this.otherDims = {};\n\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n\n return SeriesDimensionDefine;\n}();\n\n;\nexport default SeriesDimensionDefine;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { shouldRetrieveDataByName } from '../Source.js';\nvar inner = makeInner();\nvar dimTypeShort = {\n float: 'f',\n int: 'i',\n ordinal: 'o',\n number: 'n',\n time: 't'\n};\n/**\r\n * Represents the dimension requirement of a series.\r\n *\r\n * NOTICE:\r\n * When there are too many dimensions in dataset and many series, only the used dimensions\r\n * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.\r\n * But users may query data by other unused dimension names.\r\n * In this case, users can only query data if and only if they have defined dimension names\r\n * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from\r\n * `source` dimensions.\r\n */\n\nvar SeriesDataSchema =\n/** @class */\nfunction () {\n function SeriesDataSchema(opt) {\n this.dimensions = opt.dimensions;\n this._dimOmitted = opt.dimensionOmitted;\n this.source = opt.source;\n this._fullDimCount = opt.fullDimensionCount;\n\n this._updateDimOmitted(opt.dimensionOmitted);\n }\n\n SeriesDataSchema.prototype.isDimensionOmitted = function () {\n return this._dimOmitted;\n };\n\n SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) {\n this._dimOmitted = dimensionOmitted;\n\n if (!dimensionOmitted) {\n return;\n }\n\n if (!this._dimNameMap) {\n this._dimNameMap = ensureSourceDimNameMap(this.source);\n }\n };\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Get index by user defined dimension name (i.e., not internal generate name).\r\n * That is, get index from `dimensionsDefine`.\r\n * If no `dimensionsDefine`, or no name get, return -1.\r\n */\n\n\n SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) {\n return retrieve2(this._dimNameMap.get(dimName), -1);\n };\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Notice: may return `null`/`undefined` if user not specify dimension names.\r\n */\n\n\n SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) {\n var dimensionsDefine = this.source.dimensionsDefine;\n\n if (dimensionsDefine) {\n return dimensionsDefine[dimIndex];\n }\n };\n\n SeriesDataSchema.prototype.makeStoreSchema = function () {\n var dimCount = this._fullDimCount;\n var willRetrieveDataByName = shouldRetrieveDataByName(this.source);\n var makeHashStrict = !shouldOmitUnusedDimensions(dimCount); // If source don't have dimensions or series don't omit unsed dimensions.\n // Generate from seriesDimList directly\n\n var dimHash = '';\n var dims = [];\n\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {\n var property = void 0;\n var type = void 0;\n var ordinalMeta = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc.\n\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n property = willRetrieveDataByName ? seriesDimDef.name : null;\n type = seriesDimDef.type;\n ordinalMeta = seriesDimDef.ordinalMeta;\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n\n if (sourceDimDef) {\n property = willRetrieveDataByName ? sourceDimDef.name : null;\n type = sourceDimDef.type;\n }\n }\n\n dims.push({\n property: property,\n type: type,\n ordinalMeta: ordinalMeta\n }); // If retrieving data by index,\n // use to determine whether data can be shared.\n // (Because in this case there might be no dimension name defined in dataset, but indices always exists).\n // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).\n // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),\n // use in hash.\n\n if (willRetrieveDataByName && property != null // For data stack, we have make sure each series has its own dim on this store.\n // So we do not add property to hash to make sure they can share this store.\n && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) {\n dimHash += makeHashStrict // Use escape character '`' in case that property name contains '$'.\n ? property.replace(/\\`/g, '`1').replace(/\\$/g, '`2') // For better performance, when there are large dimensions, tolerant this defects that hardly meet.\n : property;\n }\n\n dimHash += '$';\n dimHash += dimTypeShort[type] || 'f';\n\n if (ordinalMeta) {\n dimHash += ordinalMeta.uid;\n }\n\n dimHash += '$';\n } // Source from endpoint(usually series) will be read differently\n // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.\n // So we use this three props as key.\n\n\n var source = this.source;\n var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$');\n return {\n dimensions: dims,\n hash: hash\n };\n };\n\n SeriesDataSchema.prototype.makeOutputDimensionNames = function () {\n var result = [];\n\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {\n var name_1 = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc.\n\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n if (!seriesDimDef.isCalculationCoord) {\n name_1 = seriesDimDef.name;\n }\n\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n\n if (sourceDimDef) {\n name_1 = sourceDimDef.name;\n }\n }\n\n result.push(name_1);\n }\n\n return result;\n };\n\n SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) {\n this.dimensions.push(dimDef);\n dimDef.isCalculationCoord = true;\n this._fullDimCount++; // If append dimension on a data store, consider the store\n // might be shared by different series, series dimensions not\n // really map to store dimensions.\n\n this._updateDimOmitted(true);\n };\n\n return SeriesDataSchema;\n}();\n\nexport { SeriesDataSchema };\nexport function isSeriesDataSchema(schema) {\n return schema instanceof SeriesDataSchema;\n}\nexport function createDimNameMap(dimsDef) {\n var dataDimNameMap = createHashMap();\n\n for (var i = 0; i < (dimsDef || []).length; i++) {\n var dimDefItemRaw = dimsDef[i];\n var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n dataDimNameMap.set(userDimName, i);\n }\n }\n\n return dataDimNameMap;\n}\nexport function ensureSourceDimNameMap(source) {\n var innerSource = inner(source);\n return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine));\n}\nexport function shouldOmitUnusedDimensions(dimCount) {\n return dimCount > 30;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../model/Model.js';\nimport DataDiffer from './DataDiffer.js';\nimport { DefaultDataProvider } from './helper/dataProvider.js';\nimport { summarizeDimensions } from './helper/dimensionHelper.js';\nimport SeriesDimensionDefine from './SeriesDimensionDefine.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types.js';\nimport { convertOptionIdName, isDataItemOption } from '../util/model.js';\nimport { setCommonECData } from '../util/innerStore.js';\nimport { isSourceInstance } from './Source.js';\nimport DataStore from './DataStore.js';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema.js';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird update animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1; // type SeriesDimensionIndex = DimensionIndex;\n\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\n\nvar SeriesData =\n/** @class */\nfunction () {\n /**\r\n * @param dimensionsInput.dimensions\r\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\r\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\r\n */\n function SeriesData(dimensionsInput, hostModel) {\n this.type = 'list';\n this._dimOmitted = false;\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Global layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elements\n\n this._graphicEls = []; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = false; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n var dimensions;\n var assignStoreDimIdx = false;\n\n if (isSeriesDataSchema(dimensionsInput)) {\n dimensions = dimensionsInput.dimensions;\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\n this._schema = dimensionsInput;\n } else {\n assignStoreDimIdx = true;\n dimensions = dimensionsInput;\n }\n\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n var needsHasOwn = false;\n var emptyObj = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n\n if (emptyObj[dimensionName] != null) {\n needsHasOwn = true;\n }\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n }\n\n if (assignStoreDimIdx) {\n dimensionInfo.storeDimIndex = i;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimInfos = dimensionInfos;\n\n this._initGetDimensionInfo(needsHasOwn);\n\n this.hostModel = hostModel;\n this._invertedIndicesMap = invertedIndicesMap;\n\n if (this._dimOmitted) {\n var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n zrUtil.each(dimensionNames, function (dimName) {\n dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n });\n }\n }\n /**\r\n *\r\n * Get concrete dimension name by dimension name or dimension index.\r\n * If input a dimension name, do not validate whether the dimension name exits.\r\n *\r\n * @caution\r\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\r\n * Because only those dimensions will have auto-generated dimension names if not\r\n * have a user-specified name, and other dimensions will get a return of null/undefined.\r\n *\r\n * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:\r\n * ```js\r\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\r\n * ```\r\n *\r\n * @return Concrete dim name.\r\n */\n\n\n SeriesData.prototype.getDimension = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx == null) {\n return dim;\n }\n\n dimIdx = dim;\n\n if (!this._dimOmitted) {\n return this.dimensions[dimIdx];\n } // Retrieve from series dimension definition because it probably contains\n // generated dimension name (like 'x', 'y').\n\n\n var dimName = this._dimIdxToName.get(dimIdx);\n\n if (dimName != null) {\n return dimName;\n }\n\n var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n\n if (sourceDimDef) {\n return sourceDimDef.name;\n }\n };\n /**\r\n * Get dimension index in data store. Return -1 if not found.\r\n * Can be used to index value from getRawValue.\r\n */\n\n\n SeriesData.prototype.getDimensionIndex = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx != null) {\n return dimIdx;\n }\n\n if (dim == null) {\n return -1;\n }\n\n var dimInfo = this._getDimInfo(dim);\n\n return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n };\n /**\r\n * The meanings of the input parameter `dim`:\r\n *\r\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\r\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\r\n * + If dim is a number-like string (e.g., `\"1\"`):\r\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\r\n * it means that concrete name.\r\n * + If not, it will be converted to a number, which means the index of the dimension.\r\n * (why? because of the backward compatibility. We have been tolerating number-like string in\r\n * dimension setting, although now it seems that it is not a good idea.)\r\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\r\n * if no dimension name is defined as `\"1\"`.\r\n * + If dim is a not-number-like string, it means the concrete dim name.\r\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\r\n * or customized in `dimensions` property of option like `\"age\"`.\r\n *\r\n * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\r\n */\n\n\n SeriesData.prototype._recognizeDimIndex = function (dim) {\n if (zrUtil.isNumber(dim) // If being a number-like string but not being defined as a dimension name.\n || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n return +dim;\n }\n };\n\n SeriesData.prototype._getStoreDimIndex = function (dim) {\n var dimIdx = this.getDimensionIndex(dim);\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimIdx == null) {\n throw new Error('Unknown dimension ' + dim);\n }\n }\n\n return dimIdx;\n };\n /**\r\n * Get type and calculation info of particular dimension\r\n * @param dim\r\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\r\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\r\n */\n\n\n SeriesData.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._getDimInfo(this.getDimension(dim));\n };\n\n SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n var dimensionInfos = this._dimInfos;\n this._getDimInfo = needsHasOwn ? function (dimName) {\n return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n } : function (dimName) {\n return dimensionInfos[dimName];\n };\n };\n /**\r\n * concrete dimension name list on coord.\r\n */\n\n\n SeriesData.prototype.getDimensionsOnCoord = function () {\n return this._dimSummary.dataDimsOnCoord.slice();\n };\n\n SeriesData.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n\n SeriesData.prototype.getStore = function () {\n return this._store;\n };\n /**\r\n * Initialize from data\r\n * @param data source or data or data store.\r\n * @param nameList The name of a datum is used on data diff and\r\n * default label/tooltip.\r\n * A name can be specified in encode.itemName,\r\n * or dataItem.name (only for series option data),\r\n * or provided in nameList from outside.\r\n */\n\n\n SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n var _this = this;\n\n var store;\n\n if (data instanceof DataStore) {\n store = data;\n }\n\n if (!store) {\n var dimensions = this.dimensions;\n var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n store = new DataStore();\n var dimensionInfos = map(dimensions, function (dimName) {\n return {\n type: _this._dimInfos[dimName].type,\n property: dimName\n };\n });\n store.initData(provider, dimensionInfos, dimValueGetter);\n }\n\n this._store = store; // Reset\n\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n this._doInit(0, store.count()); // Cache summary info for fast visit. See \"dimensionHelper\".\n // Needs to be initialized after store is prepared.\n\n\n this._dimSummary = summarizeDimensions(this, this._schema);\n this.userOutput = this._dimSummary.userOutput;\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\n\n\n SeriesData.prototype.appendData = function (data) {\n var range = this._store.appendData(data);\n\n this._doInit(range[0], range[1]);\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n * This method does not modify `rawData` (`dataProvider`), but only\r\n * add values to store.\r\n *\r\n * The final count will be increased by `Math.max(values.length, names.length)`.\r\n *\r\n * @param values That is the SourceType: 'arrayRows', like\r\n * [\r\n * [12, 33, 44],\r\n * [NaN, 43, 1],\r\n * ['-', 'asdf', 0]\r\n * ]\r\n * Each item is exactly corresponding to a dimension.\r\n */\n\n\n SeriesData.prototype.appendValues = function (values, names) {\n var _a = this._store.appendValues(values, names.length),\n start = _a.start,\n end = _a.end;\n\n var shouldMakeIdFromName = this._shouldMakeIdFromName();\n\n this._updateOrdinalMeta();\n\n if (names) {\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n this._nameList[idx] = names[sourceIdx];\n\n if (shouldMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n };\n\n SeriesData.prototype._updateOrdinalMeta = function () {\n var store = this._store;\n var dimensions = this.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = this._dimInfos[dimensions[i]];\n\n if (dimInfo.ordinalMeta) {\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n }\n }\n };\n\n SeriesData.prototype._shouldMakeIdFromName = function () {\n var provider = this._store.getProvider();\n\n return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n };\n\n SeriesData.prototype._doInit = function (start, end) {\n if (start >= end) {\n return;\n }\n\n var store = this._store;\n var provider = store.getProvider();\n\n this._updateOrdinalMeta();\n\n var nameList = this._nameList;\n var idList = this._idList;\n var sourceFormat = provider.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n if (isFormatOriginal && !provider.pure) {\n var sharedDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n var dataItem = provider.getItem(idx, sharedDataItem);\n\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n if (dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n }\n }\n\n if (this._shouldMakeIdFromName()) {\n for (var idx = start; idx < end; idx++) {\n makeIdFromName(this, idx);\n }\n }\n\n prepareInvertedIndex(this);\n };\n /**\r\n * PENDING: In fact currently this function is only used to short-circuit\r\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\r\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\r\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\r\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\r\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\r\n * be still needed.\r\n *\r\n * Optimize for the scenario that data is filtered by a given extent.\r\n * Consider that if data amount is more than hundreds of thousand,\r\n * extent calculation will cost more than 10ms and the cache will\r\n * be erased because of the filtering.\r\n */\n\n\n SeriesData.prototype.getApproximateExtent = function (dim) {\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n /**\r\n * Calculate extent on a filtered data might be time consuming.\r\n * Approximate extent is only used for: calculate extent of filtered data outside.\r\n */\n\n\n SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n SeriesData.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n SeriesData.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\r\n * @return Never be null/undefined. `number` will be converted to string. Because:\r\n * In most cases, name is used in display, where returning a string is more convenient.\r\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\r\n * rule that name `2` equals to name `'2'`.\r\n */\n\n\n SeriesData.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n\n SeriesData.prototype._getCategory = function (dimIdx, idx) {\n var ordinal = this._store.get(dimIdx, idx);\n\n var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n\n if (ordinalMeta) {\n return ordinalMeta.categories[ordinal];\n }\n\n return ordinal;\n };\n /**\r\n * @return Never null/undefined. `number` will be converted to string. Because:\r\n * In all cases having encountered at present, id is used in making diff comparison, which\r\n * are usually based on hash map. We can keep the rule that the internal id are always string\r\n * (treat `2` is the same as `'2'`) to make the related logic simple.\r\n */\n\n\n SeriesData.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n SeriesData.prototype.count = function () {\n return this._store.count();\n };\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n *\r\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.get = function (dim, idx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.get(dimInfo.storeDimIndex, idx);\n }\n };\n /**\r\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n }\n };\n\n SeriesData.prototype.getIndices = function () {\n return this._store.getIndices();\n };\n\n SeriesData.prototype.getDataExtent = function (dim) {\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getSum = function (dim) {\n return this._store.getSum(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getMedian = function (dim) {\n return this._store.getMedian(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getValues = function (dimensions, idx) {\n var _this = this;\n\n var store = this._store;\n return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n return _this._getStoreDimIndex(dim);\n }), idx) : store.getValues(dimensions);\n };\n /**\r\n * If value is NaN. Including '-'\r\n * Only check the coord dimensions.\r\n */\n\n\n SeriesData.prototype.hasValue = function (idx) {\n var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n\n for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\r\n * Retrieve the index with given name\r\n */\n\n\n SeriesData.prototype.indexOfName = function (name) {\n for (var i = 0, len = this._store.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n\n SeriesData.prototype.getRawIndex = function (idx) {\n return this._store.getRawIndex(idx);\n };\n\n SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n return this._store.indexOfRawIndex(rawIndex);\n };\n /**\r\n * Only support the dimension which inverted index created.\r\n * Do not support other cases until required.\r\n * @param dim concrete dim\r\n * @param value ordinal index\r\n * @return rawIndex\r\n */\n\n\n SeriesData.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\r\n * Retrieve the index of nearest value\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices has\r\n * the same value, they are put to the result.\r\n */\n\n\n SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);\n };\n\n SeriesData.prototype.each = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n\n this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n\n SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return this;\n };\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\n\n\n SeriesData.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var innerRange = {};\n var dims = zrUtil.keys(range);\n var dimIndices = [];\n zrUtil.each(dims, function (dim) {\n var dimIdx = _this._getStoreDimIndex(dim);\n\n innerRange[dimIdx] = range[dim];\n dimIndices.push(dimIdx);\n });\n this._store = this._store.selectRange(innerRange);\n return this;\n };\n /* eslint-enable max-len */\n\n\n SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n var list = cloneListForMapAndSample(this);\n list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return list;\n };\n\n SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n var _this = this; // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(normalizeDimensions(dims), function (dim) {\n var dimInfo = _this.getDimensionInfo(dim);\n\n if (!dimInfo.isCalculationCoord) {\n console.error('Danger: only stack dimension can be modified');\n }\n });\n }\n\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series,\n // it still cost lots of memory, because `_store.dimensions` are not shared.\n // We should consider there probably be shallow clone happen in each series\n // in consequent filter/map.\n\n this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\n\n\n SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n return list;\n };\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\n\n\n SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n return list;\n };\n\n SeriesData.prototype.getRawDataItem = function (idx) {\n return this._store.getRawDataItem(idx);\n };\n /**\r\n * Get model of one data item.\r\n */\n // TODO: Type of data item\n\n\n SeriesData.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\r\n * Create a data differ\r\n */\n\n\n SeriesData.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\r\n * Get visual property.\r\n */\n\n\n SeriesData.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n SeriesData.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\r\n * Get visual property of single data item\r\n */\n // eslint-disable-next-line\n\n\n SeriesData.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\r\n * If exists visual property of single data item\r\n */\n\n\n SeriesData.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\r\n * Make sure itemVisual property is unique\r\n */\n // TODO: use key to save visual to reduce memory.\n\n\n SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n SeriesData.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\r\n * Clear itemVisuals and list visual.\r\n */\n\n\n SeriesData.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n SeriesData.prototype.setLayout = function (key, val) {\n isObject(key) ? zrUtil.extend(this._layout, key) : this._layout[key] = val;\n };\n /**\r\n * Get layout property.\r\n */\n\n\n SeriesData.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\r\n * Get layout of single data item\r\n */\n\n\n SeriesData.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\r\n * Set layout of single data item\r\n */\n\n\n SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\r\n * Clear all layout of single data item\r\n */\n\n\n SeriesData.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\r\n * Set graphic element relative to data. It can be set as null\r\n */\n\n\n SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n setCommonECData(seriesIndex, this.dataType, idx, el);\n this._graphicEls[idx] = el;\n };\n\n SeriesData.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\r\n * Shallow clone a new list except visual and layout properties, and graph elements.\r\n * New list only change the indices.\r\n */\n\n\n SeriesData.prototype.cloneShallow = function (list) {\n if (!list) {\n list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n }\n\n transferProperties(list, this);\n list._store = this._store;\n return list;\n };\n /**\r\n * Wrap some method to add more feature\r\n */\n\n\n SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (!zrUtil.isFunction(originalMethod)) {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n SeriesData.internalField = function () {\n prepareInvertedIndex = function (data) {\n var invertedIndicesMap = data._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n var store = data._store;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < store.count(); i++) {\n // Only support the case that all values are distinct.\n invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (data, dimIdx, idx) {\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n };\n /**\r\n * @see the comment of `List['getId']`.\r\n */\n\n\n getId = function (data, rawIndex) {\n var id = data._idList[rawIndex];\n\n if (id == null && data._idDimIdx != null) {\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n /**\r\n * Data in excludeDimensions is copied, otherwise transferred.\r\n */\n\n\n cloneListForMapAndSample = function (original) {\n var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n return list;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (data, idx) {\n var nameList = data._nameList;\n var idList = data._idList;\n var nameDimIdx = data._nameDimIdx;\n var idDimIdx = data._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = data._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return SeriesData;\n}();\n\nexport default SeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nimport SeriesDimensionDefine from '../SeriesDimensionDefine.js';\nimport { createHashMap, defaults, each, extend, isObject, isString } from 'zrender/lib/core/util.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { CtorInt32Array } from '../DataStore.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper.js';\nimport { createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions } from './SeriesDataSchema.js';\n/**\r\n * For outside usage compat (like echarts-gl are using it).\r\n */\n\nexport function createDimensions(source, opt) {\n return prepareSeriesDataSchema(source, opt).dimensions;\n}\n/**\r\n * This method builds the relationship between:\r\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\r\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\r\n * + \"what the data source provids (see `source`)\".\r\n *\r\n * Some guess strategy will be adapted if user does not define something.\r\n * If no 'value' dimension specified, the first no-named dimension will be\r\n * named as 'value'.\r\n *\r\n * @return The results are always sorted by `storeDimIndex` asc.\r\n */\n\nexport default function prepareSeriesDataSchema( // TODO: TYPE completeDimensions type\nsource, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n opt = opt || {};\n var sysDims = opt.coordDimensions || [];\n var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\n var coordDimNameMap = createHashMap();\n var resultList = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); // Try to ignore unused dimensions if sharing a high dimension datastore\n // 30 is an experience value.\n\n var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\n var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\n var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\n var encodeDef = opt.encodeDefine;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n var encodeDefMap = createHashMap(encodeDef);\n var indicesMap = new CtorInt32Array(dimCount);\n\n for (var i = 0; i < indicesMap.length; i++) {\n indicesMap[i] = -1;\n }\n\n function getResultItem(dimIdx) {\n var idx = indicesMap[dimIdx];\n\n if (idx < 0) {\n var dimDefItemRaw = dimsDef[dimIdx];\n var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n };\n var resultItem = new SeriesDimensionDefine();\n var userDimName = dimDefItem.name;\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 displayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n var newIdx = resultList.length;\n indicesMap[dimIdx] = newIdx;\n resultItem.storeDimIndex = dimIdx;\n resultList.push(resultItem);\n return resultItem;\n }\n\n return resultList[idx];\n }\n\n if (!omitUnusedDimensions) {\n for (var i = 0; i < dimCount; i++) {\n getResultItem(i);\n }\n } // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n\n\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).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 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(getResultItem(resultDimIdx), coordDim, idx);\n }\n });\n }); // Apply templates and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = extend({}, 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 = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n 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 < dimCount && getResultItem(availDimIdx).coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < dimCount && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = getResultItem(resultDimIdx); // Coordinate system has a higher priority on dim type than source.\n\n if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\n resultItem.type = sysDimItem.type;\n }\n\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 (VISUAL_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';\n\n function ifNoNameFillWithCoordName(resultItem) {\n if (resultItem.name == null) {\n // Duplication will be removed in the next step.\n resultItem.name = resultItem.coordDim;\n }\n } // Set dim `name` and other `coordDim` and other props.\n\n\n if (!omitUnusedDimensions) {\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = getResultItem(resultDimIdx);\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n // TODO no need to generate coordDim for isExtraCoord?\n resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0; // Series specified generateCoord is using out.\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n ifNoNameFillWithCoordName(resultItem);\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first column should better be treated as a \"ordinal\" although it\n // might not be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n } else {\n each(resultList, function (resultItem) {\n // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\n ifNoNameFillWithCoordName(resultItem);\n }); // Sort dimensions: there are some rule that use the last dim as label,\n // and for some latter travel process easier.\n\n resultList.sort(function (item0, item1) {\n return item0.storeDimIndex - item1.storeDimIndex;\n });\n }\n\n removeDuplication(resultList);\n return new SeriesDataSchema({\n source: source,\n dimensions: resultList,\n fullDimensionCount: dimCount,\n dimensionOmitted: omitUnusedDimensions\n });\n}\n\nfunction removeDuplication(result) {\n var duplicationMap = createHashMap();\n\n for (var i = 0; i < result.length; i++) {\n var dim = result[i];\n var dimOriginalName = dim.name;\n var count = duplicationMap.get(dimOriginalName) || 0;\n\n if (count > 0) {\n // Starts from 0.\n dim.name = dimOriginalName + (count - 1);\n }\n\n count++;\n duplicationMap.set(dimOriginalName, count);\n }\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 calculate 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 data store?\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.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\n\nfunction genCoordDimName(name, map, fromZero) {\n if (fromZero || map.hasKey(name)) {\n var i = 0;\n\n while (map.hasKey(name + i)) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Helper for model references.\r\n * There are many manners to refer axis/coordSys.\r\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\nimport { createHashMap, retrieve, each } from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../util/model.js';\n/**\r\n * @class\r\n * For example:\r\n * {\r\n * coordSysName: 'cartesian2d',\r\n * coordSysDims: ['x', 'y', ...],\r\n * axisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: yAxisModel\r\n * }),\r\n * categoryAxisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: undefined\r\n * }),\r\n * // The index of the first category axis in `coordSysDims`.\r\n * // `null/undefined` means no category axis exists.\r\n * firstCategoryDimIndex: 1,\r\n * // To replace user specified encode.\r\n * }\r\n */\n\nvar CoordSysInfo =\n/** @class */\nfunction () {\n function CoordSysInfo(coordSysName) {\n this.coordSysDims = [];\n this.axisMap = createHashMap();\n this.categoryAxisMap = createHashMap();\n this.coordSysName = coordSysName;\n }\n\n return CoordSysInfo;\n}();\n\nexport function getCoordSysInfoBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = new CoordSysInfo(coordSysName);\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!xAxisModel) {\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\n }\n\n if (!yAxisModel) {\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\n }\n }\n\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 == null && (result.firstCategoryDimIndex = 1);\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!singleAxisModel) {\n throw new Error('singleAxis should be specified.');\n }\n }\n\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', SINGLE_REFERRING).models[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!angleAxisModel) {\n throw new Error('angleAxis option not found');\n }\n\n if (!radiusAxisModel) {\n throw new Error('radiusAxis option not found');\n }\n }\n\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 == null && (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)) {\n categoryAxisMap.set(axisDim, axisModel);\n\n if (result.firstCategoryDimIndex == null) {\n result.firstCategoryDimIndex = index;\n }\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isString } from 'zrender/lib/core/util.js';\nimport { isSeriesDataSchema } from './SeriesDataSchema.js';\n/**\r\n * Note that it is too complicated to support 3d stack by value\r\n * (have to create two-dimension inverted index), so in 3d case\r\n * we just support that stacked by index.\r\n *\r\n * @param seriesModel\r\n * @param dimensionsInput The same as the input of .\r\n * The input will be modified.\r\n * @param opt\r\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\r\n * @param opt.byIndex=false\r\n * @return calculationInfo\r\n * {\r\n * stackedDimension: string\r\n * stackedByDimension: string\r\n * isStackedByIndex: boolean\r\n * stackedOverDimension: string\r\n * stackResultDimension: string\r\n * }\r\n */\n\nexport function enableDataStack(seriesModel, dimensionsInput, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension;\n var dimensionDefineList;\n var schema;\n var store;\n\n if (isLegacyDimensionsInput(dimensionsInput)) {\n dimensionDefineList = dimensionsInput;\n } else {\n schema = dimensionsInput.schema;\n dimensionDefineList = schema.dimensions;\n store = dimensionsInput.store;\n } // Compatibal: when `stack` is set as '', do not stack.\n\n\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionDefineList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionDefineList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n } // Find the first stackable dimension as the stackedDimInfo.\n\n\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n\n\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n // Also need to use seriesModel.id as postfix because different\n // series may share same data store. The stack dimension needs to be distinguished.\n stackResultDimension = '__\\0ecstackresult_' + seriesModel.id;\n stackedOverDimension = '__\\0ecstackedover_' + seriesModel.id; // Create inverted index to fast query index by value.\n\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex_1 = 0;\n each(dimensionDefineList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n stackedDimCoordIndex_1++;\n }\n });\n var stackedOverDimensionDefine = {\n name: stackResultDimension,\n coordDim: stackedDimCoordDim_1,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length\n };\n var stackResultDimensionDefine = {\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex_1 + 1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length + 1\n };\n\n if (schema) {\n if (store) {\n stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType);\n stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType);\n }\n\n schema.appendCalculationDimension(stackedOverDimensionDefine);\n schema.appendCalculationDimension(stackResultDimensionDefine);\n } else {\n dimensionDefineList.push(stackedOverDimensionDefine);\n dimensionDefineList.push(stackResultDimensionDefine);\n }\n }\n\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\n\nfunction isLegacyDimensionsInput(dimensionsInput) {\n return !isSeriesDataSchema(dimensionsInput.schema);\n}\n\nexport function isDimensionStacked(data, stackedDim) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\n}\nexport function getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { getCoordSysInfoBySeries } from '../../model/referHelper.js';\nimport { createSourceFromSeriesDataOption } from '../../data/Source.js';\nimport { enableDataStack } from '../../data/helper/dataStackHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nimport { SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\n\nfunction getCoordSysDimDefs(seriesModel, coordSysInfo) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysDimDefs;\n\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n return coordSysDimDefs;\n}\n\nfunction injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n\n if (createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n return firstCategoryDimIndex;\n}\n/**\r\n * Caution: there are side effects to `sourceManager` in this method.\r\n * Should better only be called in `Series['getInitialData']`.\r\n */\n\n\nfunction createSeriesData(sourceRaw, seriesModel, opt) {\n opt = opt || {};\n var sourceManager = seriesModel.getSourceManager();\n var source;\n var isOriginalSource = false;\n\n if (sourceRaw) {\n isOriginalSource = true;\n source = createSourceFromSeriesDataOption(sourceRaw);\n } else {\n source = sourceManager.getSource(); // Is series.data. not dataset.\n\n isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;\n }\n\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var encodeDefaulter = zrUtil.isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;\n var createDimensionOptions = {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefine: seriesModel.getEncode(),\n encodeDefaulter: encodeDefaulter,\n canOmitUnusedDimensions: !isOriginalSource\n };\n var schema = prepareSeriesDataSchema(source, createDimensionOptions);\n var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);\n var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;\n var stackCalculationInfo = enableDataStack(seriesModel, {\n schema: schema,\n store: store\n });\n var data = new SeriesData(schema, seriesModel);\n data.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n data.hasItemOption = false;\n data.initData( // Try to reuse the data store in sourceManager if using dataset.\n isOriginalSource ? source : store, null, dimValueGetter);\n return data;\n}\n\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\n\nfunction firstDataNotNull(arr) {\n var i = 0;\n\n while (i < arr.length && arr[i] == null) {\n i++;\n }\n\n return arr[i];\n}\n\nexport default createSeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\n\nvar LineSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LineSeriesModel, _super);\n\n function LineSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LineSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n LineSeriesModel.prototype.getInitialData = function (option) {\n if (process.env.NODE_ENV !== 'production') {\n var coordSys = option.coordinateSystem;\n\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\n }\n }\n\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n LineSeriesModel.prototype.getLegendIcon = function (opt) {\n var group = new Group();\n var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);\n group.add(line);\n line.setStyle(opt.lineStyle);\n var visualType = this.getData().getVisual('symbol');\n var visualRotate = this.getData().getVisual('symbolRotate');\n var symbolType = visualType === 'none' ? 'circle' : visualType; // Symbol size is 80% when there is a line\n\n var size = opt.itemHeight * 0.8;\n var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill);\n group.add(symbol);\n symbol.setStyle(opt.itemStyle);\n var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0;\n symbol.rotation = symbolRotate * Math.PI / 180;\n symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n\n if (symbolType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n\n return group;\n };\n\n LineSeriesModel.type = 'series.line';\n LineSeriesModel.dependencies = ['grid', 'polar'];\n LineSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 3,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n clip: true,\n label: {\n position: 'top'\n },\n // itemStyle: {\n // },\n endLabel: {\n show: false,\n valueAnimation: true,\n distance: 8\n },\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n emphasis: {\n scale: true\n },\n // areaStyle: {\n // origin of areaStyle. Valid values:\n // `'auto'/null/undefined`: from axisLine to data\n // `'start'`: from min to data\n // `'end'`: from data to max\n // origin: 'auto'\n // },\n // false, 'start', 'end', 'middle'\n step: false,\n // Disabled if step is true\n smooth: false,\n smoothMonotone: null,\n symbol: 'emptyCircle',\n symbolSize: 4,\n symbolRotate: null,\n showSymbol: true,\n // `false`: follow the label interval strategy.\n // `true`: show all symbols.\n // `'auto'`: If possible, show all symbols, otherwise\n // follow the label interval strategy.\n showAllSymbol: 'auto',\n // Whether to connect break point.\n connectNulls: false,\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\n sampling: 'none',\n animationEasing: 'linear',\n // Disable progressive\n progressive: 0,\n hoverLayerThreshold: Infinity,\n universalTransition: {\n divideShape: 'clone'\n },\n triggerLineEvent: false\n };\n return LineSeriesModel;\n}(SeriesModel);\n\nexport default LineSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isArray } from 'zrender/lib/core/util.js';\n/**\r\n * @return label string. Not null/undefined\r\n */\n\nexport function getDefaultLabel(data, dataIndex) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1)\n\n if (len === 1) {\n var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\n return rawVal != null ? rawVal + '' : null;\n } else if (len) {\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\n }\n\n return vals.join(' ');\n }\n}\nexport function getDefaultInterpolatedLabel(data, interpolatedValue) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n\n if (!isArray(interpolatedValue)) {\n return interpolatedValue + '';\n }\n\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n var dimIndex = data.getDimensionIndex(labelDims[i]);\n\n if (dimIndex >= 0) {\n vals.push(interpolatedValue[dimIndex]);\n }\n }\n\n return vals.join(' ');\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport { getDefaultLabel } from './labelHelper.js';\nimport { extend } from 'zrender/lib/core/util.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar Symbol =\n/** @class */\nfunction (_super) {\n __extends(Symbol, _super);\n\n function Symbol(data, idx, seriesScope, opts) {\n var _this = _super.call(this) || this;\n\n _this.updateData(data, idx, seriesScope, opts);\n\n return _this;\n }\n\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\n // Remove paths created before\n this.removeAll(); // let symbolPath = createSymbol(\n // symbolType, -0.5, -0.5, 1, 1, color\n // );\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4150.\n\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\n symbolPath.attr({\n z2: 100,\n culling: true,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n }); // Rewrite drift method\n\n symbolPath.drift = driftSymbol;\n this._symbolType = symbolType;\n this.add(symbolPath);\n };\n /**\r\n * Stop animation\r\n * @param {boolean} toLastFrame\r\n */\n\n\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\n this.childAt(0).stopAnimation(null, toLastFrame);\n };\n\n Symbol.prototype.getSymbolType = function () {\n return this._symbolType;\n };\n /**\r\n * FIXME:\r\n * Caution: This method breaks the encapsulation of this module,\r\n * but it indeed brings convenience. So do not use the method\r\n * unless you detailedly know all the implements of `Symbol`,\r\n * especially animation.\r\n *\r\n * Get symbol path element.\r\n */\n\n\n Symbol.prototype.getSymbolPath = function () {\n return this.childAt(0);\n };\n /**\r\n * Highlight symbol\r\n */\n\n\n Symbol.prototype.highlight = function () {\n enterEmphasis(this.childAt(0));\n };\n /**\r\n * Downplay symbol\r\n */\n\n\n Symbol.prototype.downplay = function () {\n leaveEmphasis(this.childAt(0));\n };\n /**\r\n * @param {number} zlevel\r\n * @param {number} z\r\n */\n\n\n Symbol.prototype.setZ = function (zlevel, z) {\n var symbolPath = this.childAt(0);\n symbolPath.zlevel = zlevel;\n symbolPath.z = z;\n };\n\n Symbol.prototype.setDraggable = function (draggable, hasCursorOption) {\n var symbolPath = this.childAt(0);\n symbolPath.draggable = draggable;\n symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor;\n };\n /**\r\n * Update symbol properties\r\n */\n\n\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\n this.silent = false;\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n var seriesModel = data.hostModel;\n var symbolSize = Symbol.getSymbolSize(data, idx);\n var isInit = symbolType !== this._symbolType;\n var disableAnimation = opts && opts.disableAnimation;\n\n if (isInit) {\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\n\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\n } else {\n var symbolPath = this.childAt(0);\n symbolPath.silent = false;\n var target = {\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n };\n disableAnimation ? symbolPath.attr(target) : graphic.updateProps(symbolPath, target, seriesModel, idx);\n saveOldStyle(symbolPath);\n }\n\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\n\n if (isInit) {\n var symbolPath = this.childAt(0);\n\n if (!disableAnimation) {\n var target = {\n scaleX: this._sizeX,\n scaleY: this._sizeY,\n style: {\n // Always fadeIn. Because it has fadeOut animation when symbol is removed..\n opacity: symbolPath.style.opacity\n }\n };\n symbolPath.scaleX = symbolPath.scaleY = 0;\n symbolPath.style.opacity = 0;\n graphic.initProps(symbolPath, target, seriesModel, idx);\n }\n }\n\n if (disableAnimation) {\n // Must stop leave transition manually if don't call initProps or updateProps.\n this.childAt(0).stopAnimation('leave');\n }\n };\n\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\n var symbolPath = this.childAt(0);\n var seriesModel = data.hostModel;\n var emphasisItemStyle;\n var blurItemStyle;\n var selectItemStyle;\n var focus;\n var blurScope;\n var emphasisDisabled;\n var labelStatesModels;\n var hoverScale;\n var cursorStyle;\n\n if (seriesScope) {\n emphasisItemStyle = seriesScope.emphasisItemStyle;\n blurItemStyle = seriesScope.blurItemStyle;\n selectItemStyle = seriesScope.selectItemStyle;\n focus = seriesScope.focus;\n blurScope = seriesScope.blurScope;\n labelStatesModels = seriesScope.labelStatesModels;\n hoverScale = seriesScope.hoverScale;\n cursorStyle = seriesScope.cursorStyle;\n emphasisDisabled = seriesScope.emphasisDisabled;\n }\n\n if (!seriesScope || data.hasItemOption) {\n var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n emphasisDisabled = emphasisModel.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n hoverScale = emphasisModel.getShallow('scale');\n cursorStyle = itemModel.getShallow('cursor');\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n symbolPath.x = symbolOffset[0];\n symbolPath.y = symbolOffset[1];\n }\n\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n if (symbolPath.__isEmptyBrush) {\n // fill and stroke will be swapped if it's empty.\n // So we cloned a new style to avoid it affecting the original style in visual storage.\n // TODO Better implementation. No empty logic!\n symbolPath.useStyle(extend({}, symbolStyle));\n } else {\n symbolPath.useStyle(symbolStyle);\n } // Disable decal because symbol scale will been applied on the decal.\n\n\n symbolPath.style.decal = null;\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\n symbolPath.style.strokeNoScale = true;\n }\n\n var liftZ = data.getItemVisual(idx, 'liftZ');\n var z2Origin = this._z2;\n\n if (liftZ != null) {\n if (z2Origin == null) {\n this._z2 = symbolPath.z2;\n symbolPath.z2 += liftZ;\n }\n } else if (z2Origin != null) {\n symbolPath.z2 = z2Origin;\n this._z2 = null;\n }\n\n var useNameLabel = opts && opts.useNameLabel;\n setLabelStyle(symbolPath, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultText: getLabelDefaultText,\n inheritColor: visualColor,\n defaultOpacity: symbolStyle.opacity\n }); // Do not execute util needed.\n\n function getLabelDefaultText(idx) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }\n\n this._sizeX = symbolSize[0] / 2;\n this._sizeY = symbolSize[1] / 2;\n var emphasisState = symbolPath.ensureState('emphasis');\n emphasisState.style = emphasisItemStyle;\n symbolPath.ensureState('select').style = selectItemStyle;\n symbolPath.ensureState('blur').style = blurItemStyle; // null / undefined / true means to use default strategy.\n // 0 / false / negative number / NaN / Infinity means no scale.\n\n var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY) // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down\n : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1; // always set scale to allow resetting\n\n emphasisState.scaleX = this._sizeX * scaleRatio;\n emphasisState.scaleY = this._sizeY * scaleRatio;\n this.setSymbolScale(1);\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n Symbol.prototype.setSymbolScale = function (scale) {\n this.scaleX = this.scaleY = scale;\n };\n\n Symbol.prototype.fadeOut = function (cb, seriesModel, opt) {\n var symbolPath = this.childAt(0);\n var dataIndex = getECData(this).dataIndex;\n var animationOpt = opt && opt.animation; // Avoid mistaken hover when fading out\n\n this.silent = symbolPath.silent = true; // Not show text when animating\n\n if (opt && opt.fadeLabel) {\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n graphic.removeElement(textContent, {\n style: {\n opacity: 0\n }\n }, seriesModel, {\n dataIndex: dataIndex,\n removeOpt: animationOpt,\n cb: function () {\n symbolPath.removeTextContent();\n }\n });\n }\n } else {\n symbolPath.removeTextContent();\n }\n\n graphic.removeElement(symbolPath, {\n style: {\n opacity: 0\n },\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: dataIndex,\n cb: cb,\n removeOpt: animationOpt\n });\n };\n\n Symbol.getSymbolSize = function (data, idx) {\n return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n };\n\n return Symbol;\n}(graphic.Group);\n\nfunction driftSymbol(dx, dy) {\n this.parent.drift(dx, dy);\n}\n\nexport default Symbol;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport SymbolClz from './Symbol.js';\nimport { isObject } from 'zrender/lib/core/util.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\n\nfunction symbolNeedsDraw(data, point, idx, opt) {\n 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\n // the symbol element shape. We use the same clip shape here as\n // the line clip.\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none';\n}\n\nfunction normalizeUpdateOpt(opt) {\n if (opt != null && !isObject(opt)) {\n opt = {\n isIgnore: opt\n };\n }\n\n return opt || {};\n}\n\nfunction makeSeriesScope(data) {\n var seriesModel = data.hostModel;\n var emphasisModel = seriesModel.getModel('emphasis');\n return {\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\n focus: emphasisModel.get('focus'),\n blurScope: emphasisModel.get('blurScope'),\n emphasisDisabled: emphasisModel.get('disabled'),\n hoverScale: emphasisModel.get('scale'),\n labelStatesModels: getLabelStatesModels(seriesModel),\n cursorStyle: seriesModel.get('cursor')\n };\n}\n\nvar SymbolDraw =\n/** @class */\nfunction () {\n function SymbolDraw(SymbolCtor) {\n this.group = new graphic.Group();\n this._SymbolCtor = SymbolCtor || SymbolClz;\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n SymbolDraw.prototype.updateData = function (data, opt) {\n // Remove progressive els.\n this._progressiveEls = null;\n opt = normalizeUpdateOpt(opt);\n var group = this.group;\n var seriesModel = data.hostModel;\n var oldData = this._data;\n var SymbolCtor = this._SymbolCtor;\n var disableAnimation = opt.disableAnimation;\n var seriesScope = makeSeriesScope(data);\n var symbolUpdateOpt = {\n disableAnimation: disableAnimation\n };\n\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\n return data.getItemLayout(idx);\n }; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n\n if (!oldData) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n var point = getSymbolPoint(newIdx);\n\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n var point = getSymbolPoint(newIdx);\n\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\n group.remove(symbolEl);\n return;\n }\n\n var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle';\n var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();\n\n if (!symbolEl // Create a new if symbol type changed.\n || oldSymbolType && oldSymbolType !== newSymbolType) {\n group.remove(symbolEl);\n symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n } else {\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\n var target = {\n x: point[0],\n y: point[1]\n };\n disableAnimation ? symbolEl.attr(target) : graphic.updateProps(symbolEl, target, seriesModel);\n } // Add back\n\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && el.fadeOut(function () {\n group.remove(el);\n }, seriesModel);\n }).execute();\n this._getSymbolPoint = getSymbolPoint;\n this._data = data;\n };\n\n ;\n\n SymbolDraw.prototype.updateLayout = function () {\n var _this = this;\n\n var data = this._data;\n\n if (data) {\n // Not use animation\n data.eachItemGraphicEl(function (el, idx) {\n var point = _this._getSymbolPoint(idx);\n\n el.setPosition(point);\n el.markRedraw();\n });\n }\n };\n\n ;\n\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._seriesScope = makeSeriesScope(data);\n this._data = null;\n this.group.removeAll();\n };\n\n ;\n /**\r\n * Update symbols draw by new data\r\n */\n\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n // Clear\n this._progressiveEls = [];\n opt = normalizeUpdateOpt(opt);\n\n function updateIncrementalAndHover(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var point = data.getItemLayout(idx);\n\n if (symbolNeedsDraw(data, point, idx, opt)) {\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n el.setPosition(point);\n this.group.add(el);\n data.setItemGraphicEl(idx, el);\n\n this._progressiveEls.push(el);\n }\n }\n };\n\n ;\n\n SymbolDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n SymbolDraw.prototype.remove = function (enableAnimation) {\n var group = this.group;\n var data = this._data; // Incremental model do not have this._data.\n\n if (data && enableAnimation) {\n data.eachItemGraphicEl(function (el) {\n el.fadeOut(function () {\n group.remove(el);\n }, data.hostModel);\n });\n } else {\n group.removeAll();\n }\n };\n\n ;\n return SymbolDraw;\n}();\n\nexport default SymbolDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { isNumber, map } from 'zrender/lib/core/util.js';\nexport function prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked = false;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /* , dims[1] */\n )) {\n // jshint ignore:line\n stacked = true;\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /* , dims[0] */\n )) {\n // jshint ignore:line\n stacked = true;\n dims[1] = stackResultDim;\n }\n\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\n\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n } // If origin is specified as a number, use it as\n // valueStart directly\n else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) {\n valueStart = valueOrigin;\n } // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n } // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n } // If is one positive, and one negative, onZero shall be true\n\n }\n\n return valueStart;\n}\n\nexport function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\n/* global Float32Array */\n\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\nexport function createFloat32Array(arg) {\n if (isArray(arg)) {\n // Return self directly if don't support TypedArray.\n return supportFloat32Array ? new Float32Array(arg) : arg;\n } // Else is number\n\n\n return new Float32ArrayCtor(arg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createFloat32Array } from '../../util/vendor.js';\n\nfunction diffData(oldData, newData) {\n var diffResult = [];\n newData.diff(oldData).add(function (idx) {\n diffResult.push({\n cmd: '+',\n idx: idx\n });\n }).update(function (newIdx, oldIdx) {\n diffResult.push({\n cmd: '=',\n idx: oldIdx,\n idx1: newIdx\n });\n }).remove(function (idx) {\n diffResult.push({\n cmd: '-',\n idx: idx\n });\n }).execute();\n return diffResult;\n}\n\nexport default function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n var diff = diffData(oldData, newData); // let newIdList = newData.mapArray(newData.getId);\n // let oldIdList = oldData.mapArray(oldData.getId);\n // convertToIntId(newIdList, oldIdList);\n // // FIXME One data ?\n // diff = arrayDiff(oldIdList, newIdList);\n\n var currPoints = [];\n var nextPoints = []; // Points for stacking base line\n\n var currStackedPoints = [];\n var nextStackedPoints = [];\n var status = [];\n var sortedIndices = [];\n var rawIndices = [];\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n\n var oldPoints = oldData.getLayout('points') || [];\n var newPoints = newData.getLayout('points') || [];\n\n for (var i = 0; i < diff.length; i++) {\n var diffItem = diff[i];\n var pointAdded = true;\n var oldIdx2 = void 0;\n var newIdx2 = void 0; // FIXME, animation is not so perfect when dataZoom window moves fast\n // Which is in case remvoing or add more than one data in the tail or head\n\n switch (diffItem.cmd) {\n case '=':\n oldIdx2 = diffItem.idx * 2;\n newIdx2 = diffItem.idx1 * 2;\n var currentX = oldPoints[oldIdx2];\n var currentY = oldPoints[oldIdx2 + 1];\n var nextX = newPoints[newIdx2];\n var nextY = newPoints[newIdx2 + 1]; // If previous data is NaN, use next point directly\n\n if (isNaN(currentX) || isNaN(currentY)) {\n currentX = nextX;\n currentY = nextY;\n }\n\n currPoints.push(currentX, currentY);\n nextPoints.push(nextX, nextY);\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\n break;\n\n case '+':\n var newIdx = diffItem.idx;\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\n var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);\n newIdx2 = newIdx * 2;\n currPoints.push(oldPt[0], oldPt[1]);\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(newIdx));\n break;\n\n case '-':\n pointAdded = false;\n } // Original indices\n\n\n if (pointAdded) {\n status.push(diffItem);\n sortedIndices.push(sortedIndices.length);\n }\n } // Diff result may be crossed if all items are changed\n // Sort by data index\n\n\n sortedIndices.sort(function (a, b) {\n return rawIndices[a] - rawIndices[b];\n });\n var len = currPoints.length;\n var sortedCurrPoints = createFloat32Array(len);\n var sortedNextPoints = createFloat32Array(len);\n var sortedCurrStackedPoints = createFloat32Array(len);\n var sortedNextStackedPoints = createFloat32Array(len);\n var sortedStatus = [];\n\n for (var i = 0; i < sortedIndices.length; i++) {\n var idx = sortedIndices[i];\n var i2 = i * 2;\n var idx2 = idx * 2;\n sortedCurrPoints[i2] = currPoints[idx2];\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\n sortedNextPoints[i2] = nextPoints[idx2];\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\n sortedStatus[i] = status[idx];\n }\n\n return {\n current: sortedCurrPoints,\n next: sortedNextPoints,\n stackedOnCurrent: sortedCurrStackedPoints,\n stackedOnNext: sortedNextStackedPoints,\n status: sortedStatus\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // Poly path support NaN point\n\nimport Path from 'zrender/lib/graphic/Path.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { cubicRootAt, cubicAt } from 'zrender/lib/core/curve.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n/**\r\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\r\n * situations. This should be used when points are non-monotone neither in x or\r\n * y dimension.\r\n */\n\n\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1]; // Ignore duplicate point\n\n while (nextX === x && nextY === y && k < segLen) {\n k++;\n nextIdx += dir;\n idx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n x = points[idx * 2];\n y = points[idx * 2 + 1];\n dx = x - prevX;\n dy = y - prevY;\n }\n\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n var dir_1 = vx > 0 ? 1 : -1;\n cpx1 = x - dir_1 * lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + dir_1 * lenNextSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n var dir_2 = vy > 0 ? 1 : -1;\n cpx1 = x;\n cpy1 = y - dir_2 * lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + dir_2 * lenNextSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n}\n\nvar ECPolylineShape =\n/** @class */\nfunction () {\n function ECPolylineShape() {\n this.smooth = 0;\n this.smoothConstraint = true;\n }\n\n return ECPolylineShape;\n}();\n\nvar ECPolyline =\n/** @class */\nfunction (_super) {\n __extends(ECPolyline, _super);\n\n function ECPolyline(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polyline';\n return _this;\n }\n\n ECPolyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECPolyline.prototype.getDefaultShape = function () {\n return new ECPolylineShape();\n };\n\n ECPolyline.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length / 2; // const result = getBoundingBox(points, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n };\n\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\n if (!this.path) {\n this.createPathProxy();\n this.buildPath(this.path, this.shape);\n }\n\n var path = this.path;\n var data = path.data;\n var CMD = PathProxy.CMD;\n var x0;\n var y0;\n var isDimX = dim === 'x';\n var roots = [];\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n var x = void 0;\n var y = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var x3 = void 0;\n var y3 = void 0;\n var t = void 0;\n\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n break;\n\n case CMD.L:\n x = data[i++];\n y = data[i++];\n t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0);\n\n if (t <= 1 && t >= 0) {\n var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0;\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n\n x0 = x;\n y0 = y;\n break;\n\n case CMD.C:\n x = data[i++];\n y = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n x3 = data[i++];\n y3 = data[i++];\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots);\n\n if (nRoot > 0) {\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\n var t_1 = roots[i_1];\n\n if (t_1 <= 1 && t_1 >= 0) {\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1);\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n }\n }\n\n x0 = x3;\n y0 = y3;\n break;\n }\n }\n };\n\n return ECPolyline;\n}(Path);\n\nexport { ECPolyline };\n\nvar ECPolygonShape =\n/** @class */\nfunction (_super) {\n __extends(ECPolygonShape, _super);\n\n function ECPolygonShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return ECPolygonShape;\n}(ECPolylineShape);\n\nvar ECPolygon =\n/** @class */\nfunction (_super) {\n __extends(ECPolygon, _super);\n\n function ECPolygon(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polygon';\n return _this;\n }\n\n ECPolygon.prototype.getDefaultShape = function () {\n return new ECPolygonShape();\n };\n\n ECPolygon.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length / 2;\n var smoothMonotone = shape.smoothMonotone;\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n };\n\n return ECPolygon;\n}(Path);\n\nexport { ECPolygon };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner\n\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369\n\n x = Math.floor(x);\n width = Math.round(width);\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n\n clipPath.shape.height = 0;\n }\n\n var duringCb = isFunction(during) ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n\n return null;\n}\n\nexport { createGridClipPath, createPolarClipPath, createClipPath };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n return coordSys.type === type;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // FIXME step not support polar\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport lineAnimationDiff from './lineAnimationDiff.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as modelUtil from '../../util/model.js';\nimport { ECPolyline, ECPolygon } from './poly.js';\nimport ChartView from '../../view/Chart.js';\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setStatesStylesFromModel, setStatesFlag, toggleHoverEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nimport { convertToColorString } from '../../util/format.js';\nimport { lerp } from 'zrender/lib/tool/color.js';\n\nfunction isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n if (points1[i] !== points2[i]) {\n return;\n }\n }\n\n return true;\n}\n\nfunction bboxFromPoints(points) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (!isNaN(x)) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n }\n\n if (!isNaN(y)) {\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n }\n\n return [[minX, minY], [maxX, maxY]];\n}\n\nfunction getBoundingDiff(points1, points2) {\n var _a = bboxFromPoints(points1),\n min1 = _a[0],\n max1 = _a[1];\n\n var _b = bboxFromPoints(points2),\n min2 = _b[0],\n max2 = _b[1]; // Get a max value from each corner of two boundings.\n\n\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\n}\n\nfunction getSmooth(smooth) {\n return zrUtil.isNumber(smooth) ? smooth : smooth ? 0.5 : 0;\n}\n\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n if (!dataCoordInfo.valueDim) {\n return [];\n }\n\n var len = data.count();\n var points = createFloat32Array(len * 2);\n\n for (var idx = 0; idx < len; idx++) {\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\n points[idx * 2] = pt[0];\n points[idx * 2 + 1] = pt[1];\n }\n\n return points;\n}\n\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {\n var baseAxis = coordSys.getBaseAxis();\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n var stepPoints = [];\n var i = 0;\n var stepPt = [];\n var pt = [];\n var nextPt = [];\n var filteredPoints = [];\n\n if (connectNulls) {\n for (i = 0; i < points.length; i += 2) {\n if (!isNaN(points[i]) && !isNaN(points[i + 1])) {\n filteredPoints.push(points[i], points[i + 1]);\n }\n }\n\n points = filteredPoints;\n }\n\n for (i = 0; i < points.length - 2; i += 2) {\n nextPt[0] = points[i + 2];\n nextPt[1] = points[i + 3];\n pt[0] = points[i];\n pt[1] = points[i + 1];\n stepPoints.push(pt[0], pt[1]);\n\n switch (stepTurnAt) {\n case 'end':\n stepPt[baseIndex] = nextPt[baseIndex];\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n break;\n\n case 'middle':\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n var stepPt2 = [];\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n stepPoints.push(stepPt2[0], stepPt2[1]);\n break;\n\n default:\n // default is start\n stepPt[baseIndex] = pt[baseIndex];\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n }\n } // Last points\n\n\n stepPoints.push(points[i++], points[i++]);\n return stepPoints;\n}\n/**\r\n * Clip color stops to edge. Avoid creating too large gradients.\r\n * Which may lead to blurry when GPU acceleration is enabled. See #15680\r\n *\r\n * The stops has been sorted from small to large.\r\n */\n\n\nfunction clipColorStops(colorStops, maxSize) {\n var newColorStops = [];\n var len = colorStops.length; // coord will always < 0 in prevOutOfRangeColorStop.\n\n var prevOutOfRangeColorStop;\n var prevInRangeColorStop;\n\n function lerpStop(stop0, stop1, clippedCoord) {\n var coord0 = stop0.coord;\n var p = (clippedCoord - coord0) / (stop1.coord - coord0);\n var color = lerp(p, [stop0.color, stop1.color]);\n return {\n coord: clippedCoord,\n color: color\n };\n }\n\n for (var i = 0; i < len; i++) {\n var stop_1 = colorStops[i];\n var coord = stop_1.coord;\n\n if (coord < 0) {\n prevOutOfRangeColorStop = stop_1;\n } else if (coord > maxSize) {\n if (prevInRangeColorStop) {\n newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize));\n } else if (prevOutOfRangeColorStop) {\n // If there are two stops and coord range is between these two stops\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize));\n } // All following stop will be out of range. So just ignore them.\n\n\n break;\n } else {\n if (prevOutOfRangeColorStop) {\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0)); // Reset\n\n prevOutOfRangeColorStop = null;\n }\n\n newColorStops.push(stop_1);\n prevInRangeColorStop = stop_1;\n }\n }\n\n return newColorStops;\n}\n\nfunction getVisualGradient(data, coordSys, api) {\n var visualMetaList = data.getVisual('visualMeta');\n\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\n // When data.count() is 0, gradient range can not be calculated.\n return;\n }\n\n if (coordSys.type !== 'cartesian2d') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style is only supported on cartesian2d.');\n }\n\n return;\n }\n\n var coordDim;\n var visualMeta;\n\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\n var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension);\n coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y\n\n if (coordDim === 'x' || coordDim === 'y') {\n visualMeta = visualMetaList[i];\n break;\n }\n }\n\n if (!visualMeta) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style only support x or y dimension.');\n }\n\n return;\n } // If the area to be rendered is bigger than area defined by LinearGradient,\n // the canvas spec prescribes that the color of the first stop and the last\n // stop should be used. But if two stops are added at offset 0, in effect\n // browsers use the color of the second stop to render area outside\n // LinearGradient. So we can only infinitesimally extend area defined in\n // LinearGradient to render `outerColors`.\n\n\n var axis = coordSys.getAxis(coordDim); // dataToCoord mapping may not be linear, but must be monotonic.\n\n var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n // offset will be calculated later.\n return {\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n color: stop.color\n };\n });\n var stopLen = colorStops.length;\n var outerColors = visualMeta.outerColors.slice();\n\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n colorStops.reverse();\n outerColors.reverse();\n }\n\n var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight());\n var inRangeStopLen = colorStopsInRange.length;\n\n if (!inRangeStopLen && stopLen) {\n // All stops are out of range. All will be the same color.\n return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color;\n }\n\n var tinyExtent = 10; // Arbitrary value: 10px\n\n var minCoord = colorStopsInRange[0].coord - tinyExtent;\n var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;\n var coordSpan = maxCoord - minCoord;\n\n if (coordSpan < 1e-3) {\n return 'transparent';\n }\n\n zrUtil.each(colorStopsInRange, function (stop) {\n stop.offset = (stop.coord - minCoord) / coordSpan;\n });\n colorStopsInRange.push({\n // NOTE: inRangeStopLen may still be 0 if stoplen is zero.\n offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,\n color: outerColors[1] || 'transparent'\n });\n colorStopsInRange.unshift({\n offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,\n color: outerColors[0] || 'transparent'\n });\n var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStopsInRange, true);\n gradient[coordDim] = minCoord;\n gradient[coordDim + '2'] = maxCoord;\n return gradient;\n}\n\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n var showAllSymbol = seriesModel.get('showAllSymbol');\n var isAuto = showAllSymbol === 'auto';\n\n if (showAllSymbol && !isAuto) {\n return;\n }\n\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (!categoryAxis) {\n return;\n } // Note that category label interval strategy might bring some weird effect\n // in some scenario: users may wonder why some of the symbols are not\n // displayed. So we show all symbols as possible as we can.\n\n\n if (isAuto // Simplify the logic, do not determine label overlap here.\n && canShowAllSymbolForCategory(categoryAxis, data)) {\n return;\n } // Otherwise follow the label interval strategy on category axis.\n\n\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\n var labelMap = {};\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);\n labelMap[ordinalNumber] = 1;\n });\n return function (dataIndex) {\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n };\n}\n\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n // In most cases, line is monotonous on category axis, and the label size\n // is close with each other. So we check the symbol size and some of the\n // label size alone with the category axis to estimate whether all symbol\n // can be shown without overlap.\n var axisExtent = categoryAxis.getExtent();\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n // Sampling some points, max 5.\n\n var dataLen = data.count();\n var step = Math.max(1, Math.round(dataLen / 5));\n\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n if (SymbolClz.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists.\n )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number\n * 1.5 > availSize) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n\nfunction getLastIndexNotNull(points) {\n var len = points.length / 2;\n\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n return len - 1;\n}\n\nfunction getPointAtIndex(points, idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n}\n\nfunction getIndexRange(points, xOrY, dim) {\n var len = points.length / 2;\n var dimIdx = dim === 'x' ? 0 : 1;\n var a;\n var b;\n var prevIndex = 0;\n var nextIndex = -1;\n\n for (var i = 0; i < len; i++) {\n b = points[i * 2 + dimIdx];\n\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\n continue;\n }\n\n if (i === 0) {\n a = b;\n continue;\n }\n\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\n nextIndex = i;\n break;\n }\n\n prevIndex = i;\n a = b;\n }\n\n return {\n range: [prevIndex, nextIndex],\n t: (xOrY - a) / (b - a)\n };\n}\n\nfunction anyStateShowEndLabel(seriesModel) {\n if (seriesModel.get(['endLabel', 'show'])) {\n return true;\n }\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var endLabelModel_1 = seriesModel.getModel('endLabel');\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\n var data_1 = seriesModel.getData();\n var labelAnimationRecord_1 = {\n lastFrameIndex: 0\n };\n var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) {\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\n } : null;\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\n var endLabel = lineView._endLabel;\n\n if (endLabel && hasAnimation) {\n if (labelAnimationRecord_1.originalX != null) {\n endLabel.attr({\n x: labelAnimationRecord_1.originalX,\n y: labelAnimationRecord_1.originalY\n });\n }\n }\n }, during); // Expand clip shape to avoid clipping when line value exceeds axis\n\n if (!seriesModel.get('clip', true)) {\n var rectShape = clipPath.shape;\n var expandSize = Math.max(rectShape.width, rectShape.height);\n\n if (isHorizontal) {\n rectShape.y -= expandSize;\n rectShape.height += expandSize * 2;\n } else {\n rectShape.x -= expandSize;\n rectShape.width += expandSize * 2;\n }\n } // Set to the final frame. To make sure label layout is right.\n\n\n if (during) {\n during(1, clipPath);\n }\n\n return clipPath;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (seriesModel.get(['endLabel', 'show'])) {\n console.warn('endLabel is not supported for lines in polar systems.');\n }\n }\n\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n }\n}\n\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center';\n var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom';\n return {\n normal: {\n align: endLabelModel.get('align') || align,\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\n }\n };\n}\n\nvar LineView =\n/** @class */\nfunction (_super) {\n __extends(LineView, _super);\n\n function LineView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n LineView.prototype.init = function () {\n var lineGroup = new graphic.Group();\n var symbolDraw = new SymbolDraw();\n this.group.add(symbolDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineGroup = lineGroup;\n };\n\n LineView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var areaStyleModel = seriesModel.getModel('areaStyle');\n var points = data.getLayout('points') || [];\n var isCoordSysPolar = coordSys.type === 'polar';\n var prevCoordSys = this._coordSys;\n var symbolDraw = this._symbolDraw;\n var polyline = this._polyline;\n var polygon = this._polygon;\n var lineGroup = this._lineGroup;\n var hasAnimation = !ecModel.ssr && seriesModel.isAnimationEnabled();\n var isAreaChart = !areaStyleModel.isEmpty();\n var valueOrigin = areaStyleModel.get('origin');\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\n var showSymbol = seriesModel.get('showSymbol');\n var connectNulls = seriesModel.get('connectNulls');\n var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols\n\n var oldData = this._data;\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n }); // Remove previous created symbols if showSymbol changed to false\n\n if (!showSymbol) {\n symbolDraw.remove();\n }\n\n group.add(lineGroup); // FIXME step not support polar\n\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\n var clipShapeForSymbol;\n\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\n clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n // See #7913 and `test/dataZoom-clip.html`.\n\n if (clipShapeForSymbol.width != null) {\n clipShapeForSymbol.x -= 0.1;\n clipShapeForSymbol.y -= 0.1;\n clipShapeForSymbol.width += 0.2;\n clipShapeForSymbol.height += 0.2;\n } else if (clipShapeForSymbol.r0) {\n clipShapeForSymbol.r0 -= 0.5;\n clipShapeForSymbol.r += 0.5;\n }\n }\n\n this._clipShapeForSymbol = clipShapeForSymbol;\n var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')]; // Initialization animation or coordinate system changed\n\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n });\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\n\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n\n polyline = this._newPolyline(points);\n\n if (isAreaChart) {\n polygon = this._newPolygon(points, stackedOnPoints);\n } // If areaStyle is removed\n else if (polygon) {\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n }\n\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } else {\n if (isAreaChart && !polygon) {\n // If areaStyle is added\n polygon = this._newPolygon(points, stackedOnPoints);\n } else if (polygon && !isAreaChart) {\n // If areaStyle is removed\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n } // Update clipPath\n\n\n var oldClipPath = lineGroup.getClipPath();\n\n if (oldClipPath) {\n var newClipPath = createLineClipPath(this, coordSys, false, seriesModel);\n graphic.initProps(oldClipPath, {\n shape: newClipPath.shape\n }, seriesModel);\n } else {\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } // Always update, or it is wrong in the case turning on legend\n // because points are not changed.\n\n\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n }); // In the case data zoom triggered refreshing frequently\n // Data may not change if line has a category axis. So it should animate nothing.\n\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n if (hasAnimation) {\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls);\n } else {\n // Not do it in update with animation\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n\n polyline.setShape({\n points: points\n });\n polygon && polygon.setShape({\n points: points,\n stackedOnPoints: stackedOnPoints\n });\n }\n }\n }\n\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n polyline.useStyle(zrUtil.defaults( // Use color in lineStyle first\n lineStyleModel.getLineStyle(), {\n fill: 'none',\n stroke: visualColor,\n lineJoin: 'bevel'\n }));\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\n\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\n var emphasisLineStyle = polyline.getState('emphasis').style;\n emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\n } // Needs seriesIndex for focus\n\n\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);\n var smooth = getSmooth(seriesModel.get('smooth'));\n var smoothMonotone = seriesModel.get('smoothMonotone');\n polyline.setShape({\n smooth: smooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n\n if (polygon) {\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n var stackedOnSmooth = 0;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: visualColor,\n opacity: 0.7,\n lineJoin: 'bevel',\n decal: data.getVisual('style').decal\n }));\n\n if (stackedOnSeries) {\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n }\n\n polygon.setShape({\n smooth: smooth,\n stackedOnSmooth: stackedOnSmooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); // Needs seriesIndex for focus\n\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);\n }\n\n var changePolyState = function (toState) {\n _this._changePolyState(toState);\n };\n\n data.eachItemGraphicEl(function (el) {\n // Switch polyline / polygon state if element changed its state.\n el && (el.onHoverStateChange = changePolyState);\n });\n this._polyline.onHoverStateChange = changePolyState;\n this._data = data; // Save the coordinate system for transition animation when data changed\n\n this._coordSys = coordSys;\n this._stackedOnPoints = stackedOnPoints;\n this._points = points;\n this._step = step;\n this._valueOrigin = valueOrigin;\n\n if (seriesModel.get('triggerLineEvent')) {\n this.packEventData(seriesModel, polyline);\n polygon && this.packEventData(seriesModel, polygon);\n }\n };\n\n LineView.prototype.packEventData = function (seriesModel, el) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'line',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'line'\n };\n };\n\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('emphasis');\n\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n var points = data.getLayout('points');\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (!symbol) {\n // Create a temporary symbol if it is not exists\n var x = points[dataIndex * 2];\n var y = points[dataIndex * 2 + 1];\n\n if (isNaN(x) || isNaN(y)) {\n // Null data\n return;\n } // fix #11360: shouldn't draw symbol outside clipShapeForSymbol\n\n\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\n return;\n }\n\n var zlevel = seriesModel.get('zlevel') || 0;\n var z = seriesModel.get('z') || 0;\n symbol = new SymbolClz(data, dataIndex);\n symbol.x = x;\n symbol.y = y;\n symbol.setZ(zlevel, z); // ensure label text of the temporary symbol is in front of line and area polygon\n\n var symbolLabel = symbol.getSymbolPath().getTextContent();\n\n if (symbolLabel) {\n symbolLabel.zlevel = zlevel;\n symbolLabel.z = z;\n symbolLabel.z2 = this._polyline.z2 + 1;\n }\n\n symbol.__temp = true;\n data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation\n\n symbol.stopSymbolAnimation(true);\n this.group.add(symbol);\n }\n\n symbol.highlight();\n } else {\n // Highlight whole series\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('normal');\n\n if (dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (symbol) {\n if (symbol.__temp) {\n data.setItemGraphicEl(dataIndex, null);\n this.group.remove(symbol);\n } else {\n symbol.downplay();\n }\n }\n } else {\n // FIXME\n // can not downplay completely.\n // Downplay whole series\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype._changePolyState = function (toState) {\n var polygon = this._polygon;\n setStatesFlag(this._polyline, toState);\n polygon && setStatesFlag(polygon, toState);\n };\n\n LineView.prototype._newPolyline = function (points) {\n var polyline = this._polyline; // Remove previous created polyline\n\n if (polyline) {\n this._lineGroup.remove(polyline);\n }\n\n polyline = new ECPolyline({\n shape: {\n points: points\n },\n segmentIgnoreThreshold: 2,\n z2: 10\n });\n\n this._lineGroup.add(polyline);\n\n this._polyline = polyline;\n return polyline;\n };\n\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\n var polygon = this._polygon; // Remove previous created polygon\n\n if (polygon) {\n this._lineGroup.remove(polygon);\n }\n\n polygon = new ECPolygon({\n shape: {\n points: points,\n stackedOnPoints: stackedOnPoints\n },\n segmentIgnoreThreshold: 2\n });\n\n this._lineGroup.add(polygon);\n\n this._polygon = polygon;\n return polygon;\n };\n\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\n var isHorizontalOrRadial;\n var isCoordSysPolar;\n var baseAxis = coordSys.getBaseAxis();\n var isAxisInverse = baseAxis.inverse;\n\n if (coordSys.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n isCoordSysPolar = false;\n } else if (coordSys.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n isCoordSysPolar = true;\n }\n\n var seriesModel = data.hostModel;\n var seriesDuration = seriesModel.get('animationDuration');\n\n if (zrUtil.isFunction(seriesDuration)) {\n seriesDuration = seriesDuration(null);\n }\n\n var seriesDelay = seriesModel.get('animationDelay') || 0;\n var seriesDelayValue = zrUtil.isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay;\n data.eachItemGraphicEl(function (symbol, idx) {\n var el = symbol;\n\n if (el) {\n var point = [symbol.x, symbol.y];\n var start = void 0;\n var end = void 0;\n var current = void 0;\n\n if (clipShape) {\n if (isCoordSysPolar) {\n var polarClip = clipShape;\n var coord = coordSys.pointToCoord(point);\n\n if (isHorizontalOrRadial) {\n start = polarClip.startAngle;\n end = polarClip.endAngle;\n current = -coord[1] / 180 * Math.PI;\n } else {\n start = polarClip.r0;\n end = polarClip.r;\n current = coord[0];\n }\n } else {\n var gridClip = clipShape;\n\n if (isHorizontalOrRadial) {\n start = gridClip.x;\n end = gridClip.x + gridClip.width;\n current = symbol.x;\n } else {\n start = gridClip.y + gridClip.height;\n end = gridClip.y;\n current = symbol.y;\n }\n }\n }\n\n var ratio = end === start ? 0 : (current - start) / (end - start);\n\n if (isAxisInverse) {\n ratio = 1 - ratio;\n }\n\n var delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue;\n var symbolPath = el.getSymbolPath();\n var text = symbolPath.getTextContent();\n el.attr({\n scaleX: 0,\n scaleY: 0\n });\n el.animateTo({\n scaleX: 1,\n scaleY: 1\n }, {\n duration: 200,\n setToFinal: true,\n delay: delay\n });\n\n if (text) {\n text.animateFrom({\n style: {\n opacity: 0\n }\n }, {\n duration: 300,\n delay: delay\n });\n }\n\n symbolPath.disableLabelAnimation = true;\n }\n });\n };\n\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) {\n var endLabelModel = seriesModel.getModel('endLabel');\n\n if (anyStateShowEndLabel(seriesModel)) {\n var data_2 = seriesModel.getData();\n var polyline = this._polyline; // series may be filtered.\n\n var points = data_2.getLayout('points');\n\n if (!points) {\n polyline.removeTextContent();\n this._endLabel = null;\n return;\n }\n\n var endLabel = this._endLabel;\n\n if (!endLabel) {\n endLabel = this._endLabel = new graphic.Text({\n z2: 200 // should be higher than item symbol\n\n });\n endLabel.ignoreClip = true;\n polyline.setTextContent(this._endLabel);\n polyline.disableLabelAnimation = true;\n } // Find last non-NaN data to display data\n\n\n var dataIndex = getLastIndexNotNull(points);\n\n if (dataIndex >= 0) {\n setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), {\n inheritColor: inheritColor,\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: function (dataIndex, opt, interpolatedValue) {\n return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex);\n },\n enableTextSetter: true\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\n polyline.textConfig.position = null;\n }\n } else if (this._endLabel) {\n this._polyline.removeTextContent();\n\n this._endLabel = null;\n }\n };\n\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\n var endLabel = this._endLabel;\n var polyline = this._polyline;\n\n if (endLabel) {\n // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\n // The label is not prepared at this time.\n if (percent < 1 && animationRecord.originalX == null) {\n animationRecord.originalX = endLabel.x;\n animationRecord.originalY = endLabel.y;\n }\n\n var points = data.getLayout('points');\n var seriesModel = data.hostModel;\n var connectNulls = seriesModel.get('connectNulls');\n var precision = endLabelModel.get('precision');\n var distance = endLabelModel.get('distance') || 0;\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var clipShape = clipRect.shape;\n var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y;\n var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\n var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\n var dim = isHorizontal ? 'x' : 'y';\n var dataIndexRange = getIndexRange(points, xOrY, dim);\n var indices = dataIndexRange.range;\n var diff = indices[1] - indices[0];\n var value = void 0;\n\n if (diff >= 1) {\n // diff > 1 && connectNulls, which is on the null data.\n if (diff > 1 && !connectNulls) {\n var pt = getPointAtIndex(points, indices[0]);\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\n } else {\n var pt = polyline.getPointOn(xOrY, dim);\n pt && endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n var startValue = seriesModel.getRawValue(indices[0]);\n var endValue = seriesModel.getRawValue(indices[1]);\n valueAnimation && (value = modelUtil.interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\n }\n\n animationRecord.lastFrameIndex = indices[0];\n } else {\n // If diff <= 0, which is the range is not found(Include NaN)\n // Choose the first point or last point.\n var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;\n var pt = getPointAtIndex(points, idx);\n valueAnimation && (value = seriesModel.getRawValue(idx));\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n }\n\n if (valueAnimation) {\n var inner = labelInner(endLabel);\n\n if (typeof inner.setLabelText === 'function') {\n inner.setLabelText(value);\n }\n }\n }\n };\n /**\r\n * @private\r\n */\n // FIXME Two value axis\n\n\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) {\n var polyline = this._polyline;\n var polygon = this._polygon;\n var seriesModel = data.hostModel;\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n var current = diff.current;\n var stackedOnCurrent = diff.stackedOnCurrent;\n var next = diff.next;\n var stackedOnNext = diff.stackedOnNext;\n\n if (step) {\n // TODO If stacked series is not step\n current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls);\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls);\n next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls);\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls);\n } // Don't apply animation if diff is large.\n // For better result and avoid memory explosion problems like\n // https://github.com/apache/incubator-echarts/issues/12229\n\n\n if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) {\n polyline.stopAnimation();\n polyline.setShape({\n points: next\n });\n\n if (polygon) {\n polygon.stopAnimation();\n polygon.setShape({\n points: next,\n stackedOnPoints: stackedOnNext\n });\n }\n\n return;\n }\n\n polyline.shape.__points = diff.current;\n polyline.shape.points = current;\n var target = {\n shape: {\n points: next\n }\n }; // Also animate the original points.\n // If points reference is changed when turning into step line.\n\n if (diff.current !== current) {\n target.shape.__points = diff.next;\n } // Stop previous animation.\n\n\n polyline.stopAnimation();\n graphic.updateProps(polyline, target, seriesModel);\n\n if (polygon) {\n polygon.setShape({\n // Reuse the points with polyline.\n points: current,\n stackedOnPoints: stackedOnCurrent\n });\n polygon.stopAnimation();\n graphic.updateProps(polygon, {\n shape: {\n stackedOnPoints: stackedOnNext\n }\n }, seriesModel); // If use attr directly in updateProps.\n\n if (polyline.shape.points !== polygon.shape.points) {\n polygon.shape.points = polyline.shape.points;\n }\n }\n\n var updatedDataInfo = [];\n var diffStatus = diff.status;\n\n for (var i = 0; i < diffStatus.length; i++) {\n var cmd = diffStatus[i].cmd;\n\n if (cmd === '=') {\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\n\n if (el) {\n updatedDataInfo.push({\n el: el,\n ptIdx: i // Index of points\n\n });\n }\n }\n }\n\n if (polyline.animators && polyline.animators.length) {\n polyline.animators[0].during(function () {\n polygon && polygon.dirtyShape();\n var points = polyline.shape.__points;\n\n for (var i = 0; i < updatedDataInfo.length; i++) {\n var el = updatedDataInfo[i].el;\n var offset = updatedDataInfo[i].ptIdx * 2;\n el.x = points[offset];\n el.y = points[offset + 1];\n el.markRedraw();\n }\n });\n }\n };\n\n LineView.prototype.remove = function (ecModel) {\n var group = this.group;\n var oldData = this._data;\n\n this._lineGroup.removeAll();\n\n this._symbolDraw.remove(true); // Remove temporary created elements when highlighting\n\n\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;\n };\n\n LineView.type = 'line';\n return LineView;\n}(ChartView);\n\nexport default LineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { map } from 'zrender/lib/core/util.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport { createFloat32Array } from '../util/vendor.js';\nexport default function pointsLayout(seriesType, forceStoreInTypedArray) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0])) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1])) {\n dims[1] = stackResultDim;\n }\n\n var store = data.getStore();\n var dimIdx0 = data.getDimensionIndex(dims[0]);\n var dimIdx1 = data.getDimensionIndex(dims[1]);\n return dimLen && {\n progress: function (params, data) {\n var segCount = params.end - params.start;\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\n var tmpIn = [];\n var tmpOut = [];\n\n for (var i = params.start, offset = 0; i < params.end; i++) {\n var point = void 0;\n\n if (dimLen === 1) {\n var x = store.get(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy.\n\n point = coordSys.dataToPoint(x, null, tmpOut);\n } else {\n tmpIn[0] = store.get(dimIdx0, i);\n tmpIn[1] = store.get(dimIdx1, i); // Let coordinate system to handle the NaN data.\n\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (useTypedArray) {\n points[offset++] = point[0];\n points[offset++] = point[1];\n } else {\n data.setItemLayout(i, point.slice());\n }\n }\n\n useTypedArray && data.setLayout('points', points);\n }\n };\n }\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n average: function (frame) {\n var sum = 0;\n var count = 0;\n\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n } // Return NaN if count is 0\n\n\n return count === 0 ? NaN : sum / count;\n },\n sum: function (frame) {\n var sum = 0;\n\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n\n return sum;\n },\n max: function (frame) {\n var max = -Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(max) ? max : NaN;\n },\n min: function (frame) {\n var min = Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(min) ? min : NaN;\n },\n // TODO\n // Median\n nearest: function (frame) {\n return frame[0];\n }\n};\n\nvar indexSampler = function (frame) {\n return Math.round(frame.length / 2);\n};\n\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data.\n\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized\n\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n\n if (isFinite(rate) && rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n\n var sampler = void 0;\n\n if (isString(sampling)) {\n sampler = samplers[sampling];\n } else if (isFunction(sampling)) {\n sampler = sampling;\n }\n\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LineSeries from './LineSeries.js';\nimport LineView from './LineView.js'; // In case developer forget to include grid component\n\nimport layoutPoints from '../../layout/points.js';\nimport dataSample from '../../processor/dataSample.js';\nexport function install(registers) {\n registers.registerChartView(LineView);\n registers.registerSeriesModel(LineSeries);\n registers.registerLayout(layoutPoints('line', true));\n registers.registerVisual({\n seriesType: 'line',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // Visual coding for legend\n\n var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n\n if (lineStyle && !lineStyle.stroke) {\n // Fill in visual should be palette color if\n // has color callback\n lineStyle.stroke = data.getVisual('style').fill;\n }\n\n data.setVisual('legendLineStyle', lineStyle);\n }\n }); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, defaults, keys } from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { createFloat32Array } from '../util/vendor.js';\nvar STACK_PREFIX = '__ec_stack_';\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(axis) {\n return axis.dim + axis.index;\n}\n/**\r\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\r\n */\n\n\nexport function getLayoutOnAxis(opt) {\n var params = [];\n var baseAxis = opt.axis;\n var axisKey = 'axis0';\n\n if (baseAxis.type !== 'category') {\n return;\n }\n\n var bandWidth = baseAxis.getBandWidth();\n\n for (var i = 0; i < opt.count || 0; i++) {\n params.push(defaults({\n bandWidth: bandWidth,\n axisKey: axisKey,\n stackId: STACK_PREFIX + i\n }, opt));\n }\n\n var widthAndOffsets = doCalBarWidthAndOffset(params);\n var result = [];\n\n for (var i = 0; i < opt.count; i++) {\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n item.offsetCenter = item.offset + item.width / 2;\n result.push(item);\n }\n\n return result;\n}\nexport function prepareLayoutBarSeries(seriesType, ecModel) {\n var seriesModels = [];\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for cartesian2d only\n if (isOnCartesian(seriesModel)) {\n seriesModels.push(seriesModel);\n }\n });\n return seriesModels;\n}\n/**\r\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\r\n * values.\r\n * This works for time axes, value axes, and log axes.\r\n * For a single time axis, return value is in the form like\r\n * {'x_0': [1000000]}.\r\n * The value of 1000000 is in milliseconds.\r\n */\n\nfunction getValueAxesMinGaps(barSeries) {\n /**\r\n * Map from axis.index to values.\r\n * For a single time axis, axisValues is in the form like\r\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\r\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\r\n * series.\r\n */\n var axisValues = {};\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n return;\n }\n\n var data = seriesModel.getData();\n var key = baseAxis.dim + '_' + baseAxis.index;\n var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var store = data.getStore();\n\n for (var i = 0, cnt = store.count(); i < cnt; ++i) {\n var value = store.get(dimIdx, i);\n\n if (!axisValues[key]) {\n // No previous data for the axis\n axisValues[key] = [value];\n } else {\n // No value in previous series\n axisValues[key].push(value);\n } // Ignore duplicated time values in the same axis\n\n }\n });\n var axisMinGaps = {};\n\n for (var key in axisValues) {\n if (axisValues.hasOwnProperty(key)) {\n var valuesInAxis = axisValues[key];\n\n if (valuesInAxis) {\n // Sort axis values into ascending order to calculate gaps\n valuesInAxis.sort(function (a, b) {\n return a - b;\n });\n var min = null;\n\n for (var j = 1; j < valuesInAxis.length; ++j) {\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n\n if (delta > 0) {\n // Ignore 0 delta because they are of the same axis value\n min = min === null ? delta : Math.min(min, delta);\n }\n } // Set to null if only have one data\n\n\n axisMinGaps[key] = min;\n }\n }\n }\n\n return axisMinGaps;\n}\n\nexport function makeColumnLayout(barSeries) {\n var axisMinGaps = getValueAxesMinGaps(barSeries);\n var seriesInfoList = [];\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n var minGap = axisMinGaps[key];\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n var scale = baseAxis.scale.getExtent();\n var scaleSpan = Math.abs(scale[1] - scale[0]);\n bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n } else {\n var data = seriesModel.getData();\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n }\n\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barMinWidth = parsePercent( // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,\n // the auto-calculated bar width might be less than 0.5 / 1.\n seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n seriesInfoList.push({\n bandWidth: bandWidth,\n barWidth: barWidth,\n barMaxWidth: barMaxWidth,\n barMinWidth: barMinWidth,\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n axisKey: getAxisKey(baseAxis),\n stackId: getSeriesStackId(seriesModel)\n });\n });\n return doCalBarWidthAndOffset(seriesInfoList);\n}\n\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n // Columns info on each category axis. Key is cartesian name\n var columnsMap = {};\n each(seriesInfoList, function (seriesInfo, idx) {\n var axisKey = seriesInfo.axisKey;\n var bandWidth = seriesInfo.bandWidth;\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: null,\n gap: '20%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = seriesInfo.stackId;\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n }; // Caution: In a single coordinate system, these barGrid attributes\n // will be shared by series. Consider that they have default values,\n // only the attributes set on the last series will work.\n // Do not change this fact unless there will be a break change.\n\n var barWidth = seriesInfo.barWidth;\n\n if (barWidth && !stacks[stackId].width) {\n // See #6312, do not restrict width.\n stacks[stackId].width = barWidth;\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n var barMaxWidth = seriesInfo.barMaxWidth;\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n var barMinWidth = seriesInfo.barMinWidth;\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n var barGap = seriesInfo.barGap;\n barGap != null && (columnsOnAxis.gap = barGap);\n var barCategoryGap = seriesInfo.barCategoryGap;\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGapPercent = columnsOnAxis.categoryGap;\n\n if (categoryGapPercent == null) {\n var columnCount = keys(stacks).length; // More columns in one group\n // the spaces between group is smaller. Or the column will be too thin.\n\n categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%';\n }\n\n var categoryGap = parsePercent(categoryGapPercent, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n each(stacks, function (column) {\n var maxWidth = column.maxWidth;\n var minWidth = column.minWidth;\n\n if (!column.width) {\n var finalWidth = autoWidth;\n\n if (maxWidth && maxWidth < finalWidth) {\n finalWidth = Math.min(maxWidth, remainedWidth);\n } // `minWidth` has higher priority. `minWidth` decide that whether the\n // bar is able to be visible. So `minWidth` should not be restricted\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n // the extreme cases for `value` axis, bars are allowed to overlap\n // with each other if `minWidth` specified.\n\n\n if (minWidth && minWidth > finalWidth) {\n finalWidth = minWidth;\n }\n\n if (finalWidth !== autoWidth) {\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n } else {\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n // CSS does. Because barWidth can be a percent value, where\n // `barMaxWidth` can be used to restrict the final width.\n var finalWidth = column.width;\n\n if (maxWidth) {\n finalWidth = Math.min(finalWidth, maxWidth);\n } // `minWidth` has higher priority, as described above\n\n\n if (minWidth) {\n finalWidth = Math.max(finalWidth, minWidth);\n }\n\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n bandWidth: bandWidth,\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n if (barWidthAndOffset && axis) {\n var result = barWidthAndOffset[getAxisKey(axis)];\n\n if (result != null && seriesModel != null) {\n return result[getSeriesStackId(seriesModel)];\n }\n\n return result;\n }\n}\n\nexport { retrieveColumnLayout };\nexport function layout(seriesType, ecModel) {\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n var barWidthAndOffset = makeColumnLayout(seriesModels);\n each(seriesModels, function (seriesModel) {\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n data.setLayout({\n bandWidth: columnLayoutInfo.bandWidth,\n offset: columnOffset,\n size: columnWidth\n });\n });\n} // TODO: Do not support stack in large mode yet.\n\nexport function createProgressiveLayout(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n if (!isOnCartesian(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim));\n var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var drawBackground = seriesModel.get('showBackground', true);\n var valueDim = data.mapDimension(valueAxis.dim);\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries');\n var isValueAxisH = valueAxis.isHorizontal();\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\n var isLarge = isInLargeMode(seriesModel);\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); // Layout info.\n\n var columnWidth = data.getLayout('size');\n var columnOffset = data.getLayout('offset');\n return {\n progress: function (params, data) {\n var count = params.count;\n var largePoints = isLarge && createFloat32Array(count * 3);\n var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3);\n var largeDataIndices = isLarge && createFloat32Array(count);\n var coordLayout = cartesian.master.getRect();\n var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;\n var dataIndex;\n var store = data.getStore();\n var idxOffset = 0;\n\n while ((dataIndex = params.next()) != null) {\n var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);\n var baseValue = store.get(baseDimIdx, dataIndex);\n var baseCoord = valueAxisStart;\n var startValue = void 0; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n\n if (stacked) {\n startValue = +value - store.get(valueDimIdx, dataIndex);\n }\n\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (isValueAxisH) {\n var coord = cartesian.dataToPoint([value, baseValue]);\n\n if (stacked) {\n var startCoord = cartesian.dataToPoint([startValue, baseValue]);\n baseCoord = startCoord[0];\n }\n\n x = baseCoord;\n y = coord[1] + columnOffset;\n width = coord[0] - baseCoord;\n height = columnWidth;\n\n if (Math.abs(width) < barMinHeight) {\n width = (width < 0 ? -1 : 1) * barMinHeight;\n }\n } else {\n var coord = cartesian.dataToPoint([baseValue, value]);\n\n if (stacked) {\n var startCoord = cartesian.dataToPoint([baseValue, startValue]);\n baseCoord = startCoord[1];\n }\n\n x = coord[0] + columnOffset;\n y = baseCoord;\n width = columnWidth;\n height = coord[1] - baseCoord;\n\n if (Math.abs(height) < barMinHeight) {\n // Include zero to has a positive bar\n height = (height <= 0 ? -1 : 1) * barMinHeight;\n }\n }\n\n if (!isLarge) {\n data.setItemLayout(dataIndex, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n } else {\n largePoints[idxOffset] = x;\n largePoints[idxOffset + 1] = y;\n largePoints[idxOffset + 2] = isValueAxisH ? width : height;\n\n if (largeBackgroundPoints) {\n largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x;\n largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;\n largeBackgroundPoints[idxOffset + 2] = bgSize;\n }\n\n largeDataIndices[dataIndex] = dataIndex;\n }\n\n idxOffset += 3;\n }\n\n if (isLarge) {\n data.setLayout({\n largePoints: largePoints,\n largeDataIndices: largeDataIndices,\n largeBackgroundPoints: largeBackgroundPoints,\n valueAxisHorizontal: isValueAxisH\n });\n }\n }\n };\n }\n };\n}\n\nfunction isOnCartesian(seriesModel) {\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\n\nfunction isInLargeMode(seriesModel) {\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n} // See cases in `test/bar-start.html` and `#7412`, `#8747`.\n\n\nfunction getValueAxisStart(baseAxis, valueAxis) {\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { each } from 'zrender/lib/core/util.js';\n\nvar BaseBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BaseBarSeriesModel, _super);\n\n function BaseBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BaseBarSeriesModel.type;\n return _this;\n }\n\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value, dims, startingAtTick) {\n var coordSys = this.coordinateSystem;\n\n if (coordSys && coordSys.clampData) {\n // PENDING if clamp ?\n var clampData_1 = coordSys.clampData(value);\n var pt_1 = coordSys.dataToPoint(clampData_1);\n\n if (startingAtTick) {\n each(coordSys.getAxes(), function (axis, idx) {\n // If axis type is category, use tick coords instead\n if (axis.type === 'category' && dims != null) {\n var tickCoords = axis.getTicksCoords();\n var targetTickId = clampData_1[idx]; // The index of rightmost tick of markArea is 1 larger than x1/y1 index\n\n var isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';\n\n if (isEnd) {\n targetTickId += 1;\n } // The only contains one tick, tickCoords is\n // like [{coord: 0, tickValue: 0}, {coord: 0}]\n // to the length should always be larger than 1\n\n\n if (tickCoords.length < 2) {\n return;\n } else if (tickCoords.length === 2) {\n // The left value and right value of the axis are\n // the same. coord is 0 in both items. Use the max\n // value of the axis as the coord\n pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]);\n return;\n }\n\n var leftCoord = void 0;\n var coord = void 0;\n var stepTickValue = 1;\n\n for (var i = 0; i < tickCoords.length; i++) {\n var tickCoord = tickCoords[i].coord; // The last item of tickCoords doesn't contain\n // tickValue\n\n var tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue;\n\n if (tickValue === targetTickId) {\n coord = tickCoord;\n break;\n } else if (tickValue < targetTickId) {\n leftCoord = tickCoord;\n } else if (leftCoord != null && tickValue > targetTickId) {\n coord = (tickCoord + leftCoord) / 2;\n break;\n }\n\n if (i === 1) {\n // Here we assume the step of category axes is\n // the same\n stepTickValue = tickValue - tickCoords[0].tickValue;\n }\n }\n\n if (coord == null) {\n if (!leftCoord) {\n // targetTickId is smaller than all tick ids in the\n // visible area, use the leftmost tick coord\n coord = tickCoords[0].coord;\n } else if (leftCoord) {\n // targetTickId is larger than all tick ids in the\n // visible area, use the rightmost tick coord\n coord = tickCoords[tickCoords.length - 1].coord;\n }\n }\n\n pt_1[idx] = axis.toGlobalCoord(coord);\n }\n });\n } else {\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt_1[offsetIndex] += offset + size / 2;\n }\n\n return pt_1;\n }\n\n return [NaN, NaN];\n };\n\n BaseBarSeriesModel.type = 'series.__base_bar__';\n BaseBarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n barMinHeight: 0,\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod'\n };\n return BaseBarSeriesModel;\n}(SeriesModel);\n\nSeriesModel.registerClass(BaseBarSeriesModel);\nexport default BaseBarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar BarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BarSeriesModel, _super);\n\n function BarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BarSeriesModel.type;\n return _this;\n }\n\n BarSeriesModel.prototype.getInitialData = function () {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true,\n createInvertedIndices: !!this.get('realtimeSort', true) || null\n });\n };\n /**\r\n * @override\r\n */\n\n\n BarSeriesModel.prototype.getProgressive = function () {\n // Do not support progressive in normal mode.\n return this.get('large') ? this.get('progressive') : false;\n };\n /**\r\n * @override\r\n */\n\n\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\n // Do not support progressive in normal mode.\n var progressiveThreshold = this.get('progressiveThreshold');\n var largeThreshold = this.get('largeThreshold');\n\n if (largeThreshold > progressiveThreshold) {\n progressiveThreshold = largeThreshold;\n }\n\n return progressiveThreshold;\n };\n\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.rect(data.getItemLayout(dataIndex));\n };\n\n BarSeriesModel.type = 'series.bar';\n BarSeriesModel.dependencies = ['grid', 'polar'];\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n // If clipped\n // Only available on cartesian2d\n clip: true,\n roundCap: false,\n showBackground: false,\n backgroundStyle: {\n color: 'rgba(180, 180, 180, 0.2)',\n borderColor: null,\n borderWidth: 0,\n borderType: 'solid',\n borderRadius: 0,\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n realtimeSort: false\n });\n return BarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default BarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic.js';\n/**\r\n * Sausage: similar to sector, but have half circle on both sides\r\n */\n\nvar SausageShape =\n/** @class */\nfunction () {\n function SausageShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n\n return SausageShape;\n}();\n\nvar SausagePath =\n/** @class */\nfunction (_super) {\n __extends(SausagePath, _super);\n\n function SausagePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'sausage';\n return _this;\n }\n\n SausagePath.prototype.getDefaultShape = function () {\n return new SausageShape();\n };\n\n SausagePath.prototype.buildPath = function (ctx, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var dr = (r - r0) * 0.5;\n var rCenter = r0 + dr;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var PI2 = Math.PI * 2;\n var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2;\n\n if (!lessThanCircle) {\n // Normalize angles\n startAngle = endAngle - (clockwise ? PI2 : -PI2);\n }\n\n var unitStartX = Math.cos(startAngle);\n var unitStartY = Math.sin(startAngle);\n var unitEndX = Math.cos(endAngle);\n var unitEndY = Math.sin(endAngle);\n\n if (lessThanCircle) {\n ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\n ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);\n } else {\n ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\n }\n\n ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\n ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n\n if (r0 !== 0) {\n ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\n } // ctx.closePath();\n\n };\n\n return SausagePath;\n}(Path);\n\nexport default SausagePath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { isArray, isNumber } from 'zrender/lib/core/util.js';\nexport function createSectorCalculateTextPosition(positionMapping, opts) {\n opts = opts || {};\n var isRoundCap = opts.isRoundCap;\n return function (out, opts, boundingRect) {\n var textPosition = opts.position;\n\n if (!textPosition || textPosition instanceof Array) {\n return calculateTextPosition(out, opts, boundingRect);\n }\n\n var mappedSectorPosition = positionMapping(textPosition);\n var distance = opts.distance != null ? opts.distance : 5;\n var sector = this.shape;\n var cx = sector.cx;\n var cy = sector.cy;\n var r = sector.r;\n var r0 = sector.r0;\n var middleR = (r + r0) / 2;\n var startAngle = sector.startAngle;\n var endAngle = sector.endAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;\n var mathCos = Math.cos;\n var mathSin = Math.sin; // base position: top-left\n\n var x = cx + r * mathCos(startAngle);\n var y = cy + r * mathSin(startAngle);\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n\n switch (mappedSectorPosition) {\n case 'startArc':\n x = cx + (r0 - distance) * mathCos(middleAngle);\n y = cy + (r0 - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n\n case 'insideStartArc':\n x = cx + (r0 + distance) * mathCos(middleAngle);\n y = cy + (r0 + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'startAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideStartAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n\n case 'middle':\n x = cx + middleR * mathCos(middleAngle);\n y = cy + middleR * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n\n case 'endArc':\n x = cx + (r + distance) * mathCos(middleAngle);\n y = cy + (r + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideEndArc':\n x = cx + (r - distance) * mathCos(middleAngle);\n y = cy + (r - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n\n case 'endAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideEndAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n default:\n return calculateTextPosition(out, opts, boundingRect);\n }\n\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n };\n}\nexport function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) {\n if (isNumber(rotateType)) {\n // user-set rotation\n sector.setTextConfig({\n rotation: rotateType\n });\n return;\n } else if (isArray(textPosition)) {\n // user-set position, use 0 as auto rotation\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n\n var shape = sector.shape;\n var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;\n var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var anchorAngle;\n var mappedSectorPosition = positionMapping(textPosition);\n\n switch (mappedSectorPosition) {\n case 'startArc':\n case 'insideStartArc':\n case 'middle':\n case 'insideEndArc':\n case 'endArc':\n anchorAngle = middleAngle;\n break;\n\n case 'startAngle':\n case 'insideStartAngle':\n anchorAngle = startAngle;\n break;\n\n case 'endAngle':\n case 'insideEndAngle':\n anchorAngle = endAngle;\n break;\n\n default:\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n\n var rotate = Math.PI * 1.5 - anchorAngle;\n /**\r\n * TODO: labels with rotate > Math.PI / 2 should be rotate another\r\n * half round flipped to increase readability. However, only middle\r\n * position supports this for now, because in other positions, the\r\n * anchor point is not at the center of the text, so the positions\r\n * after rotating is not as expected.\r\n */\n\n if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n rotate -= Math.PI;\n }\n\n sector.setTextConfig({\n rotation: rotate\n });\n}\n\nfunction adjustAngleDistanceX(angle, distance, isEnd) {\n return distance * Math.sin(angle) * (isEnd ? -1 : 1);\n}\n\nfunction adjustAngleDistanceY(angle, distance, isEnd) {\n return distance * Math.cos(angle) * (isEnd ? 1 : -1);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray, map } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nexport function getSectorCornerRadius(model, shape, zeroIfNull) {\n var cornerRadius = model.get('borderRadius');\n\n if (cornerRadius == null) {\n return zeroIfNull ? {\n cornerRadius: 0\n } : null;\n }\n\n if (!isArray(cornerRadius)) {\n cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\n }\n\n var dr = Math.abs(shape.r || 0 - shape.r0 || 0);\n return {\n cornerRadius: map(cornerRadius, function (cr) {\n return parsePercent(cr, dr);\n })\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport { extend, each, map } from 'zrender/lib/core/util.js';\nimport { Rect, Sector, updateProps, initProps, removeElementWithFadeOut, traverseElements } from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation, labelInner } from '../../label/labelStyle.js';\nimport { throttle } from '../../util/throttle.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { warn } from '../../util/log.js';\nimport { createSectorCalculateTextPosition, setSectorTextRotation } from '../../label/sectorLabel.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\n\nfunction getClipArea(coord, data) {\n var coordSysClipArea = coord.getArea && coord.getArea();\n\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var baseAxis = coord.getBaseAxis(); // When boundaryGap is false or using time axis. bar may exceed the grid.\n // We should not clip this part.\n // See test/bar2.html\n\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\n var expandWidth = data.getLayout('bandWidth');\n\n if (baseAxis.isHorizontal()) {\n coordSysClipArea.x -= expandWidth;\n coordSysClipArea.width += expandWidth * 2;\n } else {\n coordSysClipArea.y -= expandWidth;\n coordSysClipArea.height += expandWidth * 2;\n }\n }\n }\n\n return coordSysClipArea;\n}\n\nvar BarView =\n/** @class */\nfunction (_super) {\n __extends(BarView, _super);\n\n function BarView() {\n var _this = _super.call(this) || this;\n\n _this.type = BarView.type;\n _this._isFirstFrame = true;\n return _this;\n }\n\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\n this._model = seriesModel;\n\n this._removeOnRenderedListener(api);\n\n this._updateDrawMode(seriesModel);\n\n var coordinateSystemType = seriesModel.get('coordinateSystem');\n\n if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload);\n } else if (process.env.NODE_ENV !== 'production') {\n warn('Only cartesian2d and polar supported for bar.');\n }\n };\n\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\n this._clear();\n\n this._updateDrawMode(seriesModel); // incremental also need to clip, otherwise might be overlow.\n // But must not set clip in each frame, otherwise all of the children will be marked redraw.\n\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype.incrementalRender = function (params, seriesModel) {\n // Reset\n this._progressiveEls = []; // Do not support progressive in normal mode.\n\n this._incrementalRenderLarge(params, seriesModel);\n };\n\n BarView.prototype.eachRendered = function (cb) {\n traverseElements(this._progressiveEls || this.group, cb);\n };\n\n BarView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coord = seriesModel.coordinateSystem;\n var baseAxis = coord.getBaseAxis();\n var isHorizontalOrRadial;\n\n if (coord.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n } else if (coord.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n }\n\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\n\n if (realtimeSortCfg) {\n this._enableRealtimeSort(realtimeSortCfg, data, api);\n }\n\n var needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\n var coordSysClipArea = getClipArea(coord, data); // If there is clipPath created in large mode. Remove it.\n\n group.removeClipPath(); // We don't use clipPath in normal mode because we needs a perfect animation\n // And don't want the label are clipped.\n\n var roundCap = seriesModel.get('roundCap', true);\n var drawBackground = seriesModel.get('showBackground', true);\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\n var bgEls = [];\n var oldBgEls = this._backgroundEls;\n var isInitSort = payload && payload.isInitSort;\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\n\n function createBackground(dataIndex) {\n var bgLayout = getLayout[coord.type](data, dataIndex);\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n\n bgEls[dataIndex] = bgEl;\n return bgEl;\n }\n\n ;\n data.diff(oldData).add(function (dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\n\n if (drawBackground) {\n createBackground(dataIndex);\n } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\n\n\n if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) {\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n // Clip will modify the layout params.\n // And return a boolean to determine if the shape are fully clipped.\n isClipped = clip[coord.type](coordSysClipArea, layout);\n }\n\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\n\n if (realtimeSortCfg) {\n /**\r\n * Force label animation because even if the element is\r\n * ignored because it's clipped, it may not be clipped after\r\n * changing order. Then, if not using forceLabelAnimation,\r\n * the label animation was never started, in which case,\r\n * the label will be the final value and doesn't have label\r\n * animation.\r\n */\n el.forceLabelAnimation = true;\n }\n\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\n } else {\n initProps(el, {\n shape: layout\n }, seriesModel, dataIndex);\n }\n\n data.setItemGraphicEl(dataIndex, el);\n group.add(el);\n el.ignore = isClipped;\n }).update(function (newIndex, oldIndex) {\n var itemModel = data.getItemModel(newIndex);\n var layout = getLayout[coord.type](data, newIndex, itemModel);\n\n if (drawBackground) {\n var bgEl = void 0;\n\n if (oldBgEls.length === 0) {\n bgEl = createBackground(oldIndex);\n } else {\n bgEl = oldBgEls[oldIndex];\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n\n bgEls[newIndex] = bgEl;\n }\n\n var bgLayout = getLayout[coord.type](data, newIndex);\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\n updateProps(bgEl, {\n shape: shape\n }, animationModel, newIndex);\n }\n\n var el = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) {\n group.remove(el);\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n isClipped = clip[coord.type](coordSysClipArea, layout);\n\n if (isClipped) {\n group.remove(el);\n }\n }\n\n if (!el) {\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\n } else {\n saveOldStyle(el);\n }\n\n if (realtimeSortCfg) {\n el.forceLabelAnimation = true;\n }\n\n if (isChangeOrder) {\n var textEl = el.getTextContent();\n\n if (textEl) {\n var labelInnerStore = labelInner(textEl);\n\n if (labelInnerStore.prevValue != null) {\n /**\r\n * Set preValue to be value so that no new label\r\n * should be started, otherwise, it will take a full\r\n * `animationDurationUpdate` time to finish the\r\n * animation, which is not expected.\r\n */\n labelInnerStore.prevValue = labelInnerStore.value;\n }\n }\n } // Not change anything if only order changed.\n // Especially not change label.\n else {\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\n } else {\n updateProps(el, {\n shape: layout\n }, seriesModel, newIndex, null);\n }\n\n data.setItemGraphicEl(newIndex, el);\n el.ignore = isClipped;\n group.add(el);\n }).remove(function (dataIndex) {\n var el = oldData.getItemGraphicEl(dataIndex);\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\n }).execute();\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\n bgGroup.removeAll();\n\n for (var i = 0; i < bgEls.length; ++i) {\n bgGroup.add(bgEls[i]);\n }\n\n group.add(bgGroup);\n this._backgroundEls = bgEls;\n this._data = data;\n };\n\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n this._removeBackground();\n\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n\n BarView.prototype._updateLargeClip = function (seriesModel) {\n // Use clipPath in large mode.\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n var group = this.group;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n };\n\n BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) {\n var _this = this; // If no data in the first frame, wait for data to initSort\n\n\n if (!data.count()) {\n return;\n }\n\n var baseAxis = realtimeSortCfg.baseAxis;\n\n if (this._isFirstFrame) {\n this._dispatchInitSort(data, realtimeSortCfg, api);\n\n this._isFirstFrame = false;\n } else {\n var orderMapping_1 = function (idx) {\n var el = data.getItemGraphicEl(idx);\n var shape = el && el.shape;\n return shape && // The result should be consistent with the initial sort by data value.\n // Do not support the case that both positive and negative exist.\n Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\n || 0;\n };\n\n this._onRendered = function () {\n _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api);\n };\n\n api.getZr().on('rendered', this._onRendered);\n }\n };\n\n BarView.prototype._dataSort = function (data, baseAxis, orderMapping) {\n var info = [];\n data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) {\n var mappedValue = orderMapping(dataIdx);\n mappedValue = mappedValue == null ? NaN : mappedValue;\n info.push({\n dataIndex: dataIdx,\n mappedValue: mappedValue,\n ordinalNumber: ordinalNumber\n });\n });\n info.sort(function (a, b) {\n // If NaN, it will be treated as min val.\n return b.mappedValue - a.mappedValue;\n });\n return {\n ordinalNumbers: map(info, function (item) {\n return item.ordinalNumber;\n })\n };\n };\n\n BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) {\n var scale = baseAxis.scale;\n var ordinalDataDim = data.mapDimension(baseAxis.dim);\n var lastValue = Number.MAX_VALUE;\n\n for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\n var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\n var value = rawIdx < 0 // If some tick have no bar, the tick will be treated as min.\n ? Number.MIN_VALUE // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\n : orderMapping(data.indexOfRawIndex(rawIdx));\n\n if (value > lastValue) {\n return true;\n }\n\n lastValue = value;\n }\n\n return false;\n };\n /*\r\n * Consider the case when A and B changed order, whose representing\r\n * bars are both out of sight, we don't wish to trigger reorder action\r\n * as long as the order in the view doesn't change.\r\n */\n\n\n BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) {\n var scale = baseAxis.scale;\n var extent = scale.getExtent();\n var tickNum = Math.max(0, extent[0]);\n var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\n\n for (; tickNum <= tickMax; ++tickNum) {\n if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\n return true;\n }\n }\n };\n\n BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) {\n if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\n return;\n }\n\n var sortInfo = this._dataSort(data, baseAxis, orderMapping);\n\n if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\n this._removeOnRenderedListener(api);\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n axisId: baseAxis.index,\n sortInfo: sortInfo\n });\n }\n };\n\n BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) {\n var baseAxis = realtimeSortCfg.baseAxis;\n\n var sortResult = this._dataSort(data, baseAxis, function (dataIdx) {\n return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);\n });\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n isInitSort: true,\n axisId: baseAxis.index,\n sortInfo: sortResult\n });\n };\n\n BarView.prototype.remove = function (ecModel, api) {\n this._clear(this._model);\n\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype.dispose = function (ecModel, api) {\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype._removeOnRenderedListener = function (api) {\n if (this._onRendered) {\n api.getZr().off('rendered', this._onRendered);\n this._onRendered = null;\n }\n };\n\n BarView.prototype._clear = function (model) {\n var group = this.group;\n var data = this._data;\n\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\n this._removeBackground();\n\n this._backgroundEls = [];\n data.eachItemGraphicEl(function (el) {\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\n });\n } else {\n group.removeAll();\n }\n\n this._data = null;\n this._isFirstFrame = true;\n };\n\n BarView.prototype._removeBackground = function () {\n this.group.remove(this._backgroundGroup);\n this._backgroundGroup = null;\n };\n\n BarView.type = 'bar';\n return BarView;\n}(ChartView);\n\nvar clip = {\n cartesian2d: function (coordSysBoundingRect, layout) {\n var signWidth = layout.width < 0 ? -1 : 1;\n var signHeight = layout.height < 0 ? -1 : 1; // Needs positive width and height\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\n var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\n var x = mathMax(layout.x, coordSysBoundingRect.x);\n var x2 = mathMin(layout.x + layout.width, coordSysX2);\n var y = mathMax(layout.y, coordSysBoundingRect.y);\n var y2 = mathMin(layout.y + layout.height, coordSysY2);\n var xClipped = x2 < x;\n var yClipped = y2 < y; // When xClipped or yClipped, the element will be marked as `ignore`.\n // But we should also place the element at the edge of the coord sys bounding rect.\n // Because if data changed and the bar shows again, its transition animation\n // will begin at this place.\n\n layout.x = xClipped && x > coordSysX2 ? x2 : x;\n layout.y = yClipped && y > coordSysY2 ? y2 : y;\n layout.width = xClipped ? 0 : x2 - x;\n layout.height = yClipped ? 0 : y2 - y; // Reverse back\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n return xClipped || yClipped;\n },\n polar: function (coordSysClipArea, layout) {\n var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n var r = mathMin(layout.r, coordSysClipArea.r);\n var r0 = mathMax(layout.r0, coordSysClipArea.r0);\n layout.r = r;\n layout.r0 = r0;\n var clipped = r - r0 < 0; // Reverse back\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n return clipped;\n }\n};\nvar elementCreator = {\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\n var rect = new Rect({\n shape: extend({}, layout),\n z2: 1\n });\n rect.__dataIndex = newIndex;\n rect.name = 'item';\n\n if (animationModel) {\n var rectShape = rect.shape;\n var animateProperty = isHorizontal ? 'height' : 'width';\n rectShape[animateProperty] = 0;\n }\n\n return rect;\n },\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\n var ShapeClass = !isRadial && roundCap ? Sausage : Sector;\n var sector = new ShapeClass({\n shape: layout,\n z2: 1\n });\n sector.name = 'item';\n var positionMap = createPolarPositionMapping(isRadial);\n sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, {\n isRoundCap: ShapeClass === Sausage\n }); // Animation\n\n if (animationModel) {\n var sectorShape = sector.shape;\n var animateProperty = isRadial ? 'r' : 'endAngle';\n var animateTarget = {};\n sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;\n animateTarget[animateProperty] = layout[animateProperty];\n (isUpdate ? updateProps : initProps)(sector, {\n shape: animateTarget // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\n\n }, animationModel);\n }\n\n return sector;\n }\n};\n\nfunction shouldRealtimeSort(seriesModel, coordSys) {\n var realtimeSortOption = seriesModel.get('realtimeSort', true);\n var baseAxis = coordSys.getBaseAxis();\n\n if (process.env.NODE_ENV !== 'production') {\n if (realtimeSortOption) {\n if (baseAxis.type !== 'category') {\n warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\n }\n\n if (coordSys.type !== 'cartesian2d') {\n warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\n }\n }\n }\n\n if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\n return {\n baseAxis: baseAxis,\n otherAxis: coordSys.getOtherAxis(baseAxis)\n };\n }\n}\n\nfunction updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\n var seriesTarget;\n var axisTarget;\n\n if (isHorizontal) {\n axisTarget = {\n x: layout.x,\n width: layout.width\n };\n seriesTarget = {\n y: layout.y,\n height: layout.height\n };\n } else {\n axisTarget = {\n y: layout.y,\n height: layout.height\n };\n seriesTarget = {\n x: layout.x,\n width: layout.width\n };\n }\n\n if (!isChangeOrder) {\n // Keep the original growth animation if only axis order changed.\n // Not start a new animation.\n (isUpdate ? updateProps : initProps)(el, {\n shape: seriesTarget\n }, seriesAnimationModel, newIndex, null);\n }\n\n var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\n (isUpdate ? updateProps : initProps)(el, {\n shape: axisTarget\n }, axisAnimationModel, newIndex);\n}\n\nfunction checkPropertiesNotValid(obj, props) {\n for (var i = 0; i < props.length; i++) {\n if (!isFinite(obj[props[i]])) {\n return true;\n }\n }\n\n return false;\n}\n\nvar rectPropties = ['x', 'y', 'width', 'height'];\nvar polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle'];\nvar isValidLayout = {\n cartesian2d: function (layout) {\n return !checkPropertiesNotValid(layout, rectPropties);\n },\n polar: function (layout) {\n return !checkPropertiesNotValid(layout, polarPropties);\n }\n};\nvar getLayout = {\n // itemModel is only used to get borderWidth, which is not needed\n // when calculating bar background layout.\n cartesian2d: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth\n\n var signX = layout.width > 0 ? 1 : -1;\n var signY = layout.height > 0 ? 1 : -1;\n return {\n x: layout.x + signX * fixedLineWidth / 2,\n y: layout.y + signY * fixedLineWidth / 2,\n width: layout.width - signX * fixedLineWidth,\n height: layout.height - signY * fixedLineWidth\n };\n },\n polar: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n return {\n cx: layout.cx,\n cy: layout.cy,\n r0: layout.r0,\n r: layout.r,\n startAngle: layout.startAngle,\n endAngle: layout.endAngle,\n clockwise: layout.clockwise\n };\n }\n};\n\nfunction isZeroOnPolar(layout) {\n return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;\n}\n\nfunction createPolarPositionMapping(isRadial) {\n return function (isRadial) {\n var arcOrAngle = isRadial ? 'Arc' : 'Angle';\n return function (position) {\n switch (position) {\n case 'start':\n case 'insideStart':\n case 'end':\n case 'insideEnd':\n return position + arcOrAngle;\n\n default:\n return position;\n }\n };\n }(isRadial);\n}\n\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) {\n var style = data.getItemVisual(dataIndex, 'style');\n\n if (!isPolar) {\n var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n el.setShape('r', borderRadius);\n } else if (!seriesModel.get('roundCap')) {\n var sectorShape = el.shape;\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n extend(sectorShape, cornerRadius);\n el.setShape(sectorShape);\n }\n\n el.useStyle(style);\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && el.attr('cursor', cursorStyle);\n var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left';\n var labelStatesModels = getLabelStatesModels(itemModel);\n setLabelStyle(el, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n inheritColor: style.fill,\n defaultOpacity: style.opacity,\n defaultOutsidePosition: labelPositionOutside\n });\n var label = el.getTextContent();\n\n if (isPolar && label) {\n var position = itemModel.get(['label', 'position']);\n el.textConfig.inside = position === 'middle' ? true : null;\n setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate']));\n }\n\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) {\n return getDefaultInterpolatedLabel(data, value);\n });\n var emphasisModel = itemModel.getModel(['emphasis']);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n setStatesStylesFromModel(el, itemModel);\n\n if (isZeroOnPolar(layout)) {\n el.style.fill = 'none';\n el.style.stroke = 'none';\n each(el.states, function (state) {\n if (state.style) {\n state.style.fill = state.style.stroke = 'none';\n }\n });\n }\n} // In case width or height are too small.\n\n\nfunction getLineWidth(itemModel, rawLayout) {\n // Has no border.\n var borderColor = itemModel.get(['itemStyle', 'borderColor']);\n\n if (!borderColor || borderColor === 'none') {\n return 0;\n }\n\n var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; // width or height may be NaN for empty data\n\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\n return Math.min(lineWidth, width, height);\n}\n\nvar LagePathShape =\n/** @class */\nfunction () {\n function LagePathShape() {}\n\n return LagePathShape;\n}();\n\nvar LargePath =\n/** @class */\nfunction (_super) {\n __extends(LargePath, _super);\n\n function LargePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeBar';\n return _this;\n }\n\n LargePath.prototype.getDefaultShape = function () {\n return new LagePathShape();\n };\n\n LargePath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n var baseDimIdx = this.baseDimIdx;\n var valueDimIdx = 1 - this.baseDimIdx;\n var startPoint = [];\n var size = [];\n var barWidth = this.barWidth;\n\n for (var i = 0; i < points.length; i += 3) {\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[i + 2];\n startPoint[baseDimIdx] = points[i + baseDimIdx];\n startPoint[valueDimIdx] = points[i + valueDimIdx];\n ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);\n }\n };\n\n return LargePath;\n}(Path);\n\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n // TODO support polar\n var data = seriesModel.getData();\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n var largeDataIndices = data.getLayout('largeDataIndices');\n var barWidth = data.getLayout('size');\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var bgPoints = data.getLayout('largeBackgroundPoints');\n\n if (bgPoints) {\n var bgEl = new LargePath({\n shape: {\n points: bgPoints\n },\n incremental: !!incremental,\n silent: true,\n z2: 0\n });\n bgEl.baseDimIdx = baseDimIdx;\n bgEl.largeDataIndices = largeDataIndices;\n bgEl.barWidth = barWidth;\n bgEl.useStyle(backgroundModel.getItemStyle());\n group.add(bgEl);\n progressiveEls && progressiveEls.push(bgEl);\n }\n\n var el = new LargePath({\n shape: {\n points: data.getLayout('largePoints')\n },\n incremental: !!incremental,\n ignoreCoarsePointer: true,\n z2: 1\n });\n el.baseDimIdx = baseDimIdx;\n el.largeDataIndices = largeDataIndices;\n el.barWidth = barWidth;\n group.add(el);\n el.useStyle(data.getVisual('style')); // Enable tooltip and user mouse/touch event handlers.\n\n getECData(el).seriesIndex = seriesModel.seriesIndex;\n\n if (!seriesModel.get('silent')) {\n el.on('mousedown', largePathUpdateDataIndex);\n el.on('mousemove', largePathUpdateDataIndex);\n }\n\n progressiveEls && progressiveEls.push(el);\n} // Use throttle to avoid frequently traverse to find dataIndex.\n\n\nvar largePathUpdateDataIndex = throttle(function (event) {\n var largePath = this;\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\n}, 30, false);\n\nfunction largePathFindDataIndex(largePath, x, y) {\n var baseDimIdx = largePath.baseDimIdx;\n var valueDimIdx = 1 - baseDimIdx;\n var points = largePath.shape.points;\n var largeDataIndices = largePath.largeDataIndices;\n var startPoint = [];\n var size = [];\n var barWidth = largePath.barWidth;\n\n for (var i = 0, len = points.length / 3; i < len; i++) {\n var ii = i * 3;\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[ii + 2];\n startPoint[baseDimIdx] = points[ii + baseDimIdx];\n startPoint[valueDimIdx] = points[ii + valueDimIdx];\n\n if (size[valueDimIdx] < 0) {\n startPoint[valueDimIdx] += size[valueDimIdx];\n size[valueDimIdx] = -size[valueDimIdx];\n }\n\n if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) {\n return largeDataIndices[i];\n }\n }\n\n return -1;\n}\n\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var rectShape = layout;\n var coordLayout = coord.getArea();\n return {\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\n };\n } else {\n var coordLayout = coord.getArea();\n var sectorShape = layout;\n return {\n cx: coordLayout.cx,\n cy: coordLayout.cy,\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\n };\n }\n}\n\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\n return new ElementClz({\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\n silent: true,\n z2: 0\n });\n}\n\nexport default BarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { layout, createProgressiveLayout } from '../../layout/barGrid.js';\nimport dataSample from '../../processor/dataSample.js';\nimport BarSeries from './BarSeries.js';\nimport BarView from './BarView.js';\nexport function install(registers) {\n registers.registerChartView(BarView);\n registers.registerSeriesModel(BarSeries);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar')); // Do layout after other overall layout, which can prepare some information.\n\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar')); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\n\n registers.registerAction({\n type: 'changeAxisOrder',\n event: 'changeAxisOrder',\n update: 'update'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n if (payload.sortInfo) {\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\n }\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport function getBasicPieLayout(seriesModel, api) {\n var viewRect = getViewRect(seriesModel, api); // center can be string or number when coordinateSystem is specified\n\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n var width = parsePercent(viewRect.width, api.getWidth());\n var height = parsePercent(viewRect.height, api.getHeight());\n var size = Math.min(width, height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var cx;\n var cy;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n // percentage is not allowed when coordinate system is specified\n var point = coordSys.dataToPoint(center);\n cx = point[0] || 0;\n cy = point[1] || 0;\n } else {\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n cx = parsePercent(center[0], width) + viewRect.x;\n cy = parsePercent(center[1], height) + viewRect.y;\n }\n\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r\n };\n}\nexport default function pieLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var viewRect = getViewRect(seriesModel, api);\n\n var _a = getBasicPieLayout(seriesModel, api),\n cx = _a.cx,\n cy = _a.cy,\n r = _a.r,\n r0 = _a.r0;\n\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var validDataCount = 0;\n data.each(valueDim, function (value) {\n !isNaN(value) && validDataCount++;\n });\n var sum = data.getSum(valueDim); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var clockwise = seriesModel.get('clockwise');\n var roseType = seriesModel.get('roseType');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max]\n\n var extent = data.getDataExtent(valueDim);\n extent[0] = 0; // In the case some sector angle is smaller than minAngle\n\n var restAngle = PI2;\n var valueSumLargerThanMinAngle = 0;\n var currentAngle = startAngle;\n var dir = clockwise ? 1 : -1;\n data.setLayout({\n viewRect: viewRect,\n r: r\n });\n data.each(valueDim, function (value, idx) {\n var angle;\n\n if (isNaN(value)) {\n data.setItemLayout(idx, {\n angle: NaN,\n startAngle: NaN,\n endAngle: NaN,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? NaN : r\n });\n return;\n } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\n\n\n if (roseType !== 'area') {\n angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n } else {\n angle = PI2 / validDataCount;\n }\n\n if (angle < minAngle) {\n angle = minAngle;\n restAngle -= minAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n\n var endAngle = currentAngle + dir * angle;\n data.setItemLayout(idx, {\n angle: angle,\n startAngle: currentAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? linearMap(value, extent, [r0, r]) : r\n });\n currentAngle = endAngle;\n }); // Some sector is constrained by minAngle\n // Rest sectors needs recalculate angle\n\n if (restAngle < PI2 && validDataCount) {\n // Average the angle if rest angle is not enough after all angles is\n // Constrained by minAngle\n if (restAngle <= 1e-3) {\n var angle_1 = PI2 / validDataCount;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_1 = data.getItemLayout(idx);\n layout_1.angle = angle_1;\n layout_1.startAngle = startAngle + dir * idx * angle_1;\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\n }\n });\n } else {\n unitRadian = restAngle / valueSumLargerThanMinAngle;\n currentAngle = startAngle;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_2 = data.getItemLayout(idx);\n var angle = layout_2.angle === minAngle ? minAngle : value * unitRadian;\n layout_2.startAngle = currentAngle;\n layout_2.endAngle = currentAngle + dir * angle;\n currentAngle += dir * angle;\n }\n });\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function dataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n // @ts-ignore FIXME: LegendModel\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// FIXME emphasis label position is not same with normal label position\nimport { parsePercent } from '../../util/number.js';\nimport { Point } from '../../util/graphic.js';\nimport { each, isNumber } from 'zrender/lib/core/util.js';\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper.js';\nimport { shiftLayoutOnY } from '../../label/labelLayoutHelper.js';\nvar RADIAN = Math.PI / 180;\n\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\n if (list.length < 2) {\n return;\n }\n\n ;\n\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\n var rB = semi.rB;\n var rB2 = rB * rB;\n\n for (var i = 0; i < semi.list.length; i++) {\n var item = semi.list[i];\n var dy = Math.abs(item.label.y - cy); // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len;\n var rA2 = rA * rA; // Use ellipse implicit function to calculate x\n\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\n var newX = cx + (dx + item.len2) * dir;\n var deltaX = newX - item.label.x;\n var newTargetWidth = item.targetTextWidth - deltaX * dir; // text x is changed, so need to recalculate width.\n\n constrainTextWidth(item, newTargetWidth, true);\n item.label.x = newX;\n }\n } // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\n\n\n function recalculateX(items) {\n // Extremes of\n var topSemi = {\n list: [],\n maxY: 0\n };\n var bottomSemi = {\n list: [],\n maxY: 0\n };\n\n for (var i = 0; i < items.length; i++) {\n if (items[i].labelAlignTo !== 'none') {\n continue;\n }\n\n var item = items[i];\n var semi = item.label.y > cy ? bottomSemi : topSemi;\n var dy = Math.abs(item.label.y - cy);\n\n if (dy >= semi.maxY) {\n var dx = item.label.x - cx - item.len2 * dir; // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len; // Canculate rB based on the topest / bottemest label.\n\n var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA;\n semi.rB = rB;\n semi.maxY = dy;\n }\n\n semi.list.push(item);\n }\n\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\n }\n\n var len = list.length;\n\n for (var i = 0; i < len; i++) {\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\n var dx = list[i].label.x - farthestX;\n list[i].linePoints[1][0] += dx;\n list[i].label.x = farthestX;\n }\n }\n\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\n recalculateX(list);\n }\n}\n\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\n var leftList = [];\n var rightList = [];\n var leftmostX = Number.MAX_VALUE;\n var rightmostX = -Number.MAX_VALUE;\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var label = labelLayoutList[i].label;\n\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n\n if (label.x < cx) {\n leftmostX = Math.min(leftmostX, label.x);\n leftList.push(labelLayoutList[i]);\n } else {\n rightmostX = Math.max(rightmostX, label.x);\n rightList.push(labelLayoutList[i]);\n }\n }\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n\n if (!isPositionCenter(layout) && layout.linePoints) {\n if (layout.labelStyleWidth != null) {\n continue;\n }\n\n var label = layout.label;\n var linePoints = layout.linePoints;\n var targetTextWidth = void 0;\n\n if (layout.labelAlignTo === 'edge') {\n if (label.x < cx) {\n targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance;\n } else {\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance;\n }\n } else if (layout.labelAlignTo === 'labelLine') {\n if (label.x < cx) {\n targetTextWidth = leftmostX - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin;\n }\n } else {\n if (label.x < cx) {\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\n }\n }\n\n layout.targetTextWidth = targetTextWidth;\n constrainTextWidth(layout, targetTextWidth);\n }\n }\n\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n\n if (!isPositionCenter(layout) && layout.linePoints) {\n var label = layout.label;\n var linePoints = layout.linePoints;\n var isAlignToEdge = layout.labelAlignTo === 'edge';\n var padding = label.style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0; // textRect.width already contains paddingH if bgColor is set\n\n var extraPaddingH = label.style.backgroundColor ? 0 : paddingH;\n var realTextWidth = layout.rect.width + extraPaddingH;\n var dist = linePoints[1][0] - linePoints[2][0];\n\n if (isAlignToEdge) {\n if (label.x < cx) {\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\n } else {\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance;\n }\n } else {\n if (label.x < cx) {\n linePoints[2][0] = label.x + layout.labelDistance;\n } else {\n linePoints[2][0] = label.x - layout.labelDistance;\n }\n\n linePoints[1][0] = linePoints[2][0] + dist;\n }\n\n linePoints[1][1] = linePoints[2][1] = label.y;\n }\n }\n}\n/**\r\n * Set max width of each label, and then wrap each label to the max width.\r\n *\r\n * @param layout label layout\r\n * @param availableWidth max width for the label to display\r\n * @param forceRecalculate recaculate the text layout even if the current width\r\n * is smaller than `availableWidth`. This is useful when the text was previously\r\n * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in\r\n * which case, previous wrapping should be redo.\r\n */\n\n\nfunction constrainTextWidth(layout, availableWidth, forceRecalculate) {\n if (forceRecalculate === void 0) {\n forceRecalculate = false;\n }\n\n if (layout.labelStyleWidth != null) {\n // User-defined style.width has the highest priority.\n return;\n }\n\n var label = layout.label;\n var style = label.style;\n var textRect = layout.rect;\n var bgColor = style.backgroundColor;\n var padding = style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0;\n var overflow = style.overflow; // textRect.width already contains paddingH if bgColor is set\n\n var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);\n\n if (availableWidth < oldOuterWidth || forceRecalculate) {\n var oldHeight = textRect.height;\n\n if (overflow && overflow.match('break')) {\n // Temporarily set background to be null to calculate\n // the bounding box without background.\n label.setStyle('backgroundColor', null); // Set constraining width\n\n label.setStyle('width', availableWidth - paddingH); // This is the real bounding box of the text without padding.\n\n var innerRect = label.getBoundingRect();\n label.setStyle('width', Math.ceil(innerRect.width));\n label.setStyle('backgroundColor', bgColor);\n } else {\n var availableInnerWidth = availableWidth - paddingH;\n var newWidth = availableWidth < oldOuterWidth // Current text is too wide, use `availableWidth` as max width.\n ? availableInnerWidth : // Current available width is enough, but the text may have\n // already been wrapped with a smaller available width.\n forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth // Current available is larger than text width,\n // so don't constrain width (otherwise it may have\n // empty space in the background).\n ? null // Current available is smaller than text width, so\n // use the current available width as constraining\n // width.\n : availableInnerWidth : // Current available width is enough, so no need to\n // constrain.\n null;\n label.setStyle('width', newWidth);\n }\n\n var newRect = label.getBoundingRect();\n textRect.width = newRect.width;\n var margin = (label.style.margin || 0) + 2.1;\n textRect.height = newRect.height + margin;\n textRect.y -= (textRect.height - oldHeight) / 2;\n }\n}\n\nfunction isPositionCenter(sectorShape) {\n // Not change x for center label\n return sectorShape.position === 'center';\n}\n\nexport default function pieLabelLayout(seriesModel) {\n var data = seriesModel.getData();\n var labelLayoutList = [];\n var cx;\n var cy;\n var hasLabelRotate = false;\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\n var viewRect = data.getLayout('viewRect');\n var r = data.getLayout('r');\n var viewWidth = viewRect.width;\n var viewLeft = viewRect.x;\n var viewTop = viewRect.y;\n var viewHeight = viewRect.height;\n\n function setNotShow(el) {\n el.ignore = true;\n }\n\n function isLabelShown(label) {\n if (!label.ignore) {\n return true;\n }\n\n for (var key in label.states) {\n if (label.states[key].ignore === false) {\n return true;\n }\n }\n\n return false;\n }\n\n data.each(function (idx) {\n var sector = data.getItemGraphicEl(idx);\n var sectorShape = sector.shape;\n var label = sector.getTextContent();\n var labelLine = sector.getTextGuideLine();\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis\n\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\n var labelDistance = labelModel.get('distanceToLabelLine');\n var labelAlignTo = labelModel.get('alignTo');\n var edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\n var bleedMargin = labelModel.get('bleedMargin');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineLen = labelLineModel.get('length');\n labelLineLen = parsePercent(labelLineLen, viewWidth);\n var labelLineLen2 = labelLineModel.get('length2');\n labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\n\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\n each(label.states, setNotShow);\n label.ignore = true;\n\n if (labelLine) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n }\n\n return;\n }\n\n if (!isLabelShown(label)) {\n return;\n }\n\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\n var nx = Math.cos(midAngle);\n var ny = Math.sin(midAngle);\n var textX;\n var textY;\n var linePoints;\n var textAlign;\n cx = sectorShape.cx;\n cy = sectorShape.cy;\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n\n if (labelPosition === 'center') {\n textX = sectorShape.cx;\n textY = sectorShape.cy;\n textAlign = 'center';\n } else {\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\n textX = x1 + nx * 3;\n textY = y1 + ny * 3;\n\n if (!isLabelInside) {\n // For roseType\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\n var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;\n var y3 = y2;\n\n if (labelAlignTo === 'edge') {\n // Adjust textX because text align of edge is opposite\n textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;\n } else {\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\n }\n\n textY = y3;\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n }\n\n textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right';\n }\n\n var PI = Math.PI;\n var labelRotate = 0;\n var rotate = labelModel.get('rotate');\n\n if (isNumber(rotate)) {\n labelRotate = rotate * (PI / 180);\n } else if (labelPosition === 'center') {\n labelRotate = 0;\n } else if (rotate === 'radial' || rotate === true) {\n var radialAngle = nx < 0 ? -midAngle + PI : -midAngle;\n labelRotate = radialAngle;\n } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') {\n var rad = Math.atan2(nx, ny);\n\n if (rad < 0) {\n rad = PI * 2 + rad;\n }\n\n var isDown = ny > 0;\n\n if (isDown) {\n rad = PI + rad;\n }\n\n labelRotate = rad - PI;\n }\n\n hasLabelRotate = !!labelRotate;\n label.x = textX;\n label.y = textY;\n label.rotation = labelRotate;\n label.setStyle({\n verticalAlign: 'middle'\n }); // Not sectorShape the inside label\n\n if (!isLabelInside) {\n var textRect = label.getBoundingRect().clone();\n textRect.applyTransform(label.getComputedTransform()); // Text has a default 1px stroke. Exclude this.\n\n var margin = (label.style.margin || 0) + 2.1;\n textRect.y -= margin / 2;\n textRect.height += margin;\n labelLayoutList.push({\n label: label,\n labelLine: labelLine,\n position: labelPosition,\n len: labelLineLen,\n len2: labelLineLen2,\n minTurnAngle: labelLineModel.get('minTurnAngle'),\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\n surfaceNormal: new Point(nx, ny),\n linePoints: linePoints,\n textAlign: textAlign,\n labelDistance: labelDistance,\n labelAlignTo: labelAlignTo,\n edgeDistance: edgeDistance,\n bleedMargin: bleedMargin,\n rect: textRect,\n unconstrainedWidth: textRect.width,\n labelStyleWidth: label.style.width\n });\n } else {\n label.setStyle({\n align: textAlign\n });\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n sector.setTextConfig({\n inside: isLabelInside\n });\n });\n\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\n }\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n var label = layout.label;\n var labelLine = layout.labelLine;\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\n\n if (label) {\n label.setStyle({\n align: layout.textAlign\n });\n\n if (notShowLabel) {\n each(label.states, setNotShow);\n label.ignore = true;\n }\n\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n if (labelLine) {\n var linePoints = layout.linePoints;\n\n if (notShowLabel || !linePoints) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n } else {\n limitTurnAngle(linePoints, layout.minTurnAngle);\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\n labelLine.setShape({\n points: linePoints\n }); // Set the anchor to the midpoint of sector\n\n label.__hostTarget.textGuideLineConfig = {\n anchor: new Point(linePoints[0][0], linePoints[0][1])\n };\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { extend, retrieve3 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport labelLayout from './labelLayout.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getBasicPieLayout } from './pieLayout.js';\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\n\nvar PiePiece =\n/** @class */\nfunction (_super) {\n __extends(PiePiece, _super);\n\n function PiePiece(data, idx, startAngle) {\n var _this = _super.call(this) || this;\n\n _this.z2 = 2;\n var text = new graphic.Text();\n\n _this.setTextContent(text);\n\n _this.updateData(data, idx, startAngle, true);\n\n return _this;\n }\n\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n var sector = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = data.getItemLayout(idx); // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.\n // see `setItemLayout` in `pieLayout.ts`.\n\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data.\n\n if (isNaN(sectorShape.startAngle)) {\n // Use NaN shape to avoid drawing shape.\n sector.setShape(sectorShape);\n return;\n }\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n var animationType = seriesModel.getShallow('animationType');\n\n if (seriesModel.ecModel.ssr) {\n // Use scale animation in SSR mode(opacity?)\n // Because CSS SVG animation doesn't support very customized shape animation.\n graphic.initProps(sector, {\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: idx,\n isFrom: true\n });\n sector.originX = sectorShape.cx;\n sector.originY = sectorShape.cy;\n } else if (animationType === 'scale') {\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, idx);\n } // Expansion\n else {\n if (startAngle != null) {\n sector.setShape({\n startAngle: startAngle,\n endAngle: startAngle\n });\n graphic.initProps(sector, {\n shape: {\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n } else {\n sector.shape.endAngle = layout.startAngle;\n graphic.updateProps(sector, {\n shape: {\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n }\n }\n } else {\n saveOldStyle(sector); // Transition animation from the old shape\n\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel, idx);\n }\n\n sector.useStyle(data.getItemVisual(idx, 'style'));\n setStatesStylesFromModel(sector, itemModel);\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var offset = seriesModel.get('selectedOffset');\n var dx = Math.cos(midAngle) * offset;\n var dy = Math.sin(midAngle) * offset;\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n\n this._updateLabel(seriesModel, data, idx);\n\n sector.ensureState('emphasis').shape = extend({\n r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)\n }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\n extend(sector.ensureState('select'), {\n x: dx,\n y: dy,\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\n });\n extend(sector.ensureState('blur'), {\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\n });\n var labelLine = sector.getTextGuideLine();\n var labelText = sector.getTextContent();\n labelLine && extend(labelLine.ensureState('select'), {\n x: dx,\n y: dy\n }); // TODO: needs dx, dy in zrender?\n\n extend(labelText.ensureState('select'), {\n x: dx,\n y: dy\n });\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\n var sector = this;\n var itemModel = data.getItemModel(idx);\n var labelLineModel = itemModel.getModel('labelLine');\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style && style.fill;\n var visualOpacity = style && style.opacity;\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx)\n });\n var labelText = sector.getTextContent(); // Set textConfig on sector.\n\n sector.setTextConfig({\n // reset position, rotation\n position: null,\n rotation: null\n }); // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n labelText.attr({\n z2: 10\n });\n var labelPosition = seriesModel.get(['label', 'position']);\n\n if (labelPosition !== 'outside' && labelPosition !== 'outer') {\n sector.removeTextGuideLine();\n } else {\n var polyline = this.getTextGuideLine();\n\n if (!polyline) {\n polyline = new graphic.Polyline();\n this.setTextGuideLine(polyline);\n } // Default use item visual color\n\n\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\n stroke: visualColor,\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\n });\n }\n };\n\n return PiePiece;\n}(graphic.Sector); // Pie view\n\n\nvar PieView =\n/** @class */\nfunction (_super) {\n __extends(PieView, _super);\n\n function PieView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var startAngle; // First render\n\n if (!oldData && data.count() > 0) {\n var shape = data.getItemLayout(0);\n\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\n shape = data.getItemLayout(s);\n }\n\n if (shape) {\n startAngle = shape.startAngle;\n }\n } // remove empty-circle if it exists\n\n\n if (this._emptyCircleSector) {\n group.remove(this._emptyCircleSector);\n } // when all data are filtered, show lightgray empty circle\n\n\n if (data.count() === 0 && seriesModel.get('showEmptyCircle')) {\n var sector = new graphic.Sector({\n shape: getBasicPieLayout(seriesModel, api)\n });\n sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle());\n this._emptyCircleSector = sector;\n group.add(sector);\n }\n\n data.diff(oldData).add(function (idx) {\n var piePiece = new PiePiece(data, idx, startAngle);\n data.setItemGraphicEl(idx, piePiece);\n group.add(piePiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx, startAngle);\n piePiece.off('click');\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\n }).execute();\n labelLayout(seriesModel); // Always use initial animation.\n\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\n this._data = data;\n }\n };\n\n PieView.prototype.dispose = function () {};\n\n PieView.prototype.containPoint = function (point, seriesModel) {\n var data = seriesModel.getData();\n var itemLayout = data.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n PieView.type = 'pie';\n return PieView;\n}(ChartView);\n\nexport default PieView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { extend, isArray } from 'zrender/lib/core/util.js';\n/**\r\n * [Usage]:\r\n * (1)\r\n * createListSimply(seriesModel, ['value']);\r\n * (2)\r\n * createListSimply(seriesModel, {\r\n * coordDimensions: ['value'],\r\n * dimensionsCount: 5\r\n * });\r\n */\n\nexport default function createSeriesDataSimply(seriesModel, opt, nameList) {\n opt = isArray(opt) && {\n coordDimensions: opt\n } || extend({\n encodeDefine: seriesModel.getEncode()\n }, opt);\n var source = seriesModel.getSource();\n var dimensions = prepareSeriesDataSchema(source, opt).dimensions;\n var list = new SeriesData(dimensions, seriesModel);\n list.initData(source, nameList);\n return list;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * LegendVisualProvider is an bridge that pick encoded color from data and\r\n * provide to the legend component.\r\n */\nvar LegendVisualProvider =\n/** @class */\nfunction () {\n function LegendVisualProvider( // Function to get data after filtered. It stores all the encoding info\n getDataWithEncodedVisual, // Function to get raw data before filtered.\n getRawData) {\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\n this._getRawData = getRawData;\n }\n\n LegendVisualProvider.prototype.getAllNames = function () {\n var rawData = this._getRawData(); // We find the name from the raw data. In case it's filtered by the legend component.\n // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\n\n\n return rawData.mapArray(rawData.getName);\n };\n\n LegendVisualProvider.prototype.containName = function (name) {\n var rawData = this._getRawData();\n\n return rawData.indexOfName(name) >= 0;\n };\n\n LegendVisualProvider.prototype.indexOfName = function (name) {\n // Only get data when necessary.\n // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n // Invoking Series#getData immediately will throw an error.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.indexOfName(name);\n };\n\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\n // Get encoded visual properties from final filtered data.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\n };\n\n return LegendVisualProvider;\n}();\n\nexport default LegendVisualProvider;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { getPercentSeats } from '../../util/number.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nvar innerData = modelUtil.makeInner();\n\nvar PieSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PieSeriesModel, _super);\n\n function PieSeriesModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n\n this._defaultLabelLine(option);\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.mergeOption = function () {\n _super.prototype.mergeOption.apply(this, arguments);\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.getInitialData = function () {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData(); // update seats when data is changed\n\n var dataInner = innerData(data);\n var seats = dataInner.seats;\n\n if (!seats) {\n var valueList_1 = [];\n data.each(data.mapDimension('value'), function (value) {\n valueList_1.push(value);\n });\n seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get('percentPrecision'));\n }\n\n var params = _super.prototype.getDataParams.call(this, dataIndex); // seats may be empty when sum is 0\n\n\n params.percent = seats[dataIndex] || 0;\n params.$vars.push('percent');\n return params;\n };\n\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n };\n\n PieSeriesModel.type = 'series.pie';\n PieSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If the angle of a sector less than `minShowLabelAngle`,\n // the label will not be displayed.\n minShowLabelAngle: 0,\n // 选中时扇区偏移量\n selectedOffset: 10,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)\n // roseType: null,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // cursor: null,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: null,\n height: null,\n label: {\n // color: 'inherit',\n // If rotate around circle\n rotate: 0,\n show: true,\n overflow: 'truncate',\n // 'outer', 'inside', 'center'\n position: 'outer',\n // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\n alignTo: 'none',\n // Closest distance between label and chart edge.\n // Works only position is 'outer' and alignTo is 'edge'.\n edgeDistance: '25%',\n // Works only position is 'outer' and alignTo is not 'edge'.\n bleedMargin: 10,\n // Distance between text and label line.\n distanceToLabelLine: 5 // formatter: 标签文本格式器,同 tooltip.formatter,不支持异步回调\n // 默认使用全局文本样式,详见 textStyle\n // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数\n\n },\n // Enabled when label.normal.position is 'outer'\n labelLine: {\n show: true,\n // 引导线两段中的第一段长度\n length: 15,\n // 引导线两段中的第二段长度\n length2: 15,\n smooth: false,\n minTurnAngle: 90,\n maxSurfaceAngle: 90,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n borderWidth: 1,\n borderJoin: 'round'\n },\n showEmptyCircle: true,\n emptyCircleStyle: {\n color: 'lightgray',\n opacity: 1\n },\n labelLayout: {\n // Hide the overlapped label.\n hideOverlap: true\n },\n emphasis: {\n scale: true,\n scaleSize: 5\n },\n // If use strategy to avoid label overlapping\n avoidLabelOverlap: true,\n // Animation type. Valid values: expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n // Animation type when update. Valid values: transition, expansion\n animationTypeUpdate: 'transition',\n animationEasingUpdate: 'cubicInOut',\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut'\n };\n return PieSeriesModel;\n}(SeriesModel);\n\nexport default PieSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function negativeDataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n // handle negative value condition\n var valueDim = data.mapDimension('value');\n var curValue = data.get(valueDim, idx);\n\n if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) {\n return false;\n }\n\n return true;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport pieLayout from '../pie/pieLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport PieView from './PieView.js';\nimport PieSeriesModel from './PieSeries.js';\nimport negativeDataFilter from '../../processor/negativeDataFilter.js';\nexport function install(registers) {\n registers.registerChartView(PieView);\n registers.registerSeriesModel(PieSeriesModel);\n createLegacyDataSelectAction('pie', registers.registerAction);\n registers.registerLayout(curry(pieLayout, 'pie'));\n registers.registerProcessor(dataFilter('pie'));\n registers.registerProcessor(negativeDataFilter('pie'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar ScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ScatterSeriesModel, _super);\n\n function ScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n ScatterSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n // PENDING\n return this.option.large ? 5e3 : this.get('progressive');\n }\n\n return progressive;\n };\n\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n // PENDING\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n ScatterSeriesModel.prototype.getZLevelKey = function () {\n // Each progressive series has individual key.\n return this.getData().count() > this.getProgressiveThreshold() ? this.id : '';\n };\n\n ScatterSeriesModel.type = 'series.scatter';\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n ScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n symbolSize: 10,\n // symbolRotate: null, // 图形旋转控制\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // cursor: null,\n itemStyle: {\n opacity: 0.8 // color: 各异\n\n },\n emphasis: {\n scale: true\n },\n // If clip the overflow graphics\n // Works on cartesian / polar series\n clip: true,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n universalTransition: {\n divideShape: 'clone'\n } // progressive: null\n\n };\n return ScatterSeriesModel;\n}(SeriesModel);\n\nexport default ScatterSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Float32Array */\n// TODO Batch by color\n\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BOOST_SIZE_THRESHOLD = 4;\n\nvar LargeSymbolPathShape =\n/** @class */\nfunction () {\n function LargeSymbolPathShape() {}\n\n return LargeSymbolPathShape;\n}();\n\nvar LargeSymbolPath =\n/** @class */\nfunction (_super) {\n __extends(LargeSymbolPath, _super);\n\n function LargeSymbolPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n\n LargeSymbolPath.prototype.getDefaultShape = function () {\n return new LargeSymbolPathShape();\n };\n\n LargeSymbolPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\n var points = shape.points;\n var size = shape.size;\n var symbolProxy = this.symbolProxy;\n var symbolProxyShape = symbolProxy.shape;\n var ctx = path.getContext ? path.getContext() : path;\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\n var softClipShape = this.softClipShape;\n var i; // Do draw in afterBrush.\n\n if (canBoost) {\n this._ctx = ctx;\n return;\n }\n\n this._ctx = null;\n\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n }\n\n symbolProxyShape.x = x - size[0] / 2;\n symbolProxyShape.y = y - size[1] / 2;\n symbolProxyShape.width = size[0];\n symbolProxyShape.height = size[1];\n symbolProxy.buildPath(path, symbolProxyShape, true);\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeSymbolPath.prototype.afterBrush = function () {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var ctx = this._ctx;\n var softClipShape = this.softClipShape;\n var i;\n\n if (!ctx) {\n return;\n } // PENDING If style or other canvas status changed?\n\n\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n } // fillRect is faster than building a rect path and draw.\n // And it support light globalCompositeOperation.\n\n\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\n // TODO ???\n // Consider transform\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = Math.max(size[0], 4);\n var h = Math.max(size[1], 4); // Not consider transform\n // Treat each element as a rect\n // top down traverse\n\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n var i = idx * 2;\n var x0 = points[i] - w / 2;\n var y0 = points[i + 1] - h / 2;\n\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n return idx;\n }\n }\n\n return -1;\n };\n\n LargeSymbolPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n\n this.hoverDataIdx = -1;\n return false;\n };\n\n LargeSymbolPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n\n if (!rect) {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = size[0];\n var h = size[1];\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n\n rect = this._rect = new graphic.BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h);\n }\n\n return rect;\n };\n\n return LargeSymbolPath;\n}(graphic.Path);\n\nvar LargeSymbolDraw =\n/** @class */\nfunction () {\n function LargeSymbolDraw() {\n this.group = new graphic.Group();\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\n this._clear();\n\n var symbolEl = this._create();\n\n symbolEl.setShape({\n points: data.getLayout('points')\n });\n\n this._setCommon(symbolEl, data, opt);\n };\n\n LargeSymbolDraw.prototype.updateLayout = function (data) {\n var points = data.getLayout('points');\n this.group.eachChild(function (child) {\n if (child.startIndex != null) {\n var len = (child.endIndex - child.startIndex) * 2;\n var byteOffset = child.startIndex * 4 * 2;\n points = new Float32Array(points.buffer, byteOffset, len);\n }\n\n child.setShape('points', points); // Reset draw cursor.\n\n child.reset();\n });\n };\n\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._clear();\n };\n\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n var lastAdded = this._newAdded[0];\n var points = data.getLayout('points');\n var oldPoints = lastAdded && lastAdded.shape.points; // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n\n if (oldPoints && oldPoints.length < 2e4) {\n var oldLen = oldPoints.length;\n var newPoints = new Float32Array(oldLen + points.length); // Concat two array\n\n newPoints.set(oldPoints);\n newPoints.set(points, oldLen); // Update endIndex\n\n lastAdded.endIndex = taskParams.end;\n lastAdded.setShape({\n points: newPoints\n });\n } else {\n // Clear\n this._newAdded = [];\n\n var symbolEl = this._create();\n\n symbolEl.startIndex = taskParams.start;\n symbolEl.endIndex = taskParams.end;\n symbolEl.incremental = true;\n symbolEl.setShape({\n points: points\n });\n\n this._setCommon(symbolEl, data, opt);\n }\n };\n\n LargeSymbolDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n\n LargeSymbolDraw.prototype._create = function () {\n var symbolEl = new LargeSymbolPath({\n cursor: 'default'\n });\n symbolEl.ignoreCoarsePointer = true;\n this.group.add(symbolEl);\n\n this._newAdded.push(symbolEl);\n\n return symbolEl;\n };\n\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) {\n var hostModel = data.hostModel;\n opt = opt || {};\n var size = data.getVisual('symbolSize');\n symbolEl.setShape('size', size instanceof Array ? size : [size, size]);\n symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data\n\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method\n\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow.\n hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n var globalStyle = data.getVisual('style');\n var visualColor = globalStyle && globalStyle.fill;\n\n if (visualColor) {\n symbolEl.setColor(visualColor);\n }\n\n var ecData = getECData(symbolEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData.seriesIndex = hostModel.seriesIndex;\n symbolEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = symbolEl.hoverDataIdx;\n\n if (dataIndex >= 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n }\n });\n };\n\n LargeSymbolDraw.prototype.remove = function () {\n this._clear();\n };\n\n LargeSymbolDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n\n return LargeSymbolDraw;\n}();\n\nexport default LargeSymbolDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\n\nvar ScatterView =\n/** @class */\nfunction (_super) {\n __extends(ScatterView, _super);\n\n function ScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterView.type;\n return _this;\n }\n\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.updateData(data, {\n // TODO\n // If this parameter should be a shape or a bounding volume\n // shape will be more general.\n // But bounding volume like bounding rect will be much faster in the contain calculation\n clipShape: this._getClipShape(seriesModel)\n });\n this._finished = true;\n };\n\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.incrementalPrepareUpdate(data);\n this._finished = false;\n };\n\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\n clipShape: this._getClipShape(seriesModel)\n });\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared\n // PENDING\n\n this.group.dirty();\n\n if (!this._finished || data.count() > 1e4) {\n return {\n update: true\n };\n } else {\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout(data);\n }\n };\n\n ScatterView.prototype.eachRendered = function (cb) {\n this._symbolDraw && this._symbolDraw.eachRendered(cb);\n };\n\n ScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\n var symbolDraw = this._symbolDraw;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n symbolDraw && symbolDraw.remove();\n symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(symbolDraw.group);\n return symbolDraw;\n };\n\n ScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n this._symbolDraw = null;\n };\n\n ScatterView.prototype.dispose = function () {};\n\n ScatterView.type = 'scatter';\n return ScatterView;\n}(ChartView);\n\nexport default ScatterView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar GridModel =\n/** @class */\nfunction (_super) {\n __extends(GridModel, _super);\n\n function GridModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GridModel.type = 'grid';\n GridModel.dependencies = ['xAxis', 'yAxis'];\n GridModel.layoutMode = 'box';\n GridModel.defaultOption = {\n show: false,\n // zlevel: 0,\n z: 0,\n left: '10%',\n top: 60,\n right: '10%',\n bottom: 70,\n // If grid size contain label\n containLabel: false,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 1,\n borderColor: '#ccc'\n };\n return GridModel;\n}(ComponentModel);\n\nexport default GridModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar AxisModelCommonMixin =\n/** @class */\nfunction () {\n function AxisModelCommonMixin() {}\n\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n var option = this.option;\n return !option.scale;\n };\n /**\r\n * Should be implemented by each axis model if necessary.\r\n * @return coordinate system model\r\n */\n\n\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n return;\n };\n\n return AxisModelCommonMixin;\n}();\n\nexport { AxisModelCommonMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nvar CartesianAxisModel =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisModel, _super);\n\n function CartesianAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n CartesianAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n };\n\n CartesianAxisModel.type = 'cartesian2dAxis';\n return CartesianAxisModel;\n}(ComponentModel);\n\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar defaultOption = {\n show: true,\n // zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By default auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#6E7079',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#E0E6F1'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\n }\n }\n};\nvar categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n boundaryGap: [0, 0],\n axisLine: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n axisTick: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n splitNumber: 5,\n minorTick: {\n // Minor tick, not available for cateogry axis.\n show: false,\n // Split number of minor ticks. The value should be in range of (0, 100)\n splitNumber: 5,\n // Length of minor tick\n length: 3,\n // Line style\n lineStyle: {// Default to be same with axisTick\n }\n },\n minorSplitLine: {\n show: false,\n lineStyle: {\n color: '#F4F7FD',\n width: 1\n }\n }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n splitNumber: 6,\n axisLabel: {\n // To eliminate labels that are not nice\n showMinLabel: false,\n showMaxLabel: false,\n rich: {\n primary: {\n fontWeight: 'bold'\n }\n }\n },\n splitLine: {\n show: false\n }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n logBase: 10\n}, valueAxis);\nexport default {\n category: categoryAxis,\n value: valueAxis,\n time: timeAxis,\n log: logAxis\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, isObject, map, isString } from 'zrender/lib/core/util.js';\nvar uidBase = 0;\n\nvar OrdinalMeta =\n/** @class */\nfunction () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n this.uid = ++uidBase;\n }\n\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n\n ;\n\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\r\n * @return The ordinal. If not found, return NaN.\r\n */\n\n\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (!isString(category) && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = this._getOrCreateMap(); // @ts-ignore\n\n\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category; // @ts-ignore\n\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n }; // Consider big data, do not create map until needed.\n\n\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n\n return OrdinalMeta;\n}();\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nexport default OrdinalMeta;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport var AXIS_TYPES = {\n value: 1,\n category: 1,\n time: 1,\n log: 1\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport { AXIS_TYPES } from './axisCommonTypes.js';\nimport { each, merge } from 'zrender/lib/core/util.js';\n/**\r\n * Generate sub axis model class\r\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\r\n */\n\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n each(AXIS_TYPES, function (v, axisType) {\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n __extends(AxisModel, _super);\n\n function AxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n merge(option, themeModel.get(axisType + 'Axis'));\n merge(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\r\n * Should not be called before all of 'getInitailData' finished.\r\n * Because categories are collected during initializing data.\r\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\n\nfunction getAxisType(option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as clazzUtil from '../util/clazz.js';\n\nvar Scale =\n/** @class */\nfunction () {\n function Scale(setting) {\n this._setting = setting || {};\n this._extent = [Infinity, -Infinity];\n }\n\n Scale.prototype.getSetting = function (name) {\n return this._setting[name];\n };\n /**\r\n * Set extent from data\r\n */\n\n\n Scale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power\n // this.setExtent(extent[0], extent[1]);\n };\n /**\r\n * Set extent from data\r\n */\n\n\n Scale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * Get extent\r\n *\r\n * Extent is always in increase order.\r\n */\n\n\n Scale.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\r\n * Set extent\r\n */\n\n\n Scale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n\n if (!isNaN(start)) {\n thisExtent[0] = start;\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = end;\n }\n };\n /**\r\n * If value is in extent range\r\n */\n\n\n Scale.prototype.isInExtentRange = function (value) {\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\n\n\n Scale.prototype.isBlank = function () {\n return this._isBlank;\n };\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\n\n\n Scale.prototype.setBlank = function (isBlank) {\n this._isBlank = isBlank;\n };\n\n return Scale;\n}();\n\nclazzUtil.enableClassManagement(Scale);\nexport default Scale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getPrecision, round, nice, quantityExponent } from '../util/number.js';\nexport function isValueNice(val) {\n var exp10 = Math.pow(10, quantityExponent(Math.abs(val)));\n var f = Math.abs(val / exp10);\n return f === 0 || f === 1 || f === 2 || f === 3 || f === 5;\n}\nexport function isIntervalOrLogScale(scale) {\n return scale.type === 'interval' || scale.type === 'log';\n}\n/**\r\n * @param extent Both extent[0] and extent[1] should be valid number.\r\n * Should be extent[0] < extent[1].\r\n * @param splitNumber splitNumber should be >= 1.\r\n */\n\nexport function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\nexport function increaseInterval(interval) {\n var exp10 = Math.pow(10, quantityExponent(interval)); // Increase interval\n\n var f = interval / exp10;\n\n if (!f) {\n f = 1;\n } else if (f === 2) {\n f = 3;\n } else if (f === 3) {\n f = 5;\n } else {\n // f is 1 or 5\n f *= 2;\n }\n\n return round(f * exp10);\n}\n/**\r\n * @return interval precision\r\n */\n\nexport function getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return getPrecision(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nexport function fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\nexport function contain(val, extent) {\n return val >= extent[0] && val <= extent[1];\n}\nexport function normalize(val, extent) {\n if (extent[1] === extent[0]) {\n return 0.5;\n }\n\n return (val - extent[0]) / (extent[1] - extent[0]);\n}\nexport function scale(val, extent) {\n return val * (extent[1] - extent[0]) + extent[0];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Linear continuous scale\r\n * http://en.wikipedia.org/wiki/Level_of_measurement\r\n */\n// FIXME only one data\n\nimport Scale from './Scale.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport * as scaleHelper from './helper.js';\nimport { isArray, map, isObject, isString } from 'zrender/lib/core/util.js';\n\nvar OrdinalScale =\n/** @class */\nfunction (_super) {\n __extends(OrdinalScale, _super);\n\n function OrdinalScale(setting) {\n var _this = _super.call(this, setting) || this;\n\n _this.type = 'ordinal';\n\n var ordinalMeta = _this.getSetting('ordinalMeta'); // Caution: Should not use instanceof, consider ec-extensions using\n // import approach to get OrdinalMeta class.\n\n\n if (!ordinalMeta) {\n ordinalMeta = new OrdinalMeta({});\n }\n\n if (isArray(ordinalMeta)) {\n ordinalMeta = new OrdinalMeta({\n categories: map(ordinalMeta, function (item) {\n return isObject(item) ? item.value : item;\n })\n });\n }\n\n _this._ordinalMeta = ordinalMeta;\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\n return _this;\n }\n\n OrdinalScale.prototype.parse = function (val) {\n // Caution: Math.round(null) will return `0` rather than `NaN`\n if (val == null) {\n return NaN;\n }\n\n return isString(val) ? this._ordinalMeta.getOrdinal(val) // val might be float.\n : Math.round(val);\n };\n\n OrdinalScale.prototype.contain = function (rank) {\n rank = this.parse(rank);\n return scaleHelper.contain(rank, this._extent) && this._ordinalMeta.categories[rank] != null;\n };\n /**\r\n * Normalize given rank or name to linear [0, 1]\r\n * @param val raw ordinal number.\r\n * @return normalized value in [0, 1].\r\n */\n\n\n OrdinalScale.prototype.normalize = function (val) {\n val = this._getTickNumber(this.parse(val));\n return scaleHelper.normalize(val, this._extent);\n };\n /**\r\n * @param val normalized value in [0, 1].\r\n * @return raw ordinal number.\r\n */\n\n\n OrdinalScale.prototype.scale = function (val) {\n val = Math.round(scaleHelper.scale(val, this._extent));\n return this.getRawOrdinalNumber(val);\n };\n\n OrdinalScale.prototype.getTicks = function () {\n var ticks = [];\n var extent = this._extent;\n var rank = extent[0];\n\n while (rank <= extent[1]) {\n ticks.push({\n value: rank\n });\n rank++;\n }\n\n return ticks;\n };\n\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\n // Not support.\n return;\n };\n /**\r\n * @see `Ordinal['_ordinalNumbersByTick']`\r\n */\n\n\n OrdinalScale.prototype.setSortInfo = function (info) {\n if (info == null) {\n this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\n return;\n }\n\n var infoOrdinalNumbers = info.ordinalNumbers;\n var ordinalsByTick = this._ordinalNumbersByTick = [];\n var ticksByOrdinal = this._ticksByOrdinalNumber = []; // Unnecessary support negative tick in `realtimeSort`.\n\n var tickNum = 0;\n var allCategoryLen = this._ordinalMeta.categories.length;\n\n for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\n var ordinalNumber = infoOrdinalNumbers[tickNum];\n ordinalsByTick[tickNum] = ordinalNumber;\n ticksByOrdinal[ordinalNumber] = tickNum;\n } // Handle that `series.data` only covers part of the `axis.category.data`.\n\n\n var unusedOrdinal = 0;\n\n for (; tickNum < allCategoryLen; ++tickNum) {\n while (ticksByOrdinal[unusedOrdinal] != null) {\n unusedOrdinal++;\n }\n\n ;\n ordinalsByTick.push(unusedOrdinal);\n ticksByOrdinal[unusedOrdinal] = tickNum;\n }\n };\n\n OrdinalScale.prototype._getTickNumber = function (ordinal) {\n var ticksByOrdinalNumber = this._ticksByOrdinalNumber; // also support ordinal out of range of `ordinalMeta.categories.length`,\n // where ordinal numbers are used as tick value directly.\n\n return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;\n };\n /**\r\n * @usage\r\n * ```js\r\n * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\r\n *\r\n * // case0\r\n * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\r\n * // case1\r\n * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\r\n * // case2\r\n * const coord = axis.dataToCoord(ordinalNumber);\r\n * ```\r\n *\r\n * @param {OrdinalNumber} tickNumber index of display\r\n */\n\n\n OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) {\n var ordinalNumbersByTick = this._ordinalNumbersByTick; // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\n // where ordinal numbers are used as tick value directly.\n\n return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;\n };\n /**\r\n * Get item on tick\r\n */\n\n\n OrdinalScale.prototype.getLabel = function (tick) {\n if (!this.isBlank()) {\n var ordinalNumber = this.getRawOrdinalNumber(tick.value);\n var cateogry = this._ordinalMeta.categories[ordinalNumber]; // Note that if no data, ordinalMeta.categories is an empty array.\n // Return empty if it's not exist.\n\n return cateogry == null ? '' : cateogry + '';\n }\n };\n\n OrdinalScale.prototype.count = function () {\n return this._extent[1] - this._extent[0] + 1;\n };\n\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * @override\r\n * If value is in extent range\r\n */\n\n\n OrdinalScale.prototype.isInExtentRange = function (value) {\n value = this._getTickNumber(value);\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n\n OrdinalScale.prototype.getOrdinalMeta = function () {\n return this._ordinalMeta;\n };\n\n OrdinalScale.prototype.calcNiceTicks = function () {};\n\n OrdinalScale.prototype.calcNiceExtent = function () {};\n\n OrdinalScale.type = 'ordinal';\n return OrdinalScale;\n}(Scale);\n\nScale.registerClass(OrdinalScale);\nexport default OrdinalScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nvar roundNumber = numberUtil.round;\n\nvar IntervalScale =\n/** @class */\nfunction (_super) {\n __extends(IntervalScale, _super);\n\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'interval'; // Step is calculated in adjustExtent.\n\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent; // start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n this.setExtent(extent[0], extent[1]);\n };\n\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user-set extent.\n // We assume user wants to set both interval, min, max to get a better result.\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\r\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\r\n */\n\n\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n }); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n\n return ticks;\n };\n\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n };\n /**\r\n * @param opt.precision If 'auto', use nice presision.\r\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\r\n */\n\n\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecision(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\r\n * @param splitNumber By default `5`.\r\n */\n\n\n IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n\n IntervalScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n // Note that extents can be both negative. See #13154\n var expandSize = Math.abs(extent[0]); // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n\n IntervalScale.prototype.setNiceExtent = function (min, max) {\n this._niceExtent = [min, max];\n };\n\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\n\nScale.registerClass(IntervalScale);\nexport default IntervalScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design has\n// considered these common cases:\n// (1) Time that is persistent in server is in UTC, but it is needed to be displayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\n\nimport * as numberUtil from '../util/number.js';\nimport { ONE_SECOND, ONE_MINUTE, ONE_HOUR, ONE_DAY, ONE_YEAR, format, leveledFormat, getUnitValue, timeUnits, fullLeveledFormatter, getPrimaryTimeUnit, isPrimaryTimeUnit, getDefaultFormatPrecisionOfInterval, fullYearGetterName, monthSetterName, fullYearSetterName, dateSetterName, hoursGetterName, hoursSetterName, minutesSetterName, secondsSetterName, millisecondsSetterName, monthGetterName, dateGetterName, minutesGetterName, secondsGetterName, millisecondsGetterName } from '../util/time.js';\nimport * as scaleHelper from './helper.js';\nimport IntervalScale from './Interval.js';\nimport Scale from './Scale.js';\nimport { warn } from '../util/log.js';\nimport { filter, isNumber, map } from 'zrender/lib/core/util.js'; // FIXME 公用?\n\nvar bisect = function (a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n\n if (a[mid][1] < x) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n return lo;\n};\n\nvar TimeScale =\n/** @class */\nfunction (_super) {\n __extends(TimeScale, _super);\n\n function TimeScale(settings) {\n var _this = _super.call(this, settings) || this;\n\n _this.type = 'time';\n return _this;\n }\n /**\r\n * Get label is mainly for other components like dataZoom, tooltip.\r\n */\n\n\n TimeScale.prototype.getLabel = function (tick) {\n var useUTC = this.getSetting('useUTC');\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\n };\n\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\n var isUTC = this.getSetting('useUTC');\n var lang = this.getSetting('locale');\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\n };\n /**\r\n * @override\r\n */\n\n\n TimeScale.prototype.getTicks = function () {\n var interval = this._interval;\n var extent = this._extent;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n }\n\n ticks.push({\n value: extent[0],\n level: 0\n });\n var useUTC = this.getSetting('useUTC');\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\n ticks = ticks.concat(innerTicks);\n ticks.push({\n value: extent[1],\n level: 0\n });\n return ticks;\n };\n\n TimeScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n // Expand extent\n extent[0] -= ONE_DAY;\n extent[1] += ONE_DAY;\n } // If there are no data and extent are [Infinity, -Infinity]\n\n\n if (extent[1] === -Infinity && extent[0] === Infinity) {\n var d = new Date();\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n extent[0] = extent[1] - ONE_DAY;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n };\n\n TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n this._approxInterval = span / approxTickNum;\n\n if (minInterval != null && this._approxInterval < minInterval) {\n this._approxInterval = minInterval;\n }\n\n if (maxInterval != null && this._approxInterval > maxInterval) {\n this._approxInterval = maxInterval;\n }\n\n var scaleIntervalsLen = scaleIntervals.length;\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); // Interval that can be used to calculate ticks\n\n this._interval = scaleIntervals[idx][1]; // Min level used when picking ticks from top down.\n // We check one more level to avoid the ticks are to sparse in some case.\n\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\n };\n\n TimeScale.prototype.parse = function (val) {\n // val might be float.\n return isNumber(val) ? val : +numberUtil.parseDate(val);\n };\n\n TimeScale.prototype.contain = function (val) {\n return scaleHelper.contain(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.normalize = function (val) {\n return scaleHelper.normalize(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.scale = function (val) {\n return scaleHelper.scale(val, this._extent);\n };\n\n TimeScale.type = 'time';\n return TimeScale;\n}(IntervalScale);\n/**\r\n * This implementation was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\n\nvar scaleIntervals = [// Format interval\n['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y\n];\n\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\n var dateA = numberUtil.parseDate(valueA);\n var dateB = numberUtil.parseDate(valueB);\n\n var isSame = function (unit) {\n return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC);\n };\n\n var isSameYear = function () {\n return isSame('year');\n }; // const isSameHalfYear = () => isSameYear() && isSame('half-year');\n // const isSameQuater = () => isSameYear() && isSame('quarter');\n\n\n var isSameMonth = function () {\n return isSameYear() && isSame('month');\n };\n\n var isSameDay = function () {\n return isSameMonth() && isSame('day');\n }; // const isSameHalfDay = () => isSameDay() && isSame('half-day');\n\n\n var isSameHour = function () {\n return isSameDay() && isSame('hour');\n };\n\n var isSameMinute = function () {\n return isSameHour() && isSame('minute');\n };\n\n var isSameSecond = function () {\n return isSameMinute() && isSame('second');\n };\n\n var isSameMilliSecond = function () {\n return isSameSecond() && isSame('millisecond');\n };\n\n switch (unit) {\n case 'year':\n return isSameYear();\n\n case 'month':\n return isSameMonth();\n\n case 'day':\n return isSameDay();\n\n case 'hour':\n return isSameHour();\n\n case 'minute':\n return isSameMinute();\n\n case 'second':\n return isSameSecond();\n\n case 'millisecond':\n return isSameMilliSecond();\n }\n} // const primaryUnitGetters = {\n// year: fullYearGetterName(),\n// month: monthGetterName(),\n// day: dateGetterName(),\n// hour: hoursGetterName(),\n// minute: minutesGetterName(),\n// second: secondsGetterName(),\n// millisecond: millisecondsGetterName()\n// };\n// const primaryUnitUTCGetters = {\n// year: fullYearGetterName(true),\n// month: monthGetterName(true),\n// day: dateGetterName(true),\n// hour: hoursGetterName(true),\n// minute: minutesGetterName(true),\n// second: secondsGetterName(true),\n// millisecond: millisecondsGetterName(true)\n// };\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\n// step = step || 1;\n// switch (getPrimaryTimeUnit(unitName)) {\n// case 'year':\n// date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\n// break;\n// case 'month':\n// date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\n// break;\n// case 'day':\n// date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\n// break;\n// case 'hour':\n// date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\n// break;\n// case 'minute':\n// date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\n// break;\n// case 'second':\n// date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\n// break;\n// case 'millisecond':\n// date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\n// break;\n// }\n// return date.getTime();\n// }\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\n\n\nfunction getDateInterval(approxInterval, daysInMonth) {\n approxInterval /= ONE_DAY;\n return approxInterval > 16 ? 16 // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick between two months.\n : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\n : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;\n}\n\nfunction getMonthInterval(approxInterval) {\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\n approxInterval /= APPROX_ONE_MONTH;\n return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getHourInterval(approxInterval) {\n approxInterval /= ONE_HOUR;\n return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\n return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMillisecondsInterval(approxInterval) {\n return numberUtil.nice(approxInterval, true);\n}\n\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\n var outDate = new Date(date);\n\n switch (getPrimaryTimeUnit(unitName)) {\n case 'year':\n case 'month':\n outDate[monthSetterName(isUTC)](0);\n\n case 'day':\n outDate[dateSetterName(isUTC)](1);\n\n case 'hour':\n outDate[hoursSetterName(isUTC)](0);\n\n case 'minute':\n outDate[minutesSetterName(isUTC)](0);\n\n case 'second':\n outDate[secondsSetterName(isUTC)](0);\n outDate[millisecondsSetterName(isUTC)](0);\n }\n\n return outDate.getTime();\n}\n\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\n var safeLimit = 10000;\n var unitNames = timeUnits;\n var iter = 0;\n\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\n var date = new Date(minTimestamp);\n var dateTime = minTimestamp;\n var d = date[getMethodName](); // if (isDate) {\n // d -= 1; // Starts with 0; PENDING\n // }\n\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\n out.push({\n value: dateTime\n });\n d += interval;\n date[setMethodName](d);\n dateTime = date.getTime();\n } // This extra tick is for calcuating ticks of next level. Will not been added to the final result\n\n\n out.push({\n value: dateTime,\n notAdd: true\n });\n }\n\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\n var newAddedTicks = [];\n var isFirstLevel = !lastLevelTicks.length;\n\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\n return;\n }\n\n if (isFirstLevel) {\n lastLevelTicks = [{\n // TODO Optimize. Not include so may ticks.\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\n }, {\n value: extent[1]\n }];\n }\n\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\n var startTick = lastLevelTicks[i].value;\n var endTick = lastLevelTicks[i + 1].value;\n\n if (startTick === endTick) {\n continue;\n }\n\n var interval = void 0;\n var getterName = void 0;\n var setterName = void 0;\n var isDate = false;\n\n switch (unitName) {\n case 'year':\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\n getterName = fullYearGetterName(isUTC);\n setterName = fullYearSetterName(isUTC);\n break;\n\n case 'half-year':\n case 'quarter':\n case 'month':\n interval = getMonthInterval(approxInterval);\n getterName = monthGetterName(isUTC);\n setterName = monthSetterName(isUTC);\n break;\n\n case 'week': // PENDING If week is added. Ignore day.\n\n case 'half-week':\n case 'day':\n interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\n\n getterName = dateGetterName(isUTC);\n setterName = dateSetterName(isUTC);\n isDate = true;\n break;\n\n case 'half-day':\n case 'quarter-day':\n case 'hour':\n interval = getHourInterval(approxInterval);\n getterName = hoursGetterName(isUTC);\n setterName = hoursSetterName(isUTC);\n break;\n\n case 'minute':\n interval = getMinutesAndSecondsInterval(approxInterval, true);\n getterName = minutesGetterName(isUTC);\n setterName = minutesSetterName(isUTC);\n break;\n\n case 'second':\n interval = getMinutesAndSecondsInterval(approxInterval, false);\n getterName = secondsGetterName(isUTC);\n setterName = secondsSetterName(isUTC);\n break;\n\n case 'millisecond':\n interval = getMillisecondsInterval(approxInterval);\n getterName = millisecondsGetterName(isUTC);\n setterName = millisecondsSetterName(isUTC);\n break;\n }\n\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\n\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\n // Add nearest years to the left extent.\n levelTicks.unshift({\n value: levelTicks[0].value - interval\n });\n }\n }\n\n for (var i = 0; i < newAddedTicks.length; i++) {\n levelTicks.push(newAddedTicks[i]);\n } // newAddedTicks.length && console.log(unitName, newAddedTicks);\n\n\n return newAddedTicks;\n }\n\n var levelsTicks = [];\n var currentLevelTicks = [];\n var tickCount = 0;\n var lastLevelTickCount = 0;\n\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\n\n if (!isPrimaryTimeUnit(unitNames[i])) {\n // TODO\n continue;\n }\n\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\n\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\n if (currentLevelTicks.length) {\n lastLevelTickCount = tickCount; // Remove the duplicate so the tick count can be precisely.\n\n currentLevelTicks.sort(function (a, b) {\n return a.value - b.value;\n });\n var levelTicksRemoveDuplicated = [];\n\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\n var tickValue = currentLevelTicks[i_1].value;\n\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\n\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\n tickCount++;\n }\n }\n }\n\n var targetTickNum = (extent[1] - extent[0]) / approxInterval; // Added too much in this level and not too less in last level\n\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\n break;\n } // Only treat primary time unit as one level.\n\n\n levelsTicks.push(levelTicksRemoveDuplicated);\n\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\n break;\n }\n } // Reset if next unitName is primary\n\n\n currentLevelTicks = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (iter >= safeLimit) {\n warn('Exceed safe limit.');\n }\n }\n\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\n return filter(levelTicks, function (tick) {\n return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd;\n });\n }), function (levelTicks) {\n return levelTicks.length > 0;\n });\n var ticks = [];\n var maxLevel = levelsTicksInExtent.length - 1;\n\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\n var levelTicks = levelsTicksInExtent[i];\n\n for (var k = 0; k < levelTicks.length; ++k) {\n ticks.push({\n value: levelTicks[k].value,\n level: maxLevel - i\n });\n }\n }\n\n ticks.sort(function (a, b) {\n return a.value - b.value;\n }); // Remove duplicates\n\n var result = [];\n\n for (var i = 0; i < ticks.length; ++i) {\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\n result.push(ticks[i]);\n }\n }\n\n return result;\n}\n\nScale.registerClass(TimeScale);\nexport default TimeScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Scale from './Scale.js';\nimport * as numberUtil from '../util/number.js';\nimport * as scaleHelper from './helper.js'; // Use some method of IntervalScale\n\nimport IntervalScale from './Interval.js';\nvar scaleProto = Scale.prototype; // FIXME:TS refactor: not good to call it directly with `this`?\n\nvar intervalScaleProto = IntervalScale.prototype;\nvar roundingErrorFix = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\n\nvar LogScale =\n/** @class */\nfunction (_super) {\n __extends(LogScale, _super);\n\n function LogScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'log';\n _this.base = 10;\n _this._originalScale = new IntervalScale(); // FIXME:TS actually used by `IntervalScale`\n\n _this._interval = 0;\n return _this;\n }\n /**\r\n * @param Whether expand the ticks to niced extent.\r\n */\n\n\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\n var originalScale = this._originalScale;\n var extent = this._extent;\n var originalExtent = originalScale.getExtent();\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\n return zrUtil.map(ticks, function (tick) {\n var val = tick.value;\n var powVal = numberUtil.round(mathPow(this.base, val)); // Fix #4158\n\n powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;\n powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;\n return {\n value: powVal\n };\n }, this);\n };\n\n LogScale.prototype.setExtent = function (start, end) {\n var base = mathLog(this.base); // log(-Infinity) is NaN, so safe guard here\n\n start = mathLog(Math.max(0, start)) / base;\n end = mathLog(Math.max(0, end)) / base;\n intervalScaleProto.setExtent.call(this, start, end);\n };\n /**\r\n * @return {number} end\r\n */\n\n\n LogScale.prototype.getExtent = function () {\n var base = this.base;\n var extent = scaleProto.getExtent.call(this);\n extent[0] = mathPow(base, extent[0]);\n extent[1] = mathPow(base, extent[1]); // Fix #4158\n\n var originalScale = this._originalScale;\n var originalExtent = originalScale.getExtent();\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n return extent;\n };\n\n LogScale.prototype.unionExtent = function (extent) {\n this._originalScale.unionExtent(extent);\n\n var base = this.base;\n extent[0] = mathLog(extent[0]) / mathLog(base);\n extent[1] = mathLog(extent[1]) / mathLog(base);\n scaleProto.unionExtent.call(this, extent);\n };\n\n LogScale.prototype.unionExtentFromData = function (data, dim) {\n // TODO\n // filter value that <= 0\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * Update interval and extent of intervals for nice ticks\r\n * @param approxTickNum default 10 Given approx tick number\r\n */\n\n\n LogScale.prototype.calcNiceTicks = function (approxTickNum) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (span === Infinity || span <= 0) {\n return;\n }\n\n var interval = numberUtil.quantity(span);\n var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count.\n\n if (err <= 0.5) {\n interval *= 10;\n } // Interval should be integer\n\n\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n interval *= 10;\n }\n\n var niceExtent = [numberUtil.round(mathCeil(extent[0] / interval) * interval), numberUtil.round(mathFloor(extent[1] / interval) * interval)];\n this._interval = interval;\n this._niceExtent = niceExtent;\n };\n\n LogScale.prototype.calcNiceExtent = function (opt) {\n intervalScaleProto.calcNiceExtent.call(this, opt);\n this._fixMin = opt.fixMin;\n this._fixMax = opt.fixMax;\n };\n\n LogScale.prototype.parse = function (val) {\n return val;\n };\n\n LogScale.prototype.contain = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.contain(val, this._extent);\n };\n\n LogScale.prototype.normalize = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.normalize(val, this._extent);\n };\n\n LogScale.prototype.scale = function (val) {\n val = scaleHelper.scale(val, this._extent);\n return mathPow(this.base, val);\n };\n\n LogScale.type = 'log';\n return LogScale;\n}(Scale);\n\nvar proto = LogScale.prototype;\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\nproto.getLabel = intervalScaleProto.getLabel;\n\nfunction fixRoundingError(val, originalVal) {\n return roundingErrorFix(val, numberUtil.getPrecision(originalVal));\n}\n\nScale.registerClass(LogScale);\nexport default LogScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\n\nvar ScaleRawExtentInfo =\n/** @class */\nfunction () {\n function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\n originalExtent) {\n this._prepareParams(scale, model, originalExtent);\n }\n /**\r\n * Parameters depending on outside (like model, user callback)\r\n * are prepared and fixed here.\r\n */\n\n\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis.\n dataExtent) {\n if (dataExtent[1] < dataExtent[0]) {\n dataExtent = [NaN, NaN];\n }\n\n this._dataMin = dataExtent[0];\n this._dataMax = dataExtent[1];\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\n\n if (isFunction(modelMinRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMinRaw !== 'dataMin') {\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n }\n\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n\n if (isFunction(modelMaxRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMaxRaw !== 'dataMax') {\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n }\n\n if (isOrdinal) {\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n // and progressive rendering is using, here the category result might just only contain\n // the processed chunk rather than the entire result.\n this._axisDataLen = model.getCategories().length;\n } else {\n var boundaryGap = model.get('boundaryGap');\n var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n if (process.env.NODE_ENV !== 'production') {\n 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.');\n }\n\n this._boundaryGapInner = [0, 0];\n } else {\n this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n }\n }\n };\n /**\r\n * Calculate extent by prepared parameters.\r\n * This method has no external dependency and can be called duplicatedly,\r\n * getting the same result.\r\n * If parameters changed, should call this method to recalcuate.\r\n */\n\n\n ScaleRawExtentInfo.prototype.calculate = function () {\n // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n var isOrdinal = this._isOrdinal;\n var dataMin = this._dataMin;\n var dataMax = this._dataMax;\n var axisDataLen = this._axisDataLen;\n var boundaryGapInner = this._boundaryGapInner;\n var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n\n var minFixed = min != null;\n var maxFixed = max != null;\n\n if (min == null) {\n min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n }\n\n if (max == null) {\n max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero.\n\n if (this._needCrossZero) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !minFixed) {\n min = 0; // minFixed = true;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !maxFixed) {\n max = 0; // maxFixed = true;\n } // PENDING:\n // When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n // If so, here `minFixed`/`maxFixed` need to be set.\n\n }\n\n var determinedMin = this._determinedMin;\n var determinedMax = this._determinedMax;\n\n if (determinedMin != null) {\n min = determinedMin;\n minFixed = true;\n }\n\n if (determinedMax != null) {\n max = determinedMax;\n maxFixed = true;\n } // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n // `NaN` means min/max axis is blank.\n\n\n return {\n min: min,\n max: max,\n minFixed: minFixed,\n maxFixed: maxFixed,\n isBlank: isBlank\n };\n };\n\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen);\n }\n\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n };\n\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen // Earse them usually means logic flaw.\n && this[attr] == null);\n }\n\n this[attr] = val;\n };\n\n ScaleRawExtentInfo.prototype.freeze = function () {\n // @ts-ignore\n this.frozen = true;\n };\n\n return ScaleRawExtentInfo;\n}();\n\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n min: '_determinedMin',\n max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n min: '_dataMin',\n max: '_dataMax'\n};\n/**\r\n * Get scale min max and related info only depends on model settings.\r\n * This method can be called after coordinate system created.\r\n * For example, in data processing stage.\r\n *\r\n * Scale extent info probably be required multiple times during a workflow.\r\n * For example:\r\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\r\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\r\n * (3) `coordSys.update` use it to finally decide the scale extent.\r\n * But the callback of `min`/`max` should not be called multiple times.\r\n * The code below should not be implemented repeatedly either.\r\n * So we cache the result in the scale instance, which will be recreated at the beginning\r\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\r\n */\n\nexport function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../scale/Ordinal.js';\nimport IntervalScale from '../scale/Interval.js';\nimport Scale from '../scale/Scale.js';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport TimeScale from '../scale/Time.js';\nimport LogScale from '../scale/Log.js';\nimport { getStackedDimension } from '../data/helper/dataStackHelper.js';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo.js';\n/**\r\n * Get axis scale extent before niced.\r\n * Item of returned array can only be number (including Infinity and NaN).\r\n *\r\n * Caution:\r\n * Precondition of calling this method:\r\n * The scale extent has been initialized using series data extent via\r\n * `scale.setExtent` or `scale.unionExtentFromData`;\r\n */\n\nexport function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /* || scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, // Only support cartesian coord yet.\nbarWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow\n\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow\n\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n} // Precondition of calling this method:\n// The scale extent has been initialized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\n\n\nexport function niceScaleExtent(scale, inModel) {\n var model = inModel;\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale instanceof LogScale) {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n var interval = model.get('interval');\n var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time';\n scale.setExtent(extent[0], extent[1]);\n scale.calcNiceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: isIntervalOrTime ? model.get('minInterval') : null,\n maxInterval: isIntervalOrTime ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\r\n * @param axisType Default retrieve from model.type\r\n */\n\nexport function createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // case 'value'/'interval', 'log', or others.\n return new (Scale.getClass(axisType) || IntervalScale)();\n }\n }\n}\n/**\r\n * Check if the axis cross 0\r\n */\n\nexport function ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\r\n * @param axis\r\n * @return Label formatter function.\r\n * param: {number} tickValue,\r\n * param: {number} idx, the index in all ticks.\r\n * If category axis, this param is not required.\r\n * return: {string} label string.\r\n */\n\nexport function makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (axis.scale.type === 'time') {\n return function (tpl) {\n return function (tick, idx) {\n return axis.scale.getFormattedLabel(tick, idx, tpl);\n };\n }(labelFormatter);\n } else if (zrUtil.isString(labelFormatter)) {\n return function (tpl) {\n return function (tick) {\n // For category axis, get raw value; for numeric axis,\n // get formatted label like '1,333,444'.\n var label = axis.scale.getLabel(tick);\n var text = tpl.replace('{value}', label != null ? label : '');\n return text;\n };\n }(labelFormatter);\n } else if (zrUtil.isFunction(labelFormatter)) {\n return function (cb) {\n return function (tick, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tick.value - categoryTickStart;\n }\n\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\n level: tick.level\n } : null);\n };\n }(labelFormatter);\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\nexport function getAxisRawValue(axis, tick) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\r\n * @param axis\r\n * @return Be null/undefined if no labels.\r\n */\n\nexport function estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n return;\n }\n\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (scale instanceof OrdinalScale) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1; // Simple optimization for large amount of labels\n\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n\n for (var i = 0; i < tickCount; i += step) {\n var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n value: categoryScaleExtent[0] + i\n };\n var label = labelFormatter(tick, i);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n\n return rect;\n}\n\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var beforeWidth = textRect.width;\n var beforeHeight = textRect.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\r\n * @param model axisLabelModel or axisTickModel\r\n * @return {number|String} Can be null|'auto'|number|function\r\n */\n\n\nexport function getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\r\n * Set `categoryInterval` as 0 implicitly indicates that\r\n * show all labels regardless of overlap.\r\n * @param {Object} axis axisModel.axis\r\n */\n\nexport function shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\n var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n // there has been stacked result dim?\n\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n // For example, the extent of the original dimension\n // is [0.1, 0.5], the extent of the `stackResultDimension`\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\n // because there is no graphic corresponding to [0.1, 0.5].\n // See the case in `test/area-stack.html` `main1`, where area line\n // stack needs `yAxis` not start from 0.\n dataDimMap[getStackedDimension(data, dataDim)] = true;\n });\n return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n if (data) {\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n var seriesExtent = data.getApproximateExtent(dim);\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nvar Cartesian =\n/** @class */\nfunction () {\n function Cartesian(name) {\n this.type = 'cartesian';\n this._dimList = [];\n this._axes = {};\n this.name = name || '';\n }\n\n Cartesian.prototype.getAxis = function (dim) {\n return this._axes[dim];\n };\n\n Cartesian.prototype.getAxes = function () {\n return zrUtil.map(this._dimList, function (dim) {\n return this._axes[dim];\n }, this);\n };\n\n Cartesian.prototype.getAxesByScale = function (scaleType) {\n scaleType = scaleType.toLowerCase();\n return zrUtil.filter(this.getAxes(), function (axis) {\n return axis.scale.type === scaleType;\n });\n };\n\n Cartesian.prototype.addAxis = function (axis) {\n var dim = axis.dim;\n this._axes[dim] = axis;\n\n this._dimList.push(dim);\n };\n\n return Cartesian;\n}();\n\n;\nexport default Cartesian;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Cartesian from './Cartesian.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nexport var cartesian2DDimensions = ['x', 'y'];\n\nfunction canCalculateAffineTransform(scale) {\n return scale.type === 'interval' || scale.type === 'time';\n}\n\nvar Cartesian2D =\n/** @class */\nfunction (_super) {\n __extends(Cartesian2D, _super);\n\n function Cartesian2D() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'cartesian2d';\n _this.dimensions = cartesian2DDimensions;\n return _this;\n }\n /**\r\n * Calculate an affine transform matrix if two axes are time or value.\r\n * It's mainly for accelartion on the large time series data.\r\n */\n\n\n Cartesian2D.prototype.calcAffineTransform = function () {\n this._transform = this._invTransform = null;\n var xAxisScale = this.getAxis('x').scale;\n var yAxisScale = this.getAxis('y').scale;\n\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n return;\n }\n\n var xScaleExtent = xAxisScale.getExtent();\n var yScaleExtent = yAxisScale.getExtent();\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n\n if (!xScaleSpan || !yScaleSpan) {\n return;\n } // Accelerate data to point calculation on the special large time series data.\n\n\n var scaleX = (end[0] - start[0]) / xScaleSpan;\n var scaleY = (end[1] - start[1]) / yScaleSpan;\n var translateX = start[0] - xScaleExtent[0] * scaleX;\n var translateY = start[1] - yScaleExtent[0] * scaleY;\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n this._invTransform = invert([], m);\n };\n /**\r\n * Base axis will be used on stacking.\r\n */\n\n\n Cartesian2D.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n };\n\n Cartesian2D.prototype.containPoint = function (point) {\n var axisX = this.getAxis('x');\n var axisY = this.getAxis('y');\n return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n };\n\n Cartesian2D.prototype.containData = function (data) {\n return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n };\n\n Cartesian2D.prototype.containZone = function (data1, data2) {\n var zoneDiag1 = this.dataToPoint(data1);\n var zoneDiag2 = this.dataToPoint(data2);\n var area = this.getArea();\n var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);\n return area.intersect(zone);\n };\n\n Cartesian2D.prototype.dataToPoint = function (data, clamp, out) {\n out = out || [];\n var xVal = data[0];\n var yVal = data[1]; // Fast path\n\n if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n return applyTransform(out, data, this._transform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\n return out;\n };\n\n Cartesian2D.prototype.clampData = function (data, out) {\n var xScale = this.getAxis('x').scale;\n var yScale = this.getAxis('y').scale;\n var xAxisExtent = xScale.getExtent();\n var yAxisExtent = yScale.getExtent();\n var x = xScale.parse(data[0]);\n var y = yScale.parse(data[1]);\n out = out || [];\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n return out;\n };\n\n Cartesian2D.prototype.pointToData = function (point, clamp) {\n var out = [];\n\n if (this._invTransform) {\n return applyTransform(out, point, this._invTransform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\n return out;\n };\n\n Cartesian2D.prototype.getOtherAxis = function (axis) {\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n };\n /**\r\n * Get rect area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\n\n\n Cartesian2D.prototype.getArea = function () {\n var xExtent = this.getAxis('x').getGlobalExtent();\n var yExtent = this.getAxis('y').getGlobalExtent();\n var x = Math.min(xExtent[0], xExtent[1]);\n var y = Math.min(yExtent[0], yExtent[1]);\n var width = Math.max(xExtent[0], xExtent[1]) - x;\n var height = Math.max(yExtent[0], yExtent[1]) - y;\n return new BoundingRect(x, y, width, height);\n };\n\n return Cartesian2D;\n}(Cartesian);\n\n;\nexport default Cartesian2D;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../util/model.js';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper.js';\nvar inner = makeInner();\nexport function createAxisLabels(axis) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\r\n * @param {module:echats/coord/Axis} axis\r\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\r\n * @return {Object} {\r\n * ticks: Array.\r\n * tickCategoryInterval: number\r\n * }\r\n */\n\nexport function createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: zrUtil.map(axis.scale.getTicks(), function (tick) {\n return tick.value;\n })\n };\n}\n\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\n\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n\n if (result) {\n return result;\n }\n\n var labels;\n var numericLabelInterval;\n\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n } // Cache to avoid calling interval function repeatedly.\n\n\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\n\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n\n if (result) {\n return result;\n }\n\n var ticks;\n var tickCategoryInterval; // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n } // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n } // Cache to avoid calling interval function repeatedly.\n\n\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\n\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tick, idx) {\n return {\n level: tick.level,\n formattedLabel: labelFormatter(tick, idx),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: tick.value\n };\n })\n };\n}\n\nfunction getListCache(axis, prop) {\n // Because key can be a function, and cache size always is small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\n\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\n\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\n\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\r\n * Calculate interval for category axis ticks and labels.\r\n * To get precise result, at least one of `getRotate` and `isHorizontal`\r\n * should be implemented in axis.\r\n */\n\n\nexport function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hidden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}\n\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\n\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n } // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n\n\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n } // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n\n\n var tickValue = startTick;\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n\n function addItem(tickValue) {\n var tickObj = {\n value: tickValue\n };\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickObj),\n rawLabel: ordinalScale.getLabel(tickObj),\n tickValue: tickValue\n });\n }\n\n return result;\n}\n\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\n var rawLabel = ordinalScale.getLabel(tick);\n var tickValue = tick.value;\n\n if (categoryInterval(tick.value, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tick),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, map } from 'zrender/lib/core/util.js';\nimport { linearMap, getPixelPrecision, round } from '../util/number.js';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval } from './axisTickLabelBuilder.js';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\r\n * Base class of Axis.\r\n */\n\nvar Axis =\n/** @class */\nfunction () {\n function Axis(dim, scale, extent) {\n this.onBand = false;\n this.inverse = false;\n this.dim = dim;\n this.scale = scale;\n this._extent = extent || [0, 0];\n }\n /**\r\n * If axis extent contain given coord\r\n */\n\n\n Axis.prototype.contain = function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n };\n /**\r\n * If axis extent contain given data\r\n */\n\n\n Axis.prototype.containData = function (data) {\n return this.scale.contain(data);\n };\n /**\r\n * Get coord extent.\r\n */\n\n\n Axis.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\r\n * Get precision used for formatting\r\n */\n\n\n Axis.prototype.getPixelPrecision = function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n };\n /**\r\n * Set coord extent\r\n */\n\n\n Axis.prototype.setExtent = function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n };\n /**\r\n * Convert data to coord. Data is the rank if it has an ordinal scale\r\n */\n\n\n Axis.prototype.dataToCoord = function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n };\n /**\r\n * Convert coord to data. Data is the rank if it has an ordinal scale\r\n */\n\n\n Axis.prototype.coordToData = function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n };\n /**\r\n * Convert pixel point to data in axis\r\n */\n\n\n Axis.prototype.pointToData = function (point, clamp) {\n // Should be implemented in derived class if necessary.\n return;\n };\n /**\r\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\r\n * `axis.getTicksCoords` considers `onBand`, which is used by\r\n * `boundaryGap:true` of category axis and splitLine and splitArea.\r\n * @param opt.tickModel default: axis.model.getModel('axisTick')\r\n * @param opt.clamp If `true`, the first and the last\r\n * tick must be at the axis end points. Otherwise, clip ticks\r\n * that outside the axis extent.\r\n */\n\n\n Axis.prototype.getTicksCoords = function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickVal) {\n return {\n coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n tickValue: tickVal\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n };\n\n Axis.prototype.getMinorTicksCoords = function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber'); // Protection.\n\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n };\n\n Axis.prototype.getViewLabels = function () {\n return createAxisLabels(this).labels;\n };\n\n Axis.prototype.getLabelModel = function () {\n return this.model.getModel('axisLabel');\n };\n /**\r\n * Notice here we only get the default tick model. For splitLine\r\n * or splitArea, we should pass the splitLineModel or splitAreaModel\r\n * manually when calling `getTicksCoords`.\r\n * In GL, this method may be overridden to:\r\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\r\n */\n\n\n Axis.prototype.getTickModel = function () {\n return this.model.getModel('axisTick');\n };\n /**\r\n * Get width of band\r\n */\n\n\n Axis.prototype.getBandWidth = function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data.\n\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n };\n /**\r\n * Only be called in category axis.\r\n * Can be overridden, consider other axes like in 3D.\r\n * @return Auto interval for cateogry axis tick and label\r\n */\n\n\n Axis.prototype.calculateCategoryInterval = function () {\n return calculateCategoryInterval(this);\n };\n\n return Axis;\n}();\n\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n} // If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\n\n\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[1]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unnecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\n\nexport default Axis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar Axis2D =\n/** @class */\nfunction (_super) {\n __extends(Axis2D, _super);\n\n function Axis2D(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n /**\r\n * Index of axis, can be used as key\r\n * Injected outside.\r\n */\n\n\n _this.index = 0;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n\n Axis2D.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n /**\r\n * Each item cooresponds to this.getExtent(), which\r\n * means globalExtent[0] may greater than globalExtent[1],\r\n * unless `asc` is input.\r\n *\r\n * @param {boolean} [asc]\r\n * @return {Array.}\r\n */\n\n\n Axis2D.prototype.getGlobalExtent = function (asc) {\n var ret = this.getExtent();\n ret[0] = this.toGlobalCoord(ret[0]);\n ret[1] = this.toGlobalCoord(ret[1]);\n asc && ret[0] > ret[1] && ret.reverse();\n return ret;\n };\n\n Axis2D.prototype.pointToData = function (point, clamp) {\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n };\n /**\r\n * Set ordinalSortInfo\r\n * @param info new OrdinalSortInfo\r\n */\n\n\n Axis2D.prototype.setCategorySortInfo = function (info) {\n if (this.type !== 'category') {\n return false;\n }\n\n this.model.option.categorySortInfo = info;\n this.scale.setSortInfo(info);\n };\n\n return Axis2D;\n}(Axis);\n\nexport default Axis2D;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Can only be called after coordinate system creation stage.\r\n * (Can be called before coordinate system update stage).\r\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getPrecisionSafe, round } from '../util/number.js';\nimport IntervalScale from '../scale/Interval.js';\nimport { getScaleExtent } from './axisHelper.js';\nimport { warn } from '../util/log.js';\nimport { increaseInterval, isValueNice } from '../scale/helper.js';\nvar mathLog = Math.log;\nexport function alignScaleTicks(scale, axisModel, alignToScale) {\n var intervalScaleProto = IntervalScale.prototype; // NOTE: There is a precondition for log scale here:\n // In log scale we store _interval and _extent of exponent value.\n // So if we use the method of InternalScale to set/get these data.\n // It process the exponent value, which is linear and what we want here.\n\n var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);\n var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true);\n var alignToSplitNumber = alignToTicks.length - 1;\n var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);\n var scaleExtent = getScaleExtent(scale, axisModel);\n var rawExtent = scaleExtent.extent;\n var isMinFixed = scaleExtent.fixMin;\n var isMaxFixed = scaleExtent.fixMax;\n\n if (scale.type === 'log') {\n var logBase = mathLog(scale.base);\n rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];\n }\n\n scale.setExtent(rawExtent[0], rawExtent[1]);\n scale.calcNiceExtent({\n splitNumber: alignToSplitNumber,\n fixMin: isMinFixed,\n fixMax: isMaxFixed\n });\n var extent = intervalScaleProto.getExtent.call(scale); // Need to update the rawExtent.\n // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'\n\n if (isMinFixed) {\n rawExtent[0] = extent[0];\n }\n\n if (isMaxFixed) {\n rawExtent[1] = extent[1];\n }\n\n var interval = intervalScaleProto.getInterval.call(scale);\n var min = rawExtent[0];\n var max = rawExtent[1];\n\n if (isMinFixed && isMaxFixed) {\n // User set min, max, divide to get new interval\n interval = (max - min) / alignToSplitNumber;\n } else if (isMinFixed) {\n max = rawExtent[0] + interval * alignToSplitNumber; // User set min, expand extent on the other side\n\n while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {\n interval = increaseInterval(interval);\n max = rawExtent[0] + interval * alignToSplitNumber;\n }\n } else if (isMaxFixed) {\n // User set max, expand extent on the other side\n min = rawExtent[1] - interval * alignToSplitNumber;\n\n while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {\n interval = increaseInterval(interval);\n min = rawExtent[1] - interval * alignToSplitNumber;\n }\n } else {\n var nicedSplitNumber = scale.getTicks().length - 1;\n\n if (nicedSplitNumber > alignToSplitNumber) {\n interval = increaseInterval(interval);\n }\n\n var range = interval * alignToSplitNumber;\n max = Math.ceil(rawExtent[1] / interval) * interval;\n min = round(max - range); // Not change the result that crossing zero.\n\n if (min < 0 && rawExtent[0] >= 0) {\n min = 0;\n max = round(range);\n } else if (max > 0 && rawExtent[1] <= 0) {\n max = 0;\n min = -round(range);\n }\n } // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale\n\n\n var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;\n var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.\n\n intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);\n intervalScaleProto.setInterval.call(scale, interval);\n\n if (t0 || t1) {\n intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var ticks = intervalScaleProto.getTicks.call(scale);\n\n if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {\n warn( // eslint-disable-next-line\n \"The ticks may be not readable when set min: \" + axisModel.get('min') + \", max: \" + axisModel.get('max') + \" and alignTicks: true\");\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Grid is a region which contains at most 4 cartesian systems\r\n *\r\n * TODO Default cartesian\r\n */\nimport { isObject, each, indexOf, retrieve3, keys } from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, estimateLabelUnionRect, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D.js';\nimport Axis2D from './Axis2D.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\n\nvar Grid =\n/** @class */\nfunction () {\n function Grid(gridModel, ecModel, api) {\n // FIXME:TS where used (different from registered type 'cartesian2d')?\n this.type = 'grid';\n this._coordsMap = {};\n this._coordsList = [];\n this._axesMap = {};\n this._axesList = [];\n this.axisPointerEnabled = true;\n this.dimensions = cartesian2DDimensions;\n\n this._initCartesian(gridModel, ecModel, api);\n\n this.model = gridModel;\n }\n\n Grid.prototype.getRect = function () {\n return this._rect;\n };\n\n Grid.prototype.update = function (ecModel, api) {\n var axesMap = this._axesMap;\n\n this._updateScale(ecModel, this.model);\n\n function updateAxisTicks(axes) {\n var alignTo; // Axis is added in order of axisIndex.\n\n var axesIndices = keys(axes);\n var len = axesIndices.length;\n\n if (!len) {\n return;\n }\n\n var axisNeedsAlign = []; // Process once and calculate the ticks for those don't use alignTicks.\n\n for (var i = len - 1; i >= 0; i--) {\n var idx = +axesIndices[i]; // Convert to number.\n\n var axis = axes[idx];\n var model = axis.model;\n var scale = axis.scale;\n\n if ( // Only value and log axis without interval support alignTicks.\n isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) {\n axisNeedsAlign.push(axis);\n } else {\n niceScaleExtent(scale, model);\n\n if (isIntervalOrLogScale(scale)) {\n // Can only align to interval or log axis.\n alignTo = axis;\n }\n }\n }\n\n ; // All axes has set alignTicks. Pick the first one.\n // PENDING. Should we find the axis that both set interval, min, max and align to this one?\n\n if (axisNeedsAlign.length) {\n if (!alignTo) {\n alignTo = axisNeedsAlign.pop();\n niceScaleExtent(alignTo.scale, alignTo.model);\n }\n\n each(axisNeedsAlign, function (axis) {\n alignScaleTicks(axis.scale, axis.model, alignTo.scale);\n });\n }\n }\n\n updateAxisTicks(axesMap.x);\n updateAxisTicks(axesMap.y); // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n\n var onZeroRecords = {};\n each(axesMap.x, function (xAxis) {\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n });\n each(axesMap.y, function (yAxis) {\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n }); // Resize again if containLabel is enabled\n // FIXME It may cause getting wrong grid size in data processing stage\n\n this.resize(this.model, api);\n };\n /**\r\n * Resize the grid\r\n */\n\n\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\n var boxLayoutParams = gridModel.getBoxLayoutParams();\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\n var gridRect = getLayoutRect(boxLayoutParams, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._rect = gridRect;\n var axesList = this._axesList;\n adjustAxes(); // Minus label size\n\n if (isContainLabel) {\n each(axesList, function (axis) {\n if (!axis.model.get(['axisLabel', 'inside'])) {\n var labelUnionRect = estimateLabelUnionRect(axis);\n\n if (labelUnionRect) {\n var dim = axis.isHorizontal() ? 'height' : 'width';\n var margin = axis.model.get(['axisLabel', 'margin']);\n gridRect[dim] -= labelUnionRect[dim] + margin;\n\n if (axis.position === 'top') {\n gridRect.y += labelUnionRect.height + margin;\n } else if (axis.position === 'left') {\n gridRect.x += labelUnionRect.width + margin;\n }\n }\n }\n });\n adjustAxes();\n }\n\n each(this._coordsList, function (coord) {\n // Calculate affine matrix to accelerate the data to point transform.\n // If all the axes scales are time or value.\n coord.calcAffineTransform();\n });\n\n function adjustAxes() {\n each(axesList, function (axis) {\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\n });\n }\n };\n\n Grid.prototype.getAxis = function (dim, axisIndex) {\n var axesMapOnDim = this._axesMap[dim];\n\n if (axesMapOnDim != null) {\n return axesMapOnDim[axisIndex || 0];\n }\n };\n\n Grid.prototype.getAxes = function () {\n return this._axesList.slice();\n };\n\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n if (xAxisIndex != null && yAxisIndex != null) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n return this._coordsMap[key];\n }\n\n if (isObject(xAxisIndex)) {\n yAxisIndex = xAxisIndex.yAxisIndex;\n xAxisIndex = xAxisIndex.xAxisIndex;\n }\n\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n return coordList[i];\n }\n }\n };\n\n Grid.prototype.getCartesians = function () {\n return this._coordsList.slice();\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n };\n\n Grid.prototype._findConvertTarget = function (finder) {\n var seriesModel = finder.seriesModel;\n var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n var gridModel = finder.gridModel;\n var coordsList = this._coordsList;\n var cartesian;\n var axis;\n\n if (seriesModel) {\n cartesian = seriesModel.coordinateSystem;\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n } else if (xAxisModel && yAxisModel) {\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n } else if (xAxisModel) {\n axis = this.getAxis('x', xAxisModel.componentIndex);\n } else if (yAxisModel) {\n axis = this.getAxis('y', yAxisModel.componentIndex);\n } // Lowest priority.\n else if (gridModel) {\n var grid = gridModel.coordinateSystem;\n\n if (grid === this) {\n cartesian = this._coordsList[0];\n }\n }\n\n return {\n cartesian: cartesian,\n axis: axis\n };\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.containPoint = function (point) {\n var coord = this._coordsList[0];\n\n if (coord) {\n return coord.containPoint(point);\n }\n };\n /**\r\n * Initialize cartesian coordinate systems\r\n */\n\n\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n var _this = this;\n\n var grid = this;\n var axisPositionUsed = {\n left: false,\n right: false,\n top: false,\n bottom: false\n };\n var axesMap = {\n x: {},\n y: {}\n };\n var axesCount = {\n x: 0,\n y: 0\n }; // Create axis\n\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n\n if (!axesCount.x || !axesCount.y) {\n // Roll back when there no either x or y axis\n this._axesMap = {};\n this._axesList = [];\n return;\n }\n\n this._axesMap = axesMap; // Create cartesian2d\n\n each(axesMap.x, function (xAxis, xAxisIndex) {\n each(axesMap.y, function (yAxis, yAxisIndex) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n var cartesian = new Cartesian2D(key);\n cartesian.master = _this;\n cartesian.model = gridModel;\n _this._coordsMap[key] = cartesian;\n\n _this._coordsList.push(cartesian);\n\n cartesian.addAxis(xAxis);\n cartesian.addAxis(yAxis);\n });\n });\n\n function createAxisCreator(dimName) {\n return function (axisModel, idx) {\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n return;\n }\n\n var axisPosition = axisModel.get('position');\n\n if (dimName === 'x') {\n // Fix position\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n // Default bottom of X\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n }\n } else {\n // Fix position\n if (axisPosition !== 'left' && axisPosition !== 'right') {\n // Default left of Y\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\n }\n }\n\n axisPositionUsed[axisPosition] = true;\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel\n\n axisModel.axis = axis; // Inject axisModel into axis\n\n axis.model = axisModel; // Inject grid info axis\n\n axis.grid = grid; // Index of axis, can be used as key\n\n axis.index = idx;\n\n grid._axesList.push(axis);\n\n axesMap[dimName][idx] = axis;\n axesCount[dimName]++;\n };\n }\n };\n /**\r\n * Update cartesian properties from series.\r\n */\n\n\n Grid.prototype._updateScale = function (ecModel, gridModel) {\n // Reset scale\n each(this._axesList, function (axis) {\n axis.scale.setExtent(Infinity, -Infinity);\n\n if (axis.type === 'category') {\n var categorySortInfo = axis.model.get('categorySortInfo');\n axis.scale.setSortInfo(categorySortInfo);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n if (isCartesian2DSeries(seriesModel)) {\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n return;\n }\n\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n var data = seriesModel.getData();\n var xAxis = cartesian.getAxis('x');\n var yAxis = cartesian.getAxis('y');\n unionExtent(data, xAxis);\n unionExtent(data, yAxis);\n }\n }, this);\n\n function unionExtent(data, axis) {\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n axis.scale.unionExtentFromData(data, dim);\n });\n }\n };\n /**\r\n * @param dim 'x' or 'y' or 'auto' or null/undefined\r\n */\n\n\n Grid.prototype.getTooltipAxes = function (dim) {\n var baseAxes = [];\n var otherAxes = [];\n each(this.getCartesians(), function (cartesian) {\n var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n var otherAxis = cartesian.getOtherAxis(baseAxis);\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n });\n return {\n baseAxes: baseAxes,\n otherAxes: otherAxes\n };\n };\n\n Grid.create = function (ecModel, api) {\n var grids = [];\n ecModel.eachComponent('grid', function (gridModel, idx) {\n var grid = new Grid(gridModel, ecModel, api);\n grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize\n // should be performed in create stage.\n\n grid.resize(gridModel, api, true);\n gridModel.coordinateSystem = grid;\n grids.push(grid);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (!isCartesian2DSeries(seriesModel)) {\n return;\n }\n\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n var gridModel = xAxisModel.getCoordSysModel();\n\n if (process.env.NODE_ENV !== 'production') {\n if (!gridModel) {\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n }\n\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n throw new Error('xAxis and yAxis must use the same grid');\n }\n }\n\n var grid = gridModel.coordinateSystem;\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n });\n return grids;\n }; // For deciding which dimensions to use when creating list data\n\n\n Grid.dimensions = cartesian2DDimensions;\n return Grid;\n}();\n/**\r\n * Check if the axis is used in the specified grid.\r\n */\n\n\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}\n\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n axis.getAxesOnZeroOf = function () {\n // TODO: onZero of multiple axes.\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n }; // onZero can not be enabled in these two situations:\n // 1. When any other axis is a category axis.\n // 2. When no axis is cross 0 point.\n\n\n var otherAxes = axesMap[otherAxisDim];\n var otherAxisOnZeroOf;\n var axisModel = axis.model;\n var onZero = axisModel.get(['axisLine', 'onZero']);\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n\n if (!onZero) {\n return;\n } // If target axis is specified.\n\n\n if (onZeroAxisIndex != null) {\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n }\n } else {\n // Find the first available other axis.\n for (var idx in otherAxes) {\n if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis,\n // if both onZero, the two Y axes overlap.\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n otherAxisOnZeroOf = otherAxes[idx];\n break;\n }\n }\n }\n\n if (otherAxisOnZeroOf) {\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n }\n\n function getOnZeroRecordKey(axis) {\n return axis.dim + '_' + axis.index;\n }\n}\n\nfunction canOnZeroToAxis(axis) {\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\n\nfunction updateAxisTransform(axis, coordBase) {\n var axisExtent = axis.getExtent();\n var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform\n\n axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n}\n\nexport default Grid;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { retrieve, defaults, extend, each, isObject, map, isString, isNumber, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport { isRadianAroundZero, remRadian } from '../../util/number.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport * as matrixUtil from 'zrender/lib/core/matrix.js';\nimport { applyTransform as v2ApplyTransform } from 'zrender/lib/core/vector.js';\nimport { shouldShowAllLabels } from '../../coord/axisHelper.js';\nimport { prepareLayoutList, hideOverlap } from '../../label/labelLayoutHelper.js';\nvar PI = Math.PI;\n/**\r\n * A final axis is translated and rotated from a \"standard axis\".\r\n * So opt.position and opt.rotation is required.\r\n *\r\n * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],\r\n * for example: (0, 0) ------------> (0, 50)\r\n *\r\n * nameDirection or tickDirection or labelDirection is 1 means tick\r\n * or label is below the standard axis, whereas is -1 means above\r\n * the standard axis. labelOffset means offset between label and axis,\r\n * which is useful when 'onZero', where axisLabel is in the grid and\r\n * label in outside grid.\r\n *\r\n * Tips: like always,\r\n * positive rotation represents anticlockwise, and negative rotation\r\n * represents clockwise.\r\n * The direction of position coordinate is the same as the direction\r\n * of screen coordinate.\r\n *\r\n * Do not need to consider axis 'inverse', which is auto processed by\r\n * axis extent.\r\n */\n\nvar AxisBuilder =\n/** @class */\nfunction () {\n function AxisBuilder(axisModel, opt) {\n this.group = new graphic.Group();\n this.opt = opt;\n this.axisModel = axisModel; // Default value\n\n defaults(opt, {\n labelOffset: 0,\n nameDirection: 1,\n tickDirection: 1,\n labelDirection: 1,\n silent: true,\n handleAutoShown: function () {\n return true;\n }\n }); // FIXME Not use a separate text group?\n\n var transformGroup = new graphic.Group({\n x: opt.position[0],\n y: opt.position[1],\n rotation: opt.rotation\n }); // this.group.add(transformGroup);\n // this._transformGroup = transformGroup;\n\n transformGroup.updateTransform();\n this._transformGroup = transformGroup;\n }\n\n AxisBuilder.prototype.hasBuilder = function (name) {\n return !!builders[name];\n };\n\n AxisBuilder.prototype.add = function (name) {\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\n };\n\n AxisBuilder.prototype.getGroup = function () {\n return this.group;\n };\n\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\n var rotationDiff = remRadian(textRotation - axisRotation);\n var textAlign;\n var textVerticalAlign;\n\n if (isRadianAroundZero(rotationDiff)) {\n // Label is parallel with axis line.\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI)) {\n // Label is inverse parallel with axis line.\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff > 0 && rotationDiff < PI) {\n textAlign = direction > 0 ? 'right' : 'left';\n } else {\n textAlign = direction > 0 ? 'left' : 'right';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n };\n\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\n var eventData = {\n componentType: axisModel.mainType,\n componentIndex: axisModel.componentIndex\n };\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\n return eventData;\n };\n\n AxisBuilder.isLabelSilent = function (axisModel) {\n var tooltipOpt = axisModel.get('tooltip');\n return axisModel.get('silent') // Consider mouse cursor, add these restrictions.\n || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);\n };\n\n return AxisBuilder;\n}();\n\n;\nvar builders = {\n axisLine: function (opt, axisModel, group, transformGroup) {\n var shown = axisModel.get(['axisLine', 'show']);\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisLine');\n }\n\n if (!shown) {\n return;\n }\n\n var extent = axisModel.axis.getExtent();\n var matrix = transformGroup.transform;\n var pt1 = [extent[0], 0];\n var pt2 = [extent[1], 0];\n var inverse = pt1[0] > pt2[0];\n\n if (matrix) {\n v2ApplyTransform(pt1, pt1, matrix);\n v2ApplyTransform(pt2, pt2, matrix);\n }\n\n var lineStyle = extend({\n lineCap: 'round'\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\n var line = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: lineStyle,\n strokeContainThreshold: opt.strokeContainThreshold || 5,\n silent: true,\n z2: 1\n });\n graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth);\n line.anid = 'line';\n group.add(line);\n var arrows = axisModel.get(['axisLine', 'symbol']);\n\n if (arrows != null) {\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\n\n if (isString(arrows)) {\n // Use the same arrow for start and end point\n arrows = [arrows, arrows];\n }\n\n if (isString(arrowSize) || isNumber(arrowSize)) {\n // Use the same size for width and height\n arrowSize = [arrowSize, arrowSize];\n }\n\n var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize);\n var symbolWidth_1 = arrowSize[0];\n var symbolHeight_1 = arrowSize[1];\n each([{\n rotate: opt.rotation + Math.PI / 2,\n offset: arrowOffset[0],\n r: 0\n }, {\n rotate: opt.rotation - Math.PI / 2,\n offset: arrowOffset[1],\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\n }], function (point, index) {\n if (arrows[index] !== 'none' && arrows[index] != null) {\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset\n\n var r = point.r + point.offset;\n var pt = inverse ? pt2 : pt1;\n symbol.attr({\n rotation: point.rotate,\n x: pt[0] + r * Math.cos(opt.rotation),\n y: pt[1] - r * Math.sin(opt.rotation),\n silent: true,\n z2: 11\n });\n group.add(symbol);\n }\n });\n }\n },\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); // This bit fixes the label overlap issue for the time chart.\n // See https://github.com/apache/echarts/issues/14266 for more.\n\n if (axisModel.get(['axisLabel', 'hideOverlap'])) {\n var labelList = prepareLayoutList(map(labelEls, function (label) {\n return {\n label: label,\n priority: label.z2,\n defaultAttr: {\n ignore: label.ignore\n }\n };\n }));\n hideOverlap(labelList);\n }\n },\n axisName: function (opt, axisModel, group, transformGroup) {\n var name = retrieve(opt.axisName, axisModel.get('name'));\n\n if (!name) {\n return;\n }\n\n var nameLocation = axisModel.get('nameLocation');\n var nameDirection = opt.nameDirection;\n var textStyleModel = axisModel.getModel('nameTextStyle');\n var gap = axisModel.get('nameGap') || 0;\n var extent = axisModel.axis.getExtent();\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\n var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // Reuse labelOffset.\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0];\n var labelLayout;\n var nameRotation = axisModel.get('nameRotate');\n\n if (nameRotation != null) {\n nameRotation = nameRotation * PI / 180; // To radian.\n }\n\n var axisNameAvailableWidth;\n\n if (isNameLocationCenter(nameLocation)) {\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis.\n nameDirection);\n } else {\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\n\n if (axisNameAvailableWidth != null) {\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\n }\n }\n\n var textFont = textStyleModel.getFont();\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\n var ellipsis = truncateOpt.ellipsis;\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\n var textEl = new graphic.Text({\n x: pos[0],\n y: pos[1],\n rotation: labelLayout.rotation,\n silent: AxisBuilder.isLabelSilent(axisModel),\n style: createTextStyle(textStyleModel, {\n text: name,\n font: textFont,\n overflow: 'truncate',\n width: maxWidth,\n ellipsis: ellipsis,\n fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']),\n align: textStyleModel.get('align') || labelLayout.textAlign,\n verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign\n }),\n z2: 1\n });\n graphic.setTooltipConfig({\n el: textEl,\n componentModel: axisModel,\n itemName: name\n });\n textEl.__fullText = name; // Id for animation\n\n textEl.anid = 'name';\n\n if (axisModel.get('triggerEvent')) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisName';\n eventData.name = name;\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n group.add(textEl);\n textEl.decomposeTransform();\n }\n};\n\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\n var rotationDiff = remRadian(textRotate - rotation);\n var textAlign;\n var textVerticalAlign;\n var inverse = extent[0] > extent[1];\n var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse;\n\n if (isRadianAroundZero(rotationDiff - PI / 2)) {\n textVerticalAlign = onLeft ? 'bottom' : 'top';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\n textVerticalAlign = onLeft ? 'top' : 'bottom';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\n textAlign = onLeft ? 'left' : 'right';\n } else {\n textAlign = onLeft ? 'right' : 'left';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\n\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\n if (shouldShowAllLabels(axisModel.axis)) {\n return;\n } // If min or max are user set, we need to check\n // If the tick on min(max) are overlap on their neighbour tick\n // If they are overlapped, we need to hide the min(max) tick label\n\n\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); // FIXME\n // Have not consider onBand yet, where tick els is more than label els.\n\n labelEls = labelEls || [];\n tickEls = tickEls || [];\n var firstLabel = labelEls[0];\n var nextLabel = labelEls[1];\n var lastLabel = labelEls[labelEls.length - 1];\n var prevLabel = labelEls[labelEls.length - 2];\n var firstTick = tickEls[0];\n var nextTick = tickEls[1];\n var lastTick = tickEls[tickEls.length - 1];\n var prevTick = tickEls[tickEls.length - 2];\n\n if (showMinLabel === false) {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\n if (showMinLabel) {\n ignoreEl(nextLabel);\n ignoreEl(nextTick);\n } else {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n }\n }\n\n if (showMaxLabel === false) {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\n if (showMaxLabel) {\n ignoreEl(prevLabel);\n ignoreEl(prevTick);\n } else {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n }\n }\n}\n\nfunction ignoreEl(el) {\n el && (el.ignore = true);\n}\n\nfunction isTwoLabelOverlapped(current, next) {\n // current and next has the same rotation.\n var firstRect = current && current.getBoundingRect().clone();\n var nextRect = next && next.getBoundingRect().clone();\n\n if (!firstRect || !nextRect) {\n return;\n } // When checking intersect of two rotated labels, we use mRotationBack\n // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\n\n\n var mRotationBack = matrixUtil.identity([]);\n matrixUtil.rotate(mRotationBack, mRotationBack, -current.rotation);\n firstRect.applyTransform(matrixUtil.mul([], mRotationBack, current.getLocalTransform()));\n nextRect.applyTransform(matrixUtil.mul([], mRotationBack, next.getLocalTransform()));\n return firstRect.intersect(nextRect);\n}\n\nfunction isNameLocationCenter(nameLocation) {\n return nameLocation === 'middle' || nameLocation === 'center';\n}\n\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\n var tickEls = [];\n var pt1 = [];\n var pt2 = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = ticksCoords[i].coord;\n pt1[0] = tickCoord;\n pt1[1] = 0;\n pt2[0] = tickCoord;\n pt2[1] = tickEndCoord;\n\n if (tickTransform) {\n v2ApplyTransform(pt1, pt1, tickTransform);\n v2ApplyTransform(pt2, pt2, tickTransform);\n } // Tick line, Not use group transform to have better line draw\n\n\n var tickEl = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: tickLineStyle,\n z2: 2,\n autoBatch: true,\n silent: true\n });\n graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\n tickEls.push(tickEl);\n }\n\n return tickEls;\n}\n\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var tickModel = axisModel.getModel('axisTick');\n var shown = tickModel.get('show');\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisTick');\n }\n\n if (!shown || axis.scale.isBlank()) {\n return;\n }\n\n var lineStyleModel = tickModel.getModel('lineStyle');\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\n var ticksCoords = axis.getTicksCoords();\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }), 'ticks');\n\n for (var i = 0; i < ticksEls.length; i++) {\n group.add(ticksEls[i]);\n }\n\n return ticksEls;\n}\n\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\n var axis = axisModel.axis;\n var minorTickModel = axisModel.getModel('minorTick');\n\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\n return;\n }\n\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var lineStyleModel = minorTickModel.getModel('lineStyle');\n var tickEndCoord = tickDirection * minorTickModel.get('length');\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }));\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\n\n for (var k = 0; k < minorTicksEls.length; k++) {\n group.add(minorTicksEls[k]);\n }\n }\n}\n\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\n\n if (!show || axis.scale.isBlank()) {\n return;\n }\n\n var labelModel = axisModel.getModel('axisLabel');\n var labelMargin = labelModel.get('margin');\n var labels = axis.getViewLabels(); // Special label rotate.\n\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\n var labelEls = [];\n var silent = AxisBuilder.isLabelSilent(axisModel);\n var triggerEvent = axisModel.get('triggerEvent');\n each(labels, function (labelItem, index) {\n var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n var formattedLabel = labelItem.formattedLabel;\n var rawLabel = labelItem.rawLabel;\n var itemLabelModel = labelModel;\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\n }\n }\n\n var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']);\n var tickCoord = axis.dataToCoord(tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: opt.labelOffset + opt.labelDirection * labelMargin,\n rotation: labelLayout.rotation,\n silent: silent,\n z2: 10 + (labelItem.level || 0),\n style: createTextStyle(itemLabelModel, {\n text: formattedLabel,\n align: itemLabelModel.getShallow('align', true) || labelLayout.textAlign,\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign,\n fill: isFunction(textColor) ? textColor( // (1) In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n // (2) Compatible with previous version, which always use formatted label as\n // input. But in interval scale the formatted label is like '223,445', which\n // maked user replace ','. So we modify it to return original val but remain\n // it as 'string' to avoid error in replacing.\n axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor\n })\n });\n textEl.anid = 'label_' + tickValue; // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = rawLabel;\n eventData.tickIndex = index;\n\n if (axis.type === 'category') {\n eventData.dataIndex = tickValue;\n }\n\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n labelEls.push(textEl);\n group.add(textEl);\n textEl.decomposeTransform();\n });\n return labelEls;\n}\n\nexport default AxisBuilder;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Model from '../../model/Model.js';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util.js'; // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\n\nexport function collect(ecModel, api) {\n var result = {\n /**\r\n * key: makeKey(axis.model)\r\n * value: {\r\n * axis,\r\n * coordSys,\r\n * axisPointerModel,\r\n * triggerTooltip,\r\n * triggerEmphasis,\r\n * involveSeries,\r\n * snap,\r\n * seriesModels,\r\n * seriesDataCount\r\n * }\r\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\r\n * key: makeKey(coordSys.model)\r\n * value: Object: key makeKey(axis.model), value: axisInfo\r\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}\n\nfunction collectAxesInfo(result, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global.\n\n var linksOption = globalAxisPointerModel.get('link', true) || [];\n var linkGroups = []; // Collect axes info.\n\n each(api.getCoordinateSystems(), function (coordSys) {\n // Some coordinate system do not support axes, like geo.\n if (!coordSys.axisPointerEnabled) {\n return;\n }\n\n var coordSysKey = makeKey(coordSys.model);\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convenient way to show axisPointer\n // for user. So we enable setting tooltip on coordSys model.\n\n var coordSysModel = coordSys.model;\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys.\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n\n if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not\n // show but axisPointer will show as normal.\n && baseTooltipModel.get('show')) {\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n\n if (triggerAxis || cross) {\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n }\n\n if (cross) {\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n }\n } // fromTooltip: true | false | 'cross'\n // triggerTooltip: true | false | null\n\n\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var triggerEmphasis = axisPointerModel.get('triggerEmphasis');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n triggerEmphasis: triggerEmphasis,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }\n });\n}\n\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n var volatileOption = {};\n each(fields, function (field) {\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n }); // category axis do not auto snap, otherwise some tick that do not\n // has value can not be hovered. value/time/log axis default snap if\n // triggered from tooltip and trigger tooltip.\n\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatible with previous behavior, tooltip axis does not show label by default.\n // Only these properties can be overridden from tooltip to axisPointer.\n\n if (tooltipAxisPointerModel.get('type') === 'cross') {\n volatileOption.type = 'line';\n }\n\n var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default.\n\n labelOption.show == null && (labelOption.show = false);\n\n if (fromTooltip === 'cross') {\n // When 'cross', both axes show labels.\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style\n // (cross style is dashed by default)\n\n if (!triggerTooltip) {\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n crossStyle && defaults(labelOption, crossStyle.textStyle);\n }\n }\n\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\n\nfunction collectSeriesInfo(result, ecModel) {\n // Prepare data for axis trigger\n ecModel.eachSeries(function (seriesModel) {\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n var coordSys = seriesModel.coordinateSystem;\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n\n if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n return;\n }\n\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n var axis = axisInfo.axis;\n\n if (coordSys.getAxis(axis.dim) === axis) {\n axisInfo.seriesModels.push(seriesModel);\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n axisInfo.seriesDataCount += seriesModel.getData().count();\n }\n });\n });\n}\n/**\r\n * For example:\r\n * {\r\n * axisPointer: {\r\n * links: [{\r\n * xAxisIndex: [2, 4],\r\n * yAxisIndex: 'all'\r\n * }, {\r\n * xAxisId: ['a5', 'a7'],\r\n * xAxisName: 'xxx'\r\n * }]\r\n * }\r\n * }\r\n */\n\n\nfunction getLinkGroupIndex(linksOption, axis) {\n var axisModel = axis.model;\n var dim = axis.dim;\n\n for (var i = 0; i < linksOption.length; i++) {\n var linkOption = linksOption[i] || {};\n\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n return i;\n }\n }\n}\n\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\n\nexport function fixValue(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n\n if (!axisInfo) {\n return;\n }\n\n var axisPointerModel = axisInfo.axisPointerModel;\n var scale = axisInfo.axis.scale;\n var option = axisPointerModel.option;\n var status = axisPointerModel.get('status');\n var value = axisPointerModel.get('value'); // Parse init value for category and time axis.\n\n if (value != null) {\n value = scale.parse(value);\n }\n\n var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value\n // and status should be initialized.\n\n if (status == null) {\n option.status = useHandle ? 'show' : 'hide';\n }\n\n var extent = scale.getExtent().slice();\n extent[0] > extent[1] && extent.reverse();\n\n if ( // Pick a value on axis when initializing.\n value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n // where we should re-pick a value to keep `handle` displaying normally.\n || value > extent[1]) {\n // Make handle displayed on the end of the axis when init, which looks better.\n value = extent[1];\n }\n\n if (value < extent[0]) {\n value = extent[0];\n }\n\n option.value = value;\n\n if (useHandle) {\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n }\n}\nexport function getAxisInfo(axisModel) {\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n return axisInfo && axisInfo.axisPointerModel;\n}\n\nfunction isHandleTrigger(axisPointerModel) {\n return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\r\n * @param {module:echarts/model/Model} model\r\n * @return {string} unique key\r\n */\n\n\nexport function makeKey(model) {\n return model.type + '||' + model.id;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper.js';\nimport ComponentView from '../../view/Component.js';\nvar axisPointerClazz = {};\n/**\r\n * Base class of AxisView.\r\n */\n\nvar AxisView =\n/** @class */\nfunction (_super) {\n __extends(AxisView, _super);\n\n function AxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisView.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n // FIXME\n // This process should proformed after coordinate systems updated\n // (axis scale updated), and should be performed each time update.\n // So put it here temporarily, although it is not appropriate to\n // put a model-writing procedure in `view`.\n this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\n\n _super.prototype.render.apply(this, arguments);\n\n this._doUpdateAxisPointerClass(axisModel, api, true);\n };\n /**\r\n * Action handler.\r\n */\n\n\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\n this._doUpdateAxisPointerClass(axisModel, api, false);\n };\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.remove = function (ecModel, api) {\n var axisPointer = this._axisPointer;\n axisPointer && axisPointer.remove(api);\n };\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.dispose = function (ecModel, api) {\n this._disposeAxisPointer(api);\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\n\n if (!Clazz) {\n return;\n }\n\n var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);\n };\n\n AxisView.prototype._disposeAxisPointer = function (api) {\n this._axisPointer && this._axisPointer.dispose(api);\n this._axisPointer = null;\n };\n\n AxisView.registerAxisPointerClass = function (type, clazz) {\n if (process.env.NODE_ENV !== 'production') {\n if (axisPointerClazz[type]) {\n throw new Error('axisPointer ' + type + ' exists');\n }\n }\n\n axisPointerClazz[type] = clazz;\n };\n\n ;\n\n AxisView.getAxisPointerClass = function (type) {\n return type && axisPointerClazz[type];\n };\n\n ;\n AxisView.type = 'axis';\n return AxisView;\n}(ComponentView);\n\nexport default AxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nexport function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n } // TODO: TYPE\n\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = inner(axisView).splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n autoBatch: true,\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n inner(axisView).splitAreaColors = newSplitAreaColors;\n}\nexport function rectCoordAxisHandleRemove(axisView) {\n inner(axisView).splitAreaColors = null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\n\nvar CartesianAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisView, _super);\n\n function CartesianAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianAxisView.type;\n _this.axisPointerClass = 'CartesianAxisPointer';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\n handleAutoShown: function (elementType) {\n var cartesians = gridModel.coordinateSystem.getCartesians();\n\n for (var i = 0; i < cartesians.length; i++) {\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\n // Still show axis tick or axisLine if other axis is value / log\n return true;\n }\n } // Not show axisTick or axisLine if other axis is category / time\n\n\n return false;\n }\n }, layout));\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\n }\n }, this); // THIS is a special case for bar racing chart.\n // Update the axis label from the natural initial layout to\n // sorted layout should has no animation.\n\n var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\n\n if (!isInitialSortFromBarRacing) {\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n CartesianAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n CartesianAxisView.type = 'cartesianAxis';\n return CartesianAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n var line = new graphic.Line({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n },\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var line = new graphic.Line({\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: lineStyle,\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n }\n },\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n }\n};\n\nvar CartesianXAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianXAxisView, _super);\n\n function CartesianXAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianXAxisView.type = 'xAxis';\n return CartesianXAxisView;\n}(CartesianAxisView);\n\nexport { CartesianXAxisView };\n\nvar CartesianYAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianYAxisView, _super);\n\n function CartesianYAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianYAxisView.type = 'yAxis';\n return CartesianYAxisView;\n}(CartesianAxisView);\n\nexport { CartesianYAxisView };\nexport default CartesianAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport GridModel from '../../coord/cartesian/GridModel.js';\nimport { Rect } from '../../util/graphic.js';\nimport { defaults } from 'zrender/lib/core/util.js';\nimport { CartesianAxisModel } from '../../coord/cartesian/AxisModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport Grid from '../../coord/cartesian/Grid.js';\nimport { CartesianXAxisView, CartesianYAxisView } from '../axis/CartesianAxisView.js'; // Grid view\n\nvar GridView =\n/** @class */\nfunction (_super) {\n __extends(GridView, _super);\n\n function GridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'grid';\n return _this;\n }\n\n GridView.prototype.render = function (gridModel, ecModel) {\n this.group.removeAll();\n\n if (gridModel.get('show')) {\n this.group.add(new Rect({\n shape: gridModel.coordinateSystem.getRect(),\n style: defaults({\n fill: gridModel.get('backgroundColor')\n }, gridModel.getItemStyle()),\n silent: true,\n z2: -1\n }));\n }\n };\n\n GridView.type = 'grid';\n return GridView;\n}(ComponentView);\n\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n offset: 0\n};\nexport function install(registers) {\n registers.registerComponentView(GridView);\n registers.registerComponentModel(GridModel);\n registers.registerCoordinateSystem('cartesian2d', Grid);\n axisModelCreator(registers, 'x', CartesianAxisModel, extraOption);\n axisModelCreator(registers, 'y', CartesianAxisModel, extraOption);\n registers.registerComponentView(CartesianXAxisView);\n registers.registerComponentView(CartesianYAxisView);\n registers.registerPreprocessor(function (option) {\n // Only create grid when need\n if (option.xAxis && option.yAxis && !option.grid) {\n option.grid = {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport ScatterSeriesModel from './ScatterSeries.js';\nimport ScatterView from './ScatterView.js';\nimport { install as installGridSimple } from '../../component/grid/installSimple.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n // In case developer forget to include grid component\n use(installGridSimple);\n registers.registerSeriesModel(ScatterSeriesModel);\n registers.registerChartView(ScatterView);\n registers.registerLayout(layoutPoints('scatter'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarLayout(ecModel) {\n ecModel.eachSeriesByType('radar', function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n return;\n }\n\n var axes = coordSys.getIndicatorAxes();\n zrUtil.each(axes, function (axis, axisIndex) {\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\n points[dataIndex] = points[dataIndex] || [];\n var point = coordSys.dataToPoint(val, axisIndex);\n points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);\n });\n }); // Close polygon\n\n data.each(function (idx) {\n // TODO\n // Is it appropriate to connect to the next data when some data is missing?\n // Or, should trade it like `connectNull` in line chart?\n var firstPoint = zrUtil.find(points[idx], function (point) {\n return isValidPoint(point);\n }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array\n\n points[idx].push(firstPoint.slice());\n data.setItemLayout(idx, points[idx]);\n });\n });\n}\n\nfunction isValidPoint(point) {\n return !isNaN(point[0]) && !isNaN(point[1]);\n}\n\nfunction getValueMissingPoint(coordSys) {\n // It is error-prone to input [NaN, NaN] into polygon, polygon.\n // (probably cause problem when refreshing or animating)\n return [coordSys.cx, coordSys.cy];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\n// Backward compat for radar chart in 2\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarBackwardCompat(option) {\n var polarOptArr = option.polar;\n\n if (polarOptArr) {\n if (!zrUtil.isArray(polarOptArr)) {\n polarOptArr = [polarOptArr];\n }\n\n var polarNotRadar_1 = [];\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\n if (polarOpt.indicator) {\n if (polarOpt.type && !polarOpt.shape) {\n polarOpt.shape = polarOpt.type;\n }\n\n option.radar = option.radar || [];\n\n if (!zrUtil.isArray(option.radar)) {\n option.radar = [option.radar];\n }\n\n option.radar.push(polarOpt);\n } else {\n polarNotRadar_1.push(polarOpt);\n }\n });\n option.polar = polarNotRadar_1;\n }\n\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n seriesOpt.radarIndex = seriesOpt.polarIndex;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n saveOldStyle(polygon);\n saveOldStyle(polyline);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle.\n\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore.\n\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n symbolPath.style.strokeNoScale = true;\n }\n\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n this._data = data;\n };\n\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\n\nexport default RadarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup, retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup.js';\n\nvar RadarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(RadarSeriesModel, _super);\n\n function RadarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n } // Overwrite\n\n\n RadarSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n generateCoord: 'indicator_',\n generateCoordCount: Infinity\n });\n };\n\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var coordSys = this.coordinateSystem;\n var indicatorAxes = coordSys.getIndicatorAxes();\n var name = this.getData().getName(dataIndex);\n var nameToDisplay = name === '' ? this.name : name;\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\n return createTooltipMarkup('section', {\n header: nameToDisplay,\n sortBlocks: true,\n blocks: zrUtil.map(indicatorAxes, function (axis) {\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\n return createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: markerColor,\n name: axis.name,\n value: val,\n sortParam: val\n });\n })\n });\n };\n\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var data_1 = this.getData();\n var coordSys = this.coordinateSystem;\n var values = data_1.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data_1.mapDimension(dim);\n }), dataIndex);\n\n for (var i = 0, len = values.length; i < len; i++) {\n if (!isNaN(values[i])) {\n var indicatorAxes = coordSys.getIndicatorAxes();\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\n }\n }\n }\n };\n\n RadarSeriesModel.type = 'series.radar';\n RadarSeriesModel.dependencies = ['radar'];\n RadarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'radar',\n legendHoverLink: true,\n radarIndex: 0,\n lineStyle: {\n width: 2,\n type: 'solid',\n join: 'round'\n },\n label: {\n position: 'top'\n },\n // areaStyle: {\n // },\n // itemStyle: {}\n symbolSize: 8 // symbolRotate: null\n\n };\n return RadarSeriesModel;\n}(SeriesModel);\n\nexport default RadarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport axisDefault from '../axisDefault.js';\nimport Model from '../../model/Model.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport ComponentModel from '../../model/Component.js';\nvar valueAxisDefault = axisDefault.value;\n\nfunction defaultsShow(opt, show) {\n return zrUtil.defaults({\n show: show\n }, opt);\n}\n\nvar RadarModel =\n/** @class */\nfunction (_super) {\n __extends(RadarModel, _super);\n\n function RadarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarModel.type;\n return _this;\n }\n\n RadarModel.prototype.optionUpdated = function () {\n var boundaryGap = this.get('boundaryGap');\n var splitNumber = this.get('splitNumber');\n var scale = this.get('scale');\n var axisLine = this.get('axisLine');\n var axisTick = this.get('axisTick'); // let axisType = this.get('axisType');\n\n var axisLabel = this.get('axisLabel');\n var nameTextStyle = this.get('axisName');\n var showName = this.get(['axisName', 'show']);\n var nameFormatter = this.get(['axisName', 'formatter']);\n var nameGap = this.get('axisNameGap');\n var triggerEvent = this.get('triggerEvent');\n var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n // PENDING\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n indicatorOpt.min = 0;\n } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n indicatorOpt.max = 0;\n }\n\n var iNameTextStyle = nameTextStyle;\n\n if (indicatorOpt.color != null) {\n iNameTextStyle = zrUtil.defaults({\n color: indicatorOpt.color\n }, nameTextStyle);\n } // Use same configuration\n\n\n var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n boundaryGap: boundaryGap,\n splitNumber: splitNumber,\n scale: scale,\n axisLine: axisLine,\n axisTick: axisTick,\n // axisType: axisType,\n axisLabel: axisLabel,\n // Compatible with 2 and use text\n name: indicatorOpt.text,\n showName: showName,\n nameLocation: 'end',\n nameGap: nameGap,\n // min: 0,\n nameTextStyle: iNameTextStyle,\n triggerEvent: triggerEvent\n }, false);\n\n if (zrUtil.isString(nameFormatter)) {\n var indName = innerIndicatorOpt.name;\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n } else if (zrUtil.isFunction(nameFormatter)) {\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n }\n\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\n zrUtil.mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent.\n\n model.mainType = 'radar';\n model.componentIndex = this.componentIndex;\n return model;\n }, this);\n this._indicatorModels = indicatorModels;\n };\n\n RadarModel.prototype.getIndicatorModels = function () {\n return this._indicatorModels;\n };\n\n RadarModel.type = 'radar';\n RadarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '75%',\n startAngle: 90,\n axisName: {\n show: true // formatter: null\n // textStyle: {}\n\n },\n boundaryGap: [0, 0],\n splitNumber: 5,\n axisNameGap: 15,\n scale: false,\n // Polygon or circle\n shape: 'polygon',\n axisLine: zrUtil.merge({\n lineStyle: {\n color: '#bbb'\n }\n }, valueAxisDefault.axisLine),\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n // axisType: 'value',\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n // {text, min, max}\n indicator: []\n };\n return RadarModel;\n}(ComponentModel);\n\nexport default RadarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (radarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n this._buildAxes(radarModel);\n\n this._buildSplitLineAndArea(radarModel);\n };\n\n RadarView.prototype._buildAxes = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\n var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name\n\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\n axisName: axisName,\n position: [radar.cx, radar.cy],\n rotation: indicatorAxis.angle,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1\n });\n return axisBuilder;\n });\n zrUtil.each(axisBuilders, function (axisBuilder) {\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this.group.add(axisBuilder.getGroup());\n }, this);\n };\n\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n\n if (!indicatorAxes.length) {\n return;\n }\n\n var shape = radarModel.get('shape');\n var splitLineModel = radarModel.getModel('splitLine');\n var splitAreaModel = radarModel.getModel('splitArea');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var showSplitLine = splitLineModel.get('show');\n var showSplitArea = splitAreaModel.get('show');\n var splitLineColors = lineStyleModel.get('color');\n var splitAreaColors = areaStyleModel.get('color');\n var splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\n var splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\n var splitLines = [];\n var splitAreas = [];\n\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\n var colorIndex = idx % areaOrLineColorList.length;\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\n return colorIndex;\n }\n\n if (shape === 'circle') {\n var ticksRadius = indicatorAxes[0].getTicksCoords();\n var cx = radar.cx;\n var cy = radar.cy;\n\n for (var i = 0; i < ticksRadius.length; i++) {\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: cx,\n cy: cy,\n r: ticksRadius[i].coord\n }\n }));\n }\n\n if (showSplitArea && i < ticksRadius.length - 1) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\n splitAreas[colorIndex].push(new graphic.Ring({\n shape: {\n cx: cx,\n cy: cy,\n r0: ticksRadius[i].coord,\n r: ticksRadius[i + 1].coord\n }\n }));\n }\n }\n } // Polyyon\n else {\n var realSplitNumber_1;\n var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\n var ticksCoords = indicatorAxis.getTicksCoords();\n realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);\n return zrUtil.map(ticksCoords, function (tickCoord) {\n return radar.coordToPoint(tickCoord.coord, idx);\n });\n });\n var prevPoints = [];\n\n for (var i = 0; i <= realSplitNumber_1; i++) {\n var points = [];\n\n for (var j = 0; j < indicatorAxes.length; j++) {\n points.push(axesTicksPoints[j][i]);\n } // Close\n\n\n if (points[0]) {\n points.push(points[0].slice());\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Can\\'t draw value axis ' + i);\n }\n }\n\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Polyline({\n shape: {\n points: points\n }\n }));\n }\n\n if (showSplitArea && prevPoints) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\n splitAreas[colorIndex].push(new graphic.Polygon({\n shape: {\n points: points.concat(prevPoints)\n }\n }));\n }\n\n prevPoints = points.slice().reverse();\n }\n }\n\n var lineStyle = lineStyleModel.getLineStyle();\n var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine\n\n zrUtil.each(splitAreas, function (splitAreas, idx) {\n this.group.add(graphic.mergePath(splitAreas, {\n style: zrUtil.defaults({\n stroke: 'none',\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\n }, areaStyle),\n silent: true\n }));\n }, this);\n zrUtil.each(splitLines, function (splitLines, idx) {\n this.group.add(graphic.mergePath(splitLines, {\n style: zrUtil.defaults({\n fill: 'none',\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\n }, lineStyle),\n silent: true\n }));\n }, this);\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ComponentView);\n\nexport default RadarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar IndicatorAxis =\n/** @class */\nfunction (_super) {\n __extends(IndicatorAxis, _super);\n\n function IndicatorAxis(dim, scale, radiusExtent) {\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\n\n _this.type = 'value';\n _this.angle = 0;\n _this.name = '';\n return _this;\n }\n\n return IndicatorAxis;\n}(Axis);\n\nexport default IndicatorAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport * as numberUtil from '../../util/number.js';\nimport { map, each, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\n\nvar Radar =\n/** @class */\nfunction () {\n function Radar(radarModel, ecModel, api) {\n /**\r\n *\r\n * Radar dimensions\r\n */\n this.dimensions = [];\n this._model = radarModel;\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n var dim = 'indicator_' + idx;\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n );\n indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis\n\n indicatorAxis.model = indicatorModel;\n indicatorModel.axis = indicatorAxis;\n this.dimensions.push(dim);\n return indicatorAxis;\n }, this);\n this.resize(radarModel, api);\n }\n\n Radar.prototype.getIndicatorAxes = function () {\n return this._indicatorAxes;\n };\n\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n }; // TODO: API should be coordToPoint([coord, indicatorIndex])\n\n\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n var angle = indicatorAxis.angle;\n var x = this.cx + coord * Math.cos(angle);\n var y = this.cy - coord * Math.sin(angle);\n return [x, y];\n };\n\n Radar.prototype.pointToData = function (pt) {\n var dx = pt[0] - this.cx;\n var dy = pt[1] - this.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx); // Find the closest angle\n // FIXME index can calculated directly\n\n var minRadianDiff = Infinity;\n var closestAxis;\n var closestAxisIdx = -1;\n\n for (var i = 0; i < this._indicatorAxes.length; i++) {\n var indicatorAxis = this._indicatorAxes[i];\n var diff = Math.abs(radian - indicatorAxis.angle);\n\n if (diff < minRadianDiff) {\n closestAxis = indicatorAxis;\n closestAxisIdx = i;\n minRadianDiff = diff;\n }\n }\n\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n };\n\n Radar.prototype.resize = function (radarModel, api) {\n var center = radarModel.get('center');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n\n var radius = radarModel.get('radius');\n\n if (isString(radius) || isNumber(radius)) {\n radius = [0, radius];\n }\n\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n this.r = numberUtil.parsePercent(radius[1], viewSize);\n each(this._indicatorAxes, function (indicatorAxis, idx) {\n indicatorAxis.setExtent(this.r0, this.r);\n var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI]\n\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n indicatorAxis.angle = angle;\n }, this);\n };\n\n Radar.prototype.update = function (ecModel, api) {\n var indicatorAxes = this._indicatorAxes;\n var radarModel = this._model;\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\n });\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n return;\n }\n\n var data = radarSeries.getData();\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n });\n }, this);\n var splitNumber = radarModel.get('splitNumber');\n var dummyScale = new IntervalScale();\n dummyScale.setExtent(0, splitNumber);\n dummyScale.setInterval(1); // Force all the axis fixing the maxSplitNumber.\n\n each(indicatorAxes, function (indicatorAxis, idx) {\n alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);\n });\n };\n\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n\n Radar.create = function (ecModel, api) {\n var radarList = [];\n ecModel.eachComponent('radar', function (radarModel) {\n var radar = new Radar(radarModel, ecModel, api);\n radarList.push(radar);\n radarModel.coordinateSystem = radar;\n });\n ecModel.eachSeriesByType('radar', function (radarSeries) {\n if (radarSeries.get('coordinateSystem') === 'radar') {\n // Inject coordinate system\n // @ts-ignore\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n }\n });\n return radarList;\n };\n /**\r\n * Radar dimensions is based on the data\r\n */\n\n\n Radar.dimensions = [];\n return Radar;\n}();\n\nexport default Radar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport RadarModel from '../../coord/radar/RadarModel.js';\nimport RadarView from './RadarView.js';\nimport Radar from '../../coord/radar/Radar.js';\nexport function install(registers) {\n registers.registerCoordinateSystem('radar', Radar);\n registers.registerComponentModel(RadarModel);\n registers.registerComponentView(RadarView);\n registers.registerVisual({\n seriesType: 'radar',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // itemVisual symbol is for selected data\n\n data.each(function (idx) {\n data.setItemVisual(idx, 'legendIcon', 'roundRect');\n }); // visual is for unselected data\n\n data.setVisual('legendIcon', 'roundRect');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport radarLayout from '../radar/radarLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport backwardCompat from '../radar/backwardCompat.js';\nimport RadarView from './RadarView.js';\nimport RadarSeriesModel from './RadarSeries.js';\nimport { install as installRadarComponent } from '../../component/radar/install.js';\nexport function install(registers) {\n use(installRadarComponent);\n registers.registerChartView(RadarView);\n registers.registerSeriesModel(RadarSeriesModel);\n registers.registerLayout(radarLayout);\n registers.registerProcessor(dataFilter('radar'));\n registers.registerPreprocessor(backwardCompat);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as echarts from '../../core/echarts.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar ATTR = '\\0_ec_interaction_mutex';\nexport function take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\nexport function release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\nexport function isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\r\n * payload: {\r\n * type: 'takeGlobalCursor',\r\n * key: 'dataZoomSelect', or 'brush', or ...,\r\n * If no userKey, release global cursor.\r\n * }\r\n */\n// TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, noop);","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport { isString, bind, defaults, clone } from 'zrender/lib/core/util.js';\n;\n\nvar RoamController =\n/** @class */\nfunction (_super) {\n __extends(RoamController, _super);\n\n function RoamController(zr) {\n var _this = _super.call(this) || this;\n\n _this._zr = zr; // Avoid two roamController bind the same handler\n\n var mousedownHandler = bind(_this._mousedownHandler, _this);\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\n var mouseupHandler = bind(_this._mouseupHandler, _this);\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\n var pinchHandler = bind(_this._pinchHandler, _this);\n /**\r\n * Notice: only enable needed types. For example, if 'zoom'\r\n * is not needed, 'zoom' should not be enabled, otherwise\r\n * default mousewheel behaviour (scroll page) will be disabled.\r\n */\n\n _this.enable = function (controlType, opt) {\n // Disable previous first\n this.disable();\n this._opt = defaults(clone(opt) || {}, {\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n // By default, wheel do not trigger move.\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n\n if (controlType == null) {\n controlType = true;\n }\n\n if (controlType === true || controlType === 'move' || controlType === 'pan') {\n zr.on('mousedown', mousedownHandler);\n zr.on('mousemove', mousemoveHandler);\n zr.on('mouseup', mouseupHandler);\n }\n\n if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n zr.on('mousewheel', mousewheelHandler);\n zr.on('pinch', pinchHandler);\n }\n };\n\n _this.disable = function () {\n zr.off('mousedown', mousedownHandler);\n zr.off('mousemove', mousemoveHandler);\n zr.off('mouseup', mouseupHandler);\n zr.off('mousewheel', mousewheelHandler);\n zr.off('pinch', pinchHandler);\n };\n\n return _this;\n }\n\n RoamController.prototype.isDragging = function () {\n return this._dragging;\n };\n\n RoamController.prototype.isPinching = function () {\n return this._pinching;\n };\n\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\n this.pointerChecker = pointerChecker;\n };\n\n RoamController.prototype.dispose = function () {\n this.disable();\n };\n\n RoamController.prototype._mousedownHandler = function (e) {\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n return;\n }\n\n var el = e.target;\n\n while (el) {\n if (el.draggable) {\n return;\n } // check if host is draggable\n\n\n el = el.__hostTarget || el.parent;\n }\n\n var x = e.offsetX;\n var y = e.offsetY; // Only check on mosedown, but not mousemove.\n // Mouse can be out of target when mouse moving.\n\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\n this._x = x;\n this._y = y;\n this._dragging = true;\n }\n };\n\n RoamController.prototype._mousemoveHandler = function (e) {\n if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY;\n var oldX = this._x;\n var oldY = this._y;\n var dx = x - oldX;\n var dy = y - oldY;\n this._x = x;\n this._y = y;\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\n trigger(this, 'pan', 'moveOnMouseMove', e, {\n dx: dx,\n dy: dy,\n oldX: oldX,\n oldY: oldY,\n newX: x,\n newY: y,\n isAvailableBehavior: null\n });\n };\n\n RoamController.prototype._mouseupHandler = function (e) {\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n this._dragging = false;\n }\n };\n\n RoamController.prototype._mousewheelHandler = function (e) {\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n var wheelDelta = e.wheelDelta;\n var absWheelDeltaDelta = Math.abs(wheelDelta);\n var originX = e.offsetX;\n var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac.\n\n if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n return;\n } // If both `shouldZoom` and `shouldMove` is true, trigger\n // their event both, and the final behavior is determined\n // by event listener themselves.\n\n\n if (shouldZoom) {\n // Convenience:\n // Mac and VM Windows on Mac: scroll up: zoom out.\n // Windows: scroll up: zoom in.\n // FIXME: Should do more test in different environment.\n // wheelDelta is too complicated in difference nvironment\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n // although it has been normallized by zrender.\n // wheelDelta of mouse wheel is bigger than touch pad.\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n var scale = wheelDelta > 0 ? factor : 1 / factor;\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\n scale: scale,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n\n if (shouldMove) {\n // FIXME: Should do more test in different environment.\n var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad.\n\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\n scrollDelta: scrollDelta,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n };\n\n RoamController.prototype._pinchHandler = function (e) {\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n checkPointerAndTrigger(this, 'zoom', null, e, {\n scale: scale,\n originX: e.pinchX,\n originY: e.pinchY,\n isAvailableBehavior: null\n });\n };\n\n return RoamController;\n}(Eventful);\n\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\n // When mouse is out of roamController rect,\n // default befavoius should not be be disabled, otherwise\n // page sliding is disabled, contrary to expectation.\n eventTool.stop(e.event);\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n }\n}\n\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n // Also provide behavior checker for event listener, for some case that\n // multiple components share one listener.\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); // TODO should not have type issue.\n\n controller.trigger(eventName, contollerEvent);\n} // settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n\n\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n}\n\nexport default RoamController;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * For geo and graph.\r\n */\nexport function updateViewOnPan(controllerHost, dx, dy) {\n var target = controllerHost.target;\n target.x += dx;\n target.y += dy;\n target.dirty();\n}\n/**\r\n * For geo and graph.\r\n */\n\nexport function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\n target.x -= (zoomX - target.x) * (zoomScale - 1);\n target.y -= (zoomY - target.y) * (zoomScale - 1);\n target.scaleX *= zoomScale;\n target.scaleY *= zoomScale;\n target.dirty();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar IRRELEVANT_EXCLUDES = {\n 'axisPointer': 1,\n 'tooltip': 1,\n 'brush': 1\n};\n/**\r\n * Avoid that: mouse click on a elements that is over geo or graph,\r\n * but roam is triggered.\r\n */\n\nexport function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}","import Group from '../graphic/Group.js';\nimport ZRImage from '../graphic/Image.js';\nimport Circle from '../graphic/shape/Circle.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Ellipse from '../graphic/shape/Ellipse.js';\nimport Line from '../graphic/shape/Line.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Polyline from '../graphic/shape/Polyline.js';\nimport * as matrix from '../core/matrix.js';\nimport { createFromString } from './path.js';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util.js';\nimport LinearGradient from '../graphic/LinearGradient.js';\nimport RadialGradient from '../graphic/RadialGradient.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { parseXML } from './parseXML.js';\n;\nvar nodeParsers;\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-anchor': 'textAlign',\n 'visibility': 'visibility',\n 'display': 'display'\n};\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\nvar SELF_STYLE_ATTRIBUTES_MAP = {\n 'alignment-baseline': 'textBaseline',\n 'stop-color': 'stopColor'\n};\nvar SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\nvar SVGParser = (function () {\n function SVGParser() {\n this._defs = {};\n this._root = null;\n }\n SVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n if (process.env.NODE_ENV !== 'production') {\n if (!svg) {\n throw new Error('Illegal svg');\n }\n }\n this._defsUsePending = [];\n var root = new Group();\n this._root = root;\n var named = [];\n var viewBox = svg.getAttribute('viewBox') || '';\n var width = parseFloat((svg.getAttribute('width') || opt.width));\n var height = parseFloat((svg.getAttribute('height') || opt.height));\n isNaN(width) && (width = null);\n isNaN(height) && (height = null);\n parseAttributes(svg, root, null, true, false);\n var child = svg.firstChild;\n while (child) {\n this._parseNode(child, root, named, null, false, false);\n child = child.nextSibling;\n }\n applyDefs(this._defs, this._defsUsePending);\n this._defsUsePending = [];\n var viewBoxRect;\n var viewBoxTransform;\n if (viewBox) {\n var viewBoxArr = splitNumberSequence(viewBox);\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat((viewBoxArr[0] || 0)),\n y: parseFloat((viewBoxArr[1] || 0)),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n if (!opt.ignoreViewBox) {\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n elRoot.x = viewBoxTransform.x;\n elRoot.y = viewBoxTransform.y;\n }\n }\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: { x: 0, y: 0, width: width, height: height }\n }));\n }\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform,\n named: named\n };\n };\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {\n var nodeName = xmlNode.nodeName.toLowerCase();\n var el;\n var namedFromForSub = namedFrom;\n if (nodeName === 'defs') {\n isInDefs = true;\n }\n if (nodeName === 'text') {\n isInText = true;\n }\n if (nodeName === 'defs' || nodeName === 'switch') {\n el = parentGroup;\n }\n else {\n if (!isInDefs) {\n var parser_1 = nodeParsers[nodeName];\n if (parser_1 && hasOwn(nodeParsers, nodeName)) {\n el = parser_1.call(this, xmlNode, parentGroup);\n var nameAttr = xmlNode.getAttribute('name');\n if (nameAttr) {\n var newNamed = {\n name: nameAttr,\n namedFrom: null,\n svgNodeTagLower: nodeName,\n el: el\n };\n named.push(newNamed);\n if (nodeName === 'g') {\n namedFromForSub = newNamed;\n }\n }\n else if (namedFrom) {\n named.push({\n name: namedFrom.name,\n namedFrom: namedFrom,\n svgNodeTagLower: nodeName,\n el: el\n });\n }\n parentGroup.add(el);\n }\n }\n var parser = paintServerParsers[nodeName];\n if (parser && hasOwn(paintServerParsers, nodeName)) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n if (id) {\n this._defs[id] = def;\n }\n }\n }\n if (el && el.isGroup) {\n var child = xmlNode.firstChild;\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);\n }\n else if (child.nodeType === 3 && isInText) {\n this._parseText(child, el);\n }\n child = child.nextSibling;\n }\n }\n };\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n var text = new TSpan({\n style: {\n text: xmlNode.textContent\n },\n silent: true,\n x: this._textX || 0,\n y: this._textY || 0\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n applyTextAlignment(text, parentGroup);\n var textStyle = text.style;\n var fontSize = textStyle.fontSize;\n if (fontSize && fontSize < 9) {\n textStyle.fontSize = 9;\n text.scaleX *= fontSize / 9;\n text.scaleY *= fontSize / 9;\n }\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\n textStyle.fontStyle,\n textStyle.fontWeight,\n (textStyle.fontSize || 12) + 'px',\n textStyle.fontFamily || 'sans-serif'\n ].join(' ');\n textStyle.font = font;\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n };\n SVGParser.internalField = (function () {\n nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\n height: parseFloat(xmlNode.getAttribute('height') || '0')\n });\n rect.silent = true;\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n r: parseFloat(xmlNode.getAttribute('r') || '0')\n });\n circle.silent = true;\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n });\n line.silent = true;\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n });\n ellipse.silent = true;\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polygon = new Polygon({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polyline = new Polyline({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polyline);\n parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZRImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'),\n x: +xmlNode.getAttribute('x'),\n y: +xmlNode.getAttribute('y'),\n width: +xmlNode.getAttribute('width'),\n height: +xmlNode.getAttribute('height')\n });\n img.silent = true;\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || '0';\n var y = xmlNode.getAttribute('y') || '0';\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n if (x != null) {\n this._textX = parseFloat(x);\n }\n if (y != null) {\n this._textY = parseFloat(y);\n }\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n var d = xmlNode.getAttribute('d') || '';\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n path.silent = true;\n return path;\n }\n };\n })();\n return SVGParser;\n}());\nvar paintServerParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n },\n 'radialgradient': function (xmlNode) {\n var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n var r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n var gradient = new RadialGradient(cx, cy, r);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n }\n};\nfunction parsePaintServerUnit(xmlNode, gradient) {\n var gradientUnits = xmlNode.getAttribute('gradientUnits');\n if (gradientUnits === 'userSpaceOnUse') {\n gradient.global = true;\n }\n}\nfunction parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n while (stop) {\n if (stop.nodeType === 1\n && stop.nodeName.toLocaleLowerCase() === 'stop') {\n var offsetStr = stop.getAttribute('offset');\n var offset = void 0;\n if (offsetStr && offsetStr.indexOf('%') > 0) {\n offset = parseInt(offsetStr, 10) / 100;\n }\n else if (offsetStr) {\n offset = parseFloat(offsetStr);\n }\n else {\n offset = 0;\n }\n var styleVals = {};\n parseInlineStyle(stop, styleVals, styleVals);\n var stopColor = styleVals.stopColor\n || stop.getAttribute('stop-color')\n || '#000000';\n gradient.colorStops.push({\n offset: offset,\n color: stopColor\n });\n }\n stop = stop.nextSibling;\n }\n}\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\nfunction parsePoints(pointsString) {\n var list = splitNumberSequence(pointsString);\n var points = [];\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n return points;\n}\nfunction parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {\n var disp = el;\n var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n var selfStyle = {};\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n if (!onlyInlineStyle) {\n parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n }\n }\n disp.style = disp.style || {};\n if (inheritedStyle.fill != null) {\n disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n }\n if (inheritedStyle.stroke != null) {\n disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n }\n each([\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = parseFloat(inheritedStyle[propName]);\n }\n });\n each([\n 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = inheritedStyle[propName];\n }\n });\n if (isTextGroup) {\n disp.__selfStyle = selfStyle;\n }\n if (inheritedStyle.lineDash) {\n disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n return parseFloat(str);\n });\n }\n if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n disp.invisible = true;\n }\n if (inheritedStyle.display === 'none') {\n disp.ignore = true;\n }\n}\nfunction applyTextAlignment(text, parentGroup) {\n var parentSelfStyle = parentGroup.__selfStyle;\n if (parentSelfStyle) {\n var textBaseline = parentSelfStyle.textBaseline;\n var zrTextBaseline = textBaseline;\n if (!textBaseline || textBaseline === 'auto') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'baseline') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n zrTextBaseline = 'top';\n }\n else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n zrTextBaseline = 'bottom';\n }\n else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n zrTextBaseline = 'middle';\n }\n text.style.textBaseline = zrTextBaseline;\n }\n var parentInheritedStyle = parentGroup.__inheritedStyle;\n if (parentInheritedStyle) {\n var textAlign = parentInheritedStyle.textAlign;\n var zrTextAlign = textAlign;\n if (textAlign) {\n if (textAlign === 'middle') {\n zrTextAlign = 'center';\n }\n text.style.textAlign = zrTextAlign;\n }\n }\n}\nvar urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(el, method, str, defsUsePending) {\n var urlMatch = str && str.match(urlRegex);\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n defsUsePending.push([el, method, url]);\n return;\n }\n if (str === 'none') {\n str = null;\n }\n return str;\n}\nfunction applyDefs(defs, defsUsePending) {\n for (var i = 0; i < defsUsePending.length; i++) {\n var item = defsUsePending[i];\n item[0].style[item[1]] = defs[item[2]];\n }\n}\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr) {\n return rawStr.match(numberReg) || [];\n}\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nvar DEGREE_TO_ANGLE = Math.PI / 180;\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var transformOps_1 = [];\n var mt = null;\n transform.replace(transformRegex, function (str, type, value) {\n transformOps_1.push(type, value);\n return '';\n });\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\n var value = transformOps_1[i];\n var type = transformOps_1[i - 1];\n var valueArr = splitNumberSequence(value);\n mt = mt || matrix.create();\n switch (type) {\n case 'translate':\n matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n break;\n case 'scale':\n matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n break;\n case 'rotate':\n matrix.rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n break;\n case 'skewX':\n var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, 0, sx, 1, 0, 0], mt);\n break;\n case 'skewY':\n var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, sy, 0, 1, 0, 0], mt);\n break;\n case 'matrix':\n mt[0] = parseFloat(valueArr[0]);\n mt[1] = parseFloat(valueArr[1]);\n mt[2] = parseFloat(valueArr[2]);\n mt[3] = parseFloat(valueArr[3]);\n mt[4] = parseFloat(valueArr[4]);\n mt[5] = parseFloat(valueArr[5]);\n break;\n }\n }\n node.setLocalTransform(mt);\n }\n}\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n var style = xmlNode.getAttribute('style');\n if (!style) {\n return;\n }\n styleRegex.lastIndex = 0;\n var styleRegResult;\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n var svgStlAttr = styleRegResult[1];\n var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrInheritableStlAttr) {\n inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n }\n var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrSelfStlAttr) {\n selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n }\n }\n}\nfunction parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n}\nexport function makeViewBoxTransform(viewBoxRect, boundingRect) {\n var scaleX = boundingRect.width / viewBoxRect.width;\n var scaleY = boundingRect.height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY);\n return {\n scale: scale,\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n };\n}\nexport function parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\nexport { parseXML };\n","import { isString } from '../core/util.js';\nexport function parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n }\n var svgNode = svg;\n if (svgNode.nodeType === 9) {\n svgNode = svgNode.firstChild;\n }\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n svgNode = svgNode.nextSibling;\n }\n return svgNode;\n}\n","import windingLine from './windingLine.js';\nvar EPSILON = 1e-8;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nexport function contain(points, x, y) {\n var w = 0;\n var p = points[0];\n if (!p) {\n return false;\n }\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n }\n var p0 = points[0];\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n return w !== 0;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar TMP_TRANSFORM = [];\n\nfunction transformPoints(points, transform) {\n for (var p = 0; p < points.length; p++) {\n vec2.applyTransform(points[p], points[p], transform);\n }\n}\n\nfunction updateBBoxFromPoints(points, min, max, projection) {\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n\n if (projection) {\n // projection may return null point.\n p = projection.project(p);\n }\n\n if (p && isFinite(p[0]) && isFinite(p[1])) {\n vec2.min(min, min, p);\n vec2.max(max, max, p);\n }\n }\n}\n\nfunction centroid(points) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = points.length;\n var x0 = points[len - 1][0];\n var y0 = points[len - 1][1]; // Polygon should been closed.\n\n for (var i = 0; i < len; i++) {\n var x1 = points[i][0];\n var y1 = points[i][1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n x0 = x1;\n y0 = y1;\n }\n\n return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0];\n}\n\nvar Region =\n/** @class */\nfunction () {\n function Region(name) {\n this.name = name;\n }\n\n Region.prototype.setCenter = function (center) {\n this._center = center;\n };\n /**\r\n * Get center point in data unit. That is,\r\n * for GeoJSONRegion, the unit is lat/lng,\r\n * for GeoSVGRegion, the unit is SVG local coord.\r\n */\n\n\n Region.prototype.getCenter = function () {\n var center = this._center;\n\n if (!center) {\n // In most cases there are no need to calculate this center.\n // So calculate only when called.\n center = this._center = this.calcCenter();\n }\n\n return center;\n };\n\n return Region;\n}();\n\nexport { Region };\n\nvar GeoJSONPolygonGeometry =\n/** @class */\nfunction () {\n function GeoJSONPolygonGeometry(exterior, interiors) {\n this.type = 'polygon';\n this.exterior = exterior;\n this.interiors = interiors;\n }\n\n return GeoJSONPolygonGeometry;\n}();\n\nexport { GeoJSONPolygonGeometry };\n\nvar GeoJSONLineStringGeometry =\n/** @class */\nfunction () {\n function GeoJSONLineStringGeometry(points) {\n this.type = 'linestring';\n this.points = points;\n }\n\n return GeoJSONLineStringGeometry;\n}();\n\nexport { GeoJSONLineStringGeometry };\n\nvar GeoJSONRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoJSONRegion, _super);\n\n function GeoJSONRegion(name, geometries, cp) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoJSON';\n _this.geometries = geometries;\n _this._center = cp && [cp[0], cp[1]];\n return _this;\n }\n\n GeoJSONRegion.prototype.calcCenter = function () {\n var geometries = this.geometries;\n var largestGeo;\n var largestGeoSize = 0;\n\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n var exterior = geo.exterior; // Simple trick to use points count instead of polygon area as region size.\n // Ignore linestring\n\n var size = exterior && exterior.length;\n\n if (size > largestGeoSize) {\n largestGeo = geo;\n largestGeoSize = size;\n }\n }\n\n if (largestGeo) {\n return centroid(largestGeo.exterior);\n } // from bounding rect by default.\n\n\n var rect = this.getBoundingRect();\n return [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.getBoundingRect = function (projection) {\n var rect = this._rect; // Always recalculate if using projection.\n\n if (rect && !projection) {\n return rect;\n }\n\n var min = [Infinity, Infinity];\n var max = [-Infinity, -Infinity];\n var geometries = this.geometries;\n each(geometries, function (geo) {\n if (geo.type === 'polygon') {\n // Doesn't consider hole\n updateBBoxFromPoints(geo.exterior, min, max, projection);\n } else {\n each(geo.points, function (points) {\n updateBBoxFromPoints(points, min, max, projection);\n });\n }\n }); // Normalie invalid bounding.\n\n if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n\n if (!projection) {\n this._rect = rect;\n }\n\n return rect;\n };\n\n GeoJSONRegion.prototype.contain = function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n var geo = geometries[i]; // Only support polygon.\n\n if (geo.type !== 'polygon') {\n continue;\n }\n\n var exterior = geo.exterior;\n var interiors = geo.interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n };\n /**\r\n * Transform the raw coords to target bounding.\r\n * @param x\r\n * @param y\r\n * @param width\r\n * @param height\r\n */\n\n\n GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n\n if (geo.type === 'polygon') {\n transformPoints(geo.exterior, transform);\n each(geo.interiors, function (interior) {\n transformPoints(interior, transform);\n });\n } else {\n each(geo.points, function (points) {\n transformPoints(points, transform);\n });\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.cloneShallow = function (name) {\n name == null && (name = this.name);\n var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n };\n\n return GeoJSONRegion;\n}(Region);\n\nexport { GeoJSONRegion };\n\nvar GeoSVGRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoSVGRegion, _super);\n\n function GeoSVGRegion(name, elOnlyForCalculate) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoSVG';\n _this._elOnlyForCalculate = elOnlyForCalculate;\n return _this;\n }\n\n GeoSVGRegion.prototype.calcCenter = function () {\n var el = this._elOnlyForCalculate;\n var rect = el.getBoundingRect();\n var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n var mat = matrix.identity(TMP_TRANSFORM);\n var target = el;\n\n while (target && !target.isGeoSVGGraphicRoot) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n matrix.invert(mat, mat);\n vec2.applyTransform(center, center, mat);\n return center;\n };\n\n return GeoSVGRegion;\n}(Region);\n\nexport { GeoSVGRegion };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parseXML } from 'zrender/lib/tool/parseXML.js';\nimport { GeoSVGRegion } from './Region.js';\n/**\r\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\r\n * to make it be a region.\r\n * 1. region styles and its label styles can be defined in echarts opton:\r\n * ```js\r\n * geo: {\r\n * regions: [{\r\n * name: 'xxx',\r\n * itemStyle: { ... },\r\n * label: { ... }\r\n * }, {\r\n * ...\r\n * },\r\n * ...]\r\n * };\r\n * ```\r\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\r\n * a region option. For exampel if there are two representing two lung lobes. They have\r\n * no common parents but both of them need to display label \"lung\" inside.\r\n */\n\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', // are also enabled because some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan', // is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a . Thereby only one label\n// displayed and located based on the bounding rect of the .\n'g']);\n\nvar GeoSVGResource =\n/** @class */\nfunction () {\n function GeoSVGResource(mapName, svg) {\n this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root\n\n this._usedGraphicMap = createHashMap(); // All unused graphics.\n\n this._freedGraphics = [];\n this._mapName = mapName; // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n\n this._parsedXML = parseXML(svg);\n }\n\n GeoSVGResource.prototype.load = function ()\n /* nameMap: NameMap */\n {\n // In the \"load\" stage, graphic need to be built to\n // get boundingRect for geo coordinate system.\n var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created.\n // Because they will be used in geo coordinate system update stage,\n // and `regions` will be mounted at `geo` coordinate system,\n // in which there is no \"view\" info, so that it should better not to\n // make references to graphic elements.\n\n if (!firstGraphic) {\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n\n this._freedGraphics.push(firstGraphic);\n\n this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come.\n // if (nameMap) {\n // named = applyNameMap(named, nameMap);\n // }\n\n var _a = createRegions(firstGraphic.named),\n regions = _a.regions,\n regionsMap = _a.regionsMap;\n\n this._regions = regions;\n this._regionsMap = regionsMap;\n }\n\n return {\n boundingRect: this._boundingRect,\n regions: this._regions,\n regionsMap: this._regionsMap\n };\n };\n\n GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n var result;\n var rootFromParse;\n\n try {\n result = svgXML && parseSVG(svgXML, {\n ignoreViewBox: true,\n ignoreRootClip: true\n }) || {};\n rootFromParse = result.root;\n assert(rootFromParse != null);\n } catch (e) {\n throw new Error('Invalid svg format\\n' + e.message);\n } // Note: we keep the covenant that the root has no transform. So always add an extra root.\n\n\n var root = new Group();\n root.add(rootFromParse);\n root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n //\n // Consider: ``\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n // \"viewport boundingRect\", or `boundingRect` for short.\n // - `viewBox` defines the transform from the real content ot the viewport.\n // `viewBox` has the same unit as the content of SVG.\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n // different from the content of SVG. Otherwise, they are the same.\n //\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n // 1. Make a transform from `viewBox` to `boundingRect`.\n // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n // the aspect ratio.\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n // (`Geo`/`View` will do this job).\n // Note: this transform might not preserve aspect radio, which depending on how users specify\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n //\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n // layout look good.\n //\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n // of the SVG content and use them to make SVG layout look good.\n\n var svgWidth = result.width;\n var svgHeight = result.height;\n var viewBoxRect = result.viewBoxRect;\n var boundingRect = this._boundingRect;\n\n if (!boundingRect) {\n var bRectX = void 0;\n var bRectY = void 0;\n var bRectWidth = void 0;\n var bRectHeight = void 0;\n\n if (svgWidth != null) {\n bRectX = 0;\n bRectWidth = svgWidth;\n } else if (viewBoxRect) {\n bRectX = viewBoxRect.x;\n bRectWidth = viewBoxRect.width;\n }\n\n if (svgHeight != null) {\n bRectY = 0;\n bRectHeight = svgHeight;\n } else if (viewBoxRect) {\n bRectY = viewBoxRect.y;\n bRectHeight = viewBoxRect.height;\n } // If both viewBox and svgWidth/svgHeight not specified,\n // we have to determine how to layout those element to make them look good.\n\n\n if (bRectX == null || bRectY == null) {\n var calculatedBoundingRect = rootFromParse.getBoundingRect();\n\n if (bRectX == null) {\n bRectX = calculatedBoundingRect.x;\n bRectWidth = calculatedBoundingRect.width;\n }\n\n if (bRectY == null) {\n bRectY = calculatedBoundingRect.y;\n bRectHeight = calculatedBoundingRect.height;\n }\n }\n\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n }\n\n if (viewBoxRect) {\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'`\n\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n rootFromParse.x = viewBoxTransform.x;\n rootFromParse.y = viewBoxTransform.y;\n } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n // They do not strictly confine all of the content inside a display rect, but deliberately\n // use a `viewBox` to define a displayable rect.\n // PENDING:\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n\n\n root.setClipPath(new Rect({\n shape: boundingRect.plain()\n }));\n var named = [];\n each(result.named, function (namedItem) {\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n named.push(namedItem);\n setSilent(namedItem.el);\n }\n });\n return {\n root: root,\n boundingRect: boundingRect,\n named: named\n };\n };\n /**\r\n * Consider:\r\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\r\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\r\n * (2) Converting SVG to graphic elements is time consuming.\r\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\r\n * and it is called without view info.\r\n * So we maintain graphic elements in this module, and enables `view` to use/return these\r\n * graphics from/to the pool with it's uid.\r\n */\n\n\n GeoSVGResource.prototype.useGraphic = function (hostKey\n /* , nameMap: NameMap */\n ) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n return svgGraphic;\n }\n\n svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation.\n || this._buildGraphic(this._parsedXML);\n usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come.\n // `nameMap` can only be obtained from echarts option.\n // The original `named` must not be modified.\n // if (nameMap) {\n // svgGraphic = extend({}, svgGraphic);\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n // }\n\n return svgGraphic;\n };\n\n GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n usedRootMap.removeKey(hostKey);\n\n this._freedGraphics.push(svgGraphic);\n }\n };\n\n return GeoSVGResource;\n}();\n\nexport { GeoSVGResource };\n\nfunction setSilent(el) {\n // Only named element has silent: false, other elements should\n // act as background and has no user interaction.\n el.silent = false; // text|tspan will be converted to group.\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.silent = false;\n });\n }\n}\n\nfunction createRegions(named) {\n var regions = [];\n var regionsMap = createHashMap(); // Create resions only for the first graphic.\n\n each(named, function (namedItem) {\n // Region has feature to calculate center for tooltip or other features.\n // If there is a , the center should be the center of the\n // bounding rect of the g.\n if (namedItem.namedFrom != null) {\n return;\n }\n\n var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on\n // `this`, but can only be created each time `load()` called.\n\n regions.push(region); // PENDING: if multiple tag named with the same name, only one will be\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n // by name. We use `region.getCenter()` as the coordinate.\n\n regionsMap.set(namedItem.name, region);\n });\n return {\n regions: regions,\n regionsMap: regionsMap\n };\n} // PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n// * Use the alias in geoNameMap.\n// * The input `named` must not be modified.\n// */\n// function applyNameMap(\n// named: GeoSVGGraphicRecord['named'],\n// nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n// const result = [] as GeoSVGGraphicRecord['named'];\n// for (let i = 0; i < named.length; i++) {\n// let regionGraphic = named[i];\n// const name = regionGraphic.name;\n// if (nameMap && nameMap.hasOwnProperty(name)) {\n// regionGraphic = extend({}, regionGraphic);\n// regionGraphic.name = name;\n// }\n// result.push(regionGraphic);\n// }\n// return result;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parse and decode geo json\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONLineStringGeometry, GeoJSONPolygonGeometry, GeoJSONRegion } from './Region.js';\n\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var jsonCompressed = json;\n var encodeScale = jsonCompressed.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = jsonCompressed.features;\n zrUtil.each(features, function (feature) {\n var geometry = feature.geometry;\n var encodeOffsets = geometry.encodeOffsets;\n var coordinates = geometry.coordinates; // Geometry may be appeded manually in the script after json loaded.\n // In this case this geometry is usually not encoded.\n\n if (!encodeOffsets) {\n return;\n }\n\n switch (geometry.type) {\n case 'LineString':\n geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'Polygon':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'MultiLineString':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'MultiPolygon':\n zrUtil.each(coordinates, function (rings, idx) {\n return decodeRings(rings, encodeOffsets[idx], encodeScale);\n });\n }\n }); // Has been decoded\n\n jsonCompressed.UTF8Encoding = false;\n return jsonCompressed;\n}\n\nfunction decodeRings(rings, encodeOffsets, encodeScale) {\n for (var c = 0; c < rings.length; c++) {\n rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale);\n }\n}\n\nfunction decodeRing(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n\nexport default function parseGeoJSON(geoJson, nameProperty) {\n geoJson = decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var geometries = [];\n\n switch (geo.type) {\n case 'Polygon':\n var coordinates = geo.coordinates; // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n\n geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));\n break;\n\n case 'MultiPolygon':\n zrUtil.each(geo.coordinates, function (item) {\n if (item[0]) {\n geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));\n }\n });\n break;\n\n case 'LineString':\n geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));\n break;\n\n case 'MultiLineString':\n geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));\n }\n\n var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONRegion } from '../Region.js';\nvar geoCoord = [126, 25];\nvar nanhaiName = '南海诸岛';\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\n\nfor (var i = 0; i < points.length; i++) {\n for (var k = 0; k < points[i].length; k++) {\n points[i][k][0] /= 10.5;\n points[i][k][1] /= -10.5 / 0.75;\n points[i][k][0] += geoCoord[0];\n points[i][k][1] += geoCoord[1];\n }\n}\n\nexport default function fixNanhai(mapType, regions) {\n if (mapType === 'china') {\n for (var i = 0; i < regions.length; i++) {\n // Already exists.\n if (regions[i].name === nanhaiName) {\n return;\n }\n }\n\n regions.push(new GeoJSONRegion(nanhaiName, zrUtil.map(points, function (exterior) {\n return {\n type: 'polygon',\n exterior: exterior\n };\n }), geoCoord));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar coordsOffsetMap = {\n '南海诸岛': [32, 80],\n // 全国\n '广东': [0, -10],\n '香港': [10, 5],\n '澳门': [-10, 10],\n // '北京': [-10, 0],\n '天津': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n if (mapType === 'china') {\n var coordFix = coordsOffsetMap[region.name];\n\n if (coordFix) {\n var cp = region.getCenter();\n cp[0] += coordFix[0] / 10.5;\n cp[1] += -coordFix[1] / (10.5 / 0.75);\n region.setCenter(cp);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Fix for 钓鱼岛\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n if (mapType === 'china' && region.name === '台湾') {\n region.geometries.push({\n type: 'polygon',\n exterior: points[0]\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isString, createHashMap, hasOwn } from 'zrender/lib/core/util.js';\nimport parseGeoJson from './parseGeoJson.js'; // Built-in GEO fixer.\n\nimport fixNanhai from './fix/nanhai.js';\nimport fixTextCoord from './fix/textCoord.js';\nimport fixDiaoyuIsland from './fix/diaoyuIsland.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nvar DEFAULT_NAME_PROPERTY = 'name';\n\nvar GeoJSONResource =\n/** @class */\nfunction () {\n function GeoJSONResource(mapName, geoJSON, specialAreas) {\n this.type = 'geoJSON';\n this._parsedMap = createHashMap();\n this._mapName = mapName;\n this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP?\n\n this._geoJSON = parseInput(geoJSON);\n }\n /**\r\n * @param nameMap can be null/undefined\r\n * @param nameProperty can be null/undefined\r\n */\n\n\n GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n\n var parsed = this._parsedMap.get(nameProperty);\n\n if (!parsed) {\n var rawRegions = this._parseToRegions(nameProperty);\n\n parsed = this._parsedMap.set(nameProperty, {\n regions: rawRegions,\n boundingRect: calculateBoundingRect(rawRegions)\n });\n }\n\n var regionsMap = createHashMap();\n var finalRegions = [];\n each(parsed.regions, function (region) {\n var regionName = region.name; // Try use the alias in geoNameMap\n\n if (nameMap && hasOwn(nameMap, regionName)) {\n region = region.cloneShallow(regionName = nameMap[regionName]);\n }\n\n finalRegions.push(region);\n regionsMap.set(regionName, region);\n });\n return {\n regions: finalRegions,\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n regionsMap: regionsMap\n };\n };\n\n GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n var mapName = this._mapName;\n var geoJSON = this._geoJSON;\n var rawRegions; // https://jsperf.com/try-catch-performance-overhead\n\n try {\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n } catch (e) {\n throw new Error('Invalid geoJson format\\n' + e.message);\n }\n\n fixNanhai(mapName, rawRegions);\n each(rawRegions, function (region) {\n var regionName = region.name;\n fixTextCoord(mapName, region);\n fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed\n // to look better\n\n var specialArea = this._specialAreas && this._specialAreas[regionName];\n\n if (specialArea) {\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n }\n }, this);\n return rawRegions;\n };\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\n\n\n GeoJSONResource.prototype.getMapForUser = function () {\n return {\n // For backward compatibility, use geoJson\n // PENDING: it has been returning them without clone.\n // do we need to avoid outsite modification?\n geoJson: this._geoJSON,\n geoJSON: this._geoJSON,\n specialAreas: this._specialAreas\n };\n };\n\n return GeoJSONResource;\n}();\n\nexport { GeoJSONResource };\n\nfunction calculateBoundingRect(regions) {\n var rect;\n\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect();\n rect = rect || regionRect.clone();\n rect.union(regionRect);\n }\n\n return rect;\n}\n\nfunction parseInput(source) {\n return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\nimport { GeoSVGResource } from './GeoSVGResource.js';\nimport { GeoJSONResource } from './GeoJSONResource.js';\nvar storage = createHashMap();\nexport default {\n /**\r\n * Compatible with previous `echarts.registerMap`.\r\n *\r\n * @usage\r\n * ```js\r\n *\r\n * echarts.registerMap('USA', geoJson, specialAreas);\r\n *\r\n * echarts.registerMap('USA', {\r\n * geoJson: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n * echarts.registerMap('USA', {\r\n * geoJSON: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n *\r\n * echarts.registerMap('airport', {\r\n * svg: svg\r\n * }\r\n * ```\r\n *\r\n * Note:\r\n * Do not support that register multiple geoJSON or SVG\r\n * one map name. Because different geoJSON and SVG have\r\n * different unit. It's not easy to make sure how those\r\n * units are mapping/normalize.\r\n * If intending to use multiple geoJSON or SVG, we can\r\n * use multiple geo coordinate system.\r\n */\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\n if (rawDef.svg) {\n var resource = new GeoSVGResource(mapName, rawDef.svg);\n storage.set(mapName, resource);\n } else {\n // Recommend:\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n // Backward compatibility:\n // echarts.registerMap('eu', geoJSON, specialAreas);\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n\n if (geoJSON && !rawDef.features) {\n rawSpecialAreas = rawDef.specialAreas;\n } else {\n geoJSON = rawDef;\n }\n\n var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n storage.set(mapName, resource);\n }\n },\n getGeoResource: function (mapName) {\n return storage.get(mapName);\n },\n\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\n getMapForUser: function (mapName) {\n var resource = storage.get(mapName); // Do not support return SVG until some real requirement come.\n\n return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n },\n load: function (mapName, nameMap, nameProperty) {\n var resource = storage.get(mapName);\n\n if (!resource) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n }\n\n return;\n }\n\n return resource.load(nameMap, nameProperty);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport RoamController from './RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enableComponentHighDownFeatures, setDefaultStateProxy } from '../../util/states.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { getUID } from '../../util/component.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner } from '../../util/model.js';\n/**\r\n * Only these tags enable use `itemStyle` if they are named in SVG.\r\n * Other tags like might not suitable for `itemStyle`.\r\n * They will not be considered to be styled until some requirements come.\r\n */\n\nvar OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'];\nvar OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS);\nvar STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar LABEL_HOST_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar mapLabelRaw = makeInner();\n\nfunction getFixedItemStyle(model) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n} // Only stroke can be used for line.\n// Using fill in style if stroke not exits.\n// TODO Not sure yet. Perhaps a separate `lineStyle`?\n\n\nfunction fixLineStyle(styleHost) {\n var style = styleHost.style;\n\n if (style) {\n style.stroke = style.stroke || style.fill;\n style.fill = null;\n }\n}\n\nvar MapDraw =\n/** @class */\nfunction () {\n function MapDraw(api) {\n var group = new graphic.Group();\n this.uid = getUID('ec_map_draw');\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n this.group = group;\n group.add(this._regionsGroup = new graphic.Group());\n group.add(this._svgGroup = new graphic.Group());\n }\n\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var transformInfo = geo.getTransformInfo();\n var transformInfoRaw = transformInfo.raw;\n var transformInfoRoam = transformInfo.roam; // No animation when first draw or in action\n\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\n\n if (isFirstDraw) {\n group.x = transformInfoRoam.x;\n group.y = transformInfoRoam.y;\n group.scaleX = transformInfoRoam.scaleX;\n group.scaleY = transformInfoRoam.scaleY;\n group.dirty();\n } else {\n graphic.updateProps(group, transformInfoRoam, mapOrGeoModel);\n }\n\n var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0;\n var viewBuildCtx = {\n api: api,\n geo: geo,\n mapOrGeoModel: mapOrGeoModel,\n data: data,\n isVisualEncodedByVisualMap: isVisualEncodedByVisualMap,\n isGeo: isGeo,\n transformInfoRaw: transformInfoRaw\n };\n\n if (geo.resourceType === 'geoJSON') {\n this._buildGeoJSON(viewBuildCtx);\n } else if (geo.resourceType === 'geoSVG') {\n this._buildSVG(viewBuildCtx);\n }\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\n };\n\n MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) {\n var regionsGroupByName = this._regionsGroupByName = zrUtil.createHashMap();\n var regionsInfoByName = zrUtil.createHashMap();\n var regionsGroup = this._regionsGroup;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var projection = viewBuildCtx.geo.projection;\n var projectionStream = projection && projection.stream;\n\n function transformPoint(point, project) {\n if (project) {\n // projection may return null point.\n point = project(point);\n }\n\n return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];\n }\n\n ;\n\n function transformPolygonPoints(inPoints) {\n var outPoints = []; // If projectionStream is provided. Use it instead of single point project.\n\n var project = !projectionStream && projection && projection.project;\n\n for (var i = 0; i < inPoints.length; ++i) {\n var newPt = transformPoint(inPoints[i], project);\n newPt && outPoints.push(newPt);\n }\n\n return outPoints;\n }\n\n function getPolyShape(points) {\n return {\n shape: {\n points: transformPolygonPoints(points)\n }\n };\n }\n\n regionsGroup.removeAll(); // Only when the resource is GeoJSON, there is `geo.regions`.\n\n zrUtil.each(viewBuildCtx.geo.regions, function (region) {\n var regionName = region.name; // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n\n var regionGroup = regionsGroupByName.get(regionName);\n\n var _a = regionsInfoByName.get(regionName) || {},\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n\n if (!regionGroup) {\n regionGroup = regionsGroupByName.set(regionName, new graphic.Group());\n regionsGroup.add(regionGroup);\n dataIdx = data ? data.indexOfName(regionName) : null;\n regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;\n regionsInfoByName.set(regionName, {\n dataIdx: dataIdx,\n regionModel: regionModel\n });\n }\n\n var polygonSubpaths = [];\n var polylineSubpaths = [];\n zrUtil.each(region.geometries, function (geometry) {\n // Polygon and MultiPolygon\n if (geometry.type === 'polygon') {\n var polys = [geometry.exterior].concat(geometry.interiors || []);\n\n if (projectionStream) {\n polys = projectPolys(polys, projectionStream);\n }\n\n zrUtil.each(polys, function (poly) {\n polygonSubpaths.push(new graphic.Polygon(getPolyShape(poly)));\n });\n } // LineString and MultiLineString\n else {\n var points = geometry.points;\n\n if (projectionStream) {\n points = projectPolys(points, projectionStream, true);\n }\n\n zrUtil.each(points, function (points) {\n polylineSubpaths.push(new graphic.Polyline(getPolyShape(points)));\n });\n }\n });\n var centerPt = transformPoint(region.getCenter(), projection && projection.project);\n\n function createCompoundPath(subpaths, isLine) {\n if (!subpaths.length) {\n return;\n }\n\n var compoundPath = new graphic.CompoundPath({\n culling: true,\n segmentIgnoreThreshold: 1,\n shape: {\n paths: subpaths\n }\n });\n regionGroup.add(compoundPath);\n applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);\n resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);\n\n if (isLine) {\n fixLineStyle(compoundPath);\n zrUtil.each(compoundPath.states, fixLineStyle);\n }\n }\n\n createCompoundPath(polygonSubpaths);\n createCompoundPath(polylineSubpaths, true);\n }); // Ensure children have been added to `regionGroup` before calling them.\n\n regionsGroupByName.each(function (regionGroup, regionName) {\n var _a = regionsInfoByName.get(regionName),\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n\n resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n }, this);\n };\n\n MapDraw.prototype._buildSVG = function (viewBuildCtx) {\n var mapName = viewBuildCtx.geo.map;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n this._svgGroup.x = transformInfoRaw.x;\n this._svgGroup.y = transformInfoRaw.y;\n this._svgGroup.scaleX = transformInfoRaw.scaleX;\n this._svgGroup.scaleY = transformInfoRaw.scaleY;\n\n if (this._svgResourceChanged(mapName)) {\n this._freeSVG();\n\n this._useSVG(mapName);\n }\n\n var svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\n var focusSelf = false;\n zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\n // Note that we also allow different elements have the same name.\n // For example, a glyph of a city and the label of the city have\n // the same name and their tooltip info can be defined in a single\n // region option.\n var regionName = namedItem.name;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var svgNodeTagLower = namedItem.svgNodeTagLower;\n var el = namedItem.el;\n var dataIdx = data ? data.indexOfName(regionName) : null;\n var regionModel = mapOrGeoModel.getRegionModel(regionName);\n\n if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {\n applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\n }\n\n if (el instanceof Displayable) {\n el.culling = true;\n } // We do not know how the SVG like so we'd better not to change z2.\n // Otherwise it might bring some unexpected result. For example,\n // an area hovered that make some inner city can not be clicked.\n\n\n el.z2EmphasisLift = 0; // If self named:\n\n if (!namedItem.namedFrom) {\n // label should batter to be displayed based on the center of \n // if it is named rather than displayed on each child.\n if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\n resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);\n }\n\n resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\n var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (focus_1 === 'self') {\n focusSelf = true;\n }\n\n var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\n els.push(el);\n }\n }\n }, this);\n\n this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\n };\n\n MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) {\n // It's a little complicated to support blurring the entire geoSVG in series-map.\n // So do not support it until some requirements come.\n // At present, in series-map, only regions can be blurred.\n if (focusSelf && viewBuildCtx.isGeo) {\n var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); // Only support `opacity` here. Because not sure that other props are suitable for\n // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\n\n var opacity_1 = blurStyle.opacity;\n\n this._svgGraphicRecord.root.traverse(function (el) {\n if (!el.isGroup) {\n // PENDING: clear those settings to SVG elements when `_freeSVG`.\n // (Currently it happen not to be needed.)\n setDefaultStateProxy(el);\n var style = el.ensureState('blur').style || {}; // Do not overwrite the region style that already set from region option.\n\n if (style.opacity == null && opacity_1 != null) {\n style.opacity = opacity_1;\n } // If `ensureState('blur').style = {}`, there will be default opacity.\n // Enable `stateTransition` (animation).\n\n\n el.ensureState('emphasis');\n }\n });\n }\n };\n\n MapDraw.prototype.remove = function () {\n this._regionsGroup.removeAll();\n\n this._regionsGroupByName = null;\n\n this._svgGroup.removeAll();\n\n this._freeSVG();\n\n this._controller.dispose();\n\n this._controllerHost = null;\n };\n\n MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) {\n if (name == null) {\n return [];\n }\n\n var geo = geoModel.coordinateSystem;\n\n if (geo.resourceType === 'geoJSON') {\n var regionsGroupByName = this._regionsGroupByName;\n\n if (regionsGroupByName) {\n var regionGroup = regionsGroupByName.get(name);\n return regionGroup ? [regionGroup] : [];\n }\n } else if (geo.resourceType === 'geoSVG') {\n return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\n }\n };\n\n MapDraw.prototype._svgResourceChanged = function (mapName) {\n return this._svgMapName !== mapName;\n };\n\n MapDraw.prototype._useSVG = function (mapName) {\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n var svgGraphic = resource.useGraphic(this.uid);\n\n this._svgGroup.add(svgGraphic.root);\n\n this._svgGraphicRecord = svgGraphic;\n this._svgMapName = mapName;\n }\n };\n\n MapDraw.prototype._freeSVG = function () {\n var mapName = this._svgMapName;\n\n if (mapName == null) {\n return;\n }\n\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n resource.freeGraphic(this.uid);\n }\n\n this._svgGraphicRecord = null;\n this._svgDispatcherMap = null;\n\n this._svgGroup.removeAll();\n\n this._svgMapName = null;\n };\n\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost; // @ts-ignore FIXME:TS\n\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n // @ts-ignore FIXME:TS\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n };\n /**\r\n * FIXME: this is a temporarily workaround.\r\n * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\r\n * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\r\n * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\r\n * props will have no chance to be restored.\r\n * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in\r\n * `renderSeries` will cache the modified `ignore` to `el._normalState`.\r\n * TODO:\r\n * Use clone/immutable in `LabelManager`?\r\n */\n\n\n MapDraw.prototype.resetForLabelLayout = function () {\n this.group.traverse(function (el) {\n var label = el.getTextContent();\n\n if (label) {\n label.ignore = mapLabelRaw(label).ignore;\n }\n });\n };\n\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\n var mapDraw = this;\n regionsGroup.off('mousedown');\n regionsGroup.off('click'); // @ts-ignore FIXME:TS resolve type conflict\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n });\n }\n };\n\n return MapDraw;\n}();\n\n;\n\nfunction applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {\n // All of the path are using `itemStyle`, because\n // (1) Some SVG also use fill on polyline (The different between\n // polyline and polygon is \"open\" or \"close\" but not fill or not).\n // (2) For the common props like opacity, if some use itemStyle\n // and some use `lineStyle`, it might confuse users.\n // (3) Most SVG use , where can not detect whether to draw a \"line\"\n // or a filled shape, so use `itemStyle` for .\n var normalStyleModel = regionModel.getModel('itemStyle');\n var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\n var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\n var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); // NOTE: DON'T use 'style' in visual when drawing map.\n // This component is used for drawing underlying map for both geo component and map series.\n\n var normalStyle = getFixedItemStyle(normalStyleModel);\n var emphasisStyle = getFixedItemStyle(emphasisStyleModel);\n var selectStyle = getFixedItemStyle(selectStyleModel);\n var blurStyle = getFixedItemStyle(blurStyleModel); // Update the itemStyle if has data visual\n\n var data = viewBuildCtx.data;\n\n if (data) {\n // Only visual color of each item will be used. It can be encoded by visualMap\n // But visual color of series is used in symbol drawing\n // Visual color for each series is for the symbol draw\n var style = data.getItemVisual(dataIndex, 'style');\n var decal = data.getItemVisual(dataIndex, 'decal');\n\n if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\n normalStyle.fill = style.fill;\n }\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\n }\n } // SVG text, tspan and image can be named but not supporeted\n // to be styled by region option yet.\n\n\n el.setStyle(normalStyle);\n el.style.strokeNoScale = true;\n el.ensureState('emphasis').style = emphasisStyle;\n el.ensureState('select').style = selectStyle;\n el.ensureState('blur').style = blurStyle; // Enable blur\n\n setDefaultStateProxy(el);\n}\n\nfunction resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx, // If labelXY not provided, use `textConfig.position: 'inside'`\nlabelXY) {\n var data = viewBuildCtx.data;\n var isGeo = viewBuildCtx.isGeo;\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : regionName;\n var labelFetcher = void 0; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var specifiedTextOpt = labelXY ? {\n normal: {\n align: 'center',\n verticalAlign: 'middle'\n }\n } : null; // Caveat: must be called after `setDefaultStateProxy(el);` called.\n // because textContent will be assign with `el.stateProxy` inside.\n\n setLabelStyle(el, getLabelStatesModels(regionModel), {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: regionName\n }, specifiedTextOpt);\n var textEl = el.getTextContent();\n\n if (textEl) {\n mapLabelRaw(textEl).ignore = textEl.ignore;\n\n if (el.textConfig && labelXY) {\n // Compute a relative offset based on the el bounding rect.\n var rect = el.getBoundingRect().clone(); // Need to make sure the percent position base on the same rect in normal and\n // emphasis state. Otherwise if using boundingRect of el, but the emphasis state\n // has borderWidth (even 0.5px), the text position will be changed obviously\n // if the position is very big like ['1234%', '1345%'].\n\n el.textConfig.layoutRect = rect;\n el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%'];\n }\n } // PENDING:\n // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.\n // But el.dataIndex is also used to determine whether user event should be triggered,\n // where el.seriesIndex or el.dataModel must be specified. At present for a single el\n // there is not case that \"only label layout enabled but user event disabled\", so here\n // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.\n\n\n el.disableLabelAnimation = true;\n } else {\n el.removeTextContent();\n el.removeTextConfig();\n el.disableLabelAnimation = null;\n }\n}\n\nfunction resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx) {\n // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the regionGroup\n if (viewBuildCtx.data) {\n // FIXME: when series-map use a SVG map, and there are duplicated name specified\n // on different SVG elements, after `data.setItemGraphicEl(...)`:\n // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\n // can be triggered only mouse hover. That's correct.\n // (2) only the last element will be kept in `data`, so that if trigger tooltip\n // by `dispatchAction`, only the last one can be found and triggered. That might be\n // not correct. We will fix it in future if anyone demanding that.\n viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\n } // series-map will not trigger \"geoselectchange\" no matter it is\n // based on a declared geo component. Because series-map will\n // trigger \"selectchange\". If it trigger both the two events,\n // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\n // it not easy to also fire event \"geoselectchanged\".\n else {\n // Package custom mouse event for geo component\n getECData(eventTrigger).eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: regionName,\n region: regionModel && regionModel.option || {}\n };\n }\n}\n\nfunction resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n if (!viewBuildCtx.data) {\n graphic.setTooltipConfig({\n el: el,\n componentModel: mapOrGeoModel,\n itemName: regionName,\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n itemTooltipOption: regionModel.get('tooltip')\n });\n }\n}\n\nfunction resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n\n var emphasisModel = regionModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n\n if (viewBuildCtx.isGeo) {\n enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);\n }\n\n return focus;\n}\n\nfunction projectPolys(rings, // Polygons include exterior and interiors. Or polylines.\ncreateStream, isLine) {\n var polygons = [];\n var curPoly;\n\n function startPolygon() {\n curPoly = [];\n }\n\n function endPolygon() {\n if (curPoly.length) {\n polygons.push(curPoly);\n curPoly = [];\n }\n }\n\n var stream = createStream({\n polygonStart: startPolygon,\n polygonEnd: endPolygon,\n lineStart: startPolygon,\n lineEnd: endPolygon,\n point: function (x, y) {\n // May have NaN values from stream.\n if (isFinite(x) && isFinite(y)) {\n curPoly.push([x, y]);\n }\n },\n sphere: function () {}\n });\n !isLine && stream.polygonStart();\n zrUtil.each(rings, function (ring) {\n stream.lineStart();\n\n for (var i = 0; i < ring.length; i++) {\n stream.point(ring[i][0], ring[i][1]);\n }\n\n stream.lineEnd();\n });\n !isLine && stream.polygonEnd();\n return polygons;\n}\n\nexport default MapDraw; // @ts-ignore FIXME:TS fix the \"compatible with each other\"?","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport MapDraw from '../../component/helper/MapDraw.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states.js';\n\nvar MapView =\n/** @class */\nfunction (_super) {\n __extends(MapView, _super);\n\n function MapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapView.type;\n return _this;\n }\n\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\n // Not render if it is an toggleSelect action from self\n if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n return;\n }\n\n var group = this.group;\n group.removeAll();\n\n if (mapModel.getHostGeoModel()) {\n return;\n }\n\n if (this._mapDraw && payload && payload.type === 'geoRoam') {\n this._mapDraw.resetForLabelLayout();\n } // Not update map if it is an roam action from self\n\n\n if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n if (mapModel.needsDrawMap) {\n var mapDraw = this._mapDraw || new MapDraw(api);\n group.add(mapDraw.group);\n mapDraw.draw(mapModel, ecModel, api, this, payload);\n this._mapDraw = mapDraw;\n } else {\n // Remove drawn map\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n }\n } else {\n var mapDraw = this._mapDraw;\n mapDraw && group.add(mapDraw.group);\n }\n\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n };\n\n MapView.prototype.remove = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n this.group.removeAll();\n };\n\n MapView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n };\n\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\n var originalData = mapModel.originalData;\n var group = this.group;\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n if (isNaN(value)) {\n return;\n }\n\n var layout = originalData.getItemLayout(originalDataIndex);\n\n if (!layout || !layout.point) {\n // Not exists in map\n return;\n }\n\n var point = layout.point;\n var offset = layout.offset;\n var circle = new graphic.Circle({\n style: {\n // Because the special of map draw.\n // Which needs statistic of multiple series and draw on one map.\n // And each series also need a symbol with legend color\n //\n // Layout and visual are put one the different data\n // TODO\n fill: mapModel.getData().getVisual('style').fill\n },\n shape: {\n cx: point[0] + offset * 9,\n cy: point[1],\n r: 3\n },\n silent: true,\n // Do not overlap the first series, on which labels are displayed.\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\n }); // Only the series that has the first value on the same region is in charge of rendering the label.\n // But consider the case:\n // series: [\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n // ]\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n // For backward compatibility, we follow the rule that render label `A` by the\n // settings on series `X` but render label `C` by the settings on series `Y`.\n\n if (!offset) {\n var fullData = mapModel.mainSeries.getData();\n var name_1 = originalData.getName(originalDataIndex);\n var fullIndex_1 = fullData.indexOfName(name_1);\n var itemModel = originalData.getItemModel(originalDataIndex);\n var labelModel = itemModel.getModel('label');\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1); // `getFormattedLabel` needs to use `getData` inside. Here\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n // FIXME\n // If this is not the `mainSeries`, the item model (like label formatter)\n // set on original data item will never get. But it has been working\n // like that from the beginning, and this scenario is rarely encountered.\n // So it won't be fixed until we have to.\n\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (idx, state) {\n return mapModel.getFormattedLabel(fullIndex_1, state);\n }\n },\n defaultText: name_1\n });\n circle.disableLabelAnimation = true;\n\n if (!labelModel.get('position')) {\n circle.setTextConfig({\n position: 'bottom'\n });\n }\n\n regionGroup.onHoverStateChange = function (toState) {\n setStatesFlag(circle, toState);\n };\n }\n\n group.add(circle);\n });\n };\n\n MapView.type = 'map';\n return MapView;\n}(ChartView);\n\nexport default MapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { createSymbol } from '../../util/symbol.js';\n\nvar MapSeries =\n/** @class */\nfunction (_super) {\n __extends(MapSeries, _super);\n\n function MapSeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapSeries.type; // Only first map series of same mapType will drawMap.\n\n _this.needsDrawMap = false; // Group of all map series with same mapType\n\n _this.seriesGroup = [];\n\n _this.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var name_1 = this.getData().getName(dataIndex);\n var geo = this.coordinateSystem;\n var region = geo.getRegion(name_1);\n return region && geo.dataToPoint(region.getCenter());\n }\n };\n\n return _this;\n }\n\n MapSeries.prototype.getInitialData = function (option) {\n var data = createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n var dataNameMap = zrUtil.createHashMap();\n var toAppendNames = [];\n\n for (var i = 0, len = data.count(); i < len; i++) {\n var name_2 = data.getName(i);\n dataNameMap.set(name_2, true);\n }\n\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\n zrUtil.each(geoSource.regions, function (region) {\n var name = region.name;\n\n if (!dataNameMap.get(name)) {\n toAppendNames.push(name);\n }\n }); // Complete data with missing regions. The consequent processes (like visual\n // map and render) can not be performed without a \"full data\". For example,\n // find `dataIndex` by name.\n\n data.appendValues([], toAppendNames);\n return data;\n };\n /**\r\n * If no host geo model, return null, which means using a\r\n * inner exclusive geo model.\r\n */\n\n\n MapSeries.prototype.getHostGeoModel = function () {\n var geoIndex = this.option.geoIndex;\n return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null;\n };\n\n MapSeries.prototype.getMapType = function () {\n return (this.getHostGeoModel() || this).option.map;\n }; // _fillOption(option, mapName) {\n // Shallow clone\n // option = zrUtil.extend({}, option);\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n // return option;\n // }\n\n\n MapSeries.prototype.getRawValue = function (dataIndex) {\n // Use value stored in data instead because it is calculated from multiple series\n // FIXME Provide all value of multiple series ?\n var data = this.getData();\n return data.get(data.mapDimension('value'), dataIndex);\n };\n /**\r\n * Get model of region\r\n */\n\n\n MapSeries.prototype.getRegionModel = function (regionName) {\n var data = this.getData();\n return data.getItemModel(data.indexOfName(regionName));\n };\n /**\r\n * Map tooltip formatter\r\n */\n\n\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // FIXME orignalData and data is a bit confusing\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n var seriesGroup = this.seriesGroup;\n var seriesNames = [];\n\n for (var i = 0; i < seriesGroup.length; i++) {\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n var valueDim = data.mapDimension('value');\n\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n seriesNames.push(seriesGroup[i].name);\n }\n }\n\n return createTooltipMarkup('section', {\n header: seriesNames.join(', '),\n noHeader: !seriesNames.length,\n blocks: [createTooltipMarkup('nameValue', {\n name: name,\n value: value\n })]\n });\n };\n\n MapSeries.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n MapSeries.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n MapSeries.prototype.getLegendIcon = function (opt) {\n var iconType = opt.icon || 'roundRect';\n var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill);\n icon.setStyle(opt.itemStyle); // Map do not use itemStyle.borderWidth as border width\n\n icon.style.stroke = 'none'; // No rotation because no series visual symbol for map\n\n if (iconType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n\n return icon;\n };\n\n MapSeries.type = 'series.map';\n MapSeries.dependencies = ['geo'];\n MapSeries.layoutMode = 'box';\n MapSeries.defaultOption = {\n // 一级层叠\n // zlevel: 0,\n // 二级层叠\n z: 2,\n coordinateSystem: 'geo',\n // map should be explicitly specified since ec3.\n map: '',\n // If `geoIndex` is not specified, a exclusive geo will be\n // created. Otherwise use the specified geo component, and\n // `map` and `mapType` are ignored.\n // geoIndex: 0,\n // 'center' | 'left' | 'right' | 'x%' | {number}\n left: 'center',\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\n top: 'center',\n // right\n // bottom\n // width:\n // height\n // Aspect is width / height. Inited to be geoJson bbox aspect\n // This parameter is used for scale this aspect\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient.\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n showLegendSymbol: true,\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ],\n // higher priority than center and zoom\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n selectedMode: true,\n label: {\n show: false,\n color: '#000'\n },\n // scaleLimit: null,\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444',\n areaColor: '#eee'\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n areaColor: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n nameProperty: 'name'\n };\n return MapSeries;\n}(SeriesModel);\n\nexport default MapSeries;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // FIXME 公用?\n\nfunction dataStatistics(datas, statisticType) {\n var dataNameMap = {};\n zrUtil.each(datas, function (data) {\n data.each(data.mapDimension('value'), function (value, idx) {\n // Add prefix to avoid conflict with Object.prototype.\n var mapKey = 'ec-' + data.getName(idx);\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n\n if (!isNaN(value)) {\n dataNameMap[mapKey].push(value);\n }\n });\n });\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n var mapKey = 'ec-' + datas[0].getName(idx);\n var sum = 0;\n var min = Infinity;\n var max = -Infinity;\n var len = dataNameMap[mapKey].length;\n\n for (var i = 0; i < len; i++) {\n min = Math.min(min, dataNameMap[mapKey][i]);\n max = Math.max(max, dataNameMap[mapKey][i]);\n sum += dataNameMap[mapKey][i];\n }\n\n var result;\n\n if (statisticType === 'min') {\n result = min;\n } else if (statisticType === 'max') {\n result = max;\n } else if (statisticType === 'average') {\n result = sum / len;\n } else {\n result = sum;\n }\n\n return len === 0 ? NaN : result;\n });\n}\n\nexport default function mapDataStatistic(ecModel) {\n var seriesGroups = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var hostGeoModel = seriesModel.getHostGeoModel();\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n });\n zrUtil.each(seriesGroups, function (seriesList, key) {\n var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n return seriesModel.getData();\n }), seriesList[0].get('mapValueCalculation'));\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].originalData = seriesList[i].getData();\n } // FIXME Put where?\n\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].seriesGroup = seriesList;\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n seriesList[i].setData(data.cloneShallow());\n seriesList[i].mainSeries = seriesList[0];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function mapSymbolLayout(ecModel) {\n var processedMapType = {};\n ecModel.eachSeriesByType('map', function (mapSeries) {\n var mapType = mapSeries.getMapType();\n\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n return;\n }\n\n var mapSymbolOffsets = {};\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n var geo = subMapSeries.coordinateSystem;\n var data = subMapSeries.originalData;\n\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n data.each(data.mapDimension('value'), function (value, idx) {\n var name = data.getName(idx);\n var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44],\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n // not be drawn. So here must validate if value is NaN.\n\n if (!region || isNaN(value)) {\n return;\n }\n\n var offset = mapSymbolOffsets[name] || 0;\n var point = geo.dataToPoint(region.getCenter());\n mapSymbolOffsets[name] = offset + 1;\n data.setItemLayout(idx, {\n point: point,\n offset: offset\n });\n });\n }\n }); // Show label of those region not has legendIcon (which is offset 0)\n\n var data = mapSeries.getData();\n data.each(function (idx) {\n var name = data.getName(idx);\n var layout = data.getItemLayout(idx) || {};\n layout.showLabel = !mapSymbolOffsets[name];\n data.setItemLayout(idx, layout);\n });\n processedMapType[mapType] = true;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Simple view coordinate system\r\n * Mapping given x, y to transformd view x, y\r\n */\n\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { parsePercent } from '../util/number.js';\nvar v2ApplyTransform = vector.applyTransform;\n\nvar View =\n/** @class */\nfunction (_super) {\n __extends(View, _super);\n\n function View(name) {\n var _this = _super.call(this) || this;\n\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\r\n * Represents the transform brought by roam/zoom.\r\n * If `View['_viewRect']` applies roam transform,\r\n * we can get the final displayed rect.\r\n */\n\n _this._roamTransformable = new Transformable();\n /**\r\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\r\n */\n\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\r\n * @return {module:zrender/core/BoundingRect}\r\n */\n\n\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\r\n * Transformed to particular position and size\r\n */\n\n\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n\n this._updateTransform();\n };\n /**\r\n * Set center of view\r\n */\n\n\n View.prototype.setCenter = function (centerCoord, api) {\n if (!centerCoord) {\n return;\n }\n\n this._center = [parsePercent(centerCoord[0], api.getWidth()), parsePercent(centerCoord[1], api.getHeight())];\n\n this._updateCenterAndZoom();\n };\n\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n\n this._zoom = zoom;\n\n this._updateCenterAndZoom();\n };\n /**\r\n * Get default center without roam\r\n */\n\n\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\r\n * Remove roam\r\n */\n\n\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n\n this._updateTransform();\n };\n /**\r\n * Update transform props on `this` based on the current\r\n * `this._roamTransformable` and `this._rawTransformable`.\r\n */\n\n\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable; // Because roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalculate them.\n\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\r\n * Get view rect after roam transform\r\n */\n\n\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\r\n * Convert a single (lon, lat) data item to (x, y) point.\r\n */\n\n\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\r\n * Convert a (x, y) point to (lon, lat) data\r\n */\n\n\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\r\n * @implements\r\n */\n\n\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var projection = opt.projection;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n var resourceType = _this.resourceType = resource ? resource.type : null;\n var regions = _this.regions = source.regions;\n var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this.regions = source.regions;\n\n if (process.env.NODE_ENV !== 'production' && projection) {\n // Do some check\n if (resourceType === 'geoSVG') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n }\n\n projection = null;\n }\n\n if (!(projection.project && projection.unproject)) {\n if (process.env.NODE_ENV !== 'production') {\n warn('project and unproject must be both provided in the projeciton.');\n }\n\n projection = null;\n }\n }\n\n _this.projection = projection;\n var boundingRect;\n\n if (projection) {\n // Can't reuse the raw bounding rect\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect(projection);\n boundingRect = boundingRect || regionRect.clone();\n boundingRect.union(regionRect);\n }\n } else {\n boundingRect = source.boundingRect;\n }\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection.\n // So we ignore them if projection is given.\n // Ignore default aspect scale if projection exits.\n\n\n _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitude if projection exits.\n\n _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n return _this;\n }\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitude is inverted.\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\r\n * Add geoCoord for indexing by name\r\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\r\n * Get geoCoord by name\r\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // Calculate center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (zrUtil.isString(data)) {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n data = projection.project(data);\n }\n\n return data && this.projectedToPoint(data, noRoam, out);\n }\n };\n\n Geo.prototype.pointToData = function (point) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n point = projection.unproject(point);\n }\n\n return point && this.pointToProjected(point);\n };\n /**\r\n * Point to projected data. Same with pointToData when projection is used.\r\n */\n\n\n Geo.prototype.pointToProjected = function (point) {\n return _super.prototype.pointToData.call(this, point);\n };\n\n Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Geo, { geo2DDimensions } from './Geo.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport * as vector from 'zrender/lib/core/vector.js';\n/**\r\n * Resize method bound to the geo\r\n */\n\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n\n if (boundingCoords != null) {\n var leftTop_1 = boundingCoords[0];\n var rightBottom_1 = boundingCoords[1];\n\n if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\n var projection_1 = this.projection;\n\n if (projection_1) {\n var xMin = leftTop_1[0];\n var yMin = leftTop_1[1];\n var xMax = rightBottom_1[0];\n var yMax = rightBottom_1[1];\n leftTop_1 = [Infinity, Infinity];\n rightBottom_1 = [-Infinity, -Infinity]; // TODO better way?\n\n var sampleLine = function (x0, y0, x1, y1) {\n var dx = x1 - x0;\n var dy = y1 - y0;\n\n for (var i = 0; i <= 100; i++) {\n var p = i / 100;\n var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\n vector.min(leftTop_1, leftTop_1, pt);\n vector.max(rightBottom_1, rightBottom_1, pt);\n }\n }; // Top\n\n\n sampleLine(xMin, yMin, xMax, yMin); // Right\n\n sampleLine(xMax, yMin, xMax, yMax); // Bottom\n\n sampleLine(xMax, yMax, xMin, yMax); // Left\n\n sampleLine(xMin, yMax, xMax, yMin);\n }\n\n this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\n }\n }\n\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n\n var viewRect;\n\n if (useCenterAndSize) {\n viewRect = {};\n\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'), api);\n this.setZoom(geoModel.get('zoom'));\n} // Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\n\n\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\n\nvar GeoCreator =\n/** @class */\nfunction () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = geo2DDimensions;\n }\n\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = [];\n\n function getCommonGeoProperties(model) {\n return {\n nameProperty: model.get('nameProperty'),\n aspectScale: model.get('aspectScale'),\n projection: model.get('projection')\n };\n } // FIXME Create each time may be slow\n\n\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var mapName = geoModel.get('map');\n var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\n nameMap: geoModel.get('nameMap')\n }, getCommonGeoProperties(geoModel)));\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo); // setGeoCoords(geo, geoModel);\n\n geoModel.coordinateSystem = geo;\n geo.model = geoModel; // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n }); // If has map series\n\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, zrUtil.extend({\n nameMap: zrUtil.mergeAll(nameMapList)\n }, getCommonGeoProperties(mapSeries[0])));\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo); // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\r\n * Fill given regions array\r\n */\n\n\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n\n return GeoCreator;\n}();\n\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport Model from '../../model/Model.js';\nimport geoCreator from './geoCreator.js';\nimport geoSourceManager from './geoSourceManager.js';\n;\n\nvar GeoModel =\n/** @class */\nfunction (_super) {\n __extends(GeoModel, _super);\n\n function GeoModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoModel.type;\n return _this;\n }\n\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\n var source = geoSourceManager.getGeoResource(option.map);\n\n if (source && source.type === 'geoJSON') {\n var itemStyle = option.itemStyle = option.itemStyle || {};\n\n if (!('color' in itemStyle)) {\n itemStyle.color = '#eee';\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n };\n\n GeoModel.prototype.optionUpdated = function () {\n var _this = this;\n\n var option = this.option;\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n var selectedMap = {};\n this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n var regionName = regionOpt.name;\n\n if (regionName) {\n optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n\n if (regionOpt.selected) {\n selectedMap[regionName] = true;\n }\n }\n\n return optionModelMap;\n }, zrUtil.createHashMap());\n\n if (!option.selectedMap) {\n option.selectedMap = selectedMap;\n }\n };\n /**\r\n * Get model of region.\r\n */\n\n\n GeoModel.prototype.getRegionModel = function (name) {\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n };\n /**\r\n * Format label\r\n * @param name Region name\r\n */\n\n\n GeoModel.prototype.getFormattedLabel = function (name, status) {\n var regionModel = this.getRegionModel(name);\n var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n var params = {\n name: name\n };\n\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n return formatter.replace('{a}', name != null ? name : '');\n }\n };\n\n GeoModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GeoModel.prototype.setCenter = function (center) {\n this.option.center = center;\n }; // PENGING If selectedMode is null ?\n\n\n GeoModel.prototype.select = function (name) {\n var option = this.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n if (selectedMode !== 'multiple') {\n option.selectedMap = null;\n }\n\n var selectedMap = option.selectedMap || (option.selectedMap = {});\n selectedMap[name] = true;\n };\n\n GeoModel.prototype.unSelect = function (name) {\n var selectedMap = this.option.selectedMap;\n\n if (selectedMap) {\n selectedMap[name] = false;\n }\n };\n\n GeoModel.prototype.toggleSelected = function (name) {\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n };\n\n GeoModel.prototype.isSelected = function (name) {\n var selectedMap = this.option.selectedMap;\n return !!(selectedMap && selectedMap[name]);\n };\n\n GeoModel.type = 'geo';\n GeoModel.layoutMode = 'box';\n GeoModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n show: true,\n left: 'center',\n top: 'center',\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // /// Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n silent: false,\n // Map type\n map: '',\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ]\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n // selectedMode: false\n label: {\n show: false,\n color: '#000'\n },\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444' // Default color:\n // + geoJSON: #eee\n // + geoSVG: null (use SVG original `fill`)\n // color: '#eee'\n\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n regions: [] // tooltip: {\n // show: false\n // }\n\n };\n return GeoModel;\n}(ComponentModel);\n\nexport default GeoModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction getCenterCoord(view, point) {\n // Use projected coord as center because it's linear.\n return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);\n}\n\nexport function updateCenterAndZoom(view, payload, zoomLimit, api) {\n var previousZoom = view.getZoom();\n var center = view.getCenter();\n var zoom = payload.zoom;\n var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);\n\n if (payload.dx != null && payload.dy != null) {\n point[0] -= payload.dx;\n point[1] -= payload.dy;\n view.setCenter(getCenterCoord(view, point), api);\n }\n\n if (zoom != null) {\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\n } // Zoom on given point(originX, originY)\n\n\n view.scaleX *= zoom;\n view.scaleY *= zoom;\n var fixX = (payload.originX - view.x) * (zoom - 1);\n var fixY = (payload.originY - view.y) * (zoom - 1);\n view.x -= fixX;\n view.y -= fixY;\n view.updateTransform(); // Get the new center\n\n view.setCenter(getCenterCoord(view, point), api);\n view.setZoom(zoom * previousZoom);\n }\n\n return {\n center: view.getCenter(),\n zoom: view.getZoom()\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MapDraw from '../helper/MapDraw.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { findEventDispatcher } from '../../util/event.js';\n\nvar GeoView =\n/** @class */\nfunction (_super) {\n __extends(GeoView, _super);\n\n function GeoView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoView.type;\n _this.focusBlurEnabled = true;\n return _this;\n }\n\n GeoView.prototype.init = function (ecModel, api) {\n this._api = api;\n };\n\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\n this._model = geoModel;\n\n if (!geoModel.get('show')) {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n return;\n }\n\n if (!this._mapDraw) {\n this._mapDraw = new MapDraw(api);\n }\n\n var mapDraw = this._mapDraw;\n mapDraw.draw(geoModel, ecModel, api, this, payload);\n mapDraw.group.on('click', this._handleRegionClick, this);\n mapDraw.group.silent = geoModel.get('silent');\n this.group.add(mapDraw.group);\n this.updateSelectStatus(geoModel, ecModel, api);\n };\n\n GeoView.prototype._handleRegionClick = function (e) {\n var eventData;\n findEventDispatcher(e.target, function (current) {\n return (eventData = getECData(current).eventData) != null;\n }, true);\n\n if (eventData) {\n this._api.dispatchAction({\n type: 'geoToggleSelect',\n geoId: this._model.id,\n name: eventData.name\n });\n }\n };\n\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\n var _this = this;\n\n this._mapDraw.group.traverse(function (node) {\n var eventData = getECData(node).eventData;\n\n if (eventData) {\n _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); // No need to traverse children.\n\n return true;\n }\n });\n };\n\n GeoView.prototype.findHighDownDispatchers = function (name) {\n return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\n };\n\n GeoView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n };\n\n GeoView.type = 'geo';\n return GeoView;\n}(ComponentView);\n\nexport default GeoView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport GeoModel from '../../coord/geo/GeoModel.js';\nimport geoCreator from '../../coord/geo/geoCreator.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport GeoView from './GeoView.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\n\nfunction registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\n\nexport function install(registers) {\n registers.registerCoordinateSystem('geo', geoCreator);\n registers.registerComponentModel(GeoModel);\n registers.registerComponentView(GeoView);\n registers.registerImpl('registerMap', registerMap);\n registers.registerImpl('getMap', function (mapName) {\n return geoSourceManager.getMapForUser(mapName);\n });\n\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n each(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n }); // Notice: there might be duplicated name in different regions.\n\n var names = [];\n each(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\n\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel, api) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'), api);\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport MapView from './MapView.js';\nimport MapSeries from './MapSeries.js';\nimport mapDataStatistic from './mapDataStatistic.js';\nimport mapSymbolLayout from './mapSymbolLayout.js';\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport { install as installGeo } from '../../component/geo/install.js';\nexport function install(registers) {\n use(installGeo);\n registers.registerChartView(MapView);\n registers.registerSeriesModel(MapSeries);\n registers.registerLayout(mapSymbolLayout);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\n createLegacyDataSelectAction('map', registers.registerAction);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The tree layoutHelper implementation was originally copied from\r\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\r\n* some modifications made for this project.\r\n* (see more details in the comment of the specific method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\n\n/**\r\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\r\n * the tree.\r\n */\nimport * as layout from '../../util/layout.js';\n/**\r\n * Initialize all computational message for following algorithm.\r\n */\n\nexport function init(inRoot) {\n var root = inRoot;\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n\n if (node.isExpand && children.length) {\n var n = children.length;\n\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes a preliminary x coordinate for node. Before that, this function is\r\n * applied recursively to the children of node, as well as the function\r\n * apportion(). After spacing out the children by calling executeShifts(), the\r\n * node is placed to the midpoint of its outermost children.\r\n */\n\nexport function firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes all real x-coordinates by summing up the modifiers recursively.\r\n */\n\nexport function secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\nexport function separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\r\n * Transform the common coordinate to radial coordinate.\r\n */\n\nexport function radialCoordinate(rad, r) {\n rad -= Math.PI / 2;\n return {\n x: r * Math.cos(rad),\n y: r * Math.sin(rad)\n };\n}\n/**\r\n * Get the layout position of the whole view.\r\n */\n\nexport function getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\r\n * All other shifts, applied to the smaller subtrees between w- and w+, are\r\n * performed by this function.\r\n *\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * The core of the algorithm. Here, a new subtree is combined with the\r\n * previous subtrees. Threads are used to traverse the inside and outside\r\n * contours of the left and right subtree up to the highest common level.\r\n * Whenever two nodes of the inside contours conflict, we compute the left\r\n * one of the greatest uncommon ancestors using the function nextAncestor()\r\n * and call moveSubtree() to shift the subtree and prepare the shifts of\r\n * smaller subtrees. Finally, we add a new thread (if necessary).\r\n */\n\n\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n\n return ancestor;\n}\n/**\r\n * This function is used to traverse the right contour of a subtree.\r\n * It returns the rightmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\n\n\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\r\n * This function is used to traverse the left contour of a subtree (or a subforest).\r\n * It returns the leftmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\n\n\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\r\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\r\n * Otherwise, returns the specified ancestor.\r\n */\n\n\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Shifts the current subtree rooted at wr.\r\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\r\n */\n\n\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\n\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport { radialCoordinate } from './layoutHelper.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport View from '../../coord/View.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport { parsePercent } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states.js';\n\nvar TreeEdgeShape =\n/** @class */\nfunction () {\n function TreeEdgeShape() {\n this.parentPoint = [];\n this.childPoints = [];\n }\n\n return TreeEdgeShape;\n}();\n\nvar TreePath =\n/** @class */\nfunction (_super) {\n __extends(TreePath, _super);\n\n function TreePath(opts) {\n return _super.call(this, opts) || this;\n }\n\n TreePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n TreePath.prototype.getDefaultShape = function () {\n return new TreeEdgeShape();\n };\n\n TreePath.prototype.buildPath = function (ctx, shape) {\n var childPoints = shape.childPoints;\n var childLen = childPoints.length;\n var parentPoint = shape.parentPoint;\n var firstChildPos = childPoints[0];\n var lastChildPos = childPoints[childLen - 1];\n\n if (childLen === 1) {\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\n return;\n }\n\n var orient = shape.orient;\n var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;\n var otherDim = 1 - forkDim;\n var forkPosition = parsePercent(shape.forkPosition, 1);\n var tmpPoint = [];\n tmpPoint[forkDim] = parentPoint[forkDim];\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\n tmpPoint[forkDim] = firstChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n tmpPoint[forkDim] = lastChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\n\n for (var i = 1; i < childLen - 1; i++) {\n var point = childPoints[i];\n ctx.moveTo(point[0], point[1]);\n tmpPoint[forkDim] = point[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n }\n };\n\n return TreePath;\n}(Path);\n\nvar TreeView =\n/** @class */\nfunction (_super) {\n __extends(TreeView, _super);\n\n function TreeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreeView.type;\n _this._mainGroup = new graphic.Group();\n return _this;\n }\n\n TreeView.prototype.init = function (ecModel, api) {\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: this.group\n };\n this.group.add(this._mainGroup);\n };\n\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var layoutInfo = seriesModel.layoutInfo;\n var group = this._mainGroup;\n var layout = seriesModel.get('layout');\n\n if (layout === 'radial') {\n group.x = layoutInfo.x + layoutInfo.width / 2;\n group.y = layoutInfo.y + layoutInfo.height / 2;\n } else {\n group.x = layoutInfo.x;\n group.y = layoutInfo.y;\n }\n\n this._updateViewCoordSys(seriesModel, api);\n\n this._updateController(seriesModel, ecModel, api);\n\n var oldData = this._data;\n data.diff(oldData).add(function (newIdx) {\n if (symbolNeedsDraw(data, newIdx)) {\n // Create node and edge\n updateNode(data, newIdx, null, group, seriesModel);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n\n if (!symbolNeedsDraw(data, newIdx)) {\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n return;\n } // Update node and edge\n\n\n updateNode(data, newIdx, symbolEl, group, seriesModel);\n }).remove(function (oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed\n // node haven't been initialized with a symbol element,\n // you can't found it's symbol element through index.\n // so if we want to remove the symbol element we should insure\n // that the symbol element is not null.\n\n if (symbolEl) {\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n }\n }).execute();\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n\n this._updateNodeAndLinkScale(seriesModel);\n\n if (seriesModel.get('expandAndCollapse') === true) {\n data.eachItemGraphicEl(function (el, dataIndex) {\n el.off('click').on('click', function () {\n api.dispatchAction({\n type: 'treeExpandAndCollapse',\n seriesId: seriesModel.id,\n dataIndex: dataIndex\n });\n });\n });\n }\n\n this._data = data;\n };\n\n TreeView.prototype._updateViewCoordSys = function (seriesModel, api) {\n var data = seriesModel.getData();\n var points = [];\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n points.push([+layout.x, +layout.y]);\n }\n });\n var min = [];\n var max = [];\n bbox.fromPoints(points, min, max); // If don't Store min max when collapse the root node after roam,\n // the root node will disappear.\n\n var oldMin = this._min;\n var oldMax = this._max; // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\n }\n\n if (max[1] - min[1] === 0) {\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\n }\n\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\n\n this.group.attr({\n x: viewCoordSys.x,\n y: viewCoordSys.y,\n scaleX: viewCoordSys.scaleX,\n scaleY: viewCoordSys.scaleY\n });\n this._min = min;\n this._max = max;\n };\n\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale(seriesModel); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\n var data = seriesModel.getData();\n\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n\n data.eachItemGraphicEl(function (el, idx) {\n el.setSymbolScale(nodeScale);\n });\n };\n\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupZoom = coordSys.scaleX || 1; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n };\n\n TreeView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n TreeView.prototype.remove = function () {\n this._mainGroup.removeAll();\n\n this._data = null;\n };\n\n TreeView.type = 'tree';\n return TreeView;\n}(ChartView);\n\nfunction symbolNeedsDraw(data, dataIndex) {\n var layout = data.getItemLayout(dataIndex);\n return layout && !isNaN(layout.x) && !isNaN(layout.y);\n}\n\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\n var isInit = !symbolEl;\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var itemModel = node.getModel();\n var visualColor = node.getVisual('style').fill;\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff';\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceLayout = source.getLayout();\n var sourceOldLayout = sourceSymbolEl ? {\n x: sourceSymbolEl.__oldX,\n y: sourceSymbolEl.__oldY,\n rawX: sourceSymbolEl.__radialOldRawX,\n rawY: sourceSymbolEl.__radialOldRawY\n } : sourceLayout;\n var targetLayout = node.getLayout();\n\n if (isInit) {\n symbolEl = new SymbolClz(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n symbolEl.x = sourceOldLayout.x;\n symbolEl.y = sourceOldLayout.y;\n } else {\n symbolEl.updateData(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n }\n\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n symbolEl.__radialRawX = targetLayout.rawX;\n symbolEl.__radialRawY = targetLayout.rawY;\n group.add(symbolEl);\n data.setItemGraphicEl(dataIndex, symbolEl);\n symbolEl.__oldX = symbolEl.x;\n symbolEl.__oldY = symbolEl.y;\n graphic.updateProps(symbolEl, {\n x: targetLayout.x,\n y: targetLayout.y\n }, seriesModel);\n var symbolPath = symbolEl.getSymbolPath();\n\n if (seriesModel.get('layout') === 'radial') {\n var realRoot = virtualRoot.children[0];\n var rootLayout = realRoot.getLayout();\n var length_1 = realRoot.children.length;\n var rad = void 0;\n var isLeft = void 0;\n\n if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {\n var center = {\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\n };\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n isLeft = center.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n isLeft = targetLayout.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n isLeft = targetLayout.x > rootLayout.x;\n\n if (!isLeft) {\n rad = rad - Math.PI;\n }\n }\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n var normalLabelModel = itemModel.getModel('label');\n var rotate = normalLabelModel.get('rotate');\n var labelRotateRadian = rotate * (Math.PI / 180);\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n symbolPath.setTextConfig({\n position: normalLabelModel.get('position') || textPosition,\n rotation: rotate == null ? -rad : labelRotateRadian,\n origin: 'center'\n });\n textContent.setStyle('verticalAlign', 'middle');\n }\n } // Handle status\n\n\n var focus = itemModel.get(['emphasis', 'focus']);\n var focusDataIndices = focus === 'relative' ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null;\n\n if (focusDataIndices) {\n // Modify the focus to data indices.\n getECData(symbolEl).focus = focusDataIndices;\n }\n\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\n\n if (symbolEl.__edge) {\n symbolEl.onHoverStateChange = function (toState) {\n if (toState !== 'blur') {\n // NOTE: Ensure the parent elements will been blurred firstly.\n // According to the return of getAncestorsIndices and getDescendantIndices\n // TODO: A bit tricky.\n var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);\n\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\n setStatesFlag(symbolEl.__edge, toState);\n }\n }\n };\n }\n}\n\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\n var itemModel = node.getModel();\n var edgeShape = seriesModel.get('edgeShape');\n var layout = seriesModel.get('layout');\n var orient = seriesModel.getOrient();\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n var edge = symbolEl.__edge; // curve edge from node -> parent\n // polyline edge from node -> children\n\n if (edgeShape === 'curve') {\n if (node.parentNode && node.parentNode !== virtualRoot) {\n if (!edge) {\n edge = symbolEl.__edge = new graphic.BezierCurve({\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\n });\n }\n\n graphic.updateProps(edge, {\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\n }, seriesModel);\n }\n } else if (edgeShape === 'polyline') {\n if (layout === 'orthogonal') {\n if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {\n var children = node.children;\n var childPoints = [];\n\n for (var i = 0; i < children.length; i++) {\n var childLayout = children[i].getLayout();\n childPoints.push([childLayout.x, childLayout.y]);\n }\n\n if (!edge) {\n edge = symbolEl.__edge = new TreePath({\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: [[targetLayout.x, targetLayout.y]],\n orient: orient,\n forkPosition: edgeForkPosition\n }\n });\n }\n\n graphic.updateProps(edge, {\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: childPoints\n }\n }, seriesModel);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\n }\n }\n } // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'\n\n\n if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {\n edge.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: null\n }, lineStyle));\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\n setDefaultStateProxy(edge);\n group.add(edge);\n }\n}\n\nfunction removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) {\n var virtualRoot = data.tree.root;\n\n var _a = getSourceNode(virtualRoot, node),\n source = _a.source,\n sourceLayout = _a.sourceLayout;\n\n var symbolEl = data.getItemGraphicEl(node.dataIndex);\n\n if (!symbolEl) {\n return;\n }\n\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceEdge = sourceSymbolEl.__edge; // 1. when expand the sub tree, delete the children node should delete the edge of\n // the source at the same time. because the polyline edge shape is only owned by the source.\n // 2.when the node is the only children of the source, delete the node should delete the edge of\n // the source at the same time. the same reason as above.\n\n var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);\n var edgeShape = seriesModel.get('edgeShape');\n var layoutOpt = seriesModel.get('layout');\n var orient = seriesModel.get('orient');\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n\n if (edge) {\n if (edgeShape === 'curve') {\n graphic.removeElement(edge, {\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\n graphic.removeElement(edge, {\n shape: {\n parentPoint: [sourceLayout.x, sourceLayout.y],\n childPoints: [[sourceLayout.x, sourceLayout.y]]\n },\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n }\n }\n}\n\nfunction getSourceNode(virtualRoot, node) {\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceLayout;\n\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n }\n\n return {\n source: source,\n sourceLayout: sourceLayout\n };\n}\n\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var virtualRoot = data.tree.root;\n var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout; // Use same duration and easing with update to have more consistent animation.\n\n var removeAnimationOpt = {\n duration: seriesModel.get('animationDurationUpdate'),\n easing: seriesModel.get('animationEasingUpdate')\n };\n graphic.removeElement(symbolEl, {\n x: sourceLayout.x + 1,\n y: sourceLayout.y + 1\n }, seriesModel, {\n cb: function () {\n group.remove(symbolEl);\n data.setItemGraphicEl(dataIndex, null);\n },\n removeOpt: removeAnimationOpt\n });\n symbolEl.fadeOut(null, data.hostModel, {\n fadeLabel: true,\n animation: removeAnimationOpt\n }); // remove edge as parent node\n\n node.children.forEach(function (childNode) {\n removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);\n }); // remove edge as child node\n\n removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);\n}\n\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n var x1;\n var x2;\n var y1;\n var y2;\n\n if (layoutOpt === 'radial') {\n x1 = sourceLayout.rawX;\n y1 = sourceLayout.rawY;\n x2 = targetLayout.rawX;\n y2 = targetLayout.rawY;\n var radialCoor1 = radialCoordinate(x1, y1);\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\n var radialCoor4 = radialCoordinate(x2, y2);\n return {\n x1: radialCoor1.x || 0,\n y1: radialCoor1.y || 0,\n x2: radialCoor4.x || 0,\n y2: radialCoor4.y || 0,\n cpx1: radialCoor2.x || 0,\n cpy1: radialCoor2.y || 0,\n cpx2: radialCoor3.x || 0,\n cpy2: radialCoor3.y || 0\n };\n } else {\n x1 = sourceLayout.x;\n y1 = sourceLayout.y;\n x2 = targetLayout.x;\n y2 = targetLayout.y;\n\n if (orient === 'LR' || orient === 'RL') {\n cpx1 = x1 + (x2 - x1) * curvature;\n cpy1 = y1;\n cpx2 = x2 + (x1 - x2) * curvature;\n cpy2 = y2;\n }\n\n if (orient === 'TB' || orient === 'BT') {\n cpx1 = x1;\n cpy1 = y1 + (y2 - y1) * curvature;\n cpx2 = x2;\n cpy2 = y2 + (y1 - y2) * curvature;\n }\n }\n\n return {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n };\n}\n\nexport default TreeView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Link lists and struct (graph or tree)\r\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\n\nfunction linkSeriesData(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = extend({}, inner(this).datas);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, inner(this).mainData, opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update();\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(inner(res).datas, function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\r\n * Supplement method to List.\r\n *\r\n * @public\r\n * @param [dataType] If not specified, return mainData.\r\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = inner(this).mainData;\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\r\n * Get list of all linked data\r\n */\n\n\nfunction getLinkedDataAll() {\n var mainData = inner(this).mainData;\n return mainData == null ? [{\n data: mainData\n }] : map(keys(inner(mainData).datas), function (type) {\n return {\n type: type,\n data: inner(mainData).datas[type]\n };\n });\n}\n\nfunction isMainData(data) {\n return inner(data).mainData === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n inner(mainData).datas = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n inner(mainData).datas[dataType] = data;\n inner(data).mainData = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n data.getLinkedDataAll = getLinkedDataAll;\n}\n\nexport default linkSeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Tree data structure\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport linkSeriesData from './helper/linkSeriesData.js';\nimport SeriesData from './SeriesData.js';\nimport prepareSeriesDataSchema from './helper/createDimensions.js';\nimport { convertOptionIdName } from '../util/model.js';\n\nvar TreeNode =\n/** @class */\nfunction () {\n function TreeNode(name, hostTree) {\n this.depth = 0;\n this.height = 0;\n /**\r\n * Reference to list item.\r\n * Do not persistent dataIndex outside,\r\n * besause it may be changed by list.\r\n * If dataIndex -1,\r\n * this node is logical deleted (filtered) in list.\r\n */\n\n this.dataIndex = -1;\n this.children = [];\n this.viewChildren = [];\n this.isExpand = false;\n this.name = name || '';\n this.hostTree = hostTree;\n }\n /**\r\n * The node is removed.\r\n */\n\n\n TreeNode.prototype.isRemoved = function () {\n return this.dataIndex < 0;\n };\n\n TreeNode.prototype.eachNode = function (options, cb, context) {\n if (zrUtil.isFunction(options)) {\n context = cb;\n cb = options;\n options = null;\n }\n\n options = options || {};\n\n if (zrUtil.isString(options)) {\n options = {\n order: options\n };\n }\n\n var order = options.order || 'preorder';\n var children = this[options.attr || 'children'];\n var suppressVisitSub;\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n children[i].eachNode(options, cb, context);\n }\n\n order === 'postorder' && cb.call(context, this);\n };\n /**\r\n * Update depth and height of this subtree.\r\n */\n\n\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\n var height = 0;\n this.depth = depth;\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.updateDepthAndHeight(depth + 1);\n\n if (child.height > height) {\n height = child.height;\n }\n }\n\n this.height = height + 1;\n };\n\n TreeNode.prototype.getNodeById = function (id) {\n if (this.getId() === id) {\n return this;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].getNodeById(id);\n\n if (res) {\n return res;\n }\n }\n };\n\n TreeNode.prototype.contains = function (node) {\n if (node === this) {\n return true;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].contains(node);\n\n if (res) {\n return res;\n }\n }\n };\n /**\r\n * @param includeSelf Default false.\r\n * @return order: [root, child, grandchild, ...]\r\n */\n\n\n TreeNode.prototype.getAncestors = function (includeSelf) {\n var ancestors = [];\n var node = includeSelf ? this : this.parentNode;\n\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n\n ancestors.reverse();\n return ancestors;\n };\n\n TreeNode.prototype.getAncestorsIndices = function () {\n var indices = [];\n var currNode = this;\n\n while (currNode) {\n indices.push(currNode.dataIndex);\n currNode = currNode.parentNode;\n }\n\n indices.reverse();\n return indices;\n };\n\n TreeNode.prototype.getDescendantIndices = function () {\n var indices = [];\n this.eachNode(function (childNode) {\n indices.push(childNode.dataIndex);\n });\n return indices;\n };\n\n TreeNode.prototype.getValue = function (dimension) {\n var data = this.hostTree.data;\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n };\n\n TreeNode.prototype.setLayout = function (layout, merge) {\n this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n };\n /**\r\n * @return {Object} layout\r\n */\n\n\n TreeNode.prototype.getLayout = function () {\n return this.hostTree.data.getItemLayout(this.dataIndex);\n }; // @depcrecated\n // getModel(path: S): Model\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n TreeNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var hostTree = this.hostTree;\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n }; // TODO: TYPE More specific model\n\n\n TreeNode.prototype.getLevelModel = function () {\n return (this.hostTree.levelModels || [])[this.depth];\n };\n\n TreeNode.prototype.setVisual = function (key, value) {\n this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n };\n /**\r\n * Get item visual\r\n * FIXME: make return type better\r\n */\n\n\n TreeNode.prototype.getVisual = function (key) {\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\n };\n\n TreeNode.prototype.getRawIndex = function () {\n return this.hostTree.data.getRawIndex(this.dataIndex);\n };\n\n TreeNode.prototype.getId = function () {\n return this.hostTree.data.getId(this.dataIndex);\n };\n /**\r\n * index in parent's children\r\n */\n\n\n TreeNode.prototype.getChildIndex = function () {\n if (this.parentNode) {\n var children = this.parentNode.children;\n\n for (var i = 0; i < children.length; ++i) {\n if (children[i] === this) {\n return i;\n }\n }\n\n return -1;\n }\n\n return -1;\n };\n /**\r\n * if this is an ancestor of another node\r\n *\r\n * @param node another node\r\n * @return if is ancestor\r\n */\n\n\n TreeNode.prototype.isAncestorOf = function (node) {\n var parent = node.parentNode;\n\n while (parent) {\n if (parent === this) {\n return true;\n }\n\n parent = parent.parentNode;\n }\n\n return false;\n };\n /**\r\n * if this is an descendant of another node\r\n *\r\n * @param node another node\r\n * @return if is descendant\r\n */\n\n\n TreeNode.prototype.isDescendantOf = function (node) {\n return node !== this && node.isAncestorOf(this);\n };\n\n return TreeNode;\n}();\n\nexport { TreeNode };\n;\n\nvar Tree =\n/** @class */\nfunction () {\n function Tree(hostModel) {\n this.type = 'tree';\n this._nodes = [];\n this.hostModel = hostModel;\n }\n\n Tree.prototype.eachNode = function (options, cb, context) {\n this.root.eachNode(options, cb, context);\n };\n\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n var rawIndex = this.data.getRawIndex(dataIndex);\n return this._nodes[rawIndex];\n };\n\n Tree.prototype.getNodeById = function (name) {\n return this.root.getNodeById(name);\n };\n /**\r\n * Update item available by list,\r\n * when list has been performed options like 'filterSelf' or 'map'.\r\n */\n\n\n Tree.prototype.update = function () {\n var data = this.data;\n var nodes = this._nodes;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n };\n /**\r\n * Clear all layouts\r\n */\n\n\n Tree.prototype.clearLayouts = function () {\n this.data.clearItemLayouts();\n };\n /**\r\n * data node format:\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: [\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: ...\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\n\n\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n var tree = new Tree(hostModel);\n var listData = [];\n var dimMax = 1;\n buildHierarchy(dataRoot);\n\n function buildHierarchy(dataNode, parentNode) {\n var value = dataNode.value;\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n listData.push(dataNode);\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n parentNode ? addChild(node, parentNode) : tree.root = node;\n\n tree._nodes.push(node);\n\n var children = dataNode.children;\n\n if (children) {\n for (var i = 0; i < children.length; i++) {\n buildHierarchy(children[i], node);\n }\n }\n }\n\n tree.root.updateDepthAndHeight(0);\n var dimensions = prepareSeriesDataSchema(listData, {\n coordDimensions: ['value'],\n dimensionsCount: dimMax\n }).dimensions;\n var list = new SeriesData(dimensions, hostModel);\n list.initData(listData);\n beforeLink && beforeLink(list);\n linkSeriesData({\n mainData: list,\n struct: tree,\n structAttr: 'tree'\n });\n tree.update();\n return tree;\n };\n\n return Tree;\n}();\n/**\r\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\r\n * so this function is not ready and not necessary to be public.\r\n */\n\n\nfunction addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}\n\nexport default Tree;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\n if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\n var root = seriesModel.getData().tree.root;\n var targetNode = payload.targetNode;\n\n if (zrUtil.isString(targetNode)) {\n targetNode = root.getNodeById(targetNode);\n }\n\n if (targetNode && root.contains(targetNode)) {\n return {\n node: targetNode\n };\n }\n\n var targetNodeId = payload.targetNodeId;\n\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\n return {\n node: targetNode\n };\n }\n }\n} // Not includes the given node at the last item.\n\nexport function getPathToRoot(node) {\n var path = [];\n\n while (node) {\n node = node.parentNode;\n node && path.push(node);\n }\n\n return path.reverse();\n}\nexport function aboveViewRoot(viewRoot, node) {\n var viewPath = getPathToRoot(viewRoot);\n return zrUtil.indexOf(viewPath, node) >= 0;\n} // From root to the input node (the input node will be included).\n\nexport function wrapTreePathInfo(node, seriesModel) {\n var treePathInfo = [];\n\n while (node) {\n var nodeDataIndex = node.dataIndex;\n treePathInfo.push({\n name: node.name,\n dataIndex: nodeDataIndex,\n value: seriesModel.getRawValue(nodeDataIndex)\n });\n node = node.parentNode;\n }\n\n treePathInfo.reverse();\n return treePathInfo;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\n\nvar TreeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreeSeriesModel, _super);\n\n function TreeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.hasSymbolVisual = true; // Do it self.\n\n _this.ignoreStyleOnData = true;\n return _this;\n }\n /**\r\n * Init a tree data structure from data in option series\r\n */\n\n\n TreeSeriesModel.prototype.getInitialData = function (option) {\n // create a virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var leavesModel = new Model(leaves, this, this.ecModel);\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n\n if (!(node && node.children.length && node.isExpand)) {\n model.parentModel = leavesModel;\n }\n\n return model;\n });\n }\n\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\n\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n };\n /**\r\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\r\n * @returns {string} orient\r\n */\n\n\n TreeSeriesModel.prototype.getOrient = function () {\n var orient = this.get('orient');\n\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n\n return orient;\n };\n\n TreeSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n TreeSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value,\n noValue: isNaN(value) || value == null\n });\n }; // Add tree path to tooltip param\n\n\n TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this);\n params.collapsed = !node.isExpand;\n return params;\n };\n\n TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n\n TreeSeriesModel.layoutMode = 'box';\n TreeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n // value can be 'polyline'\n edgeShape: 'curve',\n edgeForkPosition: '50%',\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n roam: false,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n // borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 500\n };\n return TreeSeriesModel;\n}(SeriesModel);\n\nexport default TreeSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Traverse the tree from bottom to top and do something\r\n */\nfunction eachAfter(root, callback, separation) {\n var nodes = [root];\n var next = [];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n next.push(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = 0; i < children.length; i++) {\n nodes.push(children[i]);\n }\n }\n }\n }\n\n while (node = next.pop()) {\n // jshint ignore:line\n callback(node, separation);\n }\n}\n/**\r\n * Traverse the tree from top to bottom and do something\r\n */\n\n\nfunction eachBefore(root, callback) {\n var nodes = [root];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n callback(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = children.length - 1; i >= 0; i--) {\n nodes.push(children[i]);\n }\n }\n }\n }\n}\n\nexport { eachAfter, eachBefore };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { eachAfter, eachBefore } from './traversalHelper.js';\nimport { init, firstWalk, secondWalk, separation as sep, radialCoordinate, getViewRect } from './layoutHelper.js';\nexport default function treeLayout(ecModel, api) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n commonLayout(seriesModel, api);\n });\n}\n\nfunction commonLayout(seriesModel, api) {\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var layout = seriesModel.get('layout');\n var width = 0;\n var height = 0;\n var separation = null;\n\n if (layout === 'radial') {\n width = 2 * Math.PI;\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n separation = sep(function (node1, node2) {\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n });\n } else {\n width = layoutInfo.width;\n height = layoutInfo.height;\n separation = sep();\n }\n\n var virtualRoot = seriesModel.getData().tree.root;\n var realRoot = virtualRoot.children[0];\n\n if (realRoot) {\n init(virtualRoot);\n eachAfter(realRoot, firstWalk, separation);\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n eachBefore(realRoot, secondWalk);\n var left_1 = realRoot;\n var right_1 = realRoot;\n var bottom_1 = realRoot;\n eachBefore(realRoot, function (node) {\n var x = node.getLayout().x;\n\n if (x < left_1.getLayout().x) {\n left_1 = node;\n }\n\n if (x > right_1.getLayout().x) {\n right_1 = node;\n }\n\n if (node.depth > bottom_1.depth) {\n bottom_1 = node;\n }\n });\n var delta = left_1 === right_1 ? 1 : separation(left_1, right_1) / 2;\n var tx_1 = delta - left_1.getLayout().x;\n var kx_1 = 0;\n var ky_1 = 0;\n var coorX_1 = 0;\n var coorY_1 = 0;\n\n if (layout === 'radial') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1); // here we use (node.depth - 1), bucause the real root's depth is 1\n\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = (node.depth - 1) * ky_1;\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\n node.setLayout({\n x: finalCoor.x,\n y: finalCoor.y,\n rawX: coorX_1,\n rawY: coorY_1\n }, true);\n });\n } else {\n var orient_1 = seriesModel.getOrient();\n\n if (orient_1 === 'RL' || orient_1 === 'LR') {\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\n kx_1 = width / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\n coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n } else if (orient_1 === 'TB' || orient_1 === 'BT') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nexport default function treeVisual(ecModel) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel(); // TODO Optimize\n\n var style = model.getModel('itemStyle').getItemStyle();\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nexport function installTreeAction(registers) {\n registers.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n });\n registers.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n }, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport TreeView from './TreeView.js';\nimport TreeSeriesModel from './TreeSeries.js';\nimport treeLayout from './treeLayout.js';\nimport treeVisual from './treeVisual.js';\nimport { installTreeAction } from './treeAction.js';\nexport function install(registers) {\n registers.registerChartView(TreeView);\n registers.registerSeriesModel(TreeSeriesModel);\n registers.registerLayout(treeLayout);\n registers.registerVisual(treeVisual);\n installTreeAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as helper from '../helper/treeHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\nexport function installTreemapAction(registers) {\n for (var i = 0; i < actionTypes.length; i++) {\n registers.registerAction({\n type: actionTypes[i],\n update: 'updateView'\n }, noop);\n }\n\n registers.registerAction({\n type: 'treemapRootToNode',\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getDecalFromPalette } from '../../model/mixin/palette.js';\nexport default function enableAriaDecalForTree(seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n var decalPaletteScope = {};\n tree.eachNode(function (node) {\n // Use decal of level 1 node\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\n node.setVisual('decal', decal);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\n\nvar TreemapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreemapSeriesModel, _super);\n\n function TreemapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapSeriesModel.type;\n _this.preventUsingHoverLayer = true;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || []; // Used in \"visual priority\" in `treemapVisual.js`.\n // This way is a little tricky, must satisfy the precondition:\n // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.\n // 2. The `Model.prototype.getModel()` will not use any clone-like way.\n\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\n var designatedVisualModel = new Model({\n itemStyle: designatedVisualItemStyle\n }, this, ecModel);\n levels = option.levels = setDefault(levels, ecModel);\n var levelModels = zrUtil.map(levels || [], function (levelDefine) {\n return new Model(levelDefine, designatedVisualModel, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = node ? levelModels[node.depth] : null; // If no levelModel, we also need `designatedVisualModel`.\n\n model.parentModel = levelModel || designatedVisualModel;\n return model;\n });\n }\n\n return tree.data;\n };\n\n TreemapSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /**\r\n * @override\r\n * @param {number} dataIndex\r\n * @param {boolean} [mutipleSeries=false]\r\n */\n\n\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n /**\r\n * Add tree path to tooltip param\r\n *\r\n * @override\r\n * @param {number} dataIndex\r\n * @return {Object}\r\n */\n\n\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this); // compatitable the previous code.\n\n params.treePathInfo = params.treeAncestors;\n return params;\n };\n /**\r\n * @public\r\n * @param {Object} layoutInfo {\r\n * x: containerGroup x\r\n * y: containerGroup y\r\n * width: containerGroup width\r\n * height: containerGroup height\r\n * }\r\n */\n\n\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\n /**\r\n * @readOnly\r\n * @type {Object}\r\n */\n this.layoutInfo = this.layoutInfo || {};\n zrUtil.extend(this.layoutInfo, layoutInfo);\n };\n /**\r\n * @param {string} id\r\n * @return {number} index\r\n */\n\n\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\n // A feature is implemented:\n // index is monotone increasing with the sequence of\n // input id at the first time.\n // This feature can make sure that each data item and its\n // mapped color have the same index between data list and\n // color list at the beginning, which is useful for user\n // to adjust data-color mapping.\n\n /**\r\n * @private\r\n * @type {Object}\r\n */\n var idIndexMap = this._idIndexMap;\n\n if (!idIndexMap) {\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n /**\r\n * @private\r\n * @type {number}\r\n */\n\n this._idIndexMapCount = 0;\n }\n\n var index = idIndexMap.get(id);\n\n if (index == null) {\n idIndexMap.set(id, index = this._idIndexMapCount++);\n }\n\n return index;\n };\n\n TreemapSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n TreemapSeriesModel.type = 'series.treemap';\n TreemapSeriesModel.layoutMode = 'box';\n TreemapSeriesModel.defaultOption = {\n // Disable progressive rendering\n progressive: 0,\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\n left: 'center',\n top: 'middle',\n width: '80%',\n height: '80%',\n sort: true,\n clipWindow: 'origin',\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\n leafDepth: null,\n drillDownIcon: '▶',\n // to align specialized icon. ▷▶❒❐▼✚\n zoomToNodeRatio: 0.32 * 0.32,\n roam: true,\n nodeClick: 'zoomToNode',\n animation: true,\n animationDurationUpdate: 900,\n animationEasing: 'quinticInOut',\n breadcrumb: {\n show: true,\n height: 22,\n left: 'center',\n top: 'bottom',\n // right\n // bottom\n emptyItemWidth: 25,\n itemStyle: {\n color: 'rgba(0,0,0,0.7)',\n textStyle: {\n color: '#fff'\n }\n },\n emphasis: {\n itemStyle: {\n color: 'rgba(0,0,0,0.9)' // '#5793f3',\n\n }\n }\n },\n label: {\n show: true,\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n distance: 0,\n padding: 5,\n position: 'inside',\n // formatter: null,\n color: '#fff',\n overflow: 'truncate' // align\n // verticalAlign\n\n },\n upperLabel: {\n show: false,\n position: [0, '50%'],\n height: 20,\n // formatter: null,\n // color: '#fff',\n overflow: 'truncate',\n // align: null,\n verticalAlign: 'middle'\n },\n itemStyle: {\n color: null,\n colorAlpha: null,\n colorSaturation: null,\n borderWidth: 0,\n gapWidth: 0,\n borderColor: '#fff',\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n // border color is evaluated by color of current node and\n // borderColorSaturation.\n\n },\n emphasis: {\n upperLabel: {\n show: true,\n position: [0, '50%'],\n overflow: 'truncate',\n verticalAlign: 'middle'\n }\n },\n visualDimension: 0,\n visualMin: null,\n visualMax: null,\n color: [],\n // level[n].color (if necessary).\n // + Specify color list of each level. level[0].color would be global\n // color list if not specified. (see method `setDefault`).\n // + But set as a empty array to forbid fetch color from global palette\n // when using nodeModel.get('color'), otherwise nodes on deep level\n // will always has color palette set and are not able to inherit color\n // from parent node.\n // + TreemapSeries.color can not be set as 'none', otherwise effect\n // legend color fetching (see seriesColor.js).\n colorAlpha: null,\n colorSaturation: null,\n colorMappingBy: 'index',\n visibleMin: 10,\n // be rendered. Only works when sort is 'asc' or 'desc'.\n childrenVisibleMin: null,\n // grandchildren will not show.\n // Why grandchildren? If not grandchildren but children,\n // some siblings show children and some not,\n // the appearance may be mess and not consistent,\n levels: [] // Each item: {\n // visibleMin, itemStyle, visualDimension, label\n // }\n\n };\n return TreemapSeriesModel;\n}(SeriesModel);\n/**\r\n * @param {Object} dataNode\r\n */\n\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\r\n * set default to level configuration\r\n */\n\n\nfunction setDefault(levels, ecModel) {\n var globalColorList = normalizeToArray(ecModel.get('color'));\n var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n\n if (!globalColorList) {\n return;\n }\n\n levels = levels || [];\n var hasColorDefine;\n var hasDecalDefine;\n zrUtil.each(levels, function (levelDefine) {\n var model = new Model(levelDefine);\n var modelColor = model.get('color');\n var modelDecal = model.get('decal');\n\n if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') {\n hasColorDefine = true;\n }\n\n if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') {\n hasDecalDefine = true;\n }\n });\n var level0 = levels[0] || (levels[0] = {});\n\n if (!hasColorDefine) {\n level0.color = globalColorList.slice();\n }\n\n if (!hasDecalDefine && globalDecalList) {\n level0.decal = globalDecalList.slice();\n }\n\n return levels;\n}\n\nexport default TreemapSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport * as layout from '../../util/layout.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { curry, defaults } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName } from '../../util/model.js';\nimport { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\n\nvar Breadcrumb =\n/** @class */\nfunction () {\n function Breadcrumb(containerGroup) {\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n }\n\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n\n if (!model.get('show') || !targetNode) {\n return;\n }\n\n var normalStyleModel = model.getModel('itemStyle');\n var emphasisModel = model.getModel('emphasis');\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']);\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n\n this._prepare(targetNode, layoutParam, textStyleModel);\n\n this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect);\n\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n };\n /**\r\n * Prepare render list and total width\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = convertOptionIdName(node.getModel().get('name'), '');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n };\n /**\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get(['breadcrumb', 'height']);\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n var emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text; // Hdie text and shorten width if necessary.\n\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel'\n }),\n textContent: new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: text\n })\n }),\n textConfig: {\n position: 'inside'\n },\n z2: Z2_EMPHASIS_LIFT * 1e4,\n onclick: curry(onSelect, itemNode)\n });\n el.disableLabelAnimation = true;\n el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, {\n text: text\n });\n el.ensureState('emphasis').style = emphasisItemStyle;\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n };\n\n Breadcrumb.prototype.remove = function () {\n this.group.removeAll();\n };\n\n return Breadcrumb;\n}();\n\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n} // Package custom mouse event.\n\n\nfunction packEventData(el, seriesModel, itemNode) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\n\nexport default Breadcrumb;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Animate multiple elements with a single done-callback.\r\n *\r\n * @example\r\n * animation\r\n * .createWrap()\r\n * .add(el1, {x: 10, y: 10})\r\n * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\r\n * .done(function () { // done })\r\n * .start('cubicOut');\r\n */\nvar AnimationWrap =\n/** @class */\nfunction () {\n function AnimationWrap() {\n this._storage = [];\n this._elExistsMap = {};\n }\n /**\r\n * Caution: a el can only be added once, otherwise 'done'\r\n * might not be called. This method checks this (by el.id),\r\n * suppresses adding and returns false when existing el found.\r\n *\r\n * @return Whether adding succeeded.\r\n */\n\n\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\n if (this._elExistsMap[el.id]) {\n return false;\n }\n\n this._elExistsMap[el.id] = true;\n\n this._storage.push({\n el: el,\n target: target,\n duration: duration,\n delay: delay,\n easing: easing\n });\n\n return true;\n };\n /**\r\n * Only execute when animation done/aborted.\r\n */\n\n\n AnimationWrap.prototype.finished = function (callback) {\n this._finishedCallback = callback;\n return this;\n };\n /**\r\n * Will stop exist animation firstly.\r\n */\n\n\n AnimationWrap.prototype.start = function () {\n var _this = this;\n\n var count = this._storage.length;\n\n var checkTerminate = function () {\n count--;\n\n if (count <= 0) {\n // Guard.\n _this._storage.length = 0;\n _this._elExistsMap = {};\n _this._finishedCallback && _this._finishedCallback();\n }\n };\n\n for (var i = 0, len = this._storage.length; i < len; i++) {\n var item = this._storage[i];\n item.el.animateTo(item.target, {\n duration: item.duration,\n delay: item.delay,\n easing: item.easing,\n setToFinal: true,\n done: checkTerminate,\n aborted: checkTerminate\n });\n }\n\n return this;\n };\n\n return AnimationWrap;\n}();\n\nexport function createWrap() {\n return new AnimationWrap();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, indexOf, curry, extend, normalizeCssArray, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isHighDownDispatcher, setAsHighDownDispatcher, setDefaultStateProxy, enableHoverFocus, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as helper from '../helper/treeHelper.js';\nimport Breadcrumb from './Breadcrumb.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as animationUtil from '../../util/animation.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport ChartView from '../../view/Chart.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner, convertOptionIdName } from '../../util/model.js';\nimport { windowOpen } from '../../util/format.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = 'label';\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel'; // Should larger than emphasis states lift z\n\nvar Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\n\nvar Z2_BG = Z2_EMPHASIS_LIFT * 2;\nvar Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\nvar getStateItemStyle = makeStyleMapper([['fill', 'color'], // `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n]);\n\nvar getItemStyleNormal = function (model) {\n // Normal style props should include emphasis style props.\n var itemStyle = getStateItemStyle(model); // Clear styles set by emphasis.\n\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n return itemStyle;\n};\n\nvar inner = makeInner();\n\nvar TreemapView =\n/** @class */\nfunction (_super) {\n __extends(TreemapView, _super);\n\n function TreemapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapView.type;\n _this._state = 'ready';\n _this._storage = createStorage();\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var models = ecModel.findComponents({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n });\n\n if (indexOf(models, seriesModel) < 0) {\n return;\n }\n\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var payloadType = payload && payload.type;\n var layoutInfo = seriesModel.layoutInfo;\n var isInit = !this._oldTree;\n var thisStorage = this._storage; // Mark new root when action is treemapRootToNode.\n\n var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n direction: payload.direction\n } : null;\n\n var containerGroup = this._giveContainerGroup(layoutInfo);\n\n var hasAnimation = seriesModel.get('animation');\n\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n\n hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n\n this._resetController(api);\n\n this._renderBreadcrumb(seriesModel, api, targetInfo);\n };\n\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\n var containerGroup = this._containerGroup;\n\n if (!containerGroup) {\n // FIXME\n // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。\n containerGroup = this._containerGroup = new Group();\n\n this._initEvents(containerGroup);\n\n this.group.add(containerGroup);\n }\n\n containerGroup.x = layoutInfo.x;\n containerGroup.y = layoutInfo.y;\n return containerGroup;\n };\n\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\n var thisTree = seriesModel.getData().tree;\n var oldTree = this._oldTree; // Clear last shape records.\n\n var lastsForAnimation = createStorage();\n var thisStorage = createStorage();\n var oldStorage = this._storage;\n var willInvisibleEls = [];\n\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\n } // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),\n // the oldTree is actually losted, so we cannot find all of the old graphic\n // elements from tree. So we use this strategy: make element storage, move\n // from old storage to new storage, clear old storage.\n\n\n dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing.\n\n var willDeleteEls = clearStorage(oldStorage);\n this._oldTree = thisTree;\n this._storage = thisStorage;\n return {\n lastsForAnimation: lastsForAnimation,\n willDeleteEls: willDeleteEls,\n renderFinally: renderFinally\n };\n\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n // When 'render' is triggered by action,\n // 'this' and 'old' may be the same tree,\n // we use rawIndex in that case.\n if (sameTree) {\n oldViewChildren = thisViewChildren;\n each(thisViewChildren, function (child, index) {\n !child.isRemoved() && processNode(index, index);\n });\n } // Diff hierarchically (diff only in each subtree, but not whole).\n // because, consistency of view is important.\n else {\n new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute();\n }\n\n function getKey(node) {\n // Identify by name or raw index.\n return node.getId();\n }\n\n function processNode(newIndex, oldIndex) {\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n }\n }\n\n function clearStorage(storage) {\n var willDeleteEls = createStorage();\n storage && each(storage, function (store, storageName) {\n var delEls = willDeleteEls[storageName];\n each(store, function (el) {\n el && (delEls.push(el), inner(el).willDelete = true);\n });\n });\n return willDeleteEls;\n }\n\n function renderFinally() {\n each(willDeleteEls, function (els) {\n each(els, function (el) {\n el.parent && el.parent.remove(el);\n });\n });\n each(willInvisibleEls, function (el) {\n el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty,\n // just mark as invisible.\n\n el.dirty();\n });\n }\n };\n\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\n var durationOption = seriesModel.get('animationDurationUpdate');\n var easingOption = seriesModel.get('animationEasing'); // TODO: do not support function until necessary.\n\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\n var animationWrap = animationUtil.createWrap(); // Make delete animations.\n\n each(renderResult.willDeleteEls, function (store, storageName) {\n each(store, function (el, rawIndex) {\n if (el.invisible) {\n return;\n }\n\n var parent = el.parent; // Always has parent, and parent is nodeGroup.\n\n var target;\n var innerStore = inner(parent);\n\n if (reRoot && reRoot.direction === 'drillDown') {\n target = parent === reRoot.rootNodeGroup // This is the content element of view root.\n // Only `content` will enter this branch, because\n // `background` and `nodeGroup` will not be deleted.\n ? {\n shape: {\n x: 0,\n y: 0,\n width: innerStore.nodeWidth,\n height: innerStore.nodeHeight\n },\n style: {\n opacity: 0\n }\n } // Others.\n : {\n style: {\n opacity: 0\n }\n };\n } else {\n var targetX = 0;\n var targetY = 0;\n\n if (!innerStore.willDelete) {\n // Let node animate to right-bottom corner, cooperating with fadeout,\n // which is appropriate for user understanding.\n // Divided by 2 for reRoot rolling up effect.\n targetX = innerStore.nodeWidth / 2;\n targetY = innerStore.nodeHeight / 2;\n }\n\n target = storageName === 'nodeGroup' ? {\n x: targetX,\n y: targetY,\n style: {\n opacity: 0\n }\n } : {\n shape: {\n x: targetX,\n y: targetY,\n width: 0,\n height: 0\n },\n style: {\n opacity: 0\n }\n };\n } // TODO: do not support delay until necessary.\n\n\n target && animationWrap.add(el, target, duration, 0, easing);\n });\n }); // Make other animations\n\n each(this._storage, function (store, storageName) {\n each(store, function (el, rawIndex) {\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\n var target = {};\n\n if (!last) {\n return;\n }\n\n if (el instanceof graphic.Group) {\n if (last.oldX != null) {\n target.x = el.x;\n target.y = el.y;\n el.x = last.oldX;\n el.y = last.oldY;\n }\n } else {\n if (last.oldShape) {\n target.shape = extend({}, el.shape);\n el.setShape(last.oldShape);\n }\n\n if (last.fadein) {\n el.setStyle('opacity', 0);\n target.style = {\n opacity: 1\n };\n } // When animation is stopped for succedent animation starting,\n // el.style.opacity might not be 1\n else if (el.style.opacity !== 1) {\n target.style = {\n opacity: 1\n };\n }\n }\n\n animationWrap.add(el, target, duration, 0, easing);\n });\n }, this);\n this._state = 'animating';\n animationWrap.finished(bind(function () {\n this._state = 'ready';\n renderResult.renderFinally();\n }, this)).start();\n };\n\n TreemapView.prototype._resetController = function (api) {\n var controller = this._controller; // Init controller.\n\n if (!controller) {\n controller = this._controller = new RoamController(api.getZr());\n controller.enable(this.seriesModel.get('roam'));\n controller.on('pan', bind(this._onPan, this));\n controller.on('zoom', bind(this._onZoom, this));\n }\n\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\n controller.setPointerChecker(function (e, x, y) {\n return rect.contain(x, y);\n });\n };\n\n TreemapView.prototype._clearController = function () {\n var controller = this._controller;\n\n if (controller) {\n controller.dispose();\n controller = null;\n }\n };\n\n TreemapView.prototype._onPan = function (e) {\n if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n this.api.dispatchAction({\n type: 'treemapMove',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rootLayout.x + e.dx,\n y: rootLayout.y + e.dy,\n width: rootLayout.width,\n height: rootLayout.height\n }\n });\n }\n };\n\n TreemapView.prototype._onZoom = function (e) {\n var mouseX = e.originX;\n var mouseY = e.originY;\n\n if (this._state !== 'animating') {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup.\n\n mouseX -= layoutInfo.x;\n mouseY -= layoutInfo.y; // Scale root bounding rect.\n\n var m = matrix.create();\n matrix.translate(m, m, [-mouseX, -mouseY]);\n matrix.scale(m, m, [e.scale, e.scale]);\n matrix.translate(m, m, [mouseX, mouseY]);\n rect.applyTransform(m);\n this.api.dispatchAction({\n type: 'treemapRender',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n }\n };\n\n TreemapView.prototype._initEvents = function (containerGroup) {\n var _this = this;\n\n containerGroup.on('click', function (e) {\n if (_this._state !== 'ready') {\n return;\n }\n\n var nodeClick = _this.seriesModel.get('nodeClick', true);\n\n if (!nodeClick) {\n return;\n }\n\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\n\n if (!targetInfo) {\n return;\n }\n\n var node = targetInfo.node;\n\n if (node.getLayout().isLeafRoot) {\n _this._rootToNode(targetInfo);\n } else {\n if (nodeClick === 'zoomToNode') {\n _this._zoomToNode(targetInfo);\n } else if (nodeClick === 'link') {\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n var link = itemModel.get('link', true);\n var linkTarget = itemModel.get('target', true) || 'blank';\n link && windowOpen(link, linkTarget);\n }\n }\n }, this);\n };\n\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\n var _this = this;\n\n if (!targetInfo) {\n targetInfo = seriesModel.get('leafDepth', true) != null ? {\n node: seriesModel.getViewRoot()\n } // FIXME\n // better way?\n // Find breadcrumb tail on center of containerGroup.\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n\n if (!targetInfo) {\n targetInfo = {\n node: seriesModel.getData().tree.root\n };\n }\n }\n\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) {\n if (_this._state !== 'animating') {\n helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({\n node: node\n }) : _this._zoomToNode({\n node: node\n });\n }\n });\n };\n /**\r\n * @override\r\n */\n\n\n TreemapView.prototype.remove = function () {\n this._clearController();\n\n this._containerGroup && this._containerGroup.removeAll();\n this._storage = createStorage();\n this._state = 'ready';\n this._breadcrumb && this._breadcrumb.remove();\n };\n\n TreemapView.prototype.dispose = function () {\n this._clearController();\n };\n\n TreemapView.prototype._zoomToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapZoomToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n\n TreemapView.prototype._rootToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapRootToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n /**\r\n * @public\r\n * @param {number} x Global coord x.\r\n * @param {number} y Global coord y.\r\n * @return {Object} info If not found, return undefined;\r\n * @return {number} info.node Target node.\r\n * @return {number} info.offsetX x refer to target node.\r\n * @return {number} info.offsetY y refer to target node.\r\n */\n\n\n TreemapView.prototype.findTarget = function (x, y) {\n var targetInfo;\n var viewRoot = this.seriesModel.getViewRoot();\n viewRoot.eachNode({\n attr: 'viewChildren',\n order: 'preorder'\n }, function (node) {\n var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element.\n\n\n if (bgEl) {\n var point = bgEl.transformCoordToLocal(x, y);\n var shape = bgEl.shape; // For performance consideration, don't use 'getBoundingRect'.\n\n if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n targetInfo = {\n node: node,\n offsetX: point[0],\n offsetY: point[1]\n };\n } else {\n return false; // Suppress visit subtree.\n }\n }\n }, this);\n return targetInfo;\n };\n\n TreemapView.type = 'treemap';\n return TreemapView;\n}(ChartView);\n/**\r\n * @inner\r\n */\n\n\nfunction createStorage() {\n return {\n nodeGroup: [],\n background: [],\n content: []\n };\n}\n/**\r\n * @inner\r\n * @return Return undefined means do not travel further.\r\n */\n\n\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n // Whether under viewRoot.\n if (!thisNode) {\n // Deleting nodes will be performed finally. This method just find\n // element from old storage, or create new element, set them to new\n // storage, and set styles.\n return;\n } // -------------------------------------------------------------------\n // Start of closure variables available in \"Procedures in renderNode\".\n\n\n var thisLayout = thisNode.getLayout();\n var data = seriesModel.getData();\n var nodeModel = thisNode.getModel(); // Only for enabling highlight/downplay. Clear firstly.\n // Because some node will not be rendered.\n\n data.setItemGraphicEl(thisNode.dataIndex, null);\n\n if (!thisLayout || !thisLayout.isInView) {\n return;\n }\n\n var thisWidth = thisLayout.width;\n var thisHeight = thisLayout.height;\n var borderWidth = thisLayout.borderWidth;\n var thisInvisible = thisLayout.invisible;\n var thisRawIndex = thisNode.getRawIndex();\n var oldRawIndex = oldNode && oldNode.getRawIndex();\n var thisViewChildren = thisNode.viewChildren;\n var upperHeight = thisLayout.upperHeight;\n var isParent = thisViewChildren && thisViewChildren.length;\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; // End of closure ariables available in \"Procedures in renderNode\".\n // -----------------------------------------------------------------\n // Node group\n\n var group = giveGraphic('nodeGroup', Group);\n\n if (!group) {\n return;\n }\n\n parentGroup.add(group); // x,y are not set when el is above view root.\n\n group.x = thisLayout.x || 0;\n group.y = thisLayout.y || 0;\n group.markRedraw();\n inner(group).nodeWidth = thisWidth;\n inner(group).nodeHeight = thisHeight;\n\n if (thisLayout.isAboveViewRoot) {\n return group;\n } // Background\n\n\n var bg = giveGraphic('background', Rect, depth, Z2_BG);\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\n var emphasisModel = nodeModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var isDisabled = emphasisModel.get('disabled');\n var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; // No children, render content.\n\n if (isParent) {\n // Because of the implementation about \"traverse\" in graphic hover style, we\n // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\n // hover event from the descendents will be listenered.\n if (isHighDownDispatcher(group)) {\n setAsHighDownDispatcher(group, false);\n }\n\n if (bg) {\n setAsHighDownDispatcher(bg, !isDisabled); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, bg);\n enableHoverFocus(bg, focusOrIndices, blurScope);\n }\n } else {\n var content = giveGraphic('content', Rect, depth, Z2_CONTENT);\n content && renderContent(group, content);\n bg.disableMorphing = true;\n\n if (bg && isHighDownDispatcher(bg)) {\n setAsHighDownDispatcher(bg, false);\n }\n\n setAsHighDownDispatcher(group, !isDisabled); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, group);\n enableHoverFocus(group, focusOrIndices, blurScope);\n }\n\n return group; // ----------------------------\n // | Procedures in renderNode |\n // ----------------------------\n\n function renderBackground(group, bg, useUpperLabel) {\n var ecData = getECData(bg); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var style = thisNode.getVisual('style');\n var visualBorderColor = style.stroke;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText( // PENDING: convert ZRColor to ColorString for text.\n bg, visualBorderColor, style.opacity, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n bg.removeTextContent();\n }\n\n bg.setStyle(normalStyle);\n bg.ensureState('emphasis').style = emphasisStyle;\n bg.ensureState('blur').style = blurStyle;\n bg.ensureState('select').style = selectStyle;\n setDefaultStateProxy(bg);\n }\n\n group.add(bg);\n }\n\n function renderContent(group, content) {\n var ecData = getECData(content); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n content.culling = true;\n content.setShape({\n x: borderWidth,\n y: borderWidth,\n width: contentWidth,\n height: contentHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(content);\n } else {\n content.invisible = false;\n var nodeStyle = thisNode.getVisual('style');\n var visualColor = nodeStyle.fill;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualColor;\n normalStyle.decal = nodeStyle.decal;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n var selectStyle = getStateItemStyle(itemStyleSelectModel); // PENDING: convert ZRColor to ColorString for text.\n\n prepareText(content, visualColor, nodeStyle.opacity, null);\n content.setStyle(normalStyle);\n content.ensureState('emphasis').style = emphasisStyle;\n content.ensureState('blur').style = blurStyle;\n content.ensureState('select').style = selectStyle;\n setDefaultStateProxy(content);\n }\n\n group.add(content);\n }\n\n function processInvisible(element) {\n // Delay invisible setting utill animation finished,\n // avoid element vanish suddenly before animation.\n !element.invisible && willInvisibleEls.push(element);\n }\n\n function prepareText(rectEl, visualColor, visualOpacity, // Can be null/undefined\n upperLabelRect) {\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n var defaultText = convertOptionIdName(nodeModel.get('name'), null);\n var isShow = normalLabelModel.getShallow('show');\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\n defaultText: isShow ? defaultText : null,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n labelFetcher: seriesModel,\n labelDataIndex: thisNode.dataIndex\n });\n var textEl = rectEl.getTextContent();\n\n if (!textEl) {\n return;\n }\n\n var textStyle = textEl.style;\n var textPadding = normalizeCssArray(textStyle.padding || 0);\n\n if (upperLabelRect) {\n rectEl.setTextConfig({\n layoutRect: upperLabelRect\n });\n textEl.disableLabelLayout = true;\n }\n\n textEl.beforeUpdate = function () {\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\n\n if (textStyle.width !== width || textStyle.height !== height) {\n textEl.setStyle({\n width: width,\n height: height\n });\n }\n };\n\n textStyle.truncateMinChar = 2;\n textStyle.lineOverflow = 'truncate';\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\n var textEmphasisState = textEl.getState('emphasis');\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\n }\n\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\n var text = style ? style.text : null;\n\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\n var iconChar = seriesModel.get('drillDownIcon', true);\n style.text = iconChar ? iconChar + ' ' + text : text;\n }\n }\n\n function giveGraphic(storageName, Ctor, depth, z) {\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n var lasts = lastsForAnimation[storageName];\n\n if (element) {\n // Remove from oldStorage\n oldStorage[storageName][oldRawIndex] = null;\n prepareAnimationWhenHasOld(lasts, element);\n } // If invisible and no old element, do not create new element (for optimizing).\n else if (!thisInvisible) {\n element = new Ctor();\n\n if (element instanceof Displayable) {\n element.z2 = calculateZ2(depth, z);\n }\n\n prepareAnimationWhenNoOld(lasts, element);\n } // Set to thisStorage\n\n\n return thisStorage[storageName][thisRawIndex] = element;\n }\n\n function prepareAnimationWhenHasOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n\n if (element instanceof Group) {\n lastCfg.oldX = element.x;\n lastCfg.oldY = element.y;\n } else {\n lastCfg.oldShape = extend({}, element.shape);\n }\n } // If a element is new, we need to find the animation start point carefully,\n // otherwise it will looks strange when 'zoomToNode'.\n\n\n function prepareAnimationWhenNoOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n var parentNode = thisNode.parentNode;\n var isGroup = element instanceof graphic.Group;\n\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n var parentOldX = 0;\n var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n // For convenience, get old bounding rect from background.\n\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\n parentOldX = parentOldBg.oldShape.width;\n parentOldY = parentOldBg.oldShape.height;\n } // When no parent old shape found, its parent is new too,\n // so we can just use {x:0, y:0}.\n\n\n if (isGroup) {\n lastCfg.oldX = 0;\n lastCfg.oldY = parentOldY;\n } else {\n lastCfg.oldShape = {\n x: parentOldX,\n y: parentOldY,\n width: 0,\n height: 0\n };\n }\n } // Fade in, user can be aware that these nodes are new.\n\n\n lastCfg.fadein = !isGroup;\n }\n} // We cannot set all background with the same z, because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause lower background elements to overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\n\n\nfunction calculateZ2(depth, z2InLevel) {\n return depth * Z2_BASE + z2InLevel;\n}\n\nexport default TreemapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as zrColor from 'zrender/lib/tool/color.js';\nimport { linearMap } from '../util/number.js';\nimport { warn } from '../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\n\nvar VisualMapping =\n/** @class */\nfunction () {\n function VisualMapping(option) {\n var mappingMethod = option.mappingMethod;\n var visualType = option.type;\n var thisOption = this.option = zrUtil.clone(option);\n this.type = visualType;\n this.mappingMethod = mappingMethod;\n this._normalizeData = normalizers[mappingMethod];\n var visualHandler = VisualMapping.visualHandlers[visualType];\n this.applyVisual = visualHandler.applyVisual;\n this.getColorMapper = visualHandler.getColorMapper;\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\n\n if (mappingMethod === 'piecewise') {\n normalizeVisualRange(thisOption);\n preprocessForPiecewise(thisOption);\n } else if (mappingMethod === 'category') {\n thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified,\n // which need no more preprocess except normalize visual.\n : normalizeVisualRange(thisOption, true);\n } else {\n // mappingMethod === 'linear' or 'fixed'\n zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\n normalizeVisualRange(thisOption);\n }\n }\n\n VisualMapping.prototype.mapValueToVisual = function (value) {\n var normalized = this._normalizeData(value);\n\n return this._normalizedToVisual(normalized, value);\n };\n\n VisualMapping.prototype.getNormalizer = function () {\n return zrUtil.bind(this._normalizeData, this);\n };\n /**\r\n * List available visual types.\r\n *\r\n * @public\r\n * @return {Array.}\r\n */\n\n\n VisualMapping.listVisualTypes = function () {\n return zrUtil.keys(VisualMapping.visualHandlers);\n }; // /**\n // * @public\n // */\n // static addVisualHandler(name, handler) {\n // visualHandlers[name] = handler;\n // }\n\n /**\r\n * @public\r\n */\n\n\n VisualMapping.isValidType = function (visualType) {\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\n };\n /**\r\n * Convenient method.\r\n * Visual can be Object or Array or primary type.\r\n */\n\n\n VisualMapping.eachVisual = function (visual, callback, context) {\n if (zrUtil.isObject(visual)) {\n zrUtil.each(visual, callback, context);\n } else {\n callback.call(context, visual);\n }\n };\n\n VisualMapping.mapVisual = function (visual, callback, context) {\n var isPrimary;\n var newVisual = zrUtil.isArray(visual) ? [] : zrUtil.isObject(visual) ? {} : (isPrimary = true, null);\n VisualMapping.eachVisual(visual, function (v, key) {\n var newVal = callback.call(context, v, key);\n isPrimary ? newVisual = newVal : newVisual[key] = newVal;\n });\n return newVisual;\n };\n /**\r\n * Retrieve visual properties from given object.\r\n */\n\n\n VisualMapping.retrieveVisuals = function (obj) {\n var ret = {};\n var hasVisual;\n obj && each(VisualMapping.visualHandlers, function (h, visualType) {\n if (obj.hasOwnProperty(visualType)) {\n ret[visualType] = obj[visualType];\n hasVisual = true;\n }\n });\n return hasVisual ? ret : null;\n };\n /**\r\n * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\r\n *\r\n * @public\r\n * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\r\n * IF Array, like: ['color', 'symbol', 'colorSaturation']\r\n * @return {Array.} Sorted visual types.\r\n */\n\n\n VisualMapping.prepareVisualTypes = function (visualTypes) {\n if (zrUtil.isArray(visualTypes)) {\n visualTypes = visualTypes.slice();\n } else if (isObject(visualTypes)) {\n var types_1 = [];\n each(visualTypes, function (item, type) {\n types_1.push(type);\n });\n visualTypes = types_1;\n } else {\n return [];\n }\n\n visualTypes.sort(function (type1, type2) {\n // color should be front of colorSaturation, colorAlpha, ...\n // symbol and symbolSize do not matter.\n return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1;\n });\n return visualTypes;\n };\n /**\r\n * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\r\n * Other visuals are only depends on themself.\r\n */\n\n\n VisualMapping.dependsOn = function (visualType1, visualType2) {\n return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;\n };\n /**\r\n * @param value\r\n * @param pieceList [{value: ..., interval: [min, max]}, ...]\r\n * Always from small to big.\r\n * @param findClosestWhenOutside Default to be false\r\n * @return index\r\n */\n\n\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\n var possibleI;\n var abs = Infinity; // value has the higher priority.\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var pieceValue = pieceList[i].value;\n\n if (pieceValue != null) {\n if (pieceValue === value // FIXME\n // It is supposed to compare value according to value type of dimension,\n // but currently value type can exactly be string or number.\n // Compromise for numeric-like string (like '12'), especially\n // in the case that visualMap.categories is ['22', '33'].\n || zrUtil.isString(pieceValue) && pieceValue === value + '') {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(pieceValue, i);\n }\n }\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var piece = pieceList[i];\n var interval = piece.interval;\n var close_1 = piece.close;\n\n if (interval) {\n if (interval[0] === -Infinity) {\n if (littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n } else if (interval[1] === Infinity) {\n if (littleThan(close_1[0], interval[0], value)) {\n return i;\n }\n } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(interval[0], i);\n findClosestWhenOutside && updatePossible(interval[1], i);\n }\n }\n\n if (findClosestWhenOutside) {\n return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;\n }\n\n function updatePossible(val, index) {\n var newAbs = Math.abs(val - value);\n\n if (newAbs < abs) {\n abs = newAbs;\n possibleI = index;\n }\n }\n };\n\n VisualMapping.visualHandlers = {\n color: {\n applyVisual: makeApplyVisual('color'),\n getColorMapper: function () {\n var thisOption = this.option;\n return zrUtil.bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) {\n !isNormalized && (value = this._normalizeData(value));\n return doMapCategory.call(this, value);\n } : function (value, isNormalized, out) {\n // If output rgb array\n // which will be much faster and useful in pixel manipulation\n var returnRGBArray = !!out;\n !isNormalized && (value = this._normalizeData(value));\n out = zrColor.fastLerp(value, thisOption.parsedVisual, out);\n return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\n }, this);\n },\n _normalizedToVisual: {\n linear: function (normalized) {\n return zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n colorHue: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, value);\n }),\n colorSaturation: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, value);\n }),\n colorLightness: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, null, value);\n }),\n colorAlpha: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyAlpha(color, value);\n }),\n decal: {\n applyVisual: makeApplyVisual('decal'),\n _normalizedToVisual: {\n linear: null,\n category: doMapCategory,\n piecewise: null,\n fixed: null\n }\n },\n opacity: {\n applyVisual: makeApplyVisual('opacity'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n },\n liftZ: {\n applyVisual: makeApplyVisual('liftZ'),\n _normalizedToVisual: {\n linear: doMapFixed,\n category: doMapFixed,\n piecewise: doMapFixed,\n fixed: doMapFixed\n }\n },\n symbol: {\n applyVisual: function (value, getter, setter) {\n var symbolCfg = this.mapValueToVisual(value);\n setter('symbol', symbolCfg);\n },\n _normalizedToVisual: {\n linear: doMapToArray,\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = doMapToArray.call(this, normalized);\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n symbolSize: {\n applyVisual: makeApplyVisual('symbolSize'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n }\n };\n return VisualMapping;\n}();\n\nfunction preprocessForPiecewise(thisOption) {\n var pieceList = thisOption.pieceList;\n thisOption.hasSpecialVisual = false;\n zrUtil.each(pieceList, function (piece, index) {\n piece.originIndex = index; // piece.visual is \"result visual value\" but not\n // a visual range, so it does not need to be normalized.\n\n if (piece.visual != null) {\n thisOption.hasSpecialVisual = true;\n }\n });\n}\n\nfunction preprocessForSpecifiedCategory(thisOption) {\n // Hash categories.\n var categories = thisOption.categories;\n var categoryMap = thisOption.categoryMap = {};\n var visual = thisOption.visual;\n each(categories, function (cate, index) {\n categoryMap[cate] = index;\n }); // Process visual map input.\n\n if (!zrUtil.isArray(visual)) {\n var visualArr_1 = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v, cate) {\n var index = categoryMap[cate];\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\n });\n } else {\n // Is primary type, represents default visual.\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\n }\n\n visual = setVisualToOption(thisOption, visualArr_1);\n } // Remove categories that has no visual,\n // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\n\n\n for (var i = categories.length - 1; i >= 0; i--) {\n if (visual[i] == null) {\n delete categoryMap[categories[i]];\n categories.pop();\n }\n }\n}\n\nfunction normalizeVisualRange(thisOption, isCategory) {\n var visual = thisOption.visual;\n var visualArr = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v) {\n visualArr.push(v);\n });\n } else if (visual != null) {\n visualArr.push(visual);\n }\n\n var doNotNeedPair = {\n color: 1,\n symbol: 1\n };\n\n if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\n // Do not care visualArr.length === 0, which is illegal.\n visualArr[1] = visualArr[0];\n }\n\n setVisualToOption(thisOption, visualArr);\n}\n\nfunction makePartialColorVisualHandler(applyValue) {\n return {\n applyVisual: function (value, getter, setter) {\n // Only used in HSL\n var colorChannel = this.mapValueToVisual(value); // Must not be array value\n\n setter('color', applyValue(getter('color'), colorChannel));\n },\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n };\n}\n\nfunction doMapToArray(normalized) {\n var visual = this.option.visual;\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}?\n}\n\nfunction makeApplyVisual(visualType) {\n return function (value, getter, setter) {\n setter(visualType, this.mapValueToVisual(value));\n };\n}\n\nfunction doMapCategory(normalized) {\n var visual = this.option.visual;\n return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];\n}\n\nfunction doMapFixed() {\n // visual will be convert to array.\n return this.option.visual[0];\n}\n/**\r\n * Create mapped to numeric visual\r\n */\n\n\nfunction createNormalizedToNumericVisual(sourceExtent) {\n return {\n linear: function (normalized) {\n return linearMap(normalized, sourceExtent, this.option.visual, true);\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\n }\n\n return result;\n },\n fixed: doMapFixed\n };\n}\n\nfunction getSpecifiedVisual(value) {\n var thisOption = this.option;\n var pieceList = thisOption.pieceList;\n\n if (thisOption.hasSpecialVisual) {\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\n var piece = pieceList[pieceIndex];\n\n if (piece && piece.visual) {\n return piece.visual[this.type];\n }\n }\n}\n\nfunction setVisualToOption(thisOption, visualArr) {\n thisOption.visual = visualArr;\n\n if (thisOption.type === 'color') {\n thisOption.parsedVisual = zrUtil.map(visualArr, function (item) {\n var color = zrColor.parse(item);\n\n if (!color && process.env.NODE_ENV !== 'production') {\n warn(\"'\" + item + \"' is an illegal color, fallback to '#000000'\", true);\n }\n\n return color || [0, 0, 0, 1];\n });\n }\n\n return visualArr;\n}\n/**\r\n * Normalizers by mapping methods.\r\n */\n\n\nvar normalizers = {\n linear: function (value) {\n return linearMap(value, this.option.dataExtent, [0, 1], true);\n },\n piecewise: function (value) {\n var pieceList = this.option.pieceList;\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\n\n if (pieceIndex != null) {\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\n }\n },\n category: function (value) {\n var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value\n\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\n },\n fixed: zrUtil.noop\n};\n\nfunction littleThan(close, a, b) {\n return close ? a <= b : a < b;\n}\n\nexport default VisualMapping;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { each, extend, isArray } from 'zrender/lib/core/util.js';\nimport { modifyHSL, modifyAlpha } from 'zrender/lib/tool/color.js';\nimport { makeInner } from '../../util/model.js';\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar inner = makeInner();\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel) {\n var tree = seriesModel.getData().tree;\n var root = tree.root;\n\n if (root.isRemoved()) {\n return;\n }\n\n travelTree(root, // Visual should calculate from tree root but not view root.\n {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\n }\n};\n\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\n var nodeModel = node.getModel();\n var nodeLayout = node.getLayout();\n var data = node.hostTree.data; // Optimize\n\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n return;\n }\n\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); // calculate border color\n\n var borderColor = nodeItemStyleModel.get('borderColor');\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n var thisNodeColor;\n\n if (borderColorSaturation != null) {\n // For performance, do not always execute 'calculateColor'.\n thisNodeColor = calculateColor(visuals);\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n }\n\n existsStyle.stroke = borderColor;\n var viewChildren = node.viewChildren;\n\n if (!viewChildren || !viewChildren.length) {\n thisNodeColor = calculateColor(visuals); // Apply visual to this node.\n\n existsStyle.fill = thisNodeColor;\n } else {\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children.\n\n each(viewChildren, function (child, index) {\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\n }\n });\n }\n}\n\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\n var visuals = extend({}, designatedVisual);\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\n var val = nodeItemStyleModel.get(visualName);\n designatedVisualItemStyle[visualName] = null;\n val != null && (visuals[visualName] = val);\n });\n return visuals;\n}\n\nfunction calculateColor(visuals) {\n var color = getValueVisualDefine(visuals, 'color');\n\n if (color) {\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n\n if (colorSaturation) {\n color = modifyHSL(color, null, null, colorSaturation);\n }\n\n if (colorAlpha) {\n color = modifyAlpha(color, colorAlpha);\n }\n\n return color;\n }\n}\n\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n return thisNodeColor != null // Can only be string\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\n\nfunction getValueVisualDefine(visuals, name) {\n var value = visuals[name];\n\n if (value != null && value !== 'none') {\n return value;\n }\n}\n\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n if (!viewChildren || !viewChildren.length) {\n return;\n }\n\n var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n\n if (!rangeVisual) {\n return;\n }\n\n var visualMin = nodeModel.get('visualMin');\n var visualMax = nodeModel.get('visualMax');\n var dataExtent = nodeLayout.dataExtent.slice();\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n var colorMappingBy = nodeModel.get('colorMappingBy');\n var opt = {\n type: rangeVisual.name,\n dataExtent: dataExtent,\n visual: rangeVisual.range\n };\n\n if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n opt.mappingMethod = 'category';\n opt.loop = true; // categories is ordinal, so do not set opt.categories.\n } else {\n opt.mappingMethod = 'linear';\n }\n\n var mapping = new VisualMapping(opt);\n inner(mapping).drColorMappingBy = colorMappingBy;\n return mapping;\n} // Notice: If we don't have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node doesn't have children, and its siblings have children,\n// and colorRange is set on level-1, then the node cannot be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\n\n\nfunction getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exists on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}\n\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n var childVisuals = extend({}, visuals);\n\n if (mapping) {\n // Only support color, colorAlpha, colorSaturation.\n var mappingType = mapping.type;\n var colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\n var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\n }\n\n return childVisuals;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The treemap layout implementation was originally copied from\r\n* \"d3.js\" with some modifications made for this project.\r\n* (See more details in the comment of the method \"squarify\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent, MAX_SAFE_INTEGER } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from '../helper/treeHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n;\n/**\r\n * @public\r\n */\n\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n // Layout result in each node:\n // {x, y, width, height, area, borderWidth}\n var ecWidth = api.getWidth();\n var ecHeight = api.getHeight();\n var seriesOption = seriesModel.option;\n var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n var size = seriesOption.size || []; // Compatible with ec2.\n\n var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);\n var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info.\n\n var payloadType = payload && payload.type;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n var viewRoot = seriesModel.getViewRoot();\n var viewAbovePath = helper.getPathToRoot(viewRoot);\n\n if (payloadType !== 'treemapMove') {\n var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n var sort_1 = seriesOption.sort;\n\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\n // Default to be desc order.\n sort_1 = 'desc';\n }\n\n var options = {\n squareRatio: seriesOption.squareRatio,\n sort: sort_1,\n leafDepth: seriesOption.leafDepth\n }; // layout should be cleared because using updateView but not update.\n\n viewRoot.hostTree.clearLayouts(); // TODO\n // optimize: if out of view clip, do not layout.\n // But take care that if do not render node out of view clip,\n // how to calculate start po\n\n var viewRootLayout_1 = {\n x: 0,\n y: 0,\n width: rootSize[0],\n height: rootSize[1],\n area: rootSize[0] * rootSize[1]\n };\n viewRoot.setLayout(viewRootLayout_1);\n squarify(viewRoot, options, false, 0); // Supplement layout.\n\n viewRootLayout_1 = viewRoot.getLayout();\n each(viewAbovePath, function (node, index) {\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n node.setLayout(zrUtil.extend({\n dataExtent: [childValue, childValue],\n borderWidth: 0,\n upperHeight: 0\n }, viewRootLayout_1));\n });\n }\n\n var treeRoot = seriesModel.getData().tree.root;\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n seriesModel.setLayoutInfo(layoutInfo); // FIXME\n // 现在没有clip功能,暂时取ec高宽。\n\n prunning(treeRoot, // Transform to base element coordinate system.\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\n }\n};\n/**\r\n * Layout treemap with squarify algorithm.\r\n * The original presentation of this algorithm\r\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\r\n * .\r\n * The implementation of this algorithm was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * @protected\r\n * @param {module:echarts/data/Tree~TreeNode} node\r\n * @param {Object} options\r\n * @param {string} options.sort 'asc' or 'desc'\r\n * @param {number} options.squareRatio\r\n * @param {boolean} hideChildren\r\n * @param {number} depth\r\n */\n\nfunction squarify(node, options, hideChildren, depth) {\n var width;\n var height;\n\n if (node.isRemoved()) {\n return;\n }\n\n var thisLayout = node.getLayout();\n width = thisLayout.width;\n height = thisLayout.height; // Considering border and gap\n\n var nodeModel = node.getModel();\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\n var layoutOffset = borderWidth - halfGapWidth;\n var layoutOffsetUpper = upperHeight - halfGapWidth;\n node.setLayout({\n borderWidth: borderWidth,\n upperHeight: upperHeight,\n upperLabelHeight: upperLabelHeight\n }, true);\n width = mathMax(width - 2 * layoutOffset, 0);\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n var totalArea = width * height;\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n\n if (!viewChildren.length) {\n return;\n }\n\n var rect = {\n x: layoutOffset,\n y: layoutOffsetUpper,\n width: width,\n height: height\n };\n var rowFixedLength = mathMin(width, height);\n var best = Infinity; // the best row score so far\n\n var row = [];\n row.area = 0;\n\n for (var i = 0, len = viewChildren.length; i < len;) {\n var child = viewChildren[i];\n row.push(child);\n row.area += child.getLayout().area;\n var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation\n\n if (score <= best) {\n i++;\n best = score;\n } // abort, and try a different orientation\n else {\n row.area -= row.pop().getLayout().area;\n position(row, rowFixedLength, rect, halfGapWidth, false);\n rowFixedLength = mathMin(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n\n if (row.length) {\n position(row, rowFixedLength, rect, halfGapWidth, true);\n }\n\n if (!hideChildren) {\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n hideChildren = true;\n }\n }\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n squarify(viewChildren[i], options, hideChildren, depth + 1);\n }\n}\n/**\r\n * Set area to each child, and calculate data extent for visual coding.\r\n */\n\n\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}\n/**\r\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\r\n */\n\n\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n // visibleMin is not supported yet when no option.sort.\n if (!orderBy) {\n return sum;\n }\n\n var visibleMin = nodeModel.get('visibleMin');\n var len = orderedChildren.length;\n var deletePoint = len; // Always travel from little value to big value.\n\n for (var i = len - 1; i >= 0; i--) {\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n\n if (value / sum * totalArea < visibleMin) {\n deletePoint = i;\n sum -= value;\n }\n }\n\n orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n return sum;\n}\n/**\r\n * Sort\r\n */\n\n\nfunction sort(viewChildren, orderBy) {\n if (orderBy) {\n viewChildren.sort(function (a, b) {\n var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n });\n }\n\n return viewChildren;\n}\n/**\r\n * Statistic\r\n */\n\n\nfunction statistic(nodeModel, children, orderBy) {\n // Calculate sum.\n var sum = 0;\n\n for (var i = 0, len = children.length; i < len; i++) {\n sum += children[i].getValue();\n } // Statistic data extent for latter visual coding.\n // Notice: data extent should be calculate based on raw children\n // but not filtered view children, otherwise visual mapping will not\n // be stable when zoom (where children is filtered by visibleMin).\n\n\n var dimension = nodeModel.get('visualDimension');\n var dataExtent; // The same as area dimension.\n\n if (!children || !children.length) {\n dataExtent = [NaN, NaN];\n } else if (dimension === 'value' && orderBy) {\n dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n orderBy === 'asc' && dataExtent.reverse();\n } // Other dimension.\n else {\n dataExtent = [Infinity, -Infinity];\n each(children, function (child) {\n var value = child.getValue(dimension);\n value < dataExtent[0] && (dataExtent[0] = value);\n value > dataExtent[1] && (dataExtent[1] = value);\n });\n }\n\n return {\n sum: sum,\n dataExtent: dataExtent\n };\n}\n/**\r\n * Computes the score for the specified row,\r\n * as the worst aspect ratio.\r\n */\n\n\nfunction worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\r\n * Positions the specified row of nodes. Modifies `rect`.\r\n */\n\n\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as default.\n\n\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n // If targetInfo.node exists, we zoom to the node,\n // so estimate whole width and height by target node.\n var currNode = (targetInfo || {}).node;\n var defaultSize = [containerWidth, containerHeight];\n\n if (!currNode || currNode === viewRoot) {\n return defaultSize;\n }\n\n var parent;\n var viewArea = containerWidth * containerHeight;\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\n\n while (parent = currNode.parentNode) {\n // jshint ignore:line\n var sum = 0;\n var siblings = parent.children;\n\n for (var i = 0, len = siblings.length; i < len; i++) {\n sum += siblings[i].getValue();\n }\n\n var currNodeValue = currNode.getValue();\n\n if (currNodeValue === 0) {\n return defaultSize;\n }\n\n area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1.\n\n var parentModel = parent.getModel();\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\n area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n currNode = parent;\n }\n\n area < viewArea && (area = viewArea);\n var scale = Math.pow(area / viewArea, 0.5);\n return [containerWidth * scale, containerHeight * scale];\n} // Root position based on coord of containerGroup\n\n\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n if (rootRect) {\n return {\n x: rootRect.x,\n y: rootRect.y\n };\n }\n\n var defaultPosition = {\n x: 0,\n y: 0\n };\n\n if (!targetInfo) {\n return defaultPosition;\n } // If targetInfo is fetched by 'retrieveTargetInfo',\n // old tree and new tree are the same tree,\n // so the node still exists and we can visit it.\n\n\n var targetNode = targetInfo.node;\n var layout = targetNode.getLayout();\n\n if (!layout) {\n return defaultPosition;\n } // Transform coord from local to container.\n\n\n var targetCenter = [layout.width / 2, layout.height / 2];\n var node = targetNode;\n\n while (node) {\n var nodeLayout = node.getLayout();\n targetCenter[0] += nodeLayout.x;\n targetCenter[1] += nodeLayout.y;\n node = node.parentNode;\n }\n\n return {\n x: layoutInfo.width / 2 - targetCenter[0],\n y: layoutInfo.height / 2 - targetCenter[1]\n };\n} // Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\n\n\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n var nodeLayout = node.getLayout();\n var nodeInViewAbovePath = viewAbovePath[depth];\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n\n if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n return;\n }\n\n node.setLayout({\n // isInView means: viewRoot sub tree + viewAbovePath\n isInView: true,\n // invisible only means: outside view clip so that the node can not\n // see but still layout for animation preparation but not render.\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n isAboveViewRoot: isAboveViewRoot\n }, true); // Transform to child coordinate.\n\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n each(node.viewChildren || [], function (child) {\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n });\n}\n\nfunction getUpperLabelHeight(model) {\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { installTreemapAction } from './treemapAction.js';\nimport TreemapSeriesModel from './TreemapSeries.js';\nimport TreemapView from './TreemapView.js';\nimport treemapVisual from './treemapVisual.js';\nimport treemapLayout from './treemapLayout.js';\nexport function install(registers) {\n registers.registerSeriesModel(TreemapSeriesModel);\n registers.registerChartView(TreemapView);\n registers.registerVisual(treemapVisual);\n registers.registerLayout(treemapLayout);\n installTreemapAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (isNumber(category)) {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function categoryVisual(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n // Get color from palette.\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\n }\n\n categoriesData.setItemVisual(idx, 'style', style);\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < symbolVisualList.length; i++) {\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\n\n if (symbolVisual != null) {\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\n }\n }\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var categoryIdx = model.getShallow('category');\n\n if (categoryIdx != null) {\n if (isString(categoryIdx)) {\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\n }\n\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\n var style = data.ensureUniqueItemVisual(idx, 'style');\n extend(style, categoryStyle);\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < visualList.length; i++) {\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\n }\n }\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\n\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nexport default function graphEdgeVisual(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const;\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\n\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\n\n var style = itemModel.getModel('lineStyle').getLineStyle();\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n switch (existsStyle.stroke) {\n case 'source':\n {\n var nodeStyle = edge.node1.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n\n case 'target':\n {\n var nodeStyle = edge.node2.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n }\n\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar KEY_DELIMITER = '-->';\n/**\r\n * params handler\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {*}\r\n */\n\nvar getAutoCurvenessParams = function (seriesModel) {\n return seriesModel.get('autoCurveness') || null;\n};\n/**\r\n * Generate a list of edge curvatures, 20 is the default\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} appendLength\r\n * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\r\n */\n\n\nvar createCurveness = function (seriesModel, appendLength) {\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\n var length = 20;\n var curvenessList = []; // handler the function set\n\n if (zrUtil.isNumber(autoCurvenessParmas)) {\n length = autoCurvenessParmas;\n } else if (zrUtil.isArray(autoCurvenessParmas)) {\n seriesModel.__curvenessList = autoCurvenessParmas;\n return;\n } // append length\n\n\n if (appendLength > length) {\n length = appendLength;\n } // make sure the length is even\n\n\n var len = length % 2 ? length + 2 : length + 3;\n curvenessList = [];\n\n for (var i = 0; i < len; i++) {\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\n }\n\n seriesModel.__curvenessList = curvenessList;\n};\n/**\r\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {string} key\r\n */\n\n\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\n var source = [n1.id, n1.dataIndex].join('.');\n var target = [n2.id, n2.dataIndex].join('.');\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\n};\n/**\r\n * get opposite key\r\n * @param {string} key\r\n * @returns {string}\r\n */\n\n\nvar getOppositeKey = function (key) {\n var keys = key.split(KEY_DELIMITER);\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\n};\n/**\r\n * get edgeMap with key\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\n\n\nvar getEdgeFromMap = function (edge, seriesModel) {\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n return seriesModel.__edgeMap[key];\n};\n/**\r\n * calculate all cases total length\r\n * @param edge\r\n * @param seriesModel\r\n * @returns {number}\r\n */\n\n\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\n return len + lenV;\n};\n/**\r\n *\r\n * @param key\r\n */\n\n\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\n var edgeMap = seriesModel.__edgeMap;\n return edgeMap[key] ? edgeMap[key].length : 0;\n};\n/**\r\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\r\n * @see /graph/GraphSeries.js@getInitialData\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\n\n\nexport function initCurvenessList(seriesModel) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n seriesModel.__curvenessList = [];\n seriesModel.__edgeMap = {}; // calc the array of curveness List\n\n createCurveness(seriesModel);\n}\n/**\r\n * set edgeMap with key\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} index\r\n */\n\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n var key = getKeyOfEdges(n1, n2, seriesModel);\n var edgeMap = seriesModel.__edgeMap;\n var oppositeEdges = edgeMap[getOppositeKey(key)]; // set direction\n\n if (edgeMap[key] && !oppositeEdges) {\n edgeMap[key].isForward = true;\n } else if (oppositeEdges && edgeMap[key]) {\n oppositeEdges.isForward = true;\n edgeMap[key].isForward = false;\n }\n\n edgeMap[key] = edgeMap[key] || [];\n edgeMap[key].push(index);\n}\n/**\r\n * get curvature for edge\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param index\r\n */\n\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\n var isArrayParam = zrUtil.isArray(autoCurvenessParams);\n\n if (!autoCurvenessParams) {\n return null;\n }\n\n var edgeArray = getEdgeFromMap(edge, seriesModel);\n\n if (!edgeArray) {\n return null;\n }\n\n var edgeIndex = -1;\n\n for (var i = 0; i < edgeArray.length; i++) {\n if (edgeArray[i] === index) {\n edgeIndex = i;\n break;\n }\n } // if totalLen is Longer createCurveness\n\n\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\n createCurveness(seriesModel, totalLen);\n edge.lineStyle = edge.lineStyle || {}; // if is opposite edge, must set curvenss to opposite number\n\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n var curvenessList = seriesModel.__curvenessList; // if pass array no need parity\n\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\n\n if (!edgeArray.isForward) {\n // the opposite edge show outside\n var oppositeKey = getOppositeKey(curKey);\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\n var resValue = curvenessList[edgeIndex + len + parityCorrection]; // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\n\n if (needReverse) {\n // set as array may make the parity handle with the len of opposite\n if (isArrayParam) {\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n } else {\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return curvenessList[edgeIndex + len + parityCorrection];\n }\n } else {\n return curvenessList[parityCorrection + edgeIndex];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport { simpleLayout, simpleLayoutEdge } from './simpleLayoutHelper.js';\nexport default function graphSimpleLayout(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data_1 = seriesModel.getData();\n var dimensions_1 = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\n });\n\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions_1.length; i++) {\n var val = data_1.get(dimensions_1[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.}, not undefined to avoid if...else... statement\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data_1.graph, seriesModel);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function getNodeGlobalScale(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\n var groupZoom = coordSys.scaleX; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n}\nexport function getSymbolSize(node) {\n var symbolSize = node.getVisual('symbolSize');\n\n if (symbolSize instanceof Array) {\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n }\n\n return +symbolSize;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\r\n * `basedOn` can be:\r\n * 'value':\r\n * This layout is not accurate and have same bad case. For example,\r\n * if the min value is very smaller than the max value, the nodes\r\n * with the min value probably overlap even though there is enough\r\n * space to layout them. So we only use this approach in the as the\r\n * init layout of the force layout.\r\n * FIXME\r\n * Probably we do not need this method any more but use\r\n * `basedOn: 'symbolSize'` in force layout if\r\n * delay its init operations to GraphView.\r\n * 'symbolSize':\r\n * This approach work only if all of the symbol size calculated.\r\n * That is, the progressive rendering is not applied to graph.\r\n * FIXME\r\n * If progressive rendering is applied to graph some day,\r\n * probably we have to use `basedOn: 'value'`.\r\n */\n\nexport function circularLayout(seriesModel, basedOn, draggingNode, pointer) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n var count = nodeData.count();\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n\n if (!count) {\n return;\n }\n\n if (draggingNode) {\n var _a = coordSys.pointToData(pointer),\n tempX = _a[0],\n tempY = _a[1];\n\n var v = [tempX - cx, tempY - cy];\n vec2.normalize(v, v);\n vec2.scale(v, v, r);\n draggingNode.setLayout([cx + v[0], cy + v[1]], true);\n var circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']);\n rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);\n }\n\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\nvar _layoutNodesBasedOn = {\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || count);\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n },\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var sumRadian = 0;\n _symbolRadiansHalf.length = count;\n var nodeScale = getNodeGlobalScale(seriesModel);\n graph.eachNode(function (node) {\n var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add\n // some the defensive code (2px is an arbitrary value).\n\n isNaN(symbolSize) && (symbolSize = 2);\n symbolSize < 0 && (symbolSize = 0);\n symbolSize *= nodeScale;\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.\n\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n sumRadian += symbolRadianHalf * 2;\n });\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n var angle = 0;\n graph.eachNode(function (node) {\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n angle += radianHalf; // init circular layout for\n // 1. layout undefined node\n // 2. not fixed node\n\n (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n }\n};\nexport function rotateNodeLabel(node, circularRotateLabel, cx, cy) {\n var el = node.getGraphicEl(); // need to check if el exists. '-' value may not create node element.\n\n if (!el) {\n return;\n }\n\n var nodeModel = node.getModel();\n var labelRotate = nodeModel.get(['label', 'rotate']) || 0;\n var symbolPath = el.getSymbolPath();\n\n if (circularRotateLabel) {\n var pos = node.getLayout();\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n var isLeft = pos[0] < cx;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setTextConfig({\n rotation: -rad,\n position: textPosition,\n origin: 'center'\n });\n var emphasisState = symbolPath.ensureState('emphasis');\n zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\n position: textPosition\n });\n } else {\n symbolPath.setTextConfig({\n rotation: labelRotate *= Math.PI / 180\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { circularLayout } from './circularLayoutHelper.js';\nexport default function graphCircularLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n if (seriesModel.get('layout') === 'circular') {\n circularLayout(seriesModel, 'symbolSize');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* Some formulas were originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment of the method \"step\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar scaleAndAdd = vec2.scaleAndAdd; // function adjacentNode(n, e) {\n// return e.n1 === n ? e.n2 : e.n1;\n// }\n\nexport function forceLayout(inNodes, inEdges, opts) {\n var nodes = inNodes;\n var edges = inEdges;\n var rect = opts.rect;\n var width = rect.width;\n var height = rect.height;\n var center = [rect.x + width / 2, rect.y + height / 2]; // let scale = opts.scale || 1;\n\n var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (let i = 0; i < edges.length; i++) {\n // let e = edges[i];\n // let n1 = e.n1;\n // let n2 = e.n2;\n // n1.edges = n1.edges || [];\n // n2.edges = n2.edges || [];\n // n1.edges.push(e);\n // n2.edges.push(e);\n // }\n // Init position\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n\n if (!n.p) {\n n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n }\n\n n.pp = vec2.clone(n.p);\n n.edges = null;\n } // Formula in 'Graph Drawing by Force-directed Placement'\n // let k = scale * Math.sqrt(width * height / nodes.length);\n // let k2 = k * k;\n\n\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\n var friction = initialFriction;\n var beforeStepCallback;\n var afterStepCallback;\n return {\n warmUp: function () {\n friction = initialFriction * 0.8;\n },\n setFixed: function (idx) {\n nodes[idx].fixed = true;\n },\n setUnfixed: function (idx) {\n nodes[idx].fixed = false;\n },\n\n /**\r\n * Before step hook\r\n */\n beforeStep: function (cb) {\n beforeStepCallback = cb;\n },\n\n /**\r\n * After step hook\r\n */\n afterStep: function (cb) {\n afterStepCallback = cb;\n },\n\n /**\r\n * Some formulas were originally copied from \"d3.js\"\r\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\r\n * with some modifications made for this project.\r\n * See the license statement at the head of this file.\r\n */\n step: function (cb) {\n beforeStepCallback && beforeStepCallback(nodes, edges);\n var v12 = [];\n var nLen = nodes.length;\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n\n if (e.ignoreForceLayout) {\n continue;\n }\n\n var n1 = e.n1;\n var n2 = e.n2;\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12) - e.d;\n var w = n2.w / (n1.w + n2.w);\n\n if (isNaN(w)) {\n w = 0;\n }\n\n vec2.normalize(v12, v12);\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n } // Gravity\n\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v12, center, n.p); // let d = vec2.len(v12);\n // vec2.scale(v12, v12, 1 / d);\n // let gravityFactor = gravity;\n\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\n }\n } // Repulsive\n // PENDING\n\n\n for (var i = 0; i < nLen; i++) {\n var n1 = nodes[i];\n\n for (var j = i + 1; j < nLen; j++) {\n var n2 = nodes[j];\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12);\n\n if (d === 0) {\n // Random repulse\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n d = 1;\n }\n\n var repFact = (n1.rep + n2.rep) / d / d;\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n }\n }\n\n var v = [];\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v, n.p, n.pp);\n scaleAndAdd(n.p, n.p, v, friction);\n vec2.copy(n.pp, n.p);\n }\n }\n\n friction = friction * 0.992;\n var finished = friction < 0.01;\n afterStepCallback && afterStepCallback(nodes, edges, finished);\n cb && cb(finished);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { forceLayout } from './forceHelper.js';\nimport { simpleLayout } from './simpleLayoutHelper.js';\nimport { circularLayout } from './circularLayoutHelper.js';\nimport { linearMap } from '../../util/number.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport default function graphForceLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var coordSys = graphSeries.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n if (graphSeries.get('layout') === 'force') {\n var preservedPoints_1 = graphSeries.preservedPoints || {};\n var graph_1 = graphSeries.getGraph();\n var nodeData_1 = graph_1.data;\n var edgeData = graph_1.edgeData;\n var forceModel = graphSeries.getModel('force');\n var initLayout = forceModel.get('initLayout');\n\n if (graphSeries.preservedPoints) {\n nodeData_1.each(function (idx) {\n var id = nodeData_1.getId(idx);\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\n });\n } else if (!initLayout || initLayout === 'none') {\n simpleLayout(graphSeries);\n } else if (initLayout === 'circular') {\n circularLayout(graphSeries, 'value');\n }\n\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\n var edgeDataExtent_1 = edgeData.getDataExtent('value'); // let edgeDataExtent = edgeData.getDataExtent('value');\n\n var repulsion = forceModel.get('repulsion');\n var edgeLength = forceModel.get('edgeLength');\n var repulsionArr_1 = zrUtil.isArray(repulsion) ? repulsion : [repulsion, repulsion];\n var edgeLengthArr_1 = zrUtil.isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; // Larger value has smaller length\n\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\n var point = nodeData_1.getItemLayout(idx);\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\n\n if (isNaN(rep)) {\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\n }\n\n return {\n w: rep,\n rep: rep,\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\n p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n };\n });\n var edges = edgeData.mapArray('value', function (value, idx) {\n var edge = graph_1.getEdgeByIndex(idx);\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\n\n if (isNaN(d)) {\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\n }\n\n var edgeModel = edge.getModel();\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\n return {\n n1: nodes_1[edge.node1.dataIndex],\n n2: nodes_1[edge.node2.dataIndex],\n d: d,\n curveness: curveness,\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\n };\n }); // let coordSys = graphSeries.coordinateSystem;\n\n var rect = coordSys.getBoundingRect();\n var forceInstance = forceLayout(nodes_1, edges, {\n rect: rect,\n gravity: forceModel.get('gravity'),\n friction: forceModel.get('friction')\n });\n forceInstance.beforeStep(function (nodes, edges) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i].fixed) {\n // Write back to layout instance\n vec2.copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\n }\n }\n });\n forceInstance.afterStep(function (nodes, edges, stopped) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (!nodes[i].fixed) {\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\n }\n\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\n }\n\n for (var i = 0, l = edges.length; i < l; i++) {\n var e = edges[i];\n var edge = graph_1.getEdgeByIndex(i);\n var p1 = e.n1.p;\n var p2 = e.n2.p;\n var points = edge.getLayout();\n points = points ? points.slice() : [];\n points[0] = points[0] || [];\n points[1] = points[1] || [];\n vec2.copy(points[0], p1);\n vec2.copy(points[1], p2);\n\n if (+e.curveness) {\n points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n }\n\n edge.setLayout(points);\n }\n });\n graphSeries.forceLayout = forceInstance;\n graphSeries.preservedPoints = preservedPoints_1; // Step to get the layout\n\n forceInstance.step();\n } else {\n // Remove prev injected forceLayout instance\n graphSeries.forceLayout = null;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\n\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max); // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n\n var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed?\n\n var viewRect = getViewRect(seriesModel, api, aspect); // Position may be NaN, use view rect instead\n\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info\n\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Line path for bezier and straight line draw\r\n */\n\nimport * as graphic from '../../util/graphic.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\n\nvar StraightLineShape =\n/** @class */\nfunction () {\n function StraightLineShape() {\n // Start point\n this.x1 = 0;\n this.y1 = 0; // End point\n\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n\n return StraightLineShape;\n}();\n\nvar CurveShape =\n/** @class */\nfunction (_super) {\n __extends(CurveShape, _super);\n\n function CurveShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return CurveShape;\n}(StraightLineShape);\n\nfunction isStraightLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\n\nvar ECLinePath =\n/** @class */\nfunction (_super) {\n __extends(ECLinePath, _super);\n\n function ECLinePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-line';\n return _this;\n }\n\n ECLinePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECLinePath.prototype.getDefaultShape = function () {\n return new StraightLineShape();\n };\n\n ECLinePath.prototype.buildPath = function (ctx, shape) {\n if (isStraightLine(shape)) {\n straightLineProto.buildPath.call(this, ctx, shape);\n } else {\n bezierCurveProto.buildPath.call(this, ctx, shape);\n }\n };\n\n ECLinePath.prototype.pointAt = function (t) {\n if (isStraightLine(this.shape)) {\n return straightLineProto.pointAt.call(this, t);\n } else {\n return bezierCurveProto.pointAt.call(this, t);\n }\n };\n\n ECLinePath.prototype.tangentAt = function (t) {\n var shape = this.shape;\n var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n };\n\n return ECLinePath;\n}(graphic.Path);\n\nexport default ECLinePath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each } from 'zrender/lib/core/util.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ECLinePath from './LinePath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { round } from '../../util/number.js';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\n\nfunction makeSymbolTypeKey(symbolCategory) {\n return '_' + symbolCategory + 'Type';\n}\n\nfunction makeSymbolTypeValue(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n\n if (!symbolType || symbolType === 'none') {\n return symbolType;\n }\n\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\n}\n/**\r\n * @inner\r\n */\n\n\nfunction createSymbol(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n\n if (!symbolType || symbolType === 'none') {\n return;\n }\n\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n symbolPath.name = name;\n return symbolPath;\n}\n\nfunction createLine(points) {\n var line = new ECLinePath({\n name: 'line',\n subPixelOptimize: true\n });\n setLinePoints(line.shape, points);\n return line;\n}\n\nfunction setLinePoints(targetShape, points) {\n targetShape.x1 = points[0][0];\n targetShape.y1 = points[0][1];\n targetShape.x2 = points[1][0];\n targetShape.y2 = points[1][1];\n targetShape.percent = 1;\n var cp1 = points[2];\n\n if (cp1) {\n targetShape.cpx1 = cp1[0];\n targetShape.cpy1 = cp1[1];\n } else {\n targetShape.cpx1 = NaN;\n targetShape.cpy1 = NaN;\n }\n}\n\nvar Line =\n/** @class */\nfunction (_super) {\n __extends(Line, _super);\n\n function Line(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createLine(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var linePoints = lineData.getItemLayout(idx);\n var line = createLine(linePoints);\n line.shape.percent = 0;\n graphic.initProps(line, {\n shape: {\n percent: 1\n }\n }, seriesModel, idx);\n this.add(line);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = createSymbol(symbolCategory, lineData, idx); // symbols must added after line to make sure\n // it will be updated after line#update.\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n\n this.add(symbol);\n this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n }; // TODO More strict on the List type in parameters?\n\n\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var linePoints = lineData.getItemLayout(idx);\n var target = {\n shape: {}\n };\n setLinePoints(target.shape, linePoints);\n graphic.updateProps(line, target, seriesModel, idx);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);\n var key = makeSymbolTypeKey(symbolCategory); // Symbol changed\n\n if (this[key] !== symbolType) {\n this.remove(this.childOfName(symbolCategory));\n var symbol = createSymbol(symbolCategory, lineData, idx);\n this.add(symbol);\n }\n\n this[key] = symbolType;\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Line.prototype.getLinePath = function () {\n return this.childAt(0);\n };\n\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope; // Optimization for large dataset\n\n if (!seriesScope || lineData.hasItemOption) {\n var itemModel = lineData.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var visualColor = lineStyle.stroke;\n line.useStyle(lineStyle);\n line.style.fill = null;\n line.style.strokeNoScale = true;\n line.ensureState('emphasis').style = emphasisLineStyle;\n line.ensureState('blur').style = blurLineStyle;\n line.ensureState('select').style = selectLineStyle; // Update symbol\n\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = this.childOfName(symbolCategory);\n\n if (symbol) {\n // Share opacity and color with line.\n symbol.setColor(visualColor);\n symbol.style.opacity = lineStyle.opacity;\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var lineState = line.getState(stateName);\n\n if (lineState) {\n var lineStateStyle = lineState.style || {};\n var state = symbol.ensureState(stateName);\n var stateStyle = state.style || (state.style = {});\n\n if (lineStateStyle.stroke != null) {\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n }\n\n if (lineStateStyle.opacity != null) {\n stateStyle.opacity = lineStateStyle.opacity;\n }\n }\n }\n\n symbol.markRedraw();\n }\n }, this);\n var rawVal = seriesModel.getRawValue(idx);\n setLabelStyle(this, labelStatesModels, {\n labelDataIndex: idx,\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n }\n },\n inheritColor: visualColor || '#000',\n defaultOpacity: lineStyle.opacity,\n defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n });\n var label = this.getTextContent(); // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n\n if (label) {\n var labelNormalModel = labelStatesModels.normal;\n label.__align = label.style.align;\n label.__verticalAlign = label.style.verticalAlign; // 'start', 'middle', 'end'\n\n label.__position = labelNormalModel.get('position') || 'middle';\n var distance = labelNormalModel.get('distance');\n\n if (!isArray(distance)) {\n distance = [distance, distance];\n }\n\n label.__labelDistance = distance;\n }\n\n this.setTextConfig({\n position: null,\n local: true,\n inside: false // Can't be inside for stroke element.\n\n });\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n Line.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n Line.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n Line.prototype.updateLayout = function (lineData, idx) {\n this.setLinePoints(lineData.getItemLayout(idx));\n };\n\n Line.prototype.setLinePoints = function (points) {\n var linePath = this.childOfName('line');\n setLinePoints(linePath.shape, points);\n linePath.dirty();\n };\n\n Line.prototype.beforeUpdate = function () {\n var lineGroup = this;\n var symbolFrom = lineGroup.childOfName('fromSymbol');\n var symbolTo = lineGroup.childOfName('toSymbol');\n var label = lineGroup.getTextContent(); // Quick reject\n\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n return;\n }\n\n var invScale = 1;\n var parentNode = this.parent;\n\n while (parentNode) {\n if (parentNode.scaleX) {\n invScale /= parentNode.scaleX;\n }\n\n parentNode = parentNode.parent;\n }\n\n var line = lineGroup.childOfName('line'); // If line not changed\n // FIXME Parent scale changed\n\n if (!this.__dirty && !line.__dirty) {\n return;\n }\n\n var percent = line.shape.percent;\n var fromPos = line.pointAt(0);\n var toPos = line.pointAt(percent);\n var d = vector.sub([], toPos, fromPos);\n vector.normalize(d, d);\n\n function setSymbolRotation(symbol, percent) {\n // Fix #12388\n // when symbol is set to be 'arrow' in markLine,\n // symbolRotate value will be ignored, and compulsively use tangent angle.\n // rotate by default if symbol rotation is not specified\n var specifiedRotation = symbol.__specifiedRotation;\n\n if (specifiedRotation == null) {\n var tangent = line.tangentAt(percent);\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n } else {\n symbol.attr('rotation', specifiedRotation);\n }\n }\n\n if (symbolFrom) {\n symbolFrom.setPosition(fromPos);\n setSymbolRotation(symbolFrom, 0);\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n symbolFrom.markRedraw();\n }\n\n if (symbolTo) {\n symbolTo.setPosition(toPos);\n setSymbolRotation(symbolTo, 1);\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n symbolTo.markRedraw();\n }\n\n if (label && !label.ignore) {\n label.x = label.y = 0;\n label.originX = label.originY = 0;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var distance = label.__labelDistance;\n var distanceX = distance[0] * invScale;\n var distanceY = distance[1] * invScale;\n var halfPercent = percent / 2;\n var tangent = line.tangentAt(halfPercent);\n var n = [tangent[1], -tangent[0]];\n var cp = line.pointAt(halfPercent);\n\n if (n[1] > 0) {\n n[0] = -n[0];\n n[1] = -n[1];\n }\n\n var dir = tangent[0] < 0 ? -1 : 1;\n\n if (label.__position !== 'start' && label.__position !== 'end') {\n var rotation = -Math.atan2(tangent[1], tangent[0]);\n\n if (toPos[0] < fromPos[0]) {\n rotation = Math.PI + rotation;\n }\n\n label.rotation = rotation;\n }\n\n var dy = void 0;\n\n switch (label.__position) {\n case 'insideStartTop':\n case 'insideMiddleTop':\n case 'insideEndTop':\n case 'middle':\n dy = -distanceY;\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideStartBottom':\n case 'insideMiddleBottom':\n case 'insideEndBottom':\n dy = distanceY;\n textVerticalAlign = 'top';\n break;\n\n default:\n dy = 0;\n textVerticalAlign = 'middle';\n }\n\n switch (label.__position) {\n case 'end':\n label.x = d[0] * distanceX + toPos[0];\n label.y = d[1] * distanceY + toPos[1];\n textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n break;\n\n case 'start':\n label.x = -d[0] * distanceX + fromPos[0];\n label.y = -d[1] * distanceY + fromPos[1];\n textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n break;\n\n case 'insideStartTop':\n case 'insideStart':\n case 'insideStartBottom':\n label.x = distanceX * dir + fromPos[0];\n label.y = fromPos[1] + dy;\n textAlign = tangent[0] < 0 ? 'right' : 'left';\n label.originX = -distanceX * dir;\n label.originY = -dy;\n break;\n\n case 'insideMiddleTop':\n case 'insideMiddle':\n case 'insideMiddleBottom':\n case 'middle':\n label.x = cp[0];\n label.y = cp[1] + dy;\n textAlign = 'center';\n label.originY = -dy;\n break;\n\n case 'insideEndTop':\n case 'insideEnd':\n case 'insideEndBottom':\n label.x = -distanceX * dir + toPos[0];\n label.y = toPos[1] + dy;\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\n label.originX = distanceX * dir;\n label.originY = -dy;\n break;\n }\n\n label.scaleX = label.scaleY = invScale;\n label.setStyle({\n // Use the user specified text align and baseline first\n verticalAlign: label.__verticalAlign || textVerticalAlign,\n align: label.__align || textAlign\n });\n }\n };\n\n return Line;\n}(graphic.Group);\n\nexport default Line;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport LineGroup from './Line.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\n\nvar LineDraw =\n/** @class */\nfunction () {\n function LineDraw(LineCtor) {\n this.group = new graphic.Group();\n this._LineCtor = LineCtor || LineGroup;\n }\n\n LineDraw.prototype.updateData = function (lineData) {\n var _this = this; // Remove progressive els.\n\n\n this._progressiveEls = null;\n var lineDraw = this;\n var group = lineDraw.group;\n var oldLineData = lineDraw._lineData;\n lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!oldLineData) {\n group.removeAll();\n }\n\n var seriesScope = makeSeriesScope(lineData);\n lineData.diff(oldLineData).add(function (idx) {\n _this._doAdd(lineData, idx, seriesScope);\n }).update(function (newIdx, oldIdx) {\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n }).remove(function (idx) {\n group.remove(oldLineData.getItemGraphicEl(idx));\n }).execute();\n };\n\n ;\n\n LineDraw.prototype.updateLayout = function () {\n var lineData = this._lineData; // Do not support update layout in incremental mode.\n\n if (!lineData) {\n return;\n }\n\n lineData.eachItemGraphicEl(function (el, idx) {\n el.updateLayout(lineData, idx);\n }, this);\n };\n\n ;\n\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n this._seriesScope = makeSeriesScope(lineData);\n this._lineData = null;\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n this._progressiveEls = [];\n\n function updateIncrementalAndHover(el) {\n if (!el.isGroup && !isEffectObject(el)) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (lineNeedsDraw(itemLayout)) {\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n this.group.add(el);\n lineData.setItemGraphicEl(idx, el);\n\n this._progressiveEls.push(el);\n }\n }\n };\n\n ;\n\n LineDraw.prototype.remove = function () {\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (!lineNeedsDraw(itemLayout)) {\n return;\n }\n\n var el = new this._LineCtor(lineData, idx, seriesScope);\n lineData.setItemGraphicEl(idx, el);\n this.group.add(el);\n };\n\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n this.group.remove(itemEl);\n return;\n }\n\n if (!itemEl) {\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n } else {\n itemEl.updateData(newLineData, newIdx, seriesScope);\n }\n\n newLineData.setItemGraphicEl(newIdx, itemEl);\n this.group.add(itemEl);\n };\n\n return LineDraw;\n}();\n\nfunction isEffectObject(el) {\n return el.animators && el.animators.length > 0;\n}\n\nfunction makeSeriesScope(lineData) {\n var hostModel = lineData.hostModel;\n var emphasisModel = hostModel.getModel('emphasis');\n return {\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n emphasisDisabled: emphasisModel.get('disabled'),\n blurScope: emphasisModel.get('blurScope'),\n focus: emphasisModel.get('focus'),\n labelStatesModels: getLabelStatesModels(hostModel)\n };\n}\n\nfunction isPointNaN(pt) {\n return isNaN(pt[0]) || isNaN(pt[1]);\n}\n\nfunction lineNeedsDraw(pts) {\n return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\n\nexport default LineDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as curveTool from 'zrender/lib/core/curve.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize } from './graphHelper.js';\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\n\nfunction intersectCurveCircle(curvePoints, center, radius) {\n var p0 = curvePoints[0];\n var p1 = curvePoints[1];\n var p2 = curvePoints[2];\n var d = Infinity;\n var t;\n var radiusSquare = radius * radius;\n var interval = 0.1;\n\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n\n if (diff < d) {\n d = diff;\n t = _t;\n }\n } // Assume the segment is monotone,Find root through Bisection method\n // At most 32 iteration\n\n\n for (var i = 0; i < 32; i++) {\n // let prev = t - interval;\n var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n var diff = v2DistSquare(v2, center) - radiusSquare;\n\n if (mathAbs(diff) < 1e-2) {\n break;\n } // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\n\n\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n interval /= 2;\n\n if (diff < 0) {\n if (nextDiff >= 0) {\n t = t + interval;\n } else {\n t = t - interval;\n }\n } else {\n if (nextDiff >= 0) {\n t = t - interval;\n } else {\n t = t + interval;\n }\n }\n }\n\n return t;\n} // Adjust edge to avoid\n\n\nexport default function adjustEdge(graph, scale) {\n var tmp0 = [];\n var quadraticSubdivide = curveTool.quadraticSubdivide;\n var pts = [[], [], []];\n var pts2 = [[], []];\n var v = [];\n scale /= 2;\n graph.eachEdge(function (edge, idx) {\n var linePoints = edge.getLayout();\n var fromSymbol = edge.getVisual('fromSymbol');\n var toSymbol = edge.getVisual('toSymbol');\n\n if (!linePoints.__original) {\n linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n\n if (linePoints[2]) {\n linePoints.__original.push(vec2.clone(linePoints[2]));\n }\n }\n\n var originalPoints = linePoints.__original; // Quadratic curve\n\n if (linePoints[2] != null) {\n vec2.copy(pts[0], originalPoints[0]);\n vec2.copy(pts[1], originalPoints[2]);\n vec2.copy(pts[2], originalPoints[1]);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[0][0] = tmp0[3];\n pts[1][0] = tmp0[4];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[0][1] = tmp0[3];\n pts[1][1] = tmp0[4];\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[1][0] = tmp0[1];\n pts[2][0] = tmp0[2];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[1][1] = tmp0[1];\n pts[2][1] = tmp0[2];\n } // Copy back to layout\n\n\n vec2.copy(linePoints[0], pts[0]);\n vec2.copy(linePoints[1], pts[2]);\n vec2.copy(linePoints[2], pts[1]);\n } // Line\n else {\n vec2.copy(pts2[0], originalPoints[0]);\n vec2.copy(pts2[1], originalPoints[1]);\n vec2.sub(v, pts2[1], pts2[0]);\n vec2.normalize(v, v);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n }\n\n vec2.copy(linePoints[0], pts2[0]);\n vec2.copy(linePoints[1], pts2[1]);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LineDraw from '../helper/LineDraw.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport adjustEdge from './adjustEdge.js';\nimport { getNodeGlobalScale } from './graphHelper.js';\nimport ChartView from '../../view/Chart.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { simpleLayoutEdge } from './simpleLayoutHelper.js';\nimport { circularLayout, rotateNodeLabel } from './circularLayoutHelper.js';\n\nfunction isViewCoordSys(coordSys) {\n return coordSys.type === 'view';\n}\n\nvar GraphView =\n/** @class */\nfunction (_super) {\n __extends(GraphView, _super);\n\n function GraphView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphView.type;\n return _this;\n }\n\n GraphView.prototype.init = function (ecModel, api) {\n var symbolDraw = new SymbolDraw();\n var lineDraw = new LineDraw();\n var group = this.group;\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n group.add(symbolDraw.group);\n group.add(lineDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineDraw = lineDraw;\n this._firstRender = true;\n };\n\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n this._model = seriesModel;\n var symbolDraw = this._symbolDraw;\n var lineDraw = this._lineDraw;\n var group = this.group;\n\n if (isViewCoordSys(coordSys)) {\n var groupNewProp = {\n x: coordSys.x,\n y: coordSys.y,\n scaleX: coordSys.scaleX,\n scaleY: coordSys.scaleY\n };\n\n if (this._firstRender) {\n group.attr(groupNewProp);\n } else {\n graphic.updateProps(group, groupNewProp, seriesModel);\n }\n } // Fix edge contact point with node\n\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n var data = seriesModel.getData();\n symbolDraw.updateData(data);\n var edgeData = seriesModel.getEdgeData(); // TODO: TYPE\n\n lineDraw.updateData(edgeData);\n\n this._updateNodeAndLinkScale();\n\n this._updateController(seriesModel, ecModel, api);\n\n clearTimeout(this._layoutTimeout);\n var forceLayout = seriesModel.forceLayout;\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\n\n if (forceLayout) {\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\n }\n\n var layout = seriesModel.get('layout');\n data.graph.eachNode(function (node) {\n var idx = node.dataIndex;\n var el = node.getGraphicEl();\n var itemModel = node.getModel();\n\n if (!el) {\n return;\n } // Update draggable\n\n\n el.off('drag').off('dragend');\n var draggable = itemModel.get('draggable');\n\n if (draggable) {\n el.on('drag', function (e) {\n switch (layout) {\n case 'force':\n forceLayout.warmUp();\n !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\n forceLayout.setFixed(idx); // Write position back to layout\n\n data.setItemLayout(idx, [el.x, el.y]);\n break;\n\n case 'circular':\n data.setItemLayout(idx, [el.x, el.y]); // mark node fixed\n\n node.setLayout({\n fixed: true\n }, true); // recalculate circular layout\n\n circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]);\n\n _this.updateLayout(seriesModel);\n\n break;\n\n case 'none':\n default:\n data.setItemLayout(idx, [el.x, el.y]); // update edge\n\n simpleLayoutEdge(seriesModel.getGraph(), seriesModel);\n\n _this.updateLayout(seriesModel);\n\n break;\n }\n }).on('dragend', function () {\n if (forceLayout) {\n forceLayout.setUnfixed(idx);\n }\n });\n }\n\n el.setDraggable(draggable, !!itemModel.get('cursor'));\n var focus = itemModel.get(['emphasis', 'focus']);\n\n if (focus === 'adjacency') {\n getECData(el).focus = node.getAdjacentDataIndices();\n }\n });\n data.graph.eachEdge(function (edge) {\n var el = edge.getGraphicEl();\n var focus = edge.getModel().get(['emphasis', 'focus']);\n\n if (!el) {\n return;\n }\n\n if (focus === 'adjacency') {\n getECData(el).focus = {\n edge: [edge.dataIndex],\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\n };\n }\n });\n var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']);\n var cx = data.getLayout('cx');\n var cy = data.getLayout('cy');\n data.graph.eachNode(function (node) {\n rotateNodeLabel(node, circularRotateLabel, cx, cy);\n });\n this._firstRender = false;\n };\n\n GraphView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\n var self = this;\n\n (function step() {\n forceLayout.step(function (stopped) {\n self.updateLayout(self._model);\n (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n });\n })();\n };\n\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\n controller.disable();\n return;\n }\n\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale();\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n _this._lineDraw.updateLayout(); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n GraphView.prototype._updateNodeAndLinkScale = function () {\n var seriesModel = this._model;\n var data = seriesModel.getData();\n var nodeScale = getNodeGlobalScale(seriesModel);\n data.eachItemGraphicEl(function (el, idx) {\n el && el.setSymbolScale(nodeScale);\n });\n };\n\n GraphView.prototype.updateLayout = function (seriesModel) {\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n this._symbolDraw.updateLayout();\n\n this._lineDraw.updateLayout();\n };\n\n GraphView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove();\n this._lineDraw && this._lineDraw.remove();\n };\n\n GraphView.type = 'graph';\n return GraphView;\n}(ChartView);\n\nexport default GraphView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // id may be function name of Object, add a prefix to avoid this problem.\n\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\r\n * @type {Object.}\r\n * @private\r\n */\n\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\r\n * If is directed graph\r\n */\n\n\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n\n ;\n /**\r\n * Add a new node\r\n */\n\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n\n return;\n }\n\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n\n ;\n /**\r\n * Get node by data index\r\n */\n\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n\n ;\n /**\r\n * Get node by id\r\n */\n\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n\n ;\n /**\r\n * Add a new edge\r\n */\n\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap; // PENDING\n\n if (zrUtil.isNumber(n1)) {\n n1 = this.nodes[n1];\n }\n\n if (zrUtil.isNumber(n2)) {\n n2 = this.nodes[n2];\n }\n\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n\n if (!n1 || !n2) {\n return;\n }\n\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n\n n1.edges.push(edge);\n\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n\n ;\n /**\r\n * Get edge by data index\r\n */\n\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n\n ;\n /**\r\n * Get edge by two linked nodes\r\n */\n\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n\n var edgesMap = this._edgesMap;\n\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n\n ;\n /**\r\n * Iterate all nodes\r\n */\n\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n\n ;\n /**\r\n * Iterate all edges\r\n */\n\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n\n ;\n /**\r\n * Breadth first traverse\r\n * Return true to stop traversing\r\n */\n\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n\n if (!startNode) {\n return;\n }\n\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n\n if (cb.call(context, startNode, null)) {\n return;\n }\n\n var queue = [startNode];\n\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n\n ; // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n }); // Update edge\n\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n\n ;\n /**\r\n * @return {module:echarts/data/Graph}\r\n */\n\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n\n return graph;\n };\n\n ;\n return Graph;\n}();\n\nvar GraphNode =\n/** @class */\nfunction () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n\n return dataIndices;\n };\n\n GraphNode.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n connectedEdgesMap.set(adjacentEdge.dataIndex, true);\n var sourceNodesQueue = [adjacentEdge.node1];\n var targetNodesQueue = [adjacentEdge.node2];\n var nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < sourceNodesQueue.length) {\n var sourceNode = sourceNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodesQueue.push(sourceNode.inEdges[j].node1);\n }\n }\n\n nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < targetNodesQueue.length) {\n var targetNode = targetNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodesQueue.push(targetNode.outEdges[j].node2);\n }\n }\n }\n\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n\n return GraphNode;\n}();\n\nvar GraphEdge =\n/** @class */\nfunction () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n } // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n\n GraphEdge.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n connectedEdgesMap.set(this.dataIndex, true);\n var sourceNodes = [this.node1];\n var targetNodes = [this.node2];\n var nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < sourceNodes.length) {\n var sourceNode = sourceNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodes.push(sourceNode.inEdges[j].node1);\n }\n }\n\n nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < targetNodes.length) {\n var targetNode = targetNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodes.push(targetNode.outEdges[j].node2);\n }\n }\n\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n\n return GraphEdge;\n}();\n\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\r\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\r\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport Graph from '../../data/Graph.js';\nimport linkSeriesData from '../../data/helper/linkSeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport createSeriesData from './createSeriesData.js';\nimport { convertOptionIdName } from '../../util/model.js';\nexport default function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createSeriesData(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensions = prepareSeriesDataSchema(nodes, {\n coordDimensions: coordDimensions,\n encodeDefine: seriesModel.getEncode()\n }).dimensions;\n nodeData = new SeriesData(dimensions, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new SeriesData(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkSeriesData({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport Model from '../../model/Model.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip.js';\nimport { initCurvenessList, createEdgeMapForCurveness } from '../helper/multipleGraphEdgeHelper.js';\n\nvar GraphSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GraphSeriesModel, _super);\n\n function GraphSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n GraphSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n\n var self = this;\n\n function getCategoriesData() {\n return self._categoriesData;\n } // Provide data for legend select\n\n\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n\n defaultEmphasis(option, 'edgeLabel', ['show']);\n };\n\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var edges = option.edges || option.links || [];\n var nodes = option.data || option.nodes || [];\n var self = this;\n\n if (nodes && edges) {\n // auto curveness\n initCurvenessList(this);\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n zrUtil.each(graph.edges, function (edge) {\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\n }, this);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n // Overwrite nodeData.getItemModel to\n nodeData.wrapMethod('getItemModel', function (model) {\n var categoriesModels = self._categoriesModels;\n var categoryIdx = model.getShallow('category');\n var categoryModel = categoriesModels[categoryIdx];\n\n if (categoryModel) {\n categoryModel.parentModel = model.parentModel;\n model.parentModel = categoryModel;\n }\n\n return model;\n }); // TODO Inherit resolveParentPath by default in Model#getModel?\n\n var oldGetModel = Model.prototype.getModel;\n\n function newGetModel(path, parentModel) {\n var model = oldGetModel.call(this, path, parentModel);\n model.resolveParentPath = resolveParentPath;\n return model;\n }\n\n edgeData.wrapMethod('getItemModel', function (model) {\n model.resolveParentPath = resolveParentPath;\n model.getModel = newGetModel;\n return model;\n });\n\n function resolveParentPath(pathArr) {\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n var newPathArr = pathArr.slice();\n\n if (pathArr[0] === 'label') {\n newPathArr[0] = 'edgeLabel';\n } else if (pathArr[1] === 'label') {\n newPathArr[1] = 'edgeLabel';\n }\n\n return newPathArr;\n }\n\n return pathArr;\n }\n }\n };\n\n GraphSeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n\n GraphSeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n GraphSeriesModel.prototype.getCategoriesData = function () {\n return this._categoriesData;\n };\n\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n if (dataType === 'edge') {\n var nodeData = this.getData();\n var params = this.getDataParams(dataIndex, dataType);\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n var sourceName = nodeData.getName(edge.node1.dataIndex);\n var targetName = nodeData.getName(edge.node2.dataIndex);\n var nameArr = [];\n sourceName != null && nameArr.push(sourceName);\n targetName != null && nameArr.push(targetName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > '),\n value: params.value,\n noValue: params.value == null\n });\n } // dataType === 'node' or empty\n\n\n var nodeMarkup = defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n return nodeMarkup;\n };\n\n GraphSeriesModel.prototype._updateCategoriesData = function () {\n var categories = zrUtil.map(this.option.categories || [], function (category) {\n // Data must has value\n return category.value != null ? category : zrUtil.extend({\n value: 0\n }, category);\n });\n var categoriesData = new SeriesData(['value'], this);\n categoriesData.initData(categories);\n this._categoriesData = categoriesData;\n this._categoriesModels = categoriesData.mapArray(function (idx) {\n return categoriesData.getItemModel(idx);\n });\n };\n\n GraphSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GraphSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\n return _super.prototype.isAnimationEnabled.call(this) // Not enable animation when do force layout\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\n };\n\n GraphSeriesModel.type = 'series.graph';\n GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n GraphSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // Default option for all coordinate systems\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // geoIndex: 0,\n legendHoverLink: true,\n layout: null,\n // Configuration of circular layout\n circular: {\n rotateLabel: false\n },\n // Configuration of force directed layout\n force: {\n initLayout: null,\n // Node repulsion. Can be an array to represent range.\n repulsion: [0, 50],\n gravity: 0.1,\n // Initial friction\n friction: 0.6,\n // Edge length. Can be an array to represent range.\n edgeLength: 30,\n layoutAnimation: true\n },\n left: 'center',\n top: 'center',\n // right: null,\n // bottom: null,\n // width: '80%',\n // height: '80%',\n symbol: 'circle',\n symbolSize: 10,\n edgeSymbol: ['none', 'none'],\n edgeSymbolSize: 10,\n edgeLabel: {\n position: 'middle',\n distance: 5\n },\n draggable: false,\n roam: false,\n // Default on center of graph\n center: null,\n zoom: 1,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.6,\n // cursor: null,\n // categories: [],\n // data: []\n // Or\n // nodes: []\n //\n // links: []\n // Or\n // edges: []\n label: {\n show: false,\n formatter: '{b}'\n },\n itemStyle: {},\n lineStyle: {\n color: '#aaa',\n width: 1,\n opacity: 0.5\n },\n emphasis: {\n scale: true,\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return GraphSeriesModel;\n}(SeriesModel);\n\nexport default GraphSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport categoryFilter from './categoryFilter.js';\nimport categoryVisual from './categoryVisual.js';\nimport edgeVisual from './edgeVisual.js';\nimport simpleLayout from './simpleLayout.js';\nimport circularLayout from './circularLayout.js';\nimport forceLayout from './forceLayout.js';\nimport createView from './createView.js';\nimport View from '../../coord/View.js';\nimport GraphView from './GraphView.js';\nimport GraphSeriesModel from './GraphSeries.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionInfo = {\n type: 'graphRoam',\n event: 'graphRoam',\n update: 'none'\n};\nexport function install(registers) {\n registers.registerChartView(GraphView);\n registers.registerSeriesModel(GraphSeriesModel);\n registers.registerProcessor(categoryFilter);\n registers.registerVisual(categoryVisual);\n registers.registerVisual(edgeVisual);\n registers.registerLayout(simpleLayout);\n registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\n registers.registerLayout(forceLayout);\n registers.registerCoordinateSystem('graphView', {\n dimensions: View.dimensions,\n create: createView\n }); // Register legacy focus actions\n\n registers.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n }, noop);\n registers.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n }, noop); // Register roam action.\n\n registers.registerAction(actionInfo, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\n\nvar PointerShape =\n/** @class */\nfunction () {\n function PointerShape() {\n this.angle = 0;\n this.width = 10;\n this.r = 10;\n this.x = 0;\n this.y = 0;\n }\n\n return PointerShape;\n}();\n\nvar PointerPath =\n/** @class */\nfunction (_super) {\n __extends(PointerPath, _super);\n\n function PointerPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'pointer';\n return _this;\n }\n\n PointerPath.prototype.getDefaultShape = function () {\n return new PointerShape();\n };\n\n PointerPath.prototype.buildPath = function (ctx, shape) {\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n var r = shape.r;\n var width = shape.width;\n var angle = shape.angle;\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n angle = shape.angle - Math.PI / 2;\n ctx.moveTo(x, y);\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n ctx.lineTo(x, y);\n };\n\n return PointerPath;\n}(Path);\n\nexport default PointerPath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport PointerPath from './PointerPath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { createTextStyle, setLabelValueAnimation, animateLabelValue } from '../../label/labelStyle.js';\nimport ChartView from '../../view/Chart.js';\nimport { parsePercent, round, linearMap } from '../../util/number.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { extend, isFunction, isString, isNumber, each } from 'zrender/lib/core/util.js';\nimport { setCommonECData } from '../../util/innerStore.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\n\nfunction parsePosition(seriesModel, api) {\n var center = seriesModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], api.getWidth());\n var cy = parsePercent(center[1], api.getHeight());\n var r = parsePercent(seriesModel.get('radius'), size / 2);\n return {\n cx: cx,\n cy: cy,\n r: r\n };\n}\n\nfunction formatLabel(value, labelFormatter) {\n var label = value == null ? '' : value + '';\n\n if (labelFormatter) {\n if (isString(labelFormatter)) {\n label = labelFormatter.replace('{value}', label);\n } else if (isFunction(labelFormatter)) {\n label = labelFormatter(value);\n }\n }\n\n return label;\n}\n\nvar GaugeView =\n/** @class */\nfunction (_super) {\n __extends(GaugeView, _super);\n\n function GaugeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeView.type;\n return _this;\n }\n\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\n var posInfo = parsePosition(seriesModel, api);\n\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n\n this._data = seriesModel.getData();\n };\n\n GaugeView.prototype.dispose = function () {};\n\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\n var group = this.group;\n var clockwise = seriesModel.get('clockwise');\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n var axisLineModel = seriesModel.getModel('axisLine');\n var roundCap = axisLineModel.get('roundCap');\n var MainPath = roundCap ? Sausage : graphic.Sector;\n var showAxis = axisLineModel.get('show');\n var lineStyleModel = axisLineModel.getModel('lineStyle');\n var axisLineWidth = lineStyleModel.get('width');\n var angles = [startAngle, endAngle];\n normalizeArcAngles(angles, !clockwise);\n startAngle = angles[0];\n endAngle = angles[1];\n var angleRangeSpan = endAngle - startAngle;\n var prevEndAngle = startAngle;\n var sectors = [];\n\n for (var i = 0; showAxis && i < colorList.length; i++) {\n // Clamp\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n endAngle = startAngle + angleRangeSpan * percent;\n var sector = new MainPath({\n shape: {\n startAngle: prevEndAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: posInfo.r - axisLineWidth,\n r: posInfo.r\n },\n silent: true\n });\n sector.setStyle({\n fill: colorList[i][1]\n });\n sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc\n // so the properties for stroking are useless\n ['color', 'width']));\n sectors.push(sector);\n prevEndAngle = endAngle;\n }\n\n sectors.reverse();\n each(sectors, function (sector) {\n return group.add(sector);\n });\n\n var getColor = function (percent) {\n // Less than 0\n if (percent <= 0) {\n return colorList[0][1];\n }\n\n var i;\n\n for (i = 0; i < colorList.length; i++) {\n if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n return colorList[i][1];\n }\n } // More than 1\n\n\n return colorList[i - 1][1];\n };\n\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\n\n this._renderAnchor(seriesModel, posInfo);\n\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n };\n\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var cx = posInfo.cx;\n var cy = posInfo.cy;\n var r = posInfo.r;\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var splitLineModel = seriesModel.getModel('splitLine');\n var tickModel = seriesModel.getModel('axisTick');\n var labelModel = seriesModel.getModel('axisLabel');\n var splitNumber = seriesModel.get('splitNumber');\n var subSplitNumber = tickModel.get('splitNumber');\n var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n var tickLen = parsePercent(tickModel.get('length'), r);\n var angle = startAngle;\n var step = (endAngle - startAngle) / splitNumber;\n var subStep = step / subSplitNumber;\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n var splitLineDistance = splitLineModel.get('distance');\n var unitX;\n var unitY;\n\n for (var i = 0; i <= splitNumber; i++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle); // Split line\n\n if (splitLineModel.get('show')) {\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\n var splitLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - splitLineLen - distance) + cx,\n y2: unitY * (r - splitLineLen - distance) + cy\n },\n style: splitLineStyle,\n silent: true\n });\n\n if (splitLineStyle.stroke === 'auto') {\n splitLine.setStyle({\n stroke: getColor(i / splitNumber)\n });\n }\n\n group.add(splitLine);\n } // Label\n\n\n if (labelModel.get('show')) {\n var distance = labelModel.get('distance') + splitLineDistance;\n var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n var autoColor = getColor(i / splitNumber);\n var textStyleX = unitX * (r - splitLineLen - distance) + cx;\n var textStyleY = unitY * (r - splitLineLen - distance) + cy;\n var rotateType = labelModel.get('rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = -angle + 2 * Math.PI;\n\n if (rotate > Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = -angle - Math.PI / 2;\n } else if (isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n\n if (rotate === 0) {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle',\n align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true\n }));\n } else {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: 'middle',\n align: 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true,\n originX: textStyleX,\n originY: textStyleY,\n rotation: rotate\n }));\n }\n } // Axis tick\n\n\n if (tickModel.get('show') && i !== splitNumber) {\n var distance = tickModel.get('distance');\n distance = distance ? distance + axisLineWidth : axisLineWidth;\n\n for (var j = 0; j <= subSplitNumber; j++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle);\n var tickLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - tickLen - distance) + cx,\n y2: unitY * (r - tickLen - distance) + cy\n },\n silent: true,\n style: tickLineStyle\n });\n\n if (tickLineStyle.stroke === 'auto') {\n tickLine.setStyle({\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\n });\n }\n\n group.add(tickLine);\n angle += subStep;\n }\n\n angle -= subStep;\n } else {\n angle += step;\n }\n }\n };\n\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var oldData = this._data;\n var oldProgressData = this._progressEls;\n var progressList = [];\n var showPointer = seriesModel.get(['pointer', 'show']);\n var progressModel = seriesModel.getModel('progress');\n var showProgress = progressModel.get('show');\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var valueExtent = [minVal, maxVal];\n var angleExtent = [startAngle, endAngle];\n\n function createPointer(idx, angle) {\n var itemModel = data.getItemModel(idx);\n var pointerModel = itemModel.getModel('pointer');\n var pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\n var pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\n var pointerStr = seriesModel.get(['pointer', 'icon']);\n var pointerOffset = pointerModel.get('offsetCenter');\n var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\n var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\n var pointerKeepAspect = pointerModel.get('keepAspect');\n var pointer; // not exist icon type will be set 'rect'\n\n if (pointerStr) {\n pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\n } else {\n pointer = new PointerPath({\n shape: {\n angle: -Math.PI / 2,\n width: pointerWidth,\n r: pointerLength,\n x: pointerOffsetX,\n y: pointerOffsetY\n }\n });\n }\n\n pointer.rotation = -(angle + Math.PI / 2);\n pointer.x = posInfo.cx;\n pointer.y = posInfo.cy;\n return pointer;\n }\n\n function createProgress(idx, endAngle) {\n var roundCap = progressModel.get('roundCap');\n var ProgressPath = roundCap ? Sausage : graphic.Sector;\n var isOverlap = progressModel.get('overlap');\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\n var progress = new ProgressPath({\n shape: {\n startAngle: startAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: r0,\n r: r\n }\n });\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\n return progress;\n }\n\n if (showProgress || showPointer) {\n data.diff(oldData).add(function (idx) {\n var val = data.get(valueDim, idx);\n\n if (showPointer) {\n var pointer = createPointer(idx, startAngle); // TODO hide pointer on NaN value?\n\n graphic.initProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(idx, pointer);\n }\n\n if (showProgress) {\n var progress = createProgress(idx, startAngle);\n var isClip = progressModel.get('clip');\n graphic.initProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);\n progressList[idx] = progress;\n }\n }).update(function (newIdx, oldIdx) {\n var val = data.get(valueDim, newIdx);\n\n if (showPointer) {\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\n var pointer = createPointer(newIdx, previousRotate);\n pointer.rotation = previousRotate;\n graphic.updateProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(newIdx, pointer);\n }\n\n if (showProgress) {\n var previousProgress = oldProgressData[oldIdx];\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\n var progress = createProgress(newIdx, previousEndAngle);\n var isClip = progressModel.get('clip');\n graphic.updateProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);\n progressList[newIdx] = progress;\n }\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n\n if (showPointer) {\n var pointer = data.getItemGraphicEl(idx);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (pointer instanceof ZRImage) {\n var pathStyle = pointer.style;\n pointer.useStyle(extend({\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n pointer.useStyle(symbolStyle);\n pointer.type !== 'pointer' && pointer.setColor(visualColor);\n }\n\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\n\n if (pointer.style.fill === 'auto') {\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n }\n\n pointer.z2EmphasisLift = 0;\n setStatesStylesFromModel(pointer, itemModel);\n toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);\n }\n\n if (showProgress) {\n var progress = progressList[idx];\n progress.useStyle(data.getItemVisual(idx, 'style'));\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\n progress.z2EmphasisLift = 0;\n setStatesStylesFromModel(progress, itemModel);\n toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);\n }\n });\n this._progressEls = progressList;\n }\n };\n\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\n var anchorModel = seriesModel.getModel('anchor');\n var showAnchor = anchorModel.get('show');\n\n if (showAnchor) {\n var anchorSize = anchorModel.get('size');\n var anchorType = anchorModel.get('icon');\n var offsetCenter = anchorModel.get('offsetCenter');\n var anchorKeepAspect = anchorModel.get('keepAspect');\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\n this.group.add(anchor);\n }\n };\n\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\n var _this = this;\n\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var contentGroup = new graphic.Group();\n var newTitleEls = [];\n var newDetailEls = [];\n var hasAnimation = seriesModel.isAnimationEnabled();\n var showPointerAbove = seriesModel.get(['pointer', 'showAbove']);\n data.diff(this._data).add(function (idx) {\n newTitleEls[idx] = new graphic.Text({\n silent: true\n });\n newDetailEls[idx] = new graphic.Text({\n silent: true\n });\n }).update(function (idx, oldIdx) {\n newTitleEls[idx] = _this._titleEls[oldIdx];\n newDetailEls[idx] = _this._detailEls[oldIdx];\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var value = data.get(valueDim, idx);\n var itemGroup = new graphic.Group();\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n var itemTitleModel = itemModel.getModel('title');\n\n if (itemTitleModel.get('show')) {\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\n var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\n var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\n var labelEl = newTitleEls[idx];\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemTitleModel, {\n x: titleX,\n y: titleY,\n text: data.getName(idx),\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: autoColor\n })\n });\n itemGroup.add(labelEl);\n }\n\n var itemDetailModel = itemModel.getModel('detail');\n\n if (itemDetailModel.get('show')) {\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\n var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\n var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\n var width = parsePercent(itemDetailModel.get('width'), posInfo.r);\n var height = parsePercent(itemDetailModel.get('height'), posInfo.r);\n var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor;\n var labelEl = newDetailEls[idx];\n var formatter_1 = itemDetailModel.get('formatter');\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemDetailModel, {\n x: detailX,\n y: detailY,\n text: formatLabel(value, formatter_1),\n width: isNaN(width) ? null : width,\n height: isNaN(height) ? null : height,\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: detailColor\n })\n });\n setLabelValueAnimation(labelEl, {\n normal: itemDetailModel\n }, value, function (value) {\n return formatLabel(value, formatter_1);\n });\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\n getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) {\n return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);\n }\n });\n itemGroup.add(labelEl);\n }\n\n contentGroup.add(itemGroup);\n });\n this.group.add(contentGroup);\n this._titleEls = newTitleEls;\n this._detailEls = newDetailEls;\n };\n\n GaugeView.type = 'gauge';\n return GaugeView;\n}(ChartView);\n\nexport default GaugeView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar GaugeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GaugeSeriesModel, _super);\n\n function GaugeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeSeriesModel.type;\n _this.visualStyleAccessPath = 'itemStyle';\n return _this;\n }\n\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, ['value']);\n };\n\n GaugeSeriesModel.type = 'series.gauge';\n GaugeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n legendHoverLink: true,\n radius: '75%',\n startAngle: 225,\n endAngle: -45,\n clockwise: true,\n // 最小值\n min: 0,\n // 最大值\n max: 100,\n // 分割段数,默认为10\n splitNumber: 10,\n // 坐标轴线\n axisLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n roundCap: false,\n lineStyle: {\n color: [[1, '#E6EBF8']],\n width: 10\n }\n },\n // 坐标轴线\n progress: {\n // 默认显示,属性show控制显示与否\n show: false,\n overlap: true,\n width: 10,\n roundCap: false,\n clip: true\n },\n // 分隔线\n splitLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n // 属性length控制线长\n length: 10,\n distance: 10,\n // 属性lineStyle(详见lineStyle)控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 3,\n type: 'solid'\n }\n },\n // 坐标轴小标记\n axisTick: {\n // 属性show控制显示与否,默认不显示\n show: true,\n // 每份split细分多少段\n splitNumber: 5,\n // 属性length控制线长\n length: 6,\n distance: 10,\n // 属性lineStyle控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 1,\n type: 'solid'\n }\n },\n axisLabel: {\n show: true,\n distance: 15,\n // formatter: null,\n color: '#464646',\n fontSize: 12,\n rotate: 0\n },\n pointer: {\n icon: null,\n offsetCenter: [0, 0],\n show: true,\n showAbove: true,\n length: '60%',\n width: 6,\n keepAspect: false\n },\n anchor: {\n show: false,\n showAbove: false,\n size: 6,\n icon: 'circle',\n offsetCenter: [0, 0],\n keepAspect: false,\n itemStyle: {\n color: '#fff',\n borderWidth: 0,\n borderColor: '#5470c6'\n }\n },\n title: {\n show: true,\n // x, y,单位px\n offsetCenter: [0, '20%'],\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 16,\n valueAnimation: false\n },\n detail: {\n show: true,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n borderColor: '#ccc',\n width: 100,\n height: null,\n padding: [5, 10],\n // x, y,单位px\n offsetCenter: [0, '40%'],\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 30,\n fontWeight: 'bold',\n lineHeight: 30,\n valueAnimation: false\n }\n };\n return GaugeSeriesModel;\n}(SeriesModel);\n\nexport default GaugeSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport GaugeView from './GaugeView.js';\nimport GaugeSeriesModel from './GaugeSeries.js';\nexport function install(registers) {\n registers.registerChartView(GaugeView);\n registers.registerSeriesModel(GaugeSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\n\nvar FunnelPiece =\n/** @class */\nfunction (_super) {\n __extends(FunnelPiece, _super);\n\n function FunnelPiece(data, idx) {\n var _this = _super.call(this) || this;\n\n var polygon = _this;\n var labelLine = new graphic.Polyline();\n var text = new graphic.Text();\n polygon.setTextContent(text);\n\n _this.setTextGuideLine(labelLine);\n\n _this.updateData(data, idx, true);\n\n return _this;\n }\n\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\n var polygon = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var opacity = itemModel.get(opacityAccessPath);\n opacity = opacity == null ? 1 : opacity;\n\n if (!firstCreate) {\n saveOldStyle(polygon);\n } // Update common style\n\n\n polygon.useStyle(data.getItemVisual(idx, 'style'));\n polygon.style.lineJoin = 'round';\n\n if (firstCreate) {\n polygon.setShape({\n points: layout.points\n });\n polygon.style.opacity = 0;\n graphic.initProps(polygon, {\n style: {\n opacity: opacity\n }\n }, seriesModel, idx);\n } else {\n graphic.updateProps(polygon, {\n style: {\n opacity: opacity\n },\n shape: {\n points: layout.points\n }\n }, seriesModel, idx);\n }\n\n setStatesStylesFromModel(polygon, itemModel);\n\n this._updateLabel(data, idx);\n\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n FunnelPiece.prototype._updateLabel = function (data, idx) {\n var polygon = this;\n var labelLine = this.getTextGuideLine();\n var labelText = polygon.getTextContent();\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style.fill;\n setLabelStyle( // position will not be used in setLabelStyle\n labelText, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: data.getName(idx)\n }, {\n normal: {\n align: labelLayout.textAlign,\n verticalAlign: labelLayout.verticalAlign\n }\n });\n polygon.setTextConfig({\n local: true,\n inside: !!labelLayout.inside,\n insideStroke: visualColor,\n // insideFill: 'auto',\n outsideFill: visualColor\n });\n var linePoints = labelLayout.linePoints;\n labelLine.setShape({\n points: linePoints\n });\n polygon.textGuideLineConfig = {\n anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\n }; // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n originX: labelLayout.x,\n originY: labelLayout.y,\n z2: 10\n });\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\n // Default use item visual color\n stroke: visualColor\n });\n };\n\n return FunnelPiece;\n}(graphic.Polygon);\n\nvar FunnelView =\n/** @class */\nfunction (_super) {\n __extends(FunnelView, _super);\n\n function FunnelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelView.type;\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n data.diff(oldData).add(function (idx) {\n var funnelPiece = new FunnelPiece(data, idx);\n data.setItemGraphicEl(idx, funnelPiece);\n group.add(funnelPiece);\n }).update(function (newIdx, oldIdx) {\n var piece = oldData.getItemGraphicEl(oldIdx);\n piece.updateData(data, newIdx);\n group.add(piece);\n data.setItemGraphicEl(newIdx, piece);\n }).remove(function (idx) {\n var piece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piece, seriesModel, idx);\n }).execute();\n this._data = data;\n };\n\n FunnelView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n FunnelView.prototype.dispose = function () {};\n\n FunnelView.type = 'funnel';\n return FunnelView;\n}(ChartView);\n\nexport default FunnelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar FunnelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(FunnelSeriesModel, _super);\n\n function FunnelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelSeriesModel.type;\n return _this;\n }\n\n FunnelSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)); // Extend labelLine emphasis\n\n this._defaultLabelLine(option);\n };\n\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n }; // Overwrite\n\n\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n\n var params = _super.prototype.getDataParams.call(this, dataIndex);\n\n var valueDim = data.mapDimension('value');\n var sum = data.getSum(valueDim); // Percent is 0 if sum is 0\n\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n params.$vars.push('percent');\n return params;\n };\n\n FunnelSeriesModel.type = 'series.funnel';\n FunnelSeriesModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n // 默认取数据最小最大值\n // min: 0,\n // max: 100,\n minSize: '0%',\n maxSize: '100%',\n sort: 'descending',\n orient: 'vertical',\n gap: 0,\n funnelAlign: 'center',\n label: {\n show: true,\n position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n labelLine: {\n show: true,\n length: 20,\n lineStyle: {\n // color: 各异,\n width: 1\n }\n },\n itemStyle: {\n // color: 各异,\n borderColor: '#fff',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return FunnelSeriesModel;\n}(SeriesModel);\n\nexport default FunnelSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as layout from '../../util/layout.js';\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction getSortedIndices(data, sort) {\n var valueDim = data.mapDimension('value');\n var valueArr = data.mapArray(valueDim, function (val) {\n return val;\n });\n var indices = [];\n var isAscending = sort === 'ascending';\n\n for (var i = 0, len = data.count(); i < len; i++) {\n indices[i] = i;\n } // Add custom sortable function & none sortable opetion by \"options.sort\"\n\n\n if (isFunction(sort)) {\n indices.sort(sort);\n } else if (sort !== 'none') {\n indices.sort(function (a, b) {\n return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n });\n }\n\n return indices;\n}\n\nfunction labelLayout(data) {\n var seriesModel = data.hostModel;\n var orient = seriesModel.get('orient');\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n var labelPosition = labelModel.get('position');\n var labelLineModel = itemModel.getModel('labelLine');\n var layout = data.getItemLayout(idx);\n var points = layout.points;\n var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\n var textAlign;\n var textX;\n var textY;\n var linePoints;\n\n if (isLabelInside) {\n if (labelPosition === 'insideLeft') {\n textX = (points[0][0] + points[3][0]) / 2 + 5;\n textY = (points[0][1] + points[3][1]) / 2;\n textAlign = 'left';\n } else if (labelPosition === 'insideRight') {\n textX = (points[1][0] + points[2][0]) / 2 - 5;\n textY = (points[1][1] + points[2][1]) / 2;\n textAlign = 'right';\n } else {\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n textAlign = 'center';\n }\n\n linePoints = [[textX, textY], [textX, textY]];\n } else {\n var x1 = void 0;\n var y1 = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var labelLineLen = labelLineModel.get('length');\n\n if (process.env.NODE_ENV !== 'production') {\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\n labelPosition = 'left';\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\n }\n\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\n labelPosition = 'bottom';\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\n }\n }\n\n if (labelPosition === 'left') {\n // Left side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n } else if (labelPosition === 'right') {\n // Right side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n } else if (labelPosition === 'top') {\n // Top side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else if (labelPosition === 'bottom') {\n // Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else if (labelPosition === 'rightTop') {\n // RightTop side\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'top';\n }\n } else if (labelPosition === 'rightBottom') {\n // RightBottom side\n x1 = points[2][0];\n y1 = points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'bottom';\n }\n } else if (labelPosition === 'leftTop') {\n // LeftTop side\n x1 = points[0][0];\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else if (labelPosition === 'leftBottom') {\n // LeftBottom side\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else {\n // Right side or Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n }\n }\n\n if (orient === 'horizontal') {\n x2 = x1;\n textX = x2;\n } else {\n y2 = y1;\n textY = y2;\n }\n\n linePoints = [[x1, y1], [x2, y2]];\n }\n\n layout.label = {\n linePoints: linePoints,\n x: textX,\n y: textY,\n verticalAlign: 'middle',\n textAlign: textAlign,\n inside: isLabelInside\n };\n });\n}\n\nexport default function funnelLayout(ecModel, api) {\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var sort = seriesModel.get('sort');\n var viewRect = getViewRect(seriesModel, api);\n var orient = seriesModel.get('orient');\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var indices = getSortedIndices(data, sort);\n var x = viewRect.x;\n var y = viewRect.y;\n var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];\n var dataExtent = data.getDataExtent(valueDim);\n var min = seriesModel.get('min');\n var max = seriesModel.get('max');\n\n if (min == null) {\n min = Math.min(dataExtent[0], 0);\n }\n\n if (max == null) {\n max = dataExtent[1];\n }\n\n var funnelAlign = seriesModel.get('funnelAlign');\n var gap = seriesModel.get('gap');\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\n\n var getLinePoints = function (idx, offset) {\n // End point index is data.count() and we assign it 0\n if (orient === 'horizontal') {\n var val_1 = data.get(valueDim, idx) || 0;\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\n var y0 = void 0;\n\n switch (funnelAlign) {\n case 'top':\n y0 = y;\n break;\n\n case 'center':\n y0 = y + (viewHeight - itemHeight) / 2;\n break;\n\n case 'bottom':\n y0 = y + (viewHeight - itemHeight);\n break;\n }\n\n return [[offset, y0], [offset, y0 + itemHeight]];\n }\n\n var val = data.get(valueDim, idx) || 0;\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n var x0;\n\n switch (funnelAlign) {\n case 'left':\n x0 = x;\n break;\n\n case 'center':\n x0 = x + (viewWidth - itemWidth) / 2;\n break;\n\n case 'right':\n x0 = x + viewWidth - itemWidth;\n break;\n }\n\n return [[x0, offset], [x0 + itemWidth, offset]];\n };\n\n if (sort === 'ascending') {\n // From bottom to top\n itemSize = -itemSize;\n gap = -gap;\n\n if (orient === 'horizontal') {\n x += viewWidth;\n } else {\n y += viewHeight;\n }\n\n indices = indices.reverse();\n }\n\n for (var i = 0; i < indices.length; i++) {\n var idx = indices[i];\n var nextIdx = indices[i + 1];\n var itemModel = data.getItemModel(idx);\n\n if (orient === 'horizontal') {\n var width = itemModel.get(['itemStyle', 'width']);\n\n if (width == null) {\n width = itemSize;\n } else {\n width = parsePercent(width, viewWidth);\n\n if (sort === 'ascending') {\n width = -width;\n }\n }\n\n var start = getLinePoints(idx, x);\n var end = getLinePoints(nextIdx, x + width);\n x += width + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n } else {\n var height = itemModel.get(['itemStyle', 'height']);\n\n if (height == null) {\n height = itemSize;\n } else {\n height = parsePercent(height, viewHeight);\n\n if (sort === 'ascending') {\n height = -height;\n }\n }\n\n var start = getLinePoints(idx, y);\n var end = getLinePoints(nextIdx, y + height);\n y += height + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n }\n }\n\n labelLayout(data);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport FunnelView from './FunnelView.js';\nimport FunnelSeriesModel from './FunnelSeries.js';\nimport funnelLayout from './funnelLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(FunnelView);\n registers.registerSeriesModel(FunnelSeriesModel);\n registers.registerLayout(funnelLayout);\n registers.registerProcessor(dataFilter('funnel'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { numericToNumber } from '../../util/number.js';\nimport { eqNaN } from 'zrender/lib/core/util.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar DEFAULT_SMOOTH = 0.3;\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n _this._dataGroup = new graphic.Group();\n _this._initialized = false;\n return _this;\n }\n\n ParallelView.prototype.init = function () {\n this.group.add(this._dataGroup);\n };\n /**\r\n * @override\r\n */\n\n\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var dataGroup = this._dataGroup;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n data.diff(oldData).add(add).update(update).remove(remove).execute();\n\n function add(newDataIndex) {\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function update(newDataIndex, oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n data.setItemGraphicEl(newDataIndex, line);\n graphic.updateProps(line, {\n shape: {\n points: points\n }\n }, seriesModel, newDataIndex);\n saveOldStyle(line);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function remove(oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n dataGroup.remove(line);\n } // First create\n\n\n if (!this._initialized) {\n this._initialized = true;\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n // Callback will be invoked immediately if there is no animation\n setTimeout(function () {\n dataGroup.removeClipPath();\n });\n });\n dataGroup.setClipPath(clipPath);\n }\n\n this._data = data;\n };\n\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._initialized = true;\n this._data = null;\n\n this._dataGroup.removeAll();\n };\n\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n var progressiveEls = this._progressiveEls = [];\n\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n line.incremental = true;\n updateElCommon(line, data, dataIndex, seriesScope);\n progressiveEls.push(line);\n }\n };\n\n ParallelView.prototype.remove = function () {\n this._dataGroup && this._dataGroup.removeAll();\n this._data = null;\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ChartView);\n\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n var parallelModel = coordSys.model;\n var rect = coordSys.getRect();\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n rectEl.setShape(dim, 0);\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width,\n height: rect.height\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n var points = [];\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimName = dimensions[i];\n var value = data.get(data.mapDimension(dimName), dataIndex);\n\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n points.push(coordSys.dataToPoint(value, dimName));\n }\n }\n\n return points;\n}\n\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n var line = new graphic.Polyline({\n shape: {\n points: points\n },\n // silent: true,\n z2: 10\n });\n dataGroup.add(line);\n data.setItemGraphicEl(dataIndex, line);\n return line;\n}\n\nfunction makeSeriesScope(seriesModel) {\n var smooth = seriesModel.get('smooth', true);\n smooth === true && (smooth = DEFAULT_SMOOTH);\n smooth = numericToNumber(smooth);\n eqNaN(smooth) && (smooth = 0);\n return {\n smooth: smooth\n };\n}\n\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.fill = null;\n el.setShape('smooth', seriesScope.smooth);\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n} // function simpleDiff(oldData, newData, dimensions) {\n// let oldLen;\n// if (!oldData\n// || !oldData.__plProgressive\n// || (oldLen = oldData.count()) !== newData.count()\n// ) {\n// return true;\n// }\n// let dimLen = dimensions.length;\n// for (let i = 0; i < oldLen; i++) {\n// for (let j = 0; j < dimLen; j++) {\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n// return true;\n// }\n// }\n// }\n// return false;\n// }\n// FIXME put in common util?\n\n\nfunction isEmptyValue(val, axisType) {\n return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\n\nexport default ParallelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { each, bind } from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\n\nvar ParallelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelSeriesModel, _super);\n\n function ParallelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\n });\n };\n /**\r\n * User can get data raw indices on 'axisAreaSelected' event received.\r\n *\r\n * @return Raw indices\r\n */\n\n\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\n var coordSys = this.coordinateSystem;\n var data = this.getData();\n var indices = [];\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n if (activeState === theActiveState) {\n indices.push(data.getRawIndex(dataIndex));\n }\n });\n return indices;\n };\n\n ParallelSeriesModel.type = 'series.parallel';\n ParallelSeriesModel.dependencies = ['parallel'];\n ParallelSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'parallel',\n parallelIndex: 0,\n label: {\n show: false\n },\n inactiveOpacity: 0.05,\n activeOpacity: 1,\n lineStyle: {\n width: 1,\n opacity: 0.45,\n type: 'solid'\n },\n emphasis: {\n label: {\n show: false\n }\n },\n progressive: 500,\n smooth: false,\n animationEasing: 'linear'\n };\n return ParallelSeriesModel;\n}(SeriesModel);\n\nfunction makeDefaultEncode(seriesModel) {\n // The mapping of parallelAxis dimension to data dimension can\n // be specified in parallelAxis.option.dim. For example, if\n // parallelAxis.option.dim is 'dim3', it mapping to the third\n // dimension of data. But `data.encode` has higher priority.\n // Moreover, parallelModel.dimension should not be regarded as data\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n\n if (!parallelModel) {\n return;\n }\n\n var encodeDefine = {};\n each(parallelModel.dimensions, function (axisDim) {\n var dataDimIndex = convertDimNameToNumber(axisDim);\n encodeDefine[axisDim] = dataDimIndex;\n });\n return encodeDefine;\n}\n\nfunction convertDimNameToNumber(dimName) {\n return +dimName.replace('dim', '');\n}\n\nexport default ParallelSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar opacityAccessPath = ['lineStyle', 'opacity'];\nvar parallelVisual = {\n seriesType: 'parallel',\n reset: function (seriesModel, ecModel) {\n var coordSys = seriesModel.coordinateSystem;\n var opacityMap = {\n normal: seriesModel.get(['lineStyle', 'opacity']),\n active: seriesModel.get('activeOpacity'),\n inactive: seriesModel.get('inactiveOpacity')\n };\n return {\n progress: function (params, data) {\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\n var opacity = opacityMap[activeState];\n\n if (activeState === 'normal' && data.hasItemOption) {\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n itemOpacity != null && (opacity = itemOpacity);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n existsStyle.opacity = opacity;\n }, params.start, params.end);\n }\n };\n }\n};\nexport default parallelVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nexport default function parallelPreprocessor(option) {\n createParallelIfNeeded(option);\n mergeAxisOptionFromParallel(option);\n}\n/**\r\n * Create a parallel coordinate if not exists.\r\n * @inner\r\n */\n\nfunction createParallelIfNeeded(option) {\n if (option.parallel) {\n return;\n }\n\n var hasParallelSeries = false;\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'parallel') {\n hasParallelSeries = true;\n }\n });\n\n if (hasParallelSeries) {\n option.parallel = [{}];\n }\n}\n/**\r\n * Merge aixs definition from parallel option (if exists) to axis option.\r\n * @inner\r\n */\n\n\nfunction mergeAxisOptionFromParallel(option) {\n var axes = modelUtil.normalizeToArray(option.parallelAxis);\n zrUtil.each(axes, function (axisOption) {\n if (!zrUtil.isObject(axisOption)) {\n return;\n }\n\n var parallelIndex = axisOption.parallelIndex || 0;\n var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n\n if (parallelOption && parallelOption.parallelAxisDefault) {\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n return _this;\n }\n\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n\n ParallelView.prototype.dispose = function (ecModel, api) {\n clear(this, '_throttledDispatchExpand');\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\r\n * @internal\r\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\r\n */\n\n\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\r\n * @internal\r\n */\n\n\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\n\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\nexport default ParallelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar ParallelModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelModel, _super);\n\n function ParallelModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelModel.type;\n return _this;\n }\n\n ParallelModel.prototype.init = function () {\n _super.prototype.init.apply(this, arguments);\n\n this.mergeOption({});\n };\n\n ParallelModel.prototype.mergeOption = function (newOption) {\n var thisOption = this.option;\n newOption && zrUtil.merge(thisOption, newOption, true);\n\n this._initDimensions();\n };\n /**\r\n * Whether series or axis is in this coordinate system.\r\n */\n\n\n ParallelModel.prototype.contains = function (model, ecModel) {\n var parallelIndex = model.get('parallelIndex');\n return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n };\n\n ParallelModel.prototype.setAxisExpand = function (opt) {\n zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n if (opt.hasOwnProperty(name)) {\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n this.option[name] = opt[name];\n }\n }, this);\n };\n\n ParallelModel.prototype._initDimensions = function () {\n var dimensions = this.dimensions = [];\n var parallelAxisIndex = this.parallelAxisIndex = [];\n var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n mainType: 'parallelAxis'\n }), function (axisModel) {\n // Can not use this.contains here, because\n // initialization has not been completed yet.\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n }, this);\n zrUtil.each(axisModels, function (axisModel) {\n dimensions.push('dim' + axisModel.get('dim'));\n parallelAxisIndex.push(axisModel.componentIndex);\n });\n };\n\n ParallelModel.type = 'parallel';\n ParallelModel.dependencies = ['parallelAxis'];\n ParallelModel.layoutMode = 'box';\n ParallelModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n layout: 'horizontal',\n // FIXME\n // naming?\n axisExpandable: false,\n axisExpandCenter: null,\n axisExpandCount: 0,\n axisExpandWidth: 50,\n axisExpandRate: 17,\n axisExpandDebounce: 50,\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n // Do not doc to user until necessary.\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n axisExpandTriggerOn: 'click',\n parallelAxisDefault: null\n };\n return ParallelModel;\n}(ComponentModel);\n\nexport default ParallelModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar ParallelAxis =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxis, _super);\n\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.axisIndex = axisIndex;\n return _this;\n }\n\n ParallelAxis.prototype.isHorizontal = function () {\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n };\n\n return ParallelAxis;\n}(Axis);\n\nexport default ParallelAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Calculate slider move result.\r\n * Usage:\r\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\r\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\r\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\r\n *\r\n * @param delta Move length.\r\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\r\n * handleEnds will be modified in this method.\r\n * @param extent handleEnds is restricted by extent.\r\n * extent[0] should less or equals than extent[1].\r\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\r\n * @param minSpan The range of dataZoom can not be smaller than that.\r\n * If not set, handle0 and cross handle1. If set as a non-negative\r\n * number (including `0`), handles will push each other when reaching\r\n * the minSpan.\r\n * @param maxSpan The range of dataZoom can not be larger than that.\r\n * @return The input handleEnds.\r\n */\nexport default function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\n delta = delta || 0;\n var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined.\n\n if (minSpan != null) {\n minSpan = restrict(minSpan, [0, extentSpan]);\n }\n\n if (maxSpan != null) {\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\n }\n\n if (handleIndex === 'all') {\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\n handleSpan = restrict(handleSpan, [0, extentSpan]);\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\n handleIndex = 0;\n }\n\n handleEnds[0] = restrict(handleEnds[0], extent);\n handleEnds[1] = restrict(handleEnds[1], extent);\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\n handleEnds[handleIndex] += delta; // Restrict in extent.\n\n var extentMinSpan = minSpan || 0;\n var realExtent = extent.slice();\n originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span.\n\n var currDistSign;\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\n // If minSpan exists, 'cross' is forbidden.\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\n } // Shrink span.\n\n\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (maxSpan != null && currDistSign.span > maxSpan) {\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\n }\n\n return handleEnds;\n}\n\nfunction getSpanSign(handleEnds, handleIndex) {\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n // is at left of handleEnds[1] for non-cross case.\n\n return {\n span: Math.abs(dist),\n sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1\n };\n}\n\nfunction restrict(value, extend) {\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parallel Coordinates\r\n * \r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport ParallelAxis from './ParallelAxis.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../../component/helper/sliderMove.js';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\n\nvar Parallel =\n/** @class */\nfunction () {\n function Parallel(parallelModel, ecModel, api) {\n this.type = 'parallel';\n /**\r\n * key: dimension\r\n */\n\n this._axesMap = zrUtil.createHashMap();\n /**\r\n * key: dimension\r\n * value: {position: [], rotation, }\r\n */\n\n this._axesLayout = {};\n this.dimensions = parallelModel.dimensions;\n this._model = parallelModel;\n\n this._init(parallelModel, ecModel, api);\n }\n\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\n var dimensions = parallelModel.dimensions;\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\n each(dimensions, function (dim, idx) {\n var axisIndex = parallelAxisIndex[idx];\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Injection\n\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = axisModel.coordinateSystem = this;\n }, this);\n };\n /**\r\n * Update axis scale after data processed\r\n */\n\n\n Parallel.prototype.update = function (ecModel, api) {\n this._updateAxesFromSeries(this._model, ecModel);\n };\n\n Parallel.prototype.containPoint = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var axisBase = layoutInfo.axisBase;\n var layoutBase = layoutInfo.layoutBase;\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var pAxis = point[1 - pixelDimIndex];\n var pLayout = point[pixelDimIndex];\n return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n };\n\n Parallel.prototype.getModel = function () {\n return this._model;\n };\n /**\r\n * Update properties from series\r\n */\n\n\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n ecModel.eachSeries(function (seriesModel) {\n if (!parallelModel.contains(seriesModel, ecModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n each(this.dimensions, function (dim) {\n var axis = this._axesMap.get(dim);\n\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n axisHelper.niceScaleExtent(axis.scale, axis.model);\n }, this);\n }, this);\n };\n /**\r\n * Resize the parallel coordinate system.\r\n */\n\n\n Parallel.prototype.resize = function (parallelModel, api) {\n this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._layoutAxes();\n };\n\n Parallel.prototype.getRect = function () {\n return this._rect;\n };\n\n Parallel.prototype._makeLayoutInfo = function () {\n var parallelModel = this._model;\n var rect = this._rect;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var layout = parallelModel.get('layout');\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n var layoutLength = rect[wh[pixelDimIndex]];\n var layoutExtent = [0, layoutLength];\n var axisCount = this.dimensions.length;\n var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n // where collapsed axes should be overlapped.\n\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\n var winSize;\n\n if (!axisExpandWindow) {\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n } else {\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n }\n\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small.\n\n axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1].\n\n var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates.\n\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n return {\n layout: layout,\n pixelDimIndex: pixelDimIndex,\n layoutBase: rect[xy[pixelDimIndex]],\n layoutLength: layoutLength,\n axisBase: rect[xy[1 - pixelDimIndex]],\n axisLength: rect[wh[1 - pixelDimIndex]],\n axisExpandable: axisExpandable,\n axisExpandWidth: axisExpandWidth,\n axisCollapseWidth: axisCollapseWidth,\n axisExpandWindow: axisExpandWindow,\n axisCount: axisCount,\n winInnerIndices: winInnerIndices,\n axisExpandWindow0Pos: axisExpandWindow0Pos\n };\n };\n\n Parallel.prototype._layoutAxes = function () {\n var rect = this._rect;\n var axes = this._axesMap;\n var dimensions = this.dimensions;\n\n var layoutInfo = this._makeLayoutInfo();\n\n var layout = layoutInfo.layout;\n axes.each(function (axis) {\n var axisExtent = [0, layoutInfo.axisLength];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n });\n each(dimensions, function (dim, idx) {\n var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n var positionTable = {\n horizontal: {\n x: posInfo.position,\n y: layoutInfo.axisLength\n },\n vertical: {\n x: 0,\n y: posInfo.position\n }\n };\n var rotationTable = {\n horizontal: PI / 2,\n vertical: 0\n };\n var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n var rotation = rotationTable[layout];\n var transform = matrix.create();\n matrix.rotate(transform, transform, rotation);\n matrix.translate(transform, transform, position); // TODO\n // tick layout info\n // TODO\n // update dimensions info based on axis order.\n\n this._axesLayout[dim] = {\n position: position,\n rotation: rotation,\n transform: transform,\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n axisLabelShow: posInfo.axisLabelShow,\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n tickDirection: 1,\n labelDirection: 1\n };\n }, this);\n };\n /**\r\n * Get axis by dim.\r\n */\n\n\n Parallel.prototype.getAxis = function (dim) {\n return this._axesMap.get(dim);\n };\n /**\r\n * Convert a dim value of a single item of series data to Point.\r\n */\n\n\n Parallel.prototype.dataToPoint = function (value, dim) {\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n };\n /**\r\n * Travel data for one time, get activeState of each data item.\r\n * @param start the start dataIndex that travel from.\r\n * @param end the next dataIndex of the last dataIndex will be travel.\r\n */\n\n\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n start == null && (start = 0);\n end == null && (end = data.count());\n var axesMap = this._axesMap;\n var dimensions = this.dimensions;\n var dataDimensions = [];\n var axisModels = [];\n zrUtil.each(dimensions, function (axisDim) {\n dataDimensions.push(data.mapDimension(axisDim));\n axisModels.push(axesMap.get(axisDim).model);\n });\n var hasActiveSet = this.hasAxisBrushed();\n\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\n var activeState = void 0;\n\n if (!hasActiveSet) {\n activeState = 'normal';\n } else {\n activeState = 'active';\n var values = data.getValues(dataDimensions, dataIndex);\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n var state = axisModels[j].getActiveState(values[j]);\n\n if (state === 'inactive') {\n activeState = 'inactive';\n break;\n }\n }\n }\n\n callback(activeState, dataIndex);\n }\n };\n /**\r\n * Whether has any activeSet.\r\n */\n\n\n Parallel.prototype.hasAxisBrushed = function () {\n var dimensions = this.dimensions;\n var axesMap = this._axesMap;\n var hasActiveSet = false;\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n hasActiveSet = true;\n }\n }\n\n return hasActiveSet;\n };\n /**\r\n * Convert coords of each axis to Point.\r\n * Return point. For example: [10, 20]\r\n */\n\n\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n var axisLayout = this._axesLayout[dim];\n return graphic.applyTransform([coord, 0], axisLayout.transform);\n };\n /**\r\n * Get axis layout.\r\n */\n\n\n Parallel.prototype.getAxisLayout = function (dim) {\n return zrUtil.clone(this._axesLayout[dim]);\n };\n /**\r\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\r\n */\n\n\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system.\n\n if (!this.containPoint(point)) {\n return {\n behavior: 'none',\n axisExpandWindow: axisExpandWindow\n };\n } // Convert the point from global to expand coordinates.\n\n\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be\n // slided when mouse is the center area of the window.\n\n var delta;\n var behavior = 'slide';\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n\n var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary.\n\n\n var useJump = triggerArea[0] != null;\n\n if (axisCollapseWidth) {\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n behavior = 'jump';\n delta = pointCoord - winSize * triggerArea[2];\n } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n behavior = 'jump';\n delta = pointCoord - winSize * (1 - triggerArea[2]);\n } else {\n (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n }\n\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove.\n : behavior = 'none';\n } // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n else {\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n var pos = extent[1] * pointCoord / winSize2;\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n }\n\n return {\n axisExpandWindow: axisExpandWindow,\n behavior: behavior\n };\n };\n\n return Parallel;\n}();\n\nfunction restrict(len, extent) {\n return mathMin(mathMax(len, extent[0]), extent[1]);\n}\n\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n return {\n position: step * axisIndex,\n axisNameAvailableWidth: step,\n axisLabelShow: true\n };\n}\n\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n var layoutLength = layoutInfo.layoutLength;\n var axisExpandWidth = layoutInfo.axisExpandWidth;\n var axisCount = layoutInfo.axisCount;\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var winInnerIndices = layoutInfo.winInnerIndices;\n var position;\n var axisNameAvailableWidth = axisCollapseWidth;\n var axisLabelShow = false;\n var nameTruncateMaxWidth;\n\n if (axisIndex < winInnerIndices[0]) {\n position = axisIndex * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n } else if (axisIndex <= winInnerIndices[1]) {\n position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n axisNameAvailableWidth = axisExpandWidth;\n axisLabelShow = true;\n } else {\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n }\n\n return {\n position: position,\n axisNameAvailableWidth: axisNameAvailableWidth,\n axisLabelShow: axisLabelShow,\n nameTruncateMaxWidth: nameTruncateMaxWidth\n };\n}\n\nexport default Parallel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parallel coordinate system creater.\r\n */\nimport Parallel from './Parallel.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nfunction createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nvar parallelCoordSysCreator = {\n create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport * as numberUtil from '../../util/number.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\n\nvar ParallelAxisModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisModel, _super);\n\n function ParallelAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisModel.type;\n /**\r\n * @readOnly\r\n */\n\n _this.activeIntervals = [];\n return _this;\n }\n\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n // So do not transfer decal directly.\n ])(this.getModel('areaSelectStyle'));\n };\n /**\r\n * The code of this feature is put on AxisModel but not ParallelAxis,\r\n * because axisModel can be alive after echarts updating but instance of\r\n * ParallelAxis having been disposed. this._activeInterval should be kept\r\n * when action dispatched (i.e. legend click).\r\n *\r\n * @param intervals `interval.length === 0` means set all active.\r\n */\n\n\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n var activeIntervals = this.activeIntervals = zrUtil.clone(intervals); // Normalize\n\n if (activeIntervals) {\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\n numberUtil.asc(activeIntervals[i]);\n }\n }\n };\n /**\r\n * @param value When only attempting detect whether 'no activeIntervals set',\r\n * `value` is not needed to be input.\r\n */\n\n\n ParallelAxisModel.prototype.getActiveState = function (value) {\n var activeIntervals = this.activeIntervals;\n\n if (!activeIntervals.length) {\n return 'normal';\n }\n\n if (value == null || isNaN(+value)) {\n return 'inactive';\n } // Simple optimization\n\n\n if (activeIntervals.length === 1) {\n var interval = activeIntervals[0];\n\n if (interval[0] <= value && value <= interval[1]) {\n return 'active';\n }\n } else {\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n return 'active';\n }\n }\n }\n\n return 'inactive';\n };\n\n return ParallelAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { curry, each, map, bind, merge, clone, defaults, assert } from 'zrender/lib/core/util.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nvar BRUSH_PANEL_GLOBAL = true;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n w: [0, 0],\n e: [0, 1],\n n: [1, 0],\n s: [1, 1]\n};\nvar CURSOR_MAP = {\n w: 'ew',\n e: 'ew',\n n: 'ns',\n s: 'ns',\n ne: 'nesw',\n sw: 'nesw',\n nw: 'nwse',\n se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n brushStyle: {\n lineWidth: 2,\n stroke: 'rgba(210,219,238,0.3)',\n fill: '#D2DBEE'\n },\n transformable: true,\n brushMode: 'single',\n removeOnClick: false\n};\nvar baseUID = 0;\n/**\r\n * params:\r\n * areas: Array., coord relates to container group,\r\n * If no container specified, to global.\r\n * opt {\r\n * isEnd: boolean,\r\n * removeOnClick: boolean\r\n * }\r\n */\n\nvar BrushController =\n/** @class */\nfunction (_super) {\n __extends(BrushController, _super);\n\n function BrushController(zr) {\n var _this = _super.call(this) || this;\n /**\r\n * @internal\r\n */\n\n\n _this._track = [];\n /**\r\n * @internal\r\n */\n\n _this._covers = [];\n _this._handlers = {};\n\n if (process.env.NODE_ENV !== 'production') {\n assert(zr);\n }\n\n _this._zr = zr;\n _this.group = new graphic.Group();\n _this._uid = 'brushController_' + baseUID++;\n each(pointerHandlers, function (handler, eventName) {\n this._handlers[eventName] = bind(handler, this);\n }, _this);\n return _this;\n }\n /**\r\n * If set to `false`, select disabled.\r\n */\n\n\n BrushController.prototype.enableBrush = function (brushOption) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n this._brushType && this._doDisableBrush();\n brushOption.brushType && this._doEnableBrush(brushOption);\n return this;\n };\n\n BrushController.prototype._doEnableBrush = function (brushOption) {\n var zr = this._zr; // Consider roam, which takes globalPan too.\n\n if (!this._enableGlobalPan) {\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\n }\n\n each(this._handlers, function (handler, eventName) {\n zr.on(eventName, handler);\n });\n this._brushType = brushOption.brushType;\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\n };\n\n BrushController.prototype._doDisableBrush = function () {\n var zr = this._zr;\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\n each(this._handlers, function (handler, eventName) {\n zr.off(eventName, handler);\n });\n this._brushType = this._brushOption = null;\n };\n /**\r\n * @param panelOpts If not pass, it is global brush.\r\n */\n\n\n BrushController.prototype.setPanels = function (panelOpts) {\n if (panelOpts && panelOpts.length) {\n var panels_1 = this._panels = {};\n each(panelOpts, function (panelOpts) {\n panels_1[panelOpts.panelId] = clone(panelOpts);\n });\n } else {\n this._panels = null;\n }\n\n return this;\n };\n\n BrushController.prototype.mount = function (opt) {\n opt = opt || {};\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = true; // should be at first.\n }\n\n this._enableGlobalPan = opt.enableGlobalPan;\n var thisGroup = this.group;\n\n this._zr.add(thisGroup);\n\n thisGroup.attr({\n x: opt.x || 0,\n y: opt.y || 0,\n rotation: opt.rotation || 0,\n scaleX: opt.scaleX || 1,\n scaleY: opt.scaleY || 1\n });\n this._transform = thisGroup.getLocalTransform();\n return this;\n }; // eachCover(cb, context): void {\n // each(this._covers, cb, context);\n // }\n\n /**\r\n * Update covers.\r\n * @param coverConfigList\r\n * If coverConfigList is null/undefined, all covers removed.\r\n */\n\n\n BrushController.prototype.updateCovers = function (coverConfigList) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n coverConfigList = map(coverConfigList, function (coverConfig) {\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\n });\n var tmpIdPrefix = '\\0-brush-index-';\n var oldCovers = this._covers;\n var newCovers = this._covers = [];\n var controller = this;\n var creatingCover = this._creatingCover;\n new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n return this;\n\n function getKey(brushOption, index) {\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n }\n\n function oldGetKey(cover, index) {\n return getKey(cover.__brushOption, index);\n }\n\n function addOrUpdate(newIndex, oldIndex) {\n var newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect,\n // where updating cover when creating should be forbidden.\n\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n newCovers[newIndex] = oldCovers[oldIndex];\n } else {\n var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));\n updateCoverAfterCreation(controller, cover);\n }\n }\n\n function remove(oldIndex) {\n if (oldCovers[oldIndex] !== creatingCover) {\n controller.group.remove(oldCovers[oldIndex]);\n }\n }\n };\n\n BrushController.prototype.unmount = function () {\n if (process.env.NODE_ENV !== 'production') {\n if (!this._mounted) {\n return;\n }\n }\n\n this.enableBrush(false); // container may 'removeAll' outside.\n\n clearCovers(this);\n\n this._zr.remove(this.group);\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = false; // should be at last.\n }\n\n return this;\n };\n\n BrushController.prototype.dispose = function () {\n this.unmount();\n this.off();\n };\n\n return BrushController;\n}(Eventful);\n\nfunction createCover(controller, brushOption) {\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n cover.__brushOption = brushOption;\n updateZ(cover, brushOption);\n controller.group.add(cover);\n return cover;\n}\n\nfunction endCreating(controller, creatingCover) {\n var coverRenderer = getCoverRenderer(creatingCover);\n\n if (coverRenderer.endCreating) {\n coverRenderer.endCreating(controller, creatingCover);\n updateZ(creatingCover, creatingCover.__brushOption);\n }\n\n return creatingCover;\n}\n\nfunction updateCoverShape(controller, cover) {\n var brushOption = cover.__brushOption;\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\n\nfunction updateZ(cover, brushOption) {\n var z = brushOption.z;\n z == null && (z = COVER_Z);\n cover.traverse(function (el) {\n el.z = z;\n el.z2 = z; // Consider in given container.\n });\n}\n\nfunction updateCoverAfterCreation(controller, cover) {\n getCoverRenderer(cover).updateCommon(controller, cover);\n updateCoverShape(controller, cover);\n}\n\nfunction getCoverRenderer(cover) {\n return coverRenderers[cover.__brushOption.brushType];\n} // return target panel or `true` (means global panel)\n\n\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panel;\n var transform = controller._transform;\n each(panels, function (pn) {\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n });\n return panel;\n} // Return a panel or true\n\n\nfunction getPanelByCover(controller, cover) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info,\n // which is then treated as global panel.\n\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\n}\n\nfunction clearCovers(controller) {\n var covers = controller._covers;\n var originalLength = covers.length;\n each(covers, function (cover) {\n controller.group.remove(cover);\n }, controller);\n covers.length = 0;\n return !!originalLength;\n}\n\nfunction trigger(controller, opt) {\n var areas = map(controller._covers, function (cover) {\n var brushOption = cover.__brushOption;\n var range = clone(brushOption.range);\n return {\n brushType: brushOption.brushType,\n panelId: brushOption.panelId,\n range: range\n };\n });\n controller.trigger('brush', {\n areas: areas,\n isEnd: !!opt.isEnd,\n removeOnClick: !!opt.removeOnClick\n });\n}\n\nfunction shouldShowCover(controller) {\n var track = controller._track;\n\n if (!track.length) {\n return false;\n }\n\n var p2 = track[track.length - 1];\n var p1 = track[0];\n var dx = p2[0] - p1[0];\n var dy = p2[1] - p1[1];\n var dist = mathPow(dx * dx + dy * dy, 0.5);\n return dist > UNSELECT_THRESHOLD;\n}\n\nfunction getTrackEnds(track) {\n var tail = track.length - 1;\n tail < 0 && (tail = 0);\n return [track[0], track[tail]];\n}\n\n;\n\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\n var cover = new graphic.Group();\n cover.add(new graphic.Rect({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true,\n draggable: true,\n cursor: 'move',\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n each(edgeNameSequences, function (nameSequence) {\n cover.add(new graphic.Rect({\n name: nameSequence.join(''),\n style: {\n opacity: 0\n },\n draggable: true,\n silent: true,\n invisible: true,\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n });\n return cover;\n}\n\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\n var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n var x = localRange[0][0];\n var y = localRange[1][0];\n var xa = x - lineWidth / 2;\n var ya = y - lineWidth / 2;\n var x2 = localRange[0][1];\n var y2 = localRange[1][1];\n var x2a = x2 - handleSize + lineWidth / 2;\n var y2a = y2 - handleSize + lineWidth / 2;\n var width = x2 - x;\n var height = y2 - y;\n var widtha = width + lineWidth;\n var heighta = height + lineWidth;\n updateRectShape(controller, cover, 'main', x, y, width, height);\n\n if (brushOption.transformable) {\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n }\n}\n\nfunction updateCommon(controller, cover) {\n var brushOption = cover.__brushOption;\n var transformable = brushOption.transformable;\n var mainEl = cover.childAt(0);\n mainEl.useStyle(makeStyle(brushOption));\n mainEl.attr({\n silent: !transformable,\n cursor: transformable ? 'move' : 'default'\n });\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\n var el = cover.childOfName(nameSequence.join(''));\n var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);\n el && el.attr({\n silent: !transformable,\n invisible: !transformable,\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n });\n });\n}\n\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n var el = cover.childOfName(name);\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\n\nfunction makeStyle(brushOption) {\n return defaults({\n strokeNoScale: true\n }, brushOption.brushStyle);\n}\n\nfunction formatRectRange(x, y, x2, y2) {\n var min = [mathMin(x, x2), mathMin(y, y2)];\n var max = [mathMax(x, x2), mathMax(y, y2)];\n return [[min[0], max[0]], [min[1], max[1]] // y range\n ];\n}\n\nfunction getTransform(controller) {\n return graphic.getTransform(controller.group);\n}\n\nfunction getGlobalDirection1(controller, localDirName) {\n var map = {\n w: 'left',\n e: 'right',\n n: 'top',\n s: 'bottom'\n };\n var inverseMap = {\n left: 'w',\n right: 'e',\n top: 'n',\n bottom: 's'\n };\n var dir = graphic.transformDirection(map[localDirName], getTransform(controller));\n return inverseMap[dir];\n}\n\nfunction getGlobalDirection2(controller, localDirNameSeq) {\n var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n return globalDir.join('');\n}\n\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\n var brushOption = cover.__brushOption;\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\n var localDelta = toLocalDelta(controller, dx, dy);\n each(dirNameSequence, function (dirName) {\n var ind = DIRECTION_MAP[dirName];\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n });\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction driftPolygon(controller, cover, dx, dy) {\n var range = cover.__brushOption.range;\n var localDelta = toLocalDelta(controller, dx, dy);\n each(range, function (point) {\n point[0] += localDelta[0];\n point[1] += localDelta[1];\n });\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction toLocalDelta(controller, dx, dy) {\n var thisGroup = controller.group;\n var localD = thisGroup.transformCoordToLocal(dx, dy);\n var localZero = thisGroup.transformCoordToLocal(0, 0);\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\n\nfunction clipByPanel(controller, cover, data) {\n var panel = getPanelByCover(controller, cover);\n return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);\n}\n\nfunction pointsToRect(points) {\n var xmin = mathMin(points[0][0], points[1][0]);\n var ymin = mathMin(points[0][1], points[1][1]);\n var xmax = mathMax(points[0][0], points[1][0]);\n var ymax = mathMax(points[0][1], points[1][1]);\n return {\n x: xmin,\n y: ymin,\n width: xmax - xmin,\n height: ymax - ymin\n };\n}\n\nfunction resetCursor(controller, e, localCursorPoint) {\n if ( // Check active\n !controller._brushType // resetCursor should be always called when mouse is in zr area,\n // but not called when mouse is out of zr area to avoid bad influence\n // if `mousemove`, `mouseup` are triggered from `document` event.\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\n return;\n }\n\n var zr = controller._zr;\n var covers = controller._covers;\n var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers.\n\n if (!controller._dragging) {\n for (var i = 0; i < covers.length; i++) {\n var brushOption = covers[i].__brushOption;\n\n if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n // Use cursor style set on cover.\n return;\n }\n }\n }\n\n currPanel && zr.setCursorStyle('crosshair');\n}\n\nfunction preventDefault(e) {\n var rawE = e.event;\n rawE.preventDefault && rawE.preventDefault();\n}\n\nfunction mainShapeContain(cover, x, y) {\n return cover.childOfName('main').contain(x, y);\n}\n\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n var creatingCover = controller._creatingCover;\n var panel = controller._creatingPanel;\n var thisBrushOption = controller._brushOption;\n var eventParams;\n\n controller._track.push(localCursorPoint.slice());\n\n if (shouldShowCover(controller) || creatingCover) {\n if (panel && !creatingCover) {\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\n var brushOption = clone(thisBrushOption);\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\n\n controller._covers.push(creatingCover);\n }\n\n if (creatingCover) {\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n var coverBrushOption = creatingCover.__brushOption;\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n\n if (isEnd) {\n endCreating(controller, creatingCover);\n coverRenderer.updateCommon(controller, creatingCover);\n }\n\n updateCoverShape(controller, creatingCover);\n eventParams = {\n isEnd: isEnd\n };\n }\n } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n // But a single click do not clear covers, because user may have casual\n // clicks (for example, click on other component and do not expect covers\n // disappear).\n // Only some cover removed, trigger action, but not every click trigger action.\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n eventParams = {\n isEnd: isEnd,\n removeOnClick: true\n };\n }\n }\n\n return eventParams;\n}\n\nfunction determineBrushType(brushType, panel) {\n if (brushType === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\n }\n\n return panel.defaultBrushType;\n }\n\n return brushType;\n}\n\nvar pointerHandlers = {\n mousedown: function (e) {\n if (this._dragging) {\n // In case some browser do not support globalOut,\n // and release mouse out side the browser.\n handleDragEnd(this, e);\n } else if (!e.target || !e.target.draggable) {\n preventDefault(e);\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n this._creatingCover = null;\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n\n if (panel) {\n this._dragging = true;\n this._track = [localCursorPoint.slice()];\n }\n }\n },\n mousemove: function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\n resetCursor(this, e, localCursorPoint);\n\n if (this._dragging) {\n preventDefault(e);\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n eventParams && trigger(this, eventParams);\n }\n },\n mouseup: function (e) {\n handleDragEnd(this, e);\n }\n};\n\nfunction handleDragEnd(controller, e) {\n if (controller._dragging) {\n preventDefault(e);\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n controller._dragging = false;\n controller._track = [];\n controller._creatingCover = null; // trigger event should be at final, after procedure will be nested.\n\n eventParams && trigger(controller, eventParams);\n }\n}\n\nfunction isOutsideZrArea(controller, x, y) {\n var zr = controller._zr;\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\r\n * key: brushType\r\n */\n\n\nvar coverRenderers = {\n lineX: getLineRenderer(0),\n lineY: getLineRenderer(1),\n rect: {\n createCover: function (controller, brushOption) {\n function returnInput(range) {\n return range;\n }\n\n return createBaseRectCover({\n toRectRange: returnInput,\n fromRectRange: returnInput\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n updateBaseRect(controller, cover, localRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n },\n polygon: {\n createCover: function (controller, brushOption) {\n var cover = new graphic.Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the\n // border of the shape when drawing, which is a better experience for user.\n\n cover.add(new graphic.Polyline({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true\n }));\n return cover;\n },\n getCreatingRange: function (localTrack) {\n return localTrack;\n },\n endCreating: function (controller, cover) {\n cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape.\n\n cover.add(new graphic.Polygon({\n name: 'main',\n draggable: true,\n drift: curry(driftPolygon, controller, cover),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n cover.childAt(0).setShape({\n points: clipByPanel(controller, cover, localRange)\n });\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n }\n};\n\nfunction getLineRenderer(xyIndex) {\n return {\n createCover: function (controller, brushOption) {\n return createBaseRectCover({\n toRectRange: function (range) {\n var rectRange = [range, [0, 100]];\n xyIndex && rectRange.reverse();\n return rectRange;\n },\n fromRectRange: function (rectRange) {\n return rectRange[xyIndex];\n }\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n return [min, max];\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n var otherExtent; // If brushWidth not specified, fit the panel.\n\n var panel = getPanelByCover(controller, cover);\n\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\n } else {\n var zr = controller._zr;\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n }\n\n var rectRange = [localRange, otherExtent];\n xyIndex && rectRange.reverse();\n updateBaseRect(controller, cover, rectRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n };\n}\n\nexport default BrushController;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { onIrrelevantElement } from './cursorHelper.js';\nimport * as graphicUtil from '../../util/graphic.js';\nexport function makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\nexport function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\nexport function makeRectIsTargetByCursor(rect, api, targetModel) {\n var boundingRect = normalizeRect(rect);\n return function (e, localCursorPoint) {\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport BrushController from '../helper/BrushController.js';\nimport * as brushHelper from '../helper/brushHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar ParallelAxisView =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisView, _super);\n\n function ParallelAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisView.type;\n return _this;\n }\n\n ParallelAxisView.prototype.init = function (ecModel, api) {\n _super.prototype.init.apply(this, arguments);\n\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n };\n\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n return;\n }\n\n this.axisModel = axisModel;\n this.api = api;\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\n var coordSys = coordSysModel.coordinateSystem;\n var areaSelectStyle = axisModel.getAreaSelectStyle();\n var areaWidth = areaSelectStyle.width;\n var dim = axisModel.axis.dim;\n var axisLayout = coordSys.getAxisLayout(dim);\n var builderOpt = zrUtil.extend({\n strokeContainThreshold: areaWidth\n }, axisLayout);\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }; // /**\n // * @override\n // */\n // updateVisual(axisModel, ecModel, api, payload) {\n // this._brushController && this._brushController\n // .updateCovers(getCoverInfoList(axisModel));\n // }\n\n\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n // After filtering, axis may change, select area needs to be update.\n var extent = axisModel.axis.getExtent();\n var extentLen = extent[1] - extent[0];\n var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n // width/height might be negative, which will be\n // normalized in BoundingRect.\n\n var rect = graphic.BoundingRect.create({\n x: extent[0],\n y: -areaWidth / 2,\n width: extentLen,\n height: areaWidth\n });\n rect.x -= extra;\n rect.width += 2 * extra;\n\n this._brushController.mount({\n enableGlobalPan: true,\n rotation: builderOpt.rotation,\n x: builderOpt.position[0],\n y: builderOpt.position[1]\n }).setPanels([{\n panelId: 'pl',\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n }]).enableBrush({\n brushType: 'lineX',\n brushStyle: areaSelectStyle,\n removeOnClick: true\n }).updateCovers(getCoverInfoList(axisModel));\n };\n\n ParallelAxisView.prototype._onBrush = function (eventParam) {\n var coverInfoList = eventParam.areas; // Do not cache these object, because the mey be changed.\n\n var axisModel = this.axisModel;\n var axis = axisModel.axis;\n var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n }); // If realtime is true, action is not dispatched on drag end, because\n // the drag end emits the same params with the last drag move event,\n // and may have some delay when using touch pad.\n\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'axisAreaSelect',\n parallelAxisId: axisModel.id,\n intervals: intervals\n });\n }\n };\n\n ParallelAxisView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n ParallelAxisView.type = 'parallelAxis';\n return ParallelAxisView;\n}(ComponentView);\n\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n mainType: 'parallelAxis',\n query: payload\n })[0] === axisModel;\n}\n\nfunction getCoverInfoList(axisModel) {\n var axis = axisModel.axis;\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\n return {\n brushType: 'lineX',\n panelId: 'pl',\n range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n };\n });\n}\n\nfunction getCoordSysModel(axisModel, ecModel) {\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\n\nexport default ParallelAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar actionInfo = {\n type: 'axisAreaSelect',\n event: 'axisAreaSelected' // update: 'updateVisual'\n\n};\nexport function installParallelActions(registers) {\n registers.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallelAxis',\n query: payload\n }, function (parallelAxisModel) {\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n });\n });\n /**\r\n * @payload\r\n */\n\n registers.registerAction('parallelAxisExpand', function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallel',\n query: payload\n }, function (parallelModel) {\n parallelModel.setAxisExpand(payload);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelModel from '../../coord/parallel/ParallelModel.js';\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport ParallelAxisModel from '../../coord/parallel/AxisModel.js';\nimport ParallelAxisView from '../axis/ParallelAxisView.js';\nimport { installParallelActions } from '../axis/parallelAxisAction.js';\nvar defaultAxisOption = {\n type: 'value',\n areaSelectStyle: {\n width: 20,\n borderWidth: 1,\n borderColor: 'rgba(160,197,232)',\n color: 'rgba(160,197,232)',\n opacity: 0.3\n },\n realtime: true,\n z: 10\n};\nexport function install(registers) {\n registers.registerComponentView(ParallelView);\n registers.registerComponentModel(ParallelModel);\n registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\n registers.registerPreprocessor(parallelPreprocessor);\n registers.registerComponentModel(ParallelAxisModel);\n registers.registerComponentView(ParallelAxisView);\n axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption);\n installParallelActions(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelSeriesModel from './ParallelSeries.js';\nimport parallelVisual from './parallelVisual.js';\nimport { install as installParallelComponent } from '../../component/parallel/install.js';\nexport function install(registers) {\n use(installParallelComponent);\n registers.registerChartView(ParallelView);\n registers.registerSeriesModel(ParallelSeriesModel);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isString, retrieve3 } from 'zrender/lib/core/util.js';\n\nvar SankeyPathShape =\n/** @class */\nfunction () {\n function SankeyPathShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.cpx2 = 0;\n this.cpy2 = 0;\n this.extent = 0;\n }\n\n return SankeyPathShape;\n}();\n\nvar SankeyPath =\n/** @class */\nfunction (_super) {\n __extends(SankeyPath, _super);\n\n function SankeyPath(opts) {\n return _super.call(this, opts) || this;\n }\n\n SankeyPath.prototype.getDefaultShape = function () {\n return new SankeyPathShape();\n };\n\n SankeyPath.prototype.buildPath = function (ctx, shape) {\n var extent = shape.extent;\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n\n if (shape.orient === 'vertical') {\n ctx.lineTo(shape.x2 + extent, shape.y2);\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n } else {\n ctx.lineTo(shape.x2, shape.y2 + extent);\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n }\n\n ctx.closePath();\n };\n\n SankeyPath.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n SankeyPath.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n return SankeyPath;\n}(graphic.Path);\n\nvar SankeyView =\n/** @class */\nfunction (_super) {\n __extends(SankeyView, _super);\n\n function SankeyView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeyView.type;\n _this._focusAdjacencyDisabled = false;\n return _this;\n }\n\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\n var sankeyView = this;\n var graph = seriesModel.getGraph();\n var group = this.group;\n var layoutInfo = seriesModel.layoutInfo; // view width\n\n var width = layoutInfo.width; // view height\n\n var height = layoutInfo.height;\n var nodeData = seriesModel.getData();\n var edgeData = seriesModel.getData('edge');\n var orient = seriesModel.get('orient');\n this._model = seriesModel;\n group.removeAll();\n group.x = layoutInfo.x;\n group.y = layoutInfo.y; // generate a bezire Curve for each edge\n\n graph.eachEdge(function (edge) {\n var curve = new SankeyPath();\n var ecData = getECData(curve);\n ecData.dataIndex = edge.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataType = 'edge';\n var edgeModel = edge.getModel();\n var lineStyleModel = edgeModel.getModel('lineStyle');\n var curvature = lineStyleModel.get('curveness');\n var n1Layout = edge.node1.getLayout();\n var node1Model = edge.node1.getModel();\n var dragX1 = node1Model.get('localX');\n var dragY1 = node1Model.get('localY');\n var n2Layout = edge.node2.getLayout();\n var node2Model = edge.node2.getModel();\n var dragX2 = node2Model.get('localX');\n var dragY2 = node2Model.get('localY');\n var edgeLayout = edge.getLayout();\n var x1;\n var y1;\n var x2;\n var y2;\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n curve.shape.extent = Math.max(1, edgeLayout.dy);\n curve.shape.orient = orient;\n\n if (orient === 'vertical') {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n cpx1 = x1;\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\n cpx2 = x2;\n cpy2 = y1 * curvature + y2 * (1 - curvature);\n } else {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\n cpy1 = y1;\n cpx2 = x1 * curvature + x2 * (1 - curvature);\n cpy2 = y2;\n }\n\n curve.setShape({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n });\n curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color\n\n applyCurveStyle(curve.style, orient, edge);\n var defaultEdgeLabelText = \"\" + edgeModel.get('value');\n var edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel');\n setLabelStyle(curve, edgeLabelStateModels, {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'edge', labelDimIndex, // ensure edgeLabel formatter is provided\n // to prevent the inheritance from `label.formatter` of the series\n retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'), defaultEdgeLabelText), extendParams);\n }\n },\n labelDataIndex: edge.dataIndex,\n defaultText: defaultEdgeLabelText\n });\n curve.setTextConfig({\n position: 'inside'\n });\n var emphasisModel = edgeModel.getModel('emphasis');\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) {\n var style = model.getItemStyle();\n applyCurveStyle(style, orient, edge);\n return style;\n });\n group.add(curve);\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus === 'trajectory' ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n }); // Generate a rect for each node\n\n graph.eachNode(function (node) {\n var layout = node.getLayout();\n var itemModel = node.getModel();\n var dragX = itemModel.get('localX');\n var dragY = itemModel.get('localY');\n var emphasisModel = itemModel.getModel('emphasis');\n var rect = new graphic.Rect({\n shape: {\n x: dragX != null ? dragX * width : layout.x,\n y: dragY != null ? dragY * height : layout.y,\n width: layout.dx,\n height: layout.dy\n },\n style: itemModel.getModel('itemStyle').getItemStyle(),\n z2: 10\n });\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'node');\n }\n },\n labelDataIndex: node.dataIndex,\n defaultText: node.id\n });\n rect.disableLabelAnimation = true;\n rect.setStyle('fill', node.getVisual('color'));\n rect.setStyle('decal', node.getVisual('style').decal);\n setStatesStylesFromModel(rect, itemModel);\n group.add(rect);\n nodeData.setItemGraphicEl(node.dataIndex, rect);\n getECData(rect).dataType = 'node';\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus === 'trajectory' ? node.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\n var itemModel = nodeData.getItemModel(dataIndex);\n\n if (itemModel.get('draggable')) {\n el.drift = function (dx, dy) {\n sankeyView._focusAdjacencyDisabled = true;\n this.shape.x += dx;\n this.shape.y += dy;\n this.dirty();\n api.dispatchAction({\n type: 'dragNode',\n seriesId: seriesModel.id,\n dataIndex: nodeData.getRawIndex(dataIndex),\n localX: this.shape.x / width,\n localY: this.shape.y / height\n });\n };\n\n el.ondragend = function () {\n sankeyView._focusAdjacencyDisabled = false;\n };\n\n el.draggable = true;\n el.cursor = 'move';\n }\n });\n\n if (!this._data && seriesModel.isAnimationEnabled()) {\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\n group.removeClipPath();\n }));\n }\n\n this._data = seriesModel.getData();\n };\n\n SankeyView.prototype.dispose = function () {};\n\n SankeyView.type = 'sankey';\n return SankeyView;\n}(ChartView);\n/**\r\n * Special color, use source node color or target node color\r\n * @param curveProps curve's style to parse\r\n * @param orient direction\r\n * @param edge current curve data\r\n */\n\n\nfunction applyCurveStyle(curveProps, orient, edge) {\n switch (curveProps.fill) {\n case 'source':\n curveProps.fill = edge.node1.getVisual('color');\n curveProps.decal = edge.node1.getVisual('style').decal;\n break;\n\n case 'target':\n curveProps.fill = edge.node2.getVisual('color');\n curveProps.decal = edge.node2.getVisual('style').decal;\n break;\n\n case 'gradient':\n var sourceColor = edge.node1.getVisual('color');\n var targetColor = edge.node2.getVisual('color');\n\n if (isString(sourceColor) && isString(targetColor)) {\n curveProps.fill = new graphic.LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{\n color: sourceColor,\n offset: 0\n }, {\n color: targetColor,\n offset: 1\n }]);\n }\n\n }\n} // Add animation to the view\n\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default SankeyView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\n\nvar SankeySeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SankeySeriesModel, _super);\n\n function SankeySeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeySeriesModel.type;\n return _this;\n }\n /**\r\n * Init a graph data structure from data in option series\r\n */\n\n\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\n var links = option.edges || option.links;\n var nodes = option.data || option.nodes;\n var levels = option.levels;\n this.levelModels = [];\n var levelModels = this.levelModels;\n\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].depth != null && levels[i].depth >= 0) {\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('levels[i].depth is mandatory and should be natural number');\n }\n }\n }\n\n if (nodes && links) {\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var layout = seriesModel.getData().getItemLayout(idx);\n\n if (layout) {\n var nodeDepth = layout.depth;\n var levelModel = seriesModel.levelModels[nodeDepth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n edgeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\n var layout = edge.node1.getLayout();\n\n if (layout) {\n var depth = layout.depth;\n var levelModel = seriesModel.levelModels[depth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n }\n };\n\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\n var nodes = this.option.data || this.option.nodes;\n var dataItem = nodes[dataIndex];\n dataItem.localX = localPosition[0];\n dataItem.localY = localPosition[1];\n };\n /**\r\n * Return the graphic data structure\r\n *\r\n * @return graphic data structure\r\n */\n\n\n SankeySeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n /**\r\n * Get edge data of graphic data structure\r\n *\r\n * @return data structure of list\r\n */\n\n\n SankeySeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n function noValue(val) {\n return isNaN(val) || val == null;\n } // dataType === 'node' or empty do not show tooltip by default\n\n\n if (dataType === 'edge') {\n var params = this.getDataParams(dataIndex, dataType);\n var rawDataOpt = params.data;\n var edgeValue = params.value;\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n return createTooltipMarkup('nameValue', {\n name: edgeName,\n value: edgeValue,\n noValue: noValue(edgeValue)\n });\n } // dataType === 'node'\n else {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var value = node.getLayout().value;\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\n return createTooltipMarkup('nameValue', {\n name: name_1 != null ? name_1 + '' : null,\n value: value,\n noValue: noValue(value)\n });\n }\n };\n\n SankeySeriesModel.prototype.optionUpdated = function () {}; // Override Series.getDataParams()\n\n\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n if (params.value == null && dataType === 'node') {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var nodeValue = node.getLayout().value;\n params.value = nodeValue;\n }\n\n return params;\n };\n\n SankeySeriesModel.type = 'series.sankey';\n SankeySeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n left: '5%',\n top: '5%',\n right: '20%',\n bottom: '5%',\n orient: 'horizontal',\n nodeWidth: 20,\n nodeGap: 8,\n draggable: true,\n layoutIterations: 32,\n label: {\n show: true,\n position: 'right',\n fontSize: 12\n },\n edgeLabel: {\n show: false,\n fontSize: 12\n },\n levels: [],\n nodeAlign: 'justify',\n lineStyle: {\n color: '#314656',\n opacity: 0.2,\n curveness: 0.5\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n opacity: 0.5\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n animationEasing: 'linear',\n animationDuration: 1000\n };\n return SankeySeriesModel;\n}(SeriesModel);\n\nexport default SankeySeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData } from '../../util/model.js';\nexport default function sankeyLayout(ecModel, api) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var nodeWidth = seriesModel.get('nodeWidth');\n var nodeGap = seriesModel.get('nodeGap');\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var width = layoutInfo.width;\n var height = layoutInfo.height;\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n computeNodeValues(nodes);\n var filteredNodes = zrUtil.filter(nodes, function (node) {\n return node.getLayout().value === 0;\n });\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n var orient = seriesModel.get('orient');\n var nodeAlign = seriesModel.get('nodeAlign');\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\n });\n}\n/**\r\n * Get the layout position of the whole view\r\n */\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n computeEdgeDepths(nodes, orient);\n}\n/**\r\n * Compute the value of each node by summing the associated edge's value\r\n */\n\n\nfunction computeNodeValues(nodes) {\n zrUtil.each(nodes, function (node) {\n var value1 = sum(node.outEdges, getEdgeValue);\n var value2 = sum(node.inEdges, getEdgeValue);\n var nodeRawValue = node.getValue() || 0;\n var value = Math.max(value1, value2, nodeRawValue);\n node.setLayout({\n value: value\n }, true);\n });\n}\n/**\r\n * Compute the x-position for each node.\r\n *\r\n * Here we use Kahn algorithm to detect cycle when we traverse\r\n * the node to computer the initial x position.\r\n */\n\n\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = []; // Storage each node's indegree.\n\n var indegreeArr = []; // Used to storage the node with indegree is equal to 0.\n\n var zeroIndegrees = [];\n var nextTargetNode = [];\n var x = 0; // let kx = 0;\n\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n\n for (var i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n\n var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n // position of the nodes.\n\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n var isItemDepth = item.depth != null && item.depth >= 0;\n\n if (isItemDepth && item.depth > maxNodeDepth) {\n maxNodeDepth = item.depth;\n }\n\n node.setLayout({\n depth: isItemDepth ? item.depth : x\n }, true);\n orient === 'vertical' ? node.setLayout({\n dy: nodeWidth\n }, true) : node.setLayout({\n dx: nodeWidth\n }, true);\n\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n var edge = node.outEdges[edgeIdx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n nextTargetNode.push(targetNode);\n }\n }\n }\n\n ++x;\n zeroIndegrees = nextTargetNode;\n nextTargetNode = [];\n }\n\n for (var i = 0; i < remainEdges.length; i++) {\n if (remainEdges[i] === 1) {\n throw new Error('Sankey is a DAG, the original data has cycle!');\n }\n }\n\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n\n if (nodeAlign && nodeAlign !== 'left') {\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n }\n\n var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n scaleNodeBreadths(nodes, kx, orient);\n}\n\nfunction isNodeDepth(node) {\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n return item.depth != null && item.depth >= 0;\n}\n\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\n if (nodeAlign === 'right') {\n var nextSourceNode = [];\n var remainNodes = nodes;\n var nodeHeight = 0;\n\n while (remainNodes.length) {\n for (var i = 0; i < remainNodes.length; i++) {\n var node = remainNodes[i];\n node.setLayout({\n skNodeHeight: nodeHeight\n }, true);\n\n for (var j = 0; j < node.inEdges.length; j++) {\n var edge = node.inEdges[j];\n\n if (nextSourceNode.indexOf(edge.node1) < 0) {\n nextSourceNode.push(edge.node1);\n }\n }\n }\n\n remainNodes = nextSourceNode;\n nextSourceNode = [];\n ++nodeHeight;\n }\n\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node)) {\n node.setLayout({\n depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)\n }, true);\n }\n });\n } else if (nodeAlign === 'justify') {\n moveSinksRight(nodes, maxDepth);\n }\n}\n/**\r\n * All the node without outEgdes are assigned maximum x-position and\r\n * be aligned in the last column.\r\n *\r\n * @param nodes. node of sankey view.\r\n * @param maxDepth. use to assign to node without outEdges as x-position.\r\n */\n\n\nfunction moveSinksRight(nodes, maxDepth) {\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node) && !node.outEdges.length) {\n node.setLayout({\n depth: maxDepth\n }, true);\n }\n });\n}\n/**\r\n * Scale node x-position to the width\r\n *\r\n * @param nodes node of sankey view\r\n * @param kx multiple used to scale nodes\r\n */\n\n\nfunction scaleNodeBreadths(nodes, kx, orient) {\n zrUtil.each(nodes, function (node) {\n var nodeDepth = node.getLayout().depth * kx;\n orient === 'vertical' ? node.setLayout({\n y: nodeDepth\n }, true) : node.setLayout({\n x: nodeDepth\n }, true);\n });\n}\n/**\r\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\r\n *\r\n * @param nodes node of sankey view\r\n * @param edges edge of sankey view\r\n * @param height the whole height of the area to draw the view\r\n * @param nodeGap the vertical distance between two nodes\r\n * in the same column.\r\n * @param iterations the number of iterations for the algorithm\r\n */\n\n\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n\n for (var alpha = 1; iterations > 0; iterations--) {\n // 0.99 is a experience parameter, ensure that each iterations of\n // changes as small as possible.\n alpha *= 0.99;\n relaxRightToLeft(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n relaxLeftToRight(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n }\n}\n\nfunction prepareNodesByBreadth(nodes, orient) {\n var nodesByBreadth = [];\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\n var groupResult = groupData(nodes, function (node) {\n return node.getLayout()[keyAttr];\n });\n groupResult.keys.sort(function (a, b) {\n return a - b;\n });\n zrUtil.each(groupResult.keys, function (key) {\n nodesByBreadth.push(groupResult.buckets.get(key));\n });\n return nodesByBreadth;\n}\n/**\r\n * Compute the original y-position for each node\r\n */\n\n\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n zrUtil.each(nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n zrUtil.each(nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\n if (ky < minKy) {\n minKy = ky;\n }\n });\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n zrUtil.each(edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}\n/**\r\n * Resolve the collision of initialized depth (y-position)\r\n */\n\n\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodesByBreadth, function (nodes) {\n nodes.sort(function (a, b) {\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n });\n var nodeX;\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n\n for (var i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout()[keyAttr];\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] + dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n }\n\n var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up\n\n dy = y0 - nodeGap - viewWidth;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n y0 = nodeX;\n\n for (var i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr];\n }\n }\n });\n}\n/**\r\n * Change the y-position of the nodes, except most the right side nodes\r\n * @param nodesByBreadth\r\n * @param alpha parameter used to adjust the nodes y-position\r\n */\n\n\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.outEdges.length) {\n var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.outEdges.length;\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n\nfunction weightedTarget(edge, orient) {\n return center(edge.node2, orient) * edge.getValue();\n}\n\nfunction centerTarget(edge, orient) {\n return center(edge.node2, orient);\n}\n\nfunction weightedSource(edge, orient) {\n return center(edge.node1, orient) * edge.getValue();\n}\n\nfunction centerSource(edge, orient) {\n return center(edge.node1, orient);\n}\n\nfunction center(node, orient) {\n return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;\n}\n\nfunction getEdgeValue(edge) {\n return edge.getValue();\n}\n\nfunction sum(array, cb, orient) {\n var sum = 0;\n var len = array.length;\n var i = -1;\n\n while (++i < len) {\n var value = +cb(array[i], orient);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n\n return sum;\n}\n/**\r\n * Change the y-position of the nodes, except most the left side nodes\r\n */\n\n\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.inEdges.length) {\n var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.inEdges.length;\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n/**\r\n * Compute the depth(y-position) of each edge\r\n */\n\n\nfunction computeEdgeDepths(nodes, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodes, function (node) {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\n });\n });\n zrUtil.each(nodes, function (node) {\n var sy = 0;\n var ty = 0;\n zrUtil.each(node.outEdges, function (edge) {\n edge.setLayout({\n sy: sy\n }, true);\n sy += edge.getLayout().dy;\n });\n zrUtil.each(node.inEdges, function (edge) {\n edge.setLayout({\n ty: ty\n }, true);\n ty += edge.getLayout().dy;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n\n if (edges.length) {\n zrUtil.each(edges, function (edge) {\n var edgeStyle = edge.getModel().get('lineStyle');\n edge.setVisual('style', edgeStyle);\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SankeyView from './SankeyView.js';\nimport SankeySeriesModel from './SankeySeries.js';\nimport sankeyLayout from './sankeyLayout.js';\nimport sankeyVisual from './sankeyVisual.js';\nexport function install(registers) {\n registers.registerChartView(SankeyView);\n registers.registerSeriesModel(SankeySeriesModel);\n registers.registerLayout(sankeyLayout);\n registers.registerVisual(sankeyVisual);\n registers.registerAction({\n type: 'dragNode',\n event: 'dragnode',\n // here can only use 'update' now, other value is not support in echarts.\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sankey',\n query: payload\n }, function (seriesModel) {\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport createSeriesDataSimply from './createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\n\nvar WhiskerBoxCommonMixin =\n/** @class */\nfunction () {\n function WhiskerBoxCommonMixin() {}\n /**\r\n * @override\r\n */\n\n\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal; // FIXME\n // Consider time axis.\n\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data; // Clone a new data for next setOption({}) usage.\n // Avoid modifying current data will affect further update.\n\n if (data && addOrdinal) {\n var newOptionData_1 = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n\n if (zrUtil.isArray(item)) {\n newItem = item.slice(); // Modify current using data.\n\n item.unshift(index);\n } else if (zrUtil.isArray(item.value)) {\n newItem = zrUtil.extend({}, item);\n newItem.value = newItem.value.slice(); // Modify current using data.\n\n item.value.unshift(index);\n } else {\n newItem = item;\n }\n\n newOptionData_1.push(newItem);\n });\n option.data = newOptionData_1;\n }\n\n var defaultValueDimensions = this.defaultValueDimensions;\n var coordDimensions = [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }];\n return createSeriesDataSimply(this, {\n coordDimensions: coordDimensions,\n dimensionsCount: defaultValueDimensions.length + 1,\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\n });\n };\n /**\r\n * If horizontal, base axis is x, otherwise y.\r\n * @override\r\n */\n\n\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n };\n\n return WhiskerBoxCommonMixin;\n}();\n\n;\nexport { WhiskerBoxCommonMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar BoxplotSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BoxplotSeriesModel, _super);\n\n function BoxplotSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotSeriesModel.type; // TODO\n // box width represents group size, so dimension should have 'size'.\n\n /**\r\n * @see \r\n * The meanings of 'min' and 'max' depend on user,\r\n * and echarts do not need to know it.\r\n * @readOnly\r\n */\n\n _this.defaultValueDimensions = [{\n name: 'min',\n defaultTooltip: true\n }, {\n name: 'Q1',\n defaultTooltip: true\n }, {\n name: 'median',\n defaultTooltip: true\n }, {\n name: 'Q3',\n defaultTooltip: true\n }, {\n name: 'max',\n defaultTooltip: true\n }];\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n BoxplotSeriesModel.type = 'series.boxplot';\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n BoxplotSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n layout: null,\n boxWidth: [7, 50],\n itemStyle: {\n color: '#fff',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2,\n shadowBlur: 5,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n }\n },\n animationDuration: 800\n };\n return BoxplotSeriesModel;\n}(SeriesModel);\n\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\nexport default BoxplotSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar BoxplotView =\n/** @class */\nfunction (_super) {\n __extends(BoxplotView, _super);\n\n function BoxplotView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotView.type;\n return _this;\n }\n\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var oldData = this._data; // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(symbolEl);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (!symbolEl) {\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n } else {\n saveOldStyle(symbolEl);\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n }\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n BoxplotView.prototype.remove = function (ecModel) {\n var group = this.group;\n var data = this._data;\n this._data = null;\n data && data.eachItemGraphicEl(function (el) {\n el && group.remove(el);\n });\n };\n\n BoxplotView.type = 'boxplot';\n return BoxplotView;\n}(ChartView);\n\nvar BoxPathShape =\n/** @class */\nfunction () {\n function BoxPathShape() {}\n\n return BoxPathShape;\n}();\n\nvar BoxPath =\n/** @class */\nfunction (_super) {\n __extends(BoxPath, _super);\n\n function BoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'boxplotBoxPath';\n return _this;\n }\n\n BoxPath.prototype.getDefaultShape = function () {\n return new BoxPathShape();\n };\n\n BoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n var i = 0;\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n\n for (; i < 4; i++) {\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n\n ctx.closePath();\n\n for (; i < ends.length; i++) {\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n };\n\n return BoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n var ends = itemLayout.ends;\n var el = new BoxPath({\n shape: {\n points: isInit ? transInit(ends, constDim, itemLayout) : ends\n }\n });\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n return el;\n}\n\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n var seriesModel = data.hostModel;\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n updateMethod(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.z2 = 100;\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\n\nfunction transInit(points, dim, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[dim] = itemLayout.initBaseline;\n return point;\n });\n}\n\nexport default BoxplotView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../../util/number.js';\nvar each = zrUtil.each;\nexport default function boxplotLayout(ecModel) {\n var groupResult = groupSeriesByAxis(ecModel);\n each(groupResult, function (groupItem) {\n var seriesModels = groupItem.seriesModels;\n\n if (!seriesModels.length) {\n return;\n }\n\n calculateBase(groupItem);\n each(seriesModels, function (seriesModel, idx) {\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n });\n });\n}\n/**\r\n * Group series by axis.\r\n */\n\nfunction groupSeriesByAxis(ecModel) {\n var result = [];\n var axisList = [];\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n var baseAxis = seriesModel.getBaseAxis();\n var idx = zrUtil.indexOf(axisList, baseAxis);\n\n if (idx < 0) {\n idx = axisList.length;\n axisList[idx] = baseAxis;\n result[idx] = {\n axis: baseAxis,\n seriesModels: []\n };\n }\n\n result[idx].seriesModels.push(seriesModel);\n });\n return result;\n}\n/**\r\n * Calculate offset and box width for each series.\r\n */\n\n\nfunction calculateBase(groupItem) {\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n var extent = baseAxis.getExtent();\n bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}\n/**\r\n * Calculate points location for each series.\r\n */\n\n\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var halfWidth = boxWidth / 2;\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n var vDimIdx = 1 - cDimIdx;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n\n if (cDim == null || vDims.length < 5) {\n return;\n }\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var axisDimVal = data.get(cDim, dataIndex);\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n var ends = [];\n addBodyEnd(ends, end2, false);\n addBodyEnd(ends, end4, true);\n ends.push(end1, end2, end5, end4);\n layEndLine(ends, end1);\n layEndLine(ends, end5);\n layEndLine(ends, median);\n data.setItemLayout(dataIndex, {\n initBaseline: median[vDimIdx],\n ends: ends\n });\n }\n\n function getPoint(axisDimVal, dim, dataIndex) {\n var val = data.get(dim, dataIndex);\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n var point;\n\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n } else {\n point = coordSys.dataToPoint(p);\n point[cDimIdx] += offset;\n }\n\n return point;\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] += halfWidth;\n point2[cDimIdx] -= halfWidth;\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function layEndLine(ends, endCenter) {\n var from = endCenter.slice();\n var to = endCenter.slice();\n from[cDimIdx] -= halfWidth;\n to[cDimIdx] += halfWidth;\n ends.push(from, to);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { quantile, asc } from '../../util/number.js';\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\n/**\r\n * See:\r\n * \r\n * \r\n *\r\n * Helper method for preparing data.\r\n *\r\n * @param rawData like\r\n * [\r\n * [12,232,443], (raw data set for the first box)\r\n * [3843,5545,1232], (raw data set for the second box)\r\n * ...\r\n * ]\r\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\r\n * default 1.5, means Q1 - 1.5 * (Q3 - Q1).\r\n * If 'none'/0 passed, min bound will not be used.\r\n */\n\nexport default function prepareBoxplotData(rawData, opt) {\n opt = opt || {};\n var boxData = [];\n var outliers = [];\n var boundIQR = opt.boundIQR;\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\n\n for (var i = 0; i < rawData.length; i++) {\n var ascList = asc(rawData[i].slice());\n var Q1 = quantile(ascList, 0.25);\n var Q2 = quantile(ascList, 0.5);\n var Q3 = quantile(ascList, 0.75);\n var min = ascList[0];\n var max = ascList[ascList.length - 1];\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\n var low = useExtreme ? min : Math.max(min, Q1 - bound);\n var high = useExtreme ? max : Math.min(max, Q3 + bound);\n var itemNameFormatter = opt.itemNameFormatter;\n var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({\n value: i\n }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + '';\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\n\n for (var j = 0; j < ascList.length; j++) {\n var dataItem = ascList[j];\n\n if (dataItem < low || dataItem > high) {\n var outlier = [itemName, dataItem];\n outliers.push(outlier);\n }\n }\n }\n\n return {\n boxData: boxData,\n outliers: outliers\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport prepareBoxplotData from './prepareBoxplotData.js';\nimport { throwError, makePrintable } from '../../util/log.js';\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nexport var boxplotTransform = {\n type: 'echarts:boxplot',\n transform: function transform(params) {\n var upstream = params.upstream;\n\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\n }\n\n throwError(errMsg);\n }\n\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\n return [{\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\n data: result.boxData\n }, {\n data: result.outliers\n }];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport BoxplotSeriesModel from './BoxplotSeries.js';\nimport BoxplotView from './BoxplotView.js';\nimport boxplotLayout from './boxplotLayout.js';\nimport { boxplotTransform } from './boxplotTransform.js';\nexport function install(registers) {\n registers.registerSeriesModel(BoxplotSeriesModel);\n registers.registerChartView(BoxplotView);\n registers.registerLayout(boxplotLayout);\n registers.registerTransform(boxplotTransform);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar SKIP_PROPS = ['color', 'borderColor'];\n\nvar CandlestickView =\n/** @class */\nfunction (_super) {\n __extends(CandlestickView, _super);\n\n function CandlestickView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickView.type;\n return _this;\n }\n\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\n // If there is clipPath created in large mode. Remove it.\n this.group.removeClipPath(); // Clear previously rendered progressive elements.\n\n this._progressiveEls = null;\n\n this._updateDrawMode(seriesModel);\n\n this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n };\n\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._clear();\n\n this._updateDrawMode(seriesModel);\n };\n\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n this._progressiveEls = [];\n this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n };\n\n CandlestickView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n CandlestickView.prototype._renderNormal = function (seriesModel) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var isSimpleBox = data.getLayout('isSimpleBox');\n var needsClip = seriesModel.get('clip', true);\n var coord = seriesModel.coordinateSystem;\n var clipArea = coord.getArea && coord.getArea(); // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n return;\n }\n\n var el = createNormalBox(itemLayout, newIdx, true);\n graphic.initProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(el);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n group.remove(el);\n return;\n }\n\n if (!el) {\n el = createNormalBox(itemLayout, newIdx);\n } else {\n graphic.updateProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n saveOldStyle(el);\n }\n\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n CandlestickView.prototype._renderLarge = function (seriesModel) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n };\n\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\n var data = seriesModel.getData();\n var isSimpleBox = data.getLayout('isSimpleBox');\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemLayout = data.getItemLayout(dataIndex);\n var el = createNormalBox(itemLayout, dataIndex);\n setBoxCommon(el, data, dataIndex, isSimpleBox);\n el.incremental = true;\n this.group.add(el);\n\n this._progressiveEls.push(el);\n }\n };\n\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n\n CandlestickView.prototype.remove = function (ecModel) {\n this._clear();\n };\n\n CandlestickView.prototype._clear = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n CandlestickView.type = 'candlestick';\n return CandlestickView;\n}(ChartView);\n\nvar NormalBoxPathShape =\n/** @class */\nfunction () {\n function NormalBoxPathShape() {}\n\n return NormalBoxPathShape;\n}();\n\nvar NormalBoxPath =\n/** @class */\nfunction (_super) {\n __extends(NormalBoxPath, _super);\n\n function NormalBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'normalCandlestickBox';\n return _this;\n }\n\n NormalBoxPath.prototype.getDefaultShape = function () {\n return new NormalBoxPathShape();\n };\n\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n\n if (this.__simpleBox) {\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[6][0], ends[6][1]);\n } else {\n ctx.moveTo(ends[0][0], ends[0][1]);\n ctx.lineTo(ends[1][0], ends[1][1]);\n ctx.lineTo(ends[2][0], ends[2][1]);\n ctx.lineTo(ends[3][0], ends[3][1]);\n ctx.closePath();\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[5][0], ends[5][1]);\n ctx.moveTo(ends[6][0], ends[6][1]);\n ctx.lineTo(ends[7][0], ends[7][1]);\n }\n };\n\n return NormalBoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n var ends = itemLayout.ends;\n return new NormalBoxPath({\n shape: {\n points: isInit ? transInit(ends, itemLayout) : ends\n },\n z2: 100\n });\n}\n\nfunction isNormalBoxClipped(clipArea, itemLayout) {\n var clipped = true;\n\n for (var i = 0; i < itemLayout.ends.length; i++) {\n // If any point are in the region.\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\n clipped = false;\n break;\n }\n }\n\n return clipped;\n}\n\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n var itemModel = data.getItemModel(dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.__simpleBox = isSimpleBox;\n setStatesStylesFromModel(el, itemModel);\n}\n\nfunction transInit(points, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[1] = itemLayout.initBaseline;\n return point;\n });\n}\n\nvar LargeBoxPathShape =\n/** @class */\nfunction () {\n function LargeBoxPathShape() {}\n\n return LargeBoxPathShape;\n}();\n\nvar LargeBoxPath =\n/** @class */\nfunction (_super) {\n __extends(LargeBoxPath, _super);\n\n function LargeBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeCandlestickBox';\n return _this;\n }\n\n LargeBoxPath.prototype.getDefaultShape = function () {\n return new LargeBoxPathShape();\n };\n\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n\n for (var i = 0; i < points.length;) {\n if (this.__sign === points[i++]) {\n var x = points[i++];\n ctx.moveTo(x, points[i++]);\n ctx.lineTo(x, points[i++]);\n } else {\n i += 3;\n }\n }\n };\n\n return LargeBoxPath;\n}(Path);\n\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n var data = seriesModel.getData();\n var largePoints = data.getLayout('largePoints');\n var elP = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 1,\n ignoreCoarsePointer: true\n });\n group.add(elP);\n var elN = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: -1,\n ignoreCoarsePointer: true\n });\n group.add(elN);\n var elDoji = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 0,\n ignoreCoarsePointer: true\n });\n group.add(elDoji);\n setLargeStyle(1, elP, seriesModel, data);\n setLargeStyle(-1, elN, seriesModel, data);\n setLargeStyle(0, elDoji, seriesModel, data);\n\n if (incremental) {\n elP.incremental = true;\n elN.incremental = true;\n }\n\n if (progressiveEls) {\n progressiveEls.push(elP, elN);\n }\n}\n\nfunction setLargeStyle(sign, el, seriesModel, data) {\n // TODO put in visual?\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) // Use color for border color by default.\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\n\n if (sign === 0) {\n borderColor = seriesModel.get(['itemStyle', 'borderColorDoji']);\n } // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n}\n\nexport default CandlestickView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar CandlestickSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CandlestickSeriesModel, _super);\n\n function CandlestickSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickSeriesModel.type;\n _this.defaultValueDimensions = [{\n name: 'open',\n defaultTooltip: true\n }, {\n name: 'close',\n defaultTooltip: true\n }, {\n name: 'lowest',\n defaultTooltip: true\n }, {\n name: 'highest',\n defaultTooltip: true\n }];\n return _this;\n }\n /**\r\n * Get dimension for shadow in dataZoom\r\n * @return dimension name\r\n */\n\n\n CandlestickSeriesModel.prototype.getShadowDim = function () {\n return 'open';\n };\n\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n var itemLayout = data.getItemLayout(dataIndex);\n return itemLayout && selectors.rect(itemLayout.brushRect);\n };\n\n CandlestickSeriesModel.type = 'series.candlestick';\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n CandlestickSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n clip: true,\n itemStyle: {\n color: '#eb5454',\n color0: '#47b262',\n borderColor: '#eb5454',\n borderColor0: '#47b262',\n borderColorDoji: null,\n // borderColor: '#d24040',\n // borderColor0: '#398f4f',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2\n }\n },\n barMaxWidth: null,\n barMinWidth: null,\n barWidth: null,\n large: true,\n largeThreshold: 600,\n progressive: 3e3,\n progressiveThreshold: 1e4,\n progressiveChunkMode: 'mod',\n animationEasing: 'linear',\n animationDuration: 300\n };\n return CandlestickSeriesModel;\n}(SeriesModel);\n\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\nexport default CandlestickSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function candlestickPreprocessor(option) {\n if (!option || !zrUtil.isArray(option.series)) {\n return;\n } // Translate 'k' to 'candlestick'.\n\n\n zrUtil.each(option.series, function (seriesItem) {\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n seriesItem.type = 'candlestick';\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { extend } from 'zrender/lib/core/util.js';\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar dojiBorderColorQuery = ['itemStyle', 'borderColorDoji'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nvar candlestickVisual = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n function getColor(sign, model) {\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n }\n\n function getBorderColor(sign, model) {\n return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n } // Only visible series has each data be visual encoded\n\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var isLargeRender = seriesModel.pipelineContext.large;\n return !isLargeRender && {\n progress: function (params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemModel = data.getItemModel(dataIndex);\n var sign = data.getItemLayout(dataIndex).sign;\n var style = itemModel.getItemStyle();\n style.fill = getColor(sign, itemModel);\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n extend(existsStyle, style);\n }\n }\n };\n }\n};\nexport default candlestickVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { subPixelOptimize } from '../../util/graphic.js';\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { parsePercent } from '../../util/number.js';\nimport { map, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nvar candlestickLayout = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var candleWidth = calculateCandleWidth(seriesModel, data);\n var cDimIdx = 0;\n var vDimIdx = 1;\n var coordDims = ['x', 'y'];\n var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));\n var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);\n var openDimI = vDimsI[0];\n var closeDimI = vDimsI[1];\n var lowestDimI = vDimsI[2];\n var highestDimI = vDimsI[3];\n data.setLayout({\n candleWidth: candleWidth,\n // The value is experimented visually.\n isSimpleBox: candleWidth <= 1.3\n });\n\n if (cDimI < 0 || vDimsI.length < 4) {\n return;\n }\n\n return {\n progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n };\n\n function normalProgress(params, data) {\n var dataIndex;\n var store = data.getStore();\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n var ocLow = Math.min(openVal, closeVal);\n var ocHigh = Math.max(openVal, closeVal);\n var ocLowPoint = getPoint(ocLow, axisDimVal);\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\n var lowestPoint = getPoint(lowestVal, axisDimVal);\n var highestPoint = getPoint(highestVal, axisDimVal);\n var ends = [];\n addBodyEnd(ends, ocHighPoint, 0);\n addBodyEnd(ends, ocLowPoint, 1);\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n var itemModel = data.getItemModel(dataIndex);\n var hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']);\n data.setItemLayout(dataIndex, {\n sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),\n initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n ends: ends,\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n });\n }\n\n function getPoint(val, axisDimVal) {\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n var pmin = getPoint(lowestVal, axisDimVal);\n var pmax = getPoint(highestVal, axisDimVal);\n pmin[cDimIdx] -= candleWidth / 2;\n pmax[cDimIdx] -= candleWidth / 2;\n return {\n x: pmin[0],\n y: pmin[1],\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n };\n }\n\n function subPixelOptimizePoint(point) {\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n return point;\n }\n }\n\n function largeProgress(params, data) {\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n var points = createFloat32Array(params.count * 4);\n var offset = 0;\n var point;\n var tmpIn = [];\n var tmpOut = [];\n var dataIndex;\n var store = data.getStore();\n var hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']);\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n points[offset++] = NaN;\n offset += 3;\n continue;\n }\n\n points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);\n tmpIn[cDimIdx] = axisDimVal;\n tmpIn[vDimIdx] = lowestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n tmpIn[vDimIdx] = highestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[1] : NaN;\n }\n\n data.setLayout('largePoints', points);\n }\n }\n};\n/**\r\n * Get the sign of a single data.\r\n *\r\n * @returns 0 for doji with hasDojiColor: true,\r\n * 1 for positive,\r\n * -1 for negative.\r\n */\n\nfunction getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) {\n var sign;\n\n if (openVal > closeVal) {\n sign = -1;\n } else if (openVal < closeVal) {\n sign = 1;\n } else {\n sign = hasDojiColor // When doji color is set, use it instead of color/color0.\n ? 0 : dataIndex > 0 // If close === open, compare with close of last record\n ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive\n 1;\n }\n\n return sign;\n}\n\nfunction calculateCandleWidth(seriesModel, data) {\n var baseAxis = seriesModel.getBaseAxis();\n var extent;\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n var barWidth = seriesModel.get('barWidth');\n return barWidth != null ? parsePercent(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap.\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\n\nexport default candlestickLayout;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CandlestickView from './CandlestickView.js';\nimport CandlestickSeriesModel from './CandlestickSeries.js';\nimport preprocessor from './preprocessor.js';\nimport candlestickVisual from './candlestickVisual.js';\nimport candlestickLayout from './candlestickLayout.js';\nexport function install(registers) {\n registers.registerChartView(CandlestickView);\n registers.registerSeriesModel(CandlestickSeriesModel);\n registers.registerPreprocessor(preprocessor);\n registers.registerVisual(candlestickVisual);\n registers.registerLayout(candlestickLayout);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport SymbolClz from './Symbol.js';\n\nfunction updateRipplePath(rippleGroup, effectCfg) {\n var color = effectCfg.rippleEffectColor || effectCfg.color;\n rippleGroup.eachChild(function (ripplePath) {\n ripplePath.attr({\n z: effectCfg.z,\n zlevel: effectCfg.zlevel,\n style: {\n stroke: effectCfg.brushType === 'stroke' ? color : null,\n fill: effectCfg.brushType === 'fill' ? color : null\n }\n });\n });\n}\n\nvar EffectSymbol =\n/** @class */\nfunction (_super) {\n __extends(EffectSymbol, _super);\n\n function EffectSymbol(data, idx) {\n var _this = _super.call(this) || this;\n\n var symbol = new SymbolClz(data, idx);\n var rippleGroup = new Group();\n\n _this.add(symbol);\n\n _this.add(rippleGroup);\n\n _this.updateData(data, idx);\n\n return _this;\n }\n\n EffectSymbol.prototype.stopEffectAnimation = function () {\n this.childAt(1).removeAll();\n };\n\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\n var symbolType = effectCfg.symbolType;\n var color = effectCfg.color;\n var rippleNumber = effectCfg.rippleNumber;\n var rippleGroup = this.childAt(1);\n\n for (var i = 0; i < rippleNumber; i++) {\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4136.\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n ripplePath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 99,\n silent: true,\n scaleX: 0.5,\n scaleY: 0.5\n });\n var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;\n ripplePath.animate('', true).when(effectCfg.period, {\n scaleX: effectCfg.rippleScale / 2,\n scaleY: effectCfg.rippleScale / 2\n }).delay(delay).start();\n ripplePath.animateStyle(true).when(effectCfg.period, {\n opacity: 0\n }).delay(delay).start();\n rippleGroup.add(ripplePath);\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\r\n * Update effect symbol\r\n */\n\n\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\n var oldEffectCfg = this._effectCfg;\n var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed\n\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber'];\n\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n var propName = DIFFICULT_PROPS[i];\n\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\n this.stopEffectAnimation();\n this.startEffectAnimation(effectCfg);\n return;\n }\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\r\n * Highlight symbol\r\n */\n\n\n EffectSymbol.prototype.highlight = function () {\n enterEmphasis(this);\n };\n /**\r\n * Downplay symbol\r\n */\n\n\n EffectSymbol.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n EffectSymbol.prototype.getSymbolType = function () {\n var symbol = this.childAt(0);\n return symbol && symbol.getSymbolType();\n };\n /**\r\n * Update symbol properties\r\n */\n\n\n EffectSymbol.prototype.updateData = function (data, idx) {\n var _this = this;\n\n var seriesModel = data.hostModel;\n this.childAt(0).updateData(data, idx);\n var rippleGroup = this.childAt(1);\n var itemModel = data.getItemModel(idx);\n var symbolType = data.getItemVisual(idx, 'symbol');\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolStyle = data.getItemVisual(idx, 'style');\n var color = symbolStyle && symbolStyle.fill;\n var emphasisModel = itemModel.getModel('emphasis');\n rippleGroup.setScale(symbolSize);\n rippleGroup.traverse(function (ripplePath) {\n ripplePath.setStyle('fill', color);\n });\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n rippleGroup.x = symbolOffset[0];\n rippleGroup.y = symbolOffset[1];\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var effectCfg = {};\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\n effectCfg.effectOffset = idx / data.count();\n effectCfg.z = seriesModel.getShallow('z') || 0;\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\n effectCfg.symbolType = symbolType;\n effectCfg.color = color;\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\n effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']);\n\n if (effectCfg.showEffectOn === 'render') {\n this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n this._effectCfg = effectCfg;\n } else {\n // Not keep old effect config\n this._effectCfg = null;\n this.stopEffectAnimation();\n\n this.onHoverStateChange = function (toState) {\n if (toState === 'emphasis') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.startEffectAnimation(effectCfg);\n }\n } else if (toState === 'normal') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.stopEffectAnimation();\n }\n }\n };\n }\n\n this._effectCfg = effectCfg;\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n ;\n\n EffectSymbol.prototype.fadeOut = function (cb) {\n cb && cb();\n };\n\n ;\n return EffectSymbol;\n}(Group);\n\nexport default EffectSymbol;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport EffectSymbol from '../helper/EffectSymbol.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\n\nvar EffectScatterView =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterView, _super);\n\n function EffectScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterView.type;\n return _this;\n }\n\n EffectScatterView.prototype.init = function () {\n this._symbolDraw = new SymbolDraw(EffectSymbol);\n };\n\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var effectSymbolDraw = this._symbolDraw;\n effectSymbolDraw.updateData(data, {\n clipShape: this._getClipShape(seriesModel)\n });\n this.group.add(effectSymbolDraw.group);\n };\n\n EffectScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n this.group.dirty();\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout();\n };\n\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.getRoamTransform) {\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\n this.group.decomposeTransform();\n }\n };\n\n EffectScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n };\n\n EffectScatterView.type = 'effectScatter';\n return EffectScatterView;\n}(ChartView);\n\nexport default EffectScatterView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar EffectScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterSeriesModel, _super);\n\n function EffectScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n EffectScatterSeriesModel.type = 'series.effectScatter';\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\n EffectScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n effectType: 'ripple',\n progressive: 0,\n // When to show the effect, option: 'render'|'emphasis'\n showEffectOn: 'render',\n clip: true,\n // Ripple effect config\n rippleEffect: {\n period: 4,\n // Scale of ripple\n scale: 2.5,\n // Brush type can be fill or stroke\n brushType: 'fill',\n // Ripple number\n number: 3\n },\n universalTransition: {\n divideShape: 'clone'\n },\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n // itemStyle: {\n // opacity: 1\n // }\n\n };\n return EffectScatterSeriesModel;\n}(SeriesModel);\n\nexport default EffectScatterSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport EffectScatterView from './EffectScatterView.js';\nimport EffectScatterSeriesModel from './EffectScatterSeries.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n registers.registerChartView(EffectScatterView);\n registers.registerSeriesModel(EffectScatterSeriesModel);\n registers.registerLayout(layoutPoints('effectScatter'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Provide effect for line\r\n */\n\nimport * as graphic from '../../util/graphic.js';\nimport Line from './Line.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as curveUtil from 'zrender/lib/core/curve.js';\n\nvar EffectLine =\n/** @class */\nfunction (_super) {\n __extends(EffectLine, _super);\n\n function EffectLine(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this.add(_this.createLine(lineData, idx, seriesScope));\n\n _this._updateEffectSymbol(lineData, idx);\n\n return _this;\n }\n\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n };\n\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.scaleX = size[0];\n symbol.scaleY = size[1];\n symbol.setColor(color);\n this._symbolType = symbolType;\n this._symbolScale = size;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var roundTrip = effectModel.get('roundTrip');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n }); // Ignore when updating\n\n symbol.ignore = true;\n\n this._updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this._getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {\n symbol.stopAnimation();\n var delayNum = void 0;\n\n if (zrUtil.isFunction(delayExpr)) {\n delayNum = delayExpr(idx);\n } else {\n delayNum = delayExpr;\n }\n\n if (symbol.__t > 0) {\n delayNum = -period * symbol.__t;\n }\n\n this._animateSymbol(symbol, period, delayNum, loop, roundTrip);\n }\n\n this._period = period;\n this._loop = loop;\n this._roundTrip = roundTrip;\n };\n\n EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop, roundTrip) {\n if (period > 0) {\n symbol.__t = 0;\n var self_1 = this;\n var animator = symbol.animate('', loop).when(roundTrip ? period * 2 : period, {\n __t: roundTrip ? 2 : 1\n }).delay(delayNum).during(function () {\n self_1._updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self_1.remove(symbol);\n });\n }\n\n animator.start();\n }\n };\n\n EffectLine.prototype._getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n };\n\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n };\n\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n };\n\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var pos = [symbol.x, symbol.y];\n var lastPos = pos.slice();\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t);\n var ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint\n\n if (t === 1) {\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n }\n } else if (symbol.__lastT === 1) {\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n symbol.scaleY = 2 * vec2.dist(p1, pos);\n } else {\n symbol.scaleY = this._symbolScale[1];\n }\n }\n\n symbol.__lastT = symbol.__t;\n symbol.ignore = false;\n symbol.x = pos[0];\n symbol.y = pos[1];\n };\n\n EffectLine.prototype.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n return EffectLine;\n}(graphic.Group);\n\nexport default EffectLine;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\n\nvar Polyline =\n/** @class */\nfunction (_super) {\n __extends(Polyline, _super);\n\n function Polyline(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createPolyline(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Polyline.prototype._createPolyline = function (lineData, idx, seriesScope) {\n // let seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n\n if (!seriesScope || lineData.hasItemOption) {\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n }\n\n line.useStyle(lineData.getItemVisual(idx, 'style'));\n line.style.fill = null;\n line.style.strokeNoScale = true;\n var lineEmphasisState = line.ensureState('emphasis');\n lineEmphasisState.style = emphasisLineStyle;\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n ;\n\n Polyline.prototype.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n };\n\n ;\n return Polyline;\n}(graphic.Group);\n\nexport default Polyline;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Polyline from './Polyline.js';\nimport EffectLine from './EffectLine.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\n\nvar EffectPolyline =\n/** @class */\nfunction (_super) {\n __extends(EffectPolyline, _super);\n\n function EffectPolyline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this._lastFrame = 0;\n _this._lastFramePercent = 0;\n return _this;\n } // Override\n\n\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Polyline(lineData, idx, seriesScope);\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\n this._points = points;\n var accLenArr = [0];\n var len = 0;\n\n for (var i = 1; i < points.length; i++) {\n var p1 = points[i - 1];\n var p2 = points[i];\n len += vec2.dist(p1, p2);\n accLenArr.push(len);\n }\n\n if (len === 0) {\n this._length = 0;\n return;\n }\n\n for (var i = 0; i < accLenArr.length; i++) {\n accLenArr[i] /= len;\n }\n\n this._offsets = accLenArr;\n this._length = len;\n };\n\n ; // Override\n\n EffectPolyline.prototype._getLineLength = function () {\n return this._length;\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var points = this._points;\n var offsets = this._offsets;\n var len = points.length;\n\n if (!offsets) {\n // Has length 0\n return;\n }\n\n var lastFrame = this._lastFrame;\n var frame;\n\n if (t < this._lastFramePercent) {\n // Start from the next frame\n // PENDING start from lastFrame ?\n var start = Math.min(lastFrame + 1, len - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (offsets[frame] <= t) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, len - 2);\n } else {\n for (frame = lastFrame; frame < len; frame++) {\n if (offsets[frame] > t) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, len - 2);\n }\n\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\n var p0 = points[frame];\n var p1 = points[frame + 1];\n symbol.x = p0[0] * (1 - p) + p * p1[0];\n symbol.y = p0[1] * (1 - p) + p * p1[1];\n var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];\n var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n this._lastFrame = frame;\n this._lastFramePercent = t;\n symbol.ignore = false;\n };\n\n ;\n return EffectPolyline;\n}(EffectLine);\n\nexport default EffectPolyline;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO Batch by color\n\nimport * as graphic from '../../util/graphic.js';\nimport * as lineContain from 'zrender/lib/contain/line.js';\nimport * as quadraticContain from 'zrender/lib/contain/quadratic.js';\nimport { getECData } from '../../util/innerStore.js';\n\nvar LargeLinesPathShape =\n/** @class */\nfunction () {\n function LargeLinesPathShape() {\n this.polyline = false;\n this.curveness = 0;\n this.segs = [];\n }\n\n return LargeLinesPathShape;\n}();\n\nvar LargeLinesPath =\n/** @class */\nfunction (_super) {\n __extends(LargeLinesPath, _super);\n\n function LargeLinesPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n\n LargeLinesPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n\n LargeLinesPath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n LargeLinesPath.prototype.getDefaultShape = function () {\n return new LargeLinesPathShape();\n };\n\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\n var segs = shape.segs;\n var curveness = shape.curveness;\n var i;\n\n if (shape.polyline) {\n for (i = this._off; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n ctx.moveTo(segs[i++], segs[i++]);\n\n for (var k = 1; k < count; k++) {\n ctx.lineTo(segs[i++], segs[i++]);\n }\n }\n }\n } else {\n for (i = this._off; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n ctx.moveTo(x0, y0);\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n ctx.quadraticCurveTo(x2, y2, x1, y1);\n } else {\n ctx.lineTo(x1, y1);\n }\n }\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\n var shape = this.shape;\n var segs = shape.segs;\n var curveness = shape.curveness;\n var lineWidth = this.style.lineWidth;\n\n if (shape.polyline) {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n\n for (var k = 1; k < count; k++) {\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n }\n\n dataIndex++;\n }\n } else {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n\n if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n } else {\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n\n dataIndex++;\n }\n }\n\n return -1;\n };\n\n LargeLinesPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n\n this.hoverDataIdx = -1;\n return false;\n };\n\n LargeLinesPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n\n if (!rect) {\n var shape = this.shape;\n var points = shape.segs;\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n\n rect = this._rect = new graphic.BoundingRect(minX, minY, maxX, maxY);\n }\n\n return rect;\n };\n\n return LargeLinesPath;\n}(graphic.Path);\n\nvar LargeLineDraw =\n/** @class */\nfunction () {\n function LargeLineDraw() {\n this.group = new graphic.Group();\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n LargeLineDraw.prototype.updateData = function (data) {\n this._clear();\n\n var lineEl = this._create();\n\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data);\n };\n\n ;\n /**\r\n * @override\r\n */\n\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clear();\n };\n\n ;\n /**\r\n * @override\r\n */\n\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\n var lastAdded = this._newAdded[0];\n var linePoints = data.getLayout('linesPoints');\n var oldSegs = lastAdded && lastAdded.shape.segs; // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n\n if (oldSegs && oldSegs.length < 2e4) {\n var oldLen = oldSegs.length;\n var newSegs = new Float32Array(oldLen + linePoints.length); // Concat two array\n\n newSegs.set(oldSegs);\n newSegs.set(linePoints, oldLen);\n lastAdded.setShape({\n segs: newSegs\n });\n } else {\n // Clear\n this._newAdded = [];\n\n var lineEl = this._create();\n\n lineEl.incremental = true;\n lineEl.setShape({\n segs: linePoints\n });\n\n this._setCommon(lineEl, data);\n\n lineEl.__startIndex = taskParams.start;\n }\n };\n /**\r\n * @override\r\n */\n\n\n LargeLineDraw.prototype.remove = function () {\n this._clear();\n };\n\n LargeLineDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n\n LargeLineDraw.prototype._create = function () {\n var lineEl = new LargeLinesPath({\n cursor: 'default',\n ignoreCoarsePointer: true\n });\n\n this._newAdded.push(lineEl);\n\n this.group.add(lineEl);\n return lineEl;\n };\n\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\n var hostModel = data.hostModel;\n lineEl.setShape({\n polyline: hostModel.get('polyline'),\n curveness: hostModel.get(['lineStyle', 'curveness'])\n });\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n lineEl.style.strokeNoScale = true;\n var style = data.getVisual('style');\n\n if (style && style.stroke) {\n lineEl.setStyle('stroke', style.stroke);\n }\n\n lineEl.setStyle('fill', null);\n var ecData = getECData(lineEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData.seriesIndex = hostModel.seriesIndex;\n lineEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = lineEl.hoverDataIdx;\n\n if (dataIndex > 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + lineEl.__startIndex;\n }\n });\n };\n\n ;\n\n LargeLineDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n\n ;\n return LargeLineDraw;\n}();\n\nexport default LargeLineDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Float32Array */\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { error } from '../../util/log.js';\nvar linesLayout = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n error('The lines series must have a coordinate system.');\n }\n\n return;\n }\n\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n return {\n progress: function (params, lineData) {\n var lineCoords = [];\n\n if (isLarge) {\n var points = void 0;\n var segCount = params.end - params.start;\n\n if (isPolyline) {\n var totalCoordsCount = 0;\n\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n\n var offset = 0;\n var pt = [];\n\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n\n if (isPolyline) {\n points[offset++] = len;\n }\n\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get(['lineStyle', 'curveness']);\n\n if (+curveness) {\n 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];\n }\n }\n\n lineData.setItemLayout(i, pts);\n }\n }\n }\n };\n }\n};\nexport default linesLayout;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\n\nvar LinesView =\n/** @class */\nfunction (_super) {\n __extends(LinesView, _super);\n\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesView.type;\n return _this;\n }\n\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength > 0) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n } else if (process.env.NODE_ENV !== 'production') {\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\n }\n }\n\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n };\n\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n LinesView.prototype.eachRendered = function (cb) {\n this._lineDraw && this._lineDraw.eachRendered(cb);\n };\n\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n } // Not in large mode\n\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n };\n\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n };\n\n LinesView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\n\nexport default LinesView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Uint32Array, Float64Array, Float32Array */\n\nimport SeriesModel from '../../model/Series.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { concatArray, mergeAll, map, isNumber } from 'zrender/lib/core/util.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\n\nfunction compatEc2(seriesOpt) {\n var data = seriesOpt.data;\n\n if (data && data[0] && data[0][0] && data[0][0].coord) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');\n }\n\n seriesOpt.data = map(data, function (itemOpt) {\n var coords = [itemOpt[0].coord, itemOpt[1].coord];\n var target = {\n coords: coords\n };\n\n if (itemOpt[0].name) {\n target.fromName = itemOpt[0].name;\n }\n\n if (itemOpt[1].name) {\n target.toName = itemOpt[1].name;\n }\n\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\n });\n }\n}\n\nvar LinesSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LinesSeriesModel, _super);\n\n function LinesSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n LinesSeriesModel.prototype.init = function (option) {\n // The input data may be null/undefined.\n option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type\n\n compatEc2(option);\n\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n\n _super.prototype.init.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.mergeOption = function (option) {\n compatEc2(option);\n\n if (option.data) {\n // Only update when have option data to merge.\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n }\n\n _super.prototype.mergeOption.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.appendData = function (params) {\n var result = this._processFlatCoordsArray(params.data);\n\n if (result.flatCoords) {\n if (!this._flatCoords) {\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n } else {\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n }\n\n params.data = new Float32Array(result.count);\n }\n\n this.getRawData().appendData(params.data);\n };\n\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\n var itemModel = this.getData().getItemModel(idx);\n var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\n }\n }\n\n return coords;\n };\n\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\n if (this._flatCoordsOffset) {\n return this._flatCoordsOffset[idx * 2 + 1];\n } else {\n return this._getCoordsFromItemModel(idx).length;\n }\n };\n\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\n if (this._flatCoordsOffset) {\n var offset = this._flatCoordsOffset[idx * 2];\n var len = this._flatCoordsOffset[idx * 2 + 1];\n\n for (var i = 0; i < len; i++) {\n out[i] = out[i] || [];\n out[i][0] = this._flatCoords[offset + i * 2];\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\n }\n\n return len;\n } else {\n var coords = this._getCoordsFromItemModel(idx);\n\n for (var i = 0; i < coords.length; i++) {\n out[i] = out[i] || [];\n out[i][0] = coords[i][0];\n out[i][1] = coords[i][1];\n }\n\n return coords.length;\n }\n };\n\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\n var startOffset = 0;\n\n if (this._flatCoords) {\n startOffset = this._flatCoords.length;\n } // Stored as a typed array. In format\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\n\n\n if (isNumber(data[0])) {\n var len = data.length; // Store offset and len of each segment\n\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\n var coordsStorage = new Float64Arr(len);\n var coordsCursor = 0;\n var offsetCursor = 0;\n var dataCount = 0;\n\n for (var i = 0; i < len;) {\n dataCount++;\n var count = data[i++]; // Offset\n\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len\n\n coordsOffsetAndLenStorage[offsetCursor++] = count;\n\n for (var k = 0; k < count; k++) {\n var x = data[i++];\n var y = data[i++];\n coordsStorage[coordsCursor++] = x;\n coordsStorage[coordsCursor++] = y;\n\n if (i > len) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invalid data format.');\n }\n }\n }\n }\n\n return {\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n flatCoords: coordsStorage,\n count: dataCount\n };\n }\n\n return {\n flatCoordsOffset: null,\n flatCoords: null,\n count: data.length\n };\n };\n\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n var CoordSys = CoordinateSystem.get(option.coordinateSystem);\n\n if (!CoordSys) {\n throw new Error('Unknown coordinate system ' + option.coordinateSystem);\n }\n }\n\n var lineData = new SeriesData(['value'], this);\n lineData.hasItemOption = false;\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n // dataItem is simply coords\n if (dataItem instanceof Array) {\n return NaN;\n } else {\n lineData.hasItemOption = true;\n var value = dataItem.value;\n\n if (value != null) {\n return value instanceof Array ? value[dimIndex] : value;\n }\n }\n });\n return lineData;\n };\n\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var itemModel = data.getItemModel(dataIndex);\n var name = itemModel.get('name');\n\n if (name) {\n return name;\n }\n\n var fromName = itemModel.get('fromName');\n var toName = itemModel.get('toName');\n var nameArr = [];\n fromName != null && nameArr.push(fromName);\n toName != null && nameArr.push(toName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > ')\n });\n };\n\n LinesSeriesModel.prototype.preventIncremental = function () {\n return !!this.get(['effect', 'show']);\n };\n\n LinesSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n return this.option.large ? 1e4 : this.get('progressive');\n }\n\n return progressive;\n };\n\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n LinesSeriesModel.prototype.getZLevelKey = function () {\n var effectModel = this.getModel('effect');\n var trailLength = effectModel.get('trailLength');\n return this.getData().count() > this.getProgressiveThreshold() // Each progressive series has individual key.\n ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : '';\n };\n\n LinesSeriesModel.type = 'series.lines';\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\n LinesSeriesModel.defaultOption = {\n coordinateSystem: 'geo',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Cartesian coordinate system\n xAxisIndex: 0,\n yAxisIndex: 0,\n symbol: ['none', 'none'],\n symbolSize: [10, 10],\n // Geo coordinate system\n geoIndex: 0,\n effect: {\n show: false,\n period: 4,\n constantSpeed: 0,\n symbol: 'circle',\n symbolSize: 3,\n loop: true,\n trailLength: 0.2\n },\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n polyline: false,\n clip: true,\n label: {\n show: false,\n position: 'end' // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n lineStyle: {\n opacity: 0.5\n }\n };\n return LinesSeriesModel;\n}(SeriesModel);\n\nexport default LinesSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nvar linesVisual = {\n seriesType: 'lines',\n reset: function (seriesModel) {\n var symbolType = normalize(seriesModel.get('symbol'));\n var symbolSize = normalize(seriesModel.get('symbolSize'));\n var data = seriesModel.getData();\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\n data.setVisual('toSymbol', symbolType && symbolType[1]);\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport default linesVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LinesView from './LinesView.js';\nimport LinesSeriesModel from './LinesSeries.js';\nimport linesLayout from './linesLayout.js';\nimport linesVisual from './linesVisual.js';\nexport function install(registers) {\n registers.registerChartView(LinesView);\n registers.registerSeriesModel(LinesSeriesModel);\n registers.registerLayout(linesLayout);\n registers.registerVisual(linesVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Uint8ClampedArray */\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar GRADIENT_LEVELS = 256;\n\nvar HeatmapLayer =\n/** @class */\nfunction () {\n function HeatmapLayer() {\n this.blurSize = 30;\n this.pointSize = 20;\n this.maxOpacity = 1;\n this.minOpacity = 0;\n this._gradientPixels = {\n inRange: null,\n outOfRange: null\n };\n var canvas = platformApi.createCanvas();\n this.canvas = canvas;\n }\n /**\r\n * Renders Heatmap and returns the rendered canvas\r\n * @param data array of data, each has x, y, value\r\n * @param width canvas width\r\n * @param height canvas height\r\n */\n\n\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\n var brush = this._getBrush();\n\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\n\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\n\n var r = this.pointSize + this.blurSize;\n var canvas = this.canvas;\n var ctx = canvas.getContext('2d');\n var len = data.length;\n canvas.width = width;\n canvas.height = height;\n\n for (var i = 0; i < len; ++i) {\n var p = data[i];\n var x = p[0];\n var y = p[1];\n var value = p[2]; // calculate alpha using value\n\n var alpha = normalize(value); // draw with the circle brush with alpha\n\n ctx.globalAlpha = alpha;\n ctx.drawImage(brush, x - r, y - r);\n }\n\n if (!canvas.width || !canvas.height) {\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n // 'CanvasRenderingContext2D': The source height is 0.\"\n return canvas;\n } // colorize the canvas using alpha value and set with gradient\n\n\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imageData.data;\n var offset = 0;\n var pixelLen = pixels.length;\n var minOpacity = this.minOpacity;\n var maxOpacity = this.maxOpacity;\n var diffOpacity = maxOpacity - minOpacity;\n\n while (offset < pixelLen) {\n var alpha = pixels[offset + 3] / 256;\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data\n\n if (alpha > 0) {\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n pixels[offset++] = gradient[gradientOffset];\n pixels[offset++] = gradient[gradientOffset + 1];\n pixels[offset++] = gradient[gradientOffset + 2];\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n } else {\n offset += 4;\n }\n }\n\n ctx.putImageData(imageData, 0, 0);\n return canvas;\n };\n /**\r\n * get canvas of a black circle brush used for canvas to draw later\r\n */\n\n\n HeatmapLayer.prototype._getBrush = function () {\n var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); // set brush size\n\n var r = this.pointSize + this.blurSize;\n var d = r * 2;\n brushCanvas.width = d;\n brushCanvas.height = d;\n var ctx = brushCanvas.getContext('2d');\n ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle,\n // draw the distinct circle in an invisible place,\n // and use shadowOffset to draw shadow in the center of the canvas\n\n ctx.shadowOffsetX = d;\n ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate\n // color in color map\n\n ctx.shadowColor = '#000'; // draw circle in the left to the canvas\n\n ctx.beginPath();\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n return brushCanvas;\n };\n /**\r\n * get gradient color map\r\n * @private\r\n */\n\n\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\n var gradientPixels = this._gradientPixels;\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n var color = [0, 0, 0, 0];\n var off = 0;\n\n for (var i = 0; i < 256; i++) {\n colorFunc[state](i / 255, true, color);\n pixelsSingleState[off++] = color[0];\n pixelsSingleState[off++] = color[1];\n pixelsSingleState[off++] = color[2];\n pixelsSingleState[off++] = color[3];\n }\n\n return pixelsSingleState;\n };\n\n return HeatmapLayer;\n}();\n\nexport default HeatmapLayer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport HeatmapLayer from './HeatmapLayer.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\n\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n var i; // Try to find in the location of the last found\n\n for (i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}\n\nfunction getIsInContinuousRange(dataExtent, range) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n return function (val) {\n return val >= range[0] && val <= range[1];\n };\n}\n\nfunction isGeoCoordSys(coordSys) {\n var dimensions = coordSys.dimensions; // Not use coordSys.type === 'geo' because coordSys maybe extended\n\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\n\nvar HeatmapView =\n/** @class */\nfunction (_super) {\n __extends(HeatmapView, _super);\n\n function HeatmapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapView.type;\n return _this;\n }\n\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\n var visualMapOfThisSeries;\n ecModel.eachComponent('visualMap', function (visualMap) {\n visualMap.eachTargetSeries(function (targetSeries) {\n if (targetSeries === seriesModel) {\n visualMapOfThisSeries = visualMap;\n }\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n if (!visualMapOfThisSeries) {\n throw new Error('Heatmap must use with visualMap');\n }\n } // Clear previously rendered progressive elements.\n\n\n this._progressiveEls = null;\n this.group.removeAll();\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\n } else if (isGeoCoordSys(coordSys)) {\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n }\n };\n\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n };\n\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n // geo does not support incremental rendering?\n if (isGeoCoordSys(coordSys)) {\n this.render(seriesModel, ecModel, api);\n } else {\n this._progressiveEls = [];\n\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\n }\n }\n };\n\n HeatmapView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\n var coordSys = seriesModel.coordinateSystem;\n var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d');\n var width;\n var height;\n var xAxisExtent;\n var yAxisExtent;\n\n if (isCartesian2d) {\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\n throw new Error('Heatmap on cartesian must have two category axes');\n }\n\n if (!(xAxis.onBand && yAxis.onBand)) {\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\n }\n } // add 0.5px to avoid the gaps\n\n\n width = xAxis.getBandWidth() + .5;\n height = yAxis.getBandWidth() + .5;\n xAxisExtent = xAxis.scale.getExtent();\n yAxisExtent = yAxis.scale.getExtent();\n }\n\n var group = this.group;\n var data = seriesModel.getData();\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\n var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']);\n var labelStatesModels = getLabelStatesModels(seriesModel);\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n\n for (var idx = start; idx < end; idx++) {\n var rect = void 0;\n var style = data.getItemVisual(idx, 'style');\n\n if (isCartesian2d) {\n var dataDimX = data.get(dataDims[0], idx);\n var dataDimY = data.get(dataDims[1], idx); // Ignore empty data and out of extent data\n\n if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {\n continue;\n }\n\n var point = coordSys.dataToPoint([dataDimX, dataDimY]);\n rect = new graphic.Rect({\n shape: {\n x: point[0] - width / 2,\n y: point[1] - height / 2,\n width: width,\n height: height\n },\n style: style\n });\n } else {\n // Ignore empty data\n if (isNaN(data.get(dataDims[1], idx))) {\n continue;\n }\n\n rect = new graphic.Rect({\n z2: 1,\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\n style: style\n });\n } // Optimization for large dataset\n\n\n if (data.hasItemOption) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel_1 = itemModel.getModel('emphasis');\n emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle();\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); // Each item value struct in the data would be firstly\n // {\n // itemStyle: { borderRadius: [30, 30] },\n // value: [2022, 02, 22]\n // }\n\n borderRadius = itemModel.get(['itemStyle', 'borderRadius']);\n focus = emphasisModel_1.get('focus');\n blurScope = emphasisModel_1.get('blurScope');\n emphasisDisabled = emphasisModel_1.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n rect.shape.r = borderRadius;\n var rawValue = seriesModel.getRawValue(idx);\n var defaultText = '-';\n\n if (rawValue && rawValue[2] != null) {\n defaultText = rawValue[2] + '';\n }\n\n setLabelStyle(rect, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: defaultText\n });\n rect.ensureState('emphasis').style = emphasisStyle;\n rect.ensureState('blur').style = blurStyle;\n rect.ensureState('select').style = selectStyle;\n toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);\n rect.incremental = incremental; // PENDING\n\n if (incremental) {\n // Rect must use hover layer if it's incremental.\n rect.states.emphasis.hoverLayer = true;\n }\n\n group.add(rect);\n data.setItemGraphicEl(idx, rect);\n\n if (this._progressiveEls) {\n this._progressiveEls.push(rect);\n }\n }\n };\n\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) {\n // throw new Error('Data range must have color visuals');\n // }\n\n var data = seriesModel.getData();\n var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n hmLayer.blurSize = seriesModel.get('blurSize');\n hmLayer.pointSize = seriesModel.get('pointSize');\n hmLayer.minOpacity = seriesModel.get('minOpacity');\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n var rect = geo.getViewRect().clone();\n var roamTransform = geo.getRoamTransform();\n rect.applyTransform(roamTransform); // Clamp on viewport\n\n var x = Math.max(rect.x, 0);\n var y = Math.max(rect.y, 0);\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\n var width = x2 - x;\n var height = y2 - y;\n var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n var points = data.mapArray(dims, function (lng, lat, value) {\n var pt = geo.dataToPoint([lng, lat]);\n pt[0] -= x;\n pt[1] -= y;\n pt.push(value);\n return pt;\n });\n var dataExtent = visualMapModel.getExtent();\n var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n inRange: inRangeVisuals.color.getColorMapper(),\n outOfRange: outOfRangeVisuals.color.getColorMapper()\n }, isInRange);\n var img = new graphic.Image({\n style: {\n width: width,\n height: height,\n x: x,\n y: y,\n image: hmLayer.canvas\n },\n silent: true\n });\n this.group.add(img);\n };\n\n HeatmapView.type = 'heatmap';\n return HeatmapView;\n}(ChartView);\n\nexport default HeatmapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\n\nvar HeatmapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(HeatmapSeriesModel, _super);\n\n function HeatmapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapSeriesModel.type;\n return _this;\n }\n\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n generateCoord: 'value'\n });\n };\n\n HeatmapSeriesModel.prototype.preventIncremental = function () {\n var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n\n if (coordSysCreator && coordSysCreator.dimensions) {\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n }\n };\n\n HeatmapSeriesModel.type = 'series.heatmap';\n HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar'];\n HeatmapSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Geo coordinate system\n geoIndex: 0,\n blurSize: 30,\n pointSize: 20,\n maxOpacity: 1,\n minOpacity: 0,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return HeatmapSeriesModel;\n}(SeriesModel);\n\nexport default HeatmapSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport HeatmapView from './HeatmapView.js';\nimport HeatmapSeriesModel from './HeatmapSeries.js';\nexport function install(registers) {\n registers.registerChartView(HeatmapView);\n registers.registerSeriesModel(HeatmapSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport { parsePercent, isNumeric } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth']; // index: +isHorizontal\n\nvar LAYOUT_ATTRS = [{\n xy: 'x',\n wh: 'width',\n index: 0,\n posDesc: ['left', 'right']\n}, {\n xy: 'y',\n wh: 'height',\n index: 1,\n posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\n\nvar PictorialBarView =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarView, _super);\n\n function PictorialBarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarView.type;\n return _this;\n }\n\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var coordSysRect = cartesian.master.getRect();\n var opt = {\n ecSize: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n seriesModel: seriesModel,\n coordSys: cartesian,\n coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n isHorizontal: isHorizontal,\n valueDim: LAYOUT_ATTRS[+isHorizontal],\n categoryDim: LAYOUT_ATTRS[1 - +isHorizontal]\n };\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var itemModel = getItemModel(data, dataIndex);\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n var bar = createBar(data, opt, symbolMeta);\n data.setItemGraphicEl(dataIndex, bar);\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).update(function (newIndex, oldIndex) {\n var bar = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(bar);\n return;\n }\n\n var itemModel = getItemModel(data, newIndex);\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\n\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n group.remove(bar);\n data.setItemGraphicEl(newIndex, null);\n bar = null;\n }\n\n if (bar) {\n updateBar(bar, opt, symbolMeta);\n } else {\n bar = createBar(data, opt, symbolMeta, true);\n }\n\n data.setItemGraphicEl(newIndex, bar);\n bar.__pictorialSymbolMeta = symbolMeta; // Add back\n\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).remove(function (dataIndex) {\n var bar = oldData.getItemGraphicEl(dataIndex);\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n }).execute();\n this._data = data;\n return this.group;\n };\n\n PictorialBarView.prototype.remove = function (ecModel, api) {\n var group = this.group;\n var data = this._data;\n\n if (ecModel.get('animation')) {\n if (data) {\n data.eachItemGraphicEl(function (bar) {\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\n });\n }\n } else {\n group.removeAll();\n }\n };\n\n PictorialBarView.type = 'pictorialBar';\n return PictorialBarView;\n}(ChartView); // Set or calculate default value about symbol, and calculate layout info.\n\n\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n style: data.getItemVisual(dataIndex, 'style'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.\n\n\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n boundingLength = symbolBoundingExtent[pxSignIdx];\n } else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n } else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n } else {\n boundingLength = layout[valueDim.wh];\n }\n\n outputSymbolMeta.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\n } // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero\n // and when borderWidth be settled, the actual linewidth will be NaN\n\n\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1;\n}\n\nfunction convertToCoordOnAxis(axis, value) {\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n} // Support ['100%', '100%']\n\n\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var categoryDim = opt.categoryDim;\n var categorySize = Math.abs(layout[categoryDim.wh]);\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n var parsedSymbolSize;\n\n if (zrUtil.isArray(symbolSize)) {\n parsedSymbolSize = symbolSize.slice();\n } else {\n if (symbolSize == null) {\n // will parse to number below\n parsedSymbolSize = ['100%', '100%'];\n } else {\n parsedSymbolSize = [symbolSize, symbolSize];\n }\n } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n // to complicated to calculate real percent value if considering scaled lineWidth.\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n // which can be tolerated in pictorial chart.\n\n\n parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);\n parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n outputSymbolMeta.symbolSize = parsedSymbolSize; // If x or y is less than zero, show reversed shape.\n\n var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale.\n\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\n\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\n // In symbols are drawn with scale, so do not need to care about the case that width\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n // be calculated.\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n\n if (valueLineWidth) {\n pathForLineWidth.attr({\n scaleX: symbolScale[0],\n scaleY: symbolScale[1],\n rotation: rotation\n });\n pathForLineWidth.updateTransform();\n valueLineWidth /= pathForLineWidth.getLineScale();\n valueLineWidth *= symbolScale[opt.valueDim.index];\n }\n\n outputSymbolMeta.valueLineWidth = valueLineWidth || 0;\n}\n\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\n var categoryDim = opt.categoryDim;\n var valueDim = opt.valueDim;\n var pxSign = outputSymbolMeta.pxSign;\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may\n // want symbols to rotate on its center, which should not be translated\n // when rotating.\n\n if (symbolRepeat) {\n var absBoundingLength = Math.abs(boundingLength);\n var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n var hasEndGap = false;\n\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n hasEndGap = true;\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n }\n\n var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted\n // to ensure that all of the symbols will not be overflow the given area.\n\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Both final repeatTimes and final symbolMarginNumeric area calculated based on\n // boundingLength.\n\n var repeatSpecified = isNumeric(symbolRepeat);\n var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed\n // entirely in the given layout area.\n\n var mDiff = absBoundingLength - repeatTimes * unitLength;\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Update repeatTimes when not all symbol will be shown.\n\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\n repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n }\n\n pathLen = repeatTimes * uLenWithMargin - endFix;\n outputSymbolMeta.repeatTimes = repeatTimes;\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\n }\n\n var sizeFix = pxSign * (pathLen / 2);\n var pathPosition = outputSymbolMeta.pathPosition = [];\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n\n if (symbolOffset) {\n pathPosition[0] += symbolOffset[0];\n pathPosition[1] += symbolOffset[1];\n }\n\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n bundlePosition[valueDim.index] = layout[valueDim.xy];\n var barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n var clipShape = outputSymbolMeta.clipShape = {}; // Consider that symbol may be overflow layout rect.\n\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n clipShape[valueDim.xy] = 0;\n clipShape[valueDim.wh] = layout[valueDim.wh];\n}\n\nfunction createPath(symbolMeta) {\n var symbolPatternSize = symbolMeta.symbolPatternSize;\n var path = createSymbol( // Consider texture img, make a big size.\n symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\n path.attr({\n culling: true\n });\n path.type !== 'image' && path.setStyle({\n strokeNoScale: true\n });\n return path;\n}\n\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var symbolSize = symbolMeta.symbolSize;\n var valueLineWidth = symbolMeta.valueLineWidth;\n var pathPosition = symbolMeta.pathPosition;\n var valueDim = opt.valueDim;\n var repeatTimes = symbolMeta.repeatTimes || 0;\n var index = 0;\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n eachPath(bar, function (path) {\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n\n if (index < repeatTimes) {\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n } else {\n updateAttr(path, null, {\n scaleX: 0,\n scaleY: 0\n }, symbolMeta, isUpdate, function () {\n bundle.remove(path);\n });\n } // updateHoverAnimation(path, symbolMeta);\n\n\n index++;\n });\n\n for (; index < repeatTimes; index++) {\n var path = createPath(symbolMeta);\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n bundle.add(path);\n var target = makeTarget(index);\n updateAttr(path, {\n x: target.x,\n y: target.y,\n scaleX: 0,\n scaleY: 0\n }, {\n scaleX: target.scaleX,\n scaleY: target.scaleY,\n rotation: target.rotation\n }, symbolMeta, isUpdate);\n }\n\n function makeTarget(index) {\n var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n // Otherwise: i = index;\n\n var pxSign = symbolMeta.pxSign;\n var i = index;\n\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n i = repeatTimes - 1 - index;\n }\n\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n return {\n x: position[0],\n y: position[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n };\n }\n}\n\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var mainPath = bar.__pictorialMainPath;\n\n if (!mainPath) {\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n bundle.add(mainPath);\n updateAttr(mainPath, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: 0,\n scaleY: 0,\n rotation: symbolMeta.rotation\n }, {\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1]\n }, symbolMeta, isUpdate);\n } else {\n updateAttr(mainPath, null, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n }, symbolMeta, isUpdate);\n }\n} // bar rect is used for label.\n\n\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n var barRect = bar.__pictorialBarRect;\n\n if (!barRect) {\n barRect = bar.__pictorialBarRect = new graphic.Rect({\n z2: 2,\n shape: rectShape,\n silent: true,\n style: {\n stroke: 'transparent',\n fill: 'transparent',\n lineWidth: 0\n }\n });\n barRect.disableMorphing = true;\n bar.add(barRect);\n } else {\n updateAttr(barRect, null, {\n shape: rectShape\n }, symbolMeta, isUpdate);\n }\n}\n\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n // If not clip, symbol will be remove and rebuilt.\n if (symbolMeta.symbolClip) {\n var clipPath = bar.__pictorialClipPath;\n var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n var valueDim = opt.valueDim;\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n\n if (clipPath) {\n graphic.updateProps(clipPath, {\n shape: clipShape\n }, animationModel, dataIndex);\n } else {\n clipShape[valueDim.wh] = 0;\n clipPath = new graphic.Rect({\n shape: clipShape\n });\n\n bar.__pictorialBundle.setClipPath(clipPath);\n\n bar.__pictorialClipPath = clipPath;\n var target = {};\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n shape: target\n }, animationModel, dataIndex);\n }\n }\n}\n\nfunction getItemModel(data, dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\n itemModel.isAnimationEnabled = isAnimationEnabled;\n return itemModel;\n}\n\nfunction getAnimationDelayParams(path) {\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\n return {\n index: path.__pictorialAnimationIndex,\n count: path.__pictorialRepeatTimes\n };\n}\n\nfunction isAnimationEnabled() {\n // `animation` prop can be set on itemModel in pictorial bar chart.\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\n\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n // bar is the main element for each data.\n var bar = new graphic.Group(); // bundle is used for location and clip.\n\n var bundle = new graphic.Group();\n bar.add(bundle);\n bar.__pictorialBundle = bundle;\n bundle.x = symbolMeta.bundlePosition[0];\n bundle.y = symbolMeta.bundlePosition[1];\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n bar.__pictorialSymbolMeta = symbolMeta;\n return bar;\n}\n\nfunction updateBar(bar, opt, symbolMeta) {\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n var bundle = bar.__pictorialBundle;\n graphic.updateProps(bundle, {\n x: symbolMeta.bundlePosition[0],\n y: symbolMeta.bundlePosition[1]\n }, animationModel, dataIndex);\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, true);\n createOrUpdateClip(bar, opt, symbolMeta, true);\n}\n\nfunction removeBar(data, dataIndex, animationModel, bar) {\n // Not show text when animating\n var labelRect = bar.__pictorialBarRect;\n labelRect && labelRect.removeTextContent();\n var paths = [];\n eachPath(bar, function (path) {\n paths.push(path);\n });\n bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet.\n\n bar.__pictorialClipPath && (animationModel = null);\n zrUtil.each(paths, function (path) {\n graphic.removeElement(path, {\n scaleX: 0,\n scaleY: 0\n }, animationModel, dataIndex, function () {\n bar.parent && bar.parent.remove(bar);\n });\n });\n data.setItemGraphicEl(dataIndex, null);\n}\n\nfunction getShapeStr(data, symbolMeta) {\n return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\n\nfunction eachPath(bar, cb, context) {\n // Do not use Group#eachChild, because it do not support remove.\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n el !== bar.__pictorialBarRect && cb.call(context, el);\n });\n}\n\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n\n if (symbolMeta.symbolClip && !isUpdate) {\n animationAttrs && el.attr(animationAttrs);\n } else {\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n }\n}\n\nfunction updateCommon(bar, opt, symbolMeta) {\n var dataIndex = symbolMeta.dataIndex;\n var itemModel = symbolMeta.itemModel; // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var emphasisModel = itemModel.getModel('emphasis');\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var hoverScale = emphasisModel.get('scale');\n eachPath(bar, function (path) {\n if (path instanceof ZRImage) {\n var pathStyle = path.style;\n path.useStyle(zrUtil.extend({\n // TODO other properties like dx, dy ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolMeta.style));\n } else {\n path.useStyle(symbolMeta.style);\n }\n\n var emphasisState = path.ensureState('emphasis');\n emphasisState.style = emphasisStyle;\n\n if (hoverScale) {\n // NOTE: Must after scale is set after updateAttr\n emphasisState.scaleX = path.scaleX * 1.1;\n emphasisState.scaleY = path.scaleY * 1.1;\n }\n\n path.ensureState('blur').style = blurStyle;\n path.ensureState('select').style = selectStyle;\n cursorStyle && (path.cursor = cursorStyle);\n path.z2 = symbolMeta.z2;\n });\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n var barRect = bar.__pictorialBarRect;\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\n labelFetcher: opt.seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\n inheritColor: symbolMeta.style.fill,\n defaultOpacity: symbolMeta.style.opacity,\n defaultOutsidePosition: barPositionOutside\n });\n toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled'));\n}\n\nfunction toIntTimes(times) {\n var roundedTimes = Math.round(times); // Escapse accurate error\n\n return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\n\nexport default PictorialBarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar PictorialBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarSeriesModel, _super);\n\n function PictorialBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarSeriesModel.type;\n _this.hasSymbolVisual = true;\n _this.defaultSymbol = 'roundRect';\n return _this;\n }\n\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\n // Disable stack.\n option.stack = null;\n return _super.prototype.getInitialData.apply(this, arguments);\n };\n\n PictorialBarSeriesModel.type = 'series.pictorialBar';\n PictorialBarSeriesModel.dependencies = ['grid'];\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n symbol: 'circle',\n symbolSize: null,\n symbolRotate: null,\n symbolPosition: null,\n symbolOffset: null,\n symbolMargin: null,\n symbolRepeat: false,\n symbolRepeatDirection: 'end',\n symbolClip: false,\n symbolBoundingData: null,\n symbolPatternSize: 400,\n barGap: '-100%',\n // z can be set in data item, which is z2 actually.\n // Disable progressive\n progressive: 0,\n emphasis: {\n // By default pictorialBar do not hover scale. Hover scale is not suitable\n // for the case that both has foreground and background.\n scale: false\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n });\n return PictorialBarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default PictorialBarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport PictorialBarView from './PictorialBarView.js';\nimport PictorialBarSeriesModel from './PictorialBarSeries.js';\nimport { createProgressiveLayout, layout } from '../../layout/barGrid.js';\nimport { curry } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerChartView(PictorialBarView);\n registers.registerSeriesModel(PictorialBarSeriesModel);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar')); // Do layout after other overall layout, which can prepare some information.\n\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { ECPolygon } from '../line/poly.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { bind } from 'zrender/lib/core/util.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar ThemeRiverView =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverView, _super);\n\n function ThemeRiverView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverView.type;\n _this._layers = [];\n return _this;\n }\n\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var self = this;\n var group = this.group;\n var layersSeries = seriesModel.getLayerSeries();\n var layoutInfo = data.getLayout('layoutInfo');\n var rect = layoutInfo.rect;\n var boundaryGap = layoutInfo.boundaryGap;\n group.x = 0;\n group.y = rect.y + boundaryGap[0];\n\n function keyGetter(item) {\n return item.name;\n }\n\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\n var newLayersGroups = [];\n dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n\n function process(status, idx, oldIdx) {\n var oldLayersGroups = self._layers;\n\n if (status === 'remove') {\n group.remove(oldLayersGroups[idx]);\n return;\n }\n\n var points0 = [];\n var points1 = [];\n var style;\n var indices = layersSeries[idx].indices;\n var j = 0;\n\n for (; j < indices.length; j++) {\n var layout = data.getItemLayout(indices[j]);\n var x = layout.x;\n var y0 = layout.y0;\n var y = layout.y;\n points0.push(x, y0);\n points1.push(x, y0 + y);\n style = data.getItemVisual(indices[j], 'style');\n }\n\n var polygon;\n var textLayout = data.getItemLayout(indices[0]);\n var labelModel = seriesModel.getModel('label');\n var margin = labelModel.get('margin');\n var emphasisModel = seriesModel.getModel('emphasis');\n\n if (status === 'add') {\n var layerGroup = newLayersGroups[idx] = new graphic.Group();\n polygon = new ECPolygon({\n shape: {\n points: points0,\n stackedOnPoints: points1,\n smooth: 0.4,\n stackedOnSmooth: 0.4,\n smoothConstraint: false\n },\n z2: 0\n });\n layerGroup.add(polygon);\n group.add(layerGroup);\n\n if (seriesModel.isAnimationEnabled()) {\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n polygon.removeClipPath();\n }));\n }\n } else {\n var layerGroup = oldLayersGroups[oldIdx];\n polygon = layerGroup.childAt(0);\n group.add(layerGroup);\n newLayersGroups[idx] = layerGroup;\n graphic.updateProps(polygon, {\n shape: {\n points: points0,\n stackedOnPoints: points1\n }\n }, seriesModel);\n saveOldStyle(polygon);\n }\n\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\n labelDataIndex: indices[j - 1],\n defaultText: data.getName(indices[j - 1]),\n inheritColor: style.fill\n }, {\n normal: {\n verticalAlign: 'middle' // align: 'right'\n\n }\n });\n polygon.setTextConfig({\n position: null,\n local: true\n });\n var labelEl = polygon.getTextContent(); // TODO More label position options.\n\n if (labelEl) {\n labelEl.x = textLayout.x - margin;\n labelEl.y = textLayout.y0 + textLayout.y / 2;\n }\n\n polygon.useStyle(style);\n data.setItemGraphicEl(idx, polygon);\n setStatesStylesFromModel(polygon, seriesModel);\n toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n }\n\n this._layersSeries = layersSeries;\n this._layers = newLayersGroups;\n };\n\n ThemeRiverView.type = 'themeRiver';\n return ThemeRiverView;\n}(ChartView);\n\n; // add animation to the view\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n x: rect.x - 50,\n width: rect.width + 100,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default ThemeRiverView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData, SINGLE_REFERRING } from '../../util/model.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar DATA_NAME_INDEX = 2;\n\nvar ThemeRiverSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverSeriesModel, _super);\n\n function ThemeRiverSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverSeriesModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n ThemeRiverSeriesModel.prototype.init = function (option) {\n // eslint-disable-next-line\n _super.prototype.init.apply(this, arguments); // Put this function here is for the sake of consistency of code style.\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n /**\r\n * If there is no value of a certain point in the time for some event,set it value to 0.\r\n *\r\n * @param {Array} data initial data in the option\r\n * @return {Array}\r\n */\n\n\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\n var rawDataLength = data.length;\n /**\r\n * Make sure every layer data get the same keys.\r\n * The value index tells which layer has visited.\r\n * {\r\n * 2014/01/01: -1\r\n * }\r\n */\n\n var timeValueKeys = {}; // grouped data by name\n\n var groupResult = groupData(data, function (item) {\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\n timeValueKeys[item[0] + ''] = -1;\n }\n\n return item[2];\n });\n var layerData = [];\n groupResult.buckets.each(function (items, key) {\n layerData.push({\n name: key,\n dataList: items\n });\n });\n var layerNum = layerData.length;\n\n for (var k = 0; k < layerNum; ++k) {\n var name_1 = layerData[k].name;\n\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\n var timeValue = layerData[k].dataList[j][0] + '';\n timeValueKeys[timeValue] = k;\n }\n\n for (var timeValue in timeValueKeys) {\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\n timeValueKeys[timeValue] = k;\n data[rawDataLength] = [timeValue, 0, name_1];\n rawDataLength++;\n }\n }\n }\n\n return data;\n };\n /**\r\n * @override\r\n * @param option the initial option that user gave\r\n * @param ecModel the model object for themeRiver option\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined\n\n var filterData = zrUtil.filter(option.data, function (dataItem) {\n return dataItem[2] !== undefined;\n }); // ??? TODO design a stage to transfer data for themeRiver and lines?\n\n var data = this.fixData(filterData || []);\n var nameList = [];\n var nameMap = this.nameMap = zrUtil.createHashMap();\n var count = 0;\n\n for (var i = 0; i < data.length; ++i) {\n nameList.push(data[i][DATA_NAME_INDEX]);\n\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n nameMap.set(data[i][DATA_NAME_INDEX], count);\n count++;\n }\n }\n\n var dimensions = prepareSeriesDataSchema(data, {\n coordDimensions: ['single'],\n dimensionsDefine: [{\n name: 'time',\n type: getDimensionTypeByAxis(axisType)\n }, {\n name: 'value',\n type: 'float'\n }, {\n name: 'name',\n type: 'ordinal'\n }],\n encodeDefine: {\n single: 0,\n value: 1,\n itemName: 2\n }\n }).dimensions;\n var list = new SeriesData(dimensions, this);\n list.initData(data);\n return list;\n };\n /**\r\n * The raw data is divided into multiple layers and each layer\r\n * has same name.\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\n var data = this.getData();\n var lenCount = data.count();\n var indexArr = [];\n\n for (var i = 0; i < lenCount; ++i) {\n indexArr[i] = i;\n }\n\n var timeDim = data.mapDimension('single'); // data group by name\n\n var groupResult = groupData(indexArr, function (index) {\n return data.get('name', index);\n });\n var layerSeries = [];\n groupResult.buckets.each(function (items, key) {\n items.sort(function (index1, index2) {\n return data.get(timeDim, index1) - data.get(timeDim, index2);\n });\n layerSeries.push({\n name: key,\n indices: items\n });\n });\n return layerSeries;\n };\n /**\r\n * Get data indices for show tooltip content\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\n if (!zrUtil.isArray(dim)) {\n dim = dim ? [dim] : [];\n }\n\n var data = this.getData();\n var layerSeries = this.getLayerSeries();\n var indices = [];\n var layerNum = layerSeries.length;\n var nestestValue;\n\n for (var i = 0; i < layerNum; ++i) {\n var minDist = Number.MAX_VALUE;\n var nearestIdx = -1;\n var pointNum = layerSeries[i].indices.length;\n\n for (var j = 0; j < pointNum; ++j) {\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n var dist = Math.abs(theValue - value);\n\n if (dist <= minDist) {\n nestestValue = theValue;\n minDist = dist;\n nearestIdx = layerSeries[i].indices[j];\n }\n }\n\n indices.push(nearestIdx);\n }\n\n return {\n dataIndices: indices,\n nestestValue: nestestValue\n };\n };\n\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var name = data.getName(dataIndex);\n var value = data.get(data.mapDimension('value'), dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n\n ThemeRiverSeriesModel.type = 'series.themeRiver';\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\n ThemeRiverSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'singleAxis',\n // gap in axis's orthogonal orientation\n boundaryGap: ['10%', '10%'],\n // legendHoverLink: true,\n singleAxisIndex: 0,\n animationEasing: 'linear',\n label: {\n margin: 4,\n show: true,\n position: 'left',\n fontSize: 11\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return ThemeRiverSeriesModel;\n}(SeriesModel);\n\nexport default ThemeRiverSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nexport default function themeRiverLayout(ecModel, api) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var single = seriesModel.coordinateSystem;\n var layoutInfo = {}; // use the axis boundingRect for view\n\n var rect = single.getRect();\n layoutInfo.rect = rect;\n var boundaryGap = seriesModel.get('boundaryGap');\n var axis = single.getAxis();\n layoutInfo.boundaryGap = boundaryGap;\n\n if (axis.orient === 'horizontal') {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, height);\n } else {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, width);\n }\n\n data.setLayout('layoutInfo', layoutInfo);\n });\n}\n/**\r\n * The layout information about themeriver\r\n *\r\n * @param data data in the series\r\n * @param seriesModel the model object of themeRiver series\r\n * @param height value used to compute every series height\r\n */\n\nfunction doThemeRiverLayout(data, seriesModel, height) {\n if (!data.count()) {\n return;\n }\n\n var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series.\n\n var layerSeries = seriesModel.getLayerSeries(); // the points in each layer.\n\n var timeDim = data.mapDimension('single');\n var valueDim = data.mapDimension('value');\n var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n return zrUtil.map(singleLayer.indices, function (idx) {\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n pt[1] = data.get(valueDim, idx);\n return pt;\n });\n });\n var base = computeBaseline(layerPoints);\n var baseLine = base.y0;\n var ky = height / base.max; // set layout information for each item.\n\n var n = layerSeries.length;\n var m = layerSeries[0].indices.length;\n var baseY0;\n\n for (var j = 0; j < m; ++j) {\n baseY0 = baseLine[j] * ky;\n data.setItemLayout(layerSeries[0].indices[j], {\n layerIndex: 0,\n x: layerPoints[0][j][0],\n y0: baseY0,\n y: layerPoints[0][j][1] * ky\n });\n\n for (var i = 1; i < n; ++i) {\n baseY0 += layerPoints[i - 1][j][1] * ky;\n data.setItemLayout(layerSeries[i].indices[j], {\n layerIndex: i,\n x: layerPoints[i][j][0],\n y0: baseY0,\n y: layerPoints[i][j][1] * ky\n });\n }\n }\n}\n/**\r\n * Compute the baseLine of the rawdata\r\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\r\n *\r\n * @param data the points in each layer\r\n */\n\n\nfunction computeBaseline(data) {\n var layerNum = data.length;\n var pointNum = data[0].length;\n var sums = [];\n var y0 = [];\n var max = 0;\n\n for (var i = 0; i < pointNum; ++i) {\n var temp = 0;\n\n for (var j = 0; j < layerNum; ++j) {\n temp += data[j][i][1];\n }\n\n if (temp > max) {\n max = temp;\n }\n\n sums.push(temp);\n }\n\n for (var k = 0; k < pointNum; ++k) {\n y0[k] = (max - sums[k]) / 2;\n }\n\n max = 0;\n\n for (var l = 0; l < pointNum; ++l) {\n var sum = sums[l] + y0[l];\n\n if (sum > max) {\n max = sum;\n }\n }\n\n return {\n y0: y0,\n max: max\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport ThemeRiverView from './ThemeRiverView.js';\nimport ThemeRiverSeriesModel from './ThemeRiverSeries.js';\nimport themeRiverLayout from './themeRiverLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(ThemeRiverView);\n registers.registerSeriesModel(ThemeRiverSeriesModel);\n registers.registerLayout(themeRiverLayout);\n registers.registerProcessor(dataFilter('themeRiver'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\r\n * Sunburstce of Sunburst including Sector, Label, LabelLine\r\n */\n\nvar SunburstPiece =\n/** @class */\nfunction (_super) {\n __extends(SunburstPiece, _super);\n\n function SunburstPiece(node, seriesModel, ecModel, api) {\n var _this = _super.call(this) || this;\n\n _this.z2 = DEFAULT_SECTOR_Z;\n _this.textConfig = {\n inside: true\n };\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\n var text = new graphic.Text({\n z2: DEFAULT_TEXT_Z,\n silent: node.getModel().get(['label', 'silent'])\n });\n\n _this.setTextContent(text);\n\n _this.updateData(true, node, seriesModel, ecModel, api);\n\n return _this;\n }\n\n SunburstPiece.prototype.updateData = function (firstCreate, node, // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\n seriesModel, ecModel, api) {\n this.node = node;\n node.piece = this;\n seriesModel = seriesModel || this._seriesModel;\n ecModel = ecModel || this._ecModel;\n var sector = this;\n getECData(sector).dataIndex = node.dataIndex;\n var itemModel = node.getModel();\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = node.getLayout();\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n var normalStyle = node.getVisual('style');\n normalStyle.lineJoin = 'bevel';\n var decal = node.getVisual('decal');\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n zrUtil.extend(sectorShape, cornerRadius);\n zrUtil.each(SPECIAL_STATES, function (stateName) {\n var state = sector.ensureState(stateName);\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\n state.style = itemStyleModel.getItemStyle(); // border radius\n\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\n\n if (cornerRadius) {\n state.shape = cornerRadius;\n }\n });\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, node.dataIndex);\n } else {\n // Disable animation for gradient since no interpolation method\n // is supported for gradient\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel);\n saveOldStyle(sector);\n }\n\n sector.useStyle(normalStyle);\n\n this._updateLabel(seriesModel);\n\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n this._seriesModel = seriesModel || this._seriesModel;\n this._ecModel = ecModel || this._ecModel;\n var focus = emphasisModel.get('focus');\n var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus;\n toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\n var _this = this;\n\n var itemModel = this.node.getModel();\n var normalLabelModel = itemModel.getModel('label');\n var layout = this.node.getLayout();\n var angle = layout.endAngle - layout.startAngle;\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var sector = this;\n var label = sector.getTextContent();\n var dataIndex = this.node.dataIndex;\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\n var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\n label.ignore = !isNormalShown; // TODO use setLabelStyle\n\n zrUtil.each(DISPLAY_STATES, function (stateName) {\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']);\n var isNormal = stateName === 'normal';\n var state = isNormal ? label : label.ensureState(stateName);\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\n\n if (isNormal) {\n text = text || _this.node.name;\n }\n\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\n\n if (text) {\n state.style.text = text;\n } // Not displaying text when angle is too small\n\n\n var isShown = labelStateModel.get('show');\n\n if (isShown != null && !isNormal) {\n state.ignore = !isShown;\n }\n\n var labelPosition = getLabelAttr(labelStateModel, 'position');\n var sectorState = isNormal ? sector : sector.states[stateName];\n var labelColor = sectorState.style.fill;\n sectorState.textConfig = {\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\n inside: labelPosition !== 'outside'\n };\n var r;\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\n var textAlign = getLabelAttr(labelStateModel, 'align');\n\n if (labelPosition === 'outside') {\n r = layout.r + labelPadding;\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\n } else {\n if (!textAlign || textAlign === 'center') {\n // Put label in the center if it's a circle\n if (angle === 2 * Math.PI && layout.r0 === 0) {\n r = 0;\n } else {\n r = (layout.r + layout.r0) / 2;\n }\n\n textAlign = 'center';\n } else if (textAlign === 'left') {\n r = layout.r0 + labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'right';\n }\n } else if (textAlign === 'right') {\n r = layout.r - labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'left';\n }\n }\n }\n\n state.style.align = textAlign;\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\n state.x = r * dx + layout.cx;\n state.y = r * dy + layout.cy;\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = normalizeRadian(-midAngle);\n\n if (rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = Math.PI / 2 - midAngle;\n\n if (rotate > Math.PI / 2) {\n rotate -= Math.PI;\n } else if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (zrUtil.isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n\n state.rotation = normalizeRadian(rotate);\n });\n\n function getLabelAttr(model, name) {\n var stateAttr = model.get(name);\n\n if (stateAttr == null) {\n return normalLabelModel.get(name);\n }\n\n return stateAttr;\n }\n\n label.dirtyStyle();\n };\n\n return SunburstPiece;\n}(graphic.Sector);\n\nexport default SunburstPiece;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog } from '../../util/log.js';\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper.js';\nexport var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\nexport function installSunburstAction(registers) {\n registers.registerAction({\n type: ROOT_TO_NODE_ACTION,\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n registers.registerAction({\n type: HIGHLIGHT_ACTION,\n update: 'none'\n }, function (payload, ecModel, api) {\n // Clone\n payload = extend({}, payload);\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleHighlight);\n\n function handleHighlight(model) {\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n\n if (targetInfo) {\n payload.dataIndex = targetInfo.node.dataIndex;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstHighlight', 'highlight');\n } // Fast forward action\n\n\n api.dispatchAction(extend(payload, {\n type: 'highlight'\n }));\n });\n registers.registerAction({\n type: UNHIGHLIGHT_ACTION,\n update: 'updateView'\n }, function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstUnhighlight', 'downplay');\n }\n\n api.dispatchAction(extend(payload, {\n type: 'downplay'\n }));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport SunburstPiece from './SunburstPiece.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction.js';\nimport { windowOpen } from '../../util/format.js';\n\nvar SunburstView =\n/** @class */\nfunction (_super) {\n __extends(SunburstView, _super);\n\n function SunburstView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstView.type;\n return _this;\n }\n\n SunburstView.prototype.render = function (seriesModel, ecModel, api, // @ts-ignore\n payload) {\n var self = this;\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var data = seriesModel.getData();\n var virtualRoot = data.tree.root;\n var newRoot = seriesModel.getViewRoot();\n var group = this.group;\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n var newChildren = [];\n newRoot.eachNode(function (node) {\n newChildren.push(node);\n });\n var oldChildren = this._oldChildren || [];\n dualTravel(newChildren, oldChildren);\n renderRollUp(virtualRoot, newRoot);\n\n this._initEvents();\n\n this._oldChildren = newChildren;\n\n function dualTravel(newChildren, oldChildren) {\n if (newChildren.length === 0 && oldChildren.length === 0) {\n return;\n }\n\n new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n\n function getKey(node) {\n return node.getId();\n }\n\n function processNode(newIdx, oldIdx) {\n var newNode = newIdx == null ? null : newChildren[newIdx];\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\n doRenderNode(newNode, oldNode);\n }\n }\n\n function doRenderNode(newNode, oldNode) {\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n // Not render data with value 0\n newNode = null;\n }\n\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n if (oldNode && oldNode.piece) {\n if (newNode) {\n // Update\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n } else {\n // Remove\n removeNode(oldNode);\n }\n } else if (newNode) {\n // Add\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\n group.add(piece); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, piece);\n }\n }\n }\n\n function removeNode(node) {\n if (!node) {\n return;\n }\n\n if (node.piece) {\n group.remove(node.piece);\n node.piece = null;\n }\n }\n\n function renderRollUp(virtualRoot, viewRoot) {\n if (viewRoot.depth > 0) {\n // Render\n if (self.virtualPiece) {\n // Update\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\n } else {\n // Add\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\n group.add(self.virtualPiece);\n } // TODO event scope\n\n\n viewRoot.piece.off('click');\n self.virtualPiece.on('click', function (e) {\n self._rootToNode(viewRoot.parentNode);\n });\n } else if (self.virtualPiece) {\n // Remove\n group.remove(self.virtualPiece);\n self.virtualPiece = null;\n }\n }\n };\n /**\r\n * @private\r\n */\n\n\n SunburstView.prototype._initEvents = function () {\n var _this = this;\n\n this.group.off('click');\n this.group.on('click', function (e) {\n var targetFound = false;\n\n var viewRoot = _this.seriesModel.getViewRoot();\n\n viewRoot.eachNode(function (node) {\n if (!targetFound && node.piece && node.piece === e.target) {\n var nodeClick = node.getModel().get('nodeClick');\n\n if (nodeClick === 'rootToNode') {\n _this._rootToNode(node);\n } else if (nodeClick === 'link') {\n var itemModel = node.getModel();\n var link = itemModel.get('link');\n\n if (link) {\n var linkTarget = itemModel.get('target', true) || '_blank';\n windowOpen(link, linkTarget);\n }\n }\n\n targetFound = true;\n }\n });\n });\n };\n /**\r\n * @private\r\n */\n\n\n SunburstView.prototype._rootToNode = function (node) {\n if (node !== this.seriesModel.getViewRoot()) {\n this.api.dispatchAction({\n type: ROOT_TO_NODE_ACTION,\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: node\n });\n }\n };\n /**\r\n * @implement\r\n */\n\n\n SunburstView.prototype.containPoint = function (point, seriesModel) {\n var treeRoot = seriesModel.getData();\n var itemLayout = treeRoot.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n SunburstView.type = 'sunburst';\n return SunburstView;\n}(ChartView);\n\nexport default SunburstView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport Model from '../../model/Model.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\n\nvar SunburstSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SunburstSeriesModel, _super);\n\n function SunburstSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstSeriesModel.type;\n _this.ignoreStyleOnData = true;\n return _this;\n }\n\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levelModels = this._levelModels = zrUtil.map(option.levels || [], function (levelDefine) {\n return new Model(levelDefine, this, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = levelModels[node.depth];\n levelModel && (model.parentModel = levelModel);\n return model;\n });\n }\n\n return tree.data;\n };\n\n SunburstSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /*\r\n * @override\r\n */\n\n\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n };\n\n SunburstSeriesModel.prototype.getLevelModel = function (node) {\n return this._levelModels && this._levelModels[node.depth];\n };\n\n SunburstSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n SunburstSeriesModel.type = 'series.sunburst';\n SunburstSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // 'rootToNode', 'link', or false\n nodeClick: 'rootToNode',\n renderLabelForZeroData: false,\n label: {\n // could be: 'radial', 'tangential', or 'none'\n rotate: 'radial',\n show: true,\n opacity: 1,\n // 'left' is for inner side of inside, and 'right' is for outer\n // side for inside\n align: 'center',\n position: 'inside',\n distance: 5,\n silent: true\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: 'white',\n borderType: 'solid',\n shadowBlur: 0,\n shadowColor: 'rgba(0, 0, 0, 0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n emphasis: {\n focus: 'descendant'\n },\n blur: {\n itemStyle: {\n opacity: 0.2\n },\n label: {\n opacity: 0.1\n }\n },\n // Animation type can be expansion, scale.\n animationType: 'expansion',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n data: [],\n\n /**\r\n * Sort order.\r\n *\r\n * Valid values: 'desc', 'asc', null, or callback function.\r\n * 'desc' and 'asc' for descend and ascendant order;\r\n * null for not sorting;\r\n * example of callback function:\r\n * function(nodeA, nodeB) {\r\n * return nodeA.getValue() - nodeB.getValue();\r\n * }\r\n */\n sort: 'desc'\n };\n return SunburstSeriesModel;\n}(SeriesModel);\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value; // TODO First value of array must be a number\n\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n\nexport default SunburstSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parsePercent } from '../../util/number.js';\nimport * as zrUtil from 'zrender/lib/core/util.js'; // let PI2 = Math.PI * 2;\n\nvar RADIAN = Math.PI / 180;\nexport default function sunburstLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var virtualRoot = seriesModel.getData().tree.root;\n var treeRoot = seriesModel.getViewRoot();\n var rootDepth = treeRoot.depth;\n var sort = seriesModel.get('sort');\n\n if (sort != null) {\n initChildren(treeRoot, sort);\n }\n\n var validDataCount = 0;\n zrUtil.each(treeRoot.children, function (child) {\n !isNaN(child.getValue()) && validDataCount++;\n });\n var sum = treeRoot.getValue(); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var renderRollupNode = treeRoot.depth > 0;\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n var rPerLevel = (r - r0) / (levels || 1);\n var clockwise = seriesModel.get('clockwise');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle\n // let restAngle = PI2;\n // let valueSumLargerThanMinAngle = 0;\n\n var dir = clockwise ? 1 : -1;\n /**\r\n * Render a tree\r\n * @return increased angle\r\n */\n\n var renderNode = function (node, startAngle) {\n if (!node) {\n return;\n }\n\n var endAngle = startAngle; // Render self\n\n if (node !== virtualRoot) {\n // Tree node is virtual, so it doesn't need to be drawn\n var value = node.getValue();\n var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n\n if (angle < minAngle) {\n angle = minAngle; // restAngle -= minAngle;\n } // else {\n // valueSumLargerThanMinAngle += value;\n // }\n\n\n endAngle = startAngle + dir * angle;\n var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n var rStart = r0 + rPerLevel * depth;\n var rEnd = r0 + rPerLevel * (depth + 1);\n var levelModel = seriesModel.getLevelModel(node);\n\n if (levelModel) {\n var r0_1 = levelModel.get('r0', true);\n var r_1 = levelModel.get('r', true);\n var radius_1 = levelModel.get('radius', true);\n\n if (radius_1 != null) {\n r0_1 = radius_1[0];\n r_1 = radius_1[1];\n }\n\n r0_1 != null && (rStart = parsePercent(r0_1, size / 2));\n r_1 != null && (rEnd = parsePercent(r_1, size / 2));\n }\n\n node.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n } // Render children\n\n\n if (node.children && node.children.length) {\n // currentAngle = startAngle;\n var siblingAngle_1 = 0;\n zrUtil.each(node.children, function (node) {\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\n });\n }\n\n return endAngle - startAngle;\n }; // Virtual root node for roll up\n\n\n if (renderRollupNode) {\n var rStart = r0;\n var rEnd = r0 + rPerLevel;\n var angle = Math.PI * 2;\n virtualRoot.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: startAngle + angle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n\n renderNode(treeRoot, startAngle);\n });\n}\n/**\r\n * Init node children by order and update visual\r\n */\n\nfunction initChildren(node, sortOrder) {\n var children = node.children || [];\n node.children = sort(children, sortOrder); // Init children recursively\n\n if (children.length) {\n zrUtil.each(node.children, function (child) {\n initChildren(child, sortOrder);\n });\n }\n}\n/**\r\n * Sort children nodes\r\n *\r\n * @param {TreeNode[]} children children of node to be sorted\r\n * @param {string | function | null} sort sort method\r\n * See SunburstSeries.js for details.\r\n */\n\n\nfunction sort(children, sortOrder) {\n if (zrUtil.isFunction(sortOrder)) {\n var sortTargets = zrUtil.map(children, function (child, idx) {\n var value = child.getValue();\n return {\n params: {\n depth: child.depth,\n height: child.height,\n dataIndex: child.dataIndex,\n getValue: function () {\n return value;\n }\n },\n index: idx\n };\n });\n sortTargets.sort(function (a, b) {\n return sortOrder(a.params, b.params);\n });\n return zrUtil.map(sortTargets, function (target) {\n return children[target.index];\n });\n } else {\n var isAsc_1 = sortOrder === 'asc';\n return children.sort(function (a, b) {\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\n return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { lift } from 'zrender/lib/tool/color.js';\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function sunburstVisual(ecModel) {\n var paletteScope = {}; // Default color strategy\n\n function pickColor(node, seriesModel, treeHeight) {\n // Choose color from palette based on the first level.\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n\n if (node.depth > 1 && isString(color)) {\n // Lighter on the deeper level.\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n }\n\n return color;\n }\n\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n var style = model.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n style.fill = pickColor(node, seriesModel, tree.root.height);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SunburstView from './SunburstView.js';\nimport SunburstSeriesModel from './SunburstSeries.js';\nimport sunburstLayout from './sunburstLayout.js';\nimport sunburstVisual from './sunburstVisual.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport { installSunburstAction } from './sunburstAction.js';\nexport function install(registers) {\n registers.registerChartView(SunburstView);\n registers.registerSeriesModel(SunburstSeriesModel);\n registers.registerLayout(curry(sunburstLayout, 'sunburst'));\n registers.registerProcessor(curry(dataFilter, 'sunburst'));\n registers.registerVisual(sunburstVisual);\n installSunburstAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { makeInner } from '../../util/model.js';\nimport SeriesModel from '../../model/Series.js'; // Also compat with ec4, where\n// `visual('color') visual('borderColor')` is supported.\n\nexport var STYLE_VISUAL_TYPE = {\n color: 'fill',\n borderColor: 'stroke'\n};\nexport var NON_STYLE_VISUAL_PROPS = {\n symbol: 1,\n symbolSize: 1,\n symbolKeepAspect: 1,\n legendIcon: 1,\n visualMeta: 1,\n liftZ: 1,\n decal: 1\n};\n;\nexport var customInnerStore = makeInner();\n\nvar CustomSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CustomSeriesModel, _super);\n\n function CustomSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomSeriesModel.type;\n return _this;\n }\n\n CustomSeriesModel.prototype.optionUpdated = function () {\n this.currentZLevel = this.get('zlevel', true);\n this.currentZ = this.get('z', true);\n };\n\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this);\n };\n\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n el && (params.info = customInnerStore(el).info);\n return params;\n };\n\n CustomSeriesModel.type = 'series.custom';\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n CustomSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Custom series will not clip by default.\n // Some case will use custom series to draw label\n // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\n clip: false // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n\n };\n return CustomSeriesModel;\n}(SeriesModel);\n\nexport default CustomSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n var axis = this.getAxis(dim);\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n }, this);\n}\n\nexport default function cartesianPrepareCustom(coordSys) {\n var rect = coordSys.master.getRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'cartesian2d',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\n\nexport default function geoPrepareCustom(coordSys) {\n var rect = coordSys.getBoundingRect();\n return {\n coordSys: {\n type: 'geo',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n zoom: coordSys.getZoom()\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" and noRoam param,\n // Compatible with this usage:\n // echarts.util.map(item.points, api.coord)\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { bind } from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\n\nexport default function singlePrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n return {\n coordSys: {\n type: 'singleAxis',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (val) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(val);\n },\n size: bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // import AngleAxis from './AngleAxis.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis\n\n var axis = this[getterName]();\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n\n if (dim === 'Angle') {\n result = result * Math.PI / 180;\n }\n\n return result;\n }, this);\n}\n\nexport default function polarPrepareCustom(coordSys) {\n var radiusAxis = coordSys.getRadiusAxis();\n var angleAxis = coordSys.getAngleAxis();\n var radius = radiusAxis.getExtent();\n radius[0] > radius[1] && radius.reverse();\n return {\n coordSys: {\n type: 'polar',\n cx: coordSys.cx,\n cy: coordSys.cy,\n r: radius[1],\n r0: radius[0]\n },\n api: {\n coord: function (data) {\n var radius = radiusAxis.dataToRadius(data[0]);\n var angle = angleAxis.dataToAngle(data[1]);\n var coord = coordSys.coordToPoint([radius, angle]);\n coord.push(radius, angle * Math.PI / 180);\n return coord;\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function calendarPrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n var rangeInfo = coordSys.getRangeInfo();\n return {\n coordSys: {\n type: 'calendar',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n cellWidth: coordSys.getCellWidth(),\n cellHeight: coordSys.getCellHeight(),\n rangeInfo: {\n start: rangeInfo.start,\n end: rangeInfo.end,\n weeks: rangeInfo.weeks,\n dayCount: rangeInfo.allDay\n }\n },\n api: {\n coord: function (data, clamp) {\n return coordSys.dataToPoint(data, clamp);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, hasOwn } from 'zrender/lib/core/util.js';\nvar deprecatedLogs = {};\n/**\r\n * Whether need to call `convertEC4CompatibleStyle`.\r\n */\n\nexport function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n // Since echarts5, `RectText` is separated from its host element and style.text\n // does not exist any more. The compat work brings some extra burden on performance.\n // So we provide:\n // `legacy: true` force make compat.\n // `legacy: false`, force do not compat.\n // `legacy` not set: auto detect whether legacy.\n // But in this case we do not compat (difficult to detect and rare case):\n // Becuse custom series and graphic component support \"merge\", users may firstly\n // only set `textStrokeWidth` style or secondly only set `text`.\n return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' // Difficult to detect whether legacy for a \"text\" el.\n && (elType === 'text' || hasOwn(style, 'text')));\n}\n/**\r\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\r\n * @param hostStyle The properties might be modified.\r\n * @return If be text el, `textContentStyle` and `textConfig` will not be returned.\r\n * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\r\n * retried from the `hostStyle`.\r\n */\n\nexport function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\n var srcStyle = hostStyle;\n var textConfig;\n var textContent;\n var textContentStyle;\n\n if (elType === 'text') {\n textContentStyle = srcStyle;\n } else {\n textContentStyle = {};\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\n hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily);\n hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize);\n hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle);\n hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight);\n textContent = {\n type: 'text',\n style: textContentStyle,\n // ec4 does not support rectText trigger.\n // And when text position is different in normal and emphasis\n // => hover text trigger emphasis;\n // => text position changed, leave mouse pointer immediately;\n // That might cause incorrect state.\n silent: true\n };\n textConfig = {};\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\n\n if (isNormal) {\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\n } else {\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\n }\n\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\n }\n\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\n each(textContentStyle.rich, function (richItem) {\n convertEC4CompatibleRichItem(richItem, richItem);\n });\n return {\n textConfig: textConfig,\n textContent: textContent\n };\n}\n/**\r\n * The result will be set to `out`.\r\n */\n\nfunction convertEC4CompatibleRichItem(out, richItem) {\n if (!richItem) {\n return;\n } // (1) For simplicity, make textXXX properties (deprecated since ec5) has\n // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\n // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\n // richText in ec5.\n // (2) `out === richItem` if and only if `out` is text el or rich item.\n // So we can overwrite existing props in `out` since textXXX has higher priority.\n\n\n richItem.font = richItem.textFont || richItem.font;\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\n}\n/**\r\n * Convert to pure echarts4 format style.\r\n * `itemStyle` will be modified, added with ec4 style properties from\r\n * `textStyle` and `textConfig`.\r\n *\r\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\r\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\r\n */\n\n\nexport function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\n var out = itemStl; // See `custom.ts`, a trick to set extra `textPosition` firstly.\n\n out.textPosition = out.textPosition || txCfg.position || 'inside';\n txCfg.offset != null && (out.textOffset = txCfg.offset);\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\n txCfg.distance != null && (out.textDistance = txCfg.distance);\n var isInside = out.textPosition.indexOf('inside') >= 0;\n var hostFill = itemStl.fill || '#000';\n convertToEC4RichItem(out, txStl);\n var textFillNotSet = out.textFill == null;\n\n if (isInside) {\n if (textFillNotSet) {\n out.textFill = txCfg.insideFill || '#fff';\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\n !out.textStroke && (out.textStroke = hostFill);\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\n }\n } else {\n if (textFillNotSet) {\n out.textFill = itemStl.fill || txCfg.outsideFill || '#000';\n }\n\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\n }\n\n out.text = txStl.text;\n out.rich = txStl.rich;\n each(txStl.rich, function (richItem) {\n convertToEC4RichItem(richItem, richItem);\n });\n return out;\n}\n\nfunction convertToEC4RichItem(out, richItem) {\n if (!richItem) {\n return;\n }\n\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\n hasOwn(richItem, 'font') && (out.font = richItem.font);\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\n}\n\nexport function warnDeprecated(deprecated, insteadApproach) {\n if (process.env.NODE_ENV !== 'production') {\n var key = deprecated + '^_^' + insteadApproach;\n\n if (!deprecatedLogs[key]) {\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\n deprecatedLogs[key] = true;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, reduce } from 'zrender/lib/core/util.js';\nimport { cloneValue } from 'zrender/lib/animation/Animator.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { Path } from '../util/graphic.js';\nimport { warn } from '../util/log.js';\nimport { TRANSFORMABLE_PROPS } from 'zrender/lib/core/Transformable.js';\nvar LEGACY_TRANSFORM_PROPS_MAP = {\n position: ['x', 'y'],\n scale: ['scaleX', 'scaleY'],\n origin: ['originX', 'originY']\n};\nvar LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);\nvar TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = 1;\n return obj;\n}, {});\nvar transformPropNamesStr = TRANSFORMABLE_PROPS.join(', '); // '' means root\n\nexport var ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra'];\n;\nvar transitionInnerStore = makeInner();\n;\n\nfunction getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {\n var animationProp = animationType + \"Animation\";\n var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};\n var userDuring = transitionInnerStore(el).userDuring; // Only set when duration is > 0 and it's need to be animated.\n\n if (config.duration > 0) {\n // For simplicity, if during not specified, the previous during will not work any more.\n config.during = userDuring ? bind(duringCall, {\n el: el,\n userDuring: userDuring\n }) : null;\n config.setToFinal = true;\n config.scope = animationType;\n }\n\n extend(config, elOption[animationProp]);\n return config;\n}\n\nexport function applyUpdateTransition(el, elOption, animatableModel, opts) {\n opts = opts || {};\n var dataIndex = opts.dataIndex,\n isInit = opts.isInit,\n clearStyle = opts.clearStyle;\n var hasAnimation = animatableModel.isAnimationEnabled(); // Save the meta info for further morphing. Like apply on the sub morphing elements.\n\n var store = transitionInnerStore(el);\n var styleOpt = elOption.style;\n store.userDuring = elOption.during;\n var transFromProps = {};\n var propsToSet = {};\n prepareTransformAllPropsFinal(el, elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet);\n\n if (!isInit && hasAnimation) {\n prepareTransformTransitionFrom(el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps);\n prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);\n }\n\n propsToSet.style = styleOpt;\n applyPropsDirectly(el, propsToSet, clearStyle);\n applyMiscProps(el, elOption);\n\n if (hasAnimation) {\n if (isInit) {\n var enterFromProps_1 = {};\n each(ELEMENT_ANIMATABLE_PROPS, function (propName) {\n var prop = propName ? elOption[propName] : elOption;\n\n if (prop && prop.enterFrom) {\n if (propName) {\n enterFromProps_1[propName] = enterFromProps_1[propName] || {};\n }\n\n extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);\n }\n });\n var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex);\n\n if (config.duration > 0) {\n el.animateFrom(enterFromProps_1, config);\n }\n } else {\n applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);\n }\n } // Store leave to be used in leave transition.\n\n\n updateLeaveTo(el, elOption);\n styleOpt ? el.dirty() : el.markRedraw();\n}\nexport function updateLeaveTo(el, elOption) {\n // Try merge to previous set leaveTo\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n\n for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {\n var propName = ELEMENT_ANIMATABLE_PROPS[i];\n var prop = propName ? elOption[propName] : elOption;\n\n if (prop && prop.leaveTo) {\n if (!leaveToProps) {\n leaveToProps = transitionInnerStore(el).leaveToProps = {};\n }\n\n if (propName) {\n leaveToProps[propName] = leaveToProps[propName] || {};\n }\n\n extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);\n }\n }\n}\nexport function applyLeaveTransition(el, elOption, animatableModel, onRemove) {\n if (el) {\n var parent_1 = el.parent;\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n\n if (leaveToProps) {\n // TODO TODO use leave after leaveAnimation in series is introduced\n // TODO Data index?\n var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);\n\n config.done = function () {\n parent_1.remove(el);\n onRemove && onRemove();\n };\n\n el.animateTo(leaveToProps, config);\n } else {\n parent_1.remove(el);\n onRemove && onRemove();\n }\n }\n}\nexport function isTransitionAll(transition) {\n return transition === 'all';\n}\n\nfunction applyPropsDirectly(el, // Can be null/undefined\nallPropsFinal, clearStyle) {\n var styleOpt = allPropsFinal.style;\n\n if (!el.isGroup && styleOpt) {\n if (clearStyle) {\n el.useStyle({}); // When style object changed, how to trade the existing animation?\n // It is probably complicated and not needed to cover all the cases.\n // But still need consider the case:\n // (1) When using init animation on `style.opacity`, and before the animation\n // ended users triggers an update by mousewhel. At that time the init\n // animation should better be continued rather than terminated.\n // So after `useStyle` called, we should change the animation target manually\n // to continue the effect of the init animation.\n // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\n // to update the value to `val2` and no animation declared, should be terminate\n // the previous animation or just modify the target of the animation?\n // Therotically That will happen not only on `style` but also on `shape` and\n // `transfrom` props. But we haven't handle this case at present yet.\n // (3) PENDING: Is it proper to visit `animators` and `targetName`?\n\n var animators = el.animators;\n\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i]; // targetName is the \"topKey\".\n\n if (animator.targetName === 'style') {\n animator.changeTarget(el.style);\n }\n }\n }\n\n el.setStyle(styleOpt);\n }\n\n if (allPropsFinal) {\n // Not set style here.\n allPropsFinal.style = null; // Set el to the final state firstly.\n\n allPropsFinal && el.attr(allPropsFinal);\n allPropsFinal.style = styleOpt;\n }\n}\n\nfunction applyPropsTransition(el, elOption, dataIndex, model, // Can be null/undefined\ntransFromProps) {\n if (transFromProps) {\n var config = getElementAnimationConfig('update', el, elOption, model, dataIndex);\n\n if (config.duration > 0) {\n el.animateFrom(transFromProps, config);\n }\n }\n}\n\nfunction applyMiscProps(el, elOption) {\n // Merge by default.\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\n\n if (el instanceof Displayable) {\n hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible);\n }\n\n if (el instanceof Path) {\n hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch);\n }\n} // Use it to avoid it be exposed to user.\n\n\nvar tmpDuringScope = {};\nvar transitionDuringAPI = {\n // Usually other props do not need to be changed in animation during.\n setTransform: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\n }\n\n tmpDuringScope.el[key] = val;\n return this;\n },\n getTransform: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\n }\n\n return tmpDuringScope.el[key];\n },\n setShape: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var el = tmpDuringScope.el;\n var shape = el.shape || (el.shape = {});\n shape[key] = val;\n el.dirtyShape && el.dirtyShape();\n return this;\n },\n getShape: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var shape = tmpDuringScope.el.shape;\n\n if (shape) {\n return shape[key];\n }\n },\n setStyle: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var el = tmpDuringScope.el;\n var style = el.style;\n\n if (style) {\n if (process.env.NODE_ENV !== 'production') {\n if (eqNaN(val)) {\n warn('style.' + key + ' must not be assigned with NaN.');\n }\n }\n\n style[key] = val;\n el.dirtyStyle && el.dirtyStyle();\n }\n\n return this;\n },\n getStyle: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var style = tmpDuringScope.el.style;\n\n if (style) {\n return style[key];\n }\n },\n setExtra: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});\n extra[key] = val;\n return this;\n },\n getExtra: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra;\n\n if (extra) {\n return extra[key];\n }\n }\n};\n\nfunction assertNotReserved(key) {\n if (process.env.NODE_ENV !== 'production') {\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\n throw new Error('key must not be \"' + key + '\"');\n }\n }\n}\n\nfunction duringCall() {\n // Do not provide \"percent\" until some requirements come.\n // Because consider thies case:\n // enterFrom: {x: 100, y: 30}, transition: 'x'.\n // And enter duration is different from update duration.\n // Thus it might be confused about the meaning of \"percent\" in during callback.\n var scope = this;\n var el = scope.el;\n\n if (!el) {\n return;\n } // If el is remove from zr by reason like legend, during still need to called,\n // because el will be added back to zr and the prop value should not be incorrect.\n\n\n var latestUserDuring = transitionInnerStore(el).userDuring;\n var scopeUserDuring = scope.userDuring; // Ensured a during is only called once in each animation frame.\n // If a during is called multiple times in one frame, maybe some users' calculation logic\n // might be wrong (not sure whether this usage exists).\n // The case of a during might be called twice can be: by default there is a animator for\n // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\n // another animators for 'style'/'shape'/'extra'.\n\n if (latestUserDuring !== scopeUserDuring) {\n // release\n scope.el = scope.userDuring = null;\n return;\n }\n\n tmpDuringScope.el = el; // Give no `this` to user in \"during\" calling.\n\n scopeUserDuring(transitionDuringAPI); // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\n // consider the issue that the prop might be incorrect when return to \"normal\" state.\n}\n\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var elPropsInAttr = fromEl[mainAttr];\n var transFromPropsInAttr;\n\n if (elPropsInAttr) {\n var transition = elOption.transition;\n var attrTransition = attrOpt.transition;\n\n if (attrTransition) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n\n if (isTransitionAll(attrTransition)) {\n extend(transFromPropsInAttr, elPropsInAttr);\n } else {\n var transitionKeys = normalizeToArray(attrTransition);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = elPropsInAttr[key];\n transFromPropsInAttr[key] = elVal;\n }\n }\n } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var elPropsInAttrKeys = keys(elPropsInAttr);\n\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\n var key = elPropsInAttrKeys[i];\n var elVal = elPropsInAttr[key];\n\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\n transFromPropsInAttr[key] = elVal;\n }\n }\n }\n }\n}\n\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var allPropsInAttr = allProps[mainAttr] = {};\n var keysInAttr = keys(attrOpt);\n\n for (var i = 0; i < keysInAttr.length; i++) {\n var key = keysInAttr[i]; // To avoid share one object with different element, and\n // to avoid user modify the object inexpectedly, have to clone.\n\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\n }\n}\n\nfunction prepareTransformTransitionFrom(el, elOption, transFromProps) {\n var transition = elOption.transition;\n var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n\n if (key === 'style' || key === 'shape' || key === 'extra') {\n continue;\n }\n\n var elVal = el[key];\n\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.transition');\n } // Do not clone, animator will perform that clone.\n\n\n transFromProps[key] = elVal;\n }\n}\n\nfunction prepareTransformAllPropsFinal(el, elOption, allProps) {\n for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {\n var legacyName = LEGACY_TRANSFORM_PROPS[i];\n var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];\n var legacyArr = elOption[legacyName];\n\n if (legacyArr) {\n allProps[xyName[0]] = legacyArr[0];\n allProps[xyName[1]] = legacyArr[1];\n }\n }\n\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var key = TRANSFORMABLE_PROPS[i];\n\n if (elOption[key] != null) {\n allProps[key] = elOption[key];\n }\n }\n}\n\nfunction prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {\n if (!styleOpt) {\n return;\n }\n\n var fromElStyle = fromEl.style;\n var transFromStyleProps;\n\n if (fromElStyle) {\n var styleTransition = styleOpt.transition;\n var elTransition = elOption.transition;\n\n if (styleTransition && !isTransitionAll(styleTransition)) {\n var transitionKeys = normalizeToArray(styleTransition);\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = fromElStyle[key]; // Do not clone, see `checkNonStyleTansitionRefer`.\n\n transFromStyleProps[key] = elVal;\n }\n } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) {\n var animationProps = fromEl.getAnimationStyleProps();\n var animationStyleProps = animationProps ? animationProps.style : null;\n\n if (animationStyleProps) {\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n var styleKeys = keys(styleOpt);\n\n for (var i = 0; i < styleKeys.length; i++) {\n var key = styleKeys[i];\n\n if (animationStyleProps[key]) {\n var elVal = fromElStyle[key];\n transFromStyleProps[key] = elVal;\n }\n }\n }\n }\n }\n}\n\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\n // The same as `checkNonStyleTansitionRefer`.\n return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;\n}\n\nvar checkTransformPropRefer;\n\nif (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer = function (key, usedIn) {\n if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {\n warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { keys, filter, each, isArray, indexOf } from 'zrender/lib/core/util.js';\nimport { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { warn } from '../util/log.js';\nimport { makeInner } from '../util/model.js';\nvar getStateToRestore = makeInner();\nvar KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra'];\n/**\r\n * Stop previous keyframe animation and restore the attributes.\r\n * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.\r\n */\n\nexport function stopPreviousKeyframeAnimationAndRestore(el) {\n // Stop previous keyframe animation.\n el.stopAnimation('keyframe'); // Restore\n\n el.attr(getStateToRestore(el));\n}\nexport function applyKeyframeAnimation(el, animationOpts, animatableModel) {\n if (!animatableModel.isAnimationEnabled() || !animationOpts) {\n return;\n }\n\n if (isArray(animationOpts)) {\n each(animationOpts, function (singleAnimationOpts) {\n applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);\n });\n return;\n }\n\n var keyframes = animationOpts.keyframes;\n var duration = animationOpts.duration;\n\n if (animatableModel && duration == null) {\n // Default to use duration of config.\n // NOTE: animation config from payload will be ignored because they are mainly for transitions.\n var config = getAnimationConfig('enter', animatableModel, 0);\n duration = config && config.duration;\n }\n\n if (!keyframes || !duration) {\n return;\n }\n\n var stateToRestore = getStateToRestore(el);\n each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) {\n if (targetPropName && !el[targetPropName]) {\n return;\n }\n\n var animator;\n var endFrameIsSet = false; // Sort keyframes by percent.\n\n keyframes.sort(function (a, b) {\n return a.percent - b.percent;\n });\n each(keyframes, function (kf) {\n // Stop current animation.\n var animators = el.animators;\n var kfValues = targetPropName ? kf[targetPropName] : kf;\n\n if (process.env.NODE_ENV !== 'production') {\n if (kf.percent >= 1) {\n endFrameIsSet = true;\n }\n }\n\n if (!kfValues) {\n return;\n }\n\n var propKeys = keys(kfValues);\n\n if (!targetPropName) {\n // PENDING performance?\n propKeys = filter(propKeys, function (key) {\n return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;\n });\n }\n\n if (!propKeys.length) {\n return;\n }\n\n if (!animator) {\n animator = el.animate(targetPropName, animationOpts.loop, true);\n animator.scope = 'keyframe';\n }\n\n for (var i = 0; i < animators.length; i++) {\n // Stop all other animation that is not keyframe.\n if (animators[i] !== animator && animators[i].targetName === animator.targetName) {\n animators[i].stopTracks(propKeys);\n }\n }\n\n targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});\n var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;\n each(propKeys, function (key) {\n // Save original value.\n savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];\n });\n animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);\n });\n\n if (!animator) {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!endFrameIsSet) {\n warn('End frame with percent: 1 is missing in the keyframeAnimation.', true);\n }\n }\n\n animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y']; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\n/**\r\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\r\n * of each coordinate systems are not required by each coordinate systems directly, but\r\n * required by the module `custom`.\r\n *\r\n * prepareInfoForCustomSeries {Function}: optional\r\n * @return {Object} {coordSys: {...}, api: {\r\n * coord: function (data, clamp) {}, // return point in global.\r\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\r\n * }}\r\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n single: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\n\nfunction isPath(el) {\n return el instanceof graphicUtil.Path;\n}\n\nfunction isDisplayable(el) {\n return el instanceof Displayable;\n}\n\nfunction copyElement(sourceEl, targetEl) {\n targetEl.copyTransform(sourceEl);\n\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n targetEl.setStyle(sourceEl.style);\n targetEl.z = sourceEl.z;\n targetEl.z2 = sourceEl.z2;\n targetEl.zlevel = sourceEl.zlevel;\n targetEl.invisible = sourceEl.invisible;\n targetEl.ignore = sourceEl.ignore;\n\n if (isPath(targetEl) && isPath(sourceEl)) {\n targetEl.setShape(sourceEl.shape);\n }\n }\n}\n\nvar CustomChartView =\n/** @class */\nfunction (_super) {\n __extends(CustomChartView, _super);\n\n function CustomChartView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomChartView.type;\n return _this;\n }\n\n CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n if (!oldData) {\n // Previous render is incremental render or first render.\n // Needs remove the incremental rendered elements.\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n }).update(function (newIdx, oldIdx) {\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).execute(); // Do clipping\n\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n\n this._data = data;\n };\n\n CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n\n CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n var progressiveEls = this._progressiveEls = [];\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n\n if (el) {\n el.traverse(setIncrementalAndHoverLayer);\n progressiveEls.push(el);\n }\n }\n };\n\n CustomChartView.prototype.eachRendered = function (cb) {\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that are triggered by its descendents.\n\n\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n };\n\n CustomChartView.type = 'custom';\n return CustomChartView;\n}(ChartView);\n\nexport default CustomChartView;\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el; // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n customInnerStore(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n customInnerStore(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n\n if (!Clz) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n\n throwError(errMsg);\n }\n\n el = new Clz();\n }\n\n customInnerStore(el).customGraphicType = graphicType;\n el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\n\nfunction updateElNormal( // Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n } // Default transition ['x', 'y']\n\n\n if (elOption && elOption.transition == null) {\n elOption.transition = DEFAULT_TRANSITION;\n } // Do some normalization on style.\n\n\n var styleOpt = elOption && elOption.style;\n\n if (styleOpt) {\n if (el.type === 'text') {\n var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n } // Always overwrite in case user specify this prop.\n\n\n styleOpt.__decalPattern = decalPattern;\n }\n\n if (isDisplayable(el)) {\n if (styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n\n if (decalPattern) {\n styleOpt.decal = decalPattern;\n }\n }\n }\n\n applyUpdateTransition(el, elOption, seriesModel, {\n dataIndex: dataIndex,\n isInit: isInit,\n clearStyle: true\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\n\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation?\n\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable default emphasis.\n stateObj.style = styleOpt || null;\n } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n\n\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n\n setDefaultStateProxy(elDisplayable);\n }\n}\n\nfunction updateZ(el, elOption, seriesModel) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel; // Always erase.\n\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur.\n\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\n\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n } // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n\n\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n }\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n dim = dim || 0;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (!dimInfo) {\n var dimIndex = data.getDimensionIndex(dim);\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n }\n\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\r\n * @deprecated The original intention of `api.style` is enable to set itemStyle\r\n * like other series. But it is not necessary and not easy to give a strict definition\r\n * of what it returns. And since echarts5 it needs to be make compat work. So\r\n * deprecates it since echarts5.\r\n *\r\n * By default, `visual` is applied to style (to support visualMap).\r\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\r\n * it can be implemented as:\r\n * `api.style({stroke: api.visual('color'), fill: null})`;\r\n *\r\n * [Compat]: since ec5, RectText has been separated from its hosts el.\r\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\r\n * any more. But `series.label` config is never published in doc.\r\n * We still compat it in `api.style()`. But not encourage to use it and will still not\r\n * to pulish it to doc.\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\r\n * @deprecated The reason see `api.style()`\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n } // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n\n\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\r\n * @public\r\n * @return If not support, return undefined.\r\n */\n\n\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\r\n * @public\r\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\r\n * @public\r\n * @return font string\r\n */\n\n\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n group.remove(existsEl);\n return;\n }\n\n var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n el && data.setItemGraphicEl(dataIndex, el);\n el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n return el;\n}\n\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n\n var toBeReplacedIdx = -1;\n var oldEl = existsEl;\n\n if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphHelper && morphHelper.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n existsEl = null;\n }\n\n var isInit = !existsEl;\n var el = existsEl;\n\n if (!el) {\n el = createEl(elOption);\n\n if (oldEl) {\n copyElement(oldEl, el);\n }\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n } // Need to set morph: false explictly to disable automatically morphing.\n\n\n if (elOption.morph === false) {\n el.disableMorphing = true;\n } else if (el.disableMorphing) {\n el.disableMorphing = false;\n }\n\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n }\n }\n\n updateZ(el, elOption, seriesModel);\n\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel);\n }\n\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n\n return el;\n} // `el` must not be null/undefined.\n\n\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n var elInner = customInnerStore(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (// Always create new if universal transition is enabled.\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n clipPath = null;\n }\n\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n\n el.setClipPath(clipPath);\n }\n\n updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n } // If not define `clipPath` in option, do nothing unnecessary.\n\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // Group does not support textContent temporarily until necessary.\n if (el.isGroup) {\n return;\n } // Normal must be called before emphasis, for `isLegacy` detection.\n\n\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n }\n }\n\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\n\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n\n if (styleOpt && ( // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorrcet type for forward compat.\n assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\n\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\n\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n\n return style;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n// that the existing children will not be removed, and enables the feature\n// that update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n// happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n// `el` is a group, and if any of the new child is null, it means to remove\n// the element at the same index, if exists. On the other hand, if the new\n// child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\n\n\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n var newChild = newChildren[index];\n var oldChild = el.childAt(index);\n\n if (newChild) {\n if (newChild.ignore == null) {\n // The old child is set to be ignored if null (see comments\n // below). So we need to set ignore to be false back.\n newChild.ignore = false;\n }\n\n doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n } // If the new element option is null, it means to remove the old\n // element. But we cannot really remove the element from the group\n // directly, because the element order may not be stable when this\n // element is added back. So we set the element to be ignored.\n\n\n oldChild.ignore = true;\n }\n }\n\n for (var i = el.childCount() - 1; i >= index; i--) {\n var child = el.childAt(i);\n removeChildFromGroup(el, child, seriesModel);\n }\n}\n\nfunction removeChildFromGroup(group, child, seriesModel) {\n // Do not support leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to control all of the elements.\n child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\r\n * @return SVG Path data.\r\n */\n\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CustomSeriesModel from './CustomSeries.js';\nimport CustomChartView from './CustomView.js';\nexport function install(registers) {\n registers.registerChartView(CustomChartView);\n registers.registerSeriesModel(CustomSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\r\n * Base axis pointer class in 2D.\r\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\r\n * In px, arbitrary value. Do not set too small,\r\n * no animation is ok for most cases.\r\n */\n\n this.animationThreshold = 15;\n }\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatedly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\r\n * add {pointer, label, graphicKey} to elOption\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Should be implemenented by sub-class.\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\r\n * Throttled method.\r\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nexport function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n\n return style;\n}\n/**\r\n * @param {Function} labelPos {align, verticalAlign, position}\r\n */\n\nexport function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\n var value = axisPointerModel.get('value');\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n });\n var labelModel = axisPointerModel.getModel('label');\n var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\n var font = labelModel.getFont();\n var textRect = textContain.getBoundingRect(text, font);\n var position = labelPos.position;\n var width = textRect.width + paddings[1] + paddings[3];\n var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align.\n\n var align = labelPos.align;\n align === 'right' && (position[0] -= width);\n align === 'center' && (position[0] -= width / 2);\n var verticalAlign = labelPos.verticalAlign;\n verticalAlign === 'bottom' && (position[1] -= height);\n verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container\n\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\n\n elOption.label = {\n // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\n x: position[0],\n y: position[1],\n style: createTextStyle(labelModel, {\n text: text,\n font: font,\n fill: labelModel.getTextColor(),\n padding: paddings,\n backgroundColor: bgColor\n }),\n // Label should be over axisPointer.\n z2: 10\n };\n} // Do not overflow ec container\n\nfunction confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}\n\nexport function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\n value = axis.scale.parse(value);\n var text = axis.scale.getLabel({\n value: value\n }, {\n // If `precision` is set, width can be fixed (like '12.00500'), which\n // helps to debounce when when moving label.\n precision: opt.precision\n });\n var formatter = opt.formatter;\n\n if (formatter) {\n var params_1 = {\n value: axisHelper.getAxisRawValue(axis, {\n value: value\n }),\n axisDimension: axis.dim,\n axisIndex: axis.index,\n seriesData: []\n };\n zrUtil.each(seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var dataParams = series && series.getDataParams(dataIndex);\n dataParams && params_1.seriesData.push(dataParams);\n });\n\n if (zrUtil.isString(formatter)) {\n text = formatter.replace('{value}', text);\n } else if (zrUtil.isFunction(formatter)) {\n text = formatter(params_1);\n }\n }\n\n return text;\n}\nexport function getTransformedPosition(axis, value, layoutInfo) {\n var transform = matrix.create();\n matrix.rotate(transform, transform, layoutInfo.rotation);\n matrix.translate(transform, transform, layoutInfo.position);\n return graphic.applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);\n}\nexport function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\n // @ts-ignore\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\n align: textLayout.textAlign,\n verticalAlign: textLayout.textVerticalAlign\n });\n}\nexport function makeLineShape(p1, p2, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x1: p1[xDimIndex],\n y1: p1[1 - xDimIndex],\n x2: p2[xDimIndex],\n y2: p2[1 - xDimIndex]\n };\n}\nexport function makeRectShape(xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n}\nexport function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: true\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\n\nvar CartesianAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisPointer, _super);\n\n function CartesianAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: pos[0],\n y: pos[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n };\n\n return CartesianAxisPointer;\n}(BaseAxisPointer);\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nexport default CartesianAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar AxisPointerModel =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerModel, _super);\n\n function AxisPointerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerModel.type;\n return _this;\n }\n\n AxisPointerModel.type = 'axisPointer';\n AxisPointerModel.defaultOption = {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n // zlevel: 0,\n z: 50,\n type: 'line',\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n triggerEmphasis: true,\n value: null,\n status: null,\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#B9BEC9',\n width: 1,\n type: 'dashed'\n },\n shadowStyle: {\n color: 'rgba(210,219,238,0.2)'\n },\n label: {\n show: true,\n formatter: null,\n precision: 'auto',\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n borderColor: null,\n borderWidth: 0,\n borderRadius: 3\n },\n handle: {\n show: false,\n // eslint-disable-next-line\n 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',\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n };\n return AxisPointerModel;\n}(ComponentModel);\n\nexport default AxisPointerModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\r\n * @param {string} key\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Function} handler\r\n * param: {string} currTrigger\r\n * param: {Array.} point\r\n */\n\nexport function register(key, api, handler) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\n\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave);\n\n useHandler('globalout', onLeave);\n\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\n\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\n\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\n\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\n\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n }; // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\n\nexport function unregister(key, api) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n\n if (record) {\n inner(zr).records[key] = null;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener.js';\nimport ComponentView from '../../view/Component.js';\n\nvar AxisPointerView =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerView, _super);\n\n function AxisPointerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerView.type;\n return _this;\n }\n\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable\n // AxisPointerView to be independent to Tooltip.\n\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n };\n\n AxisPointerView.prototype.remove = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.prototype.dispose = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.type = 'axisPointer';\n return AxisPointerView;\n}(ComponentView);\n\nexport default AxisPointerView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\n/**\r\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\r\n * @param ecModel\r\n * @return {point: [x, y], el: ...} point Will not be null.\r\n */\n\nexport default function findPointFromSeries(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n if (finder.isStacked) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueAxisDim = valueAxis.dim;\n var baseAxisDim = baseAxis.dim;\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var baseDim = data.mapDimension(baseAxisDim);\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\n point = coordSys.dataToPoint(stackedData) || [];\n } else {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex)) || [];\n }\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n\n return {\n point: point,\n el: el\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\nimport * as modelHelper from './modelHelper.js';\nimport findPointFromSeries from './findPointFromSeries.js';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util.js';\nvar inner = makeInner();\n/**\r\n * Basic logic: check all axis, if they do not demand show/highlight,\r\n * then hide/downplay them.\r\n *\r\n * @return content of event obj for echarts.connect.\r\n */\n\nexport default function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}\n\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n var axis = axisInfo.axis;\n\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n } // Heavy calculation. So put it after axis.containData checking.\n\n\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect.\n // By default use the first involved series data as a sample to connect.\n\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n extend(outputFinder, payloadBatch[0]);\n } // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n\n\n if (!noSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n\n updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\n\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimensionsAll(dim);\n var seriesNestestValue;\n var dataIndices;\n\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex\n // when data length is not same.\n // false,\n axis.type === 'category' ? 0.5 : null);\n\n if (!dataIndices.length) {\n return;\n }\n\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff); // Consider category case\n\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\n\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\n\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n // depends that all models have been updated. So it should not be performed\n // here. Considering axisPointerModel used here is volatile, which is hard\n // to be retrieve in TooltipView, we prepare parameters here.\n valueLabelOpt: {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\n\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value; // For label formatter param and highlight.\n\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n } // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n } // If status is 'hide', should be no info in payload.\n\n\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\n\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n } // In most case only one axis (or event one series is used). It is\n // convenient to fetch payload.seriesIndex and payload.dataIndex\n // directly. So put the first seriesIndex and dataIndex of the first\n // axis on the payload.\n\n\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\n\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification should be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n }); // Diff.\n\n var toHighlight = [];\n var toDownplay = [];\n each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toHighlight\n });\n}\n\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\n\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\n\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport AxisView from '../axis/AxisView.js';\nimport CartesianAxisPointer from './CartesianAxisPointer.js';\nimport AxisPointerModel from './AxisPointerModel.js';\nimport AxisPointerView from './AxisPointerView.js';\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { collect } from './modelHelper.js';\nimport axisTrigger from './axisTrigger.js';\nexport function install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n registers.registerComponentModel(AxisPointerModel);\n registers.registerComponentView(AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !isArray(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { install as installSimple } from './installSimple.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nexport function install(registers) {\n use(installSimple);\n use(installAxisPointer);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\n\nvar PolarAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisPointer, _super);\n\n function PolarAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n\n if (axis.dim === 'angle') {\n this.animationThreshold = Math.PI / 18;\n }\n\n var polar = axis.polar;\n var otherAxis = polar.getOtherAxis(axis);\n var otherExtent = otherAxis.getExtent();\n var coordValue = axis.dataToCoord(value);\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var labelMargin = axisPointerModel.get(['label', 'margin']);\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n };\n\n return PolarAxisPointer;\n}(BaseAxisPointer);\n\n;\n\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n var axis = axisModel.axis;\n var coord = axis.dataToCoord(value);\n var axisAngle = polar.getAngleAxis().getExtent()[0];\n axisAngle = axisAngle / 180 * Math.PI;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var position;\n var align;\n var verticalAlign;\n\n if (axis.dim === 'radius') {\n var transform = matrix.create();\n matrix.rotate(transform, transform, axisAngle);\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\n position = graphic.applyTransform([coord, -labelMargin], transform);\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; // @ts-ignore\n\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n align = labelLayout.textAlign;\n verticalAlign = labelLayout.textVerticalAlign;\n } else {\n // angle axis\n var r = radiusExtent[1];\n position = polar.coordToPoint([r + labelMargin, coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n }\n\n return {\n position: position,\n align: align,\n verticalAlign: verticalAlign\n };\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, polar, coordValue, otherExtent) {\n return axis.dim === 'angle' ? {\n type: 'Line',\n shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n } : {\n type: 'Circle',\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: coordValue\n }\n };\n },\n shadow: function (axis, polar, coordValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var radian = Math.PI / 180;\n return axis.dim === 'angle' ? {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive\n (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n } : {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n };\n }\n};\nexport default PolarAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar PolarModel =\n/** @class */\nfunction (_super) {\n __extends(PolarModel, _super);\n\n function PolarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarModel.type;\n return _this;\n }\n\n PolarModel.prototype.findAxisModel = function (axisType) {\n var foundAxisModel;\n var ecModel = this.ecModel;\n ecModel.eachComponent(axisType, function (axisModel) {\n if (axisModel.getCoordSysModel() === this) {\n foundAxisModel = axisModel;\n }\n }, this);\n return foundAxisModel;\n };\n\n PolarModel.type = 'polar';\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n PolarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '80%'\n };\n return PolarModel;\n}(ComponentModel);\n\nexport default PolarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nvar PolarAxisModel =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisModel, _super);\n\n function PolarAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n PolarAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n };\n\n PolarAxisModel.type = 'polarAxis';\n return PolarAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\n\nvar AngleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisModel, _super);\n\n function AngleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisModel.type;\n return _this;\n }\n\n AngleAxisModel.type = 'angleAxis';\n return AngleAxisModel;\n}(PolarAxisModel);\n\nexport { AngleAxisModel };\n\nvar RadiusAxisModel =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisModel, _super);\n\n function RadiusAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisModel.type;\n return _this;\n }\n\n RadiusAxisModel.type = 'radiusAxis';\n return RadiusAxisModel;\n}(PolarAxisModel);\n\nexport { RadiusAxisModel };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar RadiusAxis =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxis, _super);\n\n function RadiusAxis(scale, radiusExtent) {\n return _super.call(this, 'radius', scale, radiusExtent) || this;\n }\n\n RadiusAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n\n return RadiusAxis;\n}(Axis);\n\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport Axis from '../Axis.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\n\nvar AngleAxis =\n/** @class */\nfunction (_super) {\n __extends(AngleAxis, _super);\n\n function AngleAxis(scale, angleExtent) {\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n }\n\n AngleAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n /**\r\n * Only be called in category axis.\r\n * Angle axis uses text height to decide interval\r\n *\r\n * @override\r\n * @return {number} Auto interval for cateogry axis tick and label\r\n */\n\n\n AngleAxis.prototype.calculateCategoryInterval = function () {\n var axis = this;\n var labelModel = axis.getLabelModel();\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitH = Math.abs(unitSpan); // Not precise, just use height as text width\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n var maxH = Math.max(rect.height, 7);\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(dh));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n };\n\n return AngleAxis;\n}(Axis);\n\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport RadiusAxis from './RadiusAxis.js';\nimport AngleAxis from './AngleAxis.js';\nexport var polarDimensions = ['radius', 'angle'];\n\nvar Polar =\n/** @class */\nfunction () {\n function Polar(name) {\n this.dimensions = polarDimensions;\n this.type = 'polar';\n /**\r\n * x of polar center\r\n */\n\n this.cx = 0;\n /**\r\n * y of polar center\r\n */\n\n this.cy = 0;\n this._radiusAxis = new RadiusAxis();\n this._angleAxis = new AngleAxis();\n this.axisPointerEnabled = true;\n this.name = name || '';\n this._radiusAxis.polar = this._angleAxis.polar = this;\n }\n /**\r\n * If contain coord\r\n */\n\n\n Polar.prototype.containPoint = function (point) {\n var coord = this.pointToCoord(point);\n return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n };\n /**\r\n * If contain data\r\n */\n\n\n Polar.prototype.containData = function (data) {\n return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n };\n\n Polar.prototype.getAxis = function (dim) {\n var key = '_' + dim + 'Axis';\n return this[key];\n };\n\n Polar.prototype.getAxes = function () {\n return [this._radiusAxis, this._angleAxis];\n };\n /**\r\n * Get axes by type of scale\r\n */\n\n\n Polar.prototype.getAxesByScale = function (scaleType) {\n var axes = [];\n var angleAxis = this._angleAxis;\n var radiusAxis = this._radiusAxis;\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n return axes;\n };\n\n Polar.prototype.getAngleAxis = function () {\n return this._angleAxis;\n };\n\n Polar.prototype.getRadiusAxis = function () {\n return this._radiusAxis;\n };\n\n Polar.prototype.getOtherAxis = function (axis) {\n var angleAxis = this._angleAxis;\n return axis === angleAxis ? this._radiusAxis : angleAxis;\n };\n /**\r\n * Base axis will be used on stacking.\r\n *\r\n */\n\n\n Polar.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n };\n\n Polar.prototype.getTooltipAxes = function (dim) {\n var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n return {\n baseAxes: [baseAxis],\n otherAxes: [this.getOtherAxis(baseAxis)]\n };\n };\n /**\r\n * Convert a single data item to (x, y) point.\r\n * Parameter data is an array which the first element is radius and the second is angle\r\n */\n\n\n Polar.prototype.dataToPoint = function (data, clamp) {\n return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);\n };\n /**\r\n * Convert a (x, y) point to data\r\n */\n\n\n Polar.prototype.pointToData = function (point, clamp) {\n var coord = this.pointToCoord(point);\n return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];\n };\n /**\r\n * Convert a (x, y) point to (radius, angle) coord\r\n */\n\n\n Polar.prototype.pointToCoord = function (point) {\n var dx = point[0] - this.cx;\n var dy = point[1] - this.cy;\n var angleAxis = this.getAngleAxis();\n var extent = angleAxis.getExtent();\n var minAngle = Math.min(extent[0], extent[1]);\n var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator\n // FIXME\n\n angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent\n\n var dir = radian < minAngle ? 1 : -1;\n\n while (radian < minAngle || radian > maxAngle) {\n radian += dir * 360;\n }\n\n return [radius, radian];\n };\n /**\r\n * Convert a (radius, angle) coord to (x, y) point\r\n */\n\n\n Polar.prototype.coordToPoint = function (coord) {\n var radius = coord[0];\n var radian = coord[1] / 180 * Math.PI;\n var x = Math.cos(radian) * radius + this.cx; // Inverse the y\n\n var y = -Math.sin(radian) * radius + this.cy;\n return [x, y];\n };\n /**\r\n * Get ring area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\n\n\n Polar.prototype.getArea = function () {\n var angleAxis = this.getAngleAxis();\n var radiusAxis = this.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180;\n return {\n cx: this.cx,\n cy: this.cy,\n r0: radiusExtent[0],\n r: radiusExtent[1],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse,\n contain: function (x, y) {\n // It's a ring shape.\n // Start angle and end angle don't matter\n var dx = x - this.cx;\n var dy = y - this.cy; // minus a tiny value 1e-4 to avoid being clipped unexpectedly\n\n var d2 = dx * dx + dy * dy - 1e-4;\n var r = this.r;\n var r0 = this.r0;\n return d2 <= r * r && d2 >= r0 * r0;\n }\n };\n };\n\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Polar;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var polarModel = finder.polarModel;\n return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Polar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Polar, { polarDimensions } from './Polar.js';\nimport { parsePercent } from '../../util/number.js';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Resize method bound to the polar\r\n */\n\nfunction resizePolar(polar, polarModel, api) {\n var center = polarModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n polar.cx = parsePercent(center[0], width);\n polar.cy = parsePercent(center[1], height);\n var radiusAxis = polar.getRadiusAxis();\n var size = Math.min(width, height) / 2;\n var radius = polarModel.get('radius');\n\n if (radius == null) {\n radius = [0, '100%'];\n } else if (!zrUtil.isArray(radius)) {\n // r0 = 0\n radius = [0, radius];\n }\n\n var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\r\n * Update polar\r\n */\n\n\nfunction updatePolarScale(ecModel, api) {\n var polar = this;\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis(); // Reset scale\n\n angleAxis.scale.setExtent(Infinity, -Infinity);\n radiusAxis.scale.setExtent(Infinity, -Infinity);\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === polar) {\n var data_1 = seriesModel.getData();\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n radiusAxis.scale.unionExtentFromData(data_1, dim);\n });\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n angleAxis.scale.unionExtentFromData(data_1, dim);\n });\n }\n });\n niceScaleExtent(angleAxis.scale, angleAxis.model);\n niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis\n\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\n var extent = angleAxis.getExtent();\n var diff = 360 / angleAxis.scale.count();\n angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n angleAxis.setExtent(extent[0], extent[1]);\n }\n}\n\nfunction isAngleAxisModel(axisModel) {\n return axisModel.mainType === 'angleAxis';\n}\n/**\r\n * Set common axis properties\r\n */\n\n\nfunction setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}\n\nvar polarCreator = {\n dimensions: polarDimensions,\n create: function (ecModel, api) {\n var polarList = [];\n ecModel.eachComponent('polar', function (polarModel, idx) {\n var polar = new Polar(idx + ''); // Inject resize and update method\n\n polar.update = updatePolarScale;\n var radiusAxis = polar.getRadiusAxis();\n var angleAxis = polar.getAngleAxis();\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n setAxis(radiusAxis, radiusAxisModel);\n setAxis(angleAxis, angleAxisModel);\n resizePolar(polar, polarModel, api);\n polarList.push(polar);\n polarModel.coordinateSystem = polar;\n polar.model = polarModel;\n }); // Inject coordinateSystem to series\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'polar') {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!polarModel) {\n throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n }\n }\n\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\n }\n });\n return polarList;\n }\n};\nexport default polarCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport AxisView from './AxisView.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport { getECData } from '../../util/innerStore.js';\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];\n\nfunction getAxisLineShape(polar, rExtent, angle) {\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n var start = polar.coordToPoint([rExtent[0], angle]);\n var end = polar.coordToPoint([rExtent[1], angle]);\n return {\n x1: start[0],\n y1: start[1],\n x2: end[0],\n y2: end[1]\n };\n}\n\nfunction getRadiusIdx(polar) {\n var radiusAxis = polar.getRadiusAxis();\n return radiusAxis.inverse ? 0 : 1;\n} // Remove the last tick which will overlap the first tick\n\n\nfunction fixAngleOverlap(list) {\n var firstItem = list[0];\n var lastItem = list[list.length - 1];\n\n if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n list.pop();\n }\n}\n\nvar AngleAxisView =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisView, _super);\n\n function AngleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!angleAxisModel.get('show')) {\n return;\n }\n\n var angleAxis = angleAxisModel.axis;\n var polar = angleAxis.polar;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var ticksAngles = angleAxis.getTicksCoords();\n var minorTickAngles = angleAxis.getMinorTicksCoords();\n var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n labelItem = zrUtil.clone(labelItem);\n var scale = angleAxis.scale;\n var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n labelItem.coord = angleAxis.dataToCoord(tickValue);\n return labelItem;\n });\n fixAngleOverlap(labels);\n fixAngleOverlap(ticksAngles);\n zrUtil.each(elementList, function (name) {\n if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\n }\n }, this);\n };\n\n AngleAxisView.type = 'angleAxis';\n return AngleAxisView;\n}(AxisView);\n\nvar angelAxisElementsBuilders = {\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); // extent id of the axis radius (r0 and r)\n\n var rId = getRadiusIdx(polar);\n var r0Id = rId ? 0 : 1;\n var shape;\n\n if (radiusExtent[r0Id] === 0) {\n shape = new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n } else {\n shape = new graphic.Ring({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId],\n r0: radiusExtent[r0Id]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n }\n\n shape.style.fill = null;\n group.add(shape);\n },\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var tickModel = angleAxisModel.getModel('axisTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n return new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n });\n });\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n })\n }));\n },\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var tickModel = angleAxisModel.getModel('axisTick');\n var minorTickModel = angleAxisModel.getModel('minorTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n }))\n }));\n },\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\n var rawCategoryData = angleAxisModel.getCategories(true);\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\n var labelMargin = commonLabelModel.get('margin');\n var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n\n zrUtil.each(labels, function (labelItem, idx) {\n var labelModel = commonLabelModel;\n var tickValue = labelItem.tickValue;\n var r = radiusExtent[getRadiusIdx(polar)];\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\n }\n }\n\n var textEl = new graphic.Text({\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\n style: createTextStyle(labelModel, {\n x: p[0],\n y: p[1],\n fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\n text: labelItem.formattedLabel,\n align: labelTextAlign,\n verticalAlign: labelTextVerticalAlign\n })\n });\n group.add(textEl); // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = labelItem.rawLabel;\n getECData(textEl).eventData = eventData;\n }\n }, this);\n },\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var splitLineModel = angleAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyleModel.getLineStyle()),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n }\n },\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: lineStyleModel.getLineStyle(),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n },\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!ticksAngles.length) {\n return;\n }\n\n var splitAreaModel = angleAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var RADIAN = Math.PI / 180;\n var prevAngle = -ticksAngles[0].coord * RADIAN;\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n var clockwise = angleAxisModel.get('clockwise');\n\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: r0,\n r: r1,\n startAngle: prevAngle,\n endAngle: -coord * RADIAN,\n clockwise: clockwise\n },\n silent: true\n }));\n prevAngle = -coord * RADIAN;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\nexport default AngleAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\n\nvar RadiusAxisView =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisView, _super);\n\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n // ensure circle radius >= 0\n r: Math.max(ticksCoords[i].coord, 0)\n }\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\r\n * @inner\r\n */\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nexport default RadiusAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(polar, axis) {\n return axis.dim + polar.model.componentIndex;\n}\n\nfunction barLayoutPolar(seriesType, ecModel, api) {\n var lastStackCoords = {};\n var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\n return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';\n }));\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for polar only\n if (seriesModel.coordinateSystem.type !== 'polar') {\n return;\n }\n\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = polar.getOtherAxis(baseAxis);\n var cx = seriesModel.coordinateSystem.cx;\n var cy = seriesModel.coordinateSystem.cy;\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim\n /* , baseDim */\n );\n var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true);\n var valueAxisStart = valueAxis.dataToCoord(0);\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n // Only ordinal axis can be stacked.\n\n if (stacked) {\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n n: valueAxisStart // Negative stack\n\n };\n } // Should also consider #4243\n\n\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n\n var r0 = void 0;\n var r = void 0;\n var startAngle = void 0;\n var endAngle = void 0; // radial sector\n\n if (valueAxis.dim === 'radius') {\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\n var angle = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(radiusSpan) < barMinHeight) {\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\n }\n\n r0 = baseCoord;\n r = baseCoord + radiusSpan;\n startAngle = angle - columnOffset;\n endAngle = startAngle - columnWidth;\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\n } // tangential sector\n else {\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\n var radius = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(angleSpan) < barMinAngle) {\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\n }\n\n r0 = radius + columnOffset;\n r = r0 + columnWidth;\n startAngle = baseCoord;\n endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring,\n // add a round to differentiate it from origin\n // let extent = angleAxis.getExtent();\n // let stackCoord = angle;\n // if (stackCoord === extent[0] && value > 0) {\n // stackCoord = extent[1];\n // }\n // else if (stackCoord === extent[1] && value < 0) {\n // stackCoord = extent[0];\n // }\n\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\n }\n\n data.setItemLayout(idx, {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n // Consider that positive angle is anti-clockwise,\n // while positive radian of sector is clockwise\n startAngle: -startAngle * Math.PI / 180,\n endAngle: -endAngle * Math.PI / 180,\n\n /**\r\n * Keep the same logic with bar in catesion: use end value to\r\n * control direction. Notice that if clockwise is true (by\r\n * default), the sector will always draw clockwisely, no matter\r\n * whether endAngle is greater or less than startAngle.\r\n */\n clockwise: startAngle >= endAngle\n });\n }\n });\n}\n/**\r\n * Calculate bar width and offset for radial bar charts\r\n */\n\n\nfunction calRadialBar(barSeries) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nexport default barLayoutPolar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport AxisView from '../axis/AxisView.js';\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport PolarModel from '../../coord/polar/PolarModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport { AngleAxisModel, RadiusAxisModel } from '../../coord/polar/AxisModel.js';\nimport polarCreator from '../../coord/polar/polarCreator.js';\nimport AngleAxisView from '../axis/AngleAxisView.js';\nimport RadiusAxisView from '../axis/RadiusAxisView.js';\nimport ComponentView from '../../view/Component.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport barLayoutPolar from '../../layout/barPolar.js';\nvar angleAxisExtraOption = {\n startAngle: 90,\n clockwise: true,\n splitNumber: 12,\n axisLabel: {\n rotate: 0\n }\n};\nvar radiusAxisExtraOption = {\n splitNumber: 5\n};\n\nvar PolarView =\n/** @class */\nfunction (_super) {\n __extends(PolarView, _super);\n\n function PolarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarView.type;\n return _this;\n }\n\n PolarView.type = 'polar';\n return PolarView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n registers.registerCoordinateSystem('polar', polarCreator);\n registers.registerComponentModel(PolarModel);\n registers.registerComponentView(PolarView); // Model and view for angleAxis and radiusAxis\n\n axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\n axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\n registers.registerComponentView(AngleAxisView);\n registers.registerComponentView(RadiusAxisView);\n registers.registerLayout(curry(barLayoutPolar, 'bar'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nimport AxisView from './AxisView.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine'];\n\nvar SingleAxisView =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisView, _super);\n\n function SingleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisView.type;\n _this.axisPointerClass = 'SingleAxisPointer';\n return _this;\n }\n\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n var layout = singleAxisHelper.layout(axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n group.add(this._axisGroup);\n group.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n SingleAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n SingleAxisView.type = 'singleAxis';\n return SingleAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, group, axisGroup, axisModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var lineWidth = lineStyleModel.get('width');\n var gridRect = axisModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var splitLines = [];\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n\n for (var i = 0; i < ticksCoords.length; ++i) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var line = new graphic.Line({\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineWidth);\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(line);\n }\n\n var lineStyle = lineStyleModel.getLineStyle(['color']);\n\n for (var i = 0; i < splitLines.length; ++i) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyle),\n silent: true\n }));\n }\n },\n splitArea: function (axisView, group, axisGroup, axisModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\n }\n};\nexport default SingleAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar SingleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisModel, _super);\n\n function SingleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisModel.type;\n return _this;\n }\n\n SingleAxisModel.prototype.getCoordSysModel = function () {\n return this;\n };\n\n SingleAxisModel.type = 'singleAxis';\n SingleAxisModel.layoutMode = 'box';\n SingleAxisModel.defaultOption = {\n left: '5%',\n top: '5%',\n right: '5%',\n bottom: '5%',\n type: 'value',\n position: 'bottom',\n orient: 'horizontal',\n axisLine: {\n show: true,\n lineStyle: {\n width: 1,\n type: 'solid'\n }\n },\n // Single coordinate system and single axis is the,\n // which is used as the parent tooltip model.\n // same model, so we set default tooltip show as true.\n tooltip: {\n show: true\n },\n axisTick: {\n show: true,\n length: 6,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n interval: 'auto'\n },\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n opacity: 0.2\n }\n }\n };\n return SingleAxisModel;\n}(ComponentModel);\n\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar SingleAxis =\n/** @class */\nfunction (_super) {\n __extends(SingleAxis, _super);\n\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n /**\r\n * Judge the orient of the axis.\r\n */\n\n\n SingleAxis.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n\n SingleAxis.prototype.pointToData = function (point, clamp) {\n return this.coordinateSystem.pointToData(point)[0];\n };\n\n return SingleAxis;\n}(Axis);\n\nexport default SingleAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Single coordinates system.\r\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\r\n * Create a single coordinates system.\r\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\r\n * Add it just for draw tooltip.\r\n */\n\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\r\n * Initialize single coordinate system.\r\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\r\n * Update axis scale after data processed\r\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\r\n * Resize the single coordinate system.\r\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\r\n * Get axis.\r\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\r\n * Get axis, add it just for draw tooltip.\r\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\r\n * If contain point.\r\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\r\n * Convert the series data to concrete point.\r\n * Can be [val] | val\r\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Single coordinate system creator.\r\n */\nimport Single, { singleDimensions } from './Single.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Create single coordinate system and inject it into seriesModel.\r\n */\n\nfunction create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}\n\nvar singleCreator = {\n create: create,\n dimensions: singleDimensions\n};\nexport default singleCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\n\nvar SingleAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisPointer, _super);\n\n function SingleAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n var pixelValue = coordSys.dataToPoint(value)[0];\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = singleAxisHelper.layout(axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = singleAxisHelper.layout(axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: position[0],\n y: position[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var dimIndex = getPointDimIndex(axis);\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: {\n verticalAlign: 'middle'\n }\n };\n };\n\n return SingleAxisPointer;\n}(BaseAxisPointer);\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = axis.getBandWidth();\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n };\n }\n};\n\nfunction getPointDimIndex(axis) {\n return axis.isHorizontal() ? 0 : 1;\n}\n\nfunction getGlobalExtent(coordSys, dimIndex) {\n var rect = coordSys.getRect();\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\n\nexport default SingleAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport ComponentView from '../../view/Component.js';\nimport SingleAxisView from '../axis/SingleAxisView.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport SingleAxisModel from '../../coord/single/AxisModel.js';\nimport singleCreator from '../../coord/single/singleCreator.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport AxisView from '../axis/AxisView.js';\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer.js';\n\nvar SingleView =\n/** @class */\nfunction (_super) {\n __extends(SingleView, _super);\n\n function SingleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleView.type;\n return _this;\n }\n\n SingleView.type = 'single';\n return SingleView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n registers.registerComponentView(SingleView); // Axis\n\n registers.registerComponentView(SingleAxisView);\n registers.registerComponentModel(SingleAxisModel);\n axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\n registers.registerCoordinateSystem('single', singleCreator);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\r\n * @override\r\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { isString, extend, map, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { formatTplSimple } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getLocaleModel } from '../../core/locale.js';\n\nvar CalendarView =\n/** @class */\nfunction (_super) {\n __extends(CalendarView, _super);\n\n function CalendarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarView.type;\n return _this;\n }\n\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n var coordSys = calendarModel.coordinateSystem; // range info\n\n var rangeData = coordSys.getRangeInfo();\n var orient = coordSys.getOrient(); // locale\n\n var localeModel = ecModel.getLocaleModel();\n\n this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function\n\n\n this._renderLines(calendarModel, rangeData, orient, group);\n\n this._renderYearText(calendarModel, rangeData, orient, group);\n\n this._renderMonthText(calendarModel, localeModel, orient, group);\n\n this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);\n }; // render day rect\n\n\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\n var coordSys = calendarModel.coordinateSystem;\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\n var sw = coordSys.getCellWidth();\n var sh = coordSys.getCellHeight();\n\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\n var point = coordSys.dataToRect([i], false).tl; // every rect\n\n var rect = new graphic.Rect({\n shape: {\n x: point[0],\n y: point[1],\n width: sw,\n height: sh\n },\n cursor: 'default',\n style: itemRectStyleModel\n });\n group.add(rect);\n }\n }; // render separate line\n\n\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\n var self = this;\n var coordSys = calendarModel.coordinateSystem;\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\n var show = calendarModel.get(['splitLine', 'show']);\n var lineWidth = lineStyleModel.lineWidth;\n this._tlpoints = [];\n this._blpoints = [];\n this._firstDayOfMonth = [];\n this._firstDayPoints = [];\n var firstDay = rangeData.start;\n\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\n addPoints(firstDay.formatedDate);\n\n if (i === 0) {\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\n }\n\n var date = firstDay.date;\n date.setMonth(date.getMonth() + 1);\n firstDay = coordSys.getDateInfo(date);\n }\n\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\n\n function addPoints(date) {\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\n\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\n\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\n\n self._tlpoints.push(points[0]);\n\n self._blpoints.push(points[points.length - 1]);\n\n show && self._drawSplitline(points, lineStyleModel, group);\n } // render top/left line\n\n\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line\n\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\n }; // get points at both ends\n\n\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\n var rs = [points[0].slice(), points[points.length - 1].slice()];\n var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth\n\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\n return rs;\n }; // render split line\n\n\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\n var poyline = new graphic.Polyline({\n z2: 20,\n shape: {\n points: points\n },\n style: lineStyle\n });\n group.add(poyline);\n }; // render month line of one week points\n\n\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\n var coordSys = calendarModel.coordinateSystem;\n var parsedDate = coordSys.getDateInfo(date);\n var points = [];\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\n var point = coordSys.dataToRect([tmpD.time], false);\n points[2 * tmpD.day] = point.tl;\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\n }\n\n return points;\n };\n\n CalendarView.prototype._formatterLabel = function (formatter, params) {\n if (isString(formatter) && formatter) {\n return formatTplSimple(formatter, params);\n }\n\n if (isFunction(formatter)) {\n return formatter(params);\n }\n\n return params.nameMap;\n };\n\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\n var x = point[0];\n var y = point[1];\n var aligns = ['center', 'bottom'];\n\n if (position === 'bottom') {\n y += margin;\n aligns = ['center', 'top'];\n } else if (position === 'left') {\n x -= margin;\n } else if (position === 'right') {\n x += margin;\n aligns = ['center', 'top'];\n } else {\n // top\n y -= margin;\n }\n\n var rotate = 0;\n\n if (position === 'left' || position === 'right') {\n rotate = Math.PI / 2;\n }\n\n return {\n rotation: rotate,\n x: x,\n y: y,\n style: {\n align: aligns[0],\n verticalAlign: aligns[1]\n }\n };\n }; // render year\n\n\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\n var yearLabel = calendarModel.getModel('yearLabel');\n\n if (!yearLabel.get('show')) {\n return;\n }\n\n var margin = yearLabel.get('margin');\n var pos = yearLabel.get('position');\n\n if (!pos) {\n pos = orient !== 'horizontal' ? 'top' : 'left';\n }\n\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\n var xc = (points[0][0] + points[1][0]) / 2;\n var yc = (points[0][1] + points[1][1]) / 2;\n var idx = orient === 'horizontal' ? 0 : 1;\n var posPoints = {\n top: [xc, points[idx][1]],\n bottom: [xc, points[1 - idx][1]],\n left: [points[1 - idx][0], yc],\n right: [points[idx][0], yc]\n };\n var name = rangeData.start.y;\n\n if (+rangeData.end.y > +rangeData.start.y) {\n name = name + '-' + rangeData.end.y;\n }\n\n var formatter = yearLabel.get('formatter');\n var params = {\n start: rangeData.start.y,\n end: rangeData.end.y,\n nameMap: name\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var yearText = new graphic.Text({\n z2: 30,\n style: createTextStyle(yearLabel, {\n text: content\n })\n });\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\n group.add(yearText);\n };\n\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\n var align = 'left';\n var vAlign = 'top';\n var x = point[0];\n var y = point[1];\n\n if (orient === 'horizontal') {\n y = y + margin;\n\n if (isCenter) {\n align = 'center';\n }\n\n if (position === 'start') {\n vAlign = 'bottom';\n }\n } else {\n x = x + margin;\n\n if (isCenter) {\n vAlign = 'middle';\n }\n\n if (position === 'start') {\n align = 'right';\n }\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render month and year text\n\n\n CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) {\n var monthLabel = calendarModel.getModel('monthLabel');\n\n if (!monthLabel.get('show')) {\n return;\n }\n\n var nameMap = monthLabel.get('nameMap');\n var margin = monthLabel.get('margin');\n var pos = monthLabel.get('position');\n var align = monthLabel.get('align');\n var termPoints = [this._tlpoints, this._blpoints];\n\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n } // PENDING\n // for ZH locale, original form is `一月` but current form is `1月`\n\n\n nameMap = localeModel.get(['time', 'monthAbbr']) || [];\n }\n\n var idx = pos === 'start' ? 0 : 1;\n var axis = orient === 'horizontal' ? 0 : 1;\n margin = pos === 'start' ? -margin : margin;\n var isCenter = align === 'center';\n\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\n var tmp = termPoints[idx][i].slice();\n var firstDay = this._firstDayOfMonth[i];\n\n if (isCenter) {\n var firstDayPoints = this._firstDayPoints[i];\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\n }\n\n var formatter = monthLabel.get('formatter');\n var name_1 = nameMap[+firstDay.m - 1];\n var params = {\n yyyy: firstDay.y,\n yy: (firstDay.y + '').slice(2),\n MM: firstDay.m,\n M: +firstDay.m,\n nameMap: name_1\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var monthText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(monthLabel, {\n text: content\n }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\n });\n group.add(monthText);\n }\n };\n\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\n var align = 'center';\n var vAlign = 'middle';\n var x = point[0];\n var y = point[1];\n var isStart = position === 'start';\n\n if (orient === 'horizontal') {\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\n align = isStart ? 'right' : 'left';\n } else {\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\n vAlign = isStart ? 'bottom' : 'top';\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render weeks\n\n\n CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) {\n var dayLabel = calendarModel.getModel('dayLabel');\n\n if (!dayLabel.get('show')) {\n return;\n }\n\n var coordSys = calendarModel.coordinateSystem;\n var pos = dayLabel.get('position');\n var nameMap = dayLabel.get('nameMap');\n var margin = dayLabel.get('margin');\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\n\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n } // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file\n\n\n var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']);\n nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) {\n return val[0];\n });\n }\n\n var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\n margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\n\n if (pos === 'start') {\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\n margin = -margin;\n }\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(start, i);\n var point = coordSys.dataToRect([tmpD.time], false).center;\n var day = i;\n day = Math.abs((i + firstDayOfWeek) % 7);\n var weekText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(dayLabel, {\n text: nameMap[day]\n }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\n });\n group.add(weekText);\n }\n };\n\n CalendarView.type = 'calendar';\n return CalendarView;\n}(ComponentView);\n\nexport default CalendarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js'; // (24*60*60*1000)\n\nvar PROXIMATE_ONE_DAY = 86400000;\n\nvar Calendar =\n/** @class */\nfunction () {\n function Calendar(calendarModel, ecModel, api) {\n this.type = 'calendar';\n this.dimensions = Calendar.dimensions; // Required in createListFromData\n\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\n this._model = calendarModel;\n }\n\n Calendar.getDimensionsInfo = function () {\n return [{\n name: 'time',\n type: 'time'\n }, 'value'];\n };\n\n Calendar.prototype.getRangeInfo = function () {\n return this._rangeInfo;\n };\n\n Calendar.prototype.getModel = function () {\n return this._model;\n };\n\n Calendar.prototype.getRect = function () {\n return this._rect;\n };\n\n Calendar.prototype.getCellWidth = function () {\n return this._sw;\n };\n\n Calendar.prototype.getCellHeight = function () {\n return this._sh;\n };\n\n Calendar.prototype.getOrient = function () {\n return this._orient;\n };\n /**\r\n * getFirstDayOfWeek\r\n *\r\n * @example\r\n * 0 : start at Sunday\r\n * 1 : start at Monday\r\n *\r\n * @return {number}\r\n */\n\n\n Calendar.prototype.getFirstDayOfWeek = function () {\n return this._firstDayOfWeek;\n };\n /**\r\n * get date info\r\n * }\r\n */\n\n\n Calendar.prototype.getDateInfo = function (date) {\n date = numberUtil.parseDate(date);\n var y = date.getFullYear();\n var m = date.getMonth() + 1;\n var mStr = m < 10 ? '0' + m : '' + m;\n var d = date.getDate();\n var dStr = d < 10 ? '0' + d : '' + d;\n var day = date.getDay();\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n return {\n y: y + '',\n m: mStr,\n d: dStr,\n day: day,\n time: date.getTime(),\n formatedDate: y + '-' + mStr + '-' + dStr,\n date: date\n };\n };\n\n Calendar.prototype.getNextNDay = function (date, n) {\n n = n || 0;\n\n if (n === 0) {\n return this.getDateInfo(date);\n }\n\n date = new Date(this.getDateInfo(date).time);\n date.setDate(date.getDate() + n);\n return this.getDateInfo(date);\n };\n\n Calendar.prototype.update = function (ecModel, api) {\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n this._orient = this._model.get('orient');\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n var weeks = this._rangeInfo.weeks || 1;\n var whNames = ['width', 'height'];\n\n var cellSize = this._model.getCellSize().slice();\n\n var layoutParams = this._model.getBoxLayoutParams();\n\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n zrUtil.each([0, 1], function (idx) {\n if (cellSizeSpecified(cellSize, idx)) {\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n }\n });\n var whGlobal = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n zrUtil.each([0, 1], function (idx) {\n if (!cellSizeSpecified(cellSize, idx)) {\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n }\n });\n\n function cellSizeSpecified(cellSize, idx) {\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\n } // Has been calculated out number.\n\n\n this._sw = cellSize[0];\n this._sh = cellSize[1];\n };\n /**\r\n * Convert a time data(time, value) item to (x, y) point.\r\n */\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\n // It will return NaN if data exceeds.\n\n\n Calendar.prototype.dataToPoint = function (data, clamp) {\n zrUtil.isArray(data) && (data = data[0]);\n clamp == null && (clamp = true);\n var dayInfo = this.getDateInfo(data);\n var range = this._rangeInfo;\n var date = dayInfo.formatedDate; // if not in range return [NaN, NaN]\n\n if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n return [NaN, NaN];\n }\n\n var week = dayInfo.day;\n\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n\n if (this._orient === 'vertical') {\n return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];\n }\n\n return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];\n };\n /**\r\n * Convert a (x, y) point to time data\r\n */\n\n\n Calendar.prototype.pointToData = function (point) {\n var date = this.pointToDate(point);\n return date && date.time;\n };\n /**\r\n * Convert a time date item to (x, y) four point.\r\n */\n\n\n Calendar.prototype.dataToRect = function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n height: this._sh - this._lineWidth\n },\n center: point,\n tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n };\n };\n /**\r\n * Convert a (x, y) point to time date\r\n *\r\n * @param {Array} point point\r\n * @return {Object} date\r\n */\n\n\n Calendar.prototype.pointToDate = function (point) {\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n var range = this._rangeInfo.range;\n\n if (this._orient === 'vertical') {\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n }\n\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n };\n\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n Calendar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n /**\r\n * initRange\r\n * Normalize to an [start, end] array\r\n */\n\n\n Calendar.prototype._initRangeOption = function () {\n var range = this._model.get('range');\n\n var normalizedRange; // Convert [1990] to 1990\n\n if (zrUtil.isArray(range) && range.length === 1) {\n range = range[0];\n }\n\n if (!zrUtil.isArray(range)) {\n var rangeStr = range.toString(); // One year.\n\n if (/^\\d{4}$/.test(rangeStr)) {\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n } // One month\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n var start = this.getDateInfo(rangeStr);\n var firstDay = start.date;\n firstDay.setMonth(firstDay.getMonth() + 1);\n var end = this.getNextNDay(firstDay, -1);\n normalizedRange = [start.formatedDate, end.formatedDate];\n } // One day\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n normalizedRange = [rangeStr, rangeStr];\n }\n } else {\n normalizedRange = range;\n }\n\n if (!normalizedRange) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.logError('Invalid date range.');\n } // Not handling it.\n\n\n return range;\n }\n\n var tmp = this._getRangeInfo(normalizedRange);\n\n if (tmp.start.time > tmp.end.time) {\n normalizedRange.reverse();\n }\n\n return normalizedRange;\n };\n /**\r\n * range info\r\n *\r\n * @private\r\n * @param {Array} range range ['2017-01-01', '2017-07-08']\r\n * If range[0] > range[1], they will not be reversed.\r\n * @return {Object} obj\r\n */\n\n\n Calendar.prototype._getRangeInfo = function (range) {\n var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n var reversed;\n\n if (parsedRange[0].time > parsedRange[1].time) {\n reversed = true;\n parsedRange.reverse();\n }\n\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430):\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n // Consider case2:\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\n // ```\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n // let second = new Date(1478412000000);\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n // ```\n // will get wrong result because of DST. So we should fix it.\n\n var date = new Date(parsedRange[0].time);\n var startDateNum = date.getDate();\n var endDateNum = parsedRange[1].date.getDate();\n date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date.\n\n var dateNum = date.getDate();\n\n if (dateNum !== endDateNum) {\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n\n while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n allDay -= sign;\n date.setDate(dateNum - sign);\n }\n }\n\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n reversed && parsedRange.reverse();\n return {\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n start: parsedRange[0],\n end: parsedRange[1],\n allDay: allDay,\n weeks: weeks,\n // From 0.\n nthWeek: nthWeek,\n fweek: parsedRange[0].day,\n lweek: parsedRange[1].day\n };\n };\n /**\r\n * get date by nthWeeks and week day in range\r\n *\r\n * @private\r\n * @param {number} nthWeek the week\r\n * @param {number} day the week day\r\n * @param {Array} range [d1, d2]\r\n * @return {Object}\r\n */\n\n\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n var rangeInfo = this._getRangeInfo(range);\n\n if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n return null;\n }\n\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n var date = new Date(rangeInfo.start.time);\n date.setDate(+rangeInfo.start.d + nthDay);\n return this.getDateInfo(date);\n };\n\n Calendar.create = function (ecModel, api) {\n var calendarList = [];\n ecModel.eachComponent('calendar', function (calendarModel) {\n var calendar = new Calendar(calendarModel, ecModel, api);\n calendarList.push(calendar);\n calendarModel.coordinateSystem = calendar;\n });\n ecModel.eachSeries(function (calendarSeries) {\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\n // Inject coordinate system\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\n }\n });\n return calendarList;\n };\n\n Calendar.dimensions = ['time', 'value'];\n return Calendar;\n}();\n\nfunction getCoordSys(finder) {\n var calendarModel = finder.calendarModel;\n var seriesModel = finder.seriesModel;\n var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n return coordSys;\n}\n\nexport default Calendar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CalendarModel from '../../coord/calendar/CalendarModel.js';\nimport CalendarView from './CalendarView.js';\nimport Calendar from '../../coord/calendar/Calendar.js';\nexport function install(registers) {\n registers.registerComponentModel(CalendarModel);\n registers.registerComponentView(CalendarView);\n registers.registerCoordinateSystem('calendar', Calendar);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport { copyLayoutParams, mergeLayoutParam } from '../../util/layout.js';\n;\n;\n;\nexport function setKeyInfoToNewElOption(resultItem, newElOption) {\n var existElOption = resultItem.existing; // Set id and type after id assigned.\n\n newElOption.id = resultItem.keyInfo.id;\n !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified\n\n if (newElOption.parentId == null) {\n var newElParentOption = newElOption.parentOption;\n\n if (newElParentOption) {\n newElOption.parentId = newElParentOption.id;\n } else if (existElOption) {\n newElOption.parentId = existElOption.parentId;\n }\n } // Clear\n\n\n newElOption.parentOption = null;\n}\n\nfunction isSetLoc(obj, props) {\n var isSet;\n zrUtil.each(props, function (prop) {\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\n });\n return isSet;\n}\n\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\n // Update existing options, for `getOption` feature.\n var newElOptCopy = zrUtil.extend({}, newElOption);\n var existElOption = existList[index];\n var $action = newElOption.$action || 'merge';\n\n if ($action === 'merge') {\n if (existElOption) {\n if (process.env.NODE_ENV !== 'production') {\n var newType = newElOption.type;\n zrUtil.assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\n } // We can ensure that newElOptCopy and existElOption are not\n // the same object, so `merge` will not change newElOptCopy.\n\n\n zrUtil.merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize.\n\n mergeLayoutParam(existElOption, newElOptCopy, {\n ignoreSize: true\n }); // Will be used in render.\n\n copyLayoutParams(newElOption, existElOption); // Copy transition info to new option so it can be used in the transition.\n // DO IT AFTER merge\n\n copyTransitionInfo(newElOption, existElOption);\n copyTransitionInfo(newElOption, existElOption, 'shape');\n copyTransitionInfo(newElOption, existElOption, 'style');\n copyTransitionInfo(newElOption, existElOption, 'extra'); // Copy clipPath\n\n newElOption.clipPath = existElOption.clipPath;\n } else {\n existList[index] = newElOptCopy;\n }\n } else if ($action === 'replace') {\n existList[index] = newElOptCopy;\n } else if ($action === 'remove') {\n // null will be cleaned later.\n existElOption && (existList[index] = null);\n }\n}\n\nvar TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo'];\nvar ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']);\n\nfunction copyTransitionInfo(target, source, targetProp) {\n if (targetProp) {\n if (!target[targetProp] && source[targetProp]) {\n // TODO avoid creating this empty object when there is no transition configuration.\n target[targetProp] = {};\n }\n\n target = target[targetProp];\n source = source[targetProp];\n }\n\n if (!target || !source) {\n return;\n }\n\n var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;\n\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n\n if (target[prop] == null && source[prop] != null) {\n target[prop] = source[prop];\n }\n }\n}\n\nfunction setLayoutInfoToExist(existItem, newElOption) {\n if (!existItem) {\n return;\n }\n\n existItem.hv = newElOption.hv = [// Rigid body, don't care about `width`.\n isSetLoc(newElOption, ['left', 'right']), // Rigid body, don't care about `height`.\n isSetLoc(newElOption, ['top', 'bottom'])]; // Give default group size. Otherwise layout error may occur.\n\n if (existItem.type === 'group') {\n var existingGroupOpt = existItem;\n var newGroupOpt = newElOption;\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\n }\n}\n\nvar GraphicComponentModel =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentModel, _super);\n\n function GraphicComponentModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentModel.type;\n _this.preventAutoZ = true;\n return _this;\n }\n\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\n // Prevent default merge to elements\n var elements = this.option.elements;\n this.option.elements = null;\n\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this.option.elements = elements;\n };\n\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n var newList = (isInit ? thisOption : newOption).elements;\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\n var flattenedList = [];\n\n this._flatten(newList, flattenedList, null);\n\n var mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge'); // Clear elOptionsToUpdate\n\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\n zrUtil.each(mappingResult, function (resultItem, index) {\n var newElOption = resultItem.newOption;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\n }\n\n if (!newElOption) {\n return;\n }\n\n elOptionsToUpdate.push(newElOption);\n setKeyInfoToNewElOption(resultItem, newElOption);\n mergeNewElOptionToExist(existList, index, newElOption);\n setLayoutInfoToExist(existList[index], newElOption);\n }, this); // Clean\n\n thisOption.elements = zrUtil.filter(existList, function (item) {\n // $action should be volatile, otherwise option gotten from\n // `getOption` will contain unexpected $action.\n item && delete item.$action;\n return item != null;\n });\n };\n /**\r\n * Convert\r\n * [{\r\n * type: 'group',\r\n * id: 'xx',\r\n * children: [{type: 'circle'}, {type: 'polygon'}]\r\n * }]\r\n * to\r\n * [\r\n * {type: 'group', id: 'xx'},\r\n * {type: 'circle', parentId: 'xx'},\r\n * {type: 'polygon', parentId: 'xx'}\r\n * ]\r\n */\n\n\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\n zrUtil.each(optionList, function (option) {\n if (!option) {\n return;\n }\n\n if (parentOption) {\n option.parentOption = parentOption;\n }\n\n result.push(option);\n var children = option.children; // here we don't judge if option.type is `group`\n // when new option doesn't provide `type`, it will cause that the children can't be updated.\n\n if (children && children.length) {\n this._flatten(children, result, option);\n } // Deleting for JSON output, and for not affecting group creation.\n\n\n delete option.children;\n }, this);\n }; // FIXME\n // Pass to view using payload? setOption has a payload?\n\n\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\n var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming.\n\n this._elOptionsToUpdate = null;\n return els;\n };\n\n GraphicComponentModel.type = 'graphic';\n GraphicComponentModel.defaultOption = {\n elements: [] // parentId: null\n\n };\n return GraphicComponentModel;\n}(ComponentModel);\n\nexport { GraphicComponentModel };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat.js';\nimport { applyLeaveTransition, applyUpdateTransition, isTransitionAll, updateLeaveTo } from '../../animation/customGraphicTransition.js';\nimport { updateProps } from '../../animation/basicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar nonShapeGraphicElements = {\n // Reserved but not supported in graphic component.\n path: null,\n compoundPath: null,\n // Supported in graphic component.\n group: graphicUtil.Group,\n image: graphicUtil.Image,\n text: graphicUtil.Text\n};\nexport var inner = modelUtil.makeInner(); // ------------------------\n// View\n// ------------------------\n\nvar GraphicComponentView =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentView, _super);\n\n function GraphicComponentView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentView.type;\n return _this;\n }\n\n GraphicComponentView.prototype.init = function () {\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\n // Having leveraged between use cases and algorithm complexity, a very\n // simple layout mechanism is used:\n // The size(width/height) can be determined by itself or its parent (not\n // implemented yet), but can not by its children. (Top-down travel)\n // The location(x/y) can be determined by the bounding rect of itself\n // (can including its descendants or not) and the size of its parent.\n // (Bottom-up travel)\n // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n // view will be reused.\n if (graphicModel !== this._lastGraphicModel) {\n this._clear();\n }\n\n this._lastGraphicModel = graphicModel;\n\n this._updateElements(graphicModel);\n\n this._relocate(graphicModel, api);\n };\n /**\r\n * Update graphic elements.\r\n */\n\n\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\n\n if (!elOptionsToUpdate) {\n return;\n }\n\n var elMap = this._elMap;\n var rootGroup = this.group;\n var globalZ = graphicModel.get('z');\n var globalZLevel = graphicModel.get('zlevel'); // Top-down tranverse to assign graphic settings to each elements.\n\n zrUtil.each(elOptionsToUpdate, function (elOption) {\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var elExisting = id != null ? elMap.get(id) : null;\n var parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\n var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;\n var elType = elOption.type;\n var elOptionStyle = elOption.style;\n\n if (elType === 'text' && elOptionStyle) {\n // In top/bottom mode, textVerticalAlign should not be used, which cause\n // inaccurately locating.\n if (elOption.hv && elOption.hv[1]) {\n elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;\n }\n }\n\n var textContentOption = elOption.textContent;\n var textConfig = elOption.textConfig;\n\n if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\n\n if (!textConfig && convertResult.textConfig) {\n textConfig = elOption.textConfig = convertResult.textConfig;\n }\n\n if (!textContentOption && convertResult.textContent) {\n textContentOption = convertResult.textContent;\n }\n } // Remove unnecessary props to avoid potential problems.\n\n\n var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed.\n\n if (process.env.NODE_ENV !== 'production') {\n elExisting && zrUtil.assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\n }\n\n var $action = elOption.$action || 'merge';\n var isMerge = $action === 'merge';\n var isReplace = $action === 'replace';\n\n if (isMerge) {\n var isInit = !elExisting;\n var el_1 = elExisting;\n\n if (isInit) {\n el_1 = createEl(id, targetElParent, elOption.type, elMap);\n } else {\n el_1 && (inner(el_1).isNew = false); // Stop and restore before update any other attributes.\n\n stopPreviousKeyframeAnimationAndRestore(el_1);\n }\n\n if (el_1) {\n applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {\n isInit: isInit\n });\n updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);\n }\n } else if (isReplace) {\n removeEl(elExisting, elOption, elMap, graphicModel);\n var el_2 = createEl(id, targetElParent, elOption.type, elMap);\n\n if (el_2) {\n applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {\n isInit: true\n });\n updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);\n }\n } else if ($action === 'remove') {\n updateLeaveTo(elExisting, elOption);\n removeEl(elExisting, elOption, elMap, graphicModel);\n }\n\n var el = elMap.get(id);\n\n if (el && textContentOption) {\n if (isMerge) {\n var textContentExisting = el.getTextContent();\n textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new graphicUtil.Text(textContentOption));\n } else if (isReplace) {\n el.setTextContent(new graphicUtil.Text(textContentOption));\n }\n }\n\n if (el) {\n var clipPathOption = elOption.clipPath;\n\n if (clipPathOption) {\n var clipPathType = clipPathOption.type;\n var clipPath = void 0;\n var isInit = false;\n\n if (isMerge) {\n var oldClipPath = el.getClipPath();\n isInit = !oldClipPath || inner(oldClipPath).type !== clipPathType;\n clipPath = isInit ? newEl(clipPathType) : oldClipPath;\n } else if (isReplace) {\n isInit = true;\n clipPath = newEl(clipPathType);\n }\n\n el.setClipPath(clipPath);\n applyUpdateTransition(clipPath, clipPathOption, graphicModel, {\n isInit: isInit\n });\n applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);\n }\n\n var elInner = inner(el);\n el.setTextConfig(textConfig);\n elInner.option = elOption;\n setEventData(el, graphicModel, elOption);\n graphicUtil.setTooltipConfig({\n el: el,\n componentModel: graphicModel,\n itemName: el.name,\n itemTooltipOption: elOption.tooltip\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);\n }\n });\n };\n /**\r\n * Locate graphic elements.\r\n */\n\n\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\n var elOptions = graphicModel.option.elements;\n var rootGroup = this.group;\n var elMap = this._elMap;\n var apiWidth = api.getWidth();\n var apiHeight = api.getHeight();\n var xy = ['x', 'y']; // Top-down to calculate percentage width/height of group\n\n for (var i = 0; i < elOptions.length; i++) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el || !el.isGroup) {\n continue;\n }\n\n var parentEl = el.parent;\n var isParentRoot = parentEl === rootGroup; // Like 'position:absolut' in css, default 0.\n\n var elInner = inner(el);\n var parentElInner = inner(parentEl);\n elInner.width = parsePercent(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;\n elInner.height = parsePercent(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;\n } // Bottom-up tranvese all elements (consider ec resize) to locate elements.\n\n\n for (var i = elOptions.length - 1; i >= 0; i--) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el) {\n continue;\n }\n\n var parentEl = el.parent;\n var parentElInner = inner(parentEl);\n var containerInfo = parentEl === rootGroup ? {\n width: apiWidth,\n height: apiHeight\n } : {\n width: parentElInner.width,\n height: parentElInner.height\n }; // PENDING\n // Currently, when `bounding: 'all'`, the union bounding rect of the group\n // does not include the rect of [0, 0, group.width, group.height], which\n // is probably weird for users. Should we make a break change for it?\n\n var layoutPos = {};\n var layouted = layoutUtil.positionElement(el, elOption, containerInfo, null, {\n hv: elOption.hv,\n boundingMode: elOption.bounding\n }, layoutPos);\n\n if (!inner(el).isNew && layouted) {\n var transition = elOption.transition;\n var animatePos = {};\n\n for (var k = 0; k < xy.length; k++) {\n var key = xy[k];\n var val = layoutPos[key];\n\n if (transition && (isTransitionAll(transition) || zrUtil.indexOf(transition, key) >= 0)) {\n animatePos[key] = val;\n } else {\n el[key] = val;\n }\n }\n\n updateProps(el, animatePos, graphicModel, 0);\n } else {\n el.attr(layoutPos);\n }\n }\n };\n /**\r\n * Clear all elements.\r\n */\n\n\n GraphicComponentView.prototype._clear = function () {\n var _this = this;\n\n var elMap = this._elMap;\n elMap.each(function (el) {\n removeEl(el, inner(el).option, elMap, _this._lastGraphicModel);\n });\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.dispose = function () {\n this._clear();\n };\n\n GraphicComponentView.type = 'graphic';\n return GraphicComponentView;\n}(ComponentView);\n\nexport { GraphicComponentView };\n\nfunction newEl(graphicType) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(graphicType, 'graphic type MUST be set');\n }\n\n var Clz = zrUtil.hasOwn(nonShapeGraphicElements, graphicType) // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n ? nonShapeGraphicElements[graphicType] : graphicUtil.getShapeClass(graphicType);\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(Clz, \"graphic type \" + graphicType + \" can not be found\");\n }\n\n var el = new Clz({});\n inner(el).type = graphicType;\n return el;\n}\n\nfunction createEl(id, targetElParent, graphicType, elMap) {\n var el = newEl(graphicType);\n targetElParent.add(el);\n elMap.set(id, el);\n inner(el).id = id;\n inner(el).isNew = true;\n return el;\n}\n\nfunction removeEl(elExisting, elOption, elMap, graphicModel) {\n var existElParent = elExisting && elExisting.parent;\n\n if (existElParent) {\n elExisting.type === 'group' && elExisting.traverse(function (el) {\n removeEl(el, elOption, elMap, graphicModel);\n });\n applyLeaveTransition(elExisting, elOption, graphicModel);\n elMap.removeKey(inner(elExisting).id);\n }\n}\n\nfunction updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {\n if (!el.isGroup) {\n zrUtil.each([['cursor', Displayable.prototype.cursor], // We should not support configure z and zlevel in the element level.\n // But seems we didn't limit it previously. So here still use it to avoid breaking.\n ['zlevel', defaultZlevel || 0], ['z', defaultZ || 0], // z2 must not be null/undefined, otherwise sort error may occur.\n ['z2', 0]], function (item) {\n var prop = item[0];\n\n if (zrUtil.hasOwn(elOption, prop)) {\n el[prop] = zrUtil.retrieve2(elOption[prop], item[1]);\n } else if (el[prop] == null) {\n el[prop] = item[1];\n }\n });\n }\n\n zrUtil.each(zrUtil.keys(elOption), function (key) {\n // Assign event handlers.\n // PENDING: should enumerate all event names or use pattern matching?\n if (key.indexOf('on') === 0) {\n var val = elOption[key];\n el[key] = zrUtil.isFunction(val) ? val : null;\n }\n });\n\n if (zrUtil.hasOwn(elOption, 'draggable')) {\n el.draggable = elOption.draggable;\n } // Other attributes\n\n\n elOption.name != null && (el.name = elOption.name);\n elOption.id != null && (el.id = elOption.id);\n} // Remove unnecessary props to avoid potential problems.\n\n\nfunction getCleanedElOption(elOption) {\n elOption = zrUtil.extend({}, elOption);\n zrUtil.each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(layoutUtil.LOCATION_PARAMS), function (name) {\n delete elOption[name];\n });\n return elOption;\n}\n\nfunction setEventData(el, graphicModel, elOption) {\n var eventData = getECData(el).eventData; // Simple optimize for large amount of elements that no need event.\n\n if (!el.silent && !el.ignore && !eventData) {\n eventData = getECData(el).eventData = {\n componentType: 'graphic',\n componentIndex: graphicModel.componentIndex,\n name: el.name\n };\n } // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n\n\n if (eventData) {\n eventData.info = elOption.info;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { GraphicComponentModel } from './GraphicModel.js';\nimport { GraphicComponentView } from './GraphicView.js';\nexport function install(registers) {\n registers.registerComponentModel(GraphicComponentModel);\n registers.registerComponentView(GraphicComponentView);\n registers.registerPreprocessor(function (option) {\n var graphicOption = option.graphic; // Convert\n // {graphic: [{left: 10, type: 'circle'}, ...]}\n // or\n // {graphic: {left: 10, type: 'circle'}}\n // to\n // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\n\n if (isArray(graphicOption)) {\n if (!graphicOption[0] || !graphicOption[0].elements) {\n option.graphic = [{\n elements: graphicOption\n }];\n } else {\n // Only one graphic instance can be instantiated. (We don't\n // want that too many views are created in echarts._viewMap.)\n option.graphic = [option.graphic[0]];\n }\n } else if (graphicOption && !graphicOption.elements) {\n option.graphic = [{\n elements: [graphicOption]\n }];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { indexOf, createHashMap, assert } from 'zrender/lib/core/util.js';\nexport var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single']; // Supported coords.\n// FIXME: polar has been broken (but rarely used).\n\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\nexport function isCoordSupported(seriesModel) {\n var coordType = seriesModel.get('coordinateSystem');\n return indexOf(SERIES_COORDS, coordType) >= 0;\n}\nexport function getAxisMainType(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'Axis';\n}\nexport function getAxisIndexPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisIndex';\n}\nexport function getAxisIdPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisId';\n}\n/**\r\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\r\n * This function finds all linked dataZoomModels start from the given payload.\r\n */\n\nexport function findEffectedDataZooms(ecModel, payload) {\n // Key: `DataZoomAxisDimension`\n var axisRecords = createHashMap();\n var effectedModels = []; // Key: uid of dataZoomModel\n\n var effectedModelMap = createHashMap(); // Find the dataZooms specified by payload.\n\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid)) {\n addToEffected(dataZoomModel);\n }\n }); // Start from the given dataZoomModels, travel the graph to find\n // all of the linked dataZoom models.\n\n var foundNewLink;\n\n do {\n foundNewLink = false;\n ecModel.eachComponent('dataZoom', processSingle);\n } while (foundNewLink);\n\n function processSingle(dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\n addToEffected(dataZoomModel);\n foundNewLink = true;\n }\n }\n\n function addToEffected(dataZoom) {\n effectedModelMap.set(dataZoom.uid, true);\n effectedModels.push(dataZoom);\n markAxisControlled(dataZoom);\n }\n\n function isLinked(dataZoomModel) {\n var isLink = false;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisIdxArr = axisRecords.get(axisDim);\n\n if (axisIdxArr && axisIdxArr[axisIndex]) {\n isLink = true;\n }\n });\n return isLink;\n }\n\n function markAxisControlled(dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\n });\n }\n\n return effectedModels;\n}\n/**\r\n * Find the first target coordinate system.\r\n * Available after model built.\r\n *\r\n * @return Like {\r\n * grid: [\r\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\r\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\r\n * ...\r\n * ], // cartesians must not be null/undefined.\r\n * polar: [\r\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\r\n * ...\r\n * ], // polars must not be null/undefined.\r\n * singleAxis: [\r\n * {model: coord0, axisModels: [], coordIndex: 0}\r\n * ]\r\n * }\r\n */\n\nexport function collectReferCoordSysModelInfo(dataZoomModel) {\n var ecModel = dataZoomModel.ecModel;\n var coordSysInfoWrap = {\n infoList: [],\n infoMap: createHashMap()\n };\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n\n if (!axisModel) {\n return;\n }\n\n var coordSysModel = axisModel.getCoordSysModel();\n\n if (!coordSysModel) {\n return;\n }\n\n var coordSysUid = coordSysModel.uid;\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\n\n if (!coordSysInfo) {\n coordSysInfo = {\n model: coordSysModel,\n axisModels: []\n };\n coordSysInfoWrap.infoList.push(coordSysInfo);\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\n }\n\n coordSysInfo.axisModels.push(axisModel);\n });\n return coordSysInfoWrap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { each, createHashMap, merge, assert } from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS } from './helper.js';\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model.js';\n\nvar DataZoomAxisInfo =\n/** @class */\nfunction () {\n function DataZoomAxisInfo() {\n this.indexList = [];\n this.indexMap = [];\n }\n\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\n // Remove duplication.\n if (!this.indexMap[axisCmptIdx]) {\n this.indexList.push(axisCmptIdx);\n this.indexMap[axisCmptIdx] = true;\n }\n };\n\n return DataZoomAxisInfo;\n}();\n\nvar DataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(DataZoomModel, _super);\n\n function DataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomModel.type;\n _this._autoThrottle = true;\n _this._noTarget = true;\n /**\r\n * It is `[rangeModeForMin, rangeModeForMax]`.\r\n * The optional values for `rangeMode`:\r\n * + `'value'` mode: the axis extent will always be determined by\r\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\r\n * how data like and how `axis.min` and `axis.max` are.\r\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\r\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\r\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\r\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\r\n *\r\n * For example, when users are using dynamic data (update data periodically via `setOption`),\r\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\r\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\r\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\r\n */\n\n _this._rangePropMode = ['percent', 'percent'];\n return _this;\n }\n\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\n var inputRawOption = retrieveRawOption(option);\n /**\r\n * Suppose a \"main process\" start at the point that model prepared (that is,\r\n * model initialized or merged or method called in `action`).\r\n * We should keep the `main process` idempotent, that is, given a set of values\r\n * on `option`, we get the same result.\r\n *\r\n * But sometimes, values on `option` will be updated for providing users\r\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\r\n * should not be the base/input of the `main process`.\r\n *\r\n * So in that case we should save and keep the input of the `main process`\r\n * separately, called `settledOption`.\r\n *\r\n * For example, consider the case:\r\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\r\n * where the original input `option.startValue`, `option.endValue` are earsed by\r\n * calculated value.\r\n * (Step)2) click the legend to hide and show a series,\r\n * where the new range is calculated by the earsed `startValue` and `endValue`,\r\n * which brings incorrect result.\r\n */\n\n this.settledOption = inputRawOption;\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype.mergeOption = function (newOption) {\n var inputRawOption = retrieveRawOption(newOption); // FIX #2591\n\n merge(this.option, newOption, true);\n merge(this.settledOption, inputRawOption, true);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype._doInit = function (inputRawOption) {\n var thisOption = this.option;\n\n this._setDefaultThrottle(inputRawOption);\n\n this._updateRangeUse(inputRawOption);\n\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n // start/end has higher priority over startValue/endValue if they\n // both set, but we should make chart.setOption({endValue: 1000})\n // effective, rather than chart.setOption({endValue: 1000, end: null}).\n if (this._rangePropMode[index] === 'value') {\n thisOption[names[0]] = settledOption[names[0]] = null;\n } // Otherwise do nothing and use the merge result.\n\n }, this);\n\n this._resetTarget();\n };\n\n DataZoomModel.prototype._resetTarget = function () {\n var optionOrient = this.get('orient', true);\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\n\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\n\n if (hasAxisSpecified) {\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\n } else {\n this._orient = optionOrient || 'horizontal';\n\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\n }\n\n this._noTarget = true;\n targetAxisIndexMap.each(function (axisInfo) {\n if (axisInfo.indexList.length) {\n this._noTarget = false;\n }\n }, this);\n };\n\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\n var hasAxisSpecified = false;\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); // When user set axisIndex as a empty array, we think that user specify axisIndex\n // but do not want use auto mode. Because empty array may be encountered when\n // some error occurred.\n\n if (!refering.specified) {\n return;\n }\n\n hasAxisSpecified = true;\n var axisInfo = new DataZoomAxisInfo();\n each(refering.models, function (axisModel) {\n axisInfo.add(axisModel.componentIndex);\n });\n targetAxisIndexMap.set(axisDim, axisInfo);\n }, this);\n return hasAxisSpecified;\n };\n\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\n var ecModel = this.ecModel;\n var needAuto = true; // Find axis that parallel to dataZoom as default.\n\n if (needAuto) {\n var axisDim = orient === 'vertical' ? 'y' : 'x';\n var axisModels = ecModel.findComponents({\n mainType: axisDim + 'Axis'\n });\n setParallelAxis(axisModels, axisDim);\n } // Find axis that parallel to dataZoom as default.\n\n\n if (needAuto) {\n var axisModels = ecModel.findComponents({\n mainType: 'singleAxis',\n filter: function (axisModel) {\n return axisModel.get('orient', true) === orient;\n }\n });\n setParallelAxis(axisModels, 'single');\n }\n\n function setParallelAxis(axisModels, axisDim) {\n // At least use the first parallel axis as the target axis.\n var axisModel = axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModel.componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false; // Find parallel axes in the same grid.\n\n if (axisDim === 'x' || axisDim === 'y') {\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n gridModel_1 && each(axisModels, function (axModel) {\n if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\n axisInfo.add(axModel.componentIndex);\n }\n });\n }\n }\n\n if (needAuto) {\n // If no parallel axis, find the first category axis as default. (Also consider polar).\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n if (!needAuto) {\n return;\n }\n\n var axisModels = ecModel.findComponents({\n mainType: getAxisMainType(axisDim),\n filter: function (axisModel) {\n return axisModel.get('type', true) === 'category';\n }\n });\n\n if (axisModels[0]) {\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModels[0].componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false;\n }\n }, this);\n }\n };\n\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\n var dim; // Find the first axis\n\n this.eachTargetAxis(function (axisDim) {\n !dim && (dim = axisDim);\n }, this);\n return dim === 'y' ? 'vertical' : 'horizontal';\n };\n\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\n // When first time user set throttle, auto throttle ends.\n if (inputRawOption.hasOwnProperty('throttle')) {\n this._autoThrottle = false;\n }\n\n if (this._autoThrottle) {\n var globalOption = this.ecModel.option;\n this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;\n }\n };\n\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\n var rangePropMode = this._rangePropMode;\n var rangeModeInOption = this.get('rangeMode');\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n var percentSpecified = inputRawOption[names[0]] != null;\n var valueSpecified = inputRawOption[names[1]] != null;\n\n if (percentSpecified && !valueSpecified) {\n rangePropMode[index] = 'percent';\n } else if (!percentSpecified && valueSpecified) {\n rangePropMode[index] = 'value';\n } else if (rangeModeInOption) {\n rangePropMode[index] = rangeModeInOption[index];\n } else if (percentSpecified) {\n // percentSpecified && valueSpecified\n rangePropMode[index] = 'percent';\n } // else remain its original setting.\n\n });\n };\n\n DataZoomModel.prototype.noTarget = function () {\n return this._noTarget;\n };\n\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\n var firstAxisModel;\n this.eachTargetAxis(function (axisDim, axisIndex) {\n if (firstAxisModel == null) {\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n }, this);\n return firstAxisModel;\n };\n /**\r\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\r\n */\n\n\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\n each(axisInfo.indexList, function (axisIndex) {\n callback.call(context, axisDim, axisIndex);\n });\n });\n };\n /**\r\n * @return If not found, return null/undefined.\r\n */\n\n\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\n var axisModel = this.getAxisModel(axisDim, axisIndex);\n\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n }\n };\n /**\r\n * @return If not found, return null/undefined.\r\n */\n\n\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim && axisIndex != null);\n }\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n };\n /**\r\n * If not specified, set to undefined.\r\n */\n\n\n DataZoomModel.prototype.setRawRange = function (opt) {\n var thisOption = this.option;\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\n // Consider the pair :\n // If one has value and the other one is `null/undefined`, we both set them\n // to `settledOption`. This strategy enables the feature to clear the original\n // value in `settledOption` to `null/undefined`.\n // But if both of them are `null/undefined`, we do not set them to `settledOption`\n // and keep `settledOption` with the original value. This strategy enables users to\n // only set but not set when calling\n // `dispatchAction`.\n // The pair is treated in the same way.\n if (opt[names[0]] != null || opt[names[1]] != null) {\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\n }\n }, this);\n\n this._updateRangeUse(opt);\n };\n\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\n var option = this.option;\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\n option[name] = opt[name];\n });\n };\n\n DataZoomModel.prototype.getPercentRange = function () {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataPercentWindow();\n }\n };\n /**\r\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\r\n *\r\n * @return [startValue, endValue] value can only be '-' or finite number.\r\n */\n\n\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\n if (axisDim == null && axisIndex == null) {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataValueWindow();\n }\n } else {\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\n }\n };\n /**\r\n * @param axisModel If axisModel given, find axisProxy\r\n * corresponding to the axisModel\r\n */\n\n\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n } // Find the first hosted axisProxy\n\n\n var firstProxy;\n\n var axisDimList = this._targetAxisInfoMap.keys();\n\n for (var i = 0; i < axisDimList.length; i++) {\n var axisDim = axisDimList[i];\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n for (var j = 0; j < axisInfo.indexList.length; j++) {\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\n\n if (proxy.hostedBy(this)) {\n return proxy;\n }\n\n if (!firstProxy) {\n firstProxy = proxy;\n }\n }\n } // If no hosted proxy found, still need to return a proxy.\n // This case always happens in toolbox dataZoom, where axes are all hosted by\n // other dataZooms.\n\n\n return firstProxy;\n };\n\n DataZoomModel.prototype.getRangePropMode = function () {\n return this._rangePropMode.slice();\n };\n\n DataZoomModel.prototype.getOrient = function () {\n if (process.env.NODE_ENV !== 'production') {\n // Should not be called before initialized.\n assert(this._orient);\n }\n\n return this._orient;\n };\n\n DataZoomModel.type = 'dataZoom';\n DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'];\n DataZoomModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n filterMode: 'filter',\n start: 0,\n end: 100\n };\n return DataZoomModel;\n}(ComponentModel);\n/**\r\n * Retrieve those raw params from option, which will be cached separately,\r\n * because they will be overwritten by normalized/calculated values in the main\r\n * process.\r\n */\n\n\nfunction retrieveRawOption(option) {\n var ret = {};\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n}\n\nexport default DataZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\n\nvar SelectDataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomModel, _super);\n\n function SelectDataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomModel.type;\n return _this;\n }\n\n SelectDataZoomModel.type = 'dataZoom.select';\n return SelectDataZoomModel;\n}(DataZoomModel);\n\nexport default SelectDataZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\n\nvar DataZoomView =\n/** @class */\nfunction (_super) {\n __extends(DataZoomView, _super);\n\n function DataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomView.type;\n return _this;\n }\n\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n this.dataZoomModel = dataZoomModel;\n this.ecModel = ecModel;\n this.api = api;\n };\n\n DataZoomView.type = 'dataZoom';\n return DataZoomView;\n}(ComponentView);\n\nexport default DataZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\n\nvar SelectDataZoomView =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomView, _super);\n\n function SelectDataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomView.type;\n return _this;\n }\n\n SelectDataZoomView.type = 'dataZoom.select';\n return SelectDataZoomView;\n}(DataZoomView);\n\nexport default SelectDataZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { unionAxisExtentFromData } from '../../coord/axisHelper.js';\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo.js';\nimport { getAxisMainType, isCoordSupported } from './helper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\n/**\r\n * Operate single axis.\r\n * One axis can only operated by one axis operator.\r\n * Different dataZoomModels may be defined to operate the same axis.\r\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\r\n * So dataZoomModels share one axisProxy in that case.\r\n */\n\nvar AxisProxy =\n/** @class */\nfunction () {\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\n this._dimName = dimName;\n this._axisIndex = axisIndex;\n this.ecModel = ecModel;\n this._dataZoomModel = dataZoomModel; // /**\n // * @readOnly\n // * @private\n // */\n // this.hasSeriesStacked;\n }\n /**\r\n * Whether the axisProxy is hosted by dataZoomModel.\r\n */\n\n\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\n return this._dataZoomModel === dataZoomModel;\n };\n /**\r\n * @return Value can only be NaN or finite value.\r\n */\n\n\n AxisProxy.prototype.getDataValueWindow = function () {\n return this._valueWindow.slice();\n };\n /**\r\n * @return {Array.}\r\n */\n\n\n AxisProxy.prototype.getDataPercentWindow = function () {\n return this._percentWindow.slice();\n };\n\n AxisProxy.prototype.getTargetSeriesModels = function () {\n var seriesModels = [];\n this.ecModel.eachSeries(function (seriesModel) {\n if (isCoordSupported(seriesModel)) {\n var axisMainType = getAxisMainType(this._dimName);\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\n\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\n seriesModels.push(seriesModel);\n }\n }\n }, this);\n return seriesModels;\n };\n\n AxisProxy.prototype.getAxisModel = function () {\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\n };\n\n AxisProxy.prototype.getMinMaxSpan = function () {\n return zrUtil.clone(this._minMaxSpan);\n };\n /**\r\n * Only calculate by given range and this._dataExtent, do not change anything.\r\n */\n\n\n AxisProxy.prototype.calculateDataWindow = function (opt) {\n var dataExtent = this._dataExtent;\n var axisModel = this.getAxisModel();\n var scale = axisModel.axis.scale;\n\n var rangePropMode = this._dataZoomModel.getRangePropMode();\n\n var percentExtent = [0, 100];\n var percentWindow = [];\n var valueWindow = [];\n var hasPropModeValue;\n each(['start', 'end'], function (prop, idx) {\n var boundPercent = opt[prop];\n var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n // but not min/max of axis, which will be calculated by data window then).\n // The former one is suitable for cases that a dataZoom component controls multiple\n // axes with different unit or extent, and the latter one is suitable for accurate\n // zoom by pixel (e.g., in dataZoomSelect).\n // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n // only when setOption or dispatchAction, otherwise it remains its original value.\n // (Why not only record `percentProp` and always map to `valueProp`? Because\n // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n // `valueProp`. consider two axes constrolled by one dataZoom. They have different\n // data extent. All of values that are overflow the `dataExtent` will be calculated\n // to percent '100%').\n\n if (rangePropMode[idx] === 'percent') {\n boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis.\n\n boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));\n } else {\n hasPropModeValue = true;\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because\n // This calculation can not be inversed, because all of values that\n // are overflow the `dataExtent` will be calculated to percent '100%'\n\n boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);\n } // valueWindow[idx] = round(boundValue);\n // percentWindow[idx] = round(boundPercent);\n // fallback to extent start/end when parsed value or percent is invalid\n\n\n valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue;\n percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent;\n });\n asc(valueWindow);\n asc(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent,\n // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window\n // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n // where API is able to initialize/modify the window size even though `zoomLock`\n // specified.\n\n var spans = this._minMaxSpan;\n hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\n\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\n var suffix = toValue ? 'Span' : 'ValueSpan';\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\n\n for (var i = 0; i < 2; i++) {\n toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\n }\n }\n\n return {\n valueWindow: valueWindow,\n percentWindow: percentWindow\n };\n };\n /**\r\n * Notice: reset should not be called before series.restoreData() is called,\r\n * so it is recommended to be called in \"process stage\" but not \"model init\r\n * stage\".\r\n */\n\n\n AxisProxy.prototype.reset = function (dataZoomModel) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them.\n\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // `calculateDataWindow` uses min/maxSpan.\n\n this._updateMinMaxSpan();\n\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\n this._valueWindow = dataWindow.valueWindow;\n this._percentWindow = dataWindow.percentWindow; // Update axis setting then.\n\n this._setAxisModel();\n };\n\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var axisDim = this._dimName;\n var seriesModels = this.getTargetSeriesModels();\n var filterMode = dataZoomModel.get('filterMode');\n var valueWindow = this._valueWindow;\n\n if (filterMode === 'none') {\n return;\n } // FIXME\n // Toolbox may has dataZoom injected. And if there are stacked bar chart\n // with NaN data, NaN will be filtered and stack will be wrong.\n // So we need to force the mode to be set empty.\n // In fect, it is not a big deal that do not support filterMode-'filter'\n // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n // selection\" some day, which might need \"adapt to data extent on the\n // otherAxis\", which is disabled by filterMode-'empty'.\n // But currently, stack has been fixed to based on value but not index,\n // so this is not an issue any more.\n // let otherAxisModel = this.getOtherAxisModel();\n // if (dataZoomModel.get('$fromToolbox')\n // && otherAxisModel\n // && otherAxisModel.hasSeriesStacked\n // ) {\n // filterMode = 'empty';\n // }\n // TODO\n // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\n\n\n each(seriesModels, function (seriesModel) {\n var seriesData = seriesModel.getData();\n var dataDims = seriesData.mapDimensionsAll(axisDim);\n\n if (!dataDims.length) {\n return;\n }\n\n if (filterMode === 'weakFilter') {\n var store_1 = seriesData.getStore();\n var dataDimIndices_1 = zrUtil.map(dataDims, function (dim) {\n return seriesData.getDimensionIndex(dim);\n }, seriesData);\n seriesData.filterSelf(function (dataIndex) {\n var leftOut;\n var rightOut;\n var hasValue;\n\n for (var i = 0; i < dataDims.length; i++) {\n var value = store_1.get(dataDimIndices_1[i], dataIndex);\n var thisHasValue = !isNaN(value);\n var thisLeftOut = value < valueWindow[0];\n var thisRightOut = value > valueWindow[1];\n\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\n return true;\n }\n\n thisHasValue && (hasValue = true);\n thisLeftOut && (leftOut = true);\n thisRightOut && (rightOut = true);\n } // If both left out and right out, do not filter.\n\n\n return hasValue && leftOut && rightOut;\n });\n } else {\n each(dataDims, function (dim) {\n if (filterMode === 'empty') {\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\n return !isInWindow(value) ? NaN : value;\n }));\n } else {\n var range = {};\n range[dim] = valueWindow; // console.time('select');\n\n seriesData.selectRange(range); // console.timeEnd('select');\n }\n });\n }\n\n each(dataDims, function (dim) {\n seriesData.setApproximateExtent(valueWindow, dim);\n });\n });\n\n function isInWindow(value) {\n return value >= valueWindow[0] && value <= valueWindow[1];\n }\n };\n\n AxisProxy.prototype._updateMinMaxSpan = function () {\n var minMaxSpan = this._minMaxSpan = {};\n var dataZoomModel = this._dataZoomModel;\n var dataExtent = this._dataExtent;\n each(['min', 'max'], function (minMax) {\n var percentSpan = dataZoomModel.get(minMax + 'Span');\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\n\n if (valueSpan != null) {\n percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\n } else if (percentSpan != null) {\n valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\n }\n\n minMaxSpan[minMax + 'Span'] = percentSpan;\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\n }, this);\n };\n\n AxisProxy.prototype._setAxisModel = function () {\n var axisModel = this.getAxisModel();\n var percentWindow = this._percentWindow;\n var valueWindow = this._valueWindow;\n\n if (!percentWindow) {\n return;\n } // [0, 500]: arbitrary value, guess axis extent.\n\n\n var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\n precision = Math.min(precision, 20); // For value axis, if min/max/scale are not set, we just use the extent obtained\n // by series data, which may be a little different from the extent calculated by\n // `axisHelper.getScaleExtent`. But the different just affects the experience a\n // little when zooming. So it will not be fixed until some users require it strongly.\n\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\n\n if (percentWindow[0] !== 0) {\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\n }\n\n if (percentWindow[1] !== 100) {\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\n }\n\n rawExtentInfo.freeze();\n };\n\n return AxisProxy;\n}();\n\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\n var dataExtent = [Infinity, -Infinity];\n each(seriesModels, function (seriesModel) {\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\n }); // It is important to get \"consistent\" extent when more then one axes is\n // controlled by a `dataZoom`, otherwise those axes will not be synchronized\n // when zooming. But it is difficult to know what is \"consistent\", considering\n // axes have different type or even different meanings (For example, two\n // time axes are used to compare data of the same date in different years).\n // So basically dataZoom just obtains extent by series.data (in category axis\n // extent can be obtained from axis.data).\n // Nevertheless, user can set min/max/scale on axes to make extent of axes\n // consistent.\n\n var axisModel = axisProxy.getAxisModel();\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\n return [rawExtentResult.min, rawExtentResult.max];\n}\n\nexport default AxisProxy;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { getAxisMainType } from './helper.js';\nimport AxisProxy from './AxisProxy.js';\nvar dataZoomProcessor = {\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n function eachAxisModel(cb) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\n });\n });\n } // FIXME: it brings side-effect to `getTargetSeries`.\n // Prepare axis proxies.\n\n\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // dispose all last axis proxy, in case that some axis are deleted.\n axisModel.__dzAxisProxy = null;\n });\n var proxyList = [];\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // Different dataZooms may constrol the same axis. In that case,\n // an axisProxy serves both of them.\n if (!axisModel.__dzAxisProxy) {\n // Use the first dataZoomModel as the main model of axisProxy.\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\n proxyList.push(axisModel.__dzAxisProxy);\n }\n });\n var seriesModelMap = createHashMap();\n each(proxyList, function (axisProxy) {\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n return seriesModelMap;\n },\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\n }); // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setCalculatedRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n });\n }\n });\n }\n};\nexport default dataZoomProcessor;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { findEffectedDataZooms } from './helper.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport default function installDataZoomAction(registers) {\n registers.registerAction('dataZoom', function (payload, ecModel) {\n var effectedModels = findEffectedDataZooms(ecModel, payload);\n each(effectedModels, function (dataZoomModel) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport dataZoomProcessor from './dataZoomProcessor.js';\nimport installDataZoomAction from './dataZoomAction.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\n installDataZoomAction(registers);\n registers.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SelectZoomModel from './SelectZoomModel.js';\nimport SelectZoomView from './SelectZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SelectZoomModel);\n registers.registerComponentView(SelectZoomView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nvar ToolboxFeature =\n/** @class */\nfunction () {\n function ToolboxFeature() {}\n\n return ToolboxFeature;\n}();\n\nexport { ToolboxFeature };\nvar features = {};\nexport function registerFeature(name, ctor) {\n features[name] = ctor;\n}\nexport function getFeature(name) {\n return features[name];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as featureManager from './featureManager.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar ToolboxModel =\n/** @class */\nfunction (_super) {\n __extends(ToolboxModel, _super);\n\n function ToolboxModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ToolboxModel.type;\n return _this;\n }\n\n ToolboxModel.prototype.optionUpdated = function () {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n var ecModel = this.ecModel;\n zrUtil.each(this.option.feature, function (featureOpt, featureName) {\n var Feature = featureManager.getFeature(featureName);\n\n if (Feature) {\n if (Feature.getDefaultOption) {\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\n }\n\n zrUtil.merge(featureOpt, Feature.defaultOption);\n }\n });\n };\n\n ToolboxModel.type = 'toolbox';\n ToolboxModel.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n ToolboxModel.defaultOption = {\n show: true,\n z: 6,\n // zlevel: 0,\n orient: 'horizontal',\n left: 'right',\n top: 'top',\n // right\n // bottom\n backgroundColor: 'transparent',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemSize: 15,\n itemGap: 8,\n showTitle: true,\n iconStyle: {\n borderColor: '#666',\n color: 'none'\n },\n emphasis: {\n iconStyle: {\n borderColor: '#3E98C5'\n }\n },\n // textStyle: {},\n // feature\n tooltip: {\n show: false,\n position: 'bottom'\n }\n };\n return ToolboxModel;\n}(ComponentModel);\n\nexport default ToolboxModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport { getLayoutRect, box as layoutBox, positionElement } from '../../util/layout.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as graphic from '../../util/graphic.js';\n/**\r\n * Layout list like component.\r\n * It will box layout each items in group of component and then position the whole group in the viewport\r\n * @param {module:zrender/group/Group} group\r\n * @param {module:echarts/model/Component} componentModel\r\n * @param {module:echarts/ExtensionAPI}\r\n */\n\nexport function layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\nexport function makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis } from '../../util/states.js';\nimport Model from '../../model/Model.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as listComponentHelper from '../helper/listComponent.js';\nimport ComponentView from '../../view/Component.js';\nimport { ToolboxFeature, getFeature } from './featureManager.js';\nimport { getUID } from '../../util/component.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\n\nvar ToolboxView =\n/** @class */\nfunction (_super) {\n __extends(ToolboxView, _super);\n\n function ToolboxView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n\n if (!toolboxModel.get('show')) {\n return;\n }\n\n var itemSize = +toolboxModel.get('itemSize');\n var isVertical = toolboxModel.get('orient') === 'vertical';\n var featureOpts = toolboxModel.get('feature') || {};\n var features = this._features || (this._features = {});\n var featureNames = [];\n zrUtil.each(featureOpts, function (opt, name) {\n featureNames.push(name);\n });\n new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute(); // Keep for diff.\n\n this._featureNames = featureNames;\n\n function processFeature(newIndex, oldIndex) {\n var featureName = featureNames[newIndex];\n var oldName = featureNames[oldIndex];\n var featureOpt = featureOpts[featureName];\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\n var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\n\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\n featureOpt.title = payload.newTitle;\n }\n\n if (featureName && !oldName) {\n // Create\n if (isUserFeatureName(featureName)) {\n feature = {\n onclick: featureModel.option.onclick,\n featureName: featureName\n };\n } else {\n var Feature = getFeature(featureName);\n\n if (!Feature) {\n return;\n }\n\n feature = new Feature();\n }\n\n features[featureName] = feature;\n } else {\n feature = features[oldName]; // If feature does not exist.\n\n if (!feature) {\n return;\n }\n }\n\n feature.uid = getUID('toolbox-feature');\n feature.model = featureModel;\n feature.ecModel = ecModel;\n feature.api = api;\n var isToolboxFeature = feature instanceof ToolboxFeature;\n\n if (!featureName && oldName) {\n isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n return;\n }\n\n if (!featureModel.get('show') || isToolboxFeature && feature.unusable) {\n isToolboxFeature && feature.remove && feature.remove(ecModel, api);\n return;\n }\n\n createIconPaths(featureModel, feature, featureName);\n\n featureModel.setIconStatus = function (iconName, status) {\n var option = this.option;\n var iconPaths = this.iconPaths;\n option.iconStatus = option.iconStatus || {};\n option.iconStatus[iconName] = status;\n\n if (iconPaths[iconName]) {\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\n }\n };\n\n if (feature instanceof ToolboxFeature) {\n if (feature.render) {\n feature.render(featureModel, ecModel, api, payload);\n }\n }\n }\n\n function createIconPaths(featureModel, feature, featureName) {\n var iconStyleModel = featureModel.getModel('iconStyle');\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); // If one feature has multiple icons, they are organized as\n // {\n // icon: {\n // foo: '',\n // bar: ''\n // },\n // title: {\n // foo: '',\n // bar: ''\n // }\n // }\n\n var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon');\n var titles = featureModel.get('title') || {};\n var iconsMap;\n var titlesMap;\n\n if (zrUtil.isString(icons)) {\n iconsMap = {};\n iconsMap[featureName] = icons;\n } else {\n iconsMap = icons;\n }\n\n if (zrUtil.isString(titles)) {\n titlesMap = {};\n titlesMap[featureName] = titles;\n } else {\n titlesMap = titles;\n }\n\n var iconPaths = featureModel.iconPaths = {};\n zrUtil.each(iconsMap, function (iconStr, iconName) {\n var path = graphic.createIcon(iconStr, {}, {\n x: -itemSize / 2,\n y: -itemSize / 2,\n width: itemSize,\n height: itemSize\n }); // TODO handling image\n\n path.setStyle(iconStyleModel.getItemStyle());\n var pathEmphasisState = path.ensureState('emphasis');\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); // Text position calculation\n\n var textContent = new ZRText({\n style: {\n text: titlesMap[iconName],\n align: iconStyleEmphasisModel.get('textAlign'),\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\n padding: iconStyleEmphasisModel.get('textPadding'),\n fill: null\n },\n ignore: true\n });\n path.setTextContent(textContent);\n graphic.setTooltipConfig({\n el: path,\n componentModel: toolboxModel,\n itemName: iconName,\n formatterParamsExtra: {\n title: titlesMap[iconName]\n }\n });\n path.__title = titlesMap[iconName];\n path.on('mouseover', function () {\n // Should not reuse above hoverStyle, which might be modified.\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\n var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top';\n textContent.setStyle({\n fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\n });\n path.setTextConfig({\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\n });\n textContent.ignore = !toolboxModel.get('showTitle'); // Use enterEmphasis and leaveEmphasis provide by ec.\n // There are flags managed by the echarts.\n\n api.enterEmphasis(this);\n }).on('mouseout', function () {\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\n api.leaveEmphasis(this);\n }\n\n textContent.hide();\n });\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\n group.add(path);\n path.on('click', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName));\n iconPaths[iconName] = path;\n });\n }\n\n listComponentHelper.layout(group, toolboxModel, api); // Render background after group is layout\n // FIXME\n\n group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen\n\n isVertical || group.eachChild(function (icon) {\n var titleText = icon.__title; // const hoverStyle = icon.hoverStyle;\n // TODO simplify code?\n\n var emphasisState = icon.ensureState('emphasis');\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\n var textContent = icon.getTextContent();\n var emphasisTextState = textContent && textContent.ensureState('emphasis'); // May be background element\n\n if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\n var rect = textContain.getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\n var offsetX = icon.x + group.x;\n var offsetY = icon.y + group.y + itemSize;\n var needPutOnTop = false;\n\n if (offsetY + rect.height > api.getHeight()) {\n emphasisTextConfig.position = 'top';\n needPutOnTop = true;\n }\n\n var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;\n\n if (offsetX + rect.width / 2 > api.getWidth()) {\n emphasisTextConfig.position = ['100%', topOffset];\n emphasisTextStyle.align = 'right';\n } else if (offsetX - rect.width / 2 < 0) {\n emphasisTextConfig.position = [0, topOffset];\n emphasisTextStyle.align = 'left';\n }\n }\n });\n };\n\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\n });\n }; // updateLayout(toolboxModel, ecModel, api, payload) {\n // zrUtil.each(this._features, function (feature) {\n // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n // });\n // },\n\n\n ToolboxView.prototype.remove = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);\n });\n this.group.removeAll();\n };\n\n ToolboxView.prototype.dispose = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n });\n };\n\n ToolboxView.type = 'toolbox';\n return ToolboxView;\n}(ComponentView);\n\nfunction isUserFeatureName(featureName) {\n return featureName.indexOf('my') === 0;\n}\n\nexport default ToolboxView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Uint8Array, document */\n\nimport env from 'zrender/lib/core/env.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n/* global window, document */\n\nvar SaveAsImage =\n/** @class */\nfunction (_super) {\n __extends(SaveAsImage, _super);\n\n function SaveAsImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n SaveAsImage.prototype.onclick = function (ecModel, api) {\n var model = this.model;\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\n var isSvg = api.getZr().painter.getType() === 'svg';\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\n var url = api.getConnectedDataURL({\n type: type,\n backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\n excludeComponents: model.get('excludeComponents'),\n pixelRatio: model.get('pixelRatio')\n });\n var browser = env.browser; // Chrome, Firefox, New Edge\n\n if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) {\n var $a = document.createElement('a');\n $a.download = title + '.' + type;\n $a.target = '_blank';\n $a.href = url;\n var evt = new MouseEvent('click', {\n // some micro front-end framework, window maybe is a Proxy\n view: document.defaultView,\n bubbles: true,\n cancelable: false\n });\n $a.dispatchEvent(evt);\n } // IE or old Edge\n else {\n // @ts-ignore\n if (window.navigator.msSaveOrOpenBlob || isSvg) {\n var parts = url.split(','); // data:[][;charset=][;base64],\n\n var base64Encoded = parts[0].indexOf('base64') > -1;\n var bstr = isSvg // should decode the svg data uri first\n ? decodeURIComponent(parts[1]) : parts[1]; // only `atob` when the data uri is encoded with base64\n // otherwise, like `svg` data uri exported by zrender,\n // there will be an error, for it's not encoded with base64.\n // (just a url-encoded string through `encodeURIComponent`)\n\n base64Encoded && (bstr = window.atob(bstr));\n var filename = title + '.' + type; // @ts-ignore\n\n if (window.navigator.msSaveOrOpenBlob) {\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n var blob = new Blob([u8arr]); // @ts-ignore\n\n window.navigator.msSaveOrOpenBlob(blob, filename);\n } else {\n var frame = document.createElement('iframe');\n document.body.appendChild(frame);\n var cw = frame.contentWindow;\n var doc = cw.document;\n doc.open('image/svg+xml', 'replace');\n doc.write(bstr);\n doc.close();\n cw.focus();\n doc.execCommand('SaveAs', true, filename);\n document.body.removeChild(frame);\n }\n } else {\n var lang = model.get('lang');\n var html = '' + '' + '' + '';\n var tab = window.open();\n tab.document.write(html);\n tab.document.title = title;\n }\n }\n };\n\n SaveAsImage.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']),\n type: 'png',\n // Default use option.backgroundColor\n // backgroundColor: '#fff',\n connectedBackgroundColor: '#fff',\n name: '',\n excludeComponents: ['toolbox'],\n // use current pixel ratio of device by default\n // pixelRatio: 1,\n lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang'])\n };\n return defaultOption;\n };\n\n return SaveAsImage;\n}(ToolboxFeature);\n\nexport default SaveAsImage;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { SINGLE_REFERRING } from '../../../util/model.js';\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\nvar ICON_TYPES = ['line', 'bar', 'stack']; // stack and tiled appears in pair for the title\n\nvar TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'];\nvar radioTypes = [['line', 'bar'], ['stack']];\n\nvar MagicType =\n/** @class */\nfunction (_super) {\n __extends(MagicType, _super);\n\n function MagicType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n MagicType.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon');\n var icons = {};\n zrUtil.each(model.get('type'), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n MagicType.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: [],\n // Icon group\n icon: {\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\n // eslint-disable-next-line\n 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\n\n },\n // `line`, `bar`, `stack`, `tiled`\n title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']),\n option: {},\n seriesIndex: {}\n };\n return defaultOption;\n };\n\n MagicType.prototype.onclick = function (ecModel, api, type) {\n var model = this.model;\n var seriesIndex = model.get(['seriesIndex', type]); // Not supported magicType\n\n if (!seriesOptGenreator[type]) {\n return;\n }\n\n var newOption = {\n series: []\n };\n\n var generateNewSeriesTypes = function (seriesModel) {\n var seriesType = seriesModel.subType;\n var seriesId = seriesModel.id;\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\n\n if (newSeriesOpt) {\n // PENDING If merge original option?\n zrUtil.defaults(newSeriesOpt, seriesModel.option);\n newOption.series.push(newSeriesOpt);\n } // Modify boundaryGap\n\n\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (categoryAxis) {\n var axisDim = categoryAxis.dim;\n var axisType = axisDim + 'Axis';\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n var axisIndex = axisModel.componentIndex;\n newOption[axisType] = newOption[axisType] || [];\n\n for (var i = 0; i <= axisIndex; i++) {\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\n }\n\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\n }\n }\n };\n\n zrUtil.each(radioTypes, function (radio) {\n if (zrUtil.indexOf(radio, type) >= 0) {\n zrUtil.each(radio, function (item) {\n model.setIconStatus(item, 'normal');\n });\n }\n });\n model.setIconStatus(type, 'emphasis');\n ecModel.eachComponent({\n mainType: 'series',\n query: seriesIndex == null ? null : {\n seriesIndex: seriesIndex\n }\n }, generateNewSeriesTypes);\n var newTitle;\n var currentType = type; // Change title of stack\n\n if (type === 'stack') {\n // use titles in model instead of ecModel\n // as stack and tiled appears in pair, just flip them\n // no need of checking stack state\n newTitle = zrUtil.merge({\n stack: model.option.title.tiled,\n tiled: model.option.title.stack\n }, model.option.title);\n\n if (model.get(['iconStatus', type]) !== 'emphasis') {\n currentType = 'tiled';\n }\n }\n\n api.dispatchAction({\n type: 'changeMagicType',\n currentType: currentType,\n newOption: newOption,\n newTitle: newTitle,\n featureName: 'magicType'\n });\n };\n\n return MagicType;\n}(ToolboxFeature);\n\nvar seriesOptGenreator = {\n 'line': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'bar') {\n return zrUtil.merge({\n id: seriesId,\n type: 'line',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'line']) || {}, true);\n }\n },\n 'bar': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'line') {\n return zrUtil.merge({\n id: seriesId,\n type: 'bar',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'bar']) || {}, true);\n }\n },\n 'stack': function (seriesType, seriesId, seriesModel, model) {\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\n\n if (seriesType === 'line' || seriesType === 'bar') {\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\n return zrUtil.merge({\n id: seriesId,\n stack: isStack ? '' : INNER_STACK_KEYWORD\n }, model.get(['option', 'stack']) || {}, true);\n }\n }\n}; // TODO: SELF REGISTERED.\n\necharts.registerAction({\n type: 'changeMagicType',\n event: 'magicTypeChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.mergeOption(payload.newOption);\n});\nexport default MagicType;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global document */\n\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { addEventListener } from 'zrender/lib/core/event.js';\nimport { warn } from '../../../util/log.js';\n/* global document */\n\nvar BLOCK_SPLITER = new Array(60).join('-');\nvar ITEM_SPLITER = '\\t';\n/**\r\n * Group series into two types\r\n * 1. on category axis, like line, bar\r\n * 2. others, like scatter, pie\r\n */\n\nfunction groupSeries(ecModel) {\n var seriesGroupByCategoryAxis = {};\n var otherSeries = [];\n var meta = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\n // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\n var baseAxis = coordSys.getBaseAxis();\n\n if (baseAxis.type === 'category') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n\n if (!seriesGroupByCategoryAxis[key]) {\n seriesGroupByCategoryAxis[key] = {\n categoryAxis: baseAxis,\n valueAxis: coordSys.getOtherAxis(baseAxis),\n series: []\n };\n meta.push({\n axisDim: baseAxis.dim,\n axisIndex: baseAxis.index\n });\n }\n\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\n } else {\n otherSeries.push(seriesModel);\n }\n } else {\n otherSeries.push(seriesModel);\n }\n });\n return {\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\n other: otherSeries,\n meta: meta\n };\n}\n/**\r\n * Assemble content of series on cateogory axis\r\n * @inner\r\n */\n\n\nfunction assembleSeriesWithCategoryAxis(groups) {\n var tables = [];\n zrUtil.each(groups, function (group, key) {\n var categoryAxis = group.categoryAxis;\n var valueAxis = group.valueAxis;\n var valueAxisDim = valueAxis.dim;\n var headers = [' '].concat(zrUtil.map(group.series, function (series) {\n return series.name;\n })); // @ts-ignore TODO Polar\n\n var columns = [categoryAxis.model.getCategories()];\n zrUtil.each(group.series, function (series) {\n var rawData = series.getRawData();\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\n return val;\n }));\n }); // Assemble table content\n\n var lines = [headers.join(ITEM_SPLITER)];\n\n for (var i = 0; i < columns[0].length; i++) {\n var items = [];\n\n for (var j = 0; j < columns.length; j++) {\n items.push(columns[j][i]);\n }\n\n lines.push(items.join(ITEM_SPLITER));\n }\n\n tables.push(lines.join('\\n'));\n });\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n/**\r\n * Assemble content of other series\r\n */\n\n\nfunction assembleOtherSeries(series) {\n return zrUtil.map(series, function (series) {\n var data = series.getRawData();\n var lines = [series.name];\n var vals = [];\n data.each(data.dimensions, function () {\n var argLen = arguments.length;\n var dataIndex = arguments[argLen - 1];\n var name = data.getName(dataIndex);\n\n for (var i = 0; i < argLen - 1; i++) {\n vals[i] = arguments[i];\n }\n\n lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER));\n });\n return lines.join('\\n');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n\nfunction getContentFromModel(ecModel) {\n var result = groupSeries(ecModel);\n return {\n value: zrUtil.filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) {\n return !!str.replace(/[\\n\\t\\s]/g, '');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\n meta: result.meta\n };\n}\n\nfunction trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}\n/**\r\n * If a block is tsv format\r\n */\n\n\nfunction isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n}\n\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\n/**\r\n * @param {string} tsv\r\n * @return {Object}\r\n */\n\nfunction parseTSVContents(tsv) {\n var tsvLines = tsv.split(/\\n+/g);\n var headers = trim(tsvLines.shift()).split(itemSplitRegex);\n var categories = [];\n var series = zrUtil.map(headers, function (header) {\n return {\n name: header,\n data: []\n };\n });\n\n for (var i = 0; i < tsvLines.length; i++) {\n var items = trim(tsvLines[i]).split(itemSplitRegex);\n categories.push(items.shift());\n\n for (var j = 0; j < items.length; j++) {\n series[j] && (series[j].data[i] = items[j]);\n }\n }\n\n return {\n series: series,\n categories: categories\n };\n}\n\nfunction parseListContents(str) {\n var lines = str.split(/\\n+/g);\n var seriesName = trim(lines.shift());\n var data = [];\n\n for (var i = 0; i < lines.length; i++) {\n // if line is empty, ignore it.\n // there is a case that a user forgot to delete `\\n`.\n var line = trim(lines[i]);\n\n if (!line) {\n continue;\n }\n\n var items = line.split(itemSplitRegex);\n var name_1 = '';\n var value = void 0;\n var hasName = false;\n\n if (isNaN(items[0])) {\n // First item is name\n hasName = true;\n name_1 = items[0];\n items = items.slice(1);\n data[i] = {\n name: name_1,\n value: []\n };\n value = data[i].value;\n } else {\n value = data[i] = [];\n }\n\n for (var j = 0; j < items.length; j++) {\n value.push(+items[j]);\n }\n\n if (value.length === 1) {\n hasName ? data[i].value = value[0] : data[i] = value[0];\n }\n }\n\n return {\n name: seriesName,\n data: data\n };\n}\n\nfunction parseContents(str, blockMetaList) {\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\n var newOption = {\n series: []\n };\n zrUtil.each(blocks, function (block, idx) {\n if (isTSVFormat(block)) {\n var result = parseTSVContents(block);\n var blockMeta = blockMetaList[idx];\n var axisKey = blockMeta.axisDim + 'Axis';\n\n if (blockMeta) {\n newOption[axisKey] = newOption[axisKey] || [];\n newOption[axisKey][blockMeta.axisIndex] = {\n data: result.categories\n };\n newOption.series = newOption.series.concat(result.series);\n }\n } else {\n var result = parseListContents(block);\n newOption.series.push(result);\n }\n });\n return newOption;\n}\n\nvar DataView =\n/** @class */\nfunction (_super) {\n __extends(DataView, _super);\n\n function DataView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataView.prototype.onclick = function (ecModel, api) {\n // FIXME: better way?\n setTimeout(function () {\n api.dispatchAction({\n type: 'hideTip'\n });\n });\n var container = api.getDom();\n var model = this.model;\n\n if (this._dom) {\n container.removeChild(this._dom);\n }\n\n var root = document.createElement('div'); // use padding to avoid 5px whitespace\n\n root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px';\n root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements\n\n var header = document.createElement('h4');\n var lang = model.get('lang') || [];\n header.innerHTML = lang[0] || model.get('title');\n header.style.cssText = 'margin:10px 20px';\n header.style.color = model.get('textColor');\n var viewMain = document.createElement('div');\n var textarea = document.createElement('textarea');\n viewMain.style.cssText = 'overflow:auto';\n var optionToContent = model.get('optionToContent');\n var contentToOption = model.get('contentToOption');\n var result = getContentFromModel(ecModel);\n\n if (zrUtil.isFunction(optionToContent)) {\n var htmlOrDom = optionToContent(api.getOption());\n\n if (zrUtil.isString(htmlOrDom)) {\n viewMain.innerHTML = htmlOrDom;\n } else if (zrUtil.isDom(htmlOrDom)) {\n viewMain.appendChild(htmlOrDom);\n }\n } else {\n // Use default textarea\n textarea.readOnly = model.get('readOnly');\n var style = textarea.style; // eslint-disable-next-line max-len\n\n style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none';\n style.color = model.get('textColor');\n style.borderColor = model.get('textareaBorderColor');\n style.backgroundColor = model.get('textareaColor');\n textarea.value = result.value;\n viewMain.appendChild(textarea);\n }\n\n var blockMetaList = result.meta;\n var buttonContainer = document.createElement('div');\n buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0'; // eslint-disable-next-line max-len\n\n var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\n var closeButton = document.createElement('div');\n var refreshButton = document.createElement('div');\n buttonStyle += ';background-color:' + model.get('buttonColor');\n buttonStyle += ';color:' + model.get('buttonTextColor');\n var self = this;\n\n function close() {\n container.removeChild(root);\n self._dom = null;\n }\n\n addEventListener(closeButton, 'click', close);\n addEventListener(refreshButton, 'click', function () {\n if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\n }\n\n close();\n return;\n }\n\n var newOption;\n\n try {\n if (zrUtil.isFunction(contentToOption)) {\n newOption = contentToOption(viewMain, api.getOption());\n } else {\n newOption = parseContents(textarea.value, blockMetaList);\n }\n } catch (e) {\n close();\n throw new Error('Data view format error ' + e);\n }\n\n if (newOption) {\n api.dispatchAction({\n type: 'changeDataView',\n newOption: newOption\n });\n }\n\n close();\n });\n closeButton.innerHTML = lang[1];\n refreshButton.innerHTML = lang[2];\n refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\n buttonContainer.appendChild(closeButton);\n root.appendChild(header);\n root.appendChild(viewMain);\n root.appendChild(buttonContainer);\n viewMain.style.height = container.clientHeight - 80 + 'px';\n container.appendChild(root);\n this._dom = root;\n };\n\n DataView.prototype.remove = function (ecModel, api) {\n this._dom && api.getDom().removeChild(this._dom);\n };\n\n DataView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n DataView.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n readOnly: false,\n optionToContent: null,\n contentToOption: null,\n // eslint-disable-next-line\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']),\n lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']),\n backgroundColor: '#fff',\n textColor: '#000',\n textareaColor: '#fff',\n textareaBorderColor: '#333',\n buttonColor: '#c23531',\n buttonTextColor: '#fff'\n };\n return defaultOption;\n };\n\n return DataView;\n}(ToolboxFeature);\n/**\r\n * @inner\r\n */\n\n\nfunction tryMergeDataOption(newData, originalData) {\n return zrUtil.map(newData, function (newVal, idx) {\n var original = originalData && originalData[idx];\n\n if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\n var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\n\n if (!newValIsObject) {\n newVal = {\n value: newVal\n };\n } // original data has name but new data has no name\n\n\n var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option\n\n newVal = zrUtil.defaults(newVal, original);\n shouldDeleteName && delete newVal.name;\n return newVal;\n } else {\n return newVal;\n }\n });\n} // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'changeDataView',\n event: 'dataViewChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n var newSeriesOptList = [];\n zrUtil.each(payload.newOption.series, function (seriesOpt) {\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\n\n if (!seriesModel) {\n // New created series\n // Geuss the series type\n newSeriesOptList.push(zrUtil.extend({\n // Default is scatter\n type: 'scatter'\n }, seriesOpt));\n } else {\n var originalData = seriesModel.get('data');\n newSeriesOptList.push({\n name: seriesOpt.name,\n data: tryMergeDataOption(seriesOpt.data, originalData)\n });\n }\n });\n ecModel.mergeOption(zrUtil.defaults({\n series: newSeriesOptList\n }, payload.newOption));\n});\nexport default DataView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\r\n * @param ecModel\r\n * @param newSnapshot key is dataZoomId\r\n */\n\nexport function push(ecModel, newSnapshot) {\n var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = storedSnapshots.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = storedSnapshots[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n storedSnapshots[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n var head = storedSnapshots[storedSnapshots.length - 1];\n storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n batchItem = storedSnapshots[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\nexport function clear(ecModel) {\n inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n return getStoreSnapshots(ecModel).length;\n}\n/**\r\n * History length of each dataZoom may be different.\r\n * this._history[0] is used to store origin range.\r\n */\n\nfunction getStoreSnapshots(ecModel) {\n var store = inner(ecModel);\n\n if (!store.snapshots) {\n store.snapshots = [{}];\n }\n\n return store.snapshots;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as history from '../../dataZoom/history.js';\nimport { ToolboxFeature } from '../featureManager.js';\n\nvar RestoreOption =\n/** @class */\nfunction (_super) {\n __extends(RestoreOption, _super);\n\n function RestoreOption() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n RestoreOption.prototype.onclick = function (ecModel, api) {\n history.clear(ecModel);\n api.dispatchAction({\n type: 'restore',\n from: this.uid\n });\n };\n\n RestoreOption.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n // eslint-disable-next-line\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title'])\n };\n return defaultOption;\n };\n\n return RestoreOption;\n}(ToolboxFeature); // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'restore',\n event: 'restore',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.resetOption('recreate');\n});\nexport default RestoreOption;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as brushHelper from './brushHelper.js';\nimport { parseFinder as modelUtilParseFinder } from '../../util/model.js'; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n\nvar BrushTargetManager =\n/** @class */\nfunction () {\n /**\r\n * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\r\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\r\n * @param opt.include include coordinate system types.\r\n */\n function BrushTargetManager(finder, ecModel, opt) {\n var _this = this;\n\n this._targetInfoList = [];\n var foundCpts = parseFinder(ecModel, finder);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, _this._targetInfoList);\n }\n });\n }\n\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n return areas;\n };\n\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range, true);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n };\n /**\r\n * the `areas` is `BrushModel.areas`.\r\n * Called in layout stage.\r\n * convert `area.coordRange` to global range and set panelId to `area.range`.\r\n */\n\n\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\n }\n\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range should always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n };\n\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\n return map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n };\n\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n };\n /**\r\n * If return Object, a coord found.\r\n * If return true, global found.\r\n * Otherwise nothing found.\r\n */\n\n\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var j = 0; j < targetInfoMatchers.length; j++) {\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n };\n\n return BrushTargetManager;\n}();\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, finder) {\n return modelUtilParseFinder(ecModel, finder, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilders.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilders.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilders = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.master.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);\n var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = map(rangeOrCoordRange, function (item) {\n var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n if (process.env.NODE_ENV !== 'production') {\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\n }\n\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n 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]]];\n },\n polygon: function (values, refer, scales) {\n return map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n// Return [0~1, 0~1]\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nexport default BrushTargetManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO depends on DataZoom and Brush\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../../helper/BrushController.js';\nimport BrushTargetManager from '../../helper/BrushTargetManager.js';\nimport * as history from '../../dataZoom/history.js';\nimport sliderMove from '../../helper/sliderMove.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { makeInternalComponentId, parseFinder } from '../../../util/model.js';\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator.js';\nvar each = zrUtil.each;\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\nvar ICON_TYPES = ['zoom', 'back'];\n\nvar DataZoomFeature =\n/** @class */\nfunction (_super) {\n __extends(DataZoomFeature, _super);\n\n function DataZoomFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\n if (!this._brushController) {\n this._brushController = new BrushController(api.getZr());\n\n this._brushController.on('brush', zrUtil.bind(this._onBrush, this)).mount();\n }\n\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\n updateBackBtnStatus(featureModel, ecModel);\n };\n\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\n handlers[type].call(this);\n };\n\n DataZoomFeature.prototype.remove = function (ecModel, api) {\n this._brushController && this._brushController.unmount();\n };\n\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\n this._brushController && this._brushController.dispose();\n };\n\n DataZoomFeature.prototype._onBrush = function (eventParam) {\n var areas = eventParam.areas;\n\n if (!eventParam.isEnd || !areas.length) {\n return;\n }\n\n var snapshot = {};\n var ecModel = this.ecModel;\n\n this._brushController.updateCovers([]); // remove cover\n\n\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {\n include: ['grid']\n });\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n if (coordSys.type !== 'cartesian2d') {\n return;\n }\n\n var brushType = area.brushType;\n\n if (brushType === 'rect') {\n setBatch('x', coordSys, coordRange[0]);\n setBatch('y', coordSys, coordRange[1]);\n } else {\n setBatch({\n lineX: 'x',\n lineY: 'y'\n }[brushType], coordSys, coordRange);\n }\n });\n history.push(ecModel, snapshot);\n\n this._dispatchZoomAction(snapshot);\n\n function setBatch(dimName, coordSys, minMax) {\n var axis = coordSys.getAxis(dimName);\n var axisModel = axis.model;\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range.\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\n\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\n }\n\n dataZoomModel && (snapshot[dataZoomModel.id] = {\n dataZoomId: dataZoomModel.id,\n startValue: minMax[0],\n endValue: minMax[1]\n });\n }\n\n function findDataZoom(dimName, axisModel, ecModel) {\n var found;\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'select'\n }, function (dzModel) {\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\n has && (found = dzModel);\n });\n return found;\n }\n };\n\n ;\n\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\n var batch = []; // Convert from hash map to array.\n\n each(snapshot, function (batchItem, dataZoomId) {\n batch.push(zrUtil.clone(batchItem));\n });\n batch.length && this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n batch: batch\n });\n };\n\n DataZoomFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n filterMode: 'filter',\n // Icon group\n icon: {\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\n },\n // `zoom`, `back`\n title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']),\n brushStyle: {\n borderWidth: 0,\n color: 'rgba(210,219,238,0.2)'\n }\n };\n return defaultOption;\n };\n\n return DataZoomFeature;\n}(ToolboxFeature);\n\nvar handlers = {\n zoom: function () {\n var nextActive = !this._isZoomActive;\n this.api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: nextActive\n });\n },\n back: function () {\n this._dispatchZoomAction(history.pop(this.ecModel));\n }\n};\n\nfunction makeAxisFinder(dzFeatureModel) {\n var setting = {\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\n xAxisId: dzFeatureModel.get('xAxisId', true),\n yAxisId: dzFeatureModel.get('yAxisId', true)\n }; // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\n // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\n // Some old cases set like this below to close yAxis control but leave xAxis control:\n // `{ feature: { dataZoom: { yAxisIndex: false } }`.\n\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\n setting.xAxisIndex = 'all';\n }\n\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\n setting.yAxisIndex = 'all';\n }\n\n return setting;\n}\n\nfunction updateBackBtnStatus(featureModel, ecModel) {\n featureModel.setIconStatus('back', history.count(ecModel) > 1 ? 'emphasis' : 'normal');\n}\n\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\n var zoomActive = view._isZoomActive;\n\n if (payload && payload.type === 'takeGlobalCursor') {\n zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false;\n }\n\n view._isZoomActive = zoomActive;\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {\n include: ['grid']\n });\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\n return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';\n });\n\n view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {\n brushType: 'auto',\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\n } : false);\n}\n\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\n var toolboxModel = ecModel.getComponent('toolbox', 0);\n var featureDataZoomPath = ['feature', 'dataZoom'];\n\n if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {\n return;\n }\n\n var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);\n var dzOptions = [];\n var finder = makeAxisFinder(dzFeatureModel);\n var finderResult = parseFinder(ecModel, finder);\n each(finderResult.xAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex');\n });\n each(finderResult.yAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex');\n });\n\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\n var axisIndex = axisModel.componentIndex;\n var newOpt = {\n type: 'select',\n $fromToolbox: true,\n // Default to be filter\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\n // Id for merge mapping.\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\n };\n newOpt[axisIndexPropName] = axisIndex;\n dzOptions.push(newOpt);\n }\n\n return dzOptions;\n});\nexport default DataZoomFeature;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect.js';\nimport ToolboxModel from './ToolboxModel.js';\nimport ToolboxView from './ToolboxView.js'; // TODOD: REGISTER IN INSTALL\n\nimport { registerFeature } from './featureManager.js';\nimport SaveAsImage from './feature/SaveAsImage.js';\nimport MagicType from './feature/MagicType.js';\nimport DataView from './feature/DataView.js';\nimport Restore from './feature/Restore.js';\nimport DataZoom from './feature/DataZoom.js';\nexport function install(registers) {\n registers.registerComponentModel(ToolboxModel);\n registers.registerComponentView(ToolboxView);\n registerFeature('saveAsImage', SaveAsImage);\n registerFeature('magicType', MagicType);\n registerFeature('dataView', DataView);\n registerFeature('dataZoom', DataZoom);\n registerFeature('restore', Restore);\n use(installDataZoomSelect);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar TooltipModel =\n/** @class */\nfunction (_super) {\n __extends(TooltipModel, _super);\n\n function TooltipModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipModel.type;\n return _this;\n }\n\n TooltipModel.type = 'tooltip';\n TooltipModel.dependencies = ['axisPointer'];\n TooltipModel.defaultOption = {\n // zlevel: 0,\n z: 60,\n show: true,\n // tooltip main content\n showContent: true,\n // 'trigger' only works on coordinate system.\n // 'item' | 'axis' | 'none'\n trigger: 'item',\n // 'click' | 'mousemove' | 'none'\n triggerOn: 'mousemove|click',\n alwaysShowContent: false,\n displayMode: 'single',\n renderMode: 'auto',\n // whether restraint content inside viewRect.\n // If renderMode: 'richText', default true.\n // If renderMode: 'html', defaut false (for backward compat).\n confine: null,\n showDelay: 0,\n hideDelay: 100,\n // Animation transition time, unit is second\n transitionDuration: 0.4,\n enterable: false,\n backgroundColor: '#fff',\n // box shadow\n shadowBlur: 10,\n shadowColor: 'rgba(0, 0, 0, .2)',\n shadowOffsetX: 1,\n shadowOffsetY: 2,\n // tooltip border radius, unit is px, default is 4\n borderRadius: 4,\n // tooltip border width, unit is px, default is 0 (no border)\n borderWidth: 1,\n // Tooltip inside padding, default is 5 for all direction\n // Array is allowed to set up, right, bottom, left, same with css\n // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\n padding: null,\n // Extra css text\n extraCssText: '',\n // axis indicator, trigger by axis\n axisPointer: {\n // default is line\n // legal values: 'line' | 'shadow' | 'cross'\n type: 'line',\n // Valid when type is line, appoint tooltip line locate on which line. Optional\n // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\n // default is 'auto', chose the axis which type is category.\n // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\n axis: 'auto',\n animation: 'auto',\n animationDurationUpdate: 200,\n animationEasingUpdate: 'exponentialOut',\n crossStyle: {\n color: '#999',\n width: 1,\n type: 'dashed',\n // TODO formatter\n textStyle: {}\n } // lineStyle and shadowStyle should not be specified here,\n // otherwise it will always override those styles on option.axisPointer.\n\n },\n textStyle: {\n color: '#666',\n fontSize: 14\n }\n };\n return TooltipModel;\n}(ComponentModel);\n\nexport default TooltipModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { toCamelCase } from '../../util/format.js';\nimport env from 'zrender/lib/core/env.js';\n/* global document */\n\nexport function shouldTooltipConfine(tooltipModel) {\n var confineOption = tooltipModel.get('confine');\n return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible.\n : tooltipModel.get('renderMode') === 'richText';\n}\n\nfunction testStyle(styleProps) {\n if (!env.domSupported) {\n return;\n }\n\n var style = document.documentElement.style;\n\n for (var i = 0, len = styleProps.length; i < len; i++) {\n if (styleProps[i] in style) {\n return styleProps[i];\n }\n }\n}\n\nexport var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\nexport var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\nexport function toCSSVendorPrefix(styleVendor, styleProp) {\n if (!styleVendor) {\n return styleProp;\n }\n\n styleProp = toCamelCase(styleProp, true);\n var idx = styleVendor.indexOf(styleProp);\n styleVendor = idx === -1 ? styleProp : \"-\" + styleVendor.slice(0, idx) + \"-\" + styleProp;\n return styleVendor.toLowerCase();\n}\nexport function getComputedStyle(el, style) {\n var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);\n return stl ? style ? stl[style] : stl : null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isString, indexOf, each, bind, isArray, isDom } from 'zrender/lib/core/util.js';\nimport { normalizeEvent } from 'zrender/lib/core/event.js';\nimport { transformLocalCoord } from 'zrender/lib/core/dom.js';\nimport env from 'zrender/lib/core/env.js';\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format.js';\nimport { shouldTooltipConfine, toCSSVendorPrefix, getComputedStyle, TRANSFORM_VENDOR, TRANSITION_VENDOR } from './helper.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\n/* global document, window */\n\nvar CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\nvar CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform'); // eslint-disable-next-line\n\nvar gCssText = \"position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;\" + (env.transform3dSupported ? 'will-change:transform;' : '');\n\nfunction mirrorPos(pos) {\n pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top';\n return pos;\n}\n\nfunction assembleArrow(tooltipModel, borderColor, arrowPosition) {\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\n return '';\n }\n\n var backgroundColor = tooltipModel.get('backgroundColor');\n var borderWidth = tooltipModel.get('borderWidth');\n borderColor = convertToColorString(borderColor);\n var arrowPos = mirrorPos(arrowPosition);\n var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);\n var positionStyle = '';\n var transformStyle = CSS_TRANSFORM_VENDOR + ':';\n var rotateDeg;\n\n if (indexOf(['left', 'right'], arrowPos) > -1) {\n positionStyle += 'top:50%';\n transformStyle += \"translateY(-50%) rotate(\" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + \"deg)\";\n } else {\n positionStyle += 'left:50%';\n transformStyle += \"translateX(-50%) rotate(\" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + \"deg)\";\n }\n\n var rotateRadian = rotateDeg * Math.PI / 180;\n var arrowWH = arrowSize + borderWidth;\n var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));\n var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;\n positionStyle += \";\" + arrowPos + \":-\" + arrowOffset + \"px\";\n var borderStyle = borderColor + \" solid \" + borderWidth + \"px;\";\n var styleCss = [\"position:absolute;width:\" + arrowSize + \"px;height:\" + arrowSize + \"px;z-index:-1;\", positionStyle + \";\" + transformStyle + \";\", \"border-bottom:\" + borderStyle, \"border-right:\" + borderStyle, \"background-color:\" + backgroundColor + \";\"];\n return \"
\";\n}\n\nfunction assembleTransition(duration, onlyFade) {\n var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\n var transitionOption = \" \" + duration / 2 + \"s \" + transitionCurve;\n var transitionText = \"opacity\" + transitionOption + \",visibility\" + transitionOption;\n\n if (!onlyFade) {\n transitionOption = \" \" + duration + \"s \" + transitionCurve;\n transitionText += env.transformSupported ? \",\" + CSS_TRANSFORM_VENDOR + transitionOption : \",left\" + transitionOption + \",top\" + transitionOption;\n }\n\n return CSS_TRANSITION_VENDOR + ':' + transitionText;\n}\n\nfunction assembleTransform(x, y, toString) {\n // If using float on style, the final width of the dom might\n // keep changing slightly while mouse move. So `toFixed(0)` them.\n var x0 = x.toFixed(0) + 'px';\n var y0 = y.toFixed(0) + 'px'; // not support transform, use `left` and `top` instead.\n\n if (!env.transformSupported) {\n return toString ? \"top:\" + y0 + \";left:\" + x0 + \";\" : [['top', y0], ['left', x0]];\n } // support transform\n\n\n var is3d = env.transform3dSupported;\n var translate = \"translate\" + (is3d ? '3d' : '') + \"(\" + x0 + \",\" + y0 + (is3d ? ',0' : '') + \")\";\n return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\n}\n/**\r\n * @param {Object} textStyle\r\n * @return {string}\r\n * @inner\r\n */\n\n\nfunction assembleFont(textStyleModel) {\n var cssText = [];\n var fontSize = textStyleModel.get('fontSize');\n var color = textStyleModel.getTextColor();\n color && cssText.push('color:' + color);\n cssText.push('font:' + textStyleModel.getFont());\n fontSize // @ts-ignore, leave it to the tooltip refactor.\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\n var shadowColor = textStyleModel.get('textShadowColor');\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\n shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);\n each(['decoration', 'align'], function (name) {\n var val = textStyleModel.get(name);\n val && cssText.push('text-' + name + ':' + val);\n });\n return cssText.join(';');\n}\n\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\n var cssText = [];\n var transitionDuration = tooltipModel.get('transitionDuration');\n var backgroundColor = tooltipModel.get('backgroundColor');\n var shadowBlur = tooltipModel.get('shadowBlur');\n var shadowColor = tooltipModel.get('shadowColor');\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\n var textStyleModel = tooltipModel.getModel('textStyle');\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\n cssText.push('box-shadow:' + boxShadow); // Animation transition. Do not animate when transitionDuration is 0.\n\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\n\n if (backgroundColor) {\n cssText.push('background-color:' + backgroundColor);\n } // Border style\n\n\n each(['width', 'color', 'radius'], function (name) {\n var borderName = 'border-' + name;\n var camelCase = toCamelCase(borderName);\n var val = tooltipModel.get(camelCase);\n val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\n }); // Text style\n\n cssText.push(assembleFont(textStyleModel)); // Padding\n\n if (padding != null) {\n cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\n }\n\n return cssText.join(';') + ';';\n} // If not able to make, do not modify the input `out`.\n\n\nfunction makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\n var zrPainter = zr && zr.painter;\n\n if (appendToBody) {\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\n\n if (zrViewportRoot) {\n // Some APPs might use scale on body, so we support CSS transform here.\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\n }\n } else {\n out[0] = zrX;\n out[1] = zrY; // xy should be based on canvas root. But tooltipContent is\n // the sibling of canvas root. So padding of ec container\n // should be considered here.\n\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\n\n if (viewportRootOffset) {\n out[0] += viewportRootOffset.offsetLeft;\n out[1] += viewportRootOffset.offsetTop;\n }\n }\n\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nvar TooltipHTMLContent =\n/** @class */\nfunction () {\n function TooltipHTMLContent(container, api, opt) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._enterable = true;\n this._alwaysShowContent = false;\n this._firstShow = true;\n this._longHide = true;\n\n if (env.wxa) {\n return null;\n }\n\n var el = document.createElement('div'); // TODO: TYPE\n\n el.domBelongToZr = true;\n this.el = el;\n var zr = this._zr = api.getZr();\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\n\n if (appendToBody) {\n document.body.appendChild(el);\n } else {\n container.appendChild(el);\n }\n\n this._container = container; // FIXME\n // Is it needed to trigger zr event manually if\n // the browser do not support `pointer-events: none`.\n\n var self = this;\n\n el.onmouseenter = function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n };\n\n el.onmousemove = function (e) {\n e = e || window.event;\n\n if (!self._enterable) {\n // `pointer-events: none` is set to tooltip content div\n // if `enterable` is set as `false`, and `el.onmousemove`\n // can not be triggered. But in browser that do not\n // support `pointer-events`, we need to do this:\n // Try trigger zrender event to avoid mouse\n // in and out shape too frequently\n var handler = zr.handler;\n var zrViewportRoot = zr.painter.getViewportRoot();\n normalizeEvent(zrViewportRoot, e, true);\n handler.dispatch('mousemove', e);\n }\n };\n\n el.onmouseleave = function () {\n // set `_inContent` to `false` before `hideLater`\n self._inContent = false;\n\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n };\n }\n /**\r\n * Update when tooltip is rendered\r\n */\n\n\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\n // FIXME\n // Move this logic to ec main?\n var container = this._container;\n var position = getComputedStyle(container, 'position');\n var domStyle = container.style;\n\n if (domStyle.position !== 'absolute' && position !== 'absolute') {\n domStyle.position = 'relative';\n } // move tooltip if chart resized\n\n\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized(); // update alwaysShowContent\n\n this._alwaysShowContent = alwaysShowContent; // update className\n\n this.el.className = tooltipModel.get('className') || ''; // Hide the tooltip\n // PENDING\n // this.hide();\n };\n\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\n clearTimeout(this._hideTimeout);\n clearTimeout(this._longHideTimeout);\n var el = this.el;\n var style = el.style;\n var styleCoord = this._styleCoord;\n\n if (!el.innerHTML) {\n style.display = 'none';\n } else {\n style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) // initial transform\n + assembleTransform(styleCoord[0], styleCoord[1], true) + (\"border-color:\" + convertToColorString(nearPointColor) + \";\") + (tooltipModel.get('extraCssText') || '') // If mouse occasionally move over the tooltip, a mouseout event will be\n // triggered by canvas, and cause some unexpectable result like dragging\n // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n // it. Although it is not supported by IE8~IE10, fortunately it is a rare\n // scenario.\n + (\";pointer-events:\" + (this._enterable ? 'auto' : 'none'));\n }\n\n this._show = true;\n this._firstShow = false;\n this._longHide = false;\n };\n\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\n var el = this.el;\n\n if (content == null) {\n el.innerHTML = '';\n return;\n }\n\n var arrow = '';\n\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) {\n arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);\n }\n\n if (isString(content)) {\n el.innerHTML = content + arrow;\n } else if (content) {\n // Clear previous\n el.innerHTML = '';\n\n if (!isArray(content)) {\n content = [content];\n }\n\n for (var i = 0; i < content.length; i++) {\n if (isDom(content[i]) && content[i].parentNode !== el) {\n el.appendChild(content[i]);\n }\n } // no arrow if empty\n\n\n if (arrow && el.childNodes.length) {\n // no need to create a new parent element, but it's not supported by IE 10 and older.\n // const arrowEl = document.createRange().createContextualFragment(arrow);\n var arrowEl = document.createElement('div');\n arrowEl.innerHTML = arrow;\n el.appendChild(arrowEl);\n }\n }\n };\n\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipHTMLContent.prototype.getSize = function () {\n var el = this.el;\n return [el.offsetWidth, el.offsetHeight];\n };\n\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\n\n if (styleCoord[0] != null && styleCoord[1] != null) {\n var style_1 = this.el.style;\n var transforms = assembleTransform(styleCoord[0], styleCoord[1]);\n each(transforms, function (transform) {\n style_1[transform[0]] = transform[1];\n });\n }\n };\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\n\n\n TooltipHTMLContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipHTMLContent.prototype.hide = function () {\n var _this = this;\n\n var style = this.el.style;\n style.visibility = 'hidden';\n style.opacity = '0';\n env.transform3dSupported && (style.willChange = '');\n this._show = false;\n this._longHideTimeout = setTimeout(function () {\n return _this._longHide = true;\n }, 500);\n };\n\n TooltipHTMLContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipHTMLContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipHTMLContent.prototype.dispose = function () {\n this.el.parentNode.removeChild(this.el);\n };\n\n return TooltipHTMLContent;\n}();\n\nexport default TooltipHTMLContent;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\nimport { throwError } from '../../util/log.js';\n\nvar TooltipRichContent =\n/** @class */\nfunction () {\n function TooltipRichContent(api) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._alwaysShowContent = false;\n this._enterable = true;\n this._zr = api.getZr();\n makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\n }\n /**\r\n * Update when tooltip is rendered\r\n */\n\n\n TooltipRichContent.prototype.update = function (tooltipModel) {\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized(); // update alwaysShowContent\n\n this._alwaysShowContent = alwaysShowContent;\n };\n\n TooltipRichContent.prototype.show = function () {\n if (this._hideTimeout) {\n clearTimeout(this._hideTimeout);\n }\n\n this.el.show();\n this._show = true;\n };\n /**\r\n * Set tooltip content\r\n */\n\n\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\n var _this = this;\n\n if (zrUtil.isObject(content)) {\n throwError(process.env.NODE_ENV !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\n }\n\n if (this.el) {\n this._zr.remove(this.el);\n }\n\n var textStyleModel = tooltipModel.getModel('textStyle');\n this.el = new ZRText({\n style: {\n rich: markupStyleCreator.richTextStyles,\n text: content,\n lineHeight: 22,\n borderWidth: 1,\n borderColor: borderColor,\n textShadowColor: textStyleModel.get('textShadowColor'),\n fill: tooltipModel.get(['textStyle', 'color']),\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\n verticalAlign: 'top',\n align: 'left'\n },\n z: tooltipModel.get('z')\n });\n zrUtil.each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) {\n _this.el.style[propName] = tooltipModel.get(propName);\n });\n zrUtil.each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) {\n _this.el.style[propName] = textStyleModel.get(propName) || 0;\n });\n\n this._zr.add(this.el);\n\n var self = this;\n this.el.on('mouseover', function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n });\n this.el.on('mouseout', function () {\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n\n self._inContent = false;\n });\n };\n\n TooltipRichContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipRichContent.prototype.getSize = function () {\n var el = this.el;\n var bounding = this.el.getBoundingRect(); // bounding rect does not include shadow. For renderMode richText,\n // if overflow, it will be cut. So calculate them accurately.\n\n var shadowOuterSize = calcShadowOuterSize(el.style);\n return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];\n };\n\n TooltipRichContent.prototype.moveTo = function (x, y) {\n var el = this.el;\n\n if (el) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, x, y);\n x = styleCoord[0];\n y = styleCoord[1];\n var style = el.style;\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\n var shadowOuterSize = calcShadowOuterSize(style); // rich text x, y do not include border.\n\n el.x = x + borderWidth + shadowOuterSize.left;\n el.y = y + borderWidth + shadowOuterSize.top;\n el.markRedraw();\n }\n };\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\n\n\n TooltipRichContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipRichContent.prototype.hide = function () {\n if (this.el) {\n this.el.hide();\n }\n\n this._show = false;\n };\n\n TooltipRichContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipRichContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipRichContent.prototype.dispose = function () {\n this._zr.remove(this.el);\n };\n\n return TooltipRichContent;\n}();\n\nfunction mathMaxWith0(val) {\n return Math.max(0, val);\n}\n\nfunction calcShadowOuterSize(style) {\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\n return {\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\n };\n}\n\nfunction makeStyleCoord(out, zr, zrX, zrY) {\n out[0] = zrX;\n out[1] = zrY;\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nexport default TooltipRichContent;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\nimport { bind, each, clone, trim, isString, isFunction, isArray, isObject, extend } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport TooltipHTMLContent from './TooltipHTMLContent.js';\nimport TooltipRichContent from './TooltipRichContent.js';\nimport { convertToColorString, formatTpl } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport { Rect } from '../../util/graphic.js';\nimport findPointFromSeries from '../axisPointer/findPointFromSeries.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport Model from '../../model/Model.js';\nimport * as globalListener from '../axisPointer/globalListener.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper.js';\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model.js';\nimport ComponentView from '../../view/Component.js';\nimport { format as timeFormat } from '../../util/time.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { shouldTooltipConfine } from './helper.js';\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat.js';\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup.js';\nimport { findEventDispatcher } from '../../util/event.js';\nimport { clear, createOrUpdate } from '../../util/throttle.js';\nvar proxyRect = new Rect({\n shape: {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n }\n});\n\nvar TooltipView =\n/** @class */\nfunction (_super) {\n __extends(TooltipView, _super);\n\n function TooltipView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipView.type;\n return _this;\n }\n\n TooltipView.prototype.init = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n\n var tooltipModel = ecModel.getComponent('tooltip');\n var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode'));\n this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api.getDom(), api, {\n appendToBody: tooltipModel.get('appendToBody', true)\n });\n };\n\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n } // Reset\n\n\n this.group.removeAll();\n this._tooltipModel = tooltipModel;\n this._ecModel = ecModel;\n this._api = api;\n var tooltipContent = this._tooltipContent;\n tooltipContent.update(tooltipModel);\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n\n this._initGlobalListener();\n\n this._keepShow(); // PENDING\n // `mousemove` event will be triggered very frequently when the mouse moves fast,\n // which causes that the `updatePosition` function was also called frequently.\n // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101\n // To avoid frequent triggering,\n // consider throttling it in 50ms when transition is enabled\n\n\n if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {\n createOrUpdate(this, '_updatePosition', 50, 'fixRate');\n } else {\n clear(this, '_updatePosition');\n }\n };\n\n TooltipView.prototype._initGlobalListener = function () {\n var tooltipModel = this._tooltipModel;\n var triggerOn = tooltipModel.get('triggerOn');\n globalListener.register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none') {\n if (triggerOn.indexOf(currTrigger) >= 0) {\n this._tryShow(e, dispatchAction);\n } else if (currTrigger === 'leave') {\n this._hide(dispatchAction);\n }\n }\n }, this));\n };\n\n TooltipView.prototype._keepShow = function () {\n var tooltipModel = this._tooltipModel;\n var ecModel = this._ecModel;\n var api = this._api;\n var triggerOn = tooltipModel.get('triggerOn'); // Try to keep the tooltip show when refreshing\n\n if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API,\n // self.manuallyShowTip({x, y}) might cause tooltip hide,\n // which is not expected.\n && triggerOn !== 'none' && triggerOn !== 'click') {\n var self_1 = this;\n clearTimeout(this._refreshUpdateTimeout);\n this._refreshUpdateTimeout = setTimeout(function () {\n // Show tip next tick after other charts are rendered\n // In case highlight action has wrong result\n // FIXME\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\n x: self_1._lastX,\n y: self_1._lastY,\n dataByCoordSys: self_1._lastDataByCoordSys\n });\n });\n }\n };\n /**\r\n * Show tip manually by\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * x: 10,\r\n * y: 10\r\n * });\r\n * Or\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * seriesIndex: 0,\r\n * dataIndex or dataIndexInside or name\r\n * });\r\n *\r\n * TODO Batch\r\n */\n\n\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\n if (payload.from === this.uid || env.node || !api.getDom()) {\n return;\n }\n\n var dispatchAction = makeDispatchAction(payload, api); // Reset ticket\n\n this._ticket = ''; // When triggered from axisPointer.\n\n var dataByCoordSys = payload.dataByCoordSys;\n var cmptRef = findComponentReference(payload, ecModel, api);\n\n if (cmptRef) {\n var rect = cmptRef.el.getBoundingRect().clone();\n rect.applyTransform(cmptRef.el.transform);\n\n this._tryShow({\n offsetX: rect.x + rect.width / 2,\n offsetY: rect.y + rect.height / 2,\n target: cmptRef.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n } else if (payload.tooltip && payload.x != null && payload.y != null) {\n var el = proxyRect;\n el.x = payload.x;\n el.y = payload.y;\n el.update();\n getECData(el).tooltipConfig = {\n name: null,\n option: payload.tooltip\n }; // Manually show tooltip while view is not using zrender elements.\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n target: el\n }, dispatchAction);\n } else if (dataByCoordSys) {\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n dataByCoordSys: dataByCoordSys,\n tooltipOption: payload.tooltipOption\n }, dispatchAction);\n } else if (payload.seriesIndex != null) {\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\n return;\n }\n\n var pointInfo = findPointFromSeries(payload, ecModel);\n var cx = pointInfo.point[0];\n var cy = pointInfo.point[1];\n\n if (cx != null && cy != null) {\n this._tryShow({\n offsetX: cx,\n offsetY: cy,\n target: pointInfo.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n }\n } else if (payload.x != null && payload.y != null) {\n // FIXME\n // should wrap dispatchAction like `axisPointer/globalListener` ?\n api.dispatchAction({\n type: 'updateAxisPointer',\n x: payload.x,\n y: payload.y\n });\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n target: api.getZr().findHover(payload.x, payload.y).target\n }, dispatchAction);\n }\n };\n\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\n var tooltipContent = this._tooltipContent;\n\n if (this._tooltipModel) {\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\n }\n\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\n\n if (payload.from !== this.uid) {\n this._hide(makeDispatchAction(payload, api));\n }\n }; // Be compatible with previous design, that is, when tooltip.type is 'axis' and\n // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n // and tooltip.\n\n\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\n var seriesIndex = payload.seriesIndex;\n var dataIndex = payload.dataIndex; // @ts-ignore\n\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\n return;\n }\n\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (!seriesModel) {\n return;\n }\n\n var data = seriesModel.getData();\n var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);\n\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\n return;\n }\n\n api.dispatchAction({\n type: 'updateAxisPointer',\n seriesIndex: seriesIndex,\n dataIndex: dataIndex,\n position: payload.position\n });\n return true;\n };\n\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\n var el = e.target;\n var tooltipModel = this._tooltipModel;\n\n if (!tooltipModel) {\n return;\n } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\n\n\n this._lastX = e.offsetX;\n this._lastY = e.offsetY;\n var dataByCoordSys = e.dataByCoordSys;\n\n if (dataByCoordSys && dataByCoordSys.length) {\n this._showAxisTooltip(dataByCoordSys, e);\n } else if (el) {\n this._lastDataByCoordSys = null;\n var seriesDispatcher_1;\n var cmptDispatcher_1;\n findEventDispatcher(el, function (target) {\n // Always show item tooltip if mouse is on the element with dataIndex\n if (getECData(target).dataIndex != null) {\n seriesDispatcher_1 = target;\n return true;\n } // Tooltip provided directly. Like legend.\n\n\n if (getECData(target).tooltipConfig != null) {\n cmptDispatcher_1 = target;\n return true;\n }\n }, true);\n\n if (seriesDispatcher_1) {\n this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction);\n } else if (cmptDispatcher_1) {\n this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction);\n } else {\n this._hide(dispatchAction);\n }\n } else {\n this._lastDataByCoordSys = null;\n\n this._hide(dispatchAction);\n }\n };\n\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\n // showDelay is used in this case: tooltip.enterable is set\n // as true. User intent to move mouse into tooltip and click\n // something. `showDelay` makes it easier to enter the content\n // but tooltip do not move immediately.\n var delay = tooltipModel.get('showDelay');\n cb = bind(cb, this);\n clearTimeout(this._showTimout);\n delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();\n };\n\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\n var ecModel = this._ecModel;\n var globalTooltipModel = this._tooltipModel;\n var point = [e.offsetX, e.offsetY];\n var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);\n var renderMode = this._renderMode;\n var cbParamsList = [];\n var articleMarkup = createTooltipMarkup('section', {\n blocks: [],\n noHeader: true\n }); // Only for legacy: `Serise['formatTooltip']` returns a string.\n\n var markupTextArrLegacy = [];\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n each(dataByCoordSys, function (itemCoordSys) {\n each(itemCoordSys.dataByAxis, function (axisItem) {\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\n var axisValue = axisItem.value;\n\n if (!axisModel || axisValue == null) {\n return;\n }\n\n var axisValueLabel = axisPointerViewHelper.getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\n var axisSectionMarkup = createTooltipMarkup('section', {\n header: axisValueLabel,\n noHeader: !trim(axisValueLabel),\n sortBlocks: true,\n blocks: []\n });\n articleMarkup.blocks.push(axisSectionMarkup);\n each(axisItem.seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var cbParams = series.getDataParams(dataIndex); // Can't find data.\n\n if (cbParams.dataIndex < 0) {\n return;\n }\n\n cbParams.axisDim = axisItem.axisDim;\n cbParams.axisIndex = axisItem.axisIndex;\n cbParams.axisType = axisItem.axisType;\n cbParams.axisId = axisItem.axisId;\n cbParams.axisValue = axisHelper.getAxisRawValue(axisModel.axis, {\n value: axisValue\n });\n cbParams.axisValueLabel = axisValueLabel; // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\n var frag = seriesTooltipResult.frag;\n\n if (frag) {\n var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter');\n axisSectionMarkup.blocks.push(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag);\n }\n\n if (seriesTooltipResult.text) {\n markupTextArrLegacy.push(seriesTooltipResult.text);\n }\n\n cbParamsList.push(cbParams);\n });\n });\n }); // In most cases, the second axis is displays upper on the first one.\n // So we reverse it to look better.\n\n articleMarkup.blocks.reverse();\n markupTextArrLegacy.reverse();\n var positionExpr = e.position;\n var orderMode = singleTooltipModel.get('order');\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle'));\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\n\n this._showOrMove(singleTooltipModel, function () {\n if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\n } else {\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\n }\n }); // Do not trigger events here, because this branch only be entered\n // from dispatchAction.\n\n };\n\n TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) {\n var ecModel = this._ecModel;\n var ecData = getECData(dispatcher); // Use dataModel in element if possible\n // Used when mouseover on a element like markPoint or edge\n // In which case, the data is not main data in series.\n\n var seriesIndex = ecData.seriesIndex;\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link.\n\n var dataModel = ecData.dataModel || seriesModel;\n var dataIndex = ecData.dataIndex;\n var dataType = ecData.dataType;\n var data = dataModel.getData(dataType);\n var renderMode = this._renderMode;\n var positionDefault = e.positionDefault;\n var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var tooltipTrigger = tooltipModel.get('trigger');\n\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\n return;\n }\n\n var params = dataModel.getDataParams(dataIndex, dataType);\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\n var orderMode = tooltipModel.get('order');\n var valueFormatter = tooltipModel.get('valueFormatter');\n var frag = seriesTooltipResult.frag;\n var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text;\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\n\n this._showOrMove(tooltipModel, function () {\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\n }); // FIXME\n // duplicated showtip if manuallyShowTip is called from dispatchAction.\n\n\n dispatchAction({\n type: 'showTip',\n dataIndexInside: dataIndex,\n dataIndex: data.getRawIndex(dataIndex),\n seriesIndex: seriesIndex,\n from: this.uid\n });\n };\n\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\n var ecData = getECData(el);\n var tooltipConfig = ecData.tooltipConfig;\n var tooltipOpt = tooltipConfig.option || {};\n\n if (isString(tooltipOpt)) {\n var content = tooltipOpt;\n tooltipOpt = {\n content: content,\n // Fixed formatter\n formatter: content\n };\n }\n\n var tooltipModelCascade = [tooltipOpt];\n\n var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\n\n if (cmpt) {\n tooltipModelCascade.push(cmpt);\n } // In most cases, component tooltip formatter has different params with series tooltip formatter,\n // so that they cannot share the same formatter. Since the global tooltip formatter is used for series\n // by convention, we do not use it as the default formatter for component.\n\n\n tooltipModelCascade.push({\n formatter: tooltipOpt.content\n });\n var positionDefault = e.positionDefault;\n var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var defaultHtml = subTooltipModel.get('content');\n var asyncTicket = Math.random() + ''; // PENDING: this case do not support richText style yet.\n\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Do not check whether `trigger` is 'none' here, because `trigger`\n // only works on coordinate system. In fact, we have not found case\n // that requires setting `trigger` nothing on component yet.\n\n this._showOrMove(subTooltipModel, function () {\n // Use formatterParams from element defined in component\n // Avoid users modify it.\n var formatterParams = clone(subTooltipModel.get('formatterParams') || {});\n\n this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\n }); // If not dispatch showTip, tip may be hide triggered by axis.\n\n\n dispatchAction({\n type: 'showTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype._showTooltipContent = function ( // Use Model insteadof TooltipModel because this model may be from series or other options.\n // Instead of top level tooltip.\n tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\n // Reset ticket\n this._ticket = '';\n\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\n return;\n }\n\n var tooltipContent = this._tooltipContent;\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n var formatter = tooltipModel.get('formatter');\n positionExpr = positionExpr || tooltipModel.get('position');\n var html = defaultHtml;\n\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor'));\n\n var nearPointColor = nearPoint.color;\n\n if (formatter) {\n if (isString(formatter)) {\n var useUTC = tooltipModel.ecModel.get('useUTC');\n var params0 = isArray(params) ? params[0] : params;\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\n html = formatter;\n\n if (isTimeAxis) {\n html = timeFormat(params0.axisValue, html, useUTC);\n }\n\n html = formatTpl(html, params, true);\n } else if (isFunction(formatter)) {\n var callback = bind(function (cbTicket, html) {\n if (cbTicket === this._ticket) {\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n }\n }, this);\n this._ticket = asyncTicket;\n html = formatter(params, asyncTicket, callback);\n } else {\n html = formatter;\n }\n }\n\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n tooltipContent.show(tooltipModel, nearPointColor);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n };\n\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) {\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\n return {\n color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none')\n };\n }\n\n if (!isArray(tooltipDataParams)) {\n return {\n color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\n };\n }\n };\n\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, // Mouse x\n y, // Mouse y\n content, params, el) {\n var viewWidth = this._api.getWidth();\n\n var viewHeight = this._api.getHeight();\n\n positionExpr = positionExpr || tooltipModel.get('position');\n var contentSize = content.getSize();\n var align = tooltipModel.get('align');\n var vAlign = tooltipModel.get('verticalAlign');\n var rect = el && el.getBoundingRect().clone();\n el && rect.applyTransform(el.transform);\n\n if (isFunction(positionExpr)) {\n // Callback of position can be an array or a string specify the position\n positionExpr = positionExpr([x, y], params, content.el, rect, {\n viewSize: [viewWidth, viewHeight],\n contentSize: contentSize.slice()\n });\n }\n\n if (isArray(positionExpr)) {\n x = parsePercent(positionExpr[0], viewWidth);\n y = parsePercent(positionExpr[1], viewHeight);\n } else if (isObject(positionExpr)) {\n var boxLayoutPosition = positionExpr;\n boxLayoutPosition.width = contentSize[0];\n boxLayoutPosition.height = contentSize[1];\n var layoutRect = getLayoutRect(boxLayoutPosition, {\n width: viewWidth,\n height: viewHeight\n });\n x = layoutRect.x;\n y = layoutRect.y;\n align = null; // When positionExpr is left/top/right/bottom,\n // align and verticalAlign will not work.\n\n vAlign = null;\n } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\n else if (isString(positionExpr) && el) {\n var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth'));\n x = pos[0];\n y = pos[1];\n } else {\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\n x = pos[0];\n y = pos[1];\n }\n\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\n\n if (shouldTooltipConfine(tooltipModel)) {\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\n x = pos[0];\n y = pos[1];\n }\n\n content.moveTo(x, y);\n }; // FIXME\n // Should we remove this but leave this to user?\n\n\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) {\n var lastCoordSys = this._lastDataByCoordSys;\n var lastCbParamsList = this._cbParamsList;\n var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;\n contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\n contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) {\n var thisItem = thisDataByAxis[indexAxis] || {};\n var lastIndices = lastItem.seriesDataIndices || [];\n var newIndices = thisItem.seriesDataIndices || [];\n contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;\n contentNotChanged && each(lastIndices, function (lastIdxItem, j) {\n var newIdxItem = newIndices[j];\n contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;\n }); // check is cbParams data value changed\n\n lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) {\n var seriesIdx = idxItem.seriesIndex;\n var cbParams = cbParamsList[seriesIdx];\n var lastCbParams = lastCbParamsList[seriesIdx];\n\n if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {\n contentNotChanged = false;\n }\n });\n });\n });\n this._lastDataByCoordSys = dataByCoordSys;\n this._cbParamsList = cbParamsList;\n return !!contentNotChanged;\n };\n\n TooltipView.prototype._hide = function (dispatchAction) {\n // Do not directly hideLater here, because this behavior may be prevented\n // in dispatchAction when showTip is dispatched.\n // FIXME\n // duplicated hideTip if manuallyHideTip is called from dispatchAction.\n this._lastDataByCoordSys = null;\n dispatchAction({\n type: 'hideTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype.dispose = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n\n clear(this, '_updatePosition');\n\n this._tooltipContent.dispose();\n\n globalListener.unregister('itemTooltip', api);\n };\n\n TooltipView.type = 'tooltip';\n return TooltipView;\n}(ComponentView);\n/**\r\n * From top to bottom. (the last one should be globalTooltipModel);\r\n */\n\n\nfunction buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n\n if (defaultTooltipOption) {\n resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n } // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n\n\n if (isString(tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n\n if (tooltipOpt) {\n resultModel = new Model(tooltipOpt, resultModel, ecModel);\n }\n }\n }\n\n return resultModel;\n}\n\nfunction makeDispatchAction(payload, api) {\n return payload.dispatchAction || bind(api.dispatchAction, api);\n}\n\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n\n if (gapH != null) {\n // Add extra 2 pixels for this case:\n // At present the \"values\" in default tooltip are using CSS `float: right`.\n // When the right edge of the tooltip box is on the right side of the\n // viewport, the `float` layout might push the \"values\" to the second line.\n if (x + width + gapH + 2 > viewWidth) {\n x -= width + gapH;\n } else {\n x += gapH;\n }\n }\n\n if (gapV != null) {\n if (y + height + gapV > viewHeight) {\n y -= height + gapV;\n } else {\n y += gapV;\n }\n }\n\n return [x, y];\n}\n\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n x = Math.min(x + width, viewWidth) - width;\n y = Math.min(y + height, viewHeight) - height;\n x = Math.max(x, 0);\n y = Math.max(y, 0);\n return [x, y];\n}\n\nfunction calcTooltipPosition(position, rect, contentSize, borderWidth) {\n var domWidth = contentSize[0];\n var domHeight = contentSize[1];\n var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;\n var x = 0;\n var y = 0;\n var rectWidth = rect.width;\n var rectHeight = rect.height;\n\n switch (position) {\n case 'inside':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'top':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y - domHeight - offset;\n break;\n\n case 'bottom':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight + offset;\n break;\n\n case 'left':\n x = rect.x - domWidth - offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'right':\n x = rect.x + rectWidth + offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n }\n\n return [x, y];\n}\n\nfunction isCenterAlign(align) {\n return align === 'center' || align === 'middle';\n}\n/**\r\n * Find target component by payload like:\r\n * ```js\r\n * { legendId: 'some_id', name: 'xxx' }\r\n * { toolboxIndex: 1, name: 'xxx' }\r\n * { geoName: 'some_name', name: 'xxx' }\r\n * ```\r\n * PENDING: at present only\r\n *\r\n * If not found, return null/undefined.\r\n */\n\n\nfunction findComponentReference(payload, ecModel, api) {\n var queryOptionMap = preParseFinder(payload).queryOptionMap;\n var componentMainType = queryOptionMap.keys()[0];\n\n if (!componentMainType || componentMainType === 'series') {\n return;\n }\n\n var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {\n useDefault: false,\n enableAll: false,\n enableNone: false\n });\n var model = queryResult.models[0];\n\n if (!model) {\n return;\n }\n\n var view = api.getViewOfComponentModel(model);\n var el;\n view.group.traverse(function (subEl) {\n var tooltipConfig = getECData(subEl).tooltipConfig;\n\n if (tooltipConfig && tooltipConfig.name === payload.name) {\n el = subEl;\n return true; // stop\n }\n });\n\n if (el) {\n return {\n componentMainType: componentMainType,\n componentIndex: model.componentIndex,\n el: el\n };\n }\n}\n\nexport default TooltipView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nimport TooltipModel from './TooltipModel.js';\nimport TooltipView from './TooltipView.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n use(installAxisPointer);\n registers.registerComponentModel(TooltipModel);\n registers.registerComponentView(TooltipView);\n /**\r\n * @action\r\n * @property {string} type\r\n * @property {number} seriesIndex\r\n * @property {number} dataIndex\r\n * @property {number} [x]\r\n * @property {number} [y]\r\n */\n\n registers.registerAction({\n type: 'showTip',\n event: 'showTip',\n update: 'tooltip:manuallyShowTip'\n }, noop);\n registers.registerAction({\n type: 'hideTip',\n event: 'hideTip',\n update: 'tooltip:manuallyHideTip'\n }, noop);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\nexport default function brushPreprocessor(option, isNew) {\n var brushComponents = normalizeToArray(option ? option.brush : []);\n\n if (!brushComponents.length) {\n return;\n }\n\n var brushComponentSpecifiedBtns = [];\n zrUtil.each(brushComponents, function (brushOpt) {\n var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : [];\n\n if (tbs instanceof Array) {\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\n }\n });\n var toolbox = option && option.toolbox;\n\n if (zrUtil.isArray(toolbox)) {\n toolbox = toolbox[0];\n }\n\n if (!toolbox) {\n toolbox = {\n feature: {}\n };\n option.toolbox = [toolbox];\n }\n\n var toolboxFeature = toolbox.feature || (toolbox.feature = {});\n var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\n removeDuplicate(brushTypes);\n\n if (isNew && !brushTypes.length) {\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\n }\n}\n\nfunction removeDuplicate(arr) {\n var map = {};\n zrUtil.each(arr, function (val) {\n map[val] = 1;\n });\n arr.length = 0;\n zrUtil.each(map, function (flag, val) {\n arr.push(val);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * @file Visual solution, for consistent option specification.\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from './VisualMapping.js';\nimport { getItemVisualFromData, setItemVisualFromData } from './helper.js';\nvar each = zrUtil.each;\n\nfunction hasKeys(obj) {\n if (obj) {\n for (var name_1 in obj) {\n if (obj.hasOwnProperty(name_1)) {\n return true;\n }\n }\n }\n}\n\nexport function createVisualMappings(option, stateList, supplementVisualOption) {\n var visualMappings = {};\n each(stateList, function (state) {\n var mappings = visualMappings[state] = createMappings();\n each(option[state], function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var mappingOption = {\n type: visualType,\n visual: visualData\n };\n supplementVisualOption && supplementVisualOption(mappingOption, state);\n mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity\n // is not supported, such as rendering using gradient color.\n\n if (visualType === 'opacity') {\n mappingOption = zrUtil.clone(mappingOption);\n mappingOption.type = 'colorAlpha';\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\n }\n });\n });\n return visualMappings;\n\n function createMappings() {\n var Creater = function () {}; // Make sure hidden fields will not be visited by\n // object iteration (with hasOwnProperty checking).\n\n\n Creater.prototype.__hidden = Creater.prototype;\n var obj = new Creater();\n return obj;\n }\n}\nexport function replaceVisualOption(thisOption, newOption, keys) {\n // Visual attributes merge is not supported, otherwise it\n // brings overcomplicated merge logic. See #2853. So if\n // newOption has anyone of these keys, all of these keys\n // will be reset. Otherwise, all keys remain.\n var has;\n zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n has = true;\n }\n });\n has && zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n thisOption[key] = zrUtil.clone(newOption[key]);\n } else {\n delete thisOption[key];\n }\n });\n}\n/**\r\n * @param stateList\r\n * @param visualMappings\r\n * @param list\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param scope Scope for getValueState\r\n * @param dimension Concrete dimension, if used.\r\n */\n// ???! handle brush?\n\nexport function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n var dataIndex;\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n if (dimension == null) {\n data.each(eachItem);\n } else {\n data.each([dimension], eachItem);\n }\n\n function eachItem(valueOrIndex, index) {\n dataIndex = dimension == null ? valueOrIndex // First argument is index\n : index;\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n return;\n }\n\n var valueState = getValueState.call(scope, valueOrIndex);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\n }\n }\n}\n/**\r\n * @param data\r\n * @param stateList\r\n * @param visualMappings >\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param dim dimension or dimension index.\r\n */\n\nexport function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n return {\n progress: function progress(params, data) {\n var dimIndex;\n\n if (dim != null) {\n dimIndex = data.getDimensionIndex(dim);\n }\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n var dataIndex;\n var store = data.getStore();\n\n while ((dataIndex = params.next()) != null) {\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n continue;\n }\n\n var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;\n var valueState = getValueState(value);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\n }\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { linePolygonIntersect } from '../../util/graphic.js';\nexport function makeBrushCommonSelectorForSeries(area) {\n var brushType = area.brushType; // Do not use function binding or curry for performance.\n\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (itemLayout) {\n return selector[brushType].rect(itemLayout, selectors, area);\n }\n };\n return selectors;\n}\nvar selector = {\n lineX: getLineSelectors(0),\n lineY: getLineSelectors(1),\n rect: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n var points = area.range;\n\n if (!itemLayout || points.length <= 1) {\n return false;\n }\n\n var x = itemLayout.x;\n var y = itemLayout.y;\n var width = itemLayout.width;\n var height = itemLayout.height;\n var p = points[0];\n\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n return true;\n }\n }\n }\n};\n\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var p = itemLayout[xyIndex];\n return inLineRange(p, range);\n }\n },\n rect: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n }\n }\n };\n}\n\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\n\nexport default selector;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport { makeBrushCommonSelectorForSeries } from './selector.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport BrushTargetManager from '../helper/BrushTargetManager.js';\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\nvar DISPATCH_METHOD = '__ecBrushSelect';\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\n;\nexport function layoutCovers(ecModel) {\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\n });\n}\n/**\r\n * Register the visual encoding if this modules required.\r\n */\n\nexport default function brushVisual(ecModel, api, payload) {\n var brushSelected = [];\n var throttleType;\n var throttleDelay;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {\n brushType: false\n });\n });\n layoutCovers(ecModel);\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel, brushIndex) {\n var thisBrushSelected = {\n brushId: brushModel.id,\n brushIndex: brushIndex,\n brushName: brushModel.name,\n areas: zrUtil.clone(brushModel.areas),\n selected: []\n }; // Every brush component exists in event params, convenient\n // for user to find by index.\n\n brushSelected.push(thisBrushSelected);\n var brushOption = brushModel.option;\n var brushLink = brushOption.brushLink;\n var linkedSeriesMap = [];\n var selectedDataIndexForLink = [];\n var rangeInfoBySeries = [];\n var hasBrushExists = false;\n\n if (!brushIndex) {\n // Only the first throttle setting works.\n throttleType = brushOption.throttleType;\n throttleDelay = brushOption.throttleDelay;\n } // Add boundingRect and selectors to range.\n\n\n var areas = zrUtil.map(brushModel.areas, function (area) {\n var builder = boundingRectBuilders[area.brushType];\n var selectableArea = zrUtil.defaults({\n boundingRect: builder ? builder(area) : void 0\n }, area);\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\n return selectableArea;\n });\n var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\n mappingOption.mappingMethod = 'fixed';\n });\n zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\n linkedSeriesMap[seriesIndex] = 1;\n });\n\n function linkOthers(seriesIndex) {\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\n } // If no supported brush or no brush on the series,\n // all visuals should be in original state.\n\n\n function brushed(rangeInfoList) {\n return !!rangeInfoList.length;\n }\n /**\r\n * Logic for each series: (If the logic has to be modified one day, do it carefully!)\r\n *\r\n * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.\r\n * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.\r\n * └!hasBrushExist┘ └nothing.\r\n * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.\r\n * └!hasBrushExist┘ └nothing.\r\n * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.\r\n * !brushed┘ └nothing.\r\n * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.\r\n */\n // Step A\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\n seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\n });\n\n function stepAParallel(seriesModel, seriesIndex) {\n var coordSys = seriesModel.coordinateSystem;\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\n });\n }\n\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\n return;\n }\n\n zrUtil.each(areas, function (area) {\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\n rangeInfoList.push(area);\n }\n\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\n });\n\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\n var data_1 = seriesModel.getData();\n data_1.each(function (dataIndex) {\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\n selectedDataIndexForLink[dataIndex] = 1;\n }\n });\n }\n } // Step B\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var seriesBrushSelected = {\n seriesId: seriesModel.id,\n seriesIndex: seriesIndex,\n seriesName: seriesModel.name,\n dataIndex: []\n }; // Every series exists in event params, convenient\n // for user to find series by seriesIndex.\n\n thisBrushSelected.selected.push(seriesBrushSelected);\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\n var data = seriesModel.getData();\n var getValueState = linkOthers(seriesIndex) ? function (dataIndex) {\n return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n } : function (dataIndex) {\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n }; // If no supported brush or no brush, all visuals are in original state.\n\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState);\n });\n });\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\n}\n;\n\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\n // This event will not be triggered when `setOpion`, otherwise dead lock may\n // triggered when do `setOption` in event listener, which we do not find\n // satisfactory way to solve yet. Some considered resolutions:\n // (a) Diff with prevoius selected data ant only trigger event when changed.\n // But store previous data and diff precisely (i.e., not only by dataIndex, but\n // also detect value changes in selected data) might bring complexity or fragility.\n // (b) Use spectial param like `silent` to suppress event triggering.\n // But such kind of volatile param may be weird in `setOption`.\n if (!payload) {\n return;\n }\n\n var zr = api.getZr();\n\n if (zr[DISPATCH_FLAG]) {\n return;\n }\n\n if (!zr[DISPATCH_METHOD]) {\n zr[DISPATCH_METHOD] = doDispatch;\n }\n\n var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\n fn(api, brushSelected);\n}\n\nfunction doDispatch(api, brushSelected) {\n if (!api.isDisposed()) {\n var zr = api.getZr();\n zr[DISPATCH_FLAG] = true;\n api.dispatchAction({\n type: 'brushSelect',\n batch: brushSelected\n });\n zr[DISPATCH_FLAG] = false;\n }\n}\n\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\n var area = rangeInfoList[i];\n\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\n return true;\n }\n }\n}\n\nfunction brushModelNotControll(brushModel, seriesIndex) {\n var seriesIndices = brushModel.option.seriesIndex;\n return seriesIndices != null && seriesIndices !== 'all' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);\n}\n\nvar boundingRectBuilders = {\n rect: function (area) {\n return getBoundingRectFromMinMax(area.range);\n },\n polygon: function (area) {\n var minMax;\n var range = area.range;\n\n for (var i = 0, len = range.length; i < len; i++) {\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\n var rg = range[i];\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\n }\n\n return minMax && getBoundingRectFromMinMax(minMax);\n }\n};\n\nfunction getBoundingRectFromMinMax(minMax) {\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../helper/BrushController.js';\nimport { layoutCovers } from './visualEncoding.js';\nimport ComponentView from '../../view/Component.js';\n\nvar BrushView =\n/** @class */\nfunction (_super) {\n __extends(BrushView, _super);\n\n function BrushView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushView.type;\n return _this;\n }\n\n BrushView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n this.model;\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount();\n };\n\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\n this.model = brushModel;\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\n // PENDING: `updateTransform` is a little tricky, whose layout need\n // to be calculate mandatorily and other stages will not be performed.\n // Take care the correctness of the logic. See #11754 .\n layoutCovers(ecModel);\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\n this.updateTransform(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\n // Do not update controller when drawing.\n (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());\n }; // updateLayout: updateController,\n // updateVisual: updateController,\n\n\n BrushView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n BrushView.prototype._onBrush = function (eventParam) {\n var modelId = this.model.id;\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); // Action is not dispatched on drag end, because the drag end\n // emits the same params with the last drag move event, and\n // may have some delay when using touch pad, which makes\n // animation not smooth (when using debounce).\n\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\n type: 'brush',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n eventParam.isEnd && this.api.dispatchAction({\n type: 'brushEnd',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n };\n\n BrushView.type = 'brush';\n return BrushView;\n}(ComponentView);\n\nexport default BrushView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport Model from '../../model/Model.js';\nimport ComponentModel from '../../model/Component.js';\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\n\nvar BrushModel =\n/** @class */\nfunction (_super) {\n __extends(BrushModel, _super);\n\n function BrushModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushModel.type;\n /**\r\n * @readOnly\r\n */\n\n _this.areas = [];\n /**\r\n * Current brush painting area settings.\r\n * @readOnly\r\n */\n\n _this.brushOption = {};\n return _this;\n }\n\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\n var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time.\n\n thisOption.outOfBrush = thisOption.outOfBrush || {\n color: DEFAULT_OUT_OF_BRUSH_COLOR\n };\n\n if (!inBrush.hasOwnProperty('liftZ')) {\n // Bigger than the highlight z lift, otherwise it will\n // be effected by the highlight z when brush.\n inBrush.liftZ = 5;\n }\n };\n /**\r\n * If `areas` is null/undefined, range state remain.\r\n */\n\n\n BrushModel.prototype.setAreas = function (areas) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isArray(areas));\n zrUtil.each(areas, function (area) {\n zrUtil.assert(area.brushType, 'Illegal areas');\n });\n } // If areas is null/undefined, range state remain.\n // This helps user to dispatchAction({type: 'brush'}) with no areas\n // set but just want to get the current brush select info from a `brush` event.\n\n\n if (!areas) {\n return;\n }\n\n this.areas = zrUtil.map(areas, function (area) {\n return generateBrushOption(this.option, area);\n }, this);\n };\n /**\r\n * Set the current painting brush option.\r\n */\n\n\n BrushModel.prototype.setBrushOption = function (brushOption) {\n this.brushOption = generateBrushOption(this.option, brushOption);\n this.brushType = this.brushOption.brushType;\n };\n\n BrushModel.type = 'brush';\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\n BrushModel.defaultOption = {\n seriesIndex: 'all',\n brushType: 'rect',\n brushMode: 'single',\n transformable: true,\n brushStyle: {\n borderWidth: 1,\n color: 'rgba(210,219,238,0.3)',\n borderColor: '#D2DBEE'\n },\n throttleType: 'fixRate',\n throttleDelay: 0,\n removeOnClick: true,\n z: 10000\n };\n return BrushModel;\n}(ComponentModel);\n\nfunction generateBrushOption(option, brushOption) {\n return zrUtil.merge({\n brushType: option.brushType,\n brushMode: option.brushMode,\n transformable: option.transformable,\n brushStyle: new Model(option.brushStyle).getItemStyle(),\n removeOnClick: option.removeOnClick,\n z: option.z\n }, brushOption, true);\n}\n\nexport default BrushModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\n\nvar BrushFeature =\n/** @class */\nfunction (_super) {\n __extends(BrushFeature, _super);\n\n function BrushFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\n var brushType;\n var brushMode;\n var isBrushed;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n brushType = brushModel.brushType;\n brushMode = brushModel.brushOption.brushMode || 'single';\n isBrushed = isBrushed || !!brushModel.areas.length;\n });\n this._brushType = brushType;\n this._brushMode = brushMode;\n zrUtil.each(featureModel.get('type', true), function (type) {\n featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal');\n });\n };\n\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\n this.render(featureModel, ecModel, api);\n };\n\n BrushFeature.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon', true);\n var icons = {};\n zrUtil.each(model.get('type', true), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n ;\n\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\n var brushType = this._brushType;\n var brushMode = this._brushMode;\n\n if (type === 'clear') {\n // Trigger parallel action firstly\n api.dispatchAction({\n type: 'axisAreaSelect',\n intervals: []\n });\n api.dispatchAction({\n type: 'brush',\n command: 'clear',\n // Clear all areas of all brush components.\n areas: []\n });\n } else {\n api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'brush',\n brushOption: {\n brushType: type === 'keep' ? brushType : brushType === type ? false : type,\n brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode\n }\n });\n }\n };\n\n ;\n\n BrushFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: ICON_TYPES.slice(),\n icon: {\n /* eslint-disable */\n 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',\n 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',\n 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',\n 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',\n 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',\n 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\n\n /* eslint-enable */\n\n },\n // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\n title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title'])\n };\n return defaultOption;\n };\n\n return BrushFeature;\n}(ToolboxFeature);\n\nexport default BrushFeature;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport brushPreprocessor from './preprocessor.js';\nimport BrushView from './BrushView.js';\nimport BrushModel from './BrushModel.js';\nimport brushVisual from './visualEncoding.js'; // TODO\n\nimport BrushFeature from '../toolbox/feature/Brush.js';\nimport { registerFeature } from '../toolbox/featureManager.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerComponentView(BrushView);\n registers.registerComponentModel(BrushModel);\n registers.registerPreprocessor(brushPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\n registers.registerAction({\n type: 'brush',\n event: 'brush',\n update: 'updateVisual'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'brush',\n query: payload\n }, function (brushModel) {\n brushModel.setAreas(payload.areas);\n });\n });\n /**\r\n * payload: {\r\n * brushComponents: [\r\n * {\r\n * brushId,\r\n * brushIndex,\r\n * brushName,\r\n * series: [\r\n * {\r\n * seriesId,\r\n * seriesIndex,\r\n * seriesName,\r\n * rawIndices: [21, 34, ...]\r\n * },\r\n * ...\r\n * ]\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\n\n registers.registerAction({\n type: 'brushSelect',\n event: 'brushSelected',\n update: 'none'\n }, noop);\n registers.registerAction({\n type: 'brushEnd',\n event: 'brushEnd',\n update: 'none'\n }, noop);\n registerFeature('brush', BrushFeature);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { windowOpen } from '../../util/format.js';\n\nvar TitleModel =\n/** @class */\nfunction (_super) {\n __extends(TitleModel, _super);\n\n function TitleModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleModel.type;\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n return _this;\n }\n\n TitleModel.type = 'title';\n TitleModel.defaultOption = {\n // zlevel: 0,\n z: 6,\n show: true,\n text: '',\n target: 'blank',\n subtext: '',\n subtarget: 'blank',\n left: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n textStyle: {\n fontSize: 18,\n fontWeight: 'bold',\n color: '#464646'\n },\n subtextStyle: {\n fontSize: 12,\n color: '#6E7079'\n }\n };\n return TitleModel;\n}(ComponentModel); // View\n\n\nvar TitleView =\n/** @class */\nfunction (_super) {\n __extends(TitleView, _super);\n\n function TitleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleView.type;\n return _this;\n }\n\n TitleView.prototype.render = function (titleModel, ecModel, api) {\n this.group.removeAll();\n\n if (!titleModel.get('show')) {\n return;\n }\n\n var group = this.group;\n var textStyleModel = titleModel.getModel('textStyle');\n var subtextStyleModel = titleModel.getModel('subtextStyle');\n var textAlign = titleModel.get('textAlign');\n var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\n var textEl = new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: titleModel.get('text'),\n fill: textStyleModel.getTextColor()\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var textRect = textEl.getBoundingRect();\n var subText = titleModel.get('subtext');\n var subTextEl = new graphic.Text({\n style: createTextStyle(subtextStyleModel, {\n text: subText,\n fill: subtextStyleModel.getTextColor(),\n y: textRect.height + titleModel.get('itemGap'),\n verticalAlign: 'top'\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var link = titleModel.get('link');\n var sublink = titleModel.get('sublink');\n var triggerEvent = titleModel.get('triggerEvent', true);\n textEl.silent = !link && !triggerEvent;\n subTextEl.silent = !sublink && !triggerEvent;\n\n if (link) {\n textEl.on('click', function () {\n windowOpen(link, '_' + titleModel.get('target'));\n });\n }\n\n if (sublink) {\n subTextEl.on('click', function () {\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\n });\n }\n\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {\n componentType: 'title',\n componentIndex: titleModel.componentIndex\n } : null;\n group.add(textEl);\n subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line.\n\n var groupRect = group.getBoundingRect();\n var layoutOption = titleModel.getBoxLayoutParams();\n layoutOption.width = groupRect.width;\n layoutOption.height = groupRect.height;\n var layoutRect = getLayoutRect(layoutOption, {\n width: api.getWidth(),\n height: api.getHeight()\n }, titleModel.get('padding')); // Adjust text align based on position\n\n if (!textAlign) {\n // Align left if title is on the left. center and right is same\n textAlign = titleModel.get('left') || titleModel.get('right'); // @ts-ignore\n\n if (textAlign === 'middle') {\n textAlign = 'center';\n } // Adjust layout by text align\n\n\n if (textAlign === 'right') {\n layoutRect.x += layoutRect.width;\n } else if (textAlign === 'center') {\n layoutRect.x += layoutRect.width / 2;\n }\n }\n\n if (!textVerticalAlign) {\n textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); // @ts-ignore\n\n if (textVerticalAlign === 'center') {\n textVerticalAlign = 'middle';\n }\n\n if (textVerticalAlign === 'bottom') {\n layoutRect.y += layoutRect.height;\n } else if (textVerticalAlign === 'middle') {\n layoutRect.y += layoutRect.height / 2;\n }\n\n textVerticalAlign = textVerticalAlign || 'top';\n }\n\n group.x = layoutRect.x;\n group.y = layoutRect.y;\n group.markRedraw();\n var alignStyle = {\n align: textAlign,\n verticalAlign: textVerticalAlign\n };\n textEl.setStyle(alignStyle);\n subTextEl.setStyle(alignStyle); // Render background\n // Get groupRect again because textAlign has been changed\n\n groupRect = group.getBoundingRect();\n var padding = layoutRect.margin;\n var style = titleModel.getItemStyle(['color', 'opacity']);\n style.fill = titleModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: groupRect.x - padding[3],\n y: groupRect.y - padding[0],\n width: groupRect.width + padding[1] + padding[3],\n height: groupRect.height + padding[0] + padding[2],\n r: titleModel.get('borderRadius')\n },\n style: style,\n subPixelOptimize: true,\n silent: true\n });\n group.add(rect);\n };\n\n TitleView.type = 'title';\n return TitleView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(TitleModel);\n registers.registerComponentView(TitleView);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\n\nvar TimelineModel =\n/** @class */\nfunction (_super) {\n __extends(TimelineModel, _super);\n\n function TimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineModel.type;\n _this.layoutMode = 'box';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._initData();\n };\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this._initData();\n };\n\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n if (currentIndex == null) {\n currentIndex = this.option.currentIndex;\n }\n\n var count = this._data.count();\n\n if (this.option.loop) {\n currentIndex = (currentIndex % count + count) % count;\n } else {\n currentIndex >= count && (currentIndex = count - 1);\n currentIndex < 0 && (currentIndex = 0);\n }\n\n this.option.currentIndex = currentIndex;\n };\n /**\r\n * @return {number} currentIndex\r\n */\n\n\n TimelineModel.prototype.getCurrentIndex = function () {\n return this.option.currentIndex;\n };\n /**\r\n * @return {boolean}\r\n */\n\n\n TimelineModel.prototype.isIndexMax = function () {\n return this.getCurrentIndex() >= this._data.count() - 1;\n };\n /**\r\n * @param {boolean} state true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.setPlayState = function (state) {\n this.option.autoPlay = !!state;\n };\n /**\r\n * @return {boolean} true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.getPlayState = function () {\n return !!this.option.autoPlay;\n };\n /**\r\n * @private\r\n */\n\n\n TimelineModel.prototype._initData = function () {\n var thisOption = this.option;\n var dataArr = thisOption.data || [];\n var axisType = thisOption.axisType;\n var names = this._names = [];\n var processedDataArr;\n\n if (axisType === 'category') {\n processedDataArr = [];\n each(dataArr, function (item, index) {\n var value = convertOptionIdName(getDataItemValue(item), '');\n var newItem;\n\n if (isObject(item)) {\n newItem = clone(item);\n newItem.value = index;\n } else {\n newItem = index;\n }\n\n processedDataArr.push(newItem);\n names.push(value);\n });\n } else {\n processedDataArr = dataArr;\n }\n\n var dimType = {\n category: 'ordinal',\n time: 'time',\n value: 'number'\n }[axisType] || 'number';\n var data = this._data = new SeriesData([{\n name: 'value',\n type: dimType\n }], this);\n data.initData(processedDataArr, names);\n };\n\n TimelineModel.prototype.getData = function () {\n return this._data;\n };\n /**\r\n * @public\r\n * @return {Array.} categoreis\r\n */\n\n\n TimelineModel.prototype.getCategories = function () {\n if (this.get('axisType') === 'category') {\n return this._names.slice();\n }\n };\n\n TimelineModel.type = 'timeline';\n /**\r\n * @protected\r\n */\n\n TimelineModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 4,\n show: true,\n axisType: 'time',\n realtime: true,\n left: '20%',\n top: null,\n right: '20%',\n bottom: 0,\n width: null,\n height: 40,\n padding: 5,\n controlPosition: 'left',\n autoPlay: false,\n rewind: false,\n loop: true,\n playInterval: 2000,\n currentIndex: 0,\n itemStyle: {},\n label: {\n color: '#000'\n },\n data: []\n };\n return TimelineModel;\n}(ComponentModel);\n\nexport default TimelineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport TimelineModel from './TimelineModel.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar SliderTimelineModel =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineModel, _super);\n\n function SliderTimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineModel.type;\n return _this;\n }\n\n SliderTimelineModel.type = 'timeline.slider';\n /**\r\n * @protected\r\n */\n\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n orient: 'horizontal',\n inverse: false,\n tooltip: {\n trigger: 'item' // data item may also have tootip attr.\n\n },\n symbol: 'circle',\n symbolSize: 12,\n lineStyle: {\n show: true,\n width: 2,\n color: '#DAE1F5'\n },\n label: {\n position: 'auto',\n // When using number, label position is not\n // restricted by viewRect.\n // positive: right/bottom, negative: left/top\n show: true,\n interval: 'auto',\n rotate: 0,\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#A4B1D7'\n },\n itemStyle: {\n color: '#A4B1D7',\n borderWidth: 1\n },\n checkpointStyle: {\n symbol: 'circle',\n symbolSize: 15,\n color: '#316bf3',\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0, 0, 0, 0.3)',\n // borderColor: 'rgba(194,53,49, 0.5)',\n animation: true,\n animationDuration: 300,\n animationEasing: 'quinticInOut'\n },\n controlStyle: {\n show: true,\n showPlayBtn: true,\n showPrevBtn: true,\n showNextBtn: true,\n itemSize: 24,\n itemGap: 12,\n position: 'left',\n 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',\n 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',\n // eslint-disable-next-line max-len\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\n // eslint-disable-next-line max-len\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\n prevBtnSize: 18,\n nextBtnSize: 18,\n color: '#A4B1D7',\n borderColor: '#A4B1D7',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#6f778d'\n },\n itemStyle: {\n color: '#316BF3'\n },\n controlStyle: {\n color: '#316BF3',\n borderColor: '#316BF3',\n borderWidth: 2\n }\n },\n progress: {\n lineStyle: {\n color: '#316BF3'\n },\n itemStyle: {\n color: '#316BF3'\n },\n label: {\n color: '#6f778d'\n }\n },\n data: []\n });\n return SliderTimelineModel;\n}(TimelineModel);\n\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\nexport default SliderTimelineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\n\nvar TimelineView =\n/** @class */\nfunction (_super) {\n __extends(TimelineView, _super);\n\n function TimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineView.type;\n return _this;\n }\n\n TimelineView.type = 'timeline';\n return TimelineView;\n}(ComponentView);\n\nexport default TimelineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../../coord/Axis.js';\n/**\r\n * Extend axis 2d\r\n */\n\nvar TimelineAxis =\n/** @class */\nfunction (_super) {\n __extends(TimelineAxis, _super);\n\n function TimelineAxis(dim, scale, coordExtent, axisType) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TimelineAxis.prototype.getLabelModel = function () {\n // Force override\n return this.model.getModel('label');\n };\n /**\r\n * @override\r\n */\n\n\n TimelineAxis.prototype.isHorizontal = function () {\n return this.model.get('orient') === 'horizontal';\n };\n\n return TimelineAxis;\n}(Axis);\n\nexport default TimelineAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport * as layout from '../../util/layout.js';\nimport TimelineView from './TimelineView.js';\nimport TimelineAxis from './TimelineAxis.js';\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as numberUtil from '../../util/number.js';\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../../scale/Ordinal.js';\nimport TimeScale from '../../scale/Time.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../../util/model.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nvar PI = Math.PI;\nvar labelDataIndexStore = makeInner();\n\nvar SliderTimelineView =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineView, _super);\n\n function SliderTimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineView.type;\n return _this;\n }\n\n SliderTimelineView.prototype.init = function (ecModel, api) {\n this.api = api;\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\n this.model = timelineModel;\n this.api = api;\n this.ecModel = ecModel;\n this.group.removeAll();\n\n if (timelineModel.get('show', true)) {\n var layoutInfo_1 = this._layout(timelineModel, api);\n\n var mainGroup_1 = this._createGroup('_mainGroup');\n\n var labelGroup = this._createGroup('_labelGroup');\n\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\n\n timelineModel.formatTooltip = function (dataIndex) {\n var name = axis_1.scale.getLabel({\n value: dataIndex\n });\n return createTooltipMarkup('nameValue', {\n noName: true,\n value: name\n });\n };\n\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\n }, this);\n\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\n\n this._position(layoutInfo_1, timelineModel);\n }\n\n this._doPlayStop();\n\n this._updateTicksStatus();\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.remove = function () {\n this._clearTimer();\n\n this.group.removeAll();\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.dispose = function () {\n this._clearTimer();\n };\n\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\n var labelPosOpt = timelineModel.get(['label', 'position']);\n var orient = timelineModel.get('orient');\n var viewRect = getViewRect(timelineModel, api);\n var parsedLabelPos; // Auto label offset.\n\n if (labelPosOpt == null || labelPosOpt === 'auto') {\n parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-';\n } else if (isString(labelPosOpt)) {\n parsedLabelPos = {\n horizontal: {\n top: '-',\n bottom: '+'\n },\n vertical: {\n left: '-',\n right: '+'\n }\n }[orient][labelPosOpt];\n } else {\n // is number\n parsedLabelPos = labelPosOpt;\n }\n\n var labelAlignMap = {\n horizontal: 'center',\n vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right'\n };\n var labelBaselineMap = {\n horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom',\n vertical: 'middle'\n };\n var rotationMap = {\n horizontal: 0,\n vertical: PI / 2\n }; // Position\n\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\n var controlModel = timelineModel.getModel('controlStyle');\n var showControl = controlModel.get('show', true);\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\n var sizePlusGap = controlSize + controlGap; // Special label rotate.\n\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\n labelRotation = labelRotation * PI / 180; // To radian.\n\n var playPosition;\n var prevBtnPosition;\n var nextBtnPosition;\n var controlPosition = controlModel.get('position', true);\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\n var xLeft = 0;\n var xRight = mainLength; // position[0] means left, position[1] means middle.\n\n if (controlPosition === 'left' || controlPosition === 'bottom') {\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n } else {\n // 'top' 'right'\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n }\n\n var axisExtent = [xLeft, xRight];\n\n if (timelineModel.get('inverse')) {\n axisExtent.reverse();\n }\n\n return {\n viewRect: viewRect,\n mainLength: mainLength,\n orient: orient,\n rotation: rotationMap[orient],\n labelRotation: labelRotation,\n labelPosOpt: parsedLabelPos,\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\n labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient],\n // Based on mainGroup.\n playPosition: playPosition,\n prevBtnPosition: prevBtnPosition,\n nextBtnPosition: nextBtnPosition,\n axisExtent: axisExtent,\n controlSize: controlSize,\n controlGap: controlGap\n };\n };\n\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\n // Position is be called finally, because bounding rect is needed for\n // adapt content to fill viewRect (auto adapt offset).\n // Timeline may be not all in the viewRect when 'offset' is specified\n // as a number, because it is more appropriate that label aligns at\n // 'offset' but not the other edge defined by viewRect.\n var mainGroup = this._mainGroup;\n var labelGroup = this._labelGroup;\n var viewRect = layoutInfo.viewRect;\n\n if (layoutInfo.orient === 'vertical') {\n // transform to horizontal, inverse rotate by left-top point.\n var m = matrix.create();\n var rotateOriginX = viewRect.x;\n var rotateOriginY = viewRect.y + viewRect.height;\n matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\n matrix.rotate(m, m, -PI / 2);\n matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\n viewRect = viewRect.clone();\n viewRect.applyTransform(m);\n }\n\n var viewBound = getBound(viewRect);\n var mainBound = getBound(mainGroup.getBoundingRect());\n var labelBound = getBound(labelGroup.getBoundingRect());\n var mainPosition = [mainGroup.x, mainGroup.y];\n var labelsPosition = [labelGroup.x, labelGroup.y];\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\n var labelPosOpt = layoutInfo.labelPosOpt;\n\n if (labelPosOpt == null || isString(labelPosOpt)) {\n // '+' or '-'\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\n } else {\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\n }\n\n mainGroup.setPosition(mainPosition);\n labelGroup.setPosition(labelsPosition);\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\n setOrigin(mainGroup);\n setOrigin(labelGroup);\n\n function setOrigin(targetGroup) {\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\n }\n\n function getBound(rect) {\n // [[xmin, xmax], [ymin, ymax]]\n return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];\n }\n\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\n }\n };\n\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\n var data = timelineModel.getData();\n var axisType = timelineModel.get('axisType');\n var scale = createScaleByModel(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`.\n\n scale.getTicks = function () {\n return data.mapArray(['value'], function (value) {\n return {\n value: value\n };\n });\n };\n\n var dataExtent = data.getDataExtent('value');\n scale.setExtent(dataExtent[0], dataExtent[1]);\n scale.calcNiceTicks();\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\n axis.model = timelineModel;\n return axis;\n };\n\n SliderTimelineView.prototype._createGroup = function (key) {\n var newGroup = this[key] = new graphic.Group();\n this.group.add(newGroup);\n return newGroup;\n };\n\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\n var axisExtent = axis.getExtent();\n\n if (!timelineModel.get(['lineStyle', 'show'])) {\n return;\n }\n\n var line = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n y1: 0,\n x2: axisExtent[1],\n y2: 0\n },\n style: extend({\n lineCap: 'round'\n }, timelineModel.getModel('lineStyle').getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(line);\n var progressLine = this._progressLine = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],\n y1: 0,\n y2: 0\n },\n style: defaults({\n lineCap: 'round',\n lineWidth: line.style.lineWidth\n }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(progressLine);\n };\n\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy.\n\n var ticks = axis.scale.getTicks();\n this._tickSymbols = []; // The value is dataIndex, see the customized scale.\n\n each(ticks, function (tick) {\n var tickCoord = axis.dataToCoord(tick.value);\n var itemModel = data.getItemModel(tick.value);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\n var symbolOpt = {\n x: tickCoord,\n y: 0,\n onclick: bind(_this._changeTimeline, _this, tick.value)\n };\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\n enableHoverEmphasis(el);\n var ecData = getECData(el);\n\n if (itemModel.get('tooltip')) {\n ecData.dataIndex = tick.value;\n ecData.dataModel = timelineModel;\n } else {\n ecData.dataIndex = ecData.dataModel = null;\n }\n\n _this._tickSymbols.push(el);\n });\n };\n\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var labelModel = axis.getLabelModel();\n\n if (!labelModel.get('show')) {\n return;\n }\n\n var data = timelineModel.getData();\n var labels = axis.getViewLabels();\n this._tickLabels = [];\n each(labels, function (labelItem) {\n // The tickValue is dataIndex, see the customized scale.\n var dataIndex = labelItem.tickValue;\n var itemModel = data.getItemModel(dataIndex);\n var normalLabelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: 0,\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\n onclick: bind(_this._changeTimeline, _this, dataIndex),\n silent: false,\n style: createTextStyle(normalLabelModel, {\n text: labelItem.formattedLabel,\n align: layoutInfo.labelAlign,\n verticalAlign: layoutInfo.labelBaseline\n })\n });\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\n group.add(textEl);\n enableHoverEmphasis(textEl);\n labelDataIndexStore(textEl).dataIndex = dataIndex;\n\n _this._tickLabels.push(textEl);\n });\n };\n\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\n var controlSize = layoutInfo.controlSize;\n var rotation = layoutInfo.rotation;\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\n var playState = timelineModel.getPlayState();\n var inverse = timelineModel.get('inverse', true);\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\n makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true);\n\n function makeBtn(position, iconName, onclick, willRotate) {\n if (!position) {\n return;\n }\n\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\n var rect = [0, -iconSize / 2, iconSize, iconSize];\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, {\n x: position[0],\n y: position[1],\n originX: controlSize / 2,\n originY: 0,\n rotation: willRotate ? -rotation : 0,\n rectHover: true,\n style: itemStyle,\n onclick: onclick\n });\n btn.ensureState('emphasis').style = hoverStyle;\n group.add(btn);\n enableHoverEmphasis(btn);\n }\n };\n\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\n var data = timelineModel.getData();\n var currentIndex = timelineModel.getCurrentIndex();\n var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');\n var me = this;\n var callback = {\n onCreate: function (pointer) {\n pointer.draggable = true;\n pointer.drift = bind(me._handlePointerDrag, me);\n pointer.ondragend = bind(me._handlePointerDragend, me);\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\n },\n onUpdate: function (pointer) {\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\n }\n }; // Reuse when exists, for animation and drag.\n\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\n };\n\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\n this._clearTimer();\n\n this.api.dispatchAction({\n type: 'timelinePlayChange',\n playState: nextState,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\n this._clearTimer();\n\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\n };\n\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\n };\n\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\n var toCoord = this._toAxisCoord(mousePos)[0];\n\n var axis = this._axis;\n var axisExtent = numberUtil.asc(axis.getExtent().slice());\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\n this._currentPointer.x = toCoord;\n\n this._currentPointer.markRedraw();\n\n var progressLine = this._progressLine;\n\n if (progressLine) {\n progressLine.shape.x2 = toCoord;\n progressLine.dirty();\n }\n\n var targetDataIndex = this._findNearestTick(toCoord);\n\n var timelineModel = this.model;\n\n if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) {\n this._changeTimeline(targetDataIndex);\n }\n };\n\n SliderTimelineView.prototype._doPlayStop = function () {\n var _this = this;\n\n this._clearTimer();\n\n if (this.model.getPlayState()) {\n this._timer = setTimeout(function () {\n // Do not cache\n var timelineModel = _this.model;\n\n _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1));\n }, this.model.get('playInterval'));\n }\n };\n\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\n var trans = this._mainGroup.getLocalTransform();\n\n return graphic.applyTransform(vertex, trans, true);\n };\n\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\n var data = this.model.getData();\n var dist = Infinity;\n var targetDataIndex;\n var axis = this._axis;\n data.each(['value'], function (value, dataIndex) {\n var coord = axis.dataToCoord(value);\n var d = Math.abs(coord - axisCoord);\n\n if (d < dist) {\n dist = d;\n targetDataIndex = dataIndex;\n }\n });\n return targetDataIndex;\n };\n\n SliderTimelineView.prototype._clearTimer = function () {\n if (this._timer) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n };\n\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\n var currentIndex = this.model.getCurrentIndex();\n\n if (nextIndex === '+') {\n nextIndex = currentIndex + 1;\n } else if (nextIndex === '-') {\n nextIndex = currentIndex - 1;\n }\n\n this.api.dispatchAction({\n type: 'timelineChange',\n currentIndex: nextIndex,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._updateTicksStatus = function () {\n var currentIndex = this.model.getCurrentIndex();\n var tickSymbols = this._tickSymbols;\n var tickLabels = this._tickLabels;\n\n if (tickSymbols) {\n for (var i = 0; i < tickSymbols.length; i++) {\n tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex);\n }\n }\n\n if (tickLabels) {\n for (var i = 0; i < tickLabels.length; i++) {\n tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\n }\n }\n };\n\n SliderTimelineView.type = 'timeline.slider';\n return SliderTimelineView;\n}(TimelineView);\n\nfunction createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // default to be value\n return new IntervalScale();\n }\n }\n}\n\nfunction getViewRect(model, api) {\n return layout.getLayoutRect(model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n }, model.get('padding'));\n}\n\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\n var style = opts.style;\n var icon = graphic.createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt.\n\n if (style) {\n icon.setStyle(style);\n }\n\n return icon;\n}\n/**\r\n * Create symbol or update symbol\r\n * opt: basic position and event handlers\r\n */\n\n\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n } else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n\n callback && callback.onUpdate(symbol);\n } // Style\n\n\n var itemStyle = itemStyleModel.getItemStyle(['color']);\n symbol.setStyle(itemStyle); // Transform and events.\n\n opt = merge({\n rectHover: true,\n z2: 100\n }, opt, true);\n var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize'));\n opt.scaleX = symbolSize[0] / 2;\n opt.scaleY = symbolSize[1] / 2;\n var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n opt.x = (opt.x || 0) + symbolOffset[0];\n opt.y = (opt.y || 0) + symbolOffset[1];\n }\n\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n symbol.attr(opt); // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\n symbol.updateTransform();\n return symbol;\n}\n\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\n if (pointer.dragging) {\n return;\n }\n\n var pointerModel = timelineModel.getModel('checkpointStyle');\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\n\n if (noAnimation || !pointerModel.get('animation', true)) {\n pointer.attr({\n x: toCoord,\n y: 0\n });\n progressLine && progressLine.attr({\n shape: {\n x2: toCoord\n }\n });\n } else {\n var animationCfg = {\n duration: pointerModel.get('animationDuration', true),\n easing: pointerModel.get('animationEasing', true)\n };\n pointer.stopAnimation(null, true);\n pointer.animateTo({\n x: toCoord,\n y: 0\n }, animationCfg);\n progressLine && progressLine.animateTo({\n shape: {\n x2: toCoord\n }\n }, animationCfg);\n }\n}\n\nexport default SliderTimelineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { defaults } from 'zrender/lib/core/util.js';\nexport function installTimelineAction(registers) {\n registers.registerAction({\n type: 'timelineChange',\n event: 'timelineChanged',\n update: 'prepareAndUpdate'\n }, function (payload, ecModel, api) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.currentIndex != null) {\n timelineModel.setCurrentIndex(payload.currentIndex);\n\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {\n timelineModel.setPlayState(false); // The timeline has played to the end, trigger event\n\n api.dispatchAction({\n type: 'timelinePlayChange',\n playState: false,\n from: payload.from\n });\n }\n } // Set normalized currentIndex to payload.\n\n\n ecModel.resetOption('timeline', {\n replaceMerge: timelineModel.get('replaceMerge', true)\n });\n return defaults({\n currentIndex: timelineModel.option.currentIndex\n }, payload);\n });\n registers.registerAction({\n type: 'timelinePlayChange',\n event: 'timelinePlayChanged',\n update: 'update'\n }, function (payload, ecModel) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.playState != null) {\n timelineModel.setPlayState(payload.playState);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function timelinePreprocessor(option) {\n var timelineOpt = option && option.timeline;\n\n if (!zrUtil.isArray(timelineOpt)) {\n timelineOpt = timelineOpt ? [timelineOpt] : [];\n }\n\n zrUtil.each(timelineOpt, function (opt) {\n if (!opt) {\n return;\n }\n\n compatibleEC2(opt);\n });\n}\n\nfunction compatibleEC2(opt) {\n var type = opt.type;\n var ec2Types = {\n 'number': 'value',\n 'time': 'time'\n }; // Compatible with ec2\n\n if (ec2Types[type]) {\n opt.axisType = ec2Types[type];\n delete opt.type;\n }\n\n transferItem(opt);\n\n if (has(opt, 'controlPosition')) {\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\n\n if (!has(controlStyle, 'position')) {\n controlStyle.position = opt.controlPosition;\n }\n\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\n controlStyle.show = false;\n delete controlStyle.position;\n }\n\n delete opt.controlPosition;\n }\n\n zrUtil.each(opt.data || [], function (dataItem) {\n if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\n // In ec2, using name as value.\n dataItem.value = dataItem.name;\n }\n\n transferItem(dataItem);\n }\n });\n}\n\nfunction transferItem(opt) {\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out\n\n var label = opt.label || opt.label || {};\n var labelNormal = label.normal || (label.normal = {});\n var excludeLabelAttr = {\n normal: 1,\n emphasis: 1\n };\n zrUtil.each(label, function (value, name) {\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\n labelNormal[name] = value;\n }\n });\n\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\n label.emphasis = itemStyleEmphasis.label;\n delete itemStyleEmphasis.label;\n }\n}\n\nfunction has(obj, attr) {\n return obj.hasOwnProperty(attr);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport SliderTimelineModel from './SliderTimelineModel.js';\nimport SliderTimelineView from './SliderTimelineView.js';\nimport { installTimelineAction } from './timelineAction.js';\nimport preprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderTimelineModel);\n registers.registerComponentView(SliderTimelineView);\n registers.registerSubTypeDefaulter('timeline', function () {\n // Only slider now.\n return 'slider';\n });\n installTimelineAction(registers);\n registers.registerPreprocessor(preprocessor);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nexport default function checkMarkerInSeries(seriesOpts, markerType) {\n if (!seriesOpts) {\n return false;\n }\n\n var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\n\n for (var idx = 0; idx < seriesOptArr.length; idx++) {\n if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {\n return true;\n }\n }\n\n return false;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport ComponentModel from '../../model/Component.js';\nimport { makeInner, defaultEmphasis } from '../../util/model.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\n\nfunction fillLabel(opt) {\n defaultEmphasis(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }\n\n\nvar inner = makeInner();\n\nvar MarkerModel =\n/** @class */\nfunction (_super) {\n __extends(MarkerModel, _super);\n\n function MarkerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerModel.type;\n /**\r\n * If marker model is created by self from series\r\n */\n\n _this.createdBySelf = false;\n return _this;\n }\n /**\r\n * @overrite\r\n */\n\n\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n if (this.type === 'marker') {\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._mergeOption(option, ecModel, false, true);\n };\n\n MarkerModel.prototype.isAnimationEnabled = function () {\n if (env.node) {\n return false;\n }\n\n var hostSeries = this.__hostSeries;\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\n };\n /**\r\n * @overrite\r\n */\n\n\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\n this._mergeOption(newOpt, ecModel, false, false);\n };\n\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\n var componentType = this.mainType;\n\n if (!createdBySelf) {\n ecModel.eachSeries(function (seriesModel) {\n // mainType can be markPoint, markLine, markArea\n var markerOpt = seriesModel.get(this.mainType, true);\n var markerModel = inner(seriesModel)[componentType];\n\n if (!markerOpt || !markerOpt.data) {\n inner(seriesModel)[componentType] = null;\n return;\n }\n\n if (!markerModel) {\n if (isInit) {\n // Default label emphasis `position` and `show`\n fillLabel(markerOpt);\n }\n\n zrUtil.each(markerOpt.data, function (item) {\n // FIXME Overwrite fillLabel method ?\n if (item instanceof Array) {\n fillLabel(item[0]);\n fillLabel(item[1]);\n } else {\n fillLabel(item);\n }\n });\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); // markerModel = new ImplementedMarkerModel(\n // markerOpt, this, ecModel\n // );\n\n zrUtil.extend(markerModel, {\n mainType: this.mainType,\n // Use the same series index and name\n seriesIndex: seriesModel.seriesIndex,\n name: seriesModel.name,\n createdBySelf: true\n });\n markerModel.__hostSeries = seriesModel;\n } else {\n markerModel._mergeOption(markerOpt, ecModel, true);\n }\n\n inner(seriesModel)[componentType] = markerModel;\n }, this);\n }\n };\n\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var itemName = data.getName(dataIndex);\n return createTooltipMarkup('section', {\n header: this.name,\n blocks: [createTooltipMarkup('nameValue', {\n name: itemName,\n value: value,\n noName: !itemName,\n noValue: value == null\n })]\n });\n };\n\n MarkerModel.prototype.getData = function () {\n return this._data;\n };\n\n MarkerModel.prototype.setData = function (data) {\n this._data = data;\n };\n\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, // Support three types of markers. Strict check.\n componentType) {\n return inner(seriesModel)[componentType];\n };\n\n MarkerModel.type = 'marker';\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\n return MarkerModel;\n}(ComponentModel);\n\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\nexport default MarkerModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkPointModel =\n/** @class */\nfunction (_super) {\n __extends(MarkPointModel, _super);\n\n function MarkPointModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointModel.type;\n return _this;\n }\n\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkPointModel.type = 'markPoint';\n MarkPointModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: 'pin',\n symbolSize: 50,\n // symbolRotate: 0,\n // symbolOffset: [0, 0]\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'inside'\n },\n itemStyle: {\n borderWidth: 2\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return MarkPointModel;\n}(MarkerModel);\n\nexport default MarkPointModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as numberUtil from '../../util/number.js';\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { indexOf, curry, clone, isArray } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\n\nfunction hasXOrY(item) {\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}\n\nfunction hasXAndY(item) {\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\n}\n\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\n var coordArr = [];\n var stacked = isDimensionStacked(data, targetDataDim\n /* , otherDataDim */\n );\n var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim;\n var value = numCalculate(data, calcDataDim, markerType);\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\n var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.\n\n var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\n precision = Math.min(precision, 20);\n\n if (precision >= 0) {\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\n }\n\n return [coordArr, coordArrValue];\n} // TODO Specified percent\n\n\nvar markerTypeCalculator = {\n min: curry(markerTypeCalculatorWithExtent, 'min'),\n max: curry(markerTypeCalculatorWithExtent, 'max'),\n average: curry(markerTypeCalculatorWithExtent, 'average'),\n median: curry(markerTypeCalculatorWithExtent, 'median')\n};\n/**\r\n * Transform markPoint data item to format used in List by do the following\r\n * 1. Calculate statistic like `max`, `min`, `average`\r\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\r\n */\n\nexport function dataTransform(seriesModel, item) {\n if (!item) {\n return;\n }\n\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dims = coordSys && coordSys.dimensions; // 1. If not specify the position with pixel directly\n // 2. If `coord` is not a data array. Which uses `xAxis`,\n // `yAxis` to specify the coord on each dimension\n // parseFloat first because item.x and item.y can be percent string like '20%'\n\n if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) {\n var axisInfo = getAxisInfo(item, data, coordSys, seriesModel); // Clone the option\n // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\n\n item = clone(item);\n\n if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\n item.coord = coordInfo[0]; // Force to use the value of calculated value.\n // let item use the value without stack.\n\n item.value = coordInfo[1];\n } else {\n // FIXME Only has one of xAxis and yAxis.\n item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];\n }\n } // x y is provided\n\n\n if (item.coord == null || !isArray(dims)) {\n item.coord = [];\n } else {\n // Each coord support max, min, average\n var coord = item.coord;\n\n for (var i = 0; i < 2; i++) {\n if (markerTypeCalculator[coord[i]]) {\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\n }\n }\n }\n\n return item;\n}\nexport function getAxisInfo(item, data, coordSys, seriesModel) {\n var ret = {};\n\n if (item.valueIndex != null || item.valueDim != null) {\n ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n } else {\n ret.baseAxis = seriesModel.getBaseAxis();\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\n }\n\n return ret;\n}\n\nfunction dataDimToCoordDim(seriesModel, dataDim) {\n var dimItem = seriesModel.getData().getDimensionInfo(dataDim);\n return dimItem && dimItem.coordDim;\n}\n/**\r\n * Filter data which is out of coordinateSystem range\r\n * [dataFilter description]\r\n */\n\n\nexport function dataFilter( // Currently only polar and cartesian has containData.\ncoordSys, item) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;\n}\nexport function zoneFilter( // Currently only polar and cartesian has containData.\ncoordSys, item1, item2) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;\n}\nexport function createMarkerDimValueGetter(inCoordSys, dims) {\n return inCoordSys ? function (item, dimName, dataIndex, dimIndex) {\n var rawVal = dimIndex < 2 // x, y, radius, angle\n ? item.coord && item.coord[dimIndex] : item.value;\n return parseDataValue(rawVal, dims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dims[dimIndex]);\n };\n}\nexport function numCalculate(data, valueDataDim, type) {\n if (type === 'average') {\n var sum_1 = 0;\n var count_1 = 0;\n data.each(valueDataDim, function (val, idx) {\n if (!isNaN(val)) {\n sum_1 += val;\n count_1++;\n }\n });\n return sum_1 / count_1;\n } else if (type === 'median') {\n return data.getMedian(valueDataDim);\n } else {\n // max & min\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { enterBlur, leaveBlur } from '../../util/states.js';\nvar inner = makeInner();\n\nvar MarkerView =\n/** @class */\nfunction (_super) {\n __extends(MarkerView, _super);\n\n function MarkerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerView.type;\n return _this;\n }\n\n MarkerView.prototype.init = function () {\n this.markerGroupMap = createHashMap();\n };\n\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\n var _this = this;\n\n var markerGroupMap = this.markerGroupMap;\n markerGroupMap.each(function (item) {\n inner(item).keep = false;\n });\n ecModel.eachSeries(function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\n });\n markerGroupMap.each(function (item) {\n !inner(item).keep && _this.group.remove(item.group);\n });\n };\n\n MarkerView.prototype.markKeep = function (drawGroup) {\n inner(drawGroup).keep = true;\n };\n\n MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) {\n var _this = this;\n\n each(seriesModelList, function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n\n if (markerModel) {\n var data = markerModel.getData();\n data.eachItemGraphicEl(function (el) {\n if (el) {\n isBlur ? enterBlur(el) : leaveBlur(el);\n }\n });\n }\n });\n };\n\n MarkerView.type = 'marker';\n return MarkerView;\n}(ComponentView);\n\nexport default MarkerView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../../chart/helper/SymbolDraw.js';\nimport * as numberUtil from '../../util/number.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isFunction, map, filter, curry, extend } from 'zrender/lib/core/util.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getVisualFromData } from '../../visual/helper.js';\n\nfunction updateMarkerLayout(mpData, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } // Chart like bar may have there own marker positioning logic\n else if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\n } else if (coordSys) {\n var x = mpData.get(coordSys.dimensions[0], idx);\n var y = mpData.get(coordSys.dimensions[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n\n mpData.setItemLayout(idx, point);\n });\n}\n\nvar MarkPointView =\n/** @class */\nfunction (_super) {\n __extends(MarkPointView, _super);\n\n function MarkPointView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointView.type;\n return _this;\n }\n\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\n\n if (mpModel) {\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var symbolDrawMap = this.markerGroupMap;\n var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());\n var mpData = createData(coordSys, seriesModel, mpModel); // FIXME\n\n mpModel.setData(mpData);\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var symbol = itemModel.getShallow('symbol');\n var symbolSize = itemModel.getShallow('symbolSize');\n var symbolRotate = itemModel.getShallow('symbolRotate');\n var symbolOffset = itemModel.getShallow('symbolOffset');\n var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect'); // TODO: refactor needed: single data item should not support callback function\n\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {\n var rawIdx = mpModel.getRawValue(idx);\n var dataParams = mpModel.getDataParams(idx);\n\n if (isFunction(symbol)) {\n symbol = symbol(rawIdx, dataParams);\n }\n\n if (isFunction(symbolSize)) {\n // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?\n symbolSize = symbolSize(rawIdx, dataParams);\n }\n\n if (isFunction(symbolRotate)) {\n symbolRotate = symbolRotate(rawIdx, dataParams);\n }\n\n if (isFunction(symbolOffset)) {\n symbolOffset = symbolOffset(rawIdx, dataParams);\n }\n }\n\n var style = itemModel.getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n }\n\n mpData.setItemVisual(idx, {\n symbol: symbol,\n symbolSize: symbolSize,\n symbolRotate: symbolRotate,\n symbolOffset: symbolOffset,\n symbolKeepAspect: symbolKeepAspect,\n style: style\n });\n }); // TODO Text are wrong\n\n symbolDraw.updateData(mpData);\n this.group.add(symbolDraw.group); // Set host model for tooltip\n // FIXME\n\n mpData.eachItemGraphicEl(function (el) {\n el.traverse(function (child) {\n getECData(child).dataModel = mpModel;\n });\n });\n this.markKeep(symbolDraw);\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkPointView.type = 'markPoint';\n return MarkPointView;\n}(MarkerView);\n\nfunction createData(coordSys, seriesModel, mpModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n 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\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var mpData = new SeriesData(coordDimsInfos, mpModel);\n var dataOpt = map(mpModel.get('data'), curry(markerHelper.dataTransform, seriesModel));\n\n if (coordSys) {\n dataOpt = filter(dataOpt, curry(markerHelper.dataFilter, coordSys));\n }\n\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n mpData.initData(dataOpt, null, dimValueGetter);\n return mpData;\n}\n\nexport default MarkPointView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkPointModel from './MarkPointModel.js';\nimport MarkPointView from './MarkPointView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkPointModel);\n registers.registerComponentView(MarkPointView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markPoint')) {\n // Make sure markPoint component is enabled\n opt.markPoint = opt.markPoint || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkLineModel =\n/** @class */\nfunction (_super) {\n __extends(MarkLineModel, _super);\n\n function MarkLineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineModel.type;\n return _this;\n }\n\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkLineModel.type = 'markLine';\n MarkLineModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: ['circle', 'arrow'],\n symbolSize: [8, 16],\n // symbolRotate: 0,\n symbolOffset: 0,\n precision: 2,\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'end',\n distance: 5\n },\n lineStyle: {\n type: 'dashed'\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n width: 3\n }\n },\n animationEasing: 'linear'\n };\n return MarkLineModel;\n}(MarkerModel);\n\nexport default MarkLineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as markerHelper from './markerHelper.js';\nimport LineDraw from '../../chart/helper/LineDraw.js';\nimport MarkerView from './MarkerView.js';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getECData } from '../../util/innerStore.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, curry, filter, isNumber } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nvar inner = makeInner();\n\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n var data = seriesModel.getData();\n var itemArray;\n\n if (!isArray(item)) {\n // Special type markLine like 'min', 'max', 'average', 'median'\n var mlType = item.type;\n\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case\n // data: [{\n // yAxis: 10\n // }]\n || item.xAxis != null || item.yAxis != null) {\n var valueAxis = void 0;\n var value = void 0;\n\n if (item.yAxis != null || item.xAxis != null) {\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n value = retrieve(item.yAxis, item.xAxis);\n } else {\n var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n valueAxis = axisInfo.valueAxis;\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\n }\n\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n var baseIndex = 1 - valueIndex; // Normized to 2d data with start and end point\n\n var mlFrom = clone(item);\n var mlTo = {\n coord: []\n };\n mlFrom.type = null;\n mlFrom.coord = [];\n mlFrom.coord[baseIndex] = -Infinity;\n mlTo.coord[baseIndex] = Infinity;\n var precision = mlModel.get('precision');\n\n if (precision >= 0 && isNumber(value)) {\n value = +value.toFixed(Math.min(precision, 20));\n }\n\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n itemArray = [mlFrom, mlTo, {\n type: mlType,\n valueIndex: item.valueIndex,\n // Force to use the value of calculated value.\n value: value\n }];\n } else {\n // Invalid data\n if (process.env.NODE_ENV !== 'production') {\n logError('Invalid markLine data.');\n }\n\n itemArray = [];\n }\n } else {\n itemArray = item;\n }\n\n var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; // Avoid line data type is extended by from(to) data type\n\n normalizedItem[2].type = normalizedItem[2].type || null; // Merge from option and to option into line option\n\n merge(normalizedItem[2], normalizedItem[0]);\n merge(normalizedItem[2], normalizedItem[1]);\n return normalizedItem;\n};\n\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markLine has one dim\n\n\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n var dimName = coordSys.dimensions[dimIndex];\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\n\nfunction markLineFilter(coordSys, item) {\n if (coordSys.type === 'cartesian2d') {\n var fromCoord = item[0].coord;\n var toCoord = item[1].coord; // In case\n // {\n // markLine: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n\n if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n\n return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\n\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n } else {\n var dims = coordSys.dimensions;\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Expand line to the edge of grid if value on one axis is Inifnity\n // In case\n // markLine: {\n // data: [{\n // yAxis: 2\n // // or\n // type: 'average'\n // }]\n // }\n\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var dims = coordSys.dimensions;\n\n if (isInfinity(data.get(dims[0], idx))) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n } else if (isInfinity(data.get(dims[1], idx))) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n data.setItemLayout(idx, point);\n}\n\nvar MarkLineView =\n/** @class */\nfunction (_super) {\n __extends(MarkLineView, _super);\n\n function MarkLineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineView.type;\n return _this;\n }\n\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n\n if (mlModel) {\n var mlData_1 = mlModel.getData();\n var fromData_1 = inner(mlModel).from;\n var toData_1 = inner(mlModel).to; // Update visual and layout of from symbol and to symbol\n\n fromData_1.each(function (idx) {\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n }); // Update layout of line\n\n mlData_1.each(function (idx) {\n mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n });\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var lineDrawMap = this.markerGroupMap;\n var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n this.group.add(lineDraw.group);\n var mlData = createList(coordSys, seriesModel, mlModel);\n var fromData = mlData.from;\n var toData = mlData.to;\n var lineData = mlData.line;\n inner(mlModel).from = fromData;\n inner(mlModel).to = toData; // Line data for tooltip and formatter\n\n mlModel.setData(lineData); // TODO\n // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\n // But the related logic and type definition are not finished yet.\n // Finish it if required\n\n var symbolType = mlModel.get('symbol');\n var symbolSize = mlModel.get('symbolSize');\n var symbolRotate = mlModel.get('symbolRotate');\n var symbolOffset = mlModel.get('symbolOffset'); // TODO: support callback function like markPoint\n\n if (!isArray(symbolType)) {\n symbolType = [symbolType, symbolType];\n }\n\n if (!isArray(symbolSize)) {\n symbolSize = [symbolSize, symbolSize];\n }\n\n if (!isArray(symbolRotate)) {\n symbolRotate = [symbolRotate, symbolRotate];\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n } // Update visual and layout of from symbol and to symbol\n\n\n mlData.from.each(function (idx) {\n updateDataVisualAndLayout(fromData, idx, true);\n updateDataVisualAndLayout(toData, idx, false);\n }); // Update visual and layout of line\n\n lineData.each(function (idx) {\n var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); // lineData.setItemVisual(idx, {\n // color: lineColor || fromData.getItemVisual(idx, 'color')\n // });\n\n lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n\n if (lineStyle.stroke == null) {\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n }\n\n lineData.setItemVisual(idx, {\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n toSymbol: toData.getItemVisual(idx, 'symbol'),\n style: lineStyle\n });\n });\n lineDraw.updateData(lineData); // Set host model for tooltip\n // FIXME\n\n mlData.line.eachItemGraphicEl(function (el) {\n getECData(el).dataModel = mlModel;\n el.traverse(function (child) {\n getECData(child).dataModel = mlModel;\n });\n });\n\n function updateDataVisualAndLayout(data, idx, isFrom) {\n var itemModel = data.getItemModel(idx);\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (style.fill == null) {\n style.fill = getVisualFromData(seriesData, 'color');\n }\n\n data.setItemVisual(idx, {\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]),\n symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n // TODO: when 2d array is supported, it should ignore parent\n symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n style: style\n });\n }\n\n this.markKeep(lineDraw);\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkLineView.type = 'markLine';\n return MarkLineView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, mlModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n 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\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var fromData = new SeriesData(coordDimsInfos, mlModel);\n var toData = new SeriesData(coordDimsInfos, mlModel); // No dimensions\n\n var lineData = new SeriesData([], mlModel);\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markLineFilter, coordSys));\n }\n\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n fromData.initData(map(optData, function (item) {\n return item[0];\n }), null, dimValueGetter);\n toData.initData(map(optData, function (item) {\n return item[1];\n }), null, dimValueGetter);\n lineData.initData(map(optData, function (item) {\n return item[2];\n }));\n lineData.hasItemOption = true;\n return {\n from: fromData,\n to: toData,\n line: lineData\n };\n}\n\nexport default MarkLineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkLineModel from './MarkLineModel.js';\nimport MarkLineView from './MarkLineView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkLineModel);\n registers.registerComponentView(MarkLineView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markLine')) {\n // Make sure markLine component is enabled\n opt.markLine = opt.markLine || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkAreaModel =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaModel, _super);\n\n function MarkAreaModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaModel.type;\n return _this;\n }\n\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkAreaModel.type = 'markArea';\n MarkAreaModel.defaultOption = {\n // zlevel: 0,\n // PENDING\n z: 1,\n tooltip: {\n trigger: 'item'\n },\n // markArea should fixed on the coordinate system\n animation: false,\n label: {\n show: true,\n position: 'top'\n },\n itemStyle: {\n // color and borderColor default to use color from series\n // color: 'auto'\n // borderColor: 'auto'\n borderWidth: 0\n },\n emphasis: {\n label: {\n show: true,\n position: 'top'\n }\n }\n };\n return MarkAreaModel;\n}(MarkerModel);\n\nexport default MarkAreaModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO Optimize on polar\n\nimport * as colorUtil from 'zrender/lib/tool/color.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport { retrieve, mergeAll, map, curry, filter, extend, isString } from 'zrender/lib/core/util.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nvar inner = makeInner();\n\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\n // item may be null\n var item0 = item[0];\n var item1 = item[1];\n\n if (!item0 || !item1) {\n return;\n }\n\n var lt = markerHelper.dataTransform(seriesModel, item0);\n var rb = markerHelper.dataTransform(seriesModel, item1); // FIXME make sure lt is less than rb\n\n var ltCoord = lt.coord;\n var rbCoord = rb.coord;\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\n rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one\n\n var result = mergeAll([{}, lt, rb]);\n result.coord = [lt.coord, rb.coord];\n result.x0 = lt.x;\n result.y0 = lt.y;\n result.x1 = rb.x;\n result.y1 = rb.y;\n return result;\n};\n\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markArea has one dim\n\n\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);\n}\n\nfunction markAreaFilter(coordSys, item) {\n var fromCoord = item.coord[0];\n var toCoord = item.coord[1];\n var item0 = {\n coord: fromCoord,\n x: item.x0,\n y: item.y0\n };\n var item1 = {\n coord: toCoord,\n x: item.x1,\n y: item.y1\n };\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // In case\n // {\n // markArea: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n } // Directly returning true may also do the work,\n // because markArea will not be shown automatically\n // when it's not included in coordinate system.\n // But filtering ahead can avoid keeping rendering markArea\n // when there are too many of them.\n\n\n return markerHelper.zoneFilter(coordSys, item0, item1);\n }\n\n return markerHelper.dataFilter(coordSys, item0) || markerHelper.dataFilter(coordSys, item1);\n} // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\n\n\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Consider the case that user input the right-bottom point first\n // Pick the larger x and y as 'x1' and 'y1'\n var pointValue0 = data.getValues(['x0', 'y0'], idx);\n var pointValue1 = data.getValues(['x1', 'y1'], idx);\n var clampPointValue0 = coordSys.clampData(pointValue0);\n var clampPointValue1 = coordSys.clampData(pointValue1);\n var pointValue = [];\n\n if (dims[0] === 'x0') {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0];\n } else {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0];\n }\n\n if (dims[1] === 'y0') {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1];\n } else {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1];\n } // Use the getMarkerPosition\n\n\n point = seriesModel.getMarkerPosition(pointValue, dims, true);\n } else {\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n var pt = [x, y];\n coordSys.clampData && coordSys.clampData(pt, pt);\n point = coordSys.dataToPoint(pt, true);\n }\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n\n if (isInfinity(x)) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\n } else if (isInfinity(y)) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n return point;\n}\n\nexport var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\n\nvar MarkAreaView =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaView, _super);\n\n function MarkAreaView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaView.type;\n return _this;\n }\n\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\n\n if (maModel) {\n var areaData_1 = maModel.getData();\n areaData_1.each(function (idx) {\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\n }); // Layout\n\n areaData_1.setItemLayout(idx, points);\n var el = areaData_1.getItemGraphicEl(idx);\n el.setShape('points', points);\n });\n }\n }, this);\n };\n\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var areaGroupMap = this.markerGroupMap;\n var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {\n group: new graphic.Group()\n });\n this.group.add(polygonGroup.group);\n this.markKeep(polygonGroup);\n var areaData = createList(coordSys, seriesModel, maModel); // Line data for tooltip and formatter\n\n maModel.setData(areaData); // Update visual and layout of line\n\n areaData.each(function (idx) {\n // Layout\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n });\n var xAxisScale = coordSys.getAxis('x').scale;\n var yAxisScale = coordSys.getAxis('y').scale;\n var xAxisExtent = xAxisScale.getExtent();\n var yAxisExtent = yAxisScale.getExtent();\n var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\n var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\n numberUtil.asc(xPointExtent);\n numberUtil.asc(yPointExtent);\n var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); // If none of the area is inside coordSys, allClipped is set to be true\n // in layout so that label will not be displayed. See #12591\n\n var allClipped = !overlapped;\n areaData.setItemLayout(idx, {\n points: points,\n allClipped: allClipped\n });\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n\n if (isString(style.fill)) {\n style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\n }\n }\n\n if (!style.stroke) {\n style.stroke = color;\n } // Visual\n\n\n areaData.setItemVisual(idx, 'style', style);\n });\n areaData.diff(inner(polygonGroup).data).add(function (idx) {\n var layout = areaData.getItemLayout(idx);\n\n if (!layout.allClipped) {\n var polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n areaData.setItemGraphicEl(idx, polygon);\n polygonGroup.group.add(polygon);\n }\n }).update(function (newIdx, oldIdx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx);\n var layout = areaData.getItemLayout(newIdx);\n\n if (!layout.allClipped) {\n if (polygon) {\n graphic.updateProps(polygon, {\n shape: {\n points: layout.points\n }\n }, maModel, newIdx);\n } else {\n polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n }\n\n areaData.setItemGraphicEl(newIdx, polygon);\n polygonGroup.group.add(polygon);\n } else if (polygon) {\n polygonGroup.group.remove(polygon);\n }\n }).remove(function (idx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\n polygonGroup.group.remove(polygon);\n }).execute();\n areaData.eachItemGraphicEl(function (polygon, idx) {\n var itemModel = areaData.getItemModel(idx);\n var style = areaData.getItemVisual(idx, 'style');\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\n labelFetcher: maModel,\n labelDataIndex: idx,\n defaultText: areaData.getName(idx) || '',\n inheritColor: isString(style.fill) ? colorUtil.modifyAlpha(style.fill, 1) : '#000'\n });\n setStatesStylesFromModel(polygon, itemModel);\n toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled']));\n getECData(polygon).dataModel = maModel;\n });\n inner(polygonGroup).data = areaData;\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkAreaView.type = 'markArea';\n return MarkAreaView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, maModel) {\n var areaData;\n var dataDims;\n var dims = ['x0', 'y0', 'x1', 'y1'];\n\n if (coordSys) {\n var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) {\n var data = seriesModel.getData();\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n dataDims = map(dims, function (dim, idx) {\n return {\n name: dim,\n type: coordDimsInfos_1[idx % 2].type\n };\n });\n areaData = new SeriesData(dataDims, maModel);\n } else {\n dataDims = [{\n name: 'value',\n type: 'float'\n }];\n areaData = new SeriesData(dataDims, maModel);\n }\n\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markAreaFilter, coordSys));\n }\n\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\n // TODO should convert to ParsedValue?\n var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\n return parseDataValue(rawVal, dataDims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dataDims[dimIndex]);\n };\n areaData.initData(optData, null, dimValueGetter);\n areaData.hasItemOption = true;\n return areaData;\n}\n\nexport default MarkAreaView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkAreaModel from './MarkAreaModel.js';\nimport MarkAreaView from './MarkAreaView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkAreaModel);\n registers.registerComponentView(MarkAreaView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markArea')) {\n // Make sure markArea component is enabled\n opt.markArea = opt.markArea || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../../model/Model.js';\nimport { isNameSpecified } from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar getDefaultSelectorOptions = function (ecModel, type) {\n if (type === 'all') {\n return {\n type: 'all',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'all'])\n };\n } else if (type === 'inverse') {\n return {\n type: 'inverse',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse'])\n };\n }\n};\n\nvar LegendModel =\n/** @class */\nfunction (_super) {\n __extends(LegendModel, _super);\n\n function LegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendModel.type;\n _this.layoutMode = {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas real width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n };\n return _this;\n }\n\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype._updateSelector = function (option) {\n var selector = option.selector;\n var ecModel = this.ecModel;\n\n if (selector === true) {\n selector = option.selector = ['all', 'inverse'];\n }\n\n if (zrUtil.isArray(selector)) {\n zrUtil.each(selector, function (item, index) {\n zrUtil.isString(item) && (item = {\n type: item\n });\n selector[index] = zrUtil.merge(item, getDefaultSelectorOptions(ecModel, item.type));\n });\n }\n };\n\n LegendModel.prototype.optionUpdated = function () {\n this._updateData(this.ecModel);\n\n var legendData = this._data; // If selectedMode is single, try to select one\n\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false; // If has any selected in option.selected\n\n for (var i = 0; i < legendData.length; i++) {\n var name_1 = legendData[i].get('name');\n\n if (this.isSelected(name_1)) {\n // Force to unselect others\n this.select(name_1);\n hasSelected = true;\n break;\n }\n } // Try select the first if selectedMode is single\n\n\n !hasSelected && this.select(legendData[0].get('name'));\n }\n };\n\n LegendModel.prototype._updateData = function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n var names = provider.getAllNames();\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\r\n * @type {Array.}\r\n * @private\r\n */\n\n this._availableNames = availableNames; // If legend.data is not specified in option, use availableNames as data,\n // which is convenient for user preparing option.\n\n var rawData = this.get('data') || potentialData;\n var legendNameMap = zrUtil.createHashMap();\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (zrUtil.isString(dataItem) || zrUtil.isNumber(dataItem)) {\n dataItem = {\n name: dataItem\n };\n }\n\n if (legendNameMap.get(dataItem.name)) {\n // remove legend name duplicate\n return null;\n }\n\n legendNameMap.set(dataItem.name, true);\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\r\n * @type {Array.}\r\n * @private\r\n */\n\n this._data = zrUtil.filter(legendData, function (item) {\n return !!item;\n });\n };\n\n LegendModel.prototype.getData = function () {\n return this._data;\n };\n\n LegendModel.prototype.select = function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n\n selected[name] = true;\n };\n\n LegendModel.prototype.unSelect = function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n };\n\n LegendModel.prototype.toggleSelected = function (name) {\n var selected = this.option.selected; // Default is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n this[selected[name] ? 'unSelect' : 'select'](name);\n };\n\n LegendModel.prototype.allSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name', true)] = true;\n });\n };\n\n LegendModel.prototype.inverseSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n var name = dataItem.get('name', true); // Initially, default value is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n selected[name] = !selected[name];\n });\n };\n\n LegendModel.prototype.isSelected = function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n };\n\n LegendModel.prototype.getOrient = function () {\n return this.get('orient') === 'vertical' ? {\n index: 1,\n name: 'vertical'\n } : {\n index: 0,\n name: 'horizontal'\n };\n };\n\n LegendModel.type = 'legend.plain';\n LegendModel.dependencies = ['series'];\n LegendModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n show: true,\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n itemWidth: 25,\n itemHeight: 14,\n symbolRotate: 'inherit',\n symbolKeepAspect: true,\n inactiveColor: '#ccc',\n inactiveBorderColor: '#ccc',\n inactiveBorderWidth: 'auto',\n itemStyle: {\n color: 'inherit',\n opacity: 'inherit',\n borderColor: 'inherit',\n borderWidth: 'auto',\n borderCap: 'inherit',\n borderJoin: 'inherit',\n borderDashOffset: 'inherit',\n borderMiterLimit: 'inherit'\n },\n lineStyle: {\n width: 'auto',\n color: 'inherit',\n inactiveColor: '#ccc',\n inactiveWidth: 2,\n opacity: 'inherit',\n type: 'inherit',\n cap: 'inherit',\n join: 'inherit',\n dashOffset: 'inherit',\n miterLimit: 'inherit'\n },\n textStyle: {\n color: '#333'\n },\n selectedMode: true,\n selector: false,\n selectorLabel: {\n show: true,\n borderRadius: 10,\n padding: [3, 5, 3, 5],\n fontSize: 12,\n fontFamily: 'sans-serif',\n color: '#666',\n borderWidth: 1,\n borderColor: '#666'\n },\n emphasis: {\n selectorLabel: {\n show: true,\n color: '#eee',\n backgroundColor: '#666'\n }\n },\n selectorPosition: 'auto',\n selectorItemGap: 7,\n selectorButtonGap: 10,\n tooltip: {\n show: false\n }\n };\n return LegendModel;\n}(ComponentModel);\n\nexport default LegendModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parse, stringify } from 'zrender/lib/tool/color.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\nimport { makeBackground } from '../helper/listComponent.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport ComponentView from '../../view/Component.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar LegendView =\n/** @class */\nfunction (_super) {\n __extends(LegendView, _super);\n\n function LegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendView.type;\n _this.newlineDisabled = false;\n return _this;\n }\n\n LegendView.prototype.init = function () {\n this.group.add(this._contentGroup = new Group());\n this.group.add(this._selectorGroup = new Group());\n this._isFirstRender = true;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getContentGroup = function () {\n return this._contentGroup;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getSelectorGroup = function () {\n return this._selectorGroup;\n };\n /**\r\n * @override\r\n */\n\n\n LegendView.prototype.render = function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n var orient = legendModel.get('orient');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n } // selector has been normalized to an array in model\n\n\n var selector = legendModel.get('selector', true);\n var selectorPosition = legendModel.get('selectorPosition', true);\n\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.x = layoutRect.x - mainRect.x;\n this.group.y = layoutRect.y - mainRect.y;\n this.group.markRedraw(); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n };\n\n LegendView.prototype.resetInner = function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n this.getSelectorGroup().removeAll();\n };\n\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\n var name = legendItemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n var g = new Group(); // @ts-ignore\n\n g.newline = true;\n contentGroup.add(g);\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawn\n return;\n } // Legend to control series.\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n var legendIcon = data.getVisual('legendIcon');\n /**\r\n * `data.getVisual('style')` may be the color from the register\r\n * in series. For example, for line series,\r\n */\n\n var style = data.getVisual('style');\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Legend to control data. In pie and funnel.\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n\n if (!provider.containName(name)) {\n return;\n }\n\n var idx = provider.indexOfName(name);\n var style = provider.getItemVisual(idx, 'style');\n var legendIcon = provider.getItemVisual(idx, 'legendIcon');\n var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range.\n // Do not show nothing.\n\n if (colorArr && colorArr[3] === 0) {\n colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n\n style = zrUtil.extend(zrUtil.extend({}, style), {\n fill: stringify(colorArr, 'rgba')\n });\n }\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!legendDrawnMap.get(name)) {\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n }\n }\n }, this);\n\n if (selector) {\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\n }\n };\n\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n each(selector, function createSelectorButton(selectorItem) {\n var type = selectorItem.type;\n var labelText = new graphic.Text({\n style: {\n x: 0,\n y: 0,\n align: 'center',\n verticalAlign: 'middle'\n },\n onclick: function () {\n api.dispatchAction({\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\n });\n }\n });\n selectorGroup.add(labelText);\n var labelModel = legendModel.getModel('selectorLabel');\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n setLabelStyle(labelText, {\n normal: labelModel,\n emphasis: emphasisLabelModel\n }, {\n defaultText: selectorItem.title\n });\n enableHoverEmphasis(labelText);\n });\n };\n\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {\n var drawType = seriesModel.visualDrawType;\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var isSelected = legendModel.isSelected(name);\n var iconRotate = legendItemModel.get('symbolRotate');\n var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\n var legendIconType = legendItemModel.get('icon');\n legendIcon = legendIconType || legendIcon || 'roundRect';\n var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);\n var itemGroup = new Group();\n var textStyleModel = legendItemModel.getModel('textStyle');\n\n if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\n // Series has specific way to define legend icon\n itemGroup.add(seriesModel.getLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: iconRotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n } else {\n // Use default legend icon policy for most series\n var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\n\n itemGroup.add(getDefaultLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: rotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (zrUtil.isString(formatter) && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (zrUtil.isFunction(formatter)) {\n content = formatter(name);\n }\n\n var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n fill: textColor,\n align: textAlign,\n verticalAlign: 'middle'\n }, {\n inheritColor: textColor\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true\n });\n var tooltipModel = legendItemModel.getModel('tooltip');\n\n if (tooltipModel.get('show')) {\n graphic.setTooltipConfig({\n el: hitRect,\n componentModel: legendModel,\n itemName: name,\n itemTooltipOption: tooltipModel.option\n });\n }\n\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n enableHoverEmphasis(itemGroup); // @ts-ignore\n\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n };\n\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n var contentPos = [-contentRect.x, -contentRect.y];\n selectorGroup.markRedraw();\n contentGroup.markRedraw();\n\n if (selector) {\n // Place buttons in selectorGroup\n layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var orientIdx = legendModel.getOrient().index;\n var wh = orientIdx === 0 ? 'width' : 'height';\n var hw = orientIdx === 0 ? 'height' : 'width';\n var yx = orientIdx === 0 ? 'y' : 'x';\n\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n } else {\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n } // Always align selector to content as 'middle'\n\n\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n var mainRect = {\n x: 0,\n y: 0\n };\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n return mainRect;\n } else {\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n return this.group.getBoundingRect();\n }\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.remove = function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n };\n\n LegendView.type = 'legend.plain';\n return LegendView;\n}(ComponentView);\n\nfunction getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {\n /**\r\n * Use series style if is inherit;\r\n * elsewise, use legend style\r\n */\n function handleCommonProps(style, visualStyle) {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n if (style.lineWidth === 'auto') {\n style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\n }\n\n each(style, function (propVal, propName) {\n style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\n });\n } // itemStyle\n\n\n var itemStyleModel = legendItemModel.getModel('itemStyle');\n var itemStyle = itemStyleModel.getItemStyle();\n var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\n var decalStyle = itemStyleModel.getShallow('decal');\n itemStyle.decal = !decalStyle || decalStyle === 'inherit' ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);\n\n if (itemStyle.fill === 'inherit') {\n /**\r\n * Series with visualDrawType as 'stroke' should have\r\n * series stroke as legend fill\r\n */\n itemStyle.fill = itemVisualStyle[drawType];\n }\n\n if (itemStyle.stroke === 'inherit') {\n /**\r\n * icon type with \"emptyXXX\" should use fill color\r\n * in visual style\r\n */\n itemStyle.stroke = itemVisualStyle[iconBrushType];\n }\n\n if (itemStyle.opacity === 'inherit') {\n /**\r\n * Use lineStyle.opacity if drawType is stroke\r\n */\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n }\n\n handleCommonProps(itemStyle, itemVisualStyle); // lineStyle\n\n var legendLineModel = legendItemModel.getModel('lineStyle');\n var lineStyle = legendLineModel.getLineStyle();\n handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color\n\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n\n if (!isSelected) {\n var borderWidth = legendItemModel.get('inactiveBorderWidth');\n /**\r\n * Since stroke is set to be inactiveBorderColor, it may occur that\r\n * there is no border in series but border in legend, so we need to\r\n * use border only when series has border if is set to be auto\r\n */\n\n var visualHasBorder = itemStyle[iconBrushType];\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n itemStyle.fill = legendItemModel.get('inactiveColor');\n itemStyle.stroke = legendItemModel.get('inactiveBorderColor');\n lineStyle.stroke = legendLineModel.get('inactiveColor');\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\n }\n\n return {\n itemStyle: itemStyle,\n lineStyle: lineStyle\n };\n}\n\nfunction getDefaultLegendIcon(opt) {\n var symboType = opt.icon || 'roundRect';\n var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n icon.setStyle(opt.itemStyle);\n icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n\n if (symboType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n\n return icon;\n}\n\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n // downplay before unselect\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: seriesName != null ? seriesName : dataName\n }); // highlight after select\n // TODO highlight immediately may cause animation loss.\n\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\n\nfunction isUseHoverLayer(api) {\n var list = api.getZr().storage.getDisplayList();\n var emphasisState;\n var i = 0;\n var len = list.length;\n\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\n i++;\n }\n\n return emphasisState && emphasisState.hoverLayer;\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nexport default LegendView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function legendFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport { curry, each } from 'zrender/lib/core/util.js';\n\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\n var selectedMap = {};\n var isToggleSelect = methodName === 'toggleSelected';\n var isSelected; // Update all legend components\n\n ecModel.eachComponent('legend', function (legendModel) {\n if (isToggleSelect && isSelected != null) {\n // Force other legend has same selected status\n // Or the first is toggled to true and other are toggled to false\n // In the case one legend has some item unSelected in option. And if other legend\n // doesn't has the item, they will assume it is selected.\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\n } else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\n legendModel[methodName]();\n } else {\n legendModel[methodName](payload.name);\n isSelected = legendModel.isSelected(payload.name);\n }\n\n var legendData = legendModel.getData();\n each(legendData, function (model) {\n var name = model.get('name'); // Wrap element\n\n if (name === '\\n' || name === '') {\n return;\n }\n\n var isItemSelected = legendModel.isSelected(name);\n\n if (selectedMap.hasOwnProperty(name)) {\n // Unselected if any legend is unselected\n selectedMap[name] = selectedMap[name] && isItemSelected;\n } else {\n selectedMap[name] = isItemSelected;\n }\n });\n }); // Return the event explicitly\n\n return methodName === 'allSelect' || methodName === 'inverseSelect' ? {\n selected: selectedMap\n } : {\n name: payload.name,\n selected: selectedMap\n };\n}\n\nexport function installLegendAction(registers) {\n /**\r\n * @event legendToggleSelect\r\n * @type {Object}\r\n * @property {string} type 'legendToggleSelect'\r\n * @property {string} [from]\r\n * @property {string} name Series name or data item name\r\n */\n registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\n registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\n registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\n /**\r\n * @event legendSelect\r\n * @type {Object}\r\n * @property {string} type 'legendSelect'\r\n * @property {string} name Series name or data item name\r\n */\n\n registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\n /**\r\n * @event legendUnSelect\r\n * @type {Object}\r\n * @property {string} type 'legendUnSelect'\r\n * @property {string} name Series name or data item name\r\n */\n\n registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LegendModel from './LegendModel.js';\nimport LegendView from './LegendView.js';\nimport legendFilter from './legendFilter.js';\nimport { installLegendAction } from './legendAction.js';\nexport function install(registers) {\n registers.registerComponentModel(LegendModel);\n registers.registerComponentView(LegendView);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\n registers.registerSubTypeDefaulter('legend', function () {\n return 'plain';\n });\n installLegendAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport LegendModel from './LegendModel.js';\nimport { mergeLayoutParam, getLayoutParams } from '../../util/layout.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar ScrollableLegendModel =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendModel, _super);\n\n function ScrollableLegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendModel.type;\n return _this;\n }\n /**\r\n * @param {number} scrollDataIndex\r\n */\n\n\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\n this.option.scrollDataIndex = scrollDataIndex;\n };\n\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n mergeAndNormalizeLayoutParams(this, this.option, option);\n };\n\n ScrollableLegendModel.type = 'legend.scroll';\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\n scrollDataIndex: 0,\n pageButtonItemGap: 5,\n pageButtonGap: null,\n pageButtonPosition: 'end',\n pageFormatter: '{current}/{total}',\n pageIcons: {\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\n },\n pageIconColor: '#2f4554',\n pageIconInactiveColor: '#aaa',\n pageIconSize: 15,\n pageTextStyle: {\n color: '#333'\n },\n animationDurationUpdate: 800\n });\n return ScrollableLegendModel;\n}(LegendModel);\n\n; // Do not `ignoreSize` to enable setting {left: 10, right: 10}.\n\nfunction mergeAndNormalizeLayoutParams(legendModel, target, raw) {\n var orient = legendModel.getOrient();\n var ignoreSize = [1, 1];\n ignoreSize[orient.index] = 0;\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: !!ignoreSize\n });\n}\n\nexport default ScrollableLegendModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Separate legend and scrollable legend to reduce package size.\r\n */\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport LegendView from './LegendView.js';\nvar Group = graphic.Group;\nvar WH = ['width', 'height'];\nvar XY = ['x', 'y'];\n\nvar ScrollableLegendView =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendView, _super);\n\n function ScrollableLegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendView.type;\n _this.newlineDisabled = true;\n _this._currentIndex = 0;\n return _this;\n }\n\n ScrollableLegendView.prototype.init = function () {\n _super.prototype.init.call(this);\n\n this.group.add(this._containerGroup = new Group());\n\n this._containerGroup.add(this.getContentGroup());\n\n this.group.add(this._controllerGroup = new Group());\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.resetInner = function () {\n _super.prototype.resetInner.call(this);\n\n this._controllerGroup.removeAll();\n\n this._containerGroup.removeClipPath();\n\n this._containerGroup.__rectSize = null;\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var self = this; // Render content items.\n\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n\n var controllerGroup = this._controllerGroup; // FIXME: support be 'auto' adapt to size number text length,\n // e.g., '3/12345' should not overlap with the control arrow button.\n\n var pageIconSize = legendModel.get('pageIconSize', true);\n var pageIconSizeArr = zrUtil.isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];\n createPageButton('pagePrev', 0);\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\n controllerGroup.add(new graphic.Text({\n name: 'pageText',\n style: {\n // Placeholder to calculate a proper layout.\n text: 'xx/xx',\n fill: pageTextStyleModel.getTextColor(),\n font: pageTextStyleModel.getFont(),\n verticalAlign: 'middle',\n align: 'center'\n },\n silent: true\n }));\n createPageButton('pageNext', 1);\n\n function createPageButton(name, iconIdx) {\n var pageDataIndexName = name + 'DataIndex';\n var icon = graphic.createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\n // Buttons will be created in each render, so we do not need\n // to worry about avoiding using legendModel kept in scope.\n onclick: zrUtil.bind(self._pageGo, self, pageDataIndexName, legendModel, api)\n }, {\n x: -pageIconSizeArr[0] / 2,\n y: -pageIconSizeArr[1] / 2,\n width: pageIconSizeArr[0],\n height: pageIconSizeArr[1]\n });\n icon.name = name;\n controllerGroup.add(icon);\n }\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n var hw = WH[1 - orientIdx];\n var yx = XY[1 - orientIdx];\n selector && layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var processMaxSize = zrUtil.clone(maxSize);\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\n\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\n\n if (selector) {\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\n } else {\n var offset = selectorRect[wh] + selectorButtonGap;\n selectorPos[orientIdx] -= offset;\n mainRect[xy] -= offset;\n }\n\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n selectorGroup.markRedraw();\n }\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\n var contentGroup = this.getContentGroup();\n var containerGroup = this._containerGroup;\n var controllerGroup = this._controllerGroup; // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\n layoutUtil.box( // Buttons in controller are layout always horizontally.\n 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\n var contentRect = contentGroup.getBoundingRect();\n var controllerRect = controllerGroup.getBoundingRect();\n var showController = this._showController = contentRect[wh] > maxSize[wh]; // In case that the inner elements of contentGroup layout do not based on [0, 0]\n\n var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming.\n // If first rendering, `contentGroup.position` is [0, 0], which\n // does not make sense and may cause unexepcted animation if adopted.\n\n if (!isFirstRender) {\n contentPos[orientIdx] = contentGroup[xy];\n } // Layout container group based on 0.\n\n\n var containerPos = [0, 0];\n var controllerPos = [-controllerRect.x, -controllerRect.y];\n var pageButtonGap = zrUtil.retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); // Place containerGroup and controllerGroup and contentGroup.\n\n if (showController) {\n var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom.\n\n if (pageButtonPosition === 'end') {\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\n } // controller is on the left / top.\n else {\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\n }\n } // Always align controller to content as 'middle'.\n\n\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\n contentGroup.setPosition(contentPos);\n containerGroup.setPosition(containerPos);\n controllerGroup.setPosition(controllerPos); // Calculate `mainRect` and set `clipPath`.\n // mainRect should not be calculated by `this.group.getBoundingRect()`\n // for sake of the overflow.\n\n var mainRect = {\n x: 0,\n y: 0\n }; // Consider content may be overflow (should be clipped).\n\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\n\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\n containerGroup.__rectSize = maxSize[wh];\n\n if (showController) {\n var clipShape = {\n x: 0,\n y: 0\n };\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\n clipShape[hw] = mainRect[hw];\n containerGroup.setClipPath(new graphic.Rect({\n shape: clipShape\n })); // Consider content may be larger than container, container rect\n // can not be obtained from `containerGroup.getBoundingRect()`.\n\n containerGroup.__rectSize = clipShape[wh];\n } else {\n // Do not remove or ignore controller. Keep them set as placeholders.\n controllerGroup.eachChild(function (child) {\n child.attr({\n invisible: true,\n silent: true\n });\n });\n } // Content translate animation.\n\n\n var pageInfo = this._getPageInfo(legendModel);\n\n pageInfo.pageIndex != null && graphic.updateProps(contentGroup, {\n x: pageInfo.contentPosition[0],\n y: pageInfo.contentPosition[1]\n }, // When switch from \"show controller\" to \"not show controller\", view should be\n // updated immediately without animation, otherwise causes weird effect.\n showController ? legendModel : null);\n\n this._updatePageInfoView(legendModel, pageInfo);\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\n\n scrollDataIndex != null && api.dispatchAction({\n type: 'legendScroll',\n scrollDataIndex: scrollDataIndex,\n legendId: legendModel.id\n });\n };\n\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\n var controllerGroup = this._controllerGroup;\n zrUtil.each(['pagePrev', 'pageNext'], function (name) {\n var key = name + 'DataIndex';\n var canJump = pageInfo[key] != null;\n var icon = controllerGroup.childOfName(name);\n\n if (icon) {\n icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true));\n icon.cursor = canJump ? 'pointer' : 'default';\n }\n });\n var pageText = controllerGroup.childOfName('pageText');\n var pageFormatter = legendModel.get('pageFormatter');\n var pageIndex = pageInfo.pageIndex;\n var current = pageIndex != null ? pageIndex + 1 : 0;\n var total = pageInfo.pageCount;\n pageText && pageFormatter && pageText.setStyle('text', zrUtil.isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({\n current: current,\n total: total\n }));\n };\n /**\r\n * contentPosition: Array., null when data item not found.\r\n * pageIndex: number, null when data item not found.\r\n * pageCount: number, always be a number, can be 0.\r\n * pagePrevDataIndex: number, null when no previous page.\r\n * pageNextDataIndex: number, null when no next page.\r\n * }\r\n */\n\n\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\n var contentGroup = this.getContentGroup();\n var containerRectSize = this._containerGroup.__rectSize;\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\n\n var children = contentGroup.children();\n var targetItem = children[targetItemIndex];\n var itemCount = children.length;\n var pCount = !itemCount ? 0 : 1;\n var result = {\n contentPosition: [contentGroup.x, contentGroup.y],\n pageCount: pCount,\n pageIndex: pCount - 1,\n pagePrevDataIndex: null,\n pageNextDataIndex: null\n };\n\n if (!targetItem) {\n return result;\n }\n\n var targetItemInfo = getItemInfo(targetItem);\n result.contentPosition[orientIdx] = -targetItemInfo.s; // Strategy:\n // (1) Always align based on the left/top most item.\n // (2) It is user-friendly that the last item shown in the\n // current window is shown at the begining of next window.\n // Otherwise if half of the last item is cut by the window,\n // it will have no chance to display entirely.\n // (3) Consider that item size probably be different, we\n // have calculate pageIndex by size rather than item index,\n // and we can not get page index directly by division.\n // (4) The window is to narrow to contain more than\n // one item, we should make sure that the page can be fliped.\n\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // Half of the last item is out of the window.\n !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || // If the current item does not intersect with the window, the new page\n // can be started at the current item or the last item.\n currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {\n if (winEndItemInfo.i > winStartItemInfo.i) {\n winStartItemInfo = winEndItemInfo;\n } else {\n // e.g., when page size is smaller than item size.\n winStartItemInfo = currItemInfo;\n }\n\n if (winStartItemInfo) {\n if (result.pageNextDataIndex == null) {\n result.pageNextDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n }\n }\n\n winEndItemInfo = currItemInfo;\n }\n\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // If the the end item does not intersect with the window started\n // from the current item, a page can be settled.\n (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && // e.g., when page size is smaller than item size.\n winStartItemInfo.i < winEndItemInfo.i) {\n winEndItemInfo = winStartItemInfo;\n\n if (result.pagePrevDataIndex == null) {\n result.pagePrevDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n ++result.pageIndex;\n }\n\n winStartItemInfo = currItemInfo;\n }\n\n return result;\n\n function getItemInfo(el) {\n if (el) {\n var itemRect = el.getBoundingRect();\n var start = itemRect[xy] + el[xy];\n return {\n s: start,\n e: start + itemRect[wh],\n i: el.__legendDataIndex\n };\n }\n }\n\n function intersect(itemInfo, winStart) {\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\n }\n };\n\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\n if (!this._showController) {\n return 0;\n }\n\n var index;\n var contentGroup = this.getContentGroup();\n var defaultIndex;\n contentGroup.eachChild(function (child, idx) {\n var legendDataIdx = child.__legendDataIndex; // FIXME\n // If the given targetDataIndex (from model) is illegal,\n // we use defaultIndex. But the index on the legend model and\n // action payload is still illegal. That case will not be\n // changed until some scenario requires.\n\n if (defaultIndex == null && legendDataIdx != null) {\n defaultIndex = idx;\n }\n\n if (legendDataIdx === targetDataIndex) {\n index = idx;\n }\n });\n return index != null ? index : defaultIndex;\n };\n\n ScrollableLegendView.type = 'legend.scroll';\n return ScrollableLegendView;\n}(LegendView);\n\nexport default ScrollableLegendView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function installScrollableLegendAction(registers) {\n /**\r\n * @event legendScroll\r\n * @type {Object}\r\n * @property {string} type 'legendScroll'\r\n * @property {string} scrollDataIndex\r\n */\n registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\n var scrollDataIndex = payload.scrollDataIndex;\n scrollDataIndex != null && ecModel.eachComponent({\n mainType: 'legend',\n subType: 'scroll',\n query: payload\n }, function (legendModel) {\n legendModel.setScrollDataIndex(scrollDataIndex);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport ScrollableLegendModel from './ScrollableLegendModel.js';\nimport ScrollableLegendView from './ScrollableLegendView.js';\nimport installScrollableLegendAction from './scrollableLegendAction.js';\nexport function install(registers) {\n use(installLegendPlain);\n registers.registerComponentModel(ScrollableLegendModel);\n registers.registerComponentView(ScrollableLegendView);\n installScrollableLegendAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport { install as installLegendScroll } from './installLegendScroll.js';\nexport function install(registers) {\n use(installLegendPlain);\n use(installLegendScroll);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar InsideZoomModel =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomModel, _super);\n\n function InsideZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = InsideZoomModel.type;\n return _this;\n }\n\n InsideZoomModel.type = 'dataZoom.inside';\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n disabled: false,\n zoomLock: false,\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n return InsideZoomModel;\n}(DataZoomModel);\n\nexport default InsideZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nimport { each, curry, createHashMap } from 'zrender/lib/core/util.js';\nimport { collectReferCoordSysModelInfo } from './helper.js';\nvar inner = makeInner();\nexport function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\n inner(api).coordSysRecordMap.each(function (coordSysRecord) {\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\n\n if (dzInfo) {\n dzInfo.getRange = getRange;\n }\n });\n}\nexport function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\n var coordSysRecordMap = inner(api).coordSysRecordMap;\n var coordSysKeyArr = coordSysRecordMap.keys();\n\n for (var i = 0; i < coordSysKeyArr.length; i++) {\n var coordSysKey = coordSysKeyArr[i];\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var dzUid = dataZoomModel.uid;\n var dzInfo = dataZoomInfoMap.get(dzUid);\n\n if (dzInfo) {\n dataZoomInfoMap.removeKey(dzUid);\n\n if (!dataZoomInfoMap.keys().length) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n }\n }\n }\n }\n}\n\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\n if (coordSysRecord) {\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\n var controller = coordSysRecord.controller;\n controller && controller.dispose();\n }\n}\n\nfunction createCoordSysRecord(api, coordSysModel) {\n // These init props will never change after record created.\n var coordSysRecord = {\n model: coordSysModel,\n containsPoint: curry(containsPoint, coordSysModel),\n dispatchAction: curry(dispatchAction, api),\n dataZoomInfoMap: null,\n controller: null\n }; // Must not do anything depends on coordSysRecord outside the event handler here,\n // because coordSysRecord not completed yet.\n\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\n controller.on(eventName, function (event) {\n var batch = [];\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\n // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n // moveOnMouseWheel, ...) enabled.\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\n return;\n }\n\n var method = (dzInfo.getRange || {})[eventName];\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\n !dzInfo.model.get('disabled', true) && range && batch.push({\n dataZoomId: dzInfo.model.id,\n start: range[0],\n end: range[1]\n });\n });\n batch.length && coordSysRecord.dispatchAction(batch);\n });\n });\n return coordSysRecord;\n}\n/**\r\n * This action will be throttled.\r\n */\n\n\nfunction dispatchAction(api, batch) {\n if (!api.isDisposed()) {\n api.dispatchAction({\n type: 'dataZoom',\n animation: {\n easing: 'cubicOut',\n duration: 100\n },\n batch: batch\n });\n }\n}\n\nfunction containsPoint(coordSysModel, e, x, y) {\n return coordSysModel.coordinateSystem.containPoint([x, y]);\n}\n/**\r\n * Merge roamController settings when multiple dataZooms share one roamController.\r\n */\n\n\nfunction mergeControllerParams(dataZoomInfoMap) {\n var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n var preventDefaultMouseMove = true;\n dataZoomInfoMap.each(function (dataZoomInfo) {\n var dataZoomModel = dataZoomInfo.model;\n var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n } // Prevent default move event by default. If one false, do not prevent. Otherwise\n // users may be confused why it does not work when multiple insideZooms exist.\n\n\n preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n });\n return {\n controlType: controlType,\n opt: {\n // RoamController will enable all of these functionalities,\n // and the final behavior is determined by its event listener\n // provided by each inside zoom.\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: true,\n preventDefaultMouseMove: !!preventDefaultMouseMove\n }\n };\n}\n\nexport function installDataZoomRoamProcessor(registers) {\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\n var apiInner = inner(api);\n var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());\n coordSysRecordMap.each(function (coordSysRecord) {\n // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should\n // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\n coordSysRecord.dataZoomInfoMap = null;\n });\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'inside'\n }, function (dataZoomModel) {\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\n var coordSysUid = dzCoordSysInfo.model.uid;\n var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); // Notice these props might be changed each time for a single dataZoomModel.\n\n dataZoomInfoMap.set(dataZoomModel.uid, {\n dzReferCoordSysInfo: dzCoordSysInfo,\n model: dataZoomModel,\n getRange: null\n });\n });\n }); // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\n // (2) Clear coord sys if not refered by any dataZoom.\n\n coordSysRecordMap.each(function (coordSysRecord) {\n var controller = coordSysRecord.controller;\n var firstDzInfo;\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var firstDzKey = dataZoomInfoMap.keys()[0];\n\n if (firstDzKey != null) {\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\n }\n }\n\n if (!firstDzInfo) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n return;\n }\n\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\n controller.enable(controllerParams.controlType, controllerParams.opt);\n controller.setPointerChecker(coordSysRecord.containsPoint);\n throttleUtil.createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as roams from './roams.js';\nimport { bind } from 'zrender/lib/core/util.js';\n\nvar InsideZoomView =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomView, _super);\n\n function InsideZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataZoom.inside';\n return _this;\n }\n\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n _super.prototype.render.apply(this, arguments);\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n return;\n } // Hence the `throttle` util ensures to preserve command order,\n // here simply updating range all the time will not cause missing\n // any of the the roam change.\n\n\n this.range = dataZoomModel.getPercentRange(); // Reset controllers.\n\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n pan: bind(getRangeHandlers.pan, this),\n zoom: bind(getRangeHandlers.zoom, this),\n scrollMove: bind(getRangeHandlers.scrollMove, this)\n });\n };\n\n InsideZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n InsideZoomView.prototype._clear = function () {\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n this.range = null;\n };\n\n InsideZoomView.type = 'dataZoom.inside';\n return InsideZoomView;\n}(DataZoomView);\n\nvar getRangeHandlers = {\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n var scale = Math.max(1 / e.scale, 0);\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\n range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range.\n\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n },\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n }),\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n })\n};\n\nfunction makeMover(getPercentDelta) {\n return function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n sliderMove(percentDelta, range, [0, 100], 'all');\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n };\n}\n\nvar getDirectionInfo = {\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n oldPoint = oldPoint || [0, 0];\n\n if (axis.dim === 'x') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // axis.dim === 'y'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var polar = coordSysInfo.model.coordinateSystem;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var angleExtent = polar.getAngleAxis().getExtent();\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n newPoint = polar.pointToCoord(newPoint);\n\n if (axisModel.mainType === 'radiusAxis') {\n ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n ret.pixelStart = radiusExtent[0];\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'angleAxis'\n ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n\n ret.pixelLength = angleExtent[1] - angleExtent[0];\n ret.pixelStart = angleExtent[0];\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n var ret = {};\n oldPoint = oldPoint || [0, 0];\n\n if (axis.orient === 'horizontal') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'vertical'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n }\n};\nexport default InsideZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport InsideZoomModel from './InsideZoomModel.js';\nimport InsideZoomView from './InsideZoomView.js';\nimport { installDataZoomRoamProcessor } from './roams.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n installCommon(registers);\n registers.registerComponentModel(InsideZoomModel);\n registers.registerComponentView(InsideZoomView);\n installDataZoomRoamProcessor(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar SliderZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomModel, _super);\n\n function SliderZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomModel.type;\n return _this;\n }\n\n SliderZoomModel.type = 'dataZoom.slider';\n SliderZoomModel.layoutMode = 'box';\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n show: true,\n // deault value can only be drived in view stage.\n right: 'ph',\n top: 'ph',\n width: 'ph',\n height: 'ph',\n left: null,\n bottom: null,\n borderColor: '#d2dbee',\n borderRadius: 3,\n backgroundColor: 'rgba(47,69,84,0)',\n // dataBackgroundColor: '#ddd',\n dataBackground: {\n lineStyle: {\n color: '#d2dbee',\n width: 0.5\n },\n areaStyle: {\n color: '#d2dbee',\n opacity: 0.2\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#8fb0f7',\n width: 0.5\n },\n areaStyle: {\n color: '#8fb0f7',\n opacity: 0.2\n }\n },\n // Color of selected window.\n fillerColor: 'rgba(135,175,274,0.2)',\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\n // Percent of the slider height\n handleSize: '100%',\n handleStyle: {\n color: '#fff',\n borderColor: '#ACB8D1'\n },\n moveHandleSize: 7,\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\n moveHandleStyle: {\n color: '#D2DBEE',\n opacity: 0.7\n },\n showDetail: true,\n showDataShadow: 'auto',\n realtime: true,\n zoomLock: false,\n textStyle: {\n color: '#6E7079'\n },\n brushSelect: true,\n brushStyle: {\n color: 'rgba(135,175,274,0.15)'\n },\n emphasis: {\n handleStyle: {\n borderColor: '#8FB0F7'\n },\n moveHandleStyle: {\n color: '#8FB0F7'\n }\n }\n });\n return SliderZoomModel;\n}(DataZoomModel);\n\nexport default SliderZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, isFunction, isString, indexOf } from 'zrender/lib/core/util.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as throttle from '../../util/throttle.js';\nimport DataZoomView from './DataZoomView.js';\nimport { linearMap, asc, parsePercent } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol.js';\nimport { deprecateLog } from '../../util/log.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar Rect = graphic.Rect; // Constants\n\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\nvar DEFAULT_FILLER_SIZE = 30;\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\nvar HORIZONTAL = 'horizontal';\nvar VERTICAL = 'vertical';\nvar LABEL_GAP = 5;\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\nvar REALTIME_ANIMATION_CONFIG = {\n easing: 'cubicOut',\n duration: 100,\n delay: 0\n};\n\nvar SliderZoomView =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomView, _super);\n\n function SliderZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomView.type;\n _this._displayables = {};\n return _this;\n }\n\n SliderZoomView.prototype.init = function (ecModel, api) {\n this.api = api; // A unique handler for each dataZoom component\n\n this._onBrush = bind(this._onBrush, this);\n this._onBrushEnd = bind(this._onBrushEnd, this);\n };\n\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n _super.prototype.render.apply(this, arguments);\n\n throttle.createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\n this._orient = dataZoomModel.getOrient();\n\n if (dataZoomModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n this.group.removeAll();\n return;\n } // Notice: this._resetInterval() should not be executed when payload.type\n // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\n\n\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\n this._buildView();\n }\n\n this._updateView();\n };\n\n SliderZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n SliderZoomView.prototype._clear = function () {\n throttle.clear(this, '_dispatchZoomAction');\n var zr = this.api.getZr();\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n };\n\n SliderZoomView.prototype._buildView = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n this._brushing = false;\n this._displayables.brushRect = null;\n\n this._resetLocation();\n\n this._resetInterval();\n\n var barGroup = this._displayables.sliderGroup = new graphic.Group();\n\n this._renderBackground();\n\n this._renderHandle();\n\n this._renderDataShadow();\n\n thisGroup.add(barGroup);\n\n this._positionGroup();\n };\n\n SliderZoomView.prototype._resetLocation = function () {\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var showMoveHandle = dataZoomModel.get('brushSelect');\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; // If some of x/y/width/height are not specified,\n // auto-adapt according to target grid.\n\n var coordRect = this._findCoordRect();\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n }; // Default align by coordinate system rect.\n\n var positionInfo = this._orient === HORIZONTAL ? {\n // Why using 'right', because right should be used in vertical,\n // and it is better to be consistent for dealing with position param merge.\n right: ecSize.width - coordRect.x - coordRect.width,\n top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,\n width: coordRect.width,\n height: DEFAULT_FILLER_SIZE\n } : {\n right: DEFAULT_LOCATION_EDGE_GAP,\n top: coordRect.y,\n width: DEFAULT_FILLER_SIZE,\n height: coordRect.height\n }; // Do not write back to option and replace value 'ph', because\n // the 'ph' value should be recalculated when resize.\n\n var layoutParams = layout.getLayoutParams(dataZoomModel.option); // Replace the placeholder value.\n\n each(['right', 'top', 'width', 'height'], function (name) {\n if (layoutParams[name] === 'ph') {\n layoutParams[name] = positionInfo[name];\n }\n });\n var layoutRect = layout.getLayoutRect(layoutParams, ecSize);\n this._location = {\n x: layoutRect.x,\n y: layoutRect.y\n };\n this._size = [layoutRect.width, layoutRect.height];\n this._orient === VERTICAL && this._size.reverse();\n };\n\n SliderZoomView.prototype._positionGroup = function () {\n var thisGroup = this.group;\n var location = this._location;\n var orient = this._orient; // Just use the first axis to determine mapping.\n\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\n var sliderGroup = this._displayables.sliderGroup;\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup.\n\n sliderGroup.attr(orient === HORIZONTAL && !inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: 1\n } : orient === HORIZONTAL && inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: -1\n } : orient === VERTICAL && !inverse ? {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: 1,\n rotation: Math.PI / 2\n } // Don't use Math.PI, considering shadow direction.\n : {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: -1,\n rotation: Math.PI / 2\n }); // Position barGroup\n\n var rect = thisGroup.getBoundingRect([sliderGroup]);\n thisGroup.x = location.x - rect.x;\n thisGroup.y = location.y - rect.y;\n thisGroup.markRedraw();\n };\n\n SliderZoomView.prototype._getViewExtent = function () {\n return [0, this._size[0]];\n };\n\n SliderZoomView.prototype._renderBackground = function () {\n var dataZoomModel = this.dataZoomModel;\n var size = this._size;\n var barGroup = this._displayables.sliderGroup;\n var brushSelect = dataZoomModel.get('brushSelect');\n barGroup.add(new Rect({\n silent: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: dataZoomModel.get('backgroundColor')\n },\n z2: -40\n })); // Click panel, over shadow, below handles.\n\n var clickPanel = new Rect({\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: 'transparent'\n },\n z2: 0,\n onclick: bind(this._onClickPanel, this)\n });\n var zr = this.api.getZr();\n\n if (brushSelect) {\n clickPanel.on('mousedown', this._onBrushStart, this);\n clickPanel.cursor = 'crosshair';\n zr.on('mousemove', this._onBrush);\n zr.on('mouseup', this._onBrushEnd);\n } else {\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n }\n\n barGroup.add(clickPanel);\n };\n\n SliderZoomView.prototype._renderDataShadow = function () {\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\n\n this._displayables.dataShadowSegs = [];\n\n if (!info) {\n return;\n }\n\n var size = this._size;\n var oldSize = this._shadowSize || [];\n var seriesModel = info.series;\n var data = seriesModel.getRawData();\n var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();\n var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick\n : info.otherDim;\n\n if (otherDim == null) {\n return;\n }\n\n var polygonPts = this._shadowPolygonPts;\n var polylinePts = this._shadowPolylinePts; // Not re-render if data doesn't change.\n\n if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n var otherDataExtent_1 = data.getDataExtent(otherDim); // Nice extent.\n\n var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;\n otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];\n var otherShadowExtent_1 = [0, size[1]];\n var thisShadowExtent = [0, size[0]];\n var areaPoints_1 = [[size[0], 0], [0, 0]];\n var linePoints_1 = [];\n var step_1 = thisShadowExtent[1] / (data.count() - 1);\n var thisCoord_1 = 0; // Optimize for large data shadow\n\n var stride_1 = Math.round(data.count() / size[0]);\n var lastIsEmpty_1;\n data.each([otherDim], function (value, index) {\n if (stride_1 > 0 && index % stride_1) {\n thisCoord_1 += step_1;\n return;\n } // FIXME\n // Should consider axis.min/axis.max when drawing dataShadow.\n // FIXME\n // 应该使用统一的空判断?还是在list里进行空判断?\n\n\n var isEmpty = value == null || isNaN(value) || value === ''; // See #4235.\n\n var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true); // Attempt to draw data shadow precisely when there are empty value.\n\n if (isEmpty && !lastIsEmpty_1 && index) {\n areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);\n linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);\n } else if (!isEmpty && lastIsEmpty_1) {\n areaPoints_1.push([thisCoord_1, 0]);\n linePoints_1.push([thisCoord_1, 0]);\n }\n\n areaPoints_1.push([thisCoord_1, otherCoord]);\n linePoints_1.push([thisCoord_1, otherCoord]);\n thisCoord_1 += step_1;\n lastIsEmpty_1 = isEmpty;\n });\n polygonPts = this._shadowPolygonPts = areaPoints_1;\n polylinePts = this._shadowPolylinePts = linePoints_1;\n }\n\n this._shadowData = data;\n this._shadowDim = otherDim;\n this._shadowSize = [size[0], size[1]];\n var dataZoomModel = this.dataZoomModel;\n\n function createDataShadowGroup(isSelectedArea) {\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\n var group = new graphic.Group();\n var polygon = new graphic.Polygon({\n shape: {\n points: polygonPts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('areaStyle').getAreaStyle(),\n silent: true,\n z2: -20\n });\n var polyline = new graphic.Polyline({\n shape: {\n points: polylinePts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('lineStyle').getLineStyle(),\n silent: true,\n z2: -19\n });\n group.add(polygon);\n group.add(polyline);\n return group;\n } // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\n\n\n for (var i = 0; i < 3; i++) {\n var group = createDataShadowGroup(i === 1);\n\n this._displayables.sliderGroup.add(group);\n\n this._displayables.dataShadowSegs.push(group);\n }\n };\n\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\n var dataZoomModel = this.dataZoomModel;\n var showDataShadow = dataZoomModel.get('showDataShadow');\n\n if (showDataShadow === false) {\n return;\n } // Find a representative series.\n\n\n var result;\n var ecModel = this.ecModel;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();\n each(seriesModels, function (seriesModel) {\n if (result) {\n return;\n }\n\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\n return;\n }\n\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\n var otherDim = getOtherDim(axisDim);\n var otherAxisInverse;\n var coordSys = seriesModel.coordinateSystem;\n\n if (otherDim != null && coordSys.getOtherAxis) {\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\n }\n\n otherDim = seriesModel.getData().mapDimension(otherDim);\n result = {\n thisAxis: thisAxis,\n series: seriesModel,\n thisDim: axisDim,\n otherDim: otherDim,\n otherAxisInverse: otherAxisInverse\n };\n }, this);\n }, this);\n return result;\n };\n\n SliderZoomView.prototype._renderHandle = function () {\n var thisGroup = this.group;\n var displayables = this._displayables;\n var handles = displayables.handles = [null, null];\n var handleLabels = displayables.handleLabels = [null, null];\n var sliderGroup = this._displayables.sliderGroup;\n var size = this._size;\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\n var brushSelect = dataZoomModel.get('brushSelect');\n var filler = displayables.filler = new Rect({\n silent: brushSelect,\n style: {\n fill: dataZoomModel.get('fillerColor')\n },\n textConfig: {\n position: 'inside'\n }\n });\n sliderGroup.add(filler); // Frame border.\n\n sliderGroup.add(new Rect({\n silent: true,\n subPixelOptimize: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1],\n r: borderRadius\n },\n style: {\n // deprecated option\n stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'),\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\n fill: 'rgba(0,0,0,0)'\n }\n })); // Left and right handle to resize\n\n each([0, 1], function (handleIndex) {\n var iconStr = dataZoomModel.get('handleIcon');\n\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) {\n // Compatitable with the old icon parsers. Which can use a path string without path://\n iconStr = 'path://' + iconStr;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\n }\n }\n\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\n path.attr({\n cursor: getCursor(this._orient),\n draggable: true,\n drift: bind(this._onDragMove, this, handleIndex),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false),\n z2: 5\n });\n var bRect = path.getBoundingRect();\n var handleSize = dataZoomModel.get('handleSize');\n this._handleHeight = parsePercent(handleSize, this._size[1]);\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\n path.style.strokeNoScale = true;\n path.rectHover = true;\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n enableHoverEmphasis(path);\n var handleColor = dataZoomModel.get('handleColor'); // deprecated option\n // Compatitable with previous version\n\n if (handleColor != null) {\n path.style.fill = handleColor;\n }\n\n sliderGroup.add(handles[handleIndex] = path);\n var textStyleModel = dataZoomModel.getModel('textStyle');\n thisGroup.add(handleLabels[handleIndex] = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: '',\n verticalAlign: 'middle',\n align: 'center',\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }),\n z2: 10\n }));\n }, this); // Handle to move. Only visible when brushSelect is set true.\n\n var actualMoveZone = filler;\n\n if (brushSelect) {\n var moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\n var moveHandle_1 = displayables.moveHandle = new graphic.Rect({\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\n silent: true,\n shape: {\n r: [0, 0, 2, 2],\n y: size[1] - 0.5,\n height: moveHandleHeight\n }\n });\n var iconSize = moveHandleHeight * 0.8;\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\n moveHandleIcon.silent = true;\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\n actualMoveZone = displayables.moveZone = new graphic.Rect({\n invisible: true,\n shape: {\n y: size[1] - moveZoneExpandSize,\n height: moveHandleHeight + moveZoneExpandSize\n }\n });\n actualMoveZone.on('mouseover', function () {\n api.enterEmphasis(moveHandle_1);\n }).on('mouseout', function () {\n api.leaveEmphasis(moveHandle_1);\n });\n sliderGroup.add(moveHandle_1);\n sliderGroup.add(moveHandleIcon);\n sliderGroup.add(actualMoveZone);\n }\n\n actualMoveZone.attr({\n draggable: true,\n cursor: getCursor(this._orient),\n drift: bind(this._onDragMove, this, 'all'),\n ondragstart: bind(this._showDataInfo, this, true),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false)\n });\n };\n\n SliderZoomView.prototype._resetInterval = function () {\n var range = this._range = this.dataZoomModel.getPercentRange();\n\n var viewExtent = this._getViewExtent();\n\n this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];\n };\n\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\n var dataZoomModel = this.dataZoomModel;\n var handleEnds = this._handleEnds;\n\n var viewExtend = this._getViewExtent();\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n var percentExtent = [0, 100];\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n var lastRange = this._range;\n var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\n };\n\n SliderZoomView.prototype._updateView = function (nonRealtime) {\n var displaybles = this._displayables;\n var handleEnds = this._handleEnds;\n var handleInterval = asc(handleEnds.slice());\n var size = this._size;\n each([0, 1], function (handleIndex) {\n // Handles\n var handle = displaybles.handles[handleIndex];\n var handleHeight = this._handleHeight;\n handle.attr({\n scaleX: handleHeight / 2,\n scaleY: handleHeight / 2,\n // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\n // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\n y: size[1] / 2 - handleHeight / 2\n });\n }, this); // Filler\n\n displaybles.filler.setShape({\n x: handleInterval[0],\n y: 0,\n width: handleInterval[1] - handleInterval[0],\n height: size[1]\n });\n var viewExtent = {\n x: handleInterval[0],\n width: handleInterval[1] - handleInterval[0]\n }; // Move handle\n\n if (displaybles.moveHandle) {\n displaybles.moveHandle.setShape(viewExtent);\n displaybles.moveZone.setShape(viewExtent); // Force update path on the invisible object\n\n displaybles.moveZone.getBoundingRect();\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\n } // update clip path of shadow.\n\n\n var dataShadowSegs = displaybles.dataShadowSegs;\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\n\n for (var i = 0; i < dataShadowSegs.length; i++) {\n var segGroup = dataShadowSegs[i];\n var clipPath = segGroup.getClipPath();\n\n if (!clipPath) {\n clipPath = new graphic.Rect();\n segGroup.setClipPath(clipPath);\n }\n\n clipPath.setShape({\n x: segIntervals[i],\n y: 0,\n width: segIntervals[i + 1] - segIntervals[i],\n height: size[1]\n });\n }\n\n this._updateDataInfo(nonRealtime);\n };\n\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\n var dataZoomModel = this.dataZoomModel;\n var displaybles = this._displayables;\n var handleLabels = displaybles.handleLabels;\n var orient = this._orient;\n var labelTexts = ['', '']; // FIXME\n // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\n\n if (dataZoomModel.get('showDetail')) {\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var axis = axisProxy.getAxisModel().axis;\n var range = this._range;\n var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode.\n ? axisProxy.calculateDataWindow({\n start: range[0],\n end: range[1]\n }).valueWindow : axisProxy.getDataValueWindow();\n labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];\n }\n }\n\n var orderedHandleEnds = asc(this._handleEnds.slice());\n setLabel.call(this, 0);\n setLabel.call(this, 1);\n\n function setLabel(handleIndex) {\n // Label\n // Text should not transform by barGroup.\n // Ignore handlers transform\n var barTransform = graphic.getTransform(displaybles.handles[handleIndex].parent, this.group);\n var direction = graphic.transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\n var offset = this._handleWidth / 2 + LABEL_GAP;\n var textPoint = graphic.applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\n align: orient === HORIZONTAL ? direction : 'center',\n text: labelTexts[handleIndex]\n });\n }\n };\n\n SliderZoomView.prototype._formatLabel = function (value, axis) {\n var dataZoomModel = this.dataZoomModel;\n var labelFormatter = dataZoomModel.get('labelFormatter');\n var labelPrecision = dataZoomModel.get('labelPrecision');\n\n if (labelPrecision == null || labelPrecision === 'auto') {\n labelPrecision = axis.getPixelPrecision();\n }\n\n var valueStr = value == null || isNaN(value) ? '' // FIXME Glue code\n : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({\n value: Math.round(value)\n }) // param of toFixed should less then 20.\n : value.toFixed(Math.min(labelPrecision, 20));\n return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr;\n };\n /**\r\n * @param showOrHide true: show, false: hide\r\n */\n\n\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\n // Always show when drgging.\n showOrHide = this._dragging || showOrHide;\n var displayables = this._displayables;\n var handleLabels = displayables.handleLabels;\n handleLabels[0].attr('invisible', !showOrHide);\n handleLabels[1].attr('invisible', !showOrHide); // Highlight move handle\n\n displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\n };\n\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\n this._dragging = true; // For mobile device, prevent screen slider on the button.\n\n eventTool.stop(event.event); // Transform dx, dy to bar coordination.\n\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\n\n var vertex = graphic.applyTransform([dx, dy], barTransform, true);\n\n var changed = this._updateInterval(handleIndex, vertex[0]);\n\n var realtime = this.dataZoomModel.get('realtime');\n\n this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed,\n // which cause bad visual effect when progressive enabled.\n\n\n changed && realtime && this._dispatchZoomAction(true);\n };\n\n SliderZoomView.prototype._onDragEnd = function () {\n this._dragging = false;\n\n this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when\n // drag end will cause the whole view rerender, which is unnecessary.\n\n\n var realtime = this.dataZoomModel.get('realtime');\n !realtime && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onClickPanel = function (e) {\n var size = this._size;\n\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\n\n if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {\n return;\n }\n\n var handleEnds = this._handleEnds;\n var center = (handleEnds[0] + handleEnds[1]) / 2;\n\n var changed = this._updateInterval('all', localPoint[0] - center);\n\n this._updateView();\n\n changed && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrushStart = function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n this._brushStart = new graphic.Point(x, y);\n this._brushing = true;\n this._brushStartTime = +new Date(); // this._updateBrushRect(x, y);\n };\n\n SliderZoomView.prototype._onBrushEnd = function (e) {\n if (!this._brushing) {\n return;\n }\n\n var brushRect = this._displayables.brushRect;\n this._brushing = false;\n\n if (!brushRect) {\n return;\n }\n\n brushRect.attr('ignore', true);\n var brushShape = brushRect.shape;\n var brushEndTime = +new Date(); // console.log(brushEndTime - this._brushStartTime);\n\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\n // Will treat it as a click\n return;\n }\n\n var viewExtend = this._getViewExtent();\n\n var percentExtent = [0, 100];\n this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\n\n this._updateView();\n\n this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrush = function (e) {\n if (this._brushing) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n\n this._updateBrushRect(e.offsetX, e.offsetY);\n }\n };\n\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\n var displayables = this._displayables;\n var dataZoomModel = this.dataZoomModel;\n var brushRect = displayables.brushRect;\n\n if (!brushRect) {\n brushRect = displayables.brushRect = new Rect({\n silent: true,\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\n });\n displayables.sliderGroup.add(brushRect);\n }\n\n brushRect.attr('ignore', false);\n var brushStart = this._brushStart;\n var sliderGroup = this._displayables.sliderGroup;\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\n var size = this._size;\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\n brushRect.setShape({\n x: startPoint[0],\n y: 0,\n width: endPoint[0] - startPoint[0],\n height: size[1]\n });\n };\n /**\r\n * This action will be throttled.\r\n */\n\n\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\n var range = this._range;\n this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n dataZoomId: this.dataZoomModel.id,\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\n start: range[0],\n end: range[1]\n });\n };\n\n SliderZoomView.prototype._findCoordRect = function () {\n // Find the grid corresponding to the first axis referred by dataZoom.\n var rect;\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\n\n if (!rect && coordSysInfoList.length) {\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\n rect = coordSys.getRect && coordSys.getRect();\n }\n\n if (!rect) {\n var width = this.api.getWidth();\n var height = this.api.getHeight();\n rect = {\n x: width * 0.2,\n y: height * 0.2,\n width: width * 0.6,\n height: height * 0.6\n };\n }\n\n return rect;\n };\n\n SliderZoomView.type = 'dataZoom.slider';\n return SliderZoomView;\n}(DataZoomView);\n\nfunction getOtherDim(thisDim) {\n // FIXME\n // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\n var map = {\n x: 'y',\n y: 'x',\n radius: 'angle',\n angle: 'radius'\n };\n return map[thisDim];\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default SliderZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SliderZoomModel from './SliderZoomModel.js';\nimport SliderZoomView from './SliderZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderZoomModel);\n registers.registerComponentView(SliderZoomView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomInside } from './installDataZoomInside.js';\nimport { install as installDataZoomSlider } from './installDataZoomSlider.js';\nexport function install(registers) {\n use(installDataZoomInside);\n use(installDataZoomSlider); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * @file Visual mapping.\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar visualDefault = {\n /**\r\n * @public\r\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nexport default visualDefault;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as numberUtil from '../../util/number.js';\nimport ComponentModel from '../../model/Component.js';\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\n\nvar VisualMapModel =\n/** @class */\nfunction (_super) {\n __extends(VisualMapModel, _super);\n\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapModel.type;\n _this.stateList = ['inRange', 'outOfRange'];\n _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color'];\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n /**\r\n * [lowerBound, upperBound]\r\n */\n\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n };\n /**\r\n * @public\r\n */\n\n\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\r\n * @protected\r\n * @return {Array.} An array of series indices.\r\n */\n\n\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n\n return seriesIndices;\n };\n /**\r\n * @public\r\n */\n\n\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\r\n * @pubilc\r\n */\n\n\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n };\n /**\r\n * @example\r\n * this.formatValueText(someVal); // format single numeric value to text.\r\n * this.formatValueText(someVal, true); // format single category value to text.\r\n * this.formatValueText([min, max]); // format numeric min-max to text.\r\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\r\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\r\n *\r\n * @param value Real value, or this.dataBound[0 or 1].\r\n * @param isCategory Only available when value is number.\r\n * @param edgeSymbols Open-close symbol when value is interval.\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n edgeSymbols = edgeSymbols || ['<', '>'];\n\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option; // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n };\n /**\r\n * PENDING:\r\n * delete this method if no outer usage.\r\n *\r\n * Return Concrete dimension. If null/undefined is returned, no dimension is used.\r\n */\n // getDataDimension(data: SeriesData) {\n // const optDim = this.option.dimension;\n // if (optDim != null) {\n // return data.getDimension(optDim);\n // }\n // const dimNames = data.dimensions;\n // for (let i = dimNames.length - 1; i >= 0; i--) {\n // const dimName = dimNames[i];\n // const dimInfo = data.getDimensionInfo(dimName);\n // if (!dimInfo.isCalculationCoord) {\n // return dimName;\n // }\n // }\n // }\n\n\n VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n var optDim = this.option.dimension;\n\n if (optDim != null) {\n return data.getDimensionIndex(optDim);\n }\n\n var dimNames = data.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimInfo.storeDimIndex;\n }\n }\n };\n\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\n\n VisualMapModel.prototype.completeVisualOption = function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n } // Compatible with previous logic, always give a default color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the default color, set inRange: {color: null}.\n\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n var itemSymbol = this.getItemSymbol();\n var defaultSymbol = itemSymbol || 'roundRect';\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter none\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max_1 = -Infinity; // symbolSize can be object when categories defined.\n\n eachVisual(symbolSize, function (value) {\n value > max_1 && (max_1 = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max_1], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n };\n\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\r\n * @public\r\n * @abstract\r\n */\n\n\n VisualMapModel.prototype.setSelected = function (selected) {};\n\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\r\n * @public\r\n * @abstract\r\n */\n\n\n VisualMapModel.prototype.getValueState = function (value) {\n return null;\n };\n /**\r\n * FIXME\r\n * Do not publish to thirt-part-dev temporarily\r\n * util the interface is stable. (Should it return\r\n * a function but not visual meta?)\r\n *\r\n * @pubilc\r\n * @abstract\r\n * @param getColorVisual\r\n * params: value, valueState\r\n * return: color\r\n * @return {Object} visualMeta\r\n * should includes {stops, outerColors}\r\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\r\n */\n\n\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\n\n VisualMapModel.type = 'visualMap';\n VisualMapModel.dependencies = ['series'];\n VisualMapModel.defaultOption = {\n show: true,\n // zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n min: 0,\n max: 200,\n left: 0,\n right: null,\n top: null,\n bottom: 0,\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n padding: 5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n precision: 0,\n textStyle: {\n color: '#333' // 值域文字颜色\n\n }\n };\n return VisualMapModel;\n}(ComponentModel);\n\nexport default VisualMapModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport * as numberUtil from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js'; // Constant\n\nvar DEFAULT_BAR_BOUND = [20, 140];\n\nvar ContinuousModel =\n/** @class */\nfunction (_super) {\n __extends(ContinuousModel, _super);\n\n function ContinuousModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n this.resetVisual(function (mappingOption) {\n mappingOption.mappingMethod = 'linear';\n mappingOption.dataExtent = this.getExtent();\n });\n\n this._resetRange();\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.resetItemSize = function () {\n _super.prototype.resetItemSize.apply(this, arguments);\n\n var itemSize = this.itemSize;\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\n };\n /**\r\n * @private\r\n */\n\n\n ContinuousModel.prototype._resetRange = function () {\n var dataExtent = this.getExtent();\n var range = this.option.range;\n\n if (!range || range.auto) {\n // `range` should always be array (so we don't use other\n // value like 'auto') for user-friend. (consider getOption).\n dataExtent.auto = 1;\n this.option.range = dataExtent;\n } else if (zrUtil.isArray(range)) {\n if (range[0] > range[1]) {\n range.reverse();\n }\n\n range[0] = Math.max(range[0], dataExtent[0]);\n range[1] = Math.min(range[1], dataExtent[1]);\n }\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.completeVisualOption = function () {\n _super.prototype.completeVisualOption.apply(this, arguments);\n\n zrUtil.each(this.stateList, function (state) {\n var symbolSize = this.option.controller[state].symbolSize;\n\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\n symbolSize[0] = symbolSize[1] / 3; // For good looking.\n }\n }, this);\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.setSelected = function (selected) {\n this.option.range = selected.slice();\n\n this._resetRange();\n };\n /**\r\n * @public\r\n */\n\n\n ContinuousModel.prototype.getSelected = function () {\n var dataExtent = this.getExtent();\n var dataInterval = numberUtil.asc((this.get('range') || []).slice()); // Clamp\n\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\n return dataInterval;\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.getValueState = function (value) {\n var range = this.option.range;\n var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.\n // range[1] is processed likewise.\n\n return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange';\n };\n\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\n var result = [];\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\r\n * @implement\r\n */\n\n\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\n var stops = [];\n\n function setStop(value, valueState) {\n stops.push({\n value: value,\n color: getColorVisual(value, valueState)\n });\n } // Format to: outOfRange -- inRange -- outOfRange.\n\n\n var iIdx = 0;\n var oIdx = 0;\n var iLen = iVals.length;\n var oLen = oVals.length;\n\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\n // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\n if (oVals[oIdx] < iVals[iIdx]) {\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\n // If range is full, value beyond min, max will be clamped.\n // make a singularity\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\n setStop(iVals[iIdx], 'inRange');\n }\n\n for (var first = 1; oIdx < oLen; oIdx++) {\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\n // make a singularity\n if (first) {\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\n first = 0;\n }\n\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n var stopsLen = stops.length;\n return {\n stops: stops,\n outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent']\n };\n };\n\n ContinuousModel.type = 'visualMap.continuous';\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n align: 'auto',\n calculable: false,\n hoverLink: true,\n realtime: true,\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\n handleSize: '120%',\n handleStyle: {\n borderColor: '#fff',\n borderWidth: 1\n },\n indicatorIcon: 'circle',\n indicatorSize: '50%',\n indicatorStyle: {\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n } // emphasis: {\n // handleStyle: {\n // shadowBlur: 3,\n // shadowOffsetX: 1,\n // shadowOffsetY: 1,\n // shadowColor: 'rgba(0,0,0,0.2)'\n // }\n // }\n\n });\n return ContinuousModel;\n}(VisualMapModel);\n\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\n if (dataExtent[0] === dataExtent[1]) {\n return dataExtent.slice();\n } // When using colorHue mapping, it is not linear color any more.\n // Moreover, canvas gradient seems not to be accurate linear.\n // FIXME\n // Should be arbitrary value 100? or based on pixel size?\n\n\n var count = 200;\n var step = (dataExtent[1] - dataExtent[0]) / count;\n var value = dataExtent[0];\n var stopValues = [];\n\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\n stopValues.push(value);\n value += step;\n }\n\n stopValues.push(dataExtent[1]);\n return stopValues;\n}\n\nexport default ContinuousModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { Rect } from '../../util/graphic.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as layout from '../../util/layout.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport ComponentView from '../../view/Component.js';\n\nvar VisualMapView =\n/** @class */\nfunction (_super) {\n __extends(VisualMapView, _super);\n\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapView.type;\n _this.autoPositionValues = {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n };\n return _this;\n }\n\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapView.prototype.renderBackground = function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new Rect({\n z2: -1,\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n };\n /**\r\n * @protected\r\n * @param targetValue can be Infinity or -Infinity\r\n * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\r\n * @param opts\r\n * @param opts.forceState Specify state, instead of using getValueState method.\r\n * @param opts.convertOpacityToAlpha For color gradient in controller widget.\r\n * @return {*} Visual value.\r\n */\n\n\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {}; // Default values.\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\n\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\n\n VisualMapView.prototype.positionGroup = function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\n\nexport default VisualMapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nvar paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n/**\r\n * @param visualMapModel\r\n * @param api\r\n * @param itemSize always [short, long]\r\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\r\n */\n\nexport function getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n } // Auto decision align.\n\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\r\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\r\n * dataIndexInside means filtered index.\r\n */\n// TODO: TYPE more specified payload types.\n\nexport function makeHighDownBatch(batch, visualMapModel) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batchItem.dataIndex != null) {\n batchItem.dataIndexInside = batchItem.dataIndex;\n batchItem.dataIndex = null;\n }\n\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\n });\n return batch;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as helper from './helper.js';\nimport * as modelUtil from '../../util/model.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { setAsHighDownDispatcher } from '../../util/states.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar linearMap = numberUtil.linearMap;\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max; // Arbitrary value\n\nvar HOVER_LINK_SIZE = 12;\nvar HOVER_LINK_OUT = 6; // Notice:\n// Any \"interval\" should be by the order of [low, high].\n// \"handle0\" (handleIndex === 0) maps to\n// low data value: this._dataInterval[0] and has low coord.\n// \"handle1\" (handleIndex === 1) maps to\n// high data value: this._dataInterval[1] and has high coord.\n// The logic of transform is implemented in this._createBarGroup.\n\nvar ContinuousView =\n/** @class */\nfunction (_super) {\n __extends(ContinuousView, _super);\n\n function ContinuousView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousView.type;\n _this._shapes = {};\n _this._dataInterval = [];\n _this._handleEnds = [];\n _this._hoverLinkDataIndices = [];\n return _this;\n }\n\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\n this._api = api;\n\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\n this._buildView();\n }\n };\n\n ContinuousView.prototype._buildView = function () {\n this.group.removeAll();\n var visualMapModel = this.visualMapModel;\n var thisGroup = this.group;\n this._orient = visualMapModel.get('orient');\n this._useHandle = visualMapModel.get('calculable');\n\n this._resetInterval();\n\n this._renderBar(thisGroup);\n\n var dataRangeText = visualMapModel.get('text');\n\n this._renderEndsText(thisGroup, dataRangeText, 0);\n\n this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation.\n\n\n this._updateView(true); // After updating view, inner shapes is built completely,\n // and then background can be rendered.\n\n\n this.renderBackground(thisGroup); // Real update view\n\n this._updateView();\n\n this._enableHoverLinkToSeries();\n\n this._enableHoverLinkFromSeries();\n\n this.positionGroup(thisGroup);\n };\n\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\n if (!dataRangeText) {\n return;\n } // Compatible with ec2, text[0] map to high value, text[1] map low value.\n\n\n var text = dataRangeText[1 - endsIndex];\n text = text != null ? text + '' : '';\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var itemSize = visualMapModel.itemSize;\n var barGroup = this._shapes.mainGroup;\n\n var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);\n\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\n\n var orient = this._orient;\n var textStyleModel = this.visualMapModel.textStyleModel;\n this.group.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: position[0],\n y: position[1],\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\n align: orient === 'horizontal' ? align : 'center',\n text: text\n })\n }));\n };\n\n ContinuousView.prototype._renderBar = function (targetGroup) {\n var visualMapModel = this.visualMapModel;\n var shapes = this._shapes;\n var itemSize = visualMapModel.itemSize;\n var orient = this._orient;\n var useHandle = this._useHandle;\n var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\n\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\n\n var gradientBarGroup = new graphic.Group();\n mainGroup.add(gradientBarGroup); // Bar\n\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, zrUtil.bind(this._dragHandle, this, 'all', false), zrUtil.bind(this._dragHandle, this, 'all', true))); // A border radius clip.\n\n gradientBarGroup.setClipPath(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: itemSize[0],\n height: itemSize[1],\n r: 3\n }\n }));\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\n var textSize = mathMax(textRect.width, textRect.height); // Handle\n\n if (useHandle) {\n shapes.handleThumbs = [];\n shapes.handleLabels = [];\n shapes.handleLabelPoints = [];\n\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\n\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\n }\n\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\n\n targetGroup.add(mainGroup);\n };\n\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\n var onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\n var onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\n var cursor = getCursor(this._orient);\n handleThumb.attr({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n ondragend: onDragEnd,\n onmousemove: function (e) {\n eventTool.stop(e.event);\n }\n });\n handleThumb.x = itemSize[0] / 2;\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\n handleThumb.setStyle({\n strokeNoScale: true,\n strokeFirst: true\n });\n handleThumb.style.lineWidth *= 2;\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n setAsHighDownDispatcher(handleThumb, true);\n mainGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by\n // transform (orient/inverse). So label is built separately but not\n // use zrender/graphic/helper/RectText, and is located based on view\n // group (according to handleLabelPoint) but not barGroup.\n\n var textStyleModel = this.visualMapModel.textStyleModel;\n var handleLabel = new graphic.Text({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n handleLabel.ensureState('blur').style = {\n opacity: 0.1\n };\n handleLabel.stateTransition = {\n duration: 200\n };\n this.group.add(handleLabel);\n var handleLabelPoint = [handleSize, 0];\n var shapes = this._shapes;\n shapes.handleThumbs[handleIndex] = handleThumb;\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\n shapes.handleLabels[handleIndex] = handleLabel;\n };\n\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\n indicator.attr({\n cursor: 'move',\n invisible: true,\n silent: true,\n x: itemSize[0] / 2\n });\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\n\n if (indicator instanceof ZRImage) {\n var pathStyle = indicator.style;\n indicator.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, indicatorStyle));\n } else {\n indicator.useStyle(indicatorStyle);\n }\n\n mainGroup.add(indicator);\n var textStyleModel = this.visualMapModel.textStyleModel;\n var indicatorLabel = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n this.group.add(indicatorLabel);\n var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];\n var shapes = this._shapes;\n shapes.indicator = indicator;\n shapes.indicatorLabel = indicatorLabel;\n shapes.indicatorLabelPoint = indicatorLabelPoint;\n this._firstShowIndicator = true;\n };\n\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, // dx is event from ondragend if isEnd is true. It's not used\n dx, dy) {\n if (!this._useHandle) {\n return;\n }\n\n this._dragging = !isEnd;\n\n if (!isEnd) {\n // Transform dx, dy to bar coordination.\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\n\n this._updateInterval(handleIndex, vertex[1]);\n\n this._hideIndicator(); // Considering realtime, update view should be executed\n // before dispatch action.\n\n\n this._updateView();\n } // dragEnd do not dispatch action when realtime.\n\n\n if (isEnd === !this.visualMapModel.get('realtime')) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: this._dataInterval.slice()\n });\n }\n\n if (isEnd) {\n !this._hovering && this._clearHoverLinkToSeries();\n } else if (useHoverLinkOnHandle(this.visualMapModel)) {\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\n }\n };\n\n ContinuousView.prototype._resetInterval = function () {\n var visualMapModel = this.visualMapModel;\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\n var dataExtent = visualMapModel.getExtent();\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];\n };\n /**\r\n * @private\r\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\r\n * @param {number} dx\r\n * @param {number} dy\r\n */\n\n\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\n delta = delta || 0;\n var visualMapModel = this.visualMapModel;\n var handleEnds = this._handleEnds;\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, // cross is forbidden\n 0);\n var dataExtent = visualMapModel.getExtent(); // Update data interval.\n\n this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];\n };\n\n ContinuousView.prototype._updateView = function (forSketch) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var shapes = this._shapes;\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\n\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\n\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\n\n shapes.inRange.setStyle({\n fill: visualInRange.barColor // opacity: visualInRange.opacity\n\n }).setShape('points', visualInRange.barPoints);\n shapes.outOfRange.setStyle({\n fill: visualOutOfRange.barColor // opacity: visualOutOfRange.opacity\n\n }).setShape('points', visualOutOfRange.barPoints);\n\n this._updateHandle(inRangeHandleEnds, visualInRange);\n };\n\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\n var opts = {\n forceState: forceState,\n convertOpacityToAlpha: true\n };\n\n var colorStops = this._makeColorGradient(dataInterval, opts);\n\n var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)];\n\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\n\n return {\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\n barPoints: barPoints,\n handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]\n };\n };\n\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\n // Considering colorHue, which is not linear, so we have to sample\n // to calculate gradient color stops, but not only calculate head\n // and tail.\n var sampleNumber = 100; // Arbitrary value.\n\n var colorStops = [];\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\n colorStops.push({\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\n offset: 0\n });\n\n for (var i = 1; i < sampleNumber; i++) {\n var currValue = dataInterval[0] + step * i;\n\n if (currValue > dataInterval[1]) {\n break;\n }\n\n colorStops.push({\n color: this.getControllerVisual(currValue, 'color', opts),\n offset: i / sampleNumber\n });\n }\n\n colorStops.push({\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\n offset: 1\n });\n return colorStops;\n };\n\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\n var itemSize = this.visualMapModel.itemSize;\n return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];\n };\n\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\n var orient = this._orient;\n var inverse = this.visualMapModel.get('inverse');\n return new graphic.Group(orient === 'horizontal' && !inverse ? {\n scaleX: itemAlign === 'bottom' ? 1 : -1,\n rotation: Math.PI / 2\n } : orient === 'horizontal' && inverse ? {\n scaleX: itemAlign === 'bottom' ? -1 : 1,\n rotation: -Math.PI / 2\n } : orient === 'vertical' && !inverse ? {\n scaleX: itemAlign === 'left' ? 1 : -1,\n scaleY: -1\n } : {\n scaleX: itemAlign === 'left' ? 1 : -1\n });\n };\n\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\n if (!this._useHandle) {\n return;\n }\n\n var shapes = this._shapes;\n var visualMapModel = this.visualMapModel;\n var handleThumbs = shapes.handleThumbs;\n var handleLabels = shapes.handleLabels;\n var itemSize = visualMapModel.itemSize;\n var dataExtent = visualMapModel.getExtent();\n each([0, 1], function (handleIndex) {\n var handleThumb = handleThumbs[handleIndex];\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\n handleThumb.y = handleEnds[handleIndex];\n var val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\n handleThumb.x = itemSize[0] - symbolSize / 2; // Update handle label position.\n\n var textPoint = graphic.applyTransform(shapes.handleLabelPoints[handleIndex], graphic.getTransform(handleThumb, this.group));\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\n verticalAlign: 'middle',\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\n });\n }, this);\n };\n\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var itemSize = visualMapModel.itemSize;\n var sizeExtent = [0, itemSize[1]];\n var shapes = this._shapes;\n var indicator = shapes.indicator;\n\n if (!indicator) {\n return;\n }\n\n indicator.attr('invisible', false);\n var opts = {\n convertOpacityToAlpha: true\n };\n var color = this.getControllerVisual(cursorValue, 'color', opts);\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\n var y = linearMap(cursorValue, dataExtent, sizeExtent, true);\n var x = itemSize[0] - symbolSize / 2;\n var oldIndicatorPos = {\n x: indicator.x,\n y: indicator.y\n }; // Update handle label position.\n\n indicator.y = y;\n indicator.x = x;\n var textPoint = graphic.applyTransform(shapes.indicatorLabelPoint, graphic.getTransform(indicator, this.group));\n var indicatorLabel = shapes.indicatorLabel;\n indicatorLabel.attr('invisible', false);\n\n var align = this._applyTransform('left', shapes.mainGroup);\n\n var orient = this._orient;\n var isHorizontal = orient === 'horizontal';\n indicatorLabel.setStyle({\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\n verticalAlign: isHorizontal ? align : 'middle',\n align: isHorizontal ? 'center' : align\n });\n var indicatorNewProps = {\n x: x,\n y: y,\n style: {\n fill: color\n }\n };\n var labelNewProps = {\n style: {\n x: textPoint[0],\n y: textPoint[1]\n }\n };\n\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\n var animationCfg = {\n duration: 100,\n easing: 'cubicInOut',\n additive: true\n };\n indicator.x = oldIndicatorPos.x;\n indicator.y = oldIndicatorPos.y;\n indicator.animateTo(indicatorNewProps, animationCfg);\n indicatorLabel.animateTo(labelNewProps, animationCfg);\n } else {\n indicator.attr(indicatorNewProps);\n indicatorLabel.attr(labelNewProps);\n }\n\n this._firstShowIndicator = false;\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.enterBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\n var self = this;\n\n this._shapes.mainGroup.on('mousemove', function (e) {\n self._hovering = true;\n\n if (!self._dragging) {\n var itemSize = self.visualMapModel.itemSize;\n\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); // For hover link show when hover handle, which might be\n // below or upper than sizeExtent.\n\n\n pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\n\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\n }\n }).on('mouseout', function () {\n // When mouse is out of handle, hoverLink still need\n // to be displayed when realtime is set as false.\n self._hovering = false;\n !self._dragging && self._clearHoverLinkToSeries();\n });\n };\n\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\n var zr = this.api.getZr();\n\n if (this.visualMapModel.option.hoverLink) {\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\n zr.on('mouseout', this._hideIndicator, this);\n } else {\n this._clearHoverLinkFromSeries();\n }\n };\n\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\n var visualMapModel = this.visualMapModel;\n var itemSize = visualMapModel.itemSize;\n\n if (!visualMapModel.option.hoverLink) {\n return;\n }\n\n var sizeExtent = [0, itemSize[1]];\n var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent.\n\n cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\n var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\n var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\n // where china and india has very large population.\n\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle,\n // otherwise labels overlap, especially when dragging.\n\n if (hoverOnBar) {\n if (valueRange[0] === -Infinity) {\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\n } else if (valueRange[1] === Infinity) {\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\n } else {\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\n }\n } // When realtime is set as false, handles, which are in barGroup,\n // also trigger hoverLink, which help user to realize where they\n // focus on when dragging. (see test/heatmap-large.html)\n // When realtime is set as true, highlight will not show when hover\n // handle, because the label on handle, which displays a exact value\n // but not range, might mislead users.\n\n\n var oldBatch = this._hoverLinkDataIndices;\n var newBatch = [];\n\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\n }\n\n var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\n\n this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\n };\n\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\n var ecData;\n findEventDispatcher(e.target, function (target) {\n var currECData = getECData(target);\n\n if (currECData.dataIndex != null) {\n ecData = currECData;\n return true;\n }\n }, true);\n\n if (!ecData) {\n return;\n }\n\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\n var visualMapModel = this.visualMapModel;\n\n if (!visualMapModel.isTargetSeries(dataModel)) {\n return;\n }\n\n var data = dataModel.getData(ecData.dataType);\n var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);\n\n if (!isNaN(value)) {\n this._showIndicator(value, value);\n }\n };\n\n ContinuousView.prototype._hideIndicator = function () {\n var shapes = this._shapes;\n shapes.indicator && shapes.indicator.attr('invisible', true);\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.leaveBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\n this._hideIndicator();\n\n var indices = this._hoverLinkDataIndices;\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\n\n indices.length = 0;\n };\n\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\n this._hideIndicator();\n\n var zr = this.api.getZr();\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\n zr.off('mouseout', this._hideIndicator);\n };\n\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\n var transform = graphic.getTransform(element, global ? null : this.group);\n return zrUtil.isArray(vertex) ? graphic.applyTransform(vertex, transform, inverse) : graphic.transformDirection(vertex, transform, inverse);\n }; // TODO: TYPE more specified payload types.\n\n\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\n batch && batch.length && this.api.dispatchAction({\n type: type,\n batch: batch\n });\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousView.prototype.dispose = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousView.prototype.remove = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n\n ContinuousView.type = 'visualMap.continuous';\n return ContinuousView;\n}(VisualMapView);\n\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\n return new graphic.Polygon({\n shape: {\n points: points\n },\n draggable: !!onDrift,\n cursor: cursor,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd\n });\n}\n\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\n\n if (hoverLinkDataSize) {\n halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\n }\n\n return halfHoverLinkSize;\n}\n\nfunction useHoverLinkOnHandle(visualMapModel) {\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default ContinuousView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport var visualMapActionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\nexport var visualMapActionHander = function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nexport var visualMapEncodingHandlers = [{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));\n });\n return resetDefines;\n }\n}, // Only support color.\n{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var dimIdx = visualMapModel.getDataDimensionIndex(data);\n\n if (dimIdx >= 0) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimIdx;\n visualMetaList.push(visualMeta);\n }\n }\n }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}]; // FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\n\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: getVisualFromData(seriesModel.getData(), 'color') // default color.\n\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n\n return resultVisual.color;\n\n function getVisual(key) {\n return resultVisual[key];\n }\n\n function setVisual(key, value) {\n resultVisual[key] = value;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar each = zrUtil.each;\nexport default function visualMapPreprocessor(option) {\n var visualMap = option && option.visualMap;\n\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n } // rename splitList to pieces\n\n\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n\n var pieces = opt.pieces;\n\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\n\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction.js';\nimport { visualMapEncodingHandlers } from './visualEncoding.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport preprocessor from './preprocessor.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n });\n registers.registerAction(visualMapActionInfo, visualMapActionHander);\n each(visualMapEncodingHandlers, function (handler) {\n registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\n });\n registers.registerPreprocessor(preprocessor);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ContinuousModel from './ContinuousModel.js';\nimport ContinuousView from './ContinuousView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(ContinuousModel);\n registers.registerComponentView(ContinuousView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport { reformIntervals } from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar PiecewiseModel =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseModel, _super);\n\n function PiecewiseModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseModel.type;\n /**\r\n * The order is always [low, ..., high].\r\n * [{text: string, interval: Array.}, ...]\r\n */\n\n _this._pieceList = [];\n return _this;\n }\n\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n\n var mode = this._mode = this._determineMode();\n\n this._pieceList = [];\n\n resetMethods[this._mode].call(this, this._pieceList);\n\n this._resetSelected(newOption, isInit);\n\n var categories = this.option.categories;\n this.resetVisual(function (mappingOption, state) {\n if (mode === 'categories') {\n mappingOption.mappingMethod = 'category';\n mappingOption.categories = zrUtil.clone(categories);\n } else {\n mappingOption.dataExtent = this.getExtent();\n mappingOption.mappingMethod = 'piecewise';\n mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\n piece = zrUtil.clone(piece);\n\n if (state !== 'inRange') {\n // FIXME\n // outOfRange do not support special visual in pieces.\n piece.visual = null;\n }\n\n return piece;\n });\n }\n });\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.completeVisualOption = function () {\n // Consider this case:\n // visualMap: {\n // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\n // }\n // where no inRange/outOfRange set but only pieces. So we should make\n // default inRange/outOfRange for this case, otherwise visuals that only\n // appear in `pieces` will not be taken into account in visual encoding.\n var option = this.option;\n var visualTypesInPieces = {};\n var visualTypes = VisualMapping.listVisualTypes();\n var isCategory = this.isCategory();\n zrUtil.each(option.pieces, function (piece) {\n zrUtil.each(visualTypes, function (visualType) {\n if (piece.hasOwnProperty(visualType)) {\n visualTypesInPieces[visualType] = 1;\n }\n });\n });\n zrUtil.each(visualTypesInPieces, function (v, visualType) {\n var exists = false;\n zrUtil.each(this.stateList, function (state) {\n exists = exists || has(option, state, visualType) || has(option.target, state, visualType);\n }, this);\n !exists && zrUtil.each(this.stateList, function (state) {\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\n });\n }, this);\n\n function has(obj, state, visualType) {\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\n }\n\n _super.prototype.completeVisualOption.apply(this, arguments);\n };\n\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\n var thisOption = this.option;\n var pieceList = this._pieceList; // Selected do not merge but all override.\n\n var selected = (isInit ? thisOption : newOption).selected || {};\n thisOption.selected = selected; // Consider 'not specified' means true.\n\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (!selected.hasOwnProperty(key)) {\n selected[key] = true;\n }\n }, this);\n\n if (thisOption.selectedMode === 'single') {\n // Ensure there is only one selected.\n var hasSel_1 = false;\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (selected[key]) {\n hasSel_1 ? selected[key] = false : hasSel_1 = true;\n }\n }, this);\n } // thisOption.selectedMode === 'multiple', default: all selected.\n\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getItemSymbol = function () {\n return this.get('itemSymbol');\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\n return this._mode === 'categories' ? piece.value + '' : piece.index + '';\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getPieceList = function () {\n return this._pieceList;\n };\n /**\r\n * @return {string}\r\n */\n\n\n PiecewiseModel.prototype._determineMode = function () {\n var option = this.option;\n return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber';\n };\n /**\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.setSelected = function (selected) {\n this.option.selected = zrUtil.clone(selected);\n };\n /**\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.getValueState = function (value) {\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\n return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange';\n };\n /**\r\n * @public\r\n * @param pieceIndex piece index in visualMapModel.getPieceList()\r\n */\n\n\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\n var result = [];\n var pieceList = this._pieceList;\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n // Should always base on model pieceList, because it is order sensitive.\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\n pIdx === pieceIndex && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\r\n * @private\r\n * @param piece piece.value or piece.interval is required.\r\n * @return Can be Infinity or -Infinity\r\n */\n\n\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\n var representValue;\n\n if (this.isCategory()) {\n representValue = piece.value;\n } else {\n if (piece.value != null) {\n representValue = piece.value;\n } else {\n var pieceInterval = piece.interval || [];\n representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;\n }\n }\n\n return representValue;\n };\n\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\n // Do not support category. (category axis is ordinal, numerical)\n if (this.isCategory()) {\n return;\n }\n\n var stops = [];\n var outerColors = ['', ''];\n var visualMapModel = this;\n\n function setStop(interval, valueState) {\n var representValue = visualMapModel.getRepresentValue({\n interval: interval\n }); // Not category\n\n if (!valueState) {\n valueState = visualMapModel.getValueState(representValue);\n }\n\n var color = getColorVisual(representValue, valueState);\n\n if (interval[0] === -Infinity) {\n outerColors[0] = color;\n } else if (interval[1] === Infinity) {\n outerColors[1] = color;\n } else {\n stops.push({\n value: interval[0],\n color: color\n }, {\n value: interval[1],\n color: color\n });\n }\n } // Suplement\n\n\n var pieceList = this._pieceList.slice();\n\n if (!pieceList.length) {\n pieceList.push({\n interval: [-Infinity, Infinity]\n });\n } else {\n var edge = pieceList[0].interval[0];\n edge !== -Infinity && pieceList.unshift({\n interval: [-Infinity, edge]\n });\n edge = pieceList[pieceList.length - 1].interval[1];\n edge !== Infinity && pieceList.push({\n interval: [edge, Infinity]\n });\n }\n\n var curr = -Infinity;\n zrUtil.each(pieceList, function (piece) {\n var interval = piece.interval;\n\n if (interval) {\n // Fulfill gap.\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\n setStop(interval.slice());\n curr = interval[1];\n }\n }, this);\n return {\n stops: stops,\n outerColors: outerColors\n };\n };\n\n PiecewiseModel.type = 'visualMap.piecewise';\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n selected: null,\n minOpen: false,\n maxOpen: false,\n align: 'auto',\n itemWidth: 20,\n itemHeight: 14,\n itemSymbol: 'roundRect',\n pieces: null,\n categories: null,\n splitNumber: 5,\n selectedMode: 'multiple',\n itemGap: 10,\n hoverLink: true // Enable hover highlight.\n\n });\n return PiecewiseModel;\n}(VisualMapModel);\n\n;\n/**\r\n * Key is this._mode\r\n * @type {Object}\r\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\r\n */\n\nvar resetMethods = {\n splitNumber: function (outPieceList) {\n var thisOption = this.option;\n var precision = Math.min(thisOption.precision, 20);\n var dataExtent = this.getExtent();\n var splitNumber = thisOption.splitNumber;\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\n thisOption.splitNumber = splitNumber;\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption\n\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\n precision++;\n }\n\n thisOption.precision = precision;\n splitStep = +splitStep.toFixed(precision);\n\n if (thisOption.minOpen) {\n outPieceList.push({\n interval: [-Infinity, dataExtent[0]],\n close: [0, 0]\n });\n }\n\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\n var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;\n outPieceList.push({\n interval: [curr, max],\n close: [1, 1]\n });\n }\n\n if (thisOption.maxOpen) {\n outPieceList.push({\n interval: [dataExtent[1], Infinity],\n close: [0, 0]\n });\n }\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece, index) {\n piece.index = index;\n piece.text = this.formatValueText(piece.interval);\n }, this);\n },\n categories: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.categories, function (cate) {\n // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。\n // 是否改一致。\n outPieceList.push({\n text: this.formatValueText(cate, true),\n value: cate\n });\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList);\n },\n pieces: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\n if (!zrUtil.isObject(pieceListItem)) {\n pieceListItem = {\n value: pieceListItem\n };\n }\n\n var item = {\n text: '',\n index: index\n };\n\n if (pieceListItem.label != null) {\n item.text = pieceListItem.label;\n }\n\n if (pieceListItem.hasOwnProperty('value')) {\n var value = item.value = pieceListItem.value;\n item.interval = [value, value];\n item.close = [1, 1];\n } else {\n // `min` `max` is legacy option.\n // `lt` `gt` `lte` `gte` is recommended.\n var interval = item.interval = [];\n var close_1 = item.close = [0, 0];\n var closeList = [1, 0, 1];\n var infinityList = [-Infinity, Infinity];\n var useMinMax = [];\n\n for (var lg = 0; lg < 2; lg++) {\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\n\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\n interval[lg] = pieceListItem[names[i]];\n close_1[lg] = closeList[i];\n useMinMax[lg] = i === 2;\n }\n\n interval[lg] == null && (interval[lg] = infinityList[lg]);\n }\n\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\n\n if (process.env.NODE_ENV !== 'production') {\n if (interval[0] > interval[1]) {\n console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.');\n }\n }\n\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\n // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\n // we use value to lift the priority when min === max\n item.value = interval[0];\n }\n }\n\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\n outPieceList.push(item);\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList); // Only pieces\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece) {\n var close = piece.close;\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\n }, this);\n }\n};\n\nfunction normalizeReverse(thisOption, pieceList) {\n var inverse = thisOption.inverse;\n\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\n pieceList.reverse();\n }\n}\n\nexport default PiecewiseModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from './helper.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\n\nvar PiecewiseVisualMapView =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseVisualMapView, _super);\n\n function PiecewiseVisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseVisualMapView.type;\n return _this;\n }\n\n PiecewiseVisualMapView.prototype.doRender = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var textStyleModel = visualMapModel.textStyleModel;\n var textFont = textStyleModel.getFont();\n var textFill = textStyleModel.getTextColor();\n\n var itemAlign = this._getItemAlign();\n\n var itemSize = visualMapModel.itemSize;\n\n var viewData = this._getViewData();\n\n var endsText = viewData.endsText;\n var showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\n zrUtil.each(viewData.viewPieceList, function (item) {\n var piece = item.piece;\n var itemGroup = new graphic.Group();\n itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\n\n this._enableHoverLink(itemGroup, item.indexInModelPieceList); // TODO Category\n\n\n var representValue = visualMapModel.getRepresentValue(piece);\n\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\n\n if (showLabel) {\n var visualState = this.visualMapModel.getValueState(representValue);\n itemGroup.add(new graphic.Text({\n style: {\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\n y: itemSize[1] / 2,\n text: piece.text,\n verticalAlign: 'middle',\n align: itemAlign,\n font: textFont,\n fill: textFill,\n opacity: visualState === 'outOfRange' ? 0.5 : 1\n }\n }));\n }\n\n thisGroup.add(itemGroup);\n }, this);\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\n layout.box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\n this.renderBackground(thisGroup);\n this.positionGroup(thisGroup);\n };\n\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\n var _this = this;\n\n itemGroup.on('mouseover', function () {\n return onHoverLink('highlight');\n }).on('mouseout', function () {\n return onHoverLink('downplay');\n });\n\n var onHoverLink = function (method) {\n var visualMapModel = _this.visualMapModel; // TODO: TYPE More detailed action types\n\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\n type: method,\n batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\n });\n };\n };\n\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\n var visualMapModel = this.visualMapModel;\n var modelOption = visualMapModel.option;\n\n if (modelOption.orient === 'vertical') {\n return helper.getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\n } else {\n // horizontal, most case left unless specifying right.\n var align = modelOption.align;\n\n if (!align || align === 'auto') {\n align = 'left';\n }\n\n return align;\n }\n };\n\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\n if (!text) {\n return;\n }\n\n var itemGroup = new graphic.Group();\n var textStyleModel = this.visualMapModel.textStyleModel;\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2,\n y: itemSize[1] / 2,\n verticalAlign: 'middle',\n align: showLabel ? itemAlign : 'center',\n text: text\n })\n }));\n group.add(itemGroup);\n };\n /**\r\n * @private\r\n * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\r\n */\n\n\n PiecewiseVisualMapView.prototype._getViewData = function () {\n var visualMapModel = this.visualMapModel;\n var viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\n return {\n piece: piece,\n indexInModelPieceList: index\n };\n });\n var endsText = visualMapModel.get('text'); // Consider orient and inverse.\n\n var orient = visualMapModel.get('orient');\n var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high]\n\n if (orient === 'horizontal' ? inverse : !inverse) {\n viewPieceList.reverse();\n } // Origin order of endsText is [high, low]\n else if (endsText) {\n endsText = endsText.slice().reverse();\n }\n\n return {\n viewPieceList: viewPieceList,\n endsText: endsText\n };\n };\n\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\n group.add(createSymbol( // symbol will be string\n this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], // color will be string\n this.getControllerVisual(representValue, 'color')));\n };\n\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\n var visualMapModel = this.visualMapModel;\n var option = visualMapModel.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n var selected = zrUtil.clone(option.selected);\n var newKey = visualMapModel.getSelectedMapKey(piece);\n\n if (selectedMode === 'single' || selectedMode === true) {\n selected[newKey] = true;\n zrUtil.each(selected, function (o, key) {\n selected[key] = key === newKey;\n });\n } else {\n selected[newKey] = !selected[newKey];\n }\n\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: selected\n });\n };\n\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\n return PiecewiseVisualMapView;\n}(VisualMapView);\n\nexport default PiecewiseVisualMapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport PiecewiseModel from './PiecewiseModel.js';\nimport PiecewiseView from './PiecewiseView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(PiecewiseModel);\n registers.registerComponentView(PiecewiseView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installVisualMapContinuous } from './installVisualMapContinuous.js';\nimport { install as installVisualMapPiecewise } from './installVisualMapPiecewise.js';\nexport function install(registers) {\n use(installVisualMapContinuous);\n use(installVisualMapPiecewise); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\nimport { getDecalFromPalette } from '../model/mixin/palette.js';\nvar DEFAULT_OPTION = {\n label: {\n enabled: true\n },\n decal: {\n show: false\n }\n};\nvar inner = makeInner();\nvar decalPaletteScope = {};\nexport default function ariaVisual(ecModel, api) {\n var ariaModel = ecModel.getModel('aria'); // See \"area enabled\" detection code in `GlobalModel.ts`.\n\n if (!ariaModel.get('enabled')) {\n return;\n }\n\n var defaultOption = zrUtil.clone(DEFAULT_OPTION);\n zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\n zrUtil.merge(ariaModel.option, defaultOption, false);\n setDecal();\n setLabel();\n\n function setDecal() {\n var decalModel = ariaModel.getModel('decal');\n var useDecal = decalModel.get('show');\n\n if (useDecal) {\n // Each type of series use one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType_1 = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries()) {\n return;\n }\n\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\n\n if (!decalScope) {\n decalScope = {};\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\n }\n\n inner(seriesModel).scope = decalScope;\n });\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n if (zrUtil.isFunction(seriesModel.enableAriaDecal)) {\n // Let series define how to use decal palette on data\n seriesModel.enableAriaDecal();\n return;\n }\n\n var data = seriesModel.getData();\n\n if (!seriesModel.isColorBySeries()) {\n var dataAll_1 = seriesModel.getRawData();\n var idxMap_1 = {};\n var decalScope_1 = inner(seriesModel).scope;\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap_1[rawIdx] = idx;\n });\n var dataCount_1 = dataAll_1.count();\n dataAll_1.each(function (rawIdx) {\n var idx = idxMap_1[rawIdx];\n var name = dataAll_1.getName(rawIdx) || rawIdx + '';\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\n var specifiedDecal = data.getItemVisual(idx, 'decal');\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\n });\n } else {\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\n var specifiedDecal = data.getVisual('decal');\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\n }\n\n function mergeDecal(specifiedDecal, paletteDecal) {\n // Merge decal from palette to decal from itemStyle.\n // User do not need to specify all of the decal props.\n var resultDecal = specifiedDecal ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal) : paletteDecal;\n resultDecal.dirty = true;\n return resultDecal;\n }\n });\n }\n }\n\n function setLabel() {\n var labelLocale = ecModel.getLocaleModel().get('aria');\n var labelModel = ariaModel.getModel('label');\n labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\n\n if (!labelModel.get('enabled')) {\n return;\n }\n\n var dom = api.getZr().dom;\n\n if (labelModel.get('description')) {\n dom.setAttribute('aria-label', labelModel.get('description'));\n return;\n }\n\n var seriesCnt = ecModel.getSeriesCount();\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n var ariaLabel;\n\n if (seriesCnt < 1) {\n // No series, no aria label\n return;\n } else {\n var title = getTitle();\n\n if (title) {\n var withTitle = labelModel.get(['general', 'withTitle']);\n ariaLabel = replace(withTitle, {\n title: title\n });\n } else {\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\n }\n\n var seriesLabels_1 = [];\n var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']);\n ariaLabel += replace(prefix, {\n seriesCount: seriesCnt\n });\n ecModel.eachSeries(function (seriesModel, idx) {\n if (idx < displaySeriesCnt) {\n var seriesLabel = void 0;\n var seriesName = seriesModel.get('name');\n var withName = seriesName ? 'withName' : 'withoutName';\n seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]);\n seriesLabel = replace(seriesLabel, {\n seriesId: seriesModel.seriesIndex,\n seriesName: seriesModel.get('name'),\n seriesType: getSeriesTypeName(seriesModel.subType)\n });\n var data = seriesModel.getData();\n\n if (data.count() > maxDataCnt) {\n // Show part of data\n var partialLabel = labelModel.get(['data', 'partialData']);\n seriesLabel += replace(partialLabel, {\n displayCnt: maxDataCnt\n });\n } else {\n seriesLabel += labelModel.get(['data', 'allData']);\n }\n\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\n var dataLabels = [];\n\n for (var i = 0; i < data.count(); i++) {\n if (i < maxDataCnt) {\n var name_1 = data.getName(i);\n var value = data.getValues(i);\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\n dataLabels.push(replace(dataLabel, {\n name: name_1,\n value: value.join(middleSeparator_1)\n }));\n }\n }\n\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\n seriesLabels_1.push(seriesLabel);\n }\n });\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\n var middleSeparator = separatorModel.get('middle');\n var endSeparator = separatorModel.get('end');\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\n dom.setAttribute('aria-label', ariaLabel);\n }\n }\n\n function replace(str, keyValues) {\n if (!zrUtil.isString(str)) {\n return str;\n }\n\n var result = str;\n zrUtil.each(keyValues, function (value, key) {\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n });\n return result;\n }\n\n function getTitle() {\n var title = ecModel.get('title');\n\n if (title && title.length) {\n title = title[0];\n }\n\n return title && title.text;\n }\n\n function getSeriesTypeName(type) {\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function ariaPreprocessor(option) {\n if (!option || !option.aria) {\n return;\n }\n\n var aria = option.aria; // aria.show is deprecated and should use aria.enabled instead\n\n if (aria.show != null) {\n aria.enabled = aria.show;\n }\n\n aria.label = aria.label || {}; // move description, general, series, data to be under aria.label\n\n zrUtil.each(['description', 'general', 'series', 'data'], function (name) {\n if (aria[name] != null) {\n aria.label[name] = aria[name];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ariaVisual from '../../visual/aria.js';\nimport ariaPreprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerPreprocessor(ariaPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne' // Might be misleading for sake of the difference between '==' and '===',\n // so don't support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n\n}; // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\n\nvar RegExpEvaluator =\n/** @class */\nfunction () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n\n if (condValue == null) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n\n throwError(errMsg);\n }\n }\n\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = typeof lVal;\n return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n };\n\n return RegExpEvaluator;\n}();\n\nvar ConstConditionInternal =\n/** @class */\nfunction () {\n function ConstConditionInternal() {}\n\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n\n return ConstConditionInternal;\n}();\n\nvar AndConditionInternal =\n/** @class */\nfunction () {\n function AndConditionInternal() {}\n\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n\n return true;\n };\n\n return AndConditionInternal;\n}();\n\nvar OrConditionInternal =\n/** @class */\nfunction () {\n function OrConditionInternal() {}\n\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n\n return false;\n };\n\n return OrConditionInternal;\n}();\n\nvar NotConditionInternal =\n/** @class */\nfunction () {\n function NotConditionInternal() {}\n\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n\n return NotConditionInternal;\n}();\n\nvar RelationalConditionInternal =\n/** @class */\nfunction () {\n function RelationalConditionInternal() {}\n\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser; // Call getValue with no `this`.\n\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow \"and\" logic internally.\n\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n\n return true;\n };\n\n return RelationalConditionInternal;\n}();\n\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n\n var errMsg = '';\n\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n\n throwError(errMsg);\n }\n\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n\n return parseRelationalOption(exprOption, getters);\n}\n\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n\n if (!cond.children.length) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n\n if (!cond.child) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n subCondList.push(evaluator);\n }\n\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n } // No relational operator always disabled in case of dangers result.\n\n\n throwError(errMsg);\n }\n\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\n\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\n\nvar ConditionalExpressionParsed =\n/** @class */\nfunction () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n\n return ConditionalExpressionParsed;\n}();\n\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseConditionalExpression } from '../../util/conditionalExpression.js';\nimport { hasOwn, createHashMap } from 'zrender/lib/core/util.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nexport var filterTransform = {\n type: 'echarts:filter',\n // PENDING: enhance to filter by index rather than create new data\n transform: function (params) {\n // [Caveat] Fail-Fast:\n // Do not return the whole dataset unless user config indicates it explicitly.\n // For example, if no condition is specified by mistake, returning an empty result\n // is better than returning the entire raw source for the user to find the mistake.\n var upstream = params.upstream;\n var rawItem;\n var condition = parseConditionalExpression(params.config, {\n valueGetterAttrMap: createHashMap({\n dimension: true\n }),\n prepareGetValue: function (exprOption) {\n var errMsg = '';\n var dimLoose = exprOption.dimension;\n\n if (!hasOwn(exprOption, 'dimension')) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n return {\n dimIdx: dimInfo.index\n };\n },\n getValue: function (param) {\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\n }\n });\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n rawItem = upstream.getRawDataItem(i);\n\n if (condition.evaluate()) {\n resultData.push(rawItem);\n }\n }\n\n return {\n data: resultData\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS } from '../../util/types.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { getRawValueParser, SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nvar sampleLog = '';\n\nif (process.env.NODE_ENV !== 'production') {\n sampleLog = ['Valid config is like:', '{ dimension: \"age\", order: \"asc\" }', 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'].join(' ');\n}\n\nexport var sortTransform = {\n type: 'echarts:sort',\n transform: function (params) {\n var upstream = params.upstream;\n var config = params.config;\n var errMsg = ''; // Normalize\n // const orderExprList: OrderExpression[] = isArray(config[0])\n // ? config as OrderExpression[]\n // : [config as OrderExpression];\n\n var orderExprList = normalizeToArray(config);\n\n if (!orderExprList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Empty `config` in sort transform.';\n }\n\n throwError(errMsg);\n }\n\n var orderDefList = [];\n each(orderExprList, function (orderExpr) {\n var dimLoose = orderExpr.dimension;\n var order = orderExpr.order;\n var parserName = orderExpr.parser;\n var incomparable = orderExpr.incomparable;\n\n if (dimLoose == null) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (incomparable && incomparable !== 'min' && incomparable !== 'max') {\n var errMsg_1 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\n }\n\n throwError(errMsg_1);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n var errMsg_2 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\n }\n\n throwError(errMsg_2);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n var parser = parserName ? getRawValueParser(parserName) : null;\n\n if (parserName && !parser) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n orderDefList.push({\n dimIdx: dimInfo.index,\n parser: parser,\n comparator: new SortOrderComparator(order, incomparable)\n });\n }); // TODO: support it?\n\n var sourceFormat = upstream.sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\n }\n\n throwError(errMsg);\n } // Other upstream format are all array.\n\n\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n resultData.push(upstream.getRawDataItem(i));\n }\n\n resultData.sort(function (item0, item1) {\n for (var i = 0; i < orderDefList.length; i++) {\n var orderDef = orderDefList[i];\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\n\n if (orderDef.parser) {\n val0 = orderDef.parser(val0);\n val1 = orderDef.parser(val1);\n }\n\n var result = orderDef.comparator.evaluate(val0, val1);\n\n if (result !== 0) {\n return result;\n }\n }\n\n return 0;\n });\n return {\n data: resultData\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { filterTransform } from './filterTransform.js';\nimport { sortTransform } from './sortTransform.js';\nexport function install(registers) {\n registers.registerTransform(filterTransform);\n registers.registerTransform(sortTransform);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * This module is imported by echarts directly.\r\n *\r\n * Notice:\r\n * Always keep this file exists for backward compatibility.\r\n * Because before 4.1.0, dataset is an optional component,\r\n * some users may import this module manually.\r\n */\n\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { SERIES_LAYOUT_BY_COLUMN } from '../../util/types.js';\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager.js';\n\nvar DatasetModel =\n/** @class */\nfunction (_super) {\n __extends(DatasetModel, _super);\n\n function DatasetModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n this._sourceManager = new SourceManager(this);\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\n _super.prototype.mergeOption.call(this, newOption, ecModel);\n\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.optionUpdated = function () {\n this._sourceManager.dirty();\n };\n\n DatasetModel.prototype.getSourceManager = function () {\n return this._sourceManager;\n };\n\n DatasetModel.type = 'dataset';\n DatasetModel.defaultOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\n };\n return DatasetModel;\n}(ComponentModel);\n\nexport { DatasetModel };\n\nvar DatasetView =\n/** @class */\nfunction (_super) {\n __extends(DatasetView, _super);\n\n function DatasetView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetView.type = 'dataset';\n return DatasetView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(DatasetModel);\n registers.registerComponentView(DatasetView);\n}","import { cubicSubdivide } from '../core/curve.js';\nimport PathProxy from '../core/PathProxy.js';\nvar CMD = PathProxy.CMD;\nfunction aroundEqual(a, b) {\n return Math.abs(a - b) < 1e-5;\n}\nexport function pathToBezierCurves(path) {\n var data = path.data;\n var len = path.len();\n var bezierArrayGroups = [];\n var currentSubpath;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n function createNewSubpath(x, y) {\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n currentSubpath = [x, y];\n }\n function addLine(x0, y0, x1, y1) {\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\n }\n }\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\n var delta = Math.abs(endAngle - startAngle);\n var len = Math.tan(delta / 4) * 4 / 3;\n var dir = endAngle < startAngle ? -1 : 1;\n var c1 = Math.cos(startAngle);\n var s1 = Math.sin(startAngle);\n var c2 = Math.cos(endAngle);\n var s2 = Math.sin(endAngle);\n var x1 = c1 * rx + cx;\n var y1 = s1 * ry + cy;\n var x4 = c2 * rx + cx;\n var y4 = s2 * ry + cy;\n var hx = rx * len * dir;\n var hy = ry * len * dir;\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\n }\n var x1;\n var y1;\n var x2;\n var y2;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n currentSubpath = [x0, y0];\n }\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n createNewSubpath(x0, y0);\n break;\n case CMD.L:\n x1 = data[i++];\n y1 = data[i++];\n addLine(xi, yi, x1, y1);\n xi = x1;\n yi = y1;\n break;\n case CMD.C:\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\n break;\n case CMD.Q:\n x1 = data[i++];\n y1 = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\n xi = x2;\n yi = y2;\n break;\n case CMD.A:\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;\n i += 1;\n var anticlockwise = !data[i++];\n x1 = Math.cos(startAngle) * rx + cx;\n y1 = Math.sin(startAngle) * ry + cy;\n if (isFirst) {\n x0 = x1;\n y0 = y1;\n createNewSubpath(x0, y0);\n }\n else {\n addLine(xi, yi, x1, y1);\n }\n xi = Math.cos(endAngle) * rx + cx;\n yi = Math.sin(endAngle) * ry + cy;\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n : Math.min(angle + step, endAngle);\n addArc(angle, nextAngle, cx, cy, rx, ry);\n }\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n x1 = x0 + data[i++];\n y1 = y0 + data[i++];\n createNewSubpath(x1, y0);\n addLine(x1, y0, x1, y1);\n addLine(x1, y1, x0, y1);\n addLine(x0, y1, x0, y0);\n addLine(x0, y0, x1, y0);\n break;\n case CMD.Z:\n currentSubpath && addLine(xi, yi, x0, y0);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n return bezierArrayGroups;\n}\nfunction adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out, scale) {\n if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {\n out.push(x3, y3);\n return;\n }\n var PIXEL_DISTANCE = 2 / scale;\n var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;\n var dx = x3 - x0;\n var dy = y3 - y0;\n var d = Math.sqrt(dx * dx + dy * dy);\n dx /= d;\n dy /= d;\n var dx1 = x1 - x0;\n var dy1 = y1 - y0;\n var dx2 = x2 - x3;\n var dy2 = y2 - y3;\n var cp1LenSqr = dx1 * dx1 + dy1 * dy1;\n var cp2LenSqr = dx2 * dx2 + dy2 * dy2;\n if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {\n out.push(x3, y3);\n return;\n }\n var projLen1 = dx * dx1 + dy * dy1;\n var projLen2 = -dx * dx2 - dy * dy2;\n var d1Sqr = cp1LenSqr - projLen1 * projLen1;\n var d2Sqr = cp2LenSqr - projLen2 * projLen2;\n if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0\n && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) {\n out.push(x3, y3);\n return;\n }\n var tmpSegX = [];\n var tmpSegY = [];\n cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);\n adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out, scale);\n adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out, scale);\n}\nexport function pathToPolygons(path, scale) {\n var bezierArrayGroups = pathToBezierCurves(path);\n var polygons = [];\n scale = scale || 1;\n for (var i = 0; i < bezierArrayGroups.length; i++) {\n var beziers = bezierArrayGroups[i];\n var polygon = [];\n var x0 = beziers[0];\n var y0 = beziers[1];\n polygon.push(x0, y0);\n for (var k = 2; k < beziers.length;) {\n var x1 = beziers[k++];\n var y1 = beziers[k++];\n var x2 = beziers[k++];\n var y2 = beziers[k++];\n var x3 = beziers[k++];\n var y3 = beziers[k++];\n adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale);\n x0 = x3;\n y0 = y3;\n }\n polygons.push(polygon);\n }\n return polygons;\n}\n","import { fromPoints } from '../core/bbox.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Point from '../core/Point.js';\nimport { map } from '../core/util.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Sector from '../graphic/shape/Sector.js';\nimport { pathToPolygons } from './convertPath.js';\nimport { clonePath } from './path.js';\nfunction getDividingGrids(dimSize, rowDim, count) {\n var rowSize = dimSize[rowDim];\n var columnSize = dimSize[1 - rowDim];\n var ratio = Math.abs(rowSize / columnSize);\n var rowCount = Math.ceil(Math.sqrt(ratio * count));\n var columnCount = Math.floor(count / rowCount);\n if (columnCount === 0) {\n columnCount = 1;\n rowCount = count;\n }\n var grids = [];\n for (var i = 0; i < rowCount; i++) {\n grids.push(columnCount);\n }\n var currentCount = rowCount * columnCount;\n var remained = count - currentCount;\n if (remained > 0) {\n for (var i = 0; i < remained; i++) {\n grids[i % rowCount] += 1;\n }\n }\n return grids;\n}\nfunction divideSector(sectorShape, count, outShapes) {\n var r0 = sectorShape.r0;\n var r = sectorShape.r;\n var startAngle = sectorShape.startAngle;\n var endAngle = sectorShape.endAngle;\n var angle = Math.abs(endAngle - startAngle);\n var arcLen = angle * r;\n var deltaR = r - r0;\n var isAngleRow = arcLen > Math.abs(deltaR);\n var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count);\n var rowSize = (isAngleRow ? angle : deltaR) / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = (isAngleRow ? deltaR : angle) / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n if (isAngleRow) {\n newShape.startAngle = startAngle + rowSize * row;\n newShape.endAngle = startAngle + rowSize * (row + 1);\n newShape.r0 = r0 + columnSize * column;\n newShape.r = r0 + columnSize * (column + 1);\n }\n else {\n newShape.startAngle = startAngle + columnSize * column;\n newShape.endAngle = startAngle + columnSize * (column + 1);\n newShape.r0 = r0 + rowSize * row;\n newShape.r = r0 + rowSize * (row + 1);\n }\n newShape.clockwise = sectorShape.clockwise;\n newShape.cx = sectorShape.cx;\n newShape.cy = sectorShape.cy;\n outShapes.push(newShape);\n }\n }\n}\nfunction divideRect(rectShape, count, outShapes) {\n var width = rectShape.width;\n var height = rectShape.height;\n var isHorizontalRow = width > height;\n var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count);\n var rowSizeDim = isHorizontalRow ? 'width' : 'height';\n var columnSizeDim = isHorizontalRow ? 'height' : 'width';\n var rowDim = isHorizontalRow ? 'x' : 'y';\n var columnDim = isHorizontalRow ? 'y' : 'x';\n var rowSize = rectShape[rowSizeDim] / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = rectShape[columnSizeDim] / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n newShape[rowDim] = row * rowSize;\n newShape[columnDim] = column * columnSize;\n newShape[rowSizeDim] = rowSize;\n newShape[columnSizeDim] = columnSize;\n newShape.x += rectShape.x;\n newShape.y += rectShape.y;\n outShapes.push(newShape);\n }\n }\n}\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y;\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n if (Math.abs(nmCrossProduct) < 1e-6) {\n return null;\n }\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n if (p < 0 || p > 1) {\n return null;\n }\n return new Point(p * mx + a1x, p * my + a1y);\n}\nfunction projPtOnLine(pt, lineA, lineB) {\n var dir = new Point();\n Point.sub(dir, lineB, lineA);\n dir.normalize();\n var dir2 = new Point();\n Point.sub(dir2, pt, lineA);\n var len = dir2.dot(dir);\n return len;\n}\nfunction addToPoly(poly, pt) {\n var last = poly[poly.length - 1];\n if (last && last[0] === pt[0] && last[1] === pt[1]) {\n return;\n }\n poly.push(pt);\n}\nfunction splitPolygonByLine(points, lineA, lineB) {\n var len = points.length;\n var intersections = [];\n for (var i = 0; i < len; i++) {\n var p0 = points[i];\n var p1 = points[(i + 1) % len];\n var intersectionPt = lineLineIntersect(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y);\n if (intersectionPt) {\n intersections.push({\n projPt: projPtOnLine(intersectionPt, lineA, lineB),\n pt: intersectionPt,\n idx: i\n });\n }\n }\n if (intersections.length < 2) {\n return [{ points: points }, { points: points }];\n }\n intersections.sort(function (a, b) {\n return a.projPt - b.projPt;\n });\n var splitPt0 = intersections[0];\n var splitPt1 = intersections[intersections.length - 1];\n if (splitPt1.idx < splitPt0.idx) {\n var tmp = splitPt0;\n splitPt0 = splitPt1;\n splitPt1 = tmp;\n }\n var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];\n var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];\n var newPolyA = [splitPt0Arr];\n var newPolyB = [splitPt1Arr];\n for (var i = splitPt0.idx + 1; i <= splitPt1.idx; i++) {\n addToPoly(newPolyA, points[i].slice());\n }\n addToPoly(newPolyA, splitPt1Arr);\n addToPoly(newPolyA, splitPt0Arr);\n for (var i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) {\n addToPoly(newPolyB, points[i % len].slice());\n }\n addToPoly(newPolyB, splitPt0Arr);\n addToPoly(newPolyB, splitPt1Arr);\n return [{\n points: newPolyA\n }, {\n points: newPolyB\n }];\n}\nfunction binaryDividePolygon(polygonShape) {\n var points = polygonShape.points;\n var min = [];\n var max = [];\n fromPoints(points, min, max);\n var boundingRect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n var width = boundingRect.width;\n var height = boundingRect.height;\n var x = boundingRect.x;\n var y = boundingRect.y;\n var pt0 = new Point();\n var pt1 = new Point();\n if (width > height) {\n pt0.x = pt1.x = x + width / 2;\n pt0.y = y;\n pt1.y = y + height;\n }\n else {\n pt0.y = pt1.y = y + height / 2;\n pt0.x = x;\n pt1.x = x + width;\n }\n return splitPolygonByLine(points, pt0, pt1);\n}\nfunction binaryDivideRecursive(divider, shape, count, out) {\n if (count === 1) {\n out.push(shape);\n }\n else {\n var mid = Math.floor(count / 2);\n var sub = divider(shape);\n binaryDivideRecursive(divider, sub[0], mid, out);\n binaryDivideRecursive(divider, sub[1], count - mid, out);\n }\n return out;\n}\nexport function clone(path, count) {\n var paths = [];\n for (var i = 0; i < count; i++) {\n paths.push(clonePath(path));\n }\n return paths;\n}\nfunction copyPathProps(source, target) {\n target.setStyle(source.style);\n target.z = source.z;\n target.z2 = source.z2;\n target.zlevel = source.zlevel;\n}\nfunction polygonConvert(points) {\n var out = [];\n for (var i = 0; i < points.length;) {\n out.push([points[i++], points[i++]]);\n }\n return out;\n}\nexport function split(path, count) {\n var outShapes = [];\n var shape = path.shape;\n var OutShapeCtor;\n switch (path.type) {\n case 'rect':\n divideRect(shape, count, outShapes);\n OutShapeCtor = Rect;\n break;\n case 'sector':\n divideSector(shape, count, outShapes);\n OutShapeCtor = Sector;\n break;\n case 'circle':\n divideSector({\n r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2,\n cx: shape.cx, cy: shape.cy\n }, count, outShapes);\n OutShapeCtor = Sector;\n break;\n default:\n var m = path.getComputedTransform();\n var scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1;\n var polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale), function (poly) { return polygonConvert(poly); });\n var polygonCount = polygons.length;\n if (polygonCount === 0) {\n binaryDivideRecursive(binaryDividePolygon, {\n points: polygons[0]\n }, count, outShapes);\n }\n else if (polygonCount === count) {\n for (var i = 0; i < polygonCount; i++) {\n outShapes.push({\n points: polygons[i]\n });\n }\n }\n else {\n var totalArea_1 = 0;\n var items = map(polygons, function (poly) {\n var min = [];\n var max = [];\n fromPoints(poly, min, max);\n var area = (max[1] - min[1]) * (max[0] - min[0]);\n totalArea_1 += area;\n return { poly: poly, area: area };\n });\n items.sort(function (a, b) { return b.area - a.area; });\n var left = count;\n for (var i = 0; i < polygonCount; i++) {\n var item = items[i];\n if (left <= 0) {\n break;\n }\n var selfCount = i === polygonCount - 1\n ? left\n : Math.ceil(item.area / totalArea_1 * count);\n if (selfCount < 0) {\n continue;\n }\n binaryDivideRecursive(binaryDividePolygon, {\n points: item.poly\n }, selfCount, outShapes);\n left -= selfCount;\n }\n ;\n }\n OutShapeCtor = Polygon;\n break;\n }\n if (!OutShapeCtor) {\n return clone(path, count);\n }\n var out = [];\n for (var i = 0; i < outShapes.length; i++) {\n var subPath = new OutShapeCtor();\n subPath.setShape(outShapes[i]);\n copyPathProps(path, subPath);\n out.push(subPath);\n }\n return out;\n}\n","import { cubicSubdivide } from '../core/curve.js';\nimport Path from '../graphic/Path.js';\nimport { defaults, map } from '../core/util.js';\nimport { lerp } from '../core/vector.js';\nimport { clonePath } from './path.js';\nimport Transformable from '../core/Transformable.js';\nimport { split } from './dividePath.js';\nimport { pathToBezierCurves } from './convertPath.js';\nfunction alignSubpath(subpath1, subpath2) {\n var len1 = subpath1.length;\n var len2 = subpath2.length;\n if (len1 === len2) {\n return [subpath1, subpath2];\n }\n var tmpSegX = [];\n var tmpSegY = [];\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\n var shorterLen = Math.min(len1, len2);\n var diff = Math.abs(len2 - len1) / 6;\n var shorterBezierCount = (shorterLen - 2) / 6;\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n var newSubpath = [shorterPath[0], shorterPath[1]];\n var remained = diff;\n for (var i = 2; i < shorterLen;) {\n var x0 = shorterPath[i - 2];\n var y0 = shorterPath[i - 1];\n var x1 = shorterPath[i++];\n var y1 = shorterPath[i++];\n var x2 = shorterPath[i++];\n var y2 = shorterPath[i++];\n var x3 = shorterPath[i++];\n var y3 = shorterPath[i++];\n if (remained <= 0) {\n newSubpath.push(x1, y1, x2, y2, x3, y3);\n continue;\n }\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n for (var k = 1; k <= actualSubDivCount; k++) {\n var p = k / actualSubDivCount;\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n x0 = tmpSegX[3];\n y0 = tmpSegY[3];\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n x1 = tmpSegX[5];\n y1 = tmpSegY[5];\n x2 = tmpSegX[6];\n y2 = tmpSegY[6];\n }\n remained -= actualSubDivCount - 1;\n }\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\n var len = lastSubpathSubpath.length;\n var lastX = lastSubpathSubpath[len - 2];\n var lastY = lastSubpathSubpath[len - 1];\n var newSubpath = [];\n for (var i = 0; i < otherSubpath.length;) {\n newSubpath[i++] = lastX;\n newSubpath[i++] = lastY;\n }\n return newSubpath;\n}\nexport function alignBezierCurves(array1, array2) {\n var _a;\n var lastSubpath1;\n var lastSubpath2;\n var newArray1 = [];\n var newArray2 = [];\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\n var subpath1 = array1[i];\n var subpath2 = array2[i];\n var newSubpath1 = void 0;\n var newSubpath2 = void 0;\n if (!subpath1) {\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n newSubpath2 = subpath2;\n }\n else if (!subpath2) {\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n newSubpath1 = subpath1;\n }\n else {\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\n lastSubpath1 = newSubpath1;\n lastSubpath2 = newSubpath2;\n }\n newArray1.push(newSubpath1);\n newArray2.push(newSubpath2);\n }\n return [newArray1, newArray2];\n}\nexport function centroid(array) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = array.length;\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\n var x0 = array[j];\n var y0 = array[j + 1];\n var x1 = array[i];\n var y1 = array[i + 1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n }\n if (signedArea === 0) {\n return [array[0] || 0, array[1] || 0];\n }\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\n var bezierCount = (fromSubBeziers.length - 2) / 6;\n var bestScore = Infinity;\n var bestOffset = 0;\n var len = fromSubBeziers.length;\n var len2 = len - 2;\n for (var offset = 0; offset < bezierCount; offset++) {\n var cursorOffset = offset * 6;\n var score = 0;\n for (var k = 0; k < len; k += 2) {\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n var x0 = fromSubBeziers[idx] - fromCp[0];\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\n var x1 = toSubBeziers[k] - toCp[0];\n var y1 = toSubBeziers[k + 1] - toCp[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestOffset = offset;\n }\n }\n return bestOffset;\n}\nfunction reverse(array) {\n var newArr = [];\n var len = array.length;\n for (var i = 0; i < len; i += 2) {\n newArr[i] = array[len - i - 2];\n newArr[i + 1] = array[len - i - 1];\n }\n return newArr;\n}\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\n var result = [];\n var fromNeedsReverse;\n for (var i = 0; i < fromArr.length; i++) {\n var fromSubpathBezier = fromArr[i];\n var toSubpathBezier = toArr[i];\n var fromCp = centroid(fromSubpathBezier);\n var toCp = centroid(toSubpathBezier);\n if (fromNeedsReverse == null) {\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n }\n var newFromSubpathBezier = [];\n var newToSubpathBezier = [];\n var bestAngle = 0;\n var bestScore = Infinity;\n var tmpArr = [];\n var len = fromSubpathBezier.length;\n if (fromNeedsReverse) {\n fromSubpathBezier = reverse(fromSubpathBezier);\n }\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n var len2 = len - 2;\n for (var k = 0; k < len2; k += 2) {\n var idx = (offset + k) % len2 + 2;\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n }\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n if (searchAngleIteration > 0) {\n var step = searchAngleRange / searchAngleIteration;\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n var score = 0;\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\n var x0 = newFromSubpathBezier[k];\n var y0 = newFromSubpathBezier[k + 1];\n var x1 = toSubpathBezier[k] - toCp[0];\n var y1 = toSubpathBezier[k + 1] - toCp[1];\n var newX1 = x1 * ca - y1 * sa;\n var newY1 = x1 * sa + y1 * ca;\n tmpArr[k] = newX1;\n tmpArr[k + 1] = newY1;\n var dx = newX1 - x0;\n var dy = newY1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestAngle = angle;\n for (var m = 0; m < tmpArr.length; m++) {\n newToSubpathBezier[m] = tmpArr[m];\n }\n }\n }\n }\n else {\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\n }\n }\n result.push({\n from: newFromSubpathBezier,\n to: newToSubpathBezier,\n fromCp: fromCp,\n toCp: toCp,\n rotation: -bestAngle\n });\n }\n return result;\n}\nexport function isCombineMorphing(path) {\n return path.__isCombineMorphing;\n}\nexport function isMorphing(el) {\n return el.__morphT >= 0;\n}\nvar SAVED_METHOD_PREFIX = '__mOriginal_';\nfunction saveAndModifyMethod(obj, methodName, modifiers) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n var originalMethod = obj[savedMethodName] || obj[methodName];\n if (!obj[savedMethodName]) {\n obj[savedMethodName] = obj[methodName];\n }\n var replace = modifiers.replace;\n var after = modifiers.after;\n var before = modifiers.before;\n obj[methodName] = function () {\n var args = arguments;\n var res;\n before && before.apply(this, args);\n if (replace) {\n res = replace.apply(this, args);\n }\n else {\n res = originalMethod.apply(this, args);\n }\n after && after.apply(this, args);\n return res;\n };\n}\nfunction restoreMethod(obj, methodName) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n if (obj[savedMethodName]) {\n obj[methodName] = obj[savedMethodName];\n obj[savedMethodName] = null;\n }\n}\nfunction applyTransformOnBeziers(bezierCurves, mm) {\n for (var i = 0; i < bezierCurves.length; i++) {\n var subBeziers = bezierCurves[i];\n for (var k = 0; k < subBeziers.length;) {\n var x = subBeziers[k];\n var y = subBeziers[k + 1];\n subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4];\n subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5];\n }\n }\n}\nfunction prepareMorphPath(fromPath, toPath) {\n var fromPathProxy = fromPath.getUpdatedPathProxy();\n var toPathProxy = toPath.getUpdatedPathProxy();\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\n var fromPathTransform = fromPath.getComputedTransform();\n var toPathTransform = toPath.getComputedTransform();\n function updateIdentityTransform() {\n this.transform = null;\n }\n fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);\n toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);\n saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform });\n toPath.transform = null;\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n var tmpArr = [];\n saveAndModifyMethod(toPath, 'buildPath', { replace: function (path) {\n var t = toPath.__morphT;\n var onet = 1 - t;\n var newCp = [];\n for (var i = 0; i < morphingData.length; i++) {\n var item = morphingData[i];\n var from = item.from;\n var to = item.to;\n var angle = item.rotation * t;\n var fromCp = item.fromCp;\n var toCp = item.toCp;\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n lerp(newCp, fromCp, toCp, t);\n for (var m = 0; m < from.length; m += 2) {\n var x0_1 = from[m];\n var y0_1 = from[m + 1];\n var x1 = to[m];\n var y1 = to[m + 1];\n var x = x0_1 * onet + x1 * t;\n var y = y0_1 * onet + y1 * t;\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n }\n var x0 = tmpArr[0];\n var y0 = tmpArr[1];\n path.moveTo(x0, y0);\n for (var m = 2; m < from.length;) {\n var x1 = tmpArr[m++];\n var y1 = tmpArr[m++];\n var x2 = tmpArr[m++];\n var y2 = tmpArr[m++];\n var x3 = tmpArr[m++];\n var y3 = tmpArr[m++];\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n }\n else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n } });\n}\nexport function morphPath(fromPath, toPath, animationOpts) {\n if (!fromPath || !toPath) {\n return toPath;\n }\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n prepareMorphPath(fromPath, toPath);\n toPath.__morphT = 0;\n function restoreToPath() {\n restoreMethod(toPath, 'buildPath');\n restoreMethod(toPath, 'updateTransform');\n toPath.__morphT = -1;\n toPath.createPathProxy();\n toPath.dirtyShape();\n }\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n toPath.dirtyShape();\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n oldDone && oldDone();\n }\n }, animationOpts));\n return toPath;\n}\nfunction hilbert(x, y, minX, minY, maxX, maxY) {\n var bits = 16;\n x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n var d = 0;\n var tmp;\n for (var s = (1 << bits) / 2; s > 0; s /= 2) {\n var rx = 0;\n var ry = 0;\n if ((x & s) > 0) {\n rx = 1;\n }\n if ((y & s) > 0) {\n ry = 1;\n }\n d += s * s * ((3 * rx) ^ ry);\n if (ry === 0) {\n if (rx === 1) {\n x = s - 1 - x;\n y = s - 1 - y;\n }\n tmp = x;\n x = y;\n y = tmp;\n }\n }\n return d;\n}\nfunction sortPaths(pathList) {\n var xMin = Infinity;\n var yMin = Infinity;\n var xMax = -Infinity;\n var yMax = -Infinity;\n var cps = map(pathList, function (path) {\n var rect = path.getBoundingRect();\n var m = path.getComputedTransform();\n var x = rect.x + rect.width / 2 + (m ? m[4] : 0);\n var y = rect.y + rect.height / 2 + (m ? m[5] : 0);\n xMin = Math.min(x, xMin);\n yMin = Math.min(y, yMin);\n xMax = Math.max(x, xMax);\n yMax = Math.max(y, yMax);\n return [x, y];\n });\n var items = map(cps, function (cp, idx) {\n return {\n cp: cp,\n z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),\n path: pathList[idx]\n };\n });\n return items.sort(function (a, b) { return a.z - b.z; }).map(function (item) { return item.path; });\n}\n;\nfunction defaultDividePath(param) {\n return split(param.path, param.count);\n}\nfunction createEmptyReturn() {\n return {\n fromIndividuals: [],\n toIndividuals: [],\n count: 0\n };\n}\nexport function combineMorph(fromList, toPath, animationOpts) {\n var fromPathList = [];\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n addFromPath(fromList);\n var separateCount = fromPathList.length;\n if (!separateCount) {\n return createEmptyReturn();\n }\n var dividePath = animationOpts.dividePath || defaultDividePath;\n var toSubPathList = dividePath({\n path: toPath, count: separateCount\n });\n if (toSubPathList.length !== separateCount) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n fromPathList = sortPaths(fromPathList);\n toSubPathList = sortPaths(toSubPathList);\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n var individualDelay = animationOpts.individualDelay;\n var identityTransform = new Transformable();\n for (var i = 0; i < separateCount; i++) {\n var from = fromPathList[i];\n var to = toSubPathList[i];\n to.parent = toPath;\n to.copyTransform(identityTransform);\n if (!individualDelay) {\n prepareMorphPath(from, to);\n }\n }\n toPath.__isCombineMorphing = true;\n toPath.childrenRef = function () {\n return toSubPathList;\n };\n function addToSubPathListToZr(zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].addSelfToZr(zr);\n }\n }\n saveAndModifyMethod(toPath, 'addSelfToZr', {\n after: function (zr) {\n addToSubPathListToZr(zr);\n }\n });\n saveAndModifyMethod(toPath, 'removeSelfFromZr', {\n after: function (zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].removeSelfFromZr(zr);\n }\n }\n });\n function restoreToPath() {\n toPath.__isCombineMorphing = false;\n toPath.__morphT = -1;\n toPath.childrenRef = null;\n restoreMethod(toPath, 'addSelfToZr');\n restoreMethod(toPath, 'removeSelfFromZr');\n }\n var toLen = toSubPathList.length;\n if (individualDelay) {\n var animating_1 = toLen;\n var eachDone = function () {\n animating_1--;\n if (animating_1 === 0) {\n restoreToPath();\n oldDone && oldDone();\n }\n };\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]),\n done: eachDone\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts);\n }\n }\n else {\n toPath.__morphT = 0;\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n for (var i = 0; i < toLen; i++) {\n var child = toSubPathList[i];\n child.__morphT = toPath.__morphT;\n child.dirtyShape();\n }\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n for (var i = 0; i < fromList.length; i++) {\n restoreMethod(fromList[i], 'updateTransform');\n }\n oldDone && oldDone();\n }\n }, animationOpts));\n }\n if (toPath.__zr) {\n addToSubPathListToZr(toPath.__zr);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toSubPathList,\n count: toLen\n };\n}\nexport function separateMorph(fromPath, toPathList, animationOpts) {\n var toLen = toPathList.length;\n var fromPathList = [];\n var dividePath = animationOpts.dividePath || defaultDividePath;\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n if (isCombineMorphing(fromPath)) {\n addFromPath(fromPath.childrenRef());\n var fromLen = fromPathList.length;\n if (fromLen < toLen) {\n var k = 0;\n for (var i = fromLen; i < toLen; i++) {\n fromPathList.push(clonePath(fromPathList[k++ % fromLen]));\n }\n }\n fromPathList.length = toLen;\n }\n else {\n fromPathList = dividePath({ path: fromPath, count: toLen });\n var fromPathTransform = fromPath.getComputedTransform();\n for (var i = 0; i < fromPathList.length; i++) {\n fromPathList[i].setLocalTransform(fromPathTransform);\n }\n if (fromPathList.length !== toLen) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n }\n fromPathList = sortPaths(fromPathList);\n toPathList = sortPaths(toPathList);\n var individualDelay = animationOpts.individualDelay;\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i])\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toPathList,\n count: toPathList.length\n };\n}\nexport { split as defaultDividePath };\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\nimport { Path } from '../util/graphic.js';\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { clonePath } from 'zrender/lib/tool/path.js';\n\nfunction isMultiple(elements) {\n return isArray(elements[0]);\n}\n\nfunction prepareMorphBatches(one, many) {\n var batches = [];\n var batchCount = one.length;\n\n for (var i = 0; i < batchCount; i++) {\n batches.push({\n one: one[i],\n many: []\n });\n }\n\n for (var i = 0; i < many.length; i++) {\n var len = many[i].length;\n var k = void 0;\n\n for (k = 0; k < len; k++) {\n batches[k % batchCount].many.push(many[i][k]);\n }\n }\n\n var off = 0; // If one has more paths than each one of many. average them.\n\n for (var i = batchCount - 1; i >= 0; i--) {\n if (!batches[i].many.length) {\n var moveFrom = batches[off].many;\n\n if (moveFrom.length <= 1) {\n // Not enough\n // Start from the first one.\n if (off) {\n off = 0;\n } else {\n return batches;\n }\n }\n\n var len = moveFrom.length;\n var mid = Math.ceil(len / 2);\n batches[i].many = moveFrom.slice(mid, len);\n batches[off].many = moveFrom.slice(0, mid);\n off++;\n }\n }\n\n return batches;\n}\n\nvar pathDividers = {\n clone: function (params) {\n var ret = []; // Fitting the alpha\n\n var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\n\n for (var i = 0; i < params.count; i++) {\n var cloned = clonePath(params.path);\n cloned.setStyle('opacity', approxOpacity);\n ret.push(cloned);\n }\n\n return ret;\n },\n // Use the default divider\n split: null\n};\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\n if (!from.length || !to.length) {\n return;\n }\n\n var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\n\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\n return;\n }\n\n var animationDelay = seriesModel.getModel('universalTransition').get('delay');\n var animationCfg = Object.assign({\n // Need to setToFinal so the further calculation based on the style can be correct.\n // Like emphasis color.\n setToFinal: true\n }, updateAnimationCfg);\n var many;\n var one;\n\n if (isMultiple(from)) {\n // manyToOne\n many = from;\n one = to;\n }\n\n if (isMultiple(to)) {\n // oneToMany\n many = to;\n one = from;\n }\n\n function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\n var batchMany = batch.many;\n var batchOne = batch.one;\n\n if (batchMany.length === 1 && !forceManyOne) {\n // Is one to one\n var batchFrom = fromIsMany ? batchMany[0] : batchOne;\n var batchTo = fromIsMany ? batchOne : batchMany[0];\n\n if (isCombineMorphing(batchFrom)) {\n // Keep doing combine animation.\n morphOneBatch({\n many: [batchFrom],\n one: batchTo\n }, true, animateIndex, animateCount, true);\n } else {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(animateIndex, animateCount)\n }, animationCfg) : animationCfg;\n morphPath(batchFrom, batchTo, individualAnimationCfg);\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\n }\n } else {\n var separateAnimationCfg = defaults({\n dividePath: pathDividers[divideShape],\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\n return animationDelay(idx + animateIndex, animateCount);\n }\n }, animationCfg);\n\n var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\n fromIndividuals = _a.fromIndividuals,\n toIndividuals = _a.toIndividuals;\n\n var count = fromIndividuals.length;\n\n for (var k = 0; k < count; k++) {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(k, count)\n }, animationCfg) : animationCfg;\n animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\n }\n }\n }\n\n var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing.\n : from.length > to.length;\n var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\n var animateCount = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n animateCount += morphBatches[i].many.length;\n }\n\n var animateIndex = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\n animateIndex += morphBatches[i].many.length;\n }\n}\nexport function getPathList(elements) {\n if (!elements) {\n return [];\n }\n\n if (isArray(elements)) {\n var pathList_1 = [];\n\n for (var i = 0; i < elements.length; i++) {\n pathList_1.push(getPathList(elements[i]));\n }\n\n return pathList_1;\n }\n\n var pathList = [];\n elements.traverse(function (el) {\n if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\n pathList.push(el);\n }\n });\n return pathList;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\n\nfunction getGroupIdDimension(data) {\n var dimensions = data.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n\n if (dimInfo && dimInfo.otherDims.itemGroupId === 0) {\n return dimensions[i];\n }\n }\n}\n\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n\n if (data.count() > DATA_COUNT_THRESHOLD) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Universal transition is disabled on large data > 10k.');\n }\n\n return;\n }\n\n var indices = data.getIndices();\n var groupDim = getGroupIdDimension(data);\n\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n dataGroupId: seriesInfo.dataGroupId,\n data: data,\n dim: seriesInfo.dim || groupDim,\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\n\nfunction fadeInElement(newEl, newSeries, newIndex) {\n newEl.traverse(function (el) {\n if (el instanceof Path) {\n // TODO use fade in animation for target element.\n initProps(el, {\n style: {\n opacity: 0\n }\n }, newSeries, {\n dataIndex: newIndex,\n isFrom: true\n });\n }\n });\n}\n\nfunction removeEl(el) {\n if (el.parent) {\n // Bake parent transform to element.\n // So it can still have proper transform to transition after it's removed.\n var computedTransform = el.getComputedTransform();\n el.setLocalTransform(computedTransform);\n el.parent.remove(el);\n }\n}\n\nfunction stopAnimation(el) {\n el.stopAnimation();\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\n }\n}\n\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n animationConfig && el.traverse(function (child) {\n if (child instanceof Displayable) {\n var oldStyle = getOldStyle(child);\n\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\n\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n\n if (len !== newDiffItems.length) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from ? // dividingMethod like clone may override the style(opacity)\n // So extend it to raw style.\n extend(extend({}, rawFrom.style), from.style) : from.style\n }, animationCfg);\n }\n }\n\n function findKeyDim(items) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].dim) {\n return items[i].dim;\n }\n }\n }\n\n var oldKeyDim = findKeyDim(oldDiffItems);\n var newKeyDim = findKeyDim(newDiffItems);\n var hasMorphAnimation = false;\n\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex; // TODO if specified dim\n\n if (onlyGetId) {\n return data.getId(dataIndex);\n } // Use group id as transition key by default.\n // So we can achieve multiple to multiple animation like drilldown / up naturally.\n // If group id not exits. Use id instead. If so, only one to one transition will be applied.\n\n\n var dataGroupId = diffItem.dataGroupId; // If specified key dimension(itemGroupId by default). Use this same dimension from other data.\n // PENDING: If only use key dimension of newData.\n\n var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim;\n var dimInfo = keyDim && data.getDimensionInfo(keyDim);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n\n if (dimInfo) {\n // Get from encode.itemGroupId.\n var key = data.get(dimInfo.name, dataIndex);\n\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[key] || key + '';\n }\n\n return key + '';\n } // Get groupId from raw item. { groupId: '' }\n\n\n var itemVal = data.getRawDataItem(dataIndex);\n\n if (itemVal && itemVal.groupId) {\n return itemVal.groupId + '';\n }\n\n return dataGroupId || data.getId(dataIndex);\n };\n } // Use id if it's very likely to be an one to one animation\n // It's more robust than groupId\n // TODO Check if key dimension is specified.\n\n\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n\n if (!useId) {\n // We may have different diff strategy with basicTransition if we use other dimension as key.\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n for (var i = 0; i < newDiffItems.length; i++) {\n var newItem = newDiffItems[i];\n var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore\n\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements.\n\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n\n if ( // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n\n if (newEl) {\n // TODO: If keep animating the group in case\n // some of the elements don't want to be morphed.\n // TODO Label?\n stopAnimation(newEl);\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newIndex);\n }\n } // else keep oldEl leaving animation.\n\n }\n\n new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n var newItem = newDiffItems[newIndex];\n var newData = newItem.data;\n var newSeries = newData.hostModel;\n var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n var oldElsList = filter(map(oldIndices, function (idx) {\n return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n }), function (oldEl) {\n return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n });\n\n if (newEl) {\n stopAnimation(newEl);\n\n if (oldElsList.length) {\n // If old element is doing leaving animation. stop it and remove it immediately.\n each(oldElsList, function (oldEl) {\n stopAnimation(oldEl);\n removeEl(oldEl);\n });\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newItem.dataIndex);\n }\n } // else keep oldEl leaving animation.\n\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed\n\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n\n var newElsList = filter(map(newIndices, function (idx) {\n return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n }), function (el) {\n return el && el !== oldEl;\n });\n var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // Use divide on old.\n newSeris, newIndices[0], updateMorphingPathProps);\n } else {\n each(newElsList, function (newEl) {\n return fadeInElement(newEl, newSeris, newIndices[0]);\n });\n }\n } // else keep oldEl leaving animation.\n\n }).updateManyToMany(function (newIndices, oldIndices) {\n // If two data are same and both have groupId.\n // Normally they should be diff by id.\n new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n }, function (rawIdx) {\n return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n }).update(function (newIndex, oldIndex) {\n // Use the original index\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n }).execute();\n }).execute();\n\n if (hasMorphAnimation) {\n each(newList, function (_a) {\n var data = _a.data;\n var seriesModel = data.hostModel;\n var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n view.group.traverse(function (el) {\n if (el instanceof Path && !el.animators.length) {\n // We can't accept there still exists element that has no animation\n // if universalTransition is enabled\n el.animateFrom({\n style: {\n opacity: 0\n }\n }, animationCfg);\n }\n });\n }\n });\n }\n}\n\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n\n return seriesKey;\n}\n\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n\n return seriesKey;\n}\n\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\n\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap(); // Map that only store key in array seriesKey.\n // Which is used to query the old data when transition from one to multiple series.\n\n var oldDataMapForSplit = createHashMap();\n each(globalStore.oldSeries, function (series, idx) {\n var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n var oldData = globalStore.oldData[idx];\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n oldDataMap.set(transitionKeyStr, {\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n\n if (isArray(transitionKey)) {\n // Same key can't in different array seriesKey.\n each(transitionKey, function (key) {\n oldDataMapForSplit.set(key, {\n key: transitionKeyStr,\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n });\n }\n });\n\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\n }\n\n each(params.updatedSeries, function (series) {\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n var newDataGroupId = series.get('dataGroupId');\n var newData = series.getData();\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); // Only transition between series with same id.\n\n var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match.\n\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n } // TODO check if data is same?\n\n\n updateBatches.set(transitionKeyStr, {\n oldSeries: [{\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n }],\n newSeries: [{\n dataGroupId: newDataGroupId,\n divide: getDivideShapeFromData(newData),\n data: newData\n }]\n });\n } else {\n // Transition from multiple series.\n if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n\n if (oldData.data) {\n oldSeries_1.push({\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n });\n }\n });\n\n if (oldSeries_1.length) {\n updateBatches.set(transitionKeyStr, {\n oldSeries: oldSeries_1,\n newSeries: [{\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n }]\n });\n }\n } else {\n // Try transition to multiple series.\n var oldData_1 = oldDataMapForSplit.get(transitionKey);\n\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n\n if (!batch) {\n batch = {\n oldSeries: [{\n dataGroupId: oldData_1.dataGroupId,\n data: oldData_1.data,\n divide: getDivideShapeFromData(oldData_1.data)\n }],\n newSeries: []\n };\n updateBatches.set(oldData_1.key, batch);\n }\n\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\n\nfunction querySeries(series, finder) {\n for (var i = 0; i < series.length; i++) {\n var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n\n if (found) {\n return i;\n }\n }\n}\n\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n var from = [];\n var to = [];\n each(normalizeToArray(transitionOpt.from), function (finder) {\n var idx = querySeries(globalStore.oldSeries, finder);\n\n if (idx >= 0) {\n from.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: globalStore.oldData[idx],\n // TODO can specify divideShape in transition.\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\n dim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n\n if (idx >= 0) {\n var data = params.updatedSeries[idx].getData();\n to.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: data,\n divide: getDivideShapeFromData(data),\n dim: finder.dimension\n });\n }\n });\n\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\n}\n\nexport function installUniversalTransition(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n each(normalizeToArray(params.seriesTransition), function (transOpt) {\n each(normalizeToArray(transOpt.to), function (finder) {\n var series = params.updatedSeries;\n\n for (var i = 0; i < series.length; i++) {\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n }\n }\n });\n });\n });\n registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var globalStore = getUniversalTransitionGlobalStore(api); // TODO multiple to multiple series.\n\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n\n if (transitionOpt) {\n each(normalizeToArray(transitionOpt), function (opt) {\n transitionSeriesFromOpt(opt, globalStore, params, api);\n });\n } else {\n // Else guess from series based on transition series key.\n var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n each(updateBatches_1.keys(), function (key) {\n var batch = updateBatches_1.get(key);\n transitionBetween(batch.oldSeries, batch.newSeries, api);\n });\n } // Reset\n\n\n each(params.updatedSeries, function (series) {\n // Reset;\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n }\n });\n } // Save all series of current update. Not only the updated one.\n\n\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData(); // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n\n if (data.count() < DATA_COUNT_THRESHOLD) {\n savedSeries.push(allSeries[i]);\n savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n savedData.push(data);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from './lib/extension.js';\nexport * from './lib/export/core.js'; // ----------------------------------------------\n// All of the modules that are allowed to be\n// imported are listed below.\n//\n// Users MUST NOT import other modules that are\n// not included in this list.\n// ----------------------------------------------\n\nimport { SVGRenderer, CanvasRenderer } from './lib/export/renderers.js';\nimport { LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart } from './lib/export/charts.js';\nimport { GridComponent, PolarComponent, GeoComponent, SingleAxisComponent, ParallelComponent, CalendarComponent, GraphicComponent, ToolboxComponent, TooltipComponent, AxisPointerComponent, BrushComponent, TitleComponent, TimelineComponent, MarkPointComponent, MarkLineComponent, MarkAreaComponent, LegendComponent, DataZoomComponent, DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent, VisualMapContinuousComponent, VisualMapPiecewiseComponent, AriaComponent, DatasetComponent, TransformComponent } from './lib/export/components.js';\nimport { UniversalTransition, LabelLayout } from './lib/export/features.js'; // -----------------\n// Render engines\n// -----------------\n// Render via Canvas.\n// echarts.init(dom, null, { renderer: 'canvas' })\n\nuse([CanvasRenderer]); // Render via SVG.\n// echarts.init(dom, null, { renderer: 'svg' })\n\nuse([SVGRenderer]); // ----------------\n// Charts (series)\n// ----------------\n// All of the series types, for example:\n// chart.setOption({\n// series: [{\n// type: 'line' // or 'bar', 'pie', ...\n// }]\n// });\n\nuse([LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart]); // -------------------\n// Coordinate systems\n// -------------------\n// All of the axis modules have been included in the\n// coordinate system module below, do not need to\n// make extra import.\n// `cartesian` coordinate system. For some historical\n// reasons, it is named as grid, for example:\n// chart.setOption({\n// grid: {...},\n// xAxis: {...},\n// yAxis: {...},\n// series: [{...}]\n// });\n\nuse(GridComponent); // `polar` coordinate system, for example:\n// chart.setOption({\n// polar: {...},\n// radiusAxis: {...},\n// angleAxis: {...},\n// series: [{\n// coordinateSystem: 'polar'\n// }]\n// });\n\nuse(PolarComponent); // `geo` coordinate system, for example:\n// chart.setOption({\n// geo: {...},\n// series: [{\n// coordinateSystem: 'geo'\n// }]\n// });\n\nuse(GeoComponent); // `singleAxis` coordinate system (notice, it is a coordinate system\n// with only one axis, work for chart like theme river), for example:\n// chart.setOption({\n// singleAxis: {...}\n// series: [{type: 'themeRiver', ...}]\n// });\n\nuse(SingleAxisComponent); // `parallel` coordinate system, only work for parallel series, for example:\n// chart.setOption({\n// parallel: {...},\n// parallelAxis: [{...}, ...],\n// series: [{\n// type: 'parallel'\n// }]\n// });\n\nuse(ParallelComponent); // `calendar` coordinate system. for example,\n// chart.setOption({\n// calendar: {...},\n// series: [{\n// coordinateSystem: 'calendar'\n// }]\n// );\n\nuse(CalendarComponent); // ------------------\n// Other components\n// ------------------\n// `graphic` component, for example:\n// chart.setOption({\n// graphic: {...}\n// });\n\nuse(GraphicComponent); // `toolbox` component, for example:\n// chart.setOption({\n// toolbox: {...}\n// });\n\nuse(ToolboxComponent); // `tooltip` component, for example:\n// chart.setOption({\n// tooltip: {...}\n// });\n\nuse(TooltipComponent); // `axisPointer` component, for example:\n// chart.setOption({\n// tooltip: {axisPointer: {...}, ...}\n// });\n// Or\n// chart.setOption({\n// axisPointer: {...}\n// });\n\nuse(AxisPointerComponent); // `brush` component, for example:\n// chart.setOption({\n// brush: {...}\n// });\n// Or\n// chart.setOption({\n// tooltip: {feature: {brush: {...}}\n// })\n\nuse(BrushComponent); // `title` component, for example:\n// chart.setOption({\n// title: {...}\n// });\n\nuse(TitleComponent); // `timeline` component, for example:\n// chart.setOption({\n// timeline: {...}\n// });\n\nuse(TimelineComponent); // `markPoint` component, for example:\n// chart.setOption({\n// series: [{markPoint: {...}}]\n// });\n\nuse(MarkPointComponent); // `markLine` component, for example:\n// chart.setOption({\n// series: [{markLine: {...}}]\n// });\n\nuse(MarkLineComponent); // `markArea` component, for example:\n// chart.setOption({\n// series: [{markArea: {...}}]\n// });\n\nuse(MarkAreaComponent); // `legend` component not scrollable. for example:\n// chart.setOption({\n// legend: {...}\n// });\n\nuse(LegendComponent); // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\n\nuse(DataZoomComponent); // `dataZoom` component providing drag, pinch, wheel behaviors\n// inside coordinate system, for example:\n// chart.setOption({\n// dataZoom: {type: 'inside'}\n// });\n\nuse(DataZoomInsideComponent); // `dataZoom` component providing a slider bar, for example:\n// chart.setOption({\n// dataZoom: {type: 'slider'}\n// });\n\nuse(DataZoomSliderComponent); // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\n\nuse(VisualMapComponent); // `visualMap` component providing continuous bar, for example:\n// chart.setOption({\n// visualMap: {type: 'continuous'}\n// });\n\nuse(VisualMapContinuousComponent); // `visualMap` component providing pieces bar, for example:\n// chart.setOption({\n// visualMap: {type: 'piecewise'}\n// });\n\nuse(VisualMapPiecewiseComponent); // `aria` component providing aria, for example:\n// chart.setOption({\n// aria: {...}\n// });\n\nuse(AriaComponent); // dataset transform\n// chart.setOption({\n// dataset: {\n// transform: []\n// }\n// });\n\nuse(TransformComponent);\nuse(DatasetComponent); // universal transition\n// chart.setOption({\n// series: {\n// universalTransition: { enabled: true }\n// }\n// })\n\nuse(UniversalTransition); // label layout\n// chart.setOption({\n// series: {\n// labelLayout: { hideOverlap: true }\n// }\n// })\n\nuse(LabelLayout);","import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createBlock as _createBlock, unref as _unref, normalizeStyle as _normalizeStyle, vShow as _vShow, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\";\nconst _withScopeId = n => (_pushScopeId(\"data-v-6e4bc48a\"), n = n(), _popScopeId(), n);\nconst _hoisted_1 = {\n class: \"content-box\"\n};\nconst _hoisted_2 = {\n class: \"info\"\n};\nconst _hoisted_3 = {\n class: \"info-content\"\n};\nconst _hoisted_4 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode(\"h1\", null, [/*#__PURE__*/_createTextVNode(\"Organism: \"), /*#__PURE__*/_createElementVNode(\"span\", null, \"Homo sapiens\")], -1));\nconst _hoisted_5 = {\n class: \"button-tag\"\n};\nconst _hoisted_6 = {\n class: \"history\"\n};\nconst _hoisted_7 = {\n class: \"card\"\n};\nimport { getProteins, getCellLineProteins } from '@/api/search';\nimport { inflate } from 'pako';\nimport * as echarts from 'echarts';\nimport { useRouter, onBeforeRouteUpdate } from \"vue-router\";\nimport { ref, onMounted, nextTick } from 'vue';\nexport default {\n __name: 'index',\n emits: ['changeLoading'],\n setup(__props, {\n emit: __emit\n }) {\n const router = useRouter();\n const drawer = ref(false);\n const emit = __emit;\n // image height\n let imgH = 500;\n // database\n let proteinTable = [];\n const showBar = ref(false);\n // component show\n const showImg = ref(false);\n // data history \n const dataHistory = ref([]);\n // current router name\n const routerName = ref('');\n // query protein\n const protein = ref([]);\n // sorted tags \n const sortTags = ref([]);\n // tags\n const proteinTags = ref([]);\n // tags color\n const tagsColor = [\"#8DD3C7\", \"#EDBC63\", \"#BEBADA\", \"#FB8072\", \"#80B1D3\"];\n // map html\n const chart = ref();\n // history\n const imgs = ref([]);\n // image object\n let myChart;\n // tagstotal\n const tagsTotal = [\"heart\", \"stomach\",\n //\"skin\",\n \"blood plasma\", \"brain\", \"kidney\", \"liver\", \"lung\", \"pancreas\", \"spleen\", \"adrenal gland\", \"testis\", \"ovary\",\n //\"uterus\",\n \"prostate\", \"colon\", \"esophagus\", \"placenta\"];\n // \n const boxTooltips = {\n trigger: 'item',\n axisPointer: {\n type: 'shadow'\n },\n textStyle: {},\n formatter: function (param) {\n return [\"

\" + param.data[0] + '

', '
', \"Max:\" + parseFloat(param.data[5]).toFixed(2) + '
', \"Q3:\" + parseFloat(param.data[4]).toFixed(2) + '
', \"Median:\" + parseFloat(param.data[3]).toFixed(2) + '
', \"Q1:\" + parseFloat(param.data[2]).toFixed(2) + '
', \"Min:\" + parseFloat(param.data[1]).toFixed(2) + '
'].join('');\n }\n };\n protein.value = Array.isArray(router.currentRoute.value.query.protein) ? router.currentRoute.value.query.protein : [router.currentRoute.value.query.protein];\n routerName.value = router.currentRoute.value.name;\n // get proteins\n const getProteinTable = async () => {\n emit('changeLoading');\n const res = routerName.value === 'tissues' ? await getProteins() : await getCellLineProteins();\n const byteArray = new Uint8Array(res.data);\n const data = inflate(byteArray, {\n to: 'string'\n });\n proteinTable = JSON.parse(data);\n emit('changeLoading');\n queryProtein(protein);\n };\n // delete tag\n const handleClose = tag => {\n dataHistory.value.splice(proteinTags.value.indexOf(tag), 1);\n proteinTags.value.splice(proteinTags.value.indexOf(tag), 1);\n routerName.value === 'tissues' ? router.push({\n path: \"/ae/tissues\",\n query: {\n protein: proteinTags.value\n }\n }) : router.push({\n path: \"/ae/cellline\",\n query: {\n protein: proteinTags.value\n }\n });\n };\n // qeury\n const queryProtein = input => {\n if (typeof input.value[0] === \"undefined\") {\n // init()\n showImg.value = false;\n myChart ? myChart.dispose() : myChart;\n return;\n }\n let proteins = proteinTable;\n input.value.map(protein => {\n const output = proteins.find(item => {\n return item.name === protein.trim();\n });\n if (!output) {\n alert('Please enter a legal protein name');\n return;\n }\n if (!proteinTags.value.includes(protein.trim())) {\n if (proteinTags.value.length === 5) {\n proteinTags.value.shift();\n proteinTags.value.push(protein.trim());\n dataHistory.value.shift();\n dataHistory.value.push(output);\n } else {\n proteinTags.value.push(protein.trim());\n dataHistory.value.push(output);\n }\n }\n });\n if (proteinTags.value.length != input.value.length) {\n routerName.value === 'tissues' ? router.push({\n path: \"/ae/tissues\",\n query: {\n protein: proteinTags.value\n }\n }) : router.push({\n path: \"/ae/cellline\",\n query: {\n protein: proteinTags.value\n }\n });\n //router.push({ path: \"/ae/tissues\", query: { protein: proteinTags.value } })\n } else {\n showImg.value = true;\n imgH = dataHistory.value.length > 1 ? dataHistory.value.length * 400 : 500;\n nextTick(() => {\n init();\n });\n }\n };\n // watch route\n onBeforeRouteUpdate(to => {\n protein.value = to.query.protein;\n queryProtein(protein);\n });\n\n // load update\n onMounted(() => {\n getProteinTable();\n });\n\n // init data\n const initData = data => {\n if (routerName.value === 'tissues') {\n if (data.tags.length < 18) {\n tagsTotal.map(item => {\n if (!data.tags.includes(item)) {\n data.tags.push(item);\n data.data.push([]);\n }\n });\n }\n }\n let dataSort = [];\n for (let i = 0; i < data.tags.length; i++) {\n let obj = {};\n obj['name'] = data.tags[i];\n obj['data'] = data.data[i].filter(value => value >= 1);\n dataSort.push(obj);\n }\n if (routerName.value !== 'tissues') {\n dataSort.sort((obja, objb) => {\n const lena = obja.data.length;\n const lenb = objb.data.length;\n return lenb - lena;\n });\n dataSort = dataSort.slice(0, 20);\n }\n // sort data\n dataSort.sort((obja, objb) => {\n /* \n objb.data.sort((a, b) => { return a - b })\n const lena = obja.data.length\n const lenb = objb.data.length\n const mida = obja.data[Math.floor(lena / 2)]\n const midb = objb.data[Math.floor(lenb / 2)] \n */\n const mida = obja.data.length > 0 ? obja.data.reduce((a, b) => a + b) / obja.data.length : 0;\n const midb = obja.data.length > 0 ? objb.data.reduce((a, b) => a + b) / objb.data.length : 0;\n return mida - midb;\n });\n // get sort column\n let neatData = [];\n let tags = [];\n dataSort.map(item => {\n neatData.push(item.data);\n tags.push(item.name);\n });\n return {\n neatData,\n tags\n };\n };\n // option\n const options = {\n // backgroundColor: '#f4f5f2',\n title: [],\n dataset: [],\n tooltip: {},\n // color: tagsColor,\n legend: {\n show: true,\n orient: 'vertical',\n right: 10,\n top: 60,\n data: []\n // bottom: 20,\n },\n grid: {\n left: '10%',\n right: '10%',\n bottom: 60\n },\n yAxis: {\n type: 'category',\n boundaryGap: true,\n nameGap: 30,\n splitArea: {\n show: false\n },\n splitLine: {\n show: false\n }\n },\n xAxis: {\n type: 'value',\n name: 'iBAQLog',\n nameLocation: 'center',\n nameGap: 40,\n splitArea: {\n show: false\n },\n splitLine: {\n show: false\n },\n min: 1\n //max: 10\n },\n toolbox: {\n feature: {\n saveAsImage: {\n type: 'png',\n title: 'save as .png',\n pixelRatio: 10\n }\n }\n },\n series: []\n };\n // init image\n const init = () => {\n if (dataHistory.value.length === 1) {\n options.dataset = [];\n options.series = [];\n options.title = [];\n options.legend.show = false;\n let {\n neatData,\n tags\n } = initData(dataHistory.value[0]);\n sortTags.value = tags;\n options.title.push({\n text: dataHistory.value[0].title,\n left: 'center'\n });\n let {\n samples,\n data\n } = countSingleValue(neatData, 2);\n if (showBar.value) {\n options.series.push({\n name: proteinTags.value[0],\n type: 'bar',\n data: data,\n itemStyle: {\n color: tagsColor[0],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n },\n label: {\n show: true,\n position: 'right',\n formatter: function () {\n return `samples: ${samples.shift()}`;\n }\n }\n });\n options.tooltip = {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n };\n options.yAxis.data = sortTags.value;\n } else {\n options.dataset.push({\n source: neatData\n });\n options.dataset.push({\n fromDatasetIndex: 0,\n transform: {\n type: 'boxplot',\n config: {\n itemNameFormatter: function (params) {\n return tags[params.value];\n }\n }\n }\n });\n options.series.push({\n name: 'category0',\n type: 'boxplot',\n datasetIndex: 1,\n itemStyle: {\n color: tagsColor[0],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n }\n });\n options.tooltip = boxTooltips;\n }\n } else {\n if (routerName.value === 'tissues') {\n sortTags.value = sortTags.value.length === 0 ? initData(dataHistory.value[0]).tags : sortTags.value;\n } else {\n sortTags.value = sortTags.value.length === 0 ? initData(dataHistory.value[0]).tags : sortTags.value;\n }\n dataHistory.value.length === 0 ? options.title = [] : options.title.splice(0, 1, {\n text: `Comparison of protein expression in different ${routerName.value}`,\n left: 'center'\n });\n dataHistory.value.length === 0 ? options.legend.show = false : options.legend.show = true;\n let datas = [];\n dataHistory.value.map(item => {\n let data = [];\n sortTags.value.forEach(tissue => {\n if (!item.tags.includes(tissue)) {\n data.push([]);\n } else {\n let index = item.tags.indexOf(tissue);\n let rowArr = item.data[index].filter(v => v >= 1);\n data.push(rowArr);\n }\n });\n datas.push(data);\n });\n let {\n samples,\n data\n } = countSingleValue(datas, 3);\n if (showBar.value) {\n datas = data;\n options.dataset = [];\n options.series = [];\n options.legend.data = [];\n datas.forEach((item, index) => {\n options.series.push({\n name: proteinTags.value[index],\n type: 'bar',\n data: item,\n itemStyle: {\n color: tagsColor[index],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n },\n label: {\n show: true,\n position: 'right',\n formatter: function () {\n return `samples: ${samples[index].shift()}`;\n }\n }\n });\n options.legend.data.push({\n name: proteinTags.value[index],\n itemStyle: {\n color: tagsColor[index],\n borderColor: tagsColor[index]\n }\n });\n });\n options.tooltip = {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n };\n options.yAxis.data = sortTags.value;\n } else {\n options.dataset = [];\n options.series = [];\n options.legend.data = [];\n datas.forEach((item, index) => {\n options.dataset.push({\n source: item\n });\n options.series.push({\n name: proteinTags.value[index],\n type: 'boxplot',\n datasetIndex: datas.length + index,\n itemStyle: {\n color: tagsColor[index],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n }\n });\n options.legend.data.push({\n name: proteinTags.value[index],\n itemStyle: {\n color: tagsColor[index],\n borderColor: tagsColor[index]\n }\n });\n });\n datas.forEach((item, index) => {\n options.dataset.push({\n fromDatasetIndex: index,\n transform: {\n type: 'boxplot',\n config: {\n itemNameFormatter: function (params) {\n return sortTags.value[params.value];\n }\n }\n }\n });\n });\n options.tooltip = boxTooltips;\n }\n }\n if (myChart != null && myChart !== '' && myChart !== undefined) {\n myChart.dispose(); // discard\n }\n myChart = echarts.init(chart.value, 'macarons');\n myChart.clear();\n myChart.resize({\n height: imgH\n });\n myChart.setOption(options);\n setTimeout(() => {\n if (protein.value.length !== 0) {\n let imgDataUrl = myChart.getDataURL({\n type: 'svg',\n pixelRatio: 2,\n backgroundColor: '#fff',\n excludeComponents: ['toolbox']\n });\n let urlFile = {\n proteinName: protein.value,\n url: imgDataUrl\n };\n imgs.value.unshift(urlFile);\n }\n }, 2000);\n };\n // count single value\n const countSingleValue = (data, dimension) => {\n if (dimension === 2) {\n /*\n let singleNum = data.filter((arr) => arr.length == 1).length\n if (singleNum >= 10) {\n data = data.map((arr) => Number((arr.reduce((a, b)=>a+b)/arr.length).toFixed(2)))\n }\n return { singleNum, data } \n */\n let samples = data.map(arr => arr.length);\n data = data.map(arr => arr.length > 0 ? Number((arr.reduce((a, b) => a + b) / arr.length).toFixed(2)) : 0);\n return {\n samples,\n data\n };\n } else {\n /*\n let singleNum = data[0].filter((arr) => arr.length == 1).length\n if (singleNum >= 10) {\n data = data.map((res) => res.map((arr) => arr.length > 0 ? Number((arr.reduce((a, b)=>a+b)/arr.length).toFixed(2)) : 0))\n }\n return { singleNum, data } \n */\n let samples = data.map(res => res.map(arr => arr.length));\n data = data.map(res => res.map(arr => arr.length > 0 ? Number((arr.reduce((a, b) => a + b) / arr.length).toFixed(2)) : 0));\n return {\n samples,\n data\n };\n }\n };\n\n //\n const changeShow = () => {\n init();\n };\n return (_ctx, _cache) => {\n const _component_el_switch = _resolveComponent(\"el-switch\");\n const _component_el_tag = _resolveComponent(\"el-tag\");\n const _component_el_text = _resolveComponent(\"el-text\");\n const _component_el_image = _resolveComponent(\"el-image\");\n const _component_el_tabs = _resolveComponent(\"el-tabs\");\n const _component_el_drawer = _resolveComponent(\"el-drawer\");\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createElementVNode(\"div\", _hoisted_2, [_createElementVNode(\"div\", _hoisted_3, [_hoisted_4, _createVNode(_component_el_switch, {\n modelValue: showBar.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => showBar.value = $event),\n class: \"ml-2\",\n \"inline-prompt\": \"\",\n style: {\n \"--el-switch-on-color\": \"#13ce66\",\n \"--el-switch-off-color\": \"#ff4949\",\n \"position\": \"absolute\"\n },\n \"active-text\": \"Bar\",\n \"inactive-text\": \"Box\",\n onChange: changeShow\n }, null, 8, [\"modelValue\"])]), _createElementVNode(\"div\", _hoisted_5, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(proteinTags.value, (item, index) => {\n return _openBlock(), _createBlock(_component_el_tag, {\n key: index,\n round: \"\",\n closable: \"\",\n color: tagsColor[index],\n onClose: $event => handleClose(item)\n }, {\n default: _withCtx(() => [_createTextVNode(_toDisplayString(item), 1)]),\n _: 2\n }, 1032, [\"color\", \"onClose\"]);\n }), 128))]), _createElementVNode(\"div\", _hoisted_6, [_createVNode(_component_el_text, {\n style: {\n \"margin-right\": \"16px\"\n },\n class: \"history-info\",\n type: \"info\",\n onClick: _cache[1] || (_cache[1] = $event => drawer.value = true)\n }, {\n default: _withCtx(() => [_createTextVNode(\" history \")]),\n _: 1\n }), _createVNode(_component_el_drawer, {\n modelValue: drawer.value,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => drawer.value = $event),\n title: \"I am the title\",\n \"with-header\": false\n }, {\n default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(imgs.value, (item, index) => {\n return _openBlock(), _createBlock(_component_el_tabs, {\n \"tab-position\": \"right\",\n style: {\n \"height\": \"300px\"\n },\n class: \"demo-tabs\",\n key: index\n }, {\n default: _withCtx(() => [_createElementVNode(\"h5\", null, _toDisplayString(item.proteinName.join()), 1), _createVNode(_component_el_image, {\n style: {\n \"width\": \"100%\"\n },\n src: item.url,\n fit: \"fill\",\n \"preview-src-list\": [item.url]\n }, null, 8, [\"src\", \"preview-src-list\"])]),\n _: 2\n }, 1024);\n }), 128))]),\n _: 1\n }, 8, [\"modelValue\"])])]), _createElementVNode(\"div\", _hoisted_7, [_createElementVNode(\"div\", {\n ref_key: \"chart\",\n ref: chart,\n style: _normalizeStyle({\n width: 100 + '%',\n height: _unref(imgH) + 'px'\n })\n }, null, 4)])], 512)), [[_vShow, showImg.value]]);\n };\n }\n};","/* unplugin-vue-components disabled */import script from \"./index.vue?vue&type=script&setup=true&lang=js\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=js\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6e4bc48a&scoped=true&lang=css\"\n\nimport exportComponent from \"../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6e4bc48a\"]])\n\nexport default __exports__","const configProviderContextKey = Symbol();\n\nexport { configProviderContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import { ref, getCurrentInstance, inject, computed, unref, provide } from 'vue';\nimport '../../../../utils/index.mjs';\nimport '../../../../hooks/index.mjs';\nimport { configProviderContextKey } from '../constants.mjs';\nimport { useNamespace, defaultNamespace, namespaceContextKey } from '../../../../hooks/use-namespace/index.mjs';\nimport { useLocale, localeContextKey } from '../../../../hooks/use-locale/index.mjs';\nimport { useZIndex, defaultInitialZIndex, zIndexContextKey } from '../../../../hooks/use-z-index/index.mjs';\nimport { debugWarn } from '../../../../utils/error.mjs';\nimport { SIZE_INJECTION_KEY } from '../../../../hooks/use-size/index.mjs';\nimport { keysOf } from '../../../../utils/objects.mjs';\n\nconst globalConfig = ref();\nfunction useGlobalConfig(key, defaultValue = void 0) {\n const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;\n if (key) {\n return computed(() => {\n var _a, _b;\n return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;\n });\n } else {\n return config;\n }\n}\nfunction useGlobalComponentSettings(block, sizeFallback) {\n const config = useGlobalConfig();\n const ns = useNamespace(block, computed(() => {\n var _a;\n return ((_a = config.value) == null ? void 0 : _a.namespace) || defaultNamespace;\n }));\n const locale = useLocale(computed(() => {\n var _a;\n return (_a = config.value) == null ? void 0 : _a.locale;\n }));\n const zIndex = useZIndex(computed(() => {\n var _a;\n return ((_a = config.value) == null ? void 0 : _a.zIndex) || defaultInitialZIndex;\n }));\n const size = computed(() => {\n var _a;\n return unref(sizeFallback) || ((_a = config.value) == null ? void 0 : _a.size) || \"\";\n });\n provideGlobalConfig(computed(() => unref(config) || {}));\n return {\n ns,\n locale,\n zIndex,\n size\n };\n}\nconst provideGlobalConfig = (config, app, global = false) => {\n var _a;\n const inSetup = !!getCurrentInstance();\n const oldConfig = inSetup ? useGlobalConfig() : void 0;\n const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? provide : void 0;\n if (!provideFn) {\n debugWarn(\"provideGlobalConfig\", \"provideGlobalConfig() can only be used inside setup().\");\n return;\n }\n const context = computed(() => {\n const cfg = unref(config);\n if (!(oldConfig == null ? void 0 : oldConfig.value))\n return cfg;\n return mergeConfig(oldConfig.value, cfg);\n });\n provideFn(configProviderContextKey, context);\n provideFn(localeContextKey, computed(() => context.value.locale));\n provideFn(namespaceContextKey, computed(() => context.value.namespace));\n provideFn(zIndexContextKey, computed(() => context.value.zIndex));\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || \"\")\n });\n if (global || !globalConfig.value) {\n globalConfig.value = context.value;\n }\n return context;\n};\nconst mergeConfig = (a, b) => {\n var _a;\n const keys = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];\n const obj = {};\n for (const key of keys) {\n obj[key] = (_a = b[key]) != null ? _a : a[key];\n }\n return obj;\n};\n\nexport { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig };\n//# sourceMappingURL=use-global-config.mjs.map\n","const formContextKey = Symbol(\"formContextKey\");\nconst formItemContextKey = Symbol(\"formItemContextKey\");\n\nexport { formContextKey, formItemContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import { getCurrentInstance, computed } from 'vue';\n\nconst useProp = (name) => {\n const vm = getCurrentInstance();\n return computed(() => {\n var _a, _b;\n return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];\n });\n};\n\nexport { useProp };\n//# sourceMappingURL=index.mjs.map\n","import { ref, inject, computed, unref } from 'vue';\nimport '../../../../hooks/index.mjs';\nimport { formContextKey, formItemContextKey } from '../constants.mjs';\nimport { useProp } from '../../../../hooks/use-prop/index.mjs';\nimport { useGlobalSize } from '../../../../hooks/use-size/index.mjs';\n\nconst useFormSize = (fallback, ignore = {}) => {\n const emptyRef = ref(void 0);\n const size = ignore.prop ? emptyRef : useProp(\"size\");\n const globalConfig = ignore.global ? emptyRef : useGlobalSize();\n const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);\n const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);\n return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || \"\");\n};\nconst useFormDisabled = (fallback) => {\n const disabled = useProp(\"disabled\");\n const form = inject(formContextKey, void 0);\n return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);\n};\nconst useSize = useFormSize;\nconst useDisabled = useFormDisabled;\n\nexport { useDisabled, useFormDisabled, useFormSize, useSize };\n//# sourceMappingURL=use-form-common-props.mjs.map\n","import { inject, ref, computed, onMounted, watch, toRef, onUnmounted } from 'vue';\nimport '../../../../hooks/index.mjs';\nimport { formContextKey, formItemContextKey } from '../constants.mjs';\nimport { useId } from '../../../../hooks/use-id/index.mjs';\n\nconst useFormItem = () => {\n const form = inject(formContextKey, void 0);\n const formItem = inject(formItemContextKey, void 0);\n return {\n form,\n formItem\n };\n};\nconst useFormItemInputId = (props, {\n formItemContext,\n disableIdGeneration,\n disableIdManagement\n}) => {\n if (!disableIdGeneration) {\n disableIdGeneration = ref(false);\n }\n if (!disableIdManagement) {\n disableIdManagement = ref(false);\n }\n const inputId = ref();\n let idUnwatch = void 0;\n const isLabeledByFormItem = computed(() => {\n var _a;\n return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);\n });\n onMounted(() => {\n idUnwatch = watch([toRef(props, \"id\"), disableIdGeneration], ([id, disableIdGeneration2]) => {\n const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;\n if (newId !== inputId.value) {\n if (formItemContext == null ? void 0 : formItemContext.removeInputId) {\n inputId.value && formItemContext.removeInputId(inputId.value);\n if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {\n formItemContext.addInputId(newId);\n }\n }\n inputId.value = newId;\n }\n }, { immediate: true });\n });\n onUnmounted(() => {\n idUnwatch && idUnwatch();\n if (formItemContext == null ? void 0 : formItemContext.removeInputId) {\n inputId.value && formItemContext.removeInputId(inputId.value);\n }\n });\n return {\n isLabeledByFormItem,\n inputId\n };\n};\n\nexport { useFormItem, useFormItemInputId };\n//# sourceMappingURL=use-form-item.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { componentSizes } from '../../../constants/size.mjs';\n\nconst textProps = buildProps({\n type: {\n type: String,\n values: [\"primary\", \"success\", \"info\", \"warning\", \"danger\", \"\"],\n default: \"\"\n },\n size: {\n type: String,\n values: componentSizes,\n default: \"\"\n },\n truncated: {\n type: Boolean\n },\n lineClamp: {\n type: [String, Number]\n },\n tag: {\n type: String,\n default: \"span\"\n }\n});\n\nexport { textProps };\n//# sourceMappingURL=text.mjs.map\n","import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';\nimport '../../../hooks/index.mjs';\nimport '../../form/index.mjs';\nimport '../../../utils/index.mjs';\nimport { textProps } from './text.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { isUndefined } from '../../../utils/types.mjs';\n\nconst __default__ = defineComponent({\n name: \"ElText\"\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: textProps,\n setup(__props) {\n const props = __props;\n const textSize = useFormSize();\n const ns = useNamespace(\"text\");\n const textKls = computed(() => [\n ns.b(),\n ns.m(props.type),\n ns.m(textSize.value),\n ns.is(\"truncated\", props.truncated),\n ns.is(\"line-clamp\", !isUndefined(props.lineClamp))\n ]);\n return (_ctx, _cache) => {\n return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {\n class: normalizeClass(unref(textKls)),\n style: normalizeStyle({ \"-webkit-line-clamp\": _ctx.lineClamp })\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"default\")\n ]),\n _: 3\n }, 8, [\"class\", \"style\"]);\n };\n }\n});\nvar Text = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"text.vue\"]]);\n\nexport { Text as default };\n//# sourceMappingURL=text2.mjs.map\n","import '../../utils/index.mjs';\nimport Text from './src/text2.mjs';\nexport { textProps } from './src/text.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElText = withInstall(Text);\n\nexport { ElText, ElText as default };\n//# sourceMappingURL=index.mjs.map\n","const UPDATE_MODEL_EVENT = \"update:modelValue\";\nconst CHANGE_EVENT = \"change\";\nconst INPUT_EVENT = \"input\";\n\nexport { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT };\n//# sourceMappingURL=event.mjs.map\n","const componentSizes = [\"\", \"default\", \"small\", \"large\"];\nconst componentSizeMap = {\n large: 40,\n default: 32,\n small: 24\n};\n\nexport { componentSizeMap, componentSizes };\n//# sourceMappingURL=size.mjs.map\n","import { getCurrentInstance, inject, computed, unref } from 'vue';\nimport '../../utils/index.mjs';\nimport { useGetDerivedNamespace } from '../use-namespace/index.mjs';\nimport { isClient } from '@vueuse/core';\nimport { debugWarn } from '../../utils/error.mjs';\n\nconst defaultIdInjection = {\n prefix: Math.floor(Math.random() * 1e4),\n current: 0\n};\nconst ID_INJECTION_KEY = Symbol(\"elIdInjection\");\nconst useIdInjection = () => {\n return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;\n};\nconst useId = (deterministicId) => {\n const idInjection = useIdInjection();\n if (!isClient && idInjection === defaultIdInjection) {\n debugWarn(\"IdInjection\", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})`);\n }\n const namespace = useGetDerivedNamespace();\n const idRef = computed(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);\n return idRef;\n};\n\nexport { ID_INJECTION_KEY, useId, useIdInjection };\n//# sourceMappingURL=index.mjs.map\n","import { inject, computed, unref } from 'vue';\nimport '../../utils/index.mjs';\nimport '../../constants/index.mjs';\nimport { buildProp } from '../../utils/vue/props/runtime.mjs';\nimport { componentSizes } from '../../constants/size.mjs';\n\nconst useSizeProp = buildProp({\n type: String,\n values: componentSizes,\n required: false\n});\nconst useSizeProps = {\n size: useSizeProp\n};\nconst SIZE_INJECTION_KEY = Symbol(\"size\");\nconst useGlobalSize = () => {\n const injectedSize = inject(SIZE_INJECTION_KEY, {});\n return computed(() => {\n return unref(injectedSize.size) || \"\";\n });\n};\n\nexport { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nexport default isNil;\n"],"names":["useSameTarget","handleClick","onClick","onMousedown","onMouseup","mousedownTarget","mouseupTarget","e","target","currentTarget","PatchFlags","PatchFlags2","flattedChildren","children","vNodes","result","forEach","child","_a","push","component","subTree","overlayProps","mask","type","Boolean","default","customMaskEvent","overlayClass","String","Array","Object","zIndex","Number","overlayEmits","click","evt","MouseEvent","BLOCK","Overlay","name","props","emits","setup","slots","emit","ns","onMaskClick","class","b","style","STYLE","CLASS","PROPS","h","position","top","right","bottom","left","ElOverlay","dialogContentProps","center","alignCenter","closeIcon","customClass","draggable","fullscreen","showClose","title","ariaLevel","dialogProps","appendToBody","appendTo","beforeClose","Function","destroyOnClose","closeOnClickModal","closeOnPressEscape","lockScroll","modal","openDelay","closeDelay","modelValue","modalClass","width","trapFocus","headerAriaLevel","dialogEmits","open","opened","close","closed","value","openAutoFocus","closeAutoFocus","drawerProps","direction","values","size","withHeader","modalFade","drawerEmits","useLockscreen","trigger","options","hiddenCls","bm","document","body","scrollBarWidth","withoutHiddenClass","bodyWidth","cleanup","setTimeout","val","namespace","bodyHasOverflow","documentElement","clientHeight","scrollHeight","bodyOverflowY","useDialog","targetRef","instance","nextZIndex","lastPosition","titleId","bodyId","visible","rendered","openTimer","closeTimer","style2","varPrefix","overlayDialogStyle","display","afterEnter","afterLeave","beforeLeave","stop","doOpen","doClose","handleClose","hide","shouldCancel","onModalClick","onOpenAutoFocus","onCloseAutoFocus","onFocusoutPrevented","event","_a2","detail","focusReason","preventDefault","onCloseRequested","isUndefined","scrollTop","transform","_sfc_main","components","ElFocusTrap","ElIcon","Close","inheritAttrs","scope","from","replacement","version","ref","drawerRef","focusStartRef","t","isHorizontal","drawerSize","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_component_close","_component_el_icon","_component_el_focus_trap","_component_el_overlay","to","disabled","onAfterEnter","onAfterLeave","onBeforeLeave","persisted","loop","trapped","onReleaseRequested","$attrs","role","tabindex","key","$slots","titleClass","id","args","_","footer","Drawer","ElDrawer","tabsRootContextKey","Symbol","tabBarProps","tabs","COMPONENT_NAME","__default__","__props","expose","rootTabs","barRef","barStyle","getBarStyle","offset","tabSize","sizeName","includes","tabPosition","sizeDir","every","tab","_b","$el","parent","refs","uid","active","tabStyles","window","getComputedStyle","length","parseFloat","paddingLeft","paddingRight","update","async","immediate","ref_key","is","TabBar","tabNavProps","panes","currentName","editable","stretch","tabNavEmits","tabClick","tabName","ev","Event","tabRemove","TabNav","vm","visibility","focused","navScroll$","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","navStyle","dir","scrollPrev","containerSize","currentOffset","newOffset","scrollNext","navSize","scrollToActiveTab","nav","activeTab","querySelector","navScroll","activeTabBounding","getBoundingClientRect","navScrollBounding","maxOffset","offsetWidth","offsetHeight","height","Math","max","min","prev","next","changeTab","code","up","down","EVENT_CODE","tabList","querySelectorAll","currentIndex","indexOf","nextIndex","focus","preventScroll","setFocus","removeFocus","visibility2","focused2","flush","deep","scrollBtn","ArrowLeft","ArrowRight","map","pane","index","_c","_d","closable","isClosable","btnClose","tabLabelContent","label","call","delete","backspace","getOrderedChildren","childComponentName","nodes","filter","n","uids","p","useOrderedChildren","orderedChildren","addChild","removeChild","children2","tabsProps","activeName","addable","isPaneName","tabsEmits","tabChange","edit","paneName","action","tabAdd","Tabs","registerPane","unregisterPane","setCurrentName","_b2","canLeave","handleTabClick","handleTabRemove","stopPropagation","handleTabAdd","addSlot","addIcon","newButton","enter","Plus","header","panels","m","tabPaneProps","lazy","tabsRoot","loaded","shouldBeRender","TabPane","ElTabs","switchProps","loading","validator","inlinePrompt","inactiveActionIcon","activeActionIcon","activeIcon","inactiveIcon","activeText","inactiveText","activeValue","inactiveValue","activeColor","inactiveColor","borderColor","validateEvent","beforeChange","switchEmits","_hoisted_5","formItem","switchSize","useBatchDeprecated","list","param","vnode","inputId","formItemContext","switchDisabled","isControlled","input","core","switchKls","checked","labelLeftKls","em","labelRightKls","coreStyle","actualValue","validate","catch","err","handleChange","switchValue","shouldChange","isPromiseOrBool","then","styles","cssVarBlock","onChange","onKeydown","Loading","Switch","ElSwitch","getProteins","request","method","url","responseType","getCellLineProteins","Z_FIXED$1","Z_BINARY","Z_TEXT","Z_UNKNOWN$1","zero$1","buf","len","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH$1","MAX_MATCH$1","LENGTH_CODES$1","LITERALS$1","L_CODES$1","D_CODES$1","BL_CODES$1","HEAP_SIZE$1","MAX_BITS$1","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","Uint8Array","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","static_dtree","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","this","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","s","w","pending_buf","pending","send_bits","bi_valid","bi_buf","send_code","c","tree","bi_reverse","res","bi_flush","gen_bitlen","desc","stree","extra","base","bits","xbits","f","overflow","bl_count","heap","heap_max","opt_len","static_len","gen_codes","next_code","tr_static_init","init_block","dyn_ltree","dyn_dtree","bl_tree","sym_next","matches","bi_windup","smaller","depth","_n2","_m2","pqdownheap","k","v","j","heap_len","compress_block","ltree","dtree","lc","sx","sym_buf","build_tree","node","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","send_tree","build_bl_tree","max_blindex","l_desc","d_desc","bl_desc","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","block_mask","static_init_done","_tr_init$1","_tr_stored_block$1","stored_len","last","set","subarray","_tr_align$1","_tr_flush_block$1","opt_lenb","static_lenb","level","strm","data_type","strategy","_tr_tally$1","sym_end","_tr_init_1","_tr_stored_block_1","_tr_flush_block_1","_tr_tally_1","_tr_align_1","trees","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","adler","pos","s1","s2","adler32_1","makeTable","table","crcTable","Uint32Array","crc32","crc","end","i","crc32_1","messages","constants$2","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_UNKNOWN","Z_DEFLATED","Z_NO_FLUSH$2","Z_FULL_FLUSH$1","Z_FINISH$3","Z_BLOCK$1","Z_OK$3","Z_STREAM_END$3","Z_STREAM_ERROR$2","Z_DATA_ERROR$2","Z_BUF_ERROR$1","Z_DEFAULT_COMPRESSION$1","Z_DEFAULT_STRATEGY$1","Z_DEFLATED$2","MAX_MEM_LEVEL","MAX_WBITS$1","DEF_MEM_LEVEL","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","MIN_MATCH","MAX_MATCH","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","GZIP_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","errorCode","msg","zero","slide_hash","wsize","w_size","hash_size","head","HASH_ZLIB","data","hash_shift","hash_mask","HASH","flush_pending","state","avail_out","output","pending_out","next_out","total_out","flush_block_only","block_start","strstart","put_byte","putShortMSB","read_buf","start","avail_in","next_in","wrap","total_in","longest_match","cur_match","match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","_w_size","more","str","window_size","insert","ins_h","deflate_stored","have","min_block","pending_buf_size","used","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","deflate_slow","max_insert","prev_match","match_available","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","lm_init","DeflateState","status","gzhead","gzindex","last_flush","w_bits","hash_bits","Uint16Array","lit_bufsize","deflateStateCheck","deflateResetKeep","deflateReset","ret","deflateSetHeader","deflateInit2","windowBits","memLevel","deflateInit","deflate$2","old_flush","level_flags","text","hcrc","comment","time","os","beg","copy","gzhead_extra","charCodeAt","bstate","deflateEnd","deflateSetDictionary","dictionary","dictLength","tmpDict","avail","deflateInit_1","deflateInit2_1","deflateReset_1","deflateResetKeep_1","deflateSetHeader_1","deflate_2$1","deflateEnd_1","deflateSetDictionary_1","deflateInfo","deflate_1$2","deflate","_has","obj","prototype","hasOwnProperty","sources","slice","arguments","source","shift","TypeError","flattenChunks","chunks","l","chunk","common","assign","STR_APPLY_UIA_OK","fromCharCode","apply","__","_utf8len","q","string2buf","TextEncoder","encode","c2","m_pos","str_len","buf_len","buf2binstring","buf2string","TextDecoder","decode","out","utf16buf","c_len","utf8border","ZStream","zstream","toString$1","toString","Z_NO_FLUSH$1","Z_FINISH$2","Z_OK$2","Z_STREAM_END$2","Z_DEFLATED$1","Deflate$1","chunkSize","opt","raw","gzip","ended","Error","dict","_dict_set","deflate$1","deflator","deflateRaw$1","gzip$1","flush_mode","_flush_mode","onData","onEnd","Deflate_1$1","deflate_2","deflateRaw_1$1","gzip_1$1","constants$1","deflate_1$1","Deflate","deflateRaw","constants","BAD$1","TYPE$1","inffast","_in","_out","dmax","whave","wnext","s_window","hold","lcode","dcode","lmask","dmask","here","op","from_source","lencode","distcode","lenbits","distbits","dolen","mode","dodist","sane","MAXBITS","ENOUGH_LENS$1","ENOUGH_DISTS$1","CODES$1","LENS$1","DISTS$1","lbase","lext","dbase","dext","inflate_table","lens","lens_index","codes","table_index","work","opts","incr","fill","low","sym","root","curr","drop","huff","offs","here_bits","here_op","here_val","inftrees","CODES","LENS","DISTS","Z_FINISH$1","Z_OK$1","Z_STREAM_END$1","Z_NEED_DICT$1","Z_STREAM_ERROR$1","Z_DATA_ERROR$1","Z_MEM_ERROR$1","HEAD","FLAGS","TIME","OS","EXLEN","EXTRA","NAME","COMMENT","HCRC","DICTID","DICT","TYPE","TYPEDO","STORED","COPY_","COPY","TABLE","LENLENS","CODELENS","LEN_","LEN","LENEXT","DIST","DISTEXT","MATCH","LIT","CHECK","LENGTH","DONE","BAD","MEM","SYNC","ENOUGH_LENS","ENOUGH_DISTS","MAX_WBITS","DEF_WBITS","zswap32","InflateState","havedict","flags","check","total","wbits","ncode","nlen","ndist","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","Int32Array","inflateReset","inflateReset2","inflateInit2","inflateInit","lenfix","distfix","virgin","fixedtables","updatewindow","src","inflate$2","put","last_bits","last_op","last_val","hbuf","order","inf_leave","done","xflags","extra_len","inflateEnd","inflateGetHeader","inflateSetDictionary","dictid","inflateReset_1","inflateReset2_1","inflateResetKeep_1","inflateInit_1","inflateInit2_1","inflate_2$1","inflateEnd_1","inflateGetHeader_1","inflateSetDictionary_1","inflateInfo","inflate_1$2","inflate","GZheader","gzheader","Inflate$1","inflate$1","inflator","inflateRaw$1","last_avail_out","next_out_utf8","tail","utf8str","join","Inflate_1$1","inflate_2","inflateRaw_1$1","ungzip$1","inflate_1$1","Inflate","inflateRaw","ungzip","inflate_1","extendStatics","d","setPrototypeOf","__proto__","__extends","constructor","create","Browser","firefox","ie","edge","newEdge","weChat","Env","browser","wxa","worker","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","transformSupported","transform3dSupported","hasGlobalWindow","env","detect","ua","test","split","SVGRect","WebKitCSSMatrix","wx","getSystemInfoSync","self","navigator","userAgent","DEFAULT_FONT_SIZE","DEFAULT_FONT_FAMILY","DEFAULT_FONT","OFFSET","SCALE","defaultWidthMapStr","getTextWidthMap","mapStr","JSON","char","DEFAULT_TEXT_WIDTH_MAP","createCanvas","createElement","measureText","_cachedFont","font","canvas","getContext","exec","fontSize","preCalcWidth","loadImage","onload","onerror","image","Image","BUILTIN_OBJECT","reduce","TYPED_ARRAY","objToString","arrayProto","nativeForEach","nativeFilter","nativeSlice","nativeMap","ctorFunction","protoFunction","protoKey","idStart","guid","logError","_i","console","error","clone","typeStr","isPrimitive","Ctor","isDom","merge","overwrite","targetProp","sourceProp","isBuiltInObject","mergeAll","targetAndSources","extend","overlay","keysArr","keys","array","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","arr","cb","context","memo","find","bindPolyfill","concat","bind","isFunction","curry","isArray","isNumber","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isImagePatternObject","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","assert","condition","message","trim","replace","primitiveKey","setAsPrimitive","MapPolyfill","existed","has","get","callback","isNativeMapSupported","Map","maybeNativeMap","HashMap","isArr","thisMap","visit","each","hasKey","removeKey","createHashMap","concatArray","a","newArray","createObject","proto","properties","StyleCtor","disableUserSelect","dom","domStyle","webkitUserSelect","userSelect","webkitTapHighlightColor","own","noop","RADIAN_TO_DEGREE","PI","x","y","add","v1","v2","scaleAndAdd","sub","sqrt","lenSquare","scale","normalize","distance","distanceSquare","distSquare","lerp","applyTransform","Param","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","__hostTarget","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","idxLR","idxTB","cssText","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","offsetLeft","offsetTop","nodeName","toUpperCase","replaceReg","replaceMap","encodeHTML","MOUSE_EVENT_REG","firefoxNotSupportOffsetXY","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","touch","targetTouches","changedTouches","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","addEventListener","removeEventListener","cancelBubble","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","_doTrack","_recognize","clear","touches","trackItem","points","recognizers","gestureInfo","pointPair","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","identity","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","vx","vy","Point","other","equal","scalar","dot","negate","toArray","fromArray","p2","p0","p1","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","union","calculateTransform","sy","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","contain","plain","isZero","tx","ty","maxX","maxY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","tmpRect","Handler","storage","painter","proxy","painterRoot","pointerSize","_hovered","_pointerSize","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","eachOtherLayer","layer","exclude","getDisplayList","setHoverTarget","candidates","targetSizeHalf","pointerRect","ignore","ignoreCoarsePointer","getBoundingRect","rStep","thetaStep","PI2","r","theta","x1","y1","processGesture","stage","_gestureMgr","gestureMgr","isHover","displayable","rectHover","ignoreClip","clipPath","getClipPath","hostEl","hoverCheckResult","handlerInstance","getWidth","getHeight","_downEl","_downPoint","_upEl","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","mid","pivot","gallopLeft","hint","lastOffset","tmp","gallopRight","TimSort","runStart","runLength","minGallop","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","count1","count2","exit","_minGallop","customCursor","customDest","sort","remaining","ts","minRun","force","REDRAW_BIT","STYLE_CHANGED_BIT","SHAPE_CHANGED_BIT","invalidZErrorLogged","logInvalidZError","warn","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","traverse","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","beforeUpdate","afterUpdate","userSetClipPath","currentClipPath","parentClipPath","updateTransform","childrenRef","__dirty","disp","__clipPaths","isNaN","decalEl","getDecalElement","textGuide","getTextGuideLine","textEl","getTextContent","addRoot","delRoot","idx","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","easingFuncs","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","mathPow","mathSqrt","EPSILON","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero","p3","cubicDerivativeAt","cubicRootAt","A","B","C","t1","disc","K","t2","discSqrt","Y1","Y2","T","acos","ASqrt","t3","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","step","quadraticRootAt","divider","quadraticProjectPoint","quadraticLength","regexp","createCubicEasingFunc","cubicEasingStr","cubic","a_1","b_1","c_1","d_1","roots_1","Clip","_inited","_startTime","_pausedTime","_paused","_life","life","_delay","delay","onframe","ondestroy","onrestart","easing","setEasing","globalTime","deltaTime","elapsedTime","percent","easingFunc","schedule","remainder","pause","resume","Entry","LinkedList","_len","entry","insertEntry","remove","LRU","maxSize","_list","_maxSize","_map","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","parseCssInt","charAt","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","ep","fname","substr","params","alpha","pop","hsla2rgba","iv","hsla","rgba","rgba2hsla","H","S","R","G","vMin","vMax","L","deltaR","deltaG","deltaB","lift","color","colorArr","stringify","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fullOutput","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","mathRound","normalizeColor","opacity","round3","round4","getMatrixStr","TEXT_ALIGN_TO_ANCHOR","middle","adjustTextY","lineHeight","textBaseline","hasShadow","shadowBlur","shadowOffsetX","shadowOffsetY","getShadowKey","globalScale","getGlobalScale","shadowColor","toFixed","isImagePattern","isSVGPattern","svgElement","isPattern","isLinearGradient","isRadialGradient","isGradient","getIdURL","getPathPrecision","getSRTTransformString","rotation","scaleX","scaleY","skewX","skewY","encodeBase64","btoa","unescape","encodeURIComponent","Buffer","arraySlice","interpolateNumber","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillColorStops","val0","val1","len0","len1","shorterArr","shorterLen","fillArray","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","cloneValue","rgba2String","guessArrayDim","VALUE_TYPE_NUMBER","VALUE_TYPE_1D_ARRAY","VALUE_TYPE_2D_ARRAY","VALUE_TYPE_COLOR","VALUE_TYPE_LINEAR_GRADIENT","VALUE_TYPE_RADIAL_GRADIENT","VALUE_TYPE_UNKOWN","isGradientValueType","valType","isArrayValueType","tmpRgba","Track","propName","keyframes","discrete","_invalid","_needsSort","_lastFr","_lastFrP","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","rawValue","arrayDim","colorArray","parsedGradient","colorStop","kf","prepare","maxTime","additiveTrack","kfs","kfsLen","lastKf","isDiscrete","lastValue","startValue","additiveValue","frameIdx","frame","nextFrame","isAdditive","valueKey","kfsNum","isValueColor","lastFrame","targetArr","_additiveValue","nextVal_1","isLinearGradient_1","nextColorStop","global","_addToTarget","Animator","allowDiscreteAnimation","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","_allowDiscrete","getMaxTime","getDelay","getLoop","getTarget","changeTarget","when","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","addtiveTrackKfs","lastFinalKf","isPaused","duration","_force","_doneCallback","_setTracksFinished","doneList","_doneCbs","_abortedCallback","animation","abortedList","_abortedCbs","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","clip","stillHasAdditiveAnimator","onframeList","_onframeCbs","addClip","forwardToLast","during","aborted","getClip","getTracks","stopTracks","allAborted","saveTo","trackKeys","firstOrLast","__changeFinalValue","finalProps","getTime","Date","Animation","_running","_time","_pauseStart","_head","_tail","addAnimator","animator","removeAnimator","notTriggerFrameAndStageUpdate","nextClip","finished","_startLoop","animate","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","FakeGlobalEvent","isLocalEl","elTmp","isLocal","domBelongToZr","parentNode","stopImmediatePropagation","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","element","toElement","relatedTarget","__pointerCapturing","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","mIdentity","scaleTmp","tmpTransform","originTransform","Transformable","getLocalTransform","setPosition","setScale","setSkew","setOrigin","originX","originY","needLocalTransform","parentTransform","_resolveGlobalScaleRatio","invTransform","globalScaleRatio","relX","relY","getComputedTransform","transformNode","ancestors","setLocalTransform","atan2","shearX","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","copyTransform","ax","anchorX","ay","anchorY","tan","initDefaultProps","TRANSFORMABLE_PROPS","textWidthCache","cacheOfFont","innerGetBoundingRect","textAlign","getLineHeight","adjustTextX","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","halfHeight","textVerticalAlign","align","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","animators","currentStates","states","_init","attr","markRedraw","updateInnerText","forceUpdate","_textContent","textConfig","local","innerTransformable","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","attrKV","setTextConfig","setTextContent","setClipPath","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","forceUseHoverLayer","toNormalState","hasStates","animationCfg","stateTransition","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","textContent","_textGuide","_updateAnimationTargets","useStates","stateObjects","notChange","stateObj","lastStateObj","mergedState","_mergeStates","removeState","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","previousTextContent","removeTextContent","cfg","removeTextConfig","setTextGuideLine","guideLine","removeTextGuideLine","refreshHover","refresh","dirty","inHover","updateDuringAnimation","wakeUp","stopAnimation","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","createLegacyProperty","privateKey","xKey","yKey","enhanceArray","defineProperty","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","copyArrShallow","is2DArray","copyValue","sourceArr","isValueSame","val2","is1DArraySame","topKey","animateObj","targetKeys","additive","setToFinal","animateAll","existsAnimators","animationKeys","innerKey","targetVal","keyLen","revertedSource","reversedTarget","sourceClone","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","oldChild","newChild","replaceAt","old","removeAll","eachChild","stopped","includeChildren","tmpMat","invisible","childRect","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","useDirtyRect","ssrMode","ssr","ssrOnly","handerProxy","HandlerProxy","getViewportRoot","useCoarsePointer","usePointerSize","defaultPointerSize","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","triggerRendered","refreshHoverImmediately","setSleepAfterStill","stillFramesCount","getType","clearAnimation","eventHandler","init","registerPainter","RADIAN_EPSILON","ROUND_SUPPORTED_PRECISION_MAX","_trim","linearMap","domain","range","clamp","r0","r1","subDomain","subRange","all","NaN","precision","returnStr","asc","getPrecision","getPrecisionSafe","eIndex","exp","significandPartLen","dotIndex","decimalPartLen","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentSeats","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","seat","addSafe","maxPrecision","MAX_SAFE_INTEGER","remRadian","radian","pi2","isRadianAroundZero","TIME_REG","hour","UTC","substring","quantity","nice","nf","exponent","exp10","quantile","ascArr","reformIntervals","littleThan","currClose","close_1","lg","numericToNumber","valFloat","getRandomIdBase","random","getGreatestCommonDividor","getLeastCommonMultiple","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","preParseFinder","mainTypeSpecified","queryOptionMap","others","defaultMainType","queryOption","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","finder","parsedKey","queryType","includeMainTypes","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","class_1","superCall","superApply","fn","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","makeContainer","componentTypeInfo","container","registerClass","componentFullType","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","makeStyleMapper","ignoreParent","model","excludes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","cbPayload","__zrImageSrc","pendingWrap","isImageReady","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","lineWidth","subLength","estimateLength","charCode","parsePlainText","lines","padding","truncate","calculatedLineHeight","bgColorDrawn","truncateLineOverflow","lineOverflow","wrapText","contentHeight","lineCount","truncateMinChar","outerHeight","outerWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","strLines","linesWidths","isEmptyStr","newLine","tokenPadding","tokenPaddingH","outerWidth_1","isLineHolder","tokensLen","isAlphabeticLetter","ch","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS_IN_HOVER_LAYER","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","notRedraw","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","changedKeys","getAnimationStyleProps","statesKeys","mergedStyle","dispProto","incremental","viewRect","mathSin","mathCos","extremity","fromPoints","fromLine","xDim","yDim","fromCubic","cubicExtrema","cubicAt","fromQuadratic","quadraticExtremum","quadraticAt","fromArc","rx","ry","startAngle","endAngle","anticlockwise","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathAbs","hasTypedArray","Float32Array","tmpAngles","modPI2","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_xi","_yi","_x0","_y0","_saveData","increaseVersion","_version","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_pathSegLen","_pathLen","moveTo","_drawPendingPt","addData","lineTo","exceedUnit","_pendingPtDist","_pendingPtX","_pendingPtY","bezierCurveTo","quadraticCurveTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","displayedLength","pendingPtX","pendingPtY","drawPart","accumLength","pendingPtDist","psi","isEllipse","breakBuild","ellipse","newProxy","containStroke","_l","_s","normalizeRadian","windingLine","x_","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBatch","pathUpdated","getUpdatedPathProxy","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectStroke","_rectStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","pathProto","subPixelOptimize","autoBatch","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","imageSource","__image","otherDim","otherDimSize","r2","r3","r4","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","fixedBoundingRect","subElStyle","lineDash","setSeparateFont","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","rectEl","imgEl","textBorderWidth","textBorderColor","isImageBg","isPlainOrGradientBg","textBorderRadius","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","hasSeparateFont","fontStyle","fontWeight","parseFontSize","fontFamily","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","FONT_PARTS","fontProp","normalizeStyle","getECData","setCommonECData","seriesIndex","dataType","dataIdx","ecData","childECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","getComponentStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","leaveBlurredSeries","allComponentViews","eachComponent","componentStates","isSeries","view","getViewOfSeriesModel","getViewOfComponentModel","isBlured","group","toggleBlurSeries","blurSeries","targetSeriesIndex","blurScope","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurComponent","componentMainType","componentIndex","focusBlurEnabled","blurSeriesFromHighlightPayload","current","focus_1","findComponentHighDownDispatchers","focusSelf","dispatchers","findHighDownDispatchers","handleGlobalMouseOverForHighDown","dispatcher","componentHighDownName","handleGlobalMouseOutForHighDown","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","disableHoverEmphasis","toggleHoverEmphasis","isDisabled","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","enableComponentHighDownFeatures","getHighlightDigit","highlightKey","payloadType","isHighDownPayload","savePathStates","selectState","select","transitionStore","getAnimationConfig","animationType","animatableModel","extraOpts","extraDelayParams","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","isUpdate","animateOrSetProps","removeOpt","isFrom","isRemove","animationConfig","getAnimationDelayParams","animationDelay","animationEasing","animateConfig","updateProps","initProps","isElementRemoved","removeElement","fadeOutDisplayable","removeElementWithFadeOut","doRemove","saveOldStyle","oldStyle","getOldStyle","EMPTY_OBJ","setLabelText","labelTexts","oldStates","normal","getLabelText","stateModels","interpolatedValue","baseText","labelFetcher","labelDataIndex","labelDimIndex","normalModel","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","richResult","globalTextStyle","option","richItemNames","getRichItemNames","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currValue","labelText","PATH_COLOR","textStyleParams","tmpText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","makeDepndencyGraph","fullNameList","graph","noEntryList","thisItem","createDependencyGraphItem","originalDeps","availableDeps","getAvailableDependencies","entryCount","dependentName","predecessor","thatItem","successor","dep","topologicalTravel","targetNameList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","inheritDefaultOption","superOption","subOption","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","langEN","langZH","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","num","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","convertToColorString","defaultColor","windowOpen","link","blank","opener","location","href","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","gap","maxWidth","maxHeight","currentLineMaxSize","nextX","nextY","nextChild","nextChildRect","moveX","newline","moveY","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","aspect","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","ins","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","getZLevelKey","setZLevel","protoInitialize","getDependencies","deps","dependencies","unshift","platform","decalColor","colorBy","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","baseCategoryDimIndex","categoryWayValueDimStart","encodeItemName","encodeSeriesName","seriesLayoutBy","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","coordDimName","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","potentialNameDimIndex","sourceFormat","dimensionsDefine","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","startIndex","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","dimName","dimType","maxLoop","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","reCreateSeriesIndices","assertSeriesInitialized","initBase","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","OPTION_INNER_KEY","OPTION_INNER_VALUE","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","visitComponent","oldCmptList","mergeMode","Component","tooltipExists","optionsByMainType","cmptsByMainType","cmptsCountByMainType","isSeriesType","ComponentModelClass","extraOpt","__requireNewView","componentOption","mainTypeInReplaceMerge","_seriesIndices","getOption","optInMainType","realLen","metNonInner","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","globalDefault","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","doPreprocess","preProcess","singleMedia","realMap","aspectratio","applicable","matched","operator","realAttr","real","expect","indices1","indices2","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axes","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","clockwise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","stackStrategy","modify","v0","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","providerMethods","mountMethods","SourceImpl","dimensionsDetectedCount","metaRawOption","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","sourceHeader","dimensions","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","nameMap","rawItem","displayName","exist","shouldRetrieveDataByName","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","methods","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","extent","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","property","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getStore","getDimensionIndex","getDimensionProperty","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","userOutput","componentSubType","dimensionNames","fullDimensions","extendParams","getItemModel","dimensionIndex","dimStr","dimLoose","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","frag","createTask","define","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","planResult","upTask","_upstream","skip","outputData","__pipeline","currentTask","forceFirstProgress","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","_doReset","_dueEnd","_outputDueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","deprecateLog","throwError","parseDataValue","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","incomparable","isDesc","_resultLT","_incomparable","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","lvalTypeof","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","dimInfo","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","errMsg_1","__isBuiltIn","rawValueGetter","upstream","isSupportedSourceFormat","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","resultIndex","resultMetaRawOption","firstUpSource","defaultDimValueGetters","UNDEFINED","CtorUint32Array","CtorUint16Array","CtorInt32Array","CtorFloat64Array","Float64Array","dataCtors","getIndicesCtor","rawCount","getInitialExtent","cloneChunk","originalChunk","prepareStore","dimIdx","append","DataCtor","oldStore","oldLen","newStore","DataStore","_chunks","_rawExtent","_extent","_rawCount","_calcDimNameToIdx","initData","inputDimensions","dimValueGetter","_provider","_indices","_getRawIdxIdentity","defaultGetter","defaultDimValueGetter","_dimValueGetter","_dimensions","_initDataFromProvider","getProvider","ensureCalculationDimension","calcDimNameToIdx","calcDimIdx","collectOrdinalMeta","ordinalMeta","rawExtents","ordinalOffset","dimRawExtent","parseAndCollect","getOrdinalMeta","appendValues","minFillLen","dimLen","rawExtent","emptyDataItem","sourceIdx","arrayRows","dimNames","dimStorage","dimStore","getValues","dimArr","rawIdx","getSum","dimData","getMedian","dimDataArray","sortedDimDataArray","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDist","minDiff","nearestIndicesLen","getIndices","newIndices","thisCount","buffer","dim0","_updateGetRawIdx","selectRange","originalCount","storeArr","quickFinished","dimStorage2","dimk","_updateDims","targetChunks","tmpRetValue","dataCount","retValue","rawExtentOnDim","lttbDownSample","valueDimension","rate","maxArea","area","nextRawIndex","targetStorage","sampledIndex","frameSize","currentRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","firstNaNIndex","countNaN","_getRawIdx","downSample","dimension","sampleValue","sampleIndex","frameValues","sampleFrameIdx","getDataExtent","initialExtent","currEnd","useRaw","clonedDims","ignoreIndices","clonedDimsMap","_copyCommonProps","_cloneIndices","getDimValueSimply","objectRows","keyedColumns","original","typedArray","SourceManager","sourceHost","_sourceList","_storeList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","resultSourceList","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","upSourceMgr","newMetaRawOption","_getSourceMetaRawOption","upMetaRawOption","needsCreateSource","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","datasetIndex","upSrcMgr","sourceIndex","getSharedDataStore","seriesDimRequest","schema","makeStoreSchema","_innerGetDataStore","hash","storeDims","seriesSource","sourceReadKey","storeList","cachedStoreMap","cachedStore","getSourceManager","disableTransformOptionMerge","TOOLTIP_LINE_HEIGHT_CSS","getTooltipTextStyle","nameFontColor","nameFontSize","nameFontWeight","valueFontColor","valueFontSize","valueFontWeight","nameStyle","valueStyle","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","isSectionFragment","getBuilder","buildSection","buildNameValue","getBlockGapLevel","gapLevel_1","subBlockLen","blocks","hasInnerGap_1","noHeader","subBlock","subGapLevel","fragment","topMarginForOuterGap","toolTipTextStyle","gaps","getGap","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","valueFormatter","subMarkupText","html","richText","wrapBlockHTML","displayableHeader","wrapInlineNameRichText","noName","noValue","noMarker","markerType","valueTypeOption","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","buildTooltipMarkup","builder","gapLevel","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","inlineValue","inlineValueType","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","getSelectionKey","getId","SERIES_UNIVERSAL_TRANSITION_PROP","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getEncode","getColorBy","isColorBySeries","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","selectedMode","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","isUniversalTransitionEnabled","universalTransitionOpt","universalTransition","lastDataIndex","hasItemOption","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","isBlur","eachRendered","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","mathAtan2","transformPath","nPoint","p_1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","prevCmd","cpx","cpy","subpathX","subpathY","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","clonePath","sourcePath","bakeTransform","toLocal","CircleShape","Circle","EllipseShape","Ellipse","mathACos","mathATan2","dx10","dy10","dx32","dy32","computeCornerTangents","cr","x01","y01","x11","y11","x10","y10","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","normalizeCornerRadius","innerRadius","hasRadius","hasInnerRadius","mod","icrStart","icrEnd","ocrStart","ocrEnd","ocrs","ocre","icrs","icre","ocrMax","icrMax","limitedOcrMax","limitedIcrMax","xre","yre","xirs","yirs","xrs","yrs","xire","yire","hasArc","cornerRadius","halfRd","it_1","crStart","crEnd","ct0","ct1","SectorShape","Sector","RingShape","Ring","smoothBezier","smooth","isLoop","constraint","prevPoint","nextPoint","cps","point","cp0","cp1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","LineShape","Line","pointAt","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","ArcShape","Arc","unitX","unitY","CompoundPath","_updatePathDirty","paths","dirtyPath","Gradient","addColorStop","LinearGradient","globalCoord","RadialGradient","extent2","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","IncrementalDisplayable","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","pathRect","getTransform","ancestor","mat","invert","transformDirection","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","elMap1","getElMap","anid","oldEl","newProp","getAnimatableProps","elMap","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","setTooltipConfig","itemTooltipOption","itemTooltipOptionObj","formatterParams","formatterParamsExtra","tooltipConfig","traverseElement","traverseElements","els","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","debounceNextCall","lastCall","lastExec","timer","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","throttleType","originFn","lastThrottleType","lastRate","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","hasAutoColor","colorPalette","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","fromPalette","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","needSetDirty","setDirty","dirtyMap","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","performArgs_1","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","Clz","Global","cond","colorAll","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","filterForExposedEvent","host","propOnHost","SYMBOL_PROPS_WITH_CB","SYMBOL_PROPS","seriesSymbolTask","legendIcon","symbolOptions","symbolOptionsCb","hasCallback","symbolPropName","symbolKeepAspect","symbolPropsCb","dataSymbolTask","getItemVisualFromData","getVisualFromData","setItemVisualFromData","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","supportDefineProperty","WeakMap","_id","_guard","enumerable","configurable","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","symbolBuildProxies","SymbolClz","symbolType","inBundle","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","keepAspect","symbolPath","setColor","normalizeSymbolSize","normalizeSymbolOffset","symbolOffset","isSafeNum","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","parseInt10","getSize","whIdx","wh","cwh","plt","prb","defaultView","normalizeLineDash","lineType","getLineDash","lineScale_1","pathProxyForDraw","styleHasStroke","isValidStrokeFillStyle","strokeOrFill","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","setTransform","matrix","translateSelf","rotateSelf","scaleSelf","brushPath","strokePart","firstDraw","dirtyFlag","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","setLineDash","needsRebuild","brushImage","drawImage","brushText","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","tag","attrs","pSize","getPatternSize","xlen","symbolRepeats","brushDecal","clearRect","fillRect","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","symbolVNode","renderOneToVNode","svgWidth","svgHeight","isAllString","dash","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","lifecycle","implsStore","registerImpl","impl","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","PENDING_UPDATE","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","toLowercaseNameAndCallEventful","disposedWarning","createRegisterEventWithLowercaseMessageCenter","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","createExtensionAPI","enableConnect","markStatusToUpdate","applyChangedStates","MessageCenter","messageCenterProto","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultCoarsePointer","defaultUseDirtyRect","_zr","_ssr","_throttledZrFlush","_coordSysMgr","CoordinateSystem","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_initEvents","_onframe","updateParams","remainTime","_model","startTime","getDom","isSSR","notMerge","lazyUpdate","transitionOpt","seriesTransition","setTheme","getRenderedCanvas","renderToCanvas","pixelRatio","renderToSVGString","renderToString","useViewBox","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","chart","getSvgDom","innerHTML","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","needPrepare","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","updatedSeries","allocateZlevels","componentZLevels","seriesZLevels","hasSeperateZLevel","zlevelKey","lastSeriesZLevel_1","lastSeriesKey_1","zLevels","applyElementStates","newStates","updateHoverLayerStatus","elCount","preventUsingHoverLayer","chartView","__alive","updateBlend","updateZ","preventAutoZ","doUpdateZ","maxZ2","labelLine","textGuideLineConfig","showAbove","prevStates","updateStates","stateAnimationModel","enableAnimation","isComponent","viewList","viewMap","doPrepare","requireNewView","viewId","classType","Clazz","Chart","__id","__model","__ecComponentInfo","excludeSeriesIdMap","excludeSeriesId","modelId","isExcluded","Series","notBlur","callView","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isHighDown","batchItem","newObj","pendingActions","dirtyList","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","echartsProto","one","wrapped","args2","idBase","isClient","existInstance","getInstanceByDom","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","priority","processor","normalizeRegister","registerPostInit","postInitFunc","registerUpdateLifecycle","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","registerLayout","layoutTask","registerVisual","visualTask","registeredTasks","targetList","defaultPriority","__raw","registerLoading","loadingFx","registerMap","mapName","geoJson","specialAreas","registerTransform","light","dark","extensions","extensionRegisters","registerComponentModel","registerComponentView","ComponentViewClass","registerSeriesModel","SeriesModelClass","registerChartView","ChartViewClass","painterType","PainterCtor","use","ext","singleExt","install","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelGuideConfig","searchSpace","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","shifts","totalShifts","shiftList","minGap","maxGap","first","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","hostModel","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","forceLabelAnimation","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldLayoutSelect","oldLayoutEmphasis","oldOpacity","layoutSelect","layoutEmphasis","newLayout","getLabelManager","installLabelLayout","registers","labelManager","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","onselectstart","getElementCount","initContext","setUnpainted","createBackBuffer","domBack","ctxBack","createRepaintRects","prevList","hasIntersections","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearColorGradientOrPattern","shouldCache","__width","__height","__canvasGradient","__painter","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","zlevelList","layers","rootCanvas","_width","_height","mainLayer","_domRoot","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","eachLayer","self_1","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","firstChild","getLayers","updatePrevLayer","prevZlevel","incrementalLayerCount","_clearLayer","layerConfig","_zlevel","delLayer","clearLayer","imageLayer","width_1","height_1","degree","SVGPathRebuilder","_start","_str","_p","_add","dThetaPositive","isCircle","unifiedTheta","xRot","dTheta_1","vals","generateStr","getStr","NONE","pathHasFill","pathHasStroke","strokeProps","svgStrokeProps","mapStyleToAttrs","updateAttr","strokeScale","strokeWidth","SVGNS","XLINKNS","XMLNS","XML_NAMESPACE","createElementNS","createVNode","createElementOpen","attrsStr","part","createElementClose","vNodeToString","convertElToString","getCssString","selectorNodes","animationNodes","bracketBegin","bracketEnd","selectors","className","attrName","animations","animationName","createBrushScope","zrId","shadowCache","patternCache","gradientCache","clipPathCache","defs","cssNodes","cssAnims","cssClassIdx","cssAnimIdx","shadowIdx","gradientIdx","patternIdx","clipPathIdx","createSVGVNode","EASING_MAP","transformOriginKey","buildPathString","kfShape","svgPathBuilder","setTransformOrigin","ANIMATE_STYLE_MAP","addAnimation","cssAnim","createCompoundPathCSSAnimation","cssAnimationCfg","cssAnimationName","composedAnim","subScope","createCSSAnimation","animNames","lastAnim","getEasingFunc","onlyShape","cssAnimations","groupAnimators","cfgArr","createSingleCSSAnimation","groupAnimator","transformKfs","shapeKfs","finalKfs","animationTimingFunctionAttrName","saveAnimatorTrackToCssKfs","cssKfs","toCssAttrName","kfEasing","timingFunction","canAnimateShape","newLen","transformOrigin","percents","allTransformOriginSame","isCanvasLike","setStyleAttrs","isFillStroke","setGradient","setPattern","setShadow","noRotateScale","noTranslate","compress","mul","convertPolyShape","strArr","validatePolyShape","createAttrsConvert","normalizedDesc","builtinShapesDef","polyline","hasShapeAnimation","brushSVGPath","builtinShpDef","svgElType","willUpdate","needBuildPath","pathVersion","elExt","__svgPathBuilder","__svgPathVersion","__svgPathStrokePercent","brushSVGImage","dw","dh","brushSVGTSpan","separatedFontStr","shadowKey","shadowId","blur_1","stdDx","stdDy","stdDeviation","gradientTag","gradientAttrs","stopColor","stopsAttrs","gradientVNode","gradientKey","gradientId","patternAttrs","noRepeat","repeatX","repeatY","imageWidth_1","imageWidth","imageHeight_1","imageHeight","imageSrc","patternImage","setSizeToVNode_1","vNode","svgEl","elm","createdImage","patternVNode","patternWidth","patternHeight","patternUnits","patternTransform","patternKey","patternId","clipPathId","clipPathAttrs","createTextNode","newNode","referenceNode","colonChar","xChar","emptyNode","isUndef","isDef","createKeyToOldIdx","beginIdx","endIdx","sameVnode","vnode1","vnode2","isSameKey","isSameTag","createElm","updateAttrs","addVnodes","parentElm","before","vnodes","startIdx","removeVnodes","oldVnode","oldAttrs","cur","removeAttribute","setAttributeNS","updateChildren","oldCh","newCh","oldKeyToIdx","idxInOld","elmToMove","oldStartIdx","newStartIdx","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","patchVnode","patch","parent_2","svgId","SVGPainter","createMethodNotSupport","_oldVNode","viewport","_viewport","svgDom","_svgDom","renderToVNode","bgVNode","_bgVNode","createBackgroundVNode","mainVNode","_mainVNode","animationCssStr","styleNode","cssAnimation","currentClipPathGroup","listLen","clipPathsGroupsStack","clipPathsGroupsStackDepth","clipGroupNodeIdx","prevLen","lca","i_2","groupAttrs","viewportStyle","bgEl","base64","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","updateManyToMany","_updateManyToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","DimensionUserOuput","dimRequest","_encode","_schema","_getFullDimensionNames","_cachedDimNames","makeOutputDimensionNames","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","userOutputEncode","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dataDimIndicesOnCoord","storeDimIndex","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","SeriesDimensionDefine","dimTypeShort","float","int","ordinal","number","SeriesDataSchema","_dimOmitted","dimensionOmitted","_fullDimCount","fullDimensionCount","_updateDimOmitted","isDimensionOmitted","_dimNameMap","ensureSourceDimNameMap","getSourceDimensionIndex","getSourceDimension","willRetrieveDataByName","makeHashStrict","shouldOmitUnusedDimensions","dimHash","fullDimIdx","seriesDimIdx","seriesDimDef","sourceDimDef","isCalculationCoord","appendCalculationDimension","isSeriesDataSchema","createDimNameMap","dataDimNameMap","dimDefItemRaw","userDimName","innerSource","dimNameMap","prepareInvertedIndex","getIdNameFromStore","normalizeDimensions","transferProperties","cloneListForMapAndSample","makeIdFromName","ID_PREFIX","INDEX_NOT_FOUND","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","SeriesData","dimensionsInput","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","assignStoreDimIdx","dimensionInfos","invertedIndicesMap","needsHasOwn","emptyObj","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","itemId","_idDimIdx","_dimInfos","_initGetDimensionInfo","_invertedIndicesMap","dimIdxToName_1","_dimIdxToName","getDimension","_recognizeDimIndex","_getDimInfo","_getStoreDimIndex","getDimensionsOnCoord","_dimSummary","mapDimension","dimensionsSummary","_store","nameList","_nameRepeatCount","_doInit","shouldMakeIdFromName","_shouldMakeIdFromName","_updateOrdinalMeta","idList","isFormatOriginal","sharedDataItem","getApproximateExtent","setApproximateExtent","_getCategory","invertedIndices","fCtx","dimIndices","filterSelf","innerRange","mapArray","ctxCompat","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","injectFunction","originalMethod","__wrappedMethods","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","prepareSeriesDataSchema","sysDims","coordDimNameMap","getDimCount","dimensionsCount","omitUnusedDimensions","canOmitUnusedDimensions","isUsingSourceDimensionsDef","encodeDef","encodeDefine","encodeDefaulter","encodeDefMap","indicesMap","getResultItem","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","ifNoNameFillWithCoordName","item0","item1","genCoordDimName","removeDuplication","duplicationMap","dimOriginalName","optDimCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","dimensionDefineList","byIndex","stackedCoordDimension","isLegacyDimensionsInput","stackedByDimInfo","stackedDimInfo","mayStack","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","stackedOverDimensionDefine","stackResultDimensionDefine","isDimensionStacked","stackedDim","getStackedDimension","targetDim","getCoordSysDimDefs","coordSysInfo","coordSysDimDefs","registeredCoordSys","getDimensionsInfo","injectOrdinalMeta","dimInfoList","hasNameEncode","categoryAxisModel","createSeriesData","sourceRaw","isOriginalSource","useEncodeDefaulter","createDimensionOptions","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","LineSeriesModel","getLegendIcon","itemHeight","itemWidth","visualRotate","symbolRotate","iconRotate","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","divideShape","triggerLineEvent","getDefaultLabel","labelDims","getDefaultInterpolatedLabel","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolType","getSymbolPath","setZ","setDraggable","hasCursorOption","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","emphasisItemStyle","blurItemStyle","selectItemStyle","emphasisDisabled","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","_progressiveEls","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","newSymbolType","oldSymbolType","_getSymbolPoint","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","baseAxis","getOtherAxis","valueStart","getValueStart","baseAxisDim","valueAxisDim","valueDim","baseDim","baseDataOffset","stacked","stackResultDim","dataDimsForPoint","getExtent","getStackedOnPoint","dataCoordInfo","stackedData","dataToPoint","supportFloat32Array","Float32ArrayCtor","createFloat32Array","arg","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","isPointNull","drawSegment","segLen","allLen","prevX","prevY","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","dir_1","dir_2","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","cartesian","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","filteredPoints","stepPt2","clipColorStops","prevOutOfRangeColorStop","prevInRangeColorStop","newColorStops","lerpStop","stop0","stop1","clippedCoord","coord0","stop_1","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","toGlobalCoord","dataToCoord","stopLen","outerColors","colorStopsInRange","inRangeStopLen","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","getViewLabels","ordinalNumber","getRawOrdinalNumber","tickValue","axisExtent","availSize","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","anyStateShowEndLabel","createLineClipPath","lineView","endLabelModel_1","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","expandSize","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_newPolygon","_initOrUpdateEndLabel","oldClipPath","newClipPath","_stackedOnPoints","_points","_doUpdateAnimation","_initSymbolLabelAnimation","_newPolyline","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","packEventData","symbolLabel","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDelay","seriesDelayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","distanceX","distanceY","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","LineSeries","STACK_PREFIX","getSeriesStackId","getAxisKey","getLayoutOnAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","getValueAxesMinGaps","barSeries","axisValues","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","isInLargeMode","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","lastColumn","widthSum","retrieveColumnLayout","barWidthAndOffset","columnLayoutInfo","columnOffset","columnWidth","createProgressiveLayout","valueDimIdx","baseDimIdx","drawBackground","isValueAxisH","valueAxisStart","getValueAxisStart","isLarge","barMinHeight","stackedDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","coordLayout","getRect","bgSize","idxOffset","baseValue","baseCoord","startCoord","valueAxisHorizontal","BaseBarSeriesModel","getMarkerPosition","startingAtTick","clampData","clampData_1","pt_1","getAxes","tickCoords","getTicksCoords","targetTickId","isEnd","leftCoord","stepTickValue","tickCoord","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","BaseBarSeries","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","lessThanCircle","unitStartX","unitStartY","unitEndX","unitEndY","createSectorCalculateTextPosition","positionMapping","isRoundCap","mappedSectorPosition","sector","middleR","middleAngle","extraDist","adjustAngleDistanceX","adjustAngleDistanceY","setSectorTextRotation","rotateType","anchorAngle","getSectorCornerRadius","zeroIfNull","getClipArea","coordSysClipArea","onBand","expandWidth","BarView","_isFirstFrame","_removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","realtimeSortCfg","shouldRealtimeSort","_enableRealtimeSort","needsClip","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","createBackgroundEl","isValidLayout","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dispatchInitSort","orderMapping_1","_onRendered","_updateSortWithinSameData","_dataSort","orderMapping","mappedValue","ordinalNumbers","_isOrderChangedWithinSameData","ordinalDataDim","tickNum","MIN_VALUE","_isOrderDifferentInView","orderInfo","tickMax","sortInfo","axisId","sortResult","otherAxis","coordSysBoundingRect","signWidth","signHeight","coordSysX2","coordSysY2","xClipped","yClipped","signR","clipped","__dataIndex","animateProperty","positionMap","createPolarPositionMapping","sectorShape","animateTarget","realtimeSortOption","seriesAnimationModel","seriesTarget","axisTarget","axisAnimationModel","checkPropertiesNotValid","rectPropties","polarPropties","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","arcOrAngle","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","progressiveEls","bgPoints","largePathUpdateDataIndex","largePath","largePathFindDataIndex","ElementClz","BarSeries","setCategorySortInfo","RADIAN","getViewRect","getBasicPieLayout","pieLayout","minAngle","validDataCount","unitRadian","roseType","stillShowZeroSum","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","adjustSingleSide","viewLeft","viewTop","farthestX","labelAlignTo","recalculateX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","newX","newTargetWidth","targetTextWidth","constrainTextWidth","items","topSemi","bottomSemi","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","labelStyleWidth","bleedMargin","isAlignToEdge","extraPaddingH","realTextWidth","availableWidth","forceRecalculate","textRect","bgColor","oldOuterWidth","oldHeight","innerRect","availableInnerWidth","newWidth","unconstrainedWidth","newRect","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelModel","labelLineLen","labelLineLen2","midAngle","isLabelInside","radialAngle","isDown","notShowLabel","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","_emptyCircleSector","piePiece","itemLayout","createSeriesDataSimply","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","innerData","PieSeriesModel","legendVisualProvider","_defaultLabelLine","dataInner","valueList_1","labelLineNormalOpt","labelLineEmphasisOpt","minShowLabelAngle","selectedOffset","percentPrecision","distanceToLabelLine","borderJoin","showEmptyCircle","emptyCircleStyle","labelLayout","avoidLabelOverlap","animationTypeUpdate","negativeDataFilter","curValue","PieSeries","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","_off","hoverDataIdx","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_create","_setCommon","endIndex","byteOffset","lastAdded","_newAdded","extrudeShadow","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","GridModel","containLabel","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","boundaryGap","deduplication","alignWithLabel","splitNumber","minorTick","primary","logBase","category","uidBase","OrdinalMeta","_needCollect","needCollect","_deduplication","createByAxisModel","dedplication","getOrdinal","_getOrCreateMap","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","axisDefault","AxisModel","getAxisType","thisOption","__ordinalMeta","getCategories","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","isIntervalOrLogScale","intervalScaleNiceTicks","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","increaseInterval","OrdinalScale","_ordinalMeta","_getTickNumber","getTicks","ticks","getMinorTicks","setSortInfo","infoOrdinalNumbers","ordinalsByTick","_ordinalNumbersByTick","ticksByOrdinal","_ticksByOrdinalNumber","allCategoryLen","unusedOrdinal","ticksByOrdinalNumber","tickNumber","ordinalNumbersByTick","getLabel","cateogry","calcNiceTicks","calcNiceExtent","roundNumber","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","dataNum","fixMax","fixMin","setNiceExtent","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","Interval","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","roundingErrorFix","mathFloor","mathCeil","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","niceExtent","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","frozen","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","inModel","extentInfo","Log","isIntervalOrTime","createScaleByModel","Ordinal","Time","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","containData","containZone","data1","data2","zoneDiag1","zoneDiag2","zone","xVal","yVal","xAxis","yAxis","xScale","yScale","xAxisExtent","yAxisExtent","pointToData","coordToData","xExtent","getGlobalExtent","yExtent","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","makeCategoryLabelsActually","labels","labelCategoryInterval","numericLabelInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","tickCategoryInterval","ticksCache","optionTickInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","fixExtentWithBands","getTickModel","ticksCoords","tickVal","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","Axis2D","coordExtent","categorySortInfo","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelDirection","tickDirection","nameDirection","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","alignScaleTicks","alignToScale","alignToTicks","alignToNicedTicks","alignToSplitNumber","alignToInterval","scaleExtent","isMinFixed","isMaxFixed","nicedSplitNumber","t0","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","updateAxisTicks","axesIndices","axisNeedsAlign","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","gridRect","axesList","adjustAxes","updateAxisTransform","labelUnionRect","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","getCartesians","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","axesModelMap","getTooltipAxes","baseAxes","otherAxes","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","AxisBuilder","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","axisNameAvailableWidth","gapSignal","isNameLocationCenter","nameRotation","endTextLayout","truncateOpt","nameTruncateMaxWidth","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","tickIndex","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","saveTooltipAxisInfo","triggerAxis","cross","tooltipAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","triggerEmphasis","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","axisElementBuilders","isInitialSortFromBarRacing","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","GridView","extraOption","ScatterSeries","radarLayout","getIndicatorAxes","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","indicator","polarIndex","radarIndex","RadarView","createSymbol","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","RadarSeriesModel","indicatorAxes","nameToDisplay","getTooltipPosition","coordToPoint","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","getIndicatorModels","radarModel","_buildAxes","_buildSplitLineAndArea","axisBuilders","indicatorAxis","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","ticksRadius","getColorIndex","realSplitNumber_1","axesTicksPoints","prevPoints","areaOrLine","areaOrLineColorList","IndicatorAxis","radiusExtent","Radar","_indicatorAxes","indicatorModel","indicatorIndex","closestAxis","minRadianDiff","closestAxisIdx","viewSize","radarSeries","dummyScale","pixel","radarList","RadarSeries","ATTR","take","resourceKey","userKey","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","nodeParsers","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","parseXML","svg","parser","DOMParser","parseFromString","svgNode","INHERITABLE_STYLE_ATTRIBUTES_MAP","INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS","SELF_STYLE_ATTRIBUTES_MAP","SELF_STYLE_ATTRIBUTES_MAP_KEYS","SVGParser","_defs","_root","xml","_defsUsePending","named","viewBox","parseAttributes","viewBoxRect","viewBoxTransform","_parseNode","applyDefs","viewBoxArr","splitNumberSequence","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","namedFrom","isInDefs","isInText","namedFromForSub","parser_1","newNamed","svgNodeTagLower","paintServerParsers","def","_parseText","_textX","_textY","inheritStyle","applyTextAlignment","pointsArr","pointsStr","parsePoints","parsePaintServerUnit","parseGradientColorStops","gradientUnits","toLocaleLowerCase","offsetStr","styleVals","parseInlineStyle","__inheritedStyle","pointsString","defsUsePending","onlyInlineStyle","isTextGroup","inheritedStyle","selfStyle","parseTransformAttribute","parseAttributeStyle","getFillStrokeStyle","__selfStyle","parentSelfStyle","zrTextBaseline","parentInheritedStyle","zrTextAlign","urlRegex","urlMatch","rawStr","transformRegex","DEGREE_TO_ANGLE","transformOps_1","mt","valueArr","styleRegex","inheritableStyleResult","selfStyleResult","styleRegResult","svgStlAttr","zrInheritableStlAttr","zrSelfStlAttr","svgAttrName","attrValue","parseSVG","TMP_TRANSFORM","transformPoints","updateBBoxFromPoints","projection","project","centroid","signedArea","Region","setCenter","_center","getCenter","calcCenter","GeoJSONPolygonGeometry","exterior","interiors","GeoJSONLineStringGeometry","GeoJSONRegion","geometries","cp","largestGeo","largestGeoSize","loopGeo","transformTo","interior","newRegion","GeoSVGRegion","elOnlyForCalculate","_elOnlyForCalculate","isGeoSVGGraphicRoot","REGION_AVAILABLE_SVG_TAG_MAP","GeoSVGResource","_usedGraphicMap","_freedGraphics","_mapName","_parsedXML","load","firstGraphic","_firstGraphic","_buildGraphic","_boundingRect","createRegions","regionsMap","_regions","_regionsMap","svgXML","rootFromParse","bRectX","bRectY","bRectWidth","bRectHeight","calculatedBoundingRect","namedItem","setSilent","useGraphic","hostKey","usedRootMap","svgGraphic","freeGraphic","region","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","features","geometry","encodeOffsets","coordinates","decodeRing","decodeRings","rings","coordinate","parseGeoJSON","nameProperty","featureObj","geoCoord","nanhaiName","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","fixDiaoyuIsland","DEFAULT_NAME_PROPERTY","GeoJSONResource","geoJSON","_parsedMap","_specialAreas","_geoJSON","parseInput","parsed","rawRegions","_parseToRegions","calculateBoundingRect","finalRegions","regionName","specialArea","getMapForUser","regionRect","rawDef","rawSpecialAreas","resource","getGeoResource","OPTION_STYLE_ENABLED_TAGS","OPTION_STYLE_ENABLED_TAG_MAP","STATE_TRIGGER_TAG_MAP","LABEL_HOST_MAP","mapLabelRaw","getFixedItemStyle","areaColor","fixLineStyle","styleHost","MapDraw","_controller","_controllerHost","_regionsGroup","_svgGroup","mapOrGeoModel","fromView","isGeo","mapSeries","getHostGeoModel","regionsGroup","transformInfo","getTransformInfo","transformInfoRaw","transformInfoRoam","roam","isFirstDraw","isVisualEncodedByVisualMap","viewBuildCtx","resourceType","_buildGeoJSON","_buildSVG","_updateController","_updateMapSelectHandler","regionsGroupByName","_regionsGroupByName","regionsInfoByName","projectionStream","stream","transformPoint","transformPolygonPoints","inPoints","outPoints","newPt","getPolyShape","regionGroup","regionModel","getRegionModel","polygonSubpaths","polylineSubpaths","polys","projectPolys","poly","centerPt","createCompoundPath","subpaths","isLine","compoundPath","applyOptionStyleForRegion","resetLabelForRegion","resetEventTriggerForRegion","resetTooltipForRegion","resetStateTriggerForRegion","_svgResourceChanged","_freeSVG","_useSVG","svgDispatcherMap","_svgDispatcherMap","_svgGraphicRecord","_enableBlurEntireSVG","opacity_1","geoModel","_svgMapName","geoSourceManager","getZoom","makeActionBase","_mouseDownFlag","resetForLabelLayout","mapDraw","normalStyleModel","emphasisStyleModel","blurStyleModel","selectStyleModel","selectStyle","labelXY","isDataNaN","showLabel","specifiedTextOpt","eventTrigger","geoIndex","createStream","curPoly","polygons","startPolygon","endPolygon","polygonStart","polygonEnd","lineStart","lineEnd","sphere","ring","MapView","mapModel","_mapDraw","needsDrawMap","_renderSymbols","originalData","originalDataIndex","fullData","mainSeries","fullIndex_1","MapSeries","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","geoSource","getMapType","seriesNames","otherIndex","setZoom","iconType","icon","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_transformTo","_viewRect","rawTransform","rawParent","_updateTransform","centerCoord","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","roamTransform","defaultCenter","roamTransformable","rawTransformable","_rawTransform","getViewRectAfterRoam","noRoam","getCoordSys","GEO_DEFAULT_PARAMS","invertLongitute","geo2DDimensions","Geo","_nameCoordMap","defaultParams","_invertLongitute","getRegionByCoord","addGeoCoord","getGeoCoord","projectedToPoint","unproject","pointToProjected","projected","resizeGeo","leftTop_1","rightBottom_1","projection_1","xMin","yMin","xMax","yMax","sampleLine","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","getCommonGeoProperties","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","getCenterCoord","updateCenterAndZoom","previousZoom","fixX","fixY","GeoView","_handleRegionClick","updateSelectStatus","geoId","makeAction","allSelected","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","isExpand","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","nodeScaleRatio","groupZoom","roamZoom","getNodeByDataIndex","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","rawX","__radialOldRawX","rawY","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","realRoot","rootLayout","isLeft","labelRotateRadian","focusDataIndices","getAncestorsIndices","getDescendantIndices","drawEdge","__edge","parentEl","edgeShape","getOrient","curvature","edgeForkPosition","getEdgeShape","childLayout","removeNodeEdge","removeAnimationOpt","getSourceNode","sourceEdge","layoutOpt","childNode","radialCoor1","radialCoor2","radialCoor3","radialCoor4","linkSeriesData","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","viewChildren","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","currNode","getValue","getLevelModel","levelModels","getChildIndex","isAncestorOf","isDescendantOf","Tree","_nodes","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","treeAncestors","curveness","eachAfter","eachBefore","treeLayout","commonLayout","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","installTreeAction","TreeSeries","actionTypes","installTreemapAction","handleRootToNode","originViewRoot","getViewRoot","resetViewRoot","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","emphasisTextStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","lastX","availableSize","itemNode","makeItemPoints","onclick","selfType","AnimationWrap","_storage","_elExistsMap","_finishedCallback","checkTerminate","createWrap","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z2_BASE","Z2_BG","Z2_CONTENT","getStateItemStyle","getItemStyleNormal","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","renderFinally","_doAnimation","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","focusOrIndices","renderContent","disableMorphing","useUpperLabel","processInvisible","visualBorderColor","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","isShow","addDrillDownIcon","textEmphasisState","iconChar","lasts","prepareAnimationWhenHasOld","calculateZ2","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","z2InLevel","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","travelTree","designatedVisual","viewRootAncestors","nodeLayout","thisNodeColor","nodeItemStyleModel","visuals","buildVisuals","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","score","worst","orderBy","overLeafDepth","statistic","filterByThreshold","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","TreemapSeries","treemapVisual","treemapLayout","categoryFilter","graphSeries","categoriesData","getCategoriesData","getGraph","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryIdx","categoryStyle","visualList","graphEdgeVisual","getEdgeData","getEdgeByIndex","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","n1","n2","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","simpleLayout","simpleLayoutEdge","eachEdge","graphSimpleLayout","dimensions_1","getNodeGlobalScale","_symbolRadiansHalf","circularLayout","basedOn","draggingNode","tempX","tempY","circularRotateLabel","rotateNodeLabel","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","getGraphicEl","graphCircularLayout","forceLayout","inNodes","inEdges","gravity","pp","beforeStepCallback","afterStepCallback","initialFriction","friction","warmUp","setFixed","setUnfixed","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","initLayout","nodeDataExtent_1","edgeDataExtent_1","repulsion","edgeLength","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getNodeByIndex","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","makeSymbolTypeValue","lineData","symbolSizeArr","symbolOffsetArr","__specifiedRotation","createLine","setLinePoints","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","halfPercent","tangent","specifiedRotation","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","v3","v2DistSquare","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","layoutAnimation","_startForceLayoutIteration","_layouting","getAdjacentDataIndices","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","addEdge","edgesMap","GraphEdge","outEdges","getEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","inDegree","outDegree","adjacentEdge","getTrajectoryDataIndices","connectedEdgesMap","connectedNodesMap","sourceNodesQueue","targetNodesQueue","nodeIteratorIndex","sourceNode","sourceNodes","targetNodes","createGraphDataProxyMixin","hostName","dataName","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","GraphSeriesModel","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryModel","oldGetModel","newGetModel","newPathArr","sourceName","nodeMarkup","circular","rotateLabel","edgeSymbol","edgeSymbolSize","edgeLabel","GraphSeries","PointerShape","PointerPath","parsePosition","formatLabel","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","sectors","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","textStyleX","textStyleY","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerOffsetX","pointerOffsetY","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","showPointerAbove","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","fmt","GaugeSeriesModel","GaugeSeries","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","FunnelSeriesModel","minSize","funnelAlign","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","FunnelSeries","DEFAULT_SMOOTH","ParallelView","_dataGroup","_initialized","dataGroup","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","activeState","eachActiveState","theActiveState","parallelIndex","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","parallelVisual","opacityMap","inactive","itemOpacity","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelOption","CLICK_THRESHOLD","_handlers","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","getSlidedAxisExpandWindow","behavior","axisExpandWindow","triggerOn","ParallelModel","_initDimensions","setAxisExpand","axisModels","axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","currDistSign","extentMinSpan","realExtent","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","winSize","layoutExtent","axisCount","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","dataDimensions","hasActiveSet","hasAxisBrushed","getActiveState","axisLayout","getAxisLayout","pointCoord","triggerArea","useJump","winSize2","createParallelCoordSys","parallelCoordSysCreator","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","BRUSH_PANEL_GLOBAL","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_uid","pointerHandlers","enableBrush","brushOption","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","areas","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","eventParams","_creatingPanel","thisBrushOption","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaSelectStyle","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","realtime","parallelAxisId","installParallelActions","parallelAxisModel","defaultAxisOption","ParallelSeries","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","applyCurveStyle","defaultEdgeLabelText","edgeLabelStateModels","dragX","dragY","localX","localY","curveProps","sourceColor","targetColor","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","sankeyLayout","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","edgeStyle","SankeySeries","WhiskerBoxCommonMixin","addOrdinal","xAxisType","yAxisType","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","otherAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","high","itemNameFormatter","outlier","boxplotTransform","BoxplotSeries","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","setBoxCommon","NormalBoxPathShape","NormalBoxPath","__simpleBox","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","elDoji","setLargeStyle","CandlestickSeriesModel","getShadowDim","brushRect","borderColorDoji","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","dojiBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","candlestickLayout","candleWidth","calculateCandleWidth","cDimI","vDimsI","openDimI","closeDimI","lowestDimI","highestDimI","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","hasDojiColor","getSign","makeBrushRect","pmin","pmax","CandlestickSeries","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","rippleNumber","period","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","showEffectOn","EffectScatterView","effectSymbolDraw","_updateGroupTransform","EffectScatterSeriesModel","effectType","rippleEffect","EffectScatterSeries","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","roundTrip","constantSpeed","delayExpr","_updateAnimationPoints","_getLineLength","_period","_roundTrip","delayNum","__t","_animateSymbol","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt","__lastT","_createPolyline","lineEmphasisState","EffectPolyline","_lastFrame","_lastFramePercent","accLenArr","_offsets","_length","offsets","LargeLinesPathShape","segs","LargeLinesPath","LargeLineDraw","lineEl","oldSegs","newSegs","isIncremental","linesLayout","isPolyline","lineCoords","totalCoordsCount","getLineCoordsCount","getLineCoords","LinesView","_updateLineDraw","trailLength","_lastZlevel","_showEffect","hasEffect","_hasEffet","_isPolyline","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","effect","linesVisual","LinesSeries","GRADIENT_LEVELS","HeatmapLayer","blurSize","pointSize","maxOpacity","minOpacity","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_renderOnCartesianAndCalendar","_renderOnGeo","isCartesian2d","dataDimX","dataDimY","dataToRect","contentShape","emphasisModel_1","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","HeatmapSeriesModel","HeatmapSeries","BAR_BORDER_WIDTH_QUERY","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","symbolRepeat","symbolClip","symbolPosition","symbolPatternSize","symbolRepeatDirection","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","symbolBoundingData","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","parsedSymbolSize","categorySize","unitLength","pathLen","absBoundingLength","symbolMargin","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","PictorialBarSeriesModel","PictorialBarSeries","ThemeRiverView","layersSeries","getLayerSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","textLayout","layerGroup","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","lenCount","indexArr","timeDim","layerSeries","index1","index2","getAxisTooltipData","nestestValue","nearestIdx","pointNum","theValue","singleAxisIndex","themeRiverLayout","doThemeRiverLayout","baseY0","layerPoints","singleLayer","computeBaseline","baseLine","layerIndex","sums","temp","ThemeRiverSeries","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_seriesModel","_ecModel","itemStyleModel","labelMinAngle","isNormalShown","getLabelAttr","stateAttr","labelStateModel","isShown","sectorState","labelColor","labelPadding","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","UNHIGHLIGHT_ACTION","installSunburstAction","handleHighlight","SunburstView","newRoot","renderLabelForZeroData","newChildren","oldChildren","_oldChildren","renderRollUp","virtualPiece","targetFound","SunburstSeriesModel","_levelModels","sunburstLayout","rootDepth","renderRollupNode","rPerLevel","rStart","rEnd","r0_1","r_1","radius_1","siblingAngle_1","sortOrder","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","SunburstSeries","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","customInnerStore","CustomSeriesModel","currentZLevel","currentZ","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","geoPrepareCustom","singlePrepareCustom","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","textContentStyle","srcStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","LEGACY_TRANSFORM_PROPS_MAP","LEGACY_TRANSFORM_PROPS","ELEMENT_ANIMATABLE_PROPS","transitionInnerStore","getElementAnimationConfig","elOption","animationProp","userDuring","duringCall","applyUpdateTransition","clearStyle","styleOpt","transFromProps","propsToSet","prepareTransformAllPropsFinal","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareShapeOrExtraTransitionFrom","prepareStyleTransitionFrom","applyPropsDirectly","applyMiscProps","enterFromProps_1","enterFrom","applyPropsTransition","updateLeaveTo","leaveToProps","leaveTo","applyLeaveTransition","onRemove","isTransitionAll","allPropsFinal","tmpDuringScope","transitionDuringAPI","getShape","setExtra","getExtra","latestUserDuring","scopeUserDuring","mainAttr","fromEl","attrOpt","transFromPropsInAttr","elPropsInAttr","attrTransition","transitionKeys","elVal","elPropsInAttrKeys","isNonStyleTransitionEnabled","allProps","allPropsInAttr","keysInAttr","legacyName","xyName","legacyArr","transFromStyleProps","fromElStyle","styleTransition","elTransition","animationStyleProps","styleKeys","optVal","getStateToRestore","KEYFRAME_EXCLUDE_KEYS","stopPreviousKeyframeAnimationAndRestore","applyKeyframeAnimation","animationOpts","singleAnimationOpts","stateToRestore","targetPropName","kfValues","propKeys","savedTarget","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","DEFAULT_TRANSITION","GROUP_DIFF_PREFIX","attachedTxInfoTmp","prepareCustoms","isDisplayable","copyElement","sourceEl","CustomChartView","customSeries","renderItem","makeRenderItem","createOrUpdateItem","setIncrementalAndHoverLayer","elementName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","attachedTxInfo","txCfgOpt","textOptionStyle","decalPattern","decalObj","__decalPattern","keyframeAnimation","updateElOnState","elStateOpt","elDisplayable","existingEmphasisState","optZ2","updateZForEachState","retrieveStateOption","currDataIndexInside","currItemModel","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","existsEl","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","morph","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","removeChildFromGroup","processAddUpdate","processRemove","childOption","CustomSeries","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","doUpdateProps","updatePointerEl","updateLabelEl","createPointerEl","createLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","payloadInfo","cursorPoint","tooltipOption","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","seriesDataIndices","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","records","initGlobalListeners","useHandler","dis","makeDispatchAction","dispatchTooltipFinally","pendings","initialized","doEnter","onLeave","actuallyPayload","showLen","showTip","hideLen","hideTip","currTrigger","unregister","AxisPointerView","findPointFromSeries","isStacked","axisTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","outputAxesInfo","valItem","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","PolarAxisPointer","coordValue","getLabelPosition","axisAngle","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","RadiusAxis","radiusToData","AngleAxis","angleToData","polarDimensions","Polar","_radiusAxis","_angleAxis","maxAngle","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","RadiusAxisView","newAxisGroup","layoutAxis","prevRadius","barLayoutPolar","lastStackCoords","calRadialBar","clampLayout","radiusSpan","angleSpan","angleAxisExtraOption","radiusAxisExtraOption","PolarView","directionMap","SingleAxisView","SingleAxisModel","SingleAxis","singleDimensions","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","singleModel","singles","singleCreator","XY","WH","SingleAxisPointer","getPointDimIndex","SingleView","CalendarModel","mergeAndNormalizeLayoutParams","getCellSize","cellSize","firstDay","cellSizeArr","CalendarView","calendarModel","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","getNextNDay","tl","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","formatedDate","getDateInfo","setMonth","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","getFirstDayOfWeek","dayOfWeekShort","lweek","fweek","weekText","PROXIMATE_ONE_DAY","Calendar","_rangeInfo","_sw","_sh","_orient","_firstDayOfWeek","mStr","dStr","getDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","normalizedRange","rangeStr","reversed","parsedRange","startDateNum","endDateNum","dateNum","nthDay","calendarList","calendarSeries","setKeyInfoToNewElOption","newElOption","existElOption","parentId","newElParentOption","parentOption","isSetLoc","isSet","mergeNewElOptionToExist","existList","newElOptCopy","$action","copyTransitionInfo","TRANSITION_PROPS_TO_COPY","ROOT_TRANSITION_PROPS_TO_COPY","setLayoutInfoToExist","existItem","existingGroupOpt","newGroupOpt","GraphicComponentModel","elements","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","optionList","useElOptionsToUpdate","nonShapeGraphicElements","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","globalZ","globalZLevel","elExisting","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","isMerge","isReplace","el_1","updateCommonAttrs","removeEl","el_2","textContentExisting","clipPathOption","clipPathType","newEl","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","containerInfo","layoutPos","layouted","bounding","animatePos","existElParent","defaultZ","defaultZlevel","graphicOption","graphic","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","foundNewLink","axisRecords","effectedModels","effectedModelMap","dataZoomModel","addToEffected","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","getPercentRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","SelectDataZoomModel","DataZoomView","SelectDataZoomView","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","hasPropModeValue","_dataExtent","percentExtent","percentWindow","valueWindow","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","store_1","dataDimIndices_1","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","dataZoomProcessor","eachAxisModel","proxyList","seriesModelMap","percentRange","valueRange","installDataZoomAction","installed","installCommon","SelectZoomModel","SelectZoomView","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","viewportSize","makeBackground","ToolboxView","toolboxModel","isVertical","featureOpts","_features","featureNames","_featureNames","processFeature","titleText","__title","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","featureModel","newTitle","isUserFeatureName","isToolboxFeature","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconsMap","titlesMap","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","hoverStyle","defaultTextPosition","SaveAsImage","$a","download","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","base64Encoded","bstr","decodeURIComponent","atob","filename","u8arr","blob","Blob","cw","contentWindow","doc","write","execCommand","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","isTSVFormat","firstLine","itemSplitRegex","RegExp","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","snapshots","RestoreOption","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","sizeOrigin","DATA_ZOOM_ID_BASE","DataZoomFeature","updateZoomBtnStatus","updateBackBtnStatus","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","_isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","featureDataZoomPath","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","newOpt","$fromToolbox","DataZoom","Restore","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","tooltipModel","confineOption","testStyle","styleProps","TRANSFORM_VENDOR","TRANSITION_VENDOR","toCSSVendorPrefix","styleVendor","styleProp","currentStyle","CSS_TRANSITION_VENDOR","CSS_TRANSFORM_VENDOR","gCssText","mirrorPos","assembleArrow","arrowPosition","rotateDeg","arrowPos","positionStyle","transformStyle","rotateRadian","arrowWH","rotatedWH","SQRT2","borderStyle","styleCss","assembleTransition","onlyFade","transitionCurve","transitionOption","transitionText","assembleTransform","is3d","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","zrPainter","zrViewportRoot","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_alwaysShowContent","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","_moveIfResized","nearPointColor","_longHideTimeout","styleCoord","setContent","childNodes","arrowEl","setEnterable","transforms","ratioX","ratioY","willChange","TooltipRichContent","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","_ticket","cmptRef","findComponentReference","positionDefault","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","seriesDispatcher_1","cmptDispatcher_1","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","tooltipModelCascade","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","lastCbParamsList","_cbParamsList","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","lastCbParams","modelCascade","defaultTooltipOption","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","subEl","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","layoutCovers","brushModel","brushVisual","throttleDelay","brushSelected","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","BrushView","$from","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushFeature","isBrushed","_brushMode","command","Brush","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","TimelineModel","_initData","setCurrentIndex","isIndexMax","setPlayState","autoPlay","getPlayState","processedDataArr","dataArr","_names","controlPosition","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","parsedLabelPos","labelPosOpt","playPosition","prevBtnPosition","nextBtnPosition","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","playState","makeBtn","willRotate","iconSize","btn","makeControlIcon","_handlePlayClick","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","installTimelineAction","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","itemStyleEmphasis","labelNormal","excludeLabelAttr","checkMarkerInSeries","seriesOpts","seriesOptArr","fillLabel","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","zoneFilter","item2","createMarkerDimValueGetter","inCoordSys","sum_1","count_1","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createData","coordDimsInfos","dataOpt","MarkLineModel","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInfinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList","fromData","toData","updateDataVisualAndLayout","fromSymbolKeepAspect","fromSymbolOffset","fromSymbolRotate","fromSymbolSize","toSymbolKeepAspect","toSymbolOffset","toSymbolRotate","toSymbolSize","optData","MarkAreaModel","markAreaTransform","maModel","ltCoord","rbCoord","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","pointValue0","pointValue1","clampPointValue0","clampPointValue1","pointValue","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","xPointExtent","yPointExtent","coordDimsInfos_1","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","legendNameMap","allSelect","inverseSelect","inactiveBorderColor","inactiveBorderWidth","borderCap","borderMiterLimit","inactiveWidth","cap","dashOffset","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","legendModel","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendItemModel","lineVisualStyle","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","selectorItem","emphasisLabelModel","itemVisualStyle","drawType","legendIconType","getLegendStyle","getDefaultLegendIcon","hitRect","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","handleCommonProps","propVal","iconBrushType","decalStyle","legendLineModel","visualHasBorder","symboType","isUseHoverLayer","legendFilter","legendSelectActionHandler","isToggleSelect","isItemSelected","installLegendAction","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","installScrollableLegendAction","InsideZoomModel","zoomLock","setViewInfoToCoordSysRecord","getRange","coordSysRecordMap","coordSysRecord","dzInfo","dataZoomInfoMap","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","disposeCoordSysRecord","createCoordSysRecord","containsPoint","dzReferCoordSysInfo","mergeControllerParams","typePriority","dataZoomInfo","oneType","installDataZoomRoamProcessor","apiInner","dzReferCoordSysWrap","dzCoordSysInfo","firstDzInfo","firstDzKey","controllerParams","InsideZoomView","pan","getRangeHandlers","scrollMove","lastRange","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","brushSelect","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","oldSize","_shadowSize","candlestickDim","polygonPts","_shadowPolygonPts","polylinePts","_shadowPolylinePts","_shadowData","_shadowDim","otherDataExtent_1","otherOffset","lastIsEmpty_1","otherShadowExtent_1","thisShadowExtent","areaPoints_1","linePoints_1","step_1","thisCoord_1","stride_1","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","visualDefault","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getItemSymbol","getTargetSeriesIndices","optionSeriesIndex","isTargetSeries","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","getDataDimensionIndex","optDim","completeSingle","completeInactive","stateExist","stateAbsent","optExist","optAbsent","defa","completeController","symbolExists","symbolSizeExists","itemSymbol","max_1","setSelected","getSelected","getVisualMeta","getColorVisual","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","calculable","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","currECData","hoverLinkDataSize","hoverLinkOnHandle","visualMapActionInfo","visualMapActionHander","visualMapEncodingHandlers","resultVisual","visualMapPreprocessor","pieces","splitList","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","PiecewiseView","DEFAULT_OPTION","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","paletteDecal","specifiedDecal","mergeDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","resultDecal","labelLocale","ariaLabel","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","middleSeparator_1","endSeparator_1","dataLabels","dataLabel","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","resultData","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_2","comparator","orderDef","DatasetModel","_sourceManager","DatasetView","aroundEqual","pathToBezierCurves","currentSubpath","bezierArrayGroups","createNewSubpath","addLine","addArc","c1","x4","y4","hx","hy","nextAngle","adpativeBezier","PIXEL_DISTANCE","PIXEL_DISTANCE_SQR","dx2","dy2","cp1LenSqr","cp2LenSqr","projLen1","projLen2","d1Sqr","d2Sqr","tmpSegX","tmpSegY","pathToPolygons","beziers","getDividingGrids","rowDim","rowSize","columnSize","rowCount","currentCount","divideSector","outShapes","arcLen","isAngleRow","newShape","divideRect","isHorizontalRow","rowSizeDim","columnSizeDim","columnDim","projPtOnLine","lineA","lineB","addToPoly","splitPolygonByLine","intersections","intersectionPt","projPt","splitPt0","splitPt1","splitPt0Arr","splitPt1Arr","newPolyA","newPolyB","binaryDividePolygon","polygonShape","binaryDivideRecursive","copyPathProps","polygonConvert","OutShapeCtor","polygonCount","totalArea_1","selfCount","subPath","alignSubpath","subpath1","subpath2","shorterPath","shorterBezierCount","eachCurveSubDivCount","newSubpath","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","findBestMorphingRotation","fromArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","sa","ca","newX1","newY1","isCombineMorphing","__isCombineMorphing","SAVED_METHOD_PREFIX","saveAndModifyMethod","modifiers","savedMethodName","after","restoreMethod","applyTransformOnBeziers","bezierCurves","mm","subBeziers","prepareMorphPath","fromPath","toPath","fromPathProxy","toPathProxy","fromBezierCurves","toBezierCurves","fromPathTransform","toPathTransform","updateIdentityTransform","morphingData","__morphT","newCp","x0_1","y0_1","morphPath","oldDone","oldDuring","restoreToPath","hilbert","sortPaths","defaultDividePath","createEmptyReturn","fromIndividuals","toIndividuals","combineMorph","fromList","fromPathList","addFromPath","separateCount","dividePath","toSubPathList","individualDelay","identityTransform","addToSubPathListToZr","toLen","animating_1","eachDone","indivdualAnimationOpts","separateMorph","toPathList","fromLen","isMultiple","prepareMorphBatches","many","batches","batchCount","moveFrom","pathDividers","approxOpacity","applyMorphAnimation","animateOtherProps","updateAnimationCfg","fromIsMany","morphBatches","animateCount","animateIndex","morphOneBatch","forceManyOne","batchMany","batchOne","separateAnimationCfg","individualAnimationCfg","batchFrom","batchTo","getPathList","pathList_1","DATA_COUNT_THRESHOLD","getUniversalTransitionGlobalStore","getGroupIdDimension","itemGroupId","flattenDataDiffItems","groupDim","dataGroupId","divide","fadeInElement","newSeries","computedTransform","animateElementStyles","isAllIdSame","oldDiffItems","newDiffItems","oldItem","transitionBetween","oldList","updateMorphingPathProps","rawFrom","rawTo","findKeyDim","oldKeyDim","newKeyDim","hasMorphAnimation","createKeyGetter","isOld","onlyGetId","keyDim","dimOrdinalMeta","itemVal","useId","isElementStillInChart","updateOneToOne","oldIndices","oldElsList","newElsList","newSeris","getSeriesTransitionKey","seriesKey","convertArraySeriesKeyToString","getDivideShapeFromData","findTransitionSeriesBatches","globalStore","updateBatches","oldDataMap","oldDataMapForSplit","oldSeries","oldDataGroupId","oldDataGroupIds","transitionKey","transitionKeyStr","newDataGroupId","oldSeries_1","oldData_1","querySeries","transitionSeriesFromOpt","installUniversalTransition","ecMOdel","transOpt","updateBatches_1","allSeries","savedSeries","savedDataGroupIds","savedData","_withScopeId","_hoisted_6","_hoisted_7","__name","__emit","router","drawer","imgH","proteinTable","showBar","showImg","dataHistory","routerName","protein","sortTags","proteinTags","tagsColor","imgs","myChart","tagsTotal","boxTooltips","currentRoute","getProteinTable","byteArray","queryProtein","proteins","alert","tags","dataSort","obja","objb","lena","lenb","mida","midb","neatData","samples","countSingleValue","fromDatasetIndex","tissue","rowArr","imgDataUrl","urlFile","proteinName","changeShow","_component_el_switch","_component_el_tag","_component_el_text","_component_el_image","_component_el_tabs","_component_el_drawer","$event","onClose","fit","__exports__","configProviderContextKey","globalConfig","useGlobalConfig","useGlobalComponentSettings","sizeFallback","provideGlobalConfig","app","inSetup","oldConfig","provideFn","provide","mergeConfig","Set","formContextKey","formItemContextKey","useProp","useFormSize","fallback","emptyRef","form","useFormDisabled","useFormItem","useFormItemInputId","disableIdGeneration","disableIdManagement","idUnwatch","isLabeledByFormItem","inputIds","disableIdGeneration2","newId","removeInputId","addInputId","textProps","truncated","lineClamp","textKls","Text","ElText","UPDATE_MODEL_EVENT","CHANGE_EVENT","INPUT_EVENT","componentSizes","componentSizeMap","small","defaultIdInjection","ID_INJECTION_KEY","useIdInjection","deterministicId","idInjection","idRef","useSizeProp","required","SIZE_INJECTION_KEY","useGlobalSize","injectedSize","isNil"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/145.354ab71d.js","mappings":"+pCAEA,MAAMA,EAAiBC,IACrB,IAAKA,EACH,MAAO,CAAEC,QAAS,KAAMC,YAAa,KAAMC,UAAW,MAExD,IAAIC,GAAkB,EAClBC,GAAgB,EACpB,MAAMJ,EAAWK,IACXF,GAAmBC,GACrBL,EAAYM,GAEdF,EAAkBC,GAAgB,CAAK,EAEnCH,EAAeI,IACnBF,EAAkBE,EAAEC,SAAWD,EAAEE,aAAa,EAE1CL,EAAaG,IACjBD,EAAgBC,EAAEC,SAAWD,EAAEE,aAAa,EAE9C,MAAO,CAAEP,UAASC,cAAaC,YAAW,ECd5C,IAAIM,EAA6B,CAAEC,IACjCA,EAAYA,EAAY,QAAU,GAAK,OACvCA,EAAYA,EAAY,SAAW,GAAK,QACxCA,EAAYA,EAAY,SAAW,GAAK,QACxCA,EAAYA,EAAY,SAAW,G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/use-same-target/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/utils/vue/vnode.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/overlay/src/overlay.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/overlay/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/dialog-content.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/dialog.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/src/drawer.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-lockscreen/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/dialog/src/use-dialog.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/src/drawer2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/drawer/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-bar.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-bar2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-nav.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-ordered-children/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tabs.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-pane.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/src/tab-pane2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/tabs/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/src/switch.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/src/switch2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/switch/index.mjs","webpack://quantms.org/./src/api/search.js","webpack://quantms.org/./node_modules/pako/dist/pako.esm.mjs","webpack://quantms.org/./node_modules/tslib/tslib.es6.js","webpack://quantms.org/./node_modules/zrender/lib/core/env.js","webpack://quantms.org/./node_modules/zrender/lib/core/platform.js","webpack://quantms.org/./node_modules/zrender/lib/core/util.js","webpack://quantms.org/./node_modules/zrender/lib/core/vector.js","webpack://quantms.org/./node_modules/zrender/lib/mixin/Draggable.js","webpack://quantms.org/./node_modules/zrender/lib/core/Eventful.js","webpack://quantms.org/./node_modules/zrender/lib/core/fourPointsTransform.js","webpack://quantms.org/./node_modules/zrender/lib/core/dom.js","webpack://quantms.org/./node_modules/zrender/lib/core/event.js","webpack://quantms.org/./node_modules/zrender/lib/core/GestureMgr.js","webpack://quantms.org/./node_modules/zrender/lib/core/matrix.js","webpack://quantms.org/./node_modules/zrender/lib/core/Point.js","webpack://quantms.org/./node_modules/zrender/lib/core/BoundingRect.js","webpack://quantms.org/./node_modules/zrender/lib/Handler.js","webpack://quantms.org/./node_modules/zrender/lib/core/timsort.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/constants.js","webpack://quantms.org/./node_modules/zrender/lib/Storage.js","webpack://quantms.org/./node_modules/zrender/lib/animation/requestAnimationFrame.js","webpack://quantms.org/./node_modules/zrender/lib/animation/easing.js","webpack://quantms.org/./node_modules/zrender/lib/core/curve.js","webpack://quantms.org/./node_modules/zrender/lib/animation/cubicEasing.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Clip.js","webpack://quantms.org/./node_modules/zrender/lib/core/LRU.js","webpack://quantms.org/./node_modules/zrender/lib/tool/color.js","webpack://quantms.org/./node_modules/zrender/lib/svg/helper.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Animator.js","webpack://quantms.org/./node_modules/zrender/lib/animation/Animation.js","webpack://quantms.org/./node_modules/zrender/lib/dom/HandlerProxy.js","webpack://quantms.org/./node_modules/zrender/lib/config.js","webpack://quantms.org/./node_modules/zrender/lib/core/Transformable.js","webpack://quantms.org/./node_modules/zrender/lib/contain/text.js","webpack://quantms.org/./node_modules/zrender/lib/Element.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Group.js","webpack://quantms.org/./node_modules/zrender/lib/zrender.js","webpack://quantms.org/./node_modules/echarts/lib/util/number.js","webpack://quantms.org/./node_modules/echarts/lib/util/model.js","webpack://quantms.org/./node_modules/echarts/lib/util/clazz.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/makeStyleMapper.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/areaStyle.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/image.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/parseText.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Displayable.js","webpack://quantms.org/./node_modules/zrender/lib/core/bbox.js","webpack://quantms.org/./node_modules/zrender/lib/core/PathProxy.js","webpack://quantms.org/./node_modules/zrender/lib/contain/line.js","webpack://quantms.org/./node_modules/zrender/lib/contain/cubic.js","webpack://quantms.org/./node_modules/zrender/lib/contain/quadratic.js","webpack://quantms.org/./node_modules/zrender/lib/contain/util.js","webpack://quantms.org/./node_modules/zrender/lib/contain/arc.js","webpack://quantms.org/./node_modules/zrender/lib/contain/windingLine.js","webpack://quantms.org/./node_modules/zrender/lib/contain/path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/TSpan.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Image.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/roundRect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Rect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Text.js","webpack://quantms.org/./node_modules/echarts/lib/util/innerStore.js","webpack://quantms.org/./node_modules/echarts/lib/util/states.js","webpack://quantms.org/./node_modules/echarts/lib/animation/basicTransition.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/textStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/lineStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/itemStyle.js","webpack://quantms.org/./node_modules/echarts/lib/model/Model.js","webpack://quantms.org/./node_modules/echarts/lib/util/component.js","webpack://quantms.org/./node_modules/echarts/lib/i18n/langEN.js","webpack://quantms.org/./node_modules/echarts/lib/i18n/langZH.js","webpack://quantms.org/./node_modules/echarts/lib/core/locale.js","webpack://quantms.org/./node_modules/echarts/lib/util/time.js","webpack://quantms.org/./node_modules/echarts/lib/util/format.js","webpack://quantms.org/./node_modules/echarts/lib/util/layout.js","webpack://quantms.org/./node_modules/echarts/lib/model/Component.js","webpack://quantms.org/./node_modules/echarts/lib/model/globalDefault.js","webpack://quantms.org/./node_modules/echarts/lib/util/types.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/sourceHelper.js","webpack://quantms.org/./node_modules/echarts/lib/model/internalComponentCreator.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/palette.js","webpack://quantms.org/./node_modules/echarts/lib/model/Global.js","webpack://quantms.org/./node_modules/echarts/lib/core/ExtensionAPI.js","webpack://quantms.org/./node_modules/echarts/lib/core/CoordinateSystem.js","webpack://quantms.org/./node_modules/echarts/lib/model/OptionManager.js","webpack://quantms.org/./node_modules/echarts/lib/preprocessor/helper/compatStyle.js","webpack://quantms.org/./node_modules/echarts/lib/preprocessor/backwardCompat.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataStack.js","webpack://quantms.org/./node_modules/echarts/lib/data/Source.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataProvider.js","webpack://quantms.org/./node_modules/echarts/lib/model/mixin/dataFormat.js","webpack://quantms.org/./node_modules/echarts/lib/core/task.js","webpack://quantms.org/./node_modules/echarts/lib/util/log.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataValueHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/transform.js","webpack://quantms.org/./node_modules/echarts/lib/data/DataStore.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/sourceManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/tooltipMarkup.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/seriesFormatTooltip.js","webpack://quantms.org/./node_modules/echarts/lib/model/Series.js","webpack://quantms.org/./node_modules/echarts/lib/view/Component.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createRenderPlanner.js","webpack://quantms.org/./node_modules/zrender/lib/tool/transformPath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/path.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Circle.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Ellipse.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/roundSector.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Sector.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Ring.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/smoothBezier.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/helper/poly.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Polygon.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Polyline.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Line.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/BezierCurve.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/shape/Arc.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/CompoundPath.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/Gradient.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/LinearGradient.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/RadialGradient.js","webpack://quantms.org/./node_modules/zrender/lib/core/OrientedBoundingRect.js","webpack://quantms.org/./node_modules/zrender/lib/graphic/IncrementalDisplayable.js","webpack://quantms.org/./node_modules/echarts/lib/util/graphic.js","webpack://quantms.org/./node_modules/echarts/lib/view/Chart.js","webpack://quantms.org/./node_modules/echarts/lib/util/throttle.js","webpack://quantms.org/./node_modules/echarts/lib/visual/style.js","webpack://quantms.org/./node_modules/echarts/lib/loading/default.js","webpack://quantms.org/./node_modules/echarts/lib/core/Scheduler.js","webpack://quantms.org/./node_modules/echarts/lib/theme/light.js","webpack://quantms.org/./node_modules/echarts/lib/theme/dark.js","webpack://quantms.org/./node_modules/echarts/lib/util/ECEventProcessor.js","webpack://quantms.org/./node_modules/echarts/lib/visual/symbol.js","webpack://quantms.org/./node_modules/echarts/lib/visual/helper.js","webpack://quantms.org/./node_modules/echarts/lib/legacy/dataSelectAction.js","webpack://quantms.org/./node_modules/echarts/lib/util/event.js","webpack://quantms.org/./node_modules/zrender/lib/core/WeakMap.js","webpack://quantms.org/./node_modules/echarts/lib/util/symbol.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/helper.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/dashStyle.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/graphic.js","webpack://quantms.org/./node_modules/echarts/lib/util/decal.js","webpack://quantms.org/./node_modules/echarts/lib/visual/decal.js","webpack://quantms.org/./node_modules/echarts/lib/core/lifecycle.js","webpack://quantms.org/./node_modules/echarts/lib/core/impl.js","webpack://quantms.org/./node_modules/echarts/lib/core/echarts.js","webpack://quantms.org/./node_modules/echarts/lib/extension.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelGuideHelper.js","webpack://quantms.org/./node_modules/echarts/lib/label/labelLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/label/LabelManager.js","webpack://quantms.org/./node_modules/echarts/lib/label/installLabelLayout.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/Layer.js","webpack://quantms.org/./node_modules/echarts/lib/export/core.js","webpack://quantms.org/./node_modules/zrender/lib/canvas/Painter.js","webpack://quantms.org/./node_modules/echarts/lib/renderer/installCanvasRenderer.js","webpack://quantms.org/./node_modules/zrender/lib/svg/SVGPathRebuilder.js","webpack://quantms.org/./node_modules/zrender/lib/svg/mapStyleToAttrs.js","webpack://quantms.org/./node_modules/zrender/lib/svg/core.js","webpack://quantms.org/./node_modules/zrender/lib/svg/cssAnimation.js","webpack://quantms.org/./node_modules/zrender/lib/svg/graphic.js","webpack://quantms.org/./node_modules/zrender/lib/svg/domapi.js","webpack://quantms.org/./node_modules/zrender/lib/svg/patch.js","webpack://quantms.org/./node_modules/zrender/lib/svg/Painter.js","webpack://quantms.org/./node_modules/echarts/lib/renderer/installSVGRenderer.js","webpack://quantms.org/./node_modules/echarts/lib/data/DataDiffer.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dimensionHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/SeriesDimensionDefine.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/SeriesDataSchema.js","webpack://quantms.org/./node_modules/echarts/lib/data/SeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/createDimensions.js","webpack://quantms.org/./node_modules/echarts/lib/model/referHelper.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/dataStackHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createSeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/LineSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/labelHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Symbol.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/SymbolDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/helper.js","webpack://quantms.org/./node_modules/echarts/lib/util/vendor.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/lineAnimationDiff.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/poly.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createClipPathFromCoordSys.js","webpack://quantms.org/./node_modules/echarts/lib/coord/CoordinateSystem.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/LineView.js","webpack://quantms.org/./node_modules/echarts/lib/layout/points.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataSample.js","webpack://quantms.org/./node_modules/echarts/lib/chart/line/install.js","webpack://quantms.org/./node_modules/echarts/lib/layout/barGrid.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BaseBarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/util/shape/sausage.js","webpack://quantms.org/./node_modules/echarts/lib/label/sectorLabel.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/sectorHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/BarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/pieLayout.js","webpack://quantms.org/./node_modules/echarts/lib/processor/dataFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/labelLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/PieView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createSeriesDataSimply.js","webpack://quantms.org/./node_modules/echarts/lib/visual/LegendVisualProvider.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/PieSeries.js","webpack://quantms.org/./node_modules/echarts/lib/processor/negativeDataFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/pie/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/ScatterSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LargeSymbolDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/ScatterView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/GridModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisModelCommonMixin.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisDefault.js","webpack://quantms.org/./node_modules/echarts/lib/data/OrdinalMeta.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisCommonTypes.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisModelCreator.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Scale.js","webpack://quantms.org/./node_modules/echarts/lib/scale/helper.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Ordinal.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Interval.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Time.js","webpack://quantms.org/./node_modules/echarts/lib/scale/Log.js","webpack://quantms.org/./node_modules/echarts/lib/coord/scaleRawExtentInfo.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Cartesian.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Cartesian2D.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisTickLabelBuilder.js","webpack://quantms.org/./node_modules/echarts/lib/coord/Axis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Axis2D.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/coord/axisAlignTicks.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/Grid.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AxisBuilder.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/modelHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/axisSplitHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/CartesianAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/grid/installSimple.js","webpack://quantms.org/./node_modules/echarts/lib/chart/scatter/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/radarLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/backwardCompat.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/RadarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/RadarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/RadarModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/radar/RadarView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/IndicatorAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/radar/Radar.js","webpack://quantms.org/./node_modules/echarts/lib/component/radar/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/radar/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/interactionMutex.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/RoamController.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/roamHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/cursorHelper.js","webpack://quantms.org/./node_modules/zrender/lib/tool/parseSVG.js","webpack://quantms.org/./node_modules/zrender/lib/tool/parseXML.js","webpack://quantms.org/./node_modules/zrender/lib/contain/polygon.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/Region.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoSVGResource.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/parseGeoJson.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/nanhai.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/textCoord.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoJSONResource.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/geoSourceManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/MapDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/MapView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/MapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/mapDataStatistic.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/mapSymbolLayout.js","webpack://quantms.org/./node_modules/echarts/lib/coord/View.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/Geo.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/geoCreator.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/GeoModel.js","webpack://quantms.org/./node_modules/echarts/lib/action/roamHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/geo/GeoView.js","webpack://quantms.org/./node_modules/echarts/lib/component/geo/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/map/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/layoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/TreeView.js","webpack://quantms.org/./node_modules/echarts/lib/data/helper/linkSeriesData.js","webpack://quantms.org/./node_modules/echarts/lib/data/Tree.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/treeHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/TreeSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/traversalHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/treeAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/tree/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/enableAriaDecalForTree.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/TreemapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/Breadcrumb.js","webpack://quantms.org/./node_modules/echarts/lib/util/animation.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/TreemapView.js","webpack://quantms.org/./node_modules/echarts/lib/visual/VisualMapping.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/treemapLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/treemap/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/categoryFilter.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/categoryVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/edgeVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/multipleGraphEdgeHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/simpleLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/graphHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/circularLayoutHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/circularLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/forceHelper.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/forceLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/createView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LinePath.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Line.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LineDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/adjustEdge.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/GraphView.js","webpack://quantms.org/./node_modules/echarts/lib/data/Graph.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/GraphSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/graph/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/PointerPath.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/GaugeView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/GaugeSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/gauge/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/FunnelView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/FunnelSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/funnelLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/funnel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/ParallelView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/ParallelSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/parallelVisual.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/parallel/ParallelView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/ParallelModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/ParallelAxis.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/sliderMove.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/Parallel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/parallelCreator.js","webpack://quantms.org/./node_modules/echarts/lib/coord/parallel/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/BrushController.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/brushHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/ParallelAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/parallelAxisAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/parallel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/parallel/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/SankeyView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/SankeySeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/sankeyLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/sankeyVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sankey/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/BoxplotSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/BoxplotView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/boxplotLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/prepareBoxplotData.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/boxplotTransform.js","webpack://quantms.org/./node_modules/echarts/lib/chart/boxplot/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/CandlestickView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/CandlestickSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/candlestickVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/candlestickLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/candlestick/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectSymbol.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/EffectScatterView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/EffectScatterSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/effectScatter/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectLine.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/Polyline.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/EffectPolyline.js","webpack://quantms.org/./node_modules/echarts/lib/chart/helper/LargeLineDraw.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/linesLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/LinesView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/LinesSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/linesVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/lines/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapLayer.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/HeatmapSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/heatmap/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/PictorialBarView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/PictorialBarSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/bar/installPictorialBar.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/ThemeRiverView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/ThemeRiverSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/themeRiverLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/themeRiver/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstPiece.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstAction.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/SunburstSeries.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstLayout.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/sunburstVisual.js","webpack://quantms.org/./node_modules/echarts/lib/chart/sunburst/install.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/CustomSeries.js","webpack://quantms.org/./node_modules/echarts/lib/coord/cartesian/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/geo/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/prepareCustom.js","webpack://quantms.org/./node_modules/echarts/lib/util/styleCompat.js","webpack://quantms.org/./node_modules/echarts/lib/animation/customGraphicTransition.js","webpack://quantms.org/./node_modules/echarts/lib/animation/customGraphicKeyframeAnimation.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/CustomView.js","webpack://quantms.org/./node_modules/echarts/lib/chart/custom/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/BaseAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/viewHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/AxisPointerModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/globalListener.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/AxisPointerView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/axisTrigger.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/grid/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/PolarAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/PolarModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/RadiusAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/AngleAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/Polar.js","webpack://quantms.org/./node_modules/echarts/lib/coord/polar/polarCreator.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/AngleAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/RadiusAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/layout/barPolar.js","webpack://quantms.org/./node_modules/echarts/lib/component/polar/install.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/singleAxisHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/axis/SingleAxisView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/AxisModel.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/SingleAxis.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/Single.js","webpack://quantms.org/./node_modules/echarts/lib/coord/single/singleCreator.js","webpack://quantms.org/./node_modules/echarts/lib/component/axisPointer/SingleAxisPointer.js","webpack://quantms.org/./node_modules/echarts/lib/component/singleAxis/install.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/CalendarModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/calendar/CalendarView.js","webpack://quantms.org/./node_modules/echarts/lib/coord/calendar/Calendar.js","webpack://quantms.org/./node_modules/echarts/lib/component/calendar/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/GraphicModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/GraphicView.js","webpack://quantms.org/./node_modules/echarts/lib/component/graphic/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/DataZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SelectZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/DataZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SelectZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/AxisProxy.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/dataZoomAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installCommon.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomSelect.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/featureManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/ToolboxModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/listComponent.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/ToolboxView.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/SaveAsImage.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/MagicType.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/DataView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/history.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/Restore.js","webpack://quantms.org/./node_modules/echarts/lib/component/helper/BrushTargetManager.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/DataZoom.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipHTMLContent.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipRichContent.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/TooltipView.js","webpack://quantms.org/./node_modules/echarts/lib/component/tooltip/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/visual/visualSolution.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/selector.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/visualEncoding.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/BrushView.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/BrushModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/toolbox/feature/Brush.js","webpack://quantms.org/./node_modules/echarts/lib/component/brush/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/title/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/SliderTimelineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/TimelineAxis.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/SliderTimelineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/timelineAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/timeline/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/checkMarkerInSeries.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkerModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkPointModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/markerHelper.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkerView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkPointView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkPoint.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkLineModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkLineView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkLine.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkAreaModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/MarkAreaView.js","webpack://quantms.org/./node_modules/echarts/lib/component/marker/installMarkArea.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/LegendModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/LegendView.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/legendFilter.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/legendAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/installLegendPlain.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/ScrollableLegendModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/ScrollableLegendView.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/scrollableLegendAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/installLegendScroll.js","webpack://quantms.org/./node_modules/echarts/lib/component/legend/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/InsideZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/roams.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/InsideZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomInside.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SliderZoomModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/SliderZoomView.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/installDataZoomSlider.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataZoom/install.js","webpack://quantms.org/./node_modules/echarts/lib/visual/visualDefault.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/VisualMapModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/ContinuousModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/VisualMapView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/helper.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/ContinuousView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/visualMapAction.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/visualEncoding.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installCommon.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installVisualMapContinuous.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/PiecewiseModel.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/PiecewiseView.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/installVisualMapPiecewise.js","webpack://quantms.org/./node_modules/echarts/lib/component/visualMap/install.js","webpack://quantms.org/./node_modules/echarts/lib/visual/aria.js","webpack://quantms.org/./node_modules/echarts/lib/component/aria/preprocessor.js","webpack://quantms.org/./node_modules/echarts/lib/component/aria/install.js","webpack://quantms.org/./node_modules/echarts/lib/util/conditionalExpression.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/filterTransform.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/sortTransform.js","webpack://quantms.org/./node_modules/echarts/lib/component/transform/install.js","webpack://quantms.org/./node_modules/echarts/lib/component/dataset/install.js","webpack://quantms.org/./node_modules/zrender/lib/tool/convertPath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/dividePath.js","webpack://quantms.org/./node_modules/zrender/lib/tool/morphPath.js","webpack://quantms.org/./node_modules/echarts/lib/animation/morphTransitionHelper.js","webpack://quantms.org/./node_modules/echarts/lib/animation/universalTransition.js","webpack://quantms.org/./node_modules/echarts/index.js","webpack://quantms.org/./src/components/AeShow/index.vue","webpack://quantms.org/./src/components/AeShow/index.vue?7d9f","webpack://quantms.org/./node_modules/element-plus/es/components/config-provider/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/config-provider/src/hooks/use-global-config.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/constants.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-prop/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/hooks/use-form-common-props.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/form/src/hooks/use-form-item.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/src/text.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/src/text2.mjs","webpack://quantms.org/./node_modules/element-plus/es/components/text/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/constants/event.mjs","webpack://quantms.org/./node_modules/element-plus/es/constants/size.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-id/index.mjs","webpack://quantms.org/./node_modules/element-plus/es/hooks/use-size/index.mjs","webpack://quantms.org/./node_modules/lodash-es/isNil.js"],"sourcesContent":["import { NOOP } from '@vue/shared';\n\nconst useSameTarget = (handleClick) => {\n if (!handleClick) {\n return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };\n }\n let mousedownTarget = false;\n let mouseupTarget = false;\n const onClick = (e) => {\n if (mousedownTarget && mouseupTarget) {\n handleClick(e);\n }\n mousedownTarget = mouseupTarget = false;\n };\n const onMousedown = (e) => {\n mousedownTarget = e.target === e.currentTarget;\n };\n const onMouseup = (e) => {\n mouseupTarget = e.target === e.currentTarget;\n };\n return { onClick, onMousedown, onMouseup };\n};\n\nexport { useSameTarget };\n//# sourceMappingURL=index.mjs.map\n","import { isVNode, Fragment, Text, Comment, openBlock, createBlock, createCommentVNode } from 'vue';\nimport { hasOwn, camelize, isArray } from '@vue/shared';\nimport '../objects.mjs';\nimport { debugWarn } from '../error.mjs';\n\nconst SCOPE = \"utils/vue/vnode\";\nvar PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {\n PatchFlags2[PatchFlags2[\"TEXT\"] = 1] = \"TEXT\";\n PatchFlags2[PatchFlags2[\"CLASS\"] = 2] = \"CLASS\";\n PatchFlags2[PatchFlags2[\"STYLE\"] = 4] = \"STYLE\";\n PatchFlags2[PatchFlags2[\"PROPS\"] = 8] = \"PROPS\";\n PatchFlags2[PatchFlags2[\"FULL_PROPS\"] = 16] = \"FULL_PROPS\";\n PatchFlags2[PatchFlags2[\"HYDRATE_EVENTS\"] = 32] = \"HYDRATE_EVENTS\";\n PatchFlags2[PatchFlags2[\"STABLE_FRAGMENT\"] = 64] = \"STABLE_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"KEYED_FRAGMENT\"] = 128] = \"KEYED_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"UNKEYED_FRAGMENT\"] = 256] = \"UNKEYED_FRAGMENT\";\n PatchFlags2[PatchFlags2[\"NEED_PATCH\"] = 512] = \"NEED_PATCH\";\n PatchFlags2[PatchFlags2[\"DYNAMIC_SLOTS\"] = 1024] = \"DYNAMIC_SLOTS\";\n PatchFlags2[PatchFlags2[\"HOISTED\"] = -1] = \"HOISTED\";\n PatchFlags2[PatchFlags2[\"BAIL\"] = -2] = \"BAIL\";\n return PatchFlags2;\n})(PatchFlags || {});\nfunction isFragment(node) {\n return isVNode(node) && node.type === Fragment;\n}\nfunction isText(node) {\n return isVNode(node) && node.type === Text;\n}\nfunction isComment(node) {\n return isVNode(node) && node.type === Comment;\n}\nconst TEMPLATE = \"template\";\nfunction isTemplate(node) {\n return isVNode(node) && node.type === TEMPLATE;\n}\nfunction isValidElementNode(node) {\n return isVNode(node) && !isFragment(node) && !isComment(node);\n}\nfunction getChildren(node, depth) {\n if (isComment(node))\n return;\n if (isFragment(node) || isTemplate(node)) {\n return depth > 0 ? getFirstValidNode(node.children, depth - 1) : void 0;\n }\n return node;\n}\nconst getFirstValidNode = (nodes, maxDepth = 3) => {\n if (Array.isArray(nodes)) {\n return getChildren(nodes[0], maxDepth);\n } else {\n return getChildren(nodes, maxDepth);\n }\n};\nfunction renderIf(condition, ...args) {\n return condition ? renderBlock(...args) : createCommentVNode(\"v-if\", true);\n}\nfunction renderBlock(...args) {\n return openBlock(), createBlock(...args);\n}\nconst getNormalizedProps = (node) => {\n if (!isVNode(node)) {\n debugWarn(SCOPE, \"[getNormalizedProps] must be a VNode\");\n return {};\n }\n const raw = node.props || {};\n const type = (isVNode(node.type) ? node.type.props : void 0) || {};\n const props = {};\n Object.keys(type).forEach((key) => {\n if (hasOwn(type[key], \"default\")) {\n props[key] = type[key].default;\n }\n });\n Object.keys(raw).forEach((key) => {\n props[camelize(key)] = raw[key];\n });\n return props;\n};\nconst ensureOnlyChild = (children) => {\n if (!isArray(children) || children.length > 1) {\n throw new Error(\"expect to receive a single Vue element child\");\n }\n return children[0];\n};\nconst flattedChildren = (children) => {\n const vNodes = isArray(children) ? children : [children];\n const result = [];\n vNodes.forEach((child) => {\n var _a;\n if (isArray(child)) {\n result.push(...flattedChildren(child));\n } else if (isVNode(child) && isArray(child.children)) {\n result.push(...flattedChildren(child.children));\n } else {\n result.push(child);\n if (isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) {\n result.push(...flattedChildren(child.component.subTree));\n }\n }\n });\n return result;\n};\n\nexport { PatchFlags, ensureOnlyChild, flattedChildren, getFirstValidNode, getNormalizedProps, isComment, isFragment, isTemplate, isText, isValidElementNode, renderBlock, renderIf };\n//# sourceMappingURL=vnode.mjs.map\n","import { defineComponent, createVNode, renderSlot, h } from 'vue';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useSameTarget } from '../../../hooks/use-same-target/index.mjs';\nimport { PatchFlags } from '../../../utils/vue/vnode.mjs';\n\nconst overlayProps = buildProps({\n mask: {\n type: Boolean,\n default: true\n },\n customMaskEvent: {\n type: Boolean,\n default: false\n },\n overlayClass: {\n type: definePropType([\n String,\n Array,\n Object\n ])\n },\n zIndex: {\n type: definePropType([String, Number])\n }\n});\nconst overlayEmits = {\n click: (evt) => evt instanceof MouseEvent\n};\nconst BLOCK = \"overlay\";\nvar Overlay = defineComponent({\n name: \"ElOverlay\",\n props: overlayProps,\n emits: overlayEmits,\n setup(props, { slots, emit }) {\n const ns = useNamespace(BLOCK);\n const onMaskClick = (e) => {\n emit(\"click\", e);\n };\n const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);\n return () => {\n return props.mask ? createVNode(\"div\", {\n class: [ns.b(), props.overlayClass],\n style: {\n zIndex: props.zIndex\n },\n onClick,\n onMousedown,\n onMouseup\n }, [renderSlot(slots, \"default\")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, [\"onClick\", \"onMouseup\", \"onMousedown\"]) : h(\"div\", {\n class: props.overlayClass,\n style: {\n zIndex: props.zIndex,\n position: \"fixed\",\n top: \"0px\",\n right: \"0px\",\n bottom: \"0px\",\n left: \"0px\"\n }\n }, [renderSlot(slots, \"default\")]);\n };\n }\n});\n\nexport { Overlay as default, overlayEmits, overlayProps };\n//# sourceMappingURL=overlay.mjs.map\n","import Overlay from './src/overlay.mjs';\nexport { overlayEmits, overlayProps } from './src/overlay.mjs';\n\nconst ElOverlay = Overlay;\n\nexport { ElOverlay, ElOverlay as default };\n//# sourceMappingURL=index.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\n\nconst dialogContentProps = buildProps({\n center: Boolean,\n alignCenter: Boolean,\n closeIcon: {\n type: iconPropType\n },\n customClass: {\n type: String,\n default: \"\"\n },\n draggable: Boolean,\n fullscreen: Boolean,\n showClose: {\n type: Boolean,\n default: true\n },\n title: {\n type: String,\n default: \"\"\n },\n ariaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst dialogContentEmits = {\n close: () => true\n};\n\nexport { dialogContentEmits, dialogContentProps };\n//# sourceMappingURL=dialog-content.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { dialogContentProps } from './dialog-content.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { isBoolean } from '../../../utils/types.mjs';\n\nconst dialogProps = buildProps({\n ...dialogContentProps,\n appendToBody: Boolean,\n appendTo: {\n type: definePropType(String),\n default: \"body\"\n },\n beforeClose: {\n type: definePropType(Function)\n },\n destroyOnClose: Boolean,\n closeOnClickModal: {\n type: Boolean,\n default: true\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true\n },\n lockScroll: {\n type: Boolean,\n default: true\n },\n modal: {\n type: Boolean,\n default: true\n },\n openDelay: {\n type: Number,\n default: 0\n },\n closeDelay: {\n type: Number,\n default: 0\n },\n top: {\n type: String\n },\n modelValue: Boolean,\n modalClass: String,\n width: {\n type: [String, Number]\n },\n zIndex: {\n type: Number\n },\n trapFocus: {\n type: Boolean,\n default: false\n },\n headerAriaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst dialogEmits = {\n open: () => true,\n opened: () => true,\n close: () => true,\n closed: () => true,\n [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),\n openAutoFocus: () => true,\n closeAutoFocus: () => true\n};\n\nexport { dialogEmits, dialogProps };\n//# sourceMappingURL=dialog.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../dialog/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { dialogProps, dialogEmits } from '../../dialog/src/dialog.mjs';\n\nconst drawerProps = buildProps({\n ...dialogProps,\n direction: {\n type: String,\n default: \"rtl\",\n values: [\"ltr\", \"rtl\", \"ttb\", \"btt\"]\n },\n size: {\n type: [String, Number],\n default: \"30%\"\n },\n withHeader: {\n type: Boolean,\n default: true\n },\n modalFade: {\n type: Boolean,\n default: true\n },\n headerAriaLevel: {\n type: String,\n default: \"2\"\n }\n});\nconst drawerEmits = dialogEmits;\n\nexport { drawerEmits, drawerProps };\n//# sourceMappingURL=drawer.mjs.map\n","import { isRef, watch, onScopeDispose } from 'vue';\nimport { computed } from '@vue/reactivity';\nimport '../../utils/index.mjs';\nimport { useNamespace } from '../use-namespace/index.mjs';\nimport { throwError } from '../../utils/error.mjs';\nimport { isClient } from '@vueuse/core';\nimport { hasClass, removeClass, getStyle, addClass } from '../../utils/dom/style.mjs';\nimport { getScrollBarWidth } from '../../utils/dom/scroll.mjs';\n\nconst useLockscreen = (trigger, options = {}) => {\n if (!isRef(trigger)) {\n throwError(\"[useLockscreen]\", \"You need to pass a ref param to this function\");\n }\n const ns = options.ns || useNamespace(\"popup\");\n const hiddenCls = computed(() => ns.bm(\"parent\", \"hidden\"));\n if (!isClient || hasClass(document.body, hiddenCls.value)) {\n return;\n }\n let scrollBarWidth = 0;\n let withoutHiddenClass = false;\n let bodyWidth = \"0\";\n const cleanup = () => {\n setTimeout(() => {\n removeClass(document == null ? void 0 : document.body, hiddenCls.value);\n if (withoutHiddenClass && document) {\n document.body.style.width = bodyWidth;\n }\n }, 200);\n };\n watch(trigger, (val) => {\n if (!val) {\n cleanup();\n return;\n }\n withoutHiddenClass = !hasClass(document.body, hiddenCls.value);\n if (withoutHiddenClass) {\n bodyWidth = document.body.style.width;\n }\n scrollBarWidth = getScrollBarWidth(ns.namespace.value);\n const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;\n const bodyOverflowY = getStyle(document.body, \"overflowY\");\n if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === \"scroll\") && withoutHiddenClass) {\n document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;\n }\n addClass(document.body, hiddenCls.value);\n });\n onScopeDispose(() => cleanup());\n};\n\nexport { useLockscreen };\n//# sourceMappingURL=index.mjs.map\n","import { getCurrentInstance, ref, computed, watch, nextTick, onMounted } from 'vue';\nimport { useTimeoutFn, isClient } from '@vueuse/core';\nimport { isUndefined } from 'lodash-unified';\nimport '../../../hooks/index.mjs';\nimport '../../../constants/index.mjs';\nimport '../../../utils/index.mjs';\nimport '../../config-provider/index.mjs';\nimport { useZIndex } from '../../../hooks/use-z-index/index.mjs';\nimport { useId } from '../../../hooks/use-id/index.mjs';\nimport { useGlobalConfig } from '../../config-provider/src/hooks/use-global-config.mjs';\nimport { defaultNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { useLockscreen } from '../../../hooks/use-lockscreen/index.mjs';\n\nconst useDialog = (props, targetRef) => {\n var _a;\n const instance = getCurrentInstance();\n const emit = instance.emit;\n const { nextZIndex } = useZIndex();\n let lastPosition = \"\";\n const titleId = useId();\n const bodyId = useId();\n const visible = ref(false);\n const closed = ref(false);\n const rendered = ref(false);\n const zIndex = ref((_a = props.zIndex) != null ? _a : nextZIndex());\n let openTimer = void 0;\n let closeTimer = void 0;\n const namespace = useGlobalConfig(\"namespace\", defaultNamespace);\n const style = computed(() => {\n const style2 = {};\n const varPrefix = `--${namespace.value}-dialog`;\n if (!props.fullscreen) {\n if (props.top) {\n style2[`${varPrefix}-margin-top`] = props.top;\n }\n if (props.width) {\n style2[`${varPrefix}-width`] = addUnit(props.width);\n }\n }\n return style2;\n });\n const overlayDialogStyle = computed(() => {\n if (props.alignCenter) {\n return { display: \"flex\" };\n }\n return {};\n });\n function afterEnter() {\n emit(\"opened\");\n }\n function afterLeave() {\n emit(\"closed\");\n emit(UPDATE_MODEL_EVENT, false);\n if (props.destroyOnClose) {\n rendered.value = false;\n }\n }\n function beforeLeave() {\n emit(\"close\");\n }\n function open() {\n closeTimer == null ? void 0 : closeTimer();\n openTimer == null ? void 0 : openTimer();\n if (props.openDelay && props.openDelay > 0) {\n ;\n ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));\n } else {\n doOpen();\n }\n }\n function close() {\n openTimer == null ? void 0 : openTimer();\n closeTimer == null ? void 0 : closeTimer();\n if (props.closeDelay && props.closeDelay > 0) {\n ;\n ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));\n } else {\n doClose();\n }\n }\n function handleClose() {\n function hide(shouldCancel) {\n if (shouldCancel)\n return;\n closed.value = true;\n visible.value = false;\n }\n if (props.beforeClose) {\n props.beforeClose(hide);\n } else {\n close();\n }\n }\n function onModalClick() {\n if (props.closeOnClickModal) {\n handleClose();\n }\n }\n function doOpen() {\n if (!isClient)\n return;\n visible.value = true;\n }\n function doClose() {\n visible.value = false;\n }\n function onOpenAutoFocus() {\n emit(\"openAutoFocus\");\n }\n function onCloseAutoFocus() {\n emit(\"closeAutoFocus\");\n }\n function onFocusoutPrevented(event) {\n var _a2;\n if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === \"pointer\") {\n event.preventDefault();\n }\n }\n if (props.lockScroll) {\n useLockscreen(visible);\n }\n function onCloseRequested() {\n if (props.closeOnPressEscape) {\n handleClose();\n }\n }\n watch(() => props.modelValue, (val) => {\n if (val) {\n closed.value = false;\n open();\n rendered.value = true;\n zIndex.value = isUndefined(props.zIndex) ? nextZIndex() : zIndex.value++;\n nextTick(() => {\n emit(\"open\");\n if (targetRef.value) {\n targetRef.value.scrollTop = 0;\n }\n });\n } else {\n if (visible.value) {\n close();\n }\n }\n });\n watch(() => props.fullscreen, (val) => {\n if (!targetRef.value)\n return;\n if (val) {\n lastPosition = targetRef.value.style.transform;\n targetRef.value.style.transform = \"\";\n } else {\n targetRef.value.style.transform = lastPosition;\n }\n });\n onMounted(() => {\n if (props.modelValue) {\n visible.value = true;\n rendered.value = true;\n open();\n }\n });\n return {\n afterEnter,\n afterLeave,\n beforeLeave,\n handleClose,\n onModalClick,\n close,\n doClose,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n titleId,\n bodyId,\n closed,\n style,\n overlayDialogStyle,\n rendered,\n visible,\n zIndex\n };\n};\n\nexport { useDialog };\n//# sourceMappingURL=use-dialog.mjs.map\n","import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, mergeProps, withModifiers, normalizeClass, createElementBlock, renderSlot, toDisplayString, createCommentVNode, vShow } from 'vue';\nimport { Close } from '@element-plus/icons-vue';\nimport { ElOverlay } from '../../overlay/index.mjs';\nimport '../../focus-trap/index.mjs';\nimport '../../dialog/index.mjs';\nimport '../../../utils/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { drawerProps, drawerEmits } from './drawer.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useLocale } from '../../../hooks/use-locale/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { useDialog } from '../../dialog/src/use-dialog.mjs';\n\nconst _sfc_main = defineComponent({\n name: \"ElDrawer\",\n components: {\n ElOverlay,\n ElFocusTrap,\n ElIcon,\n Close\n },\n inheritAttrs: false,\n props: drawerProps,\n emits: drawerEmits,\n setup(props, { slots }) {\n useDeprecated({\n scope: \"el-drawer\",\n from: \"the title slot\",\n replacement: \"the header slot\",\n version: \"3.0.0\",\n ref: \"https://element-plus.org/en-US/component/drawer.html#slots\"\n }, computed(() => !!slots.title));\n useDeprecated({\n scope: \"el-drawer\",\n from: \"custom-class\",\n replacement: \"class\",\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/drawer.html#attributes\",\n type: \"Attribute\"\n }, computed(() => !!props.customClass));\n const drawerRef = ref();\n const focusStartRef = ref();\n const ns = useNamespace(\"drawer\");\n const { t } = useLocale();\n const isHorizontal = computed(() => props.direction === \"rtl\" || props.direction === \"ltr\");\n const drawerSize = computed(() => addUnit(props.size));\n return {\n ...useDialog(props, drawerRef),\n drawerRef,\n focusStartRef,\n isHorizontal,\n drawerSize,\n ns,\n t\n };\n }\n});\nconst _hoisted_1 = [\"aria-label\", \"aria-labelledby\", \"aria-describedby\"];\nconst _hoisted_2 = [\"id\", \"aria-level\"];\nconst _hoisted_3 = [\"aria-label\"];\nconst _hoisted_4 = [\"id\"];\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_close = resolveComponent(\"close\");\n const _component_el_icon = resolveComponent(\"el-icon\");\n const _component_el_focus_trap = resolveComponent(\"el-focus-trap\");\n const _component_el_overlay = resolveComponent(\"el-overlay\");\n return openBlock(), createBlock(Teleport, {\n to: \"body\",\n disabled: !_ctx.appendToBody\n }, [\n createVNode(Transition, {\n name: _ctx.ns.b(\"fade\"),\n onAfterEnter: _ctx.afterEnter,\n onAfterLeave: _ctx.afterLeave,\n onBeforeLeave: _ctx.beforeLeave,\n persisted: \"\"\n }, {\n default: withCtx(() => [\n withDirectives(createVNode(_component_el_overlay, {\n mask: _ctx.modal,\n \"overlay-class\": _ctx.modalClass,\n \"z-index\": _ctx.zIndex,\n onClick: _ctx.onModalClick\n }, {\n default: withCtx(() => [\n createVNode(_component_el_focus_trap, {\n loop: \"\",\n trapped: _ctx.visible,\n \"focus-trap-el\": _ctx.drawerRef,\n \"focus-start-el\": _ctx.focusStartRef,\n onReleaseRequested: _ctx.onCloseRequested\n }, {\n default: withCtx(() => [\n createElementVNode(\"div\", mergeProps({\n ref: \"drawerRef\",\n \"aria-modal\": \"true\",\n \"aria-label\": _ctx.title || void 0,\n \"aria-labelledby\": !_ctx.title ? _ctx.titleId : void 0,\n \"aria-describedby\": _ctx.bodyId\n }, _ctx.$attrs, {\n class: [_ctx.ns.b(), _ctx.direction, _ctx.visible && \"open\", _ctx.customClass],\n style: _ctx.isHorizontal ? \"width: \" + _ctx.drawerSize : \"height: \" + _ctx.drawerSize,\n role: \"dialog\",\n onClick: _cache[1] || (_cache[1] = withModifiers(() => {\n }, [\"stop\"]))\n }), [\n createElementVNode(\"span\", {\n ref: \"focusStartRef\",\n class: normalizeClass(_ctx.ns.e(\"sr-focus\")),\n tabindex: \"-1\"\n }, null, 2),\n _ctx.withHeader ? (openBlock(), createElementBlock(\"header\", {\n key: 0,\n class: normalizeClass(_ctx.ns.e(\"header\"))\n }, [\n !_ctx.$slots.title ? renderSlot(_ctx.$slots, \"header\", {\n key: 0,\n close: _ctx.handleClose,\n titleId: _ctx.titleId,\n titleClass: _ctx.ns.e(\"title\")\n }, () => [\n !_ctx.$slots.title ? (openBlock(), createElementBlock(\"span\", {\n key: 0,\n id: _ctx.titleId,\n role: \"heading\",\n \"aria-level\": _ctx.headerAriaLevel,\n class: normalizeClass(_ctx.ns.e(\"title\"))\n }, toDisplayString(_ctx.title), 11, _hoisted_2)) : createCommentVNode(\"v-if\", true)\n ]) : renderSlot(_ctx.$slots, \"title\", { key: 1 }, () => [\n createCommentVNode(\" DEPRECATED SLOT \")\n ]),\n _ctx.showClose ? (openBlock(), createElementBlock(\"button\", {\n key: 2,\n \"aria-label\": _ctx.t(\"el.drawer.close\"),\n class: normalizeClass(_ctx.ns.e(\"close-btn\")),\n type: \"button\",\n onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClose && _ctx.handleClose(...args))\n }, [\n createVNode(_component_el_icon, {\n class: normalizeClass(_ctx.ns.e(\"close\"))\n }, {\n default: withCtx(() => [\n createVNode(_component_close)\n ]),\n _: 1\n }, 8, [\"class\"])\n ], 10, _hoisted_3)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n _ctx.rendered ? (openBlock(), createElementBlock(\"div\", {\n key: 1,\n id: _ctx.bodyId,\n class: normalizeClass(_ctx.ns.e(\"body\"))\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 10, _hoisted_4)) : createCommentVNode(\"v-if\", true),\n _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", {\n key: 2,\n class: normalizeClass(_ctx.ns.e(\"footer\"))\n }, [\n renderSlot(_ctx.$slots, \"footer\")\n ], 2)) : createCommentVNode(\"v-if\", true)\n ], 16, _hoisted_1)\n ]),\n _: 3\n }, 8, [\"trapped\", \"focus-trap-el\", \"focus-start-el\", \"onReleaseRequested\"])\n ]),\n _: 3\n }, 8, [\"mask\", \"overlay-class\", \"z-index\", \"onClick\"]), [\n [vShow, _ctx.visible]\n ])\n ]),\n _: 3\n }, 8, [\"name\", \"onAfterEnter\", \"onAfterLeave\", \"onBeforeLeave\"])\n ], 8, [\"disabled\"]);\n}\nvar Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__file\", \"drawer.vue\"]]);\n\nexport { Drawer as default };\n//# sourceMappingURL=drawer2.mjs.map\n","import '../../utils/index.mjs';\nimport Drawer from './src/drawer2.mjs';\nexport { drawerEmits, drawerProps } from './src/drawer.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElDrawer = withInstall(Drawer);\n\nexport { ElDrawer, ElDrawer as default };\n//# sourceMappingURL=index.mjs.map\n","const tabsRootContextKey = Symbol(\"tabsRootContextKey\");\n\nexport { tabsRootContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\n\nconst tabBarProps = buildProps({\n tabs: {\n type: definePropType(Array),\n default: () => mutable([])\n }\n});\n\nexport { tabBarProps };\n//# sourceMappingURL=tab-bar.mjs.map\n","import { defineComponent, getCurrentInstance, inject, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';\nimport { useResizeObserver } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { tabBarProps } from './tab-bar.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { capitalize } from '../../../utils/strings.mjs';\n\nconst COMPONENT_NAME = \"ElTabBar\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: tabBarProps,\n setup(__props, { expose }) {\n const props = __props;\n const instance = getCurrentInstance();\n const rootTabs = inject(tabsRootContextKey);\n if (!rootTabs)\n throwError(COMPONENT_NAME, \"\");\n const ns = useNamespace(\"tabs\");\n const barRef = ref();\n const barStyle = ref();\n const getBarStyle = () => {\n let offset = 0;\n let tabSize = 0;\n const sizeName = [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition) ? \"width\" : \"height\";\n const sizeDir = sizeName === \"width\" ? \"x\" : \"y\";\n const position = sizeDir === \"x\" ? \"left\" : \"top\";\n props.tabs.every((tab) => {\n var _a, _b;\n const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];\n if (!$el)\n return false;\n if (!tab.active) {\n return true;\n }\n offset = $el[`offset${capitalize(position)}`];\n tabSize = $el[`client${capitalize(sizeName)}`];\n const tabStyles = window.getComputedStyle($el);\n if (sizeName === \"width\") {\n if (props.tabs.length > 1) {\n tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);\n }\n offset += Number.parseFloat(tabStyles.paddingLeft);\n }\n return false;\n });\n return {\n [sizeName]: `${tabSize}px`,\n transform: `translate${capitalize(sizeDir)}(${offset}px)`\n };\n };\n const update = () => barStyle.value = getBarStyle();\n watch(() => props.tabs, async () => {\n await nextTick();\n update();\n }, { immediate: true });\n useResizeObserver(barRef, () => update());\n expose({\n ref: barRef,\n update\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n ref_key: \"barRef\",\n ref: barRef,\n class: normalizeClass([unref(ns).e(\"active-bar\"), unref(ns).is(unref(rootTabs).props.tabPosition)]),\n style: normalizeStyle(barStyle.value)\n }, null, 6);\n };\n }\n});\nvar TabBar = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"tab-bar.vue\"]]);\n\nexport { TabBar as default };\n//# sourceMappingURL=tab-bar2.mjs.map\n","import { defineComponent, getCurrentInstance, inject, ref, computed, nextTick, watch, onMounted, onUpdated, createVNode } from 'vue';\nimport { useDocumentVisibility, useWindowFocus, useResizeObserver } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue';\nimport '../../../hooks/index.mjs';\nimport TabBar from './tab-bar2.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { mutable } from '../../../utils/typescript.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { capitalize } from '../../../utils/strings.mjs';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\n\nconst tabNavProps = buildProps({\n panes: {\n type: definePropType(Array),\n default: () => mutable([])\n },\n currentName: {\n type: [String, Number],\n default: \"\"\n },\n editable: Boolean,\n type: {\n type: String,\n values: [\"card\", \"border-card\", \"\"],\n default: \"\"\n },\n stretch: Boolean\n});\nconst tabNavEmits = {\n tabClick: (tab, tabName, ev) => ev instanceof Event,\n tabRemove: (tab, ev) => ev instanceof Event\n};\nconst COMPONENT_NAME = \"ElTabNav\";\nconst TabNav = defineComponent({\n name: COMPONENT_NAME,\n props: tabNavProps,\n emits: tabNavEmits,\n setup(props, {\n expose,\n emit\n }) {\n const vm = getCurrentInstance();\n const rootTabs = inject(tabsRootContextKey);\n if (!rootTabs)\n throwError(COMPONENT_NAME, ``);\n const ns = useNamespace(\"tabs\");\n const visibility = useDocumentVisibility();\n const focused = useWindowFocus();\n const navScroll$ = ref();\n const nav$ = ref();\n const el$ = ref();\n const tabBarRef = ref();\n const scrollable = ref(false);\n const navOffset = ref(0);\n const isFocus = ref(false);\n const focusable = ref(true);\n const sizeName = computed(() => [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition) ? \"width\" : \"height\");\n const navStyle = computed(() => {\n const dir = sizeName.value === \"width\" ? \"X\" : \"Y\";\n return {\n transform: `translate${dir}(-${navOffset.value}px)`\n };\n });\n const scrollPrev = () => {\n if (!navScroll$.value)\n return;\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (!currentOffset)\n return;\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;\n navOffset.value = newOffset;\n };\n const scrollNext = () => {\n if (!navScroll$.value || !nav$.value)\n return;\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (navSize - currentOffset <= containerSize)\n return;\n const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;\n navOffset.value = newOffset;\n };\n const scrollToActiveTab = async () => {\n const nav = nav$.value;\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav)\n return;\n await nextTick();\n const activeTab = el$.value.querySelector(\".is-active\");\n if (!activeTab)\n return;\n const navScroll = navScroll$.value;\n const isHorizontal = [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition);\n const activeTabBounding = activeTab.getBoundingClientRect();\n const navScrollBounding = navScroll.getBoundingClientRect();\n const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;\n const currentOffset = navOffset.value;\n let newOffset = currentOffset;\n if (isHorizontal) {\n if (activeTabBounding.left < navScrollBounding.left) {\n newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);\n }\n if (activeTabBounding.right > navScrollBounding.right) {\n newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;\n }\n } else {\n if (activeTabBounding.top < navScrollBounding.top) {\n newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);\n }\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\n newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);\n }\n }\n newOffset = Math.max(newOffset, 0);\n navOffset.value = Math.min(newOffset, maxOffset);\n };\n const update = () => {\n var _a;\n if (!nav$.value || !navScroll$.value)\n return;\n props.stretch && ((_a = tabBarRef.value) == null ? void 0 : _a.update());\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];\n const currentOffset = navOffset.value;\n if (containerSize < navSize) {\n scrollable.value = scrollable.value || {};\n scrollable.value.prev = currentOffset;\n scrollable.value.next = currentOffset + containerSize < navSize;\n if (navSize - currentOffset < containerSize) {\n navOffset.value = navSize - containerSize;\n }\n } else {\n scrollable.value = false;\n if (currentOffset > 0) {\n navOffset.value = 0;\n }\n }\n };\n const changeTab = (e) => {\n const code = e.code;\n const {\n up,\n down,\n left,\n right\n } = EVENT_CODE;\n if (![up, down, left, right].includes(code))\n return;\n const tabList = Array.from(e.currentTarget.querySelectorAll(\"[role=tab]:not(.is-disabled)\"));\n const currentIndex = tabList.indexOf(e.target);\n let nextIndex;\n if (code === left || code === up) {\n if (currentIndex === 0) {\n nextIndex = tabList.length - 1;\n } else {\n nextIndex = currentIndex - 1;\n }\n } else {\n if (currentIndex < tabList.length - 1) {\n nextIndex = currentIndex + 1;\n } else {\n nextIndex = 0;\n }\n }\n tabList[nextIndex].focus({\n preventScroll: true\n });\n tabList[nextIndex].click();\n setFocus();\n };\n const setFocus = () => {\n if (focusable.value)\n isFocus.value = true;\n };\n const removeFocus = () => isFocus.value = false;\n watch(visibility, (visibility2) => {\n if (visibility2 === \"hidden\") {\n focusable.value = false;\n } else if (visibility2 === \"visible\") {\n setTimeout(() => focusable.value = true, 50);\n }\n });\n watch(focused, (focused2) => {\n if (focused2) {\n setTimeout(() => focusable.value = true, 50);\n } else {\n focusable.value = false;\n }\n });\n useResizeObserver(el$, update);\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0));\n onUpdated(() => update());\n expose({\n scrollToActiveTab,\n removeFocus\n });\n watch(() => props.panes, () => vm.update(), {\n flush: \"post\",\n deep: true\n });\n return () => {\n const scrollBtn = scrollable.value ? [createVNode(\"span\", {\n \"class\": [ns.e(\"nav-prev\"), ns.is(\"disabled\", !scrollable.value.prev)],\n \"onClick\": scrollPrev\n }, [createVNode(ElIcon, null, {\n default: () => [createVNode(ArrowLeft, null, null)]\n })]), createVNode(\"span\", {\n \"class\": [ns.e(\"nav-next\"), ns.is(\"disabled\", !scrollable.value.next)],\n \"onClick\": scrollNext\n }, [createVNode(ElIcon, null, {\n default: () => [createVNode(ArrowRight, null, null)]\n })])] : null;\n const tabs = props.panes.map((pane, index) => {\n var _a, _b, _c, _d;\n const uid = pane.uid;\n const disabled = pane.props.disabled;\n const tabName = (_b = (_a = pane.props.name) != null ? _a : pane.index) != null ? _b : `${index}`;\n const closable = !disabled && (pane.isClosable || props.editable);\n pane.index = `${index}`;\n const btnClose = closable ? createVNode(ElIcon, {\n \"class\": \"is-icon-close\",\n \"onClick\": (ev) => emit(\"tabRemove\", pane, ev)\n }, {\n default: () => [createVNode(Close, null, null)]\n }) : null;\n const tabLabelContent = ((_d = (_c = pane.slots).label) == null ? void 0 : _d.call(_c)) || pane.props.label;\n const tabindex = !disabled && pane.active ? 0 : -1;\n return createVNode(\"div\", {\n \"ref\": `tab-${uid}`,\n \"class\": [ns.e(\"item\"), ns.is(rootTabs.props.tabPosition), ns.is(\"active\", pane.active), ns.is(\"disabled\", disabled), ns.is(\"closable\", closable), ns.is(\"focus\", isFocus.value)],\n \"id\": `tab-${tabName}`,\n \"key\": `tab-${uid}`,\n \"aria-controls\": `pane-${tabName}`,\n \"role\": \"tab\",\n \"aria-selected\": pane.active,\n \"tabindex\": tabindex,\n \"onFocus\": () => setFocus(),\n \"onBlur\": () => removeFocus(),\n \"onClick\": (ev) => {\n removeFocus();\n emit(\"tabClick\", pane, tabName, ev);\n },\n \"onKeydown\": (ev) => {\n if (closable && (ev.code === EVENT_CODE.delete || ev.code === EVENT_CODE.backspace)) {\n emit(\"tabRemove\", pane, ev);\n }\n }\n }, [...[tabLabelContent, btnClose]]);\n });\n return createVNode(\"div\", {\n \"ref\": el$,\n \"class\": [ns.e(\"nav-wrap\"), ns.is(\"scrollable\", !!scrollable.value), ns.is(rootTabs.props.tabPosition)]\n }, [scrollBtn, createVNode(\"div\", {\n \"class\": ns.e(\"nav-scroll\"),\n \"ref\": navScroll$\n }, [createVNode(\"div\", {\n \"class\": [ns.e(\"nav\"), ns.is(rootTabs.props.tabPosition), ns.is(\"stretch\", props.stretch && [\"top\", \"bottom\"].includes(rootTabs.props.tabPosition))],\n \"ref\": nav$,\n \"style\": navStyle.value,\n \"role\": \"tablist\",\n \"onKeydown\": changeTab\n }, [...[!props.type ? createVNode(TabBar, {\n \"ref\": tabBarRef,\n \"tabs\": [...props.panes]\n }, null) : null, tabs]])])]);\n };\n }\n});\n\nexport { TabNav as default, tabNavEmits, tabNavProps };\n//# sourceMappingURL=tab-nav.mjs.map\n","import { isVNode, shallowRef } from 'vue';\nimport '../../utils/index.mjs';\nimport { flattedChildren } from '../../utils/vue/vnode.mjs';\n\nconst getOrderedChildren = (vm, childComponentName, children) => {\n const nodes = flattedChildren(vm.subTree).filter((n) => {\n var _a;\n return isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component;\n });\n const uids = nodes.map((n) => n.component.uid);\n return uids.map((uid) => children[uid]).filter((p) => !!p);\n};\nconst useOrderedChildren = (vm, childComponentName) => {\n const children = {};\n const orderedChildren = shallowRef([]);\n const addChild = (child) => {\n children[child.uid] = child;\n orderedChildren.value = getOrderedChildren(vm, childComponentName, children);\n };\n const removeChild = (uid) => {\n delete children[uid];\n orderedChildren.value = orderedChildren.value.filter((children2) => children2.uid !== uid);\n };\n return {\n children: orderedChildren,\n addChild,\n removeChild\n };\n};\n\nexport { useOrderedChildren };\n//# sourceMappingURL=index.mjs.map\n","import { defineComponent, getCurrentInstance, ref, computed, watch, nextTick, provide, createVNode, renderSlot } from 'vue';\nimport '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport { Plus } from '@element-plus/icons-vue';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport TabNav from './tab-nav.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { isString } from '@vue/shared';\nimport { isNumber, isUndefined } from '../../../utils/types.mjs';\nimport { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useOrderedChildren } from '../../../hooks/use-ordered-children/index.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { EVENT_CODE } from '../../../constants/aria.mjs';\n\nconst tabsProps = buildProps({\n type: {\n type: String,\n values: [\"card\", \"border-card\", \"\"],\n default: \"\"\n },\n activeName: {\n type: [String, Number]\n },\n closable: Boolean,\n addable: Boolean,\n modelValue: {\n type: [String, Number]\n },\n editable: Boolean,\n tabPosition: {\n type: String,\n values: [\"top\", \"right\", \"bottom\", \"left\"],\n default: \"top\"\n },\n beforeLeave: {\n type: definePropType(Function),\n default: () => true\n },\n stretch: Boolean\n});\nconst isPaneName = (value) => isString(value) || isNumber(value);\nconst tabsEmits = {\n [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),\n tabClick: (pane, ev) => ev instanceof Event,\n tabChange: (name) => isPaneName(name),\n edit: (paneName, action) => [\"remove\", \"add\"].includes(action),\n tabRemove: (name) => isPaneName(name),\n tabAdd: () => true\n};\nconst Tabs = defineComponent({\n name: \"ElTabs\",\n props: tabsProps,\n emits: tabsEmits,\n setup(props, {\n emit,\n slots,\n expose\n }) {\n var _a, _b;\n const ns = useNamespace(\"tabs\");\n const {\n children: panes,\n addChild: registerPane,\n removeChild: unregisterPane\n } = useOrderedChildren(getCurrentInstance(), \"ElTabPane\");\n const nav$ = ref();\n const currentName = ref((_b = (_a = props.modelValue) != null ? _a : props.activeName) != null ? _b : \"0\");\n const setCurrentName = async (value, trigger = false) => {\n var _a2, _b2, _c;\n if (currentName.value === value || isUndefined(value))\n return;\n try {\n const canLeave = await ((_a2 = props.beforeLeave) == null ? void 0 : _a2.call(props, value, currentName.value));\n if (canLeave !== false) {\n currentName.value = value;\n if (trigger) {\n emit(UPDATE_MODEL_EVENT, value);\n emit(\"tabChange\", value);\n }\n (_c = (_b2 = nav$.value) == null ? void 0 : _b2.removeFocus) == null ? void 0 : _c.call(_b2);\n }\n } catch (e) {\n }\n };\n const handleTabClick = (tab, tabName, event) => {\n if (tab.props.disabled)\n return;\n setCurrentName(tabName, true);\n emit(\"tabClick\", tab, event);\n };\n const handleTabRemove = (pane, ev) => {\n if (pane.props.disabled || isUndefined(pane.props.name))\n return;\n ev.stopPropagation();\n emit(\"edit\", pane.props.name, \"remove\");\n emit(\"tabRemove\", pane.props.name);\n };\n const handleTabAdd = () => {\n emit(\"edit\", void 0, \"add\");\n emit(\"tabAdd\");\n };\n useDeprecated({\n from: '\"activeName\"',\n replacement: '\"model-value\" or \"v-model\"',\n scope: \"ElTabs\",\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/tabs.html#attributes\",\n type: \"Attribute\"\n }, computed(() => !!props.activeName));\n watch(() => props.activeName, (modelValue) => setCurrentName(modelValue));\n watch(() => props.modelValue, (modelValue) => setCurrentName(modelValue));\n watch(currentName, async () => {\n var _a2;\n await nextTick();\n (_a2 = nav$.value) == null ? void 0 : _a2.scrollToActiveTab();\n });\n provide(tabsRootContextKey, {\n props,\n currentName,\n registerPane,\n unregisterPane\n });\n expose({\n currentName\n });\n return () => {\n const addSlot = slots.addIcon;\n const newButton = props.editable || props.addable ? createVNode(\"span\", {\n \"class\": ns.e(\"new-tab\"),\n \"tabindex\": \"0\",\n \"onClick\": handleTabAdd,\n \"onKeydown\": (ev) => {\n if (ev.code === EVENT_CODE.enter)\n handleTabAdd();\n }\n }, [addSlot ? renderSlot(slots, \"addIcon\") : createVNode(ElIcon, {\n \"class\": ns.is(\"icon-plus\")\n }, {\n default: () => [createVNode(Plus, null, null)]\n })]) : null;\n const header = createVNode(\"div\", {\n \"class\": [ns.e(\"header\"), ns.is(props.tabPosition)]\n }, [newButton, createVNode(TabNav, {\n \"ref\": nav$,\n \"currentName\": currentName.value,\n \"editable\": props.editable,\n \"type\": props.type,\n \"panes\": panes.value,\n \"stretch\": props.stretch,\n \"onTabClick\": handleTabClick,\n \"onTabRemove\": handleTabRemove\n }, null)]);\n const panels = createVNode(\"div\", {\n \"class\": ns.e(\"content\")\n }, [renderSlot(slots, \"default\")]);\n return createVNode(\"div\", {\n \"class\": [ns.b(), ns.m(props.tabPosition), {\n [ns.m(\"card\")]: props.type === \"card\",\n [ns.m(\"border-card\")]: props.type === \"border-card\"\n }]\n }, [...props.tabPosition !== \"bottom\" ? [header, panels] : [panels, header]]);\n };\n }\n});\n\nexport { Tabs as default, tabsEmits, tabsProps };\n//# sourceMappingURL=tabs.mjs.map\n","import '../../../utils/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\n\nconst tabPaneProps = buildProps({\n label: {\n type: String,\n default: \"\"\n },\n name: {\n type: [String, Number]\n },\n closable: Boolean,\n disabled: Boolean,\n lazy: Boolean\n});\n\nexport { tabPaneProps };\n//# sourceMappingURL=tab-pane.mjs.map\n","import { defineComponent, getCurrentInstance, useSlots, inject, ref, computed, watch, reactive, onMounted, onUnmounted, unref, withDirectives, openBlock, createElementBlock, normalizeClass, renderSlot, vShow, createCommentVNode } from 'vue';\nimport { eagerComputed } from '@vueuse/core';\nimport '../../../utils/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { tabsRootContextKey } from './constants.mjs';\nimport { tabPaneProps } from './tab-pane.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { throwError } from '../../../utils/error.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\n\nconst _hoisted_1 = [\"id\", \"aria-hidden\", \"aria-labelledby\"];\nconst COMPONENT_NAME = \"ElTabPane\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: tabPaneProps,\n setup(__props) {\n const props = __props;\n const instance = getCurrentInstance();\n const slots = useSlots();\n const tabsRoot = inject(tabsRootContextKey);\n if (!tabsRoot)\n throwError(COMPONENT_NAME, \"usage: \");\n const ns = useNamespace(\"tab-pane\");\n const index = ref();\n const isClosable = computed(() => props.closable || tabsRoot.props.closable);\n const active = eagerComputed(() => {\n var _a;\n return tabsRoot.currentName.value === ((_a = props.name) != null ? _a : index.value);\n });\n const loaded = ref(active.value);\n const paneName = computed(() => {\n var _a;\n return (_a = props.name) != null ? _a : index.value;\n });\n const shouldBeRender = eagerComputed(() => !props.lazy || loaded.value || active.value);\n watch(active, (val) => {\n if (val)\n loaded.value = true;\n });\n const pane = reactive({\n uid: instance.uid,\n slots,\n props,\n paneName,\n active,\n index,\n isClosable\n });\n onMounted(() => {\n tabsRoot.registerPane(pane);\n });\n onUnmounted(() => {\n tabsRoot.unregisterPane(pane.uid);\n });\n return (_ctx, _cache) => {\n return unref(shouldBeRender) ? withDirectives((openBlock(), createElementBlock(\"div\", {\n key: 0,\n id: `pane-${unref(paneName)}`,\n class: normalizeClass(unref(ns).b()),\n role: \"tabpanel\",\n \"aria-hidden\": !unref(active),\n \"aria-labelledby\": `tab-${unref(paneName)}`\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 10, _hoisted_1)), [\n [vShow, unref(active)]\n ]) : createCommentVNode(\"v-if\", true);\n };\n }\n});\nvar TabPane = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"tab-pane.vue\"]]);\n\nexport { TabPane as default };\n//# sourceMappingURL=tab-pane2.mjs.map\n","import '../../utils/index.mjs';\nimport Tabs from './src/tabs.mjs';\nexport { tabsEmits, tabsProps } from './src/tabs.mjs';\nimport TabPane from './src/tab-pane2.mjs';\nexport { tabBarProps } from './src/tab-bar.mjs';\nexport { tabNavEmits, tabNavProps } from './src/tab-nav.mjs';\nexport { tabPaneProps } from './src/tab-pane.mjs';\nexport { tabsRootContextKey } from './src/constants.mjs';\nimport { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';\n\nconst ElTabs = withInstall(Tabs, {\n TabPane\n});\nconst ElTabPane = withNoopInstall(TabPane);\n\nexport { ElTabPane, ElTabs, ElTabs as default };\n//# sourceMappingURL=index.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { isValidComponentSize } from '../../../utils/vue/validator.mjs';\nimport { iconPropType } from '../../../utils/vue/icon.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';\nimport { isBoolean, isNumber } from '../../../utils/types.mjs';\nimport { isString } from '@vue/shared';\n\nconst switchProps = buildProps({\n modelValue: {\n type: [Boolean, String, Number],\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n loading: {\n type: Boolean,\n default: false\n },\n size: {\n type: String,\n validator: isValidComponentSize\n },\n width: {\n type: [String, Number],\n default: \"\"\n },\n inlinePrompt: {\n type: Boolean,\n default: false\n },\n inactiveActionIcon: {\n type: iconPropType\n },\n activeActionIcon: {\n type: iconPropType\n },\n activeIcon: {\n type: iconPropType\n },\n inactiveIcon: {\n type: iconPropType\n },\n activeText: {\n type: String,\n default: \"\"\n },\n inactiveText: {\n type: String,\n default: \"\"\n },\n activeValue: {\n type: [Boolean, String, Number],\n default: true\n },\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false\n },\n activeColor: {\n type: String,\n default: \"\"\n },\n inactiveColor: {\n type: String,\n default: \"\"\n },\n borderColor: {\n type: String,\n default: \"\"\n },\n name: {\n type: String,\n default: \"\"\n },\n validateEvent: {\n type: Boolean,\n default: true\n },\n beforeChange: {\n type: definePropType(Function)\n },\n id: String,\n tabindex: {\n type: [String, Number]\n },\n value: {\n type: [Boolean, String, Number],\n default: false\n },\n label: {\n type: String,\n default: void 0\n }\n});\nconst switchEmits = {\n [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)\n};\n\nexport { switchEmits, switchProps };\n//# sourceMappingURL=switch.mjs.map\n","import { defineComponent, getCurrentInstance, computed, ref, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, createVNode, renderSlot } from 'vue';\nimport { isPromise } from '@vue/shared';\nimport '../../../utils/index.mjs';\nimport { ElIcon } from '../../icon/index.mjs';\nimport '../../form/index.mjs';\nimport { Loading } from '@element-plus/icons-vue';\nimport '../../../constants/index.mjs';\nimport '../../../hooks/index.mjs';\nimport { switchProps, switchEmits } from './switch.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';\nimport { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';\nimport { addUnit } from '../../../utils/dom/style.mjs';\nimport { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';\nimport { debugWarn, throwError } from '../../../utils/error.mjs';\nimport { isBoolean } from '../../../utils/types.mjs';\n\nconst _hoisted_1 = [\"onClick\"];\nconst _hoisted_2 = [\"id\", \"aria-checked\", \"aria-disabled\", \"aria-label\", \"name\", \"true-value\", \"false-value\", \"disabled\", \"tabindex\", \"onKeydown\"];\nconst _hoisted_3 = [\"aria-hidden\"];\nconst _hoisted_4 = [\"aria-hidden\"];\nconst _hoisted_5 = [\"aria-hidden\"];\nconst COMPONENT_NAME = \"ElSwitch\";\nconst __default__ = defineComponent({\n name: COMPONENT_NAME\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: switchProps,\n emits: switchEmits,\n setup(__props, { expose, emit }) {\n const props = __props;\n const vm = getCurrentInstance();\n const { formItem } = useFormItem();\n const switchSize = useFormSize();\n const ns = useNamespace(\"switch\");\n const useBatchDeprecated = (list) => {\n list.forEach((param) => {\n useDeprecated({\n from: param[0],\n replacement: param[1],\n scope: COMPONENT_NAME,\n version: \"2.3.0\",\n ref: \"https://element-plus.org/en-US/component/switch.html#attributes\",\n type: \"Attribute\"\n }, computed(() => {\n var _a;\n return !!((_a = vm.vnode.props) == null ? void 0 : _a[param[2]]);\n }));\n });\n };\n useBatchDeprecated([\n ['\"value\"', '\"model-value\" or \"v-model\"', \"value\"],\n ['\"active-color\"', \"CSS var `--el-switch-on-color`\", \"activeColor\"],\n ['\"inactive-color\"', \"CSS var `--el-switch-off-color`\", \"inactiveColor\"],\n ['\"border-color\"', \"CSS var `--el-switch-border-color`\", \"borderColor\"]\n ]);\n const { inputId } = useFormItemInputId(props, {\n formItemContext: formItem\n });\n const switchDisabled = useFormDisabled(computed(() => props.loading));\n const isControlled = ref(props.modelValue !== false);\n const input = ref();\n const core = ref();\n const switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is(\"disabled\", switchDisabled.value),\n ns.is(\"checked\", checked.value)\n ]);\n const labelLeftKls = computed(() => [\n ns.e(\"label\"),\n ns.em(\"label\", \"left\"),\n ns.is(\"active\", !checked.value)\n ]);\n const labelRightKls = computed(() => [\n ns.e(\"label\"),\n ns.em(\"label\", \"right\"),\n ns.is(\"active\", checked.value)\n ]);\n const coreStyle = computed(() => ({\n width: addUnit(props.width)\n }));\n watch(() => props.modelValue, () => {\n isControlled.value = true;\n });\n watch(() => props.value, () => {\n isControlled.value = false;\n });\n const actualValue = computed(() => {\n return isControlled.value ? props.modelValue : props.value;\n });\n const checked = computed(() => actualValue.value === props.activeValue);\n if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue);\n emit(CHANGE_EVENT, props.inactiveValue);\n emit(INPUT_EVENT, props.inactiveValue);\n }\n watch(checked, (val) => {\n var _a;\n input.value.checked = val;\n if (props.validateEvent) {\n (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, \"change\").catch((err) => debugWarn(err));\n }\n });\n const handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue;\n emit(UPDATE_MODEL_EVENT, val);\n emit(CHANGE_EVENT, val);\n emit(INPUT_EVENT, val);\n nextTick(() => {\n input.value.checked = checked.value;\n });\n };\n const switchValue = () => {\n if (switchDisabled.value)\n return;\n const { beforeChange } = props;\n if (!beforeChange) {\n handleChange();\n return;\n }\n const shouldChange = beforeChange();\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange)\n ].includes(true);\n if (!isPromiseOrBool) {\n throwError(COMPONENT_NAME, \"beforeChange must return type `Promise` or `boolean`\");\n }\n if (isPromise(shouldChange)) {\n shouldChange.then((result) => {\n if (result) {\n handleChange();\n }\n }).catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);\n });\n } else if (shouldChange) {\n handleChange();\n }\n };\n const styles = computed(() => {\n return ns.cssVarBlock({\n ...props.activeColor ? { \"on-color\": props.activeColor } : null,\n ...props.inactiveColor ? { \"off-color\": props.inactiveColor } : null,\n ...props.borderColor ? { \"border-color\": props.borderColor } : null\n });\n });\n const focus = () => {\n var _a, _b;\n (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);\n };\n onMounted(() => {\n input.value.checked = checked.value;\n });\n expose({\n focus,\n checked\n });\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"div\", {\n class: normalizeClass(unref(switchKls)),\n style: normalizeStyle(unref(styles)),\n onClick: withModifiers(switchValue, [\"prevent\"])\n }, [\n createElementVNode(\"input\", {\n id: unref(inputId),\n ref_key: \"input\",\n ref: input,\n class: normalizeClass(unref(ns).e(\"input\")),\n type: \"checkbox\",\n role: \"switch\",\n \"aria-checked\": unref(checked),\n \"aria-disabled\": unref(switchDisabled),\n \"aria-label\": _ctx.label,\n name: _ctx.name,\n \"true-value\": _ctx.activeValue,\n \"false-value\": _ctx.inactiveValue,\n disabled: unref(switchDisabled),\n tabindex: _ctx.tabindex,\n onChange: handleChange,\n onKeydown: withKeys(switchValue, [\"enter\"])\n }, null, 42, _hoisted_2),\n !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock(\"span\", {\n key: 0,\n class: normalizeClass(unref(labelLeftKls))\n }, [\n _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true),\n !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n \"aria-hidden\": unref(checked)\n }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n createElementVNode(\"span\", {\n ref_key: \"core\",\n ref: core,\n class: normalizeClass(unref(ns).e(\"core\")),\n style: normalizeStyle(unref(coreStyle))\n }, [\n _ctx.inlinePrompt ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(unref(ns).e(\"inner\"))\n }, [\n _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {\n key: 0,\n class: normalizeClass(unref(ns).is(\"icon\"))\n }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))\n ]),\n _: 1\n }, 8, [\"class\"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass(unref(ns).is(\"text\")),\n \"aria-hidden\": !unref(checked)\n }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true),\n createElementVNode(\"div\", {\n class: normalizeClass(unref(ns).e(\"action\"))\n }, [\n _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {\n key: 0,\n class: normalizeClass(unref(ns).is(\"loading\"))\n }, {\n default: withCtx(() => [\n createVNode(unref(Loading))\n ]),\n _: 1\n }, 8, [\"class\"])) : unref(checked) ? renderSlot(_ctx.$slots, \"active-action\", { key: 1 }, () => [\n _ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true)\n ]) : !unref(checked) ? renderSlot(_ctx.$slots, \"inactive-action\", { key: 2 }, () => [\n _ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true)\n ]) : createCommentVNode(\"v-if\", true)\n ], 2)\n ], 6),\n !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n class: normalizeClass(unref(labelRightKls))\n }, [\n _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {\n default: withCtx(() => [\n (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))\n ]),\n _: 1\n })) : createCommentVNode(\"v-if\", true),\n !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock(\"span\", {\n key: 1,\n \"aria-hidden\": !unref(checked)\n }, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode(\"v-if\", true)\n ], 2)) : createCommentVNode(\"v-if\", true)\n ], 14, _hoisted_1);\n };\n }\n});\nvar Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"switch.vue\"]]);\n\nexport { Switch as default };\n//# sourceMappingURL=switch2.mjs.map\n","import '../../utils/index.mjs';\nimport Switch from './src/switch2.mjs';\nexport { switchEmits, switchProps } from './src/switch.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElSwitch = withInstall(Switch);\n\nexport { ElSwitch, ElSwitch as default };\n//# sourceMappingURL=index.mjs.map\n","import request from './request'\nexport const queryKey = (proteinName) => {\n const param = new URLSearchParams()\n param.append('protein_name', proteinName)\n return request({\n method: 'post',\n url: 'query',\n data: param\n })\n}\n\nexport const getProteins = () => {\n return request({\n method: 'get',\n url: '/data/proteinTable.json.gz',\n responseType: 'arraybuffer'\n })\n}\n\nexport const getCellLineProteins = () => {\n return request({\n method: 'get',\n url: '/data/Cell_lines_IBAQ.json.gz',\n responseType: 'arraybuffer'\n })\n}\n","\n/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED$1 = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN$1 = 2;\n\n/*============================================================================*/\n\n\nfunction zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH$1 = 3;\nconst MAX_MATCH$1 = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES$1 = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS$1 = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES$1 = 30;\n/* number of distance codes */\n\nconst BL_CODES$1 = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE$1 = 2 * L_CODES$1 + 1;\n/* maximum heap size */\n\nconst MAX_BITS$1 = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nconst DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nconst static_ltree = new Array((L_CODES$1 + 2) * 2);\nzero$1(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nconst static_dtree = new Array(D_CODES$1 * 2);\nzero$1(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nconst _dist_code = new Array(DIST_CODE_LEN);\nzero$1(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nconst _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1);\nzero$1(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nconst base_length = new Array(LENGTH_CODES$1);\nzero$1(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nconst base_dist = new Array(D_CODES$1);\nzero$1(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nlet static_l_desc;\nlet static_d_desc;\nlet static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nconst d_code = (dist) => {\n\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n};\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nconst put_short = (s, w) => {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n};\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nconst send_bits = (s, value, length) => {\n\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n};\n\n\nconst send_code = (s, c, tree) => {\n\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n};\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nconst bi_reverse = (code, len) => {\n\n let res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nconst bi_flush = (s) => {\n\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n};\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nconst gen_bitlen = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const max_code = desc.max_code;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const extra = desc.stat_desc.extra_bits;\n const base = desc.stat_desc.extra_base;\n const max_length = desc.stat_desc.max_length;\n let h; /* heap index */\n let n, m; /* iterate over the tree elements */\n let bits; /* bit length */\n let xbits; /* extra bits */\n let f; /* frequency */\n let overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Tracev((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Tracev((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n};\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nconst gen_codes = (tree, max_code, bl_count) => {\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n\n const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS$1; bits++) {\n code = (code + bl_count[bits - 1]) << 1;\n next_code[bits] = code;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< {\n\n let n; /* iterates over tree elements */\n let bits; /* bit counter */\n let length; /* length value */\n let code; /* code value */\n let dist; /* distance index */\n const bl_count = new Array(MAX_BITS$1 + 1);\n /* number of codes at each bit length for an optimal tree */\n\n // do check in _tr_init()\n //if (static_init_done) return;\n\n /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n static_l_desc.static_tree = static_ltree;\n static_l_desc.extra_bits = extra_lbits;\n static_d_desc.static_tree = static_dtree;\n static_d_desc.extra_bits = extra_dbits;\n static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES$1 - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES$1; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS$1; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES$1 + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES$1; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS);\n\n //static_init_done = true;\n};\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nconst init_block = (s) => {\n\n let n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.sym_next = s.matches = 0;\n};\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nconst bi_windup = (s) =>\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n};\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nconst smaller = (tree, n, m, depth) => {\n\n const _n2 = n * 2;\n const _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n};\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nconst pqdownheap = (s, tree, k) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n\n const v = s.heap[k];\n let j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n};\n\n\n// inlined manually\n// const SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nconst compress_block = (s, ltree, dtree) => {\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n\n let dist; /* distance of matched string */\n let lc; /* match length or unmatched char (if dist == 0) */\n let sx = 0; /* running index in sym_buf */\n let code; /* the code to send */\n let extra; /* number of extra bits to send */\n\n if (s.sym_next !== 0) {\n do {\n dist = s.pending_buf[s.sym_buf + sx++] & 0xff;\n dist += (s.pending_buf[s.sym_buf + sx++] & 0xff) << 8;\n lc = s.pending_buf[s.sym_buf + sx++];\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and sym_buf is ok: */\n //Assert(s->pending < s->lit_bufsize + sx, \"pendingBuf overflow\");\n\n } while (sx < s.sym_next);\n }\n\n send_code(s, END_BLOCK, ltree);\n};\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nconst build_tree = (s, desc) => {\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n\n const tree = desc.dyn_tree;\n const stree = desc.stat_desc.static_tree;\n const has_stree = desc.stat_desc.has_stree;\n const elems = desc.stat_desc.elems;\n let n, m; /* iterate over heap elements */\n let max_code = -1; /* largest code with non zero frequency */\n let node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE$1;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n};\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nconst scan_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nconst send_tree = (s, tree, max_code) => {\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n\n let n; /* iterates over all tree elements */\n let prevlen = -1; /* last emitted length */\n let curlen; /* length of current code */\n\n let nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n let count = 0; /* repeat count of the current code */\n let max_count = 7; /* max repeat count */\n let min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n};\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nconst build_bl_tree = (s) => {\n\n let max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n};\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nconst send_all_trees = (s, lcodes, dcodes, blcodes) => {\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n\n let rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n};\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"block list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"allow list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nconst detect_data_type = (s) => {\n /* block_mask is the bit mask of block-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n let block_mask = 0xf3ffc07f;\n let n;\n\n /* Check for non-textual (\"block-listed\") bytes. */\n for (n = 0; n <= 31; n++, block_mask >>>= 1) {\n if ((block_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"allow-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS$1; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"block-listed\" or \"allow-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n};\n\n\nlet static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nconst _tr_init$1 = (s) =>\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n};\n\n\n/* ===========================================================================\n * Send a stored block\n */\nconst _tr_stored_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n bi_windup(s); /* align on byte boundary */\n put_short(s, stored_len);\n put_short(s, ~stored_len);\n if (stored_len) {\n s.pending_buf.set(s.window.subarray(buf, buf + stored_len), s.pending);\n }\n s.pending += stored_len;\n};\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nconst _tr_align$1 = (s) => {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n};\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and write out the encoded block.\n */\nconst _tr_flush_block$1 = (s, buf, stored_len, last) => {\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n\n let opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n let max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN$1) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->sym_next / 3));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block$1(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n};\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nconst _tr_tally$1 = (s, dist, lc) => {\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n\n s.pending_buf[s.sym_buf + s.sym_next++] = dist;\n s.pending_buf[s.sym_buf + s.sym_next++] = dist >> 8;\n s.pending_buf[s.sym_buf + s.sym_next++] = lc;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n return (s.sym_next === s.sym_end);\n};\n\nvar _tr_init_1 = _tr_init$1;\nvar _tr_stored_block_1 = _tr_stored_block$1;\nvar _tr_flush_block_1 = _tr_flush_block$1;\nvar _tr_tally_1 = _tr_tally$1;\nvar _tr_align_1 = _tr_align$1;\n\nvar trees = {\n\t_tr_init: _tr_init_1,\n\t_tr_stored_block: _tr_stored_block_1,\n\t_tr_flush_block: _tr_flush_block_1,\n\t_tr_tally: _tr_tally_1,\n\t_tr_align: _tr_align_1\n};\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nvar adler32_1 = adler32;\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nvar crc32_1 = crc32;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar messages = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar constants$2 = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees;\n\n\n\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1,\n Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1,\n Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1,\n Z_UNKNOWN,\n Z_DEFLATED: Z_DEFLATED$2\n} = constants$2;\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS$1 = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42; /* zlib header -> BUSY_STATE */\n//#ifdef GZIP\nconst GZIP_STATE = 57; /* gzip header -> BUSY_STATE | EXTRA_STATE */\n//#endif\nconst EXTRA_STATE = 69; /* gzip extra block -> NAME_STATE */\nconst NAME_STATE = 73; /* gzip file name -> COMMENT_STATE */\nconst COMMENT_STATE = 91; /* gzip comment -> HCRC_STATE */\nconst HCRC_STATE = 103; /* gzip header CRC -> BUSY_STATE */\nconst BUSY_STATE = 113; /* deflate -> FINISH_STATE */\nconst FINISH_STATE = 666; /* stream complete */\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = messages[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) * 2) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n/* ===========================================================================\n * Slide the hash table when sliding the window down (could be avoided with 32\n * bit values at the expense of memory usage). We slide even when level == 0 to\n * keep the hash table consistent if we switch back to level > 0 later.\n */\nconst slide_hash = (s) => {\n let n, m;\n let p;\n let wsize = s.w_size;\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= wsize ? m - wsize : 0);\n } while (--n);\n n = wsize;\n//#ifndef FASTEST\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= wsize ? m - wsize : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n//#endif\n};\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\nlet HASH = HASH_ZLIB;\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output, except for\n * some deflate_stored() output, goes through this function so some\n * applications may wish to modify it to avoid allocating a large\n * strm->next_out buffer and copying into it. (See also read_buf()).\n */\nconst flush_pending = (strm) => {\n const s = strm.state;\n\n //_tr_flush_bits(s);\n let len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n};\n\n\nconst flush_block_only = (s, last) => {\n _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n};\n\n\nconst put_byte = (s, b) => {\n s.pending_buf[s.pending++] = b;\n};\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nconst putShortMSB = (s, b) => {\n\n // put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n};\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nconst read_buf = (strm, buf, start, size) => {\n\n let len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n};\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nconst longest_match = (s, cur_match) => {\n\n let chain_length = s.max_chain_length; /* max hash chain length */\n let scan = s.strstart; /* current string */\n let match; /* matched string */\n let len; /* length of current match */\n let best_len = s.prev_length; /* best match length so far */\n let nice_match = s.nice_match; /* stop if match long enough */\n const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n const _win = s.window; // shortcut\n\n const wmask = s.w_mask;\n const prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n const strend = s.strstart + MAX_MATCH;\n let scan_end1 = _win[scan + best_len - 1];\n let scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n};\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nconst fill_window = (s) => {\n\n const _w_size = s.w_size;\n let n, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size - more), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n slide_hash(s);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]);\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// const curr = s.strstart + s.lookahead;\n// let init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n};\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n *\n * In case deflateParams() is used to later switch to a non-zero compression\n * level, s->matches (otherwise unused when storing) keeps track of the number\n * of hash table slides to perform. If s->matches is 1, then one hash table\n * slide will be done when switching. If s->matches is 2, the maximum value\n * allowed here, then the hash table will be cleared, since two or more slides\n * is the same as a clear.\n *\n * deflate_stored() is written to minimize the number of times an input byte is\n * copied. It is most efficient with large input and output buffers, which\n * maximizes the opportunites to have a single copy from next_in to next_out.\n */\nconst deflate_stored = (s, flush) => {\n\n /* Smallest worthy block size when not flushing or finishing. By default\n * this is 32K. This can be as small as 507 bytes for memLevel == 1. For\n * large input and output buffers, the stored block size will be larger.\n */\n let min_block = s.pending_buf_size - 5 > s.w_size ? s.w_size : s.pending_buf_size - 5;\n\n /* Copy as many min_block or larger stored blocks directly to next_out as\n * possible. If flushing, copy the remaining available input to next_out as\n * stored blocks, if there is enough space.\n */\n let len, left, have, last = 0;\n let used = s.strm.avail_in;\n do {\n /* Set len to the maximum size block that we can copy directly with the\n * available input data and output space. Set left to how much of that\n * would be copied from what's left in the window.\n */\n len = 65535/* MAX_STORED */; /* maximum deflate stored block length */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n if (s.strm.avail_out < have) { /* need room for header */\n break;\n }\n /* maximum stored block length that will fit in avail_out: */\n have = s.strm.avail_out - have;\n left = s.strstart - s.block_start; /* bytes left in window */\n if (len > left + s.strm.avail_in) {\n len = left + s.strm.avail_in; /* limit len to the input */\n }\n if (len > have) {\n len = have; /* limit len to the output */\n }\n\n /* If the stored block would be less than min_block in length, or if\n * unable to copy all of the available input when flushing, then try\n * copying to the window and the pending buffer instead. Also don't\n * write an empty block when flushing -- deflate() does that.\n */\n if (len < min_block && ((len === 0 && flush !== Z_FINISH$3) ||\n flush === Z_NO_FLUSH$2 ||\n len !== left + s.strm.avail_in)) {\n break;\n }\n\n /* Make a dummy stored block in pending to get the header bytes,\n * including any pending bits. This also updates the debugging counts.\n */\n last = flush === Z_FINISH$3 && len === left + s.strm.avail_in ? 1 : 0;\n _tr_stored_block(s, 0, 0, last);\n\n /* Replace the lengths in the dummy stored block with len. */\n s.pending_buf[s.pending - 4] = len;\n s.pending_buf[s.pending - 3] = len >> 8;\n s.pending_buf[s.pending - 2] = ~len;\n s.pending_buf[s.pending - 1] = ~len >> 8;\n\n /* Write the stored block header bytes. */\n flush_pending(s.strm);\n\n//#ifdef ZLIB_DEBUG\n// /* Update debugging counts for the data about to be copied. */\n// s->compressed_len += len << 3;\n// s->bits_sent += len << 3;\n//#endif\n\n /* Copy uncompressed bytes from the window to next_out. */\n if (left) {\n if (left > len) {\n left = len;\n }\n //zmemcpy(s->strm->next_out, s->window + s->block_start, left);\n s.strm.output.set(s.window.subarray(s.block_start, s.block_start + left), s.strm.next_out);\n s.strm.next_out += left;\n s.strm.avail_out -= left;\n s.strm.total_out += left;\n s.block_start += left;\n len -= left;\n }\n\n /* Copy uncompressed bytes directly from next_in to next_out, updating\n * the check value.\n */\n if (len) {\n read_buf(s.strm, s.strm.output, s.strm.next_out, len);\n s.strm.next_out += len;\n s.strm.avail_out -= len;\n s.strm.total_out += len;\n }\n } while (last === 0);\n\n /* Update the sliding window with the last s->w_size bytes of the copied\n * data, or append all of the copied data to the existing window if less\n * than s->w_size bytes were copied. Also update the number of bytes to\n * insert in the hash tables, in the event that deflateParams() switches to\n * a non-zero compression level.\n */\n used -= s.strm.avail_in; /* number of input bytes directly copied */\n if (used) {\n /* If any input was used, then no unused input remains in the window,\n * therefore s->block_start == s->strstart.\n */\n if (used >= s.w_size) { /* supplant the previous history */\n s.matches = 2; /* clear hash */\n //zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);\n s.window.set(s.strm.input.subarray(s.strm.next_in - s.w_size, s.strm.next_in), 0);\n s.strstart = s.w_size;\n s.insert = s.strstart;\n }\n else {\n if (s.window_size - s.strstart <= used) {\n /* Slide the window down. */\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n //zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);\n s.window.set(s.strm.input.subarray(s.strm.next_in - used, s.strm.next_in), s.strstart);\n s.strstart += used;\n s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used;\n }\n s.block_start = s.strstart;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* If the last block was written to next_out, then done. */\n if (last) {\n return BS_FINISH_DONE;\n }\n\n /* If flushing and all input has been consumed, then done. */\n if (flush !== Z_NO_FLUSH$2 && flush !== Z_FINISH$3 &&\n s.strm.avail_in === 0 && s.strstart === s.block_start) {\n return BS_BLOCK_DONE;\n }\n\n /* Fill the window with any remaining input. */\n have = s.window_size - s.strstart;\n if (s.strm.avail_in > have && s.block_start >= s.w_size) {\n /* Slide the window down. */\n s.block_start -= s.w_size;\n s.strstart -= s.w_size;\n //zmemcpy(s->window, s->window + s->w_size, s->strstart);\n s.window.set(s.window.subarray(s.w_size, s.w_size + s.strstart), 0);\n if (s.matches < 2) {\n s.matches++; /* add a pending slide_hash() */\n }\n have += s.w_size; /* more space now */\n if (s.insert > s.strstart) {\n s.insert = s.strstart;\n }\n }\n if (have > s.strm.avail_in) {\n have = s.strm.avail_in;\n }\n if (have) {\n read_buf(s.strm, s.window, s.strstart, have);\n s.strstart += have;\n s.insert += have > s.w_size - s.insert ? s.w_size - s.insert : have;\n }\n if (s.high_water < s.strstart) {\n s.high_water = s.strstart;\n }\n\n /* There was not enough avail_out to write a complete worthy or flushed\n * stored block to next_out. Write a stored block to pending instead, if we\n * have enough input for a worthy block, or if flushing and there is enough\n * room for the remaining input as a stored block in the pending buffer.\n */\n have = (s.bi_valid + 42) >> 3; /* number of header bytes */\n /* maximum stored block length that will fit in pending: */\n have = s.pending_buf_size - have > 65535/* MAX_STORED */ ? 65535/* MAX_STORED */ : s.pending_buf_size - have;\n min_block = have > s.w_size ? s.w_size : have;\n left = s.strstart - s.block_start;\n if (left >= min_block ||\n ((left || flush === Z_FINISH$3) && flush !== Z_NO_FLUSH$2 &&\n s.strm.avail_in === 0 && left <= have)) {\n len = left > have ? have : left;\n last = flush === Z_FINISH$3 && s.strm.avail_in === 0 &&\n len === left ? 1 : 0;\n _tr_stored_block(s, s.block_start, len, last);\n s.block_start += len;\n flush_pending(s.strm);\n }\n\n /* We've done all we can with the available input and output. */\n return last ? BS_FINISH_STARTED : BS_NEED_MORE;\n};\n\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nconst deflate_fast = (s, flush) => {\n\n let hash_head; /* head of the hash chain */\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]);\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nconst deflate_slow = (s, flush) => {\n\n let hash_head; /* head of hash chain */\n let bflush; /* set if current block must be flushed */\n\n let max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n};\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nconst deflate_rle = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n let prev; /* byte at distance one to match */\n let scan, strend; /* scan goes up to strend for length of run */\n\n const _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nconst deflate_huff = (s, flush) => {\n\n let bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH$2) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = _tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH$3) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.sym_next) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n};\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nconst configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nconst lm_init = (s) => {\n\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n};\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED$2; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.sym_buf = 0; /* buffer for distances and literals/lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.sym_next = 0; /* running index in sym_buf */\n this.sym_end = 0; /* symbol table full when sym_next reaches this */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\n/* =========================================================================\n * Check for a valid deflate stream state. Return 0 if ok, 1 if not.\n */\nconst deflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const s = strm.state;\n if (!s || s.strm !== strm || (s.status !== INIT_STATE &&\n//#ifdef GZIP\n s.status !== GZIP_STATE &&\n//#endif\n s.status !== EXTRA_STATE &&\n s.status !== NAME_STATE &&\n s.status !== COMMENT_STATE &&\n s.status !== HCRC_STATE &&\n s.status !== BUSY_STATE &&\n s.status !== FINISH_STATE)) {\n return 1;\n }\n return 0;\n};\n\n\nconst deflateResetKeep = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n const s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status =\n//#ifdef GZIP\n s.wrap === 2 ? GZIP_STATE :\n//#endif\n s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = -2;\n _tr_init(s);\n return Z_OK$3;\n};\n\n\nconst deflateReset = (strm) => {\n\n const ret = deflateResetKeep(strm);\n if (ret === Z_OK$3) {\n lm_init(strm.state);\n }\n return ret;\n};\n\n\nconst deflateSetHeader = (strm, head) => {\n\n if (deflateStateCheck(strm) || strm.state.wrap !== 2) {\n return Z_STREAM_ERROR$2;\n }\n strm.state.gzhead = head;\n return Z_OK$3;\n};\n\n\nconst deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {\n\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR$2;\n }\n let wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION$1) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) {\n return err(strm, Z_STREAM_ERROR$2);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n const s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n s.status = INIT_STATE; /* to pass state test in deflateReset() */\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n /* We overlay pending_buf and sym_buf. This works since the average size\n * for length/distance pairs over any compressed block is assured to be 31\n * bits or less.\n *\n * Analysis: The longest fixed codes are a length code of 8 bits plus 5\n * extra bits, for lengths 131 to 257. The longest fixed distance codes are\n * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest\n * possible fixed-codes length/distance pair is then 31 bits total.\n *\n * sym_buf starts one-fourth of the way into pending_buf. So there are\n * three bytes in sym_buf for every four bytes in pending_buf. Each symbol\n * in sym_buf is three bytes -- two for the distance and one for the\n * literal/length. As each symbol is consumed, the pointer to the next\n * sym_buf value to read moves forward three bytes. From that symbol, up to\n * 31 bits are written to pending_buf. The closest the written pending_buf\n * bits gets to the next sym_buf symbol to read is just before the last\n * code is written. At that time, 31*(n-2) bits have been written, just\n * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at\n * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1\n * symbols are written.) The closest the writing gets to what is unread is\n * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and\n * can range from 128 to 32768.\n *\n * Therefore, at a minimum, there are 142 bits of space between what is\n * written and what is read in the overlain buffers, so the symbols cannot\n * be overwritten by the compressed data. That space is actually 139 bits,\n * due to the three-bit fixed-code block header.\n *\n * That covers the case where either Z_FIXED is specified, forcing fixed\n * codes, or when the use of fixed codes is chosen, because that choice\n * results in a smaller compressed block than dynamic codes. That latter\n * condition then assures that the above analysis also covers all dynamic\n * blocks. A dynamic-code block will only be chosen to be emitted if it has\n * fewer bits than a fixed-code block would for the same set of symbols.\n * Therefore its average symbol length is assured to be less than 31. So\n * the compressed data for a dynamic block also cannot overwrite the\n * symbols from which it is being constructed.\n */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->sym_buf = s->pending_buf + s->lit_bufsize;\n s.sym_buf = s.lit_bufsize;\n\n //s->sym_end = (s->lit_bufsize - 1) * 3;\n s.sym_end = (s.lit_bufsize - 1) * 3;\n /* We avoid equality with lit_bufsize*3 because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n};\n\nconst deflateInit = (strm, level) => {\n\n return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1);\n};\n\n\n/* ========================================================================= */\nconst deflate$2 = (strm, flush) => {\n\n if (deflateStateCheck(strm) || flush > Z_BLOCK$1 || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n\n if (!strm.output ||\n (strm.avail_in !== 0 && !strm.input) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH$3)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2);\n }\n\n const old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK$3;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH$3) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR$1);\n }\n\n /* Write the header */\n if (s.status === INIT_STATE && s.wrap === 0) {\n s.status = BUSY_STATE;\n }\n if (s.status === INIT_STATE) {\n /* zlib header */\n let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8;\n let level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#ifdef GZIP\n if (s.status === GZIP_STATE) {\n /* gzip header */\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let left = (s.gzhead.extra.length & 0xffff) - s.gzindex;\n while (s.pending + left > s.pending_buf_size) {\n let copy = s.pending_buf_size - s.pending;\n // zmemcpy(s.pending_buf + s.pending,\n // s.gzhead.extra + s.gzindex, copy);\n s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex, s.gzindex + copy), s.pending);\n s.pending = s.pending_buf_size;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex += copy;\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n left -= copy;\n }\n // JS specific: s.gzhead.extra may be TypedArray or Array for backward compatibility\n // TypedArray.slice and TypedArray.from don't exist in IE10-IE11\n let gzhead_extra = new Uint8Array(s.gzhead.extra);\n // zmemcpy(s->pending_buf + s->pending,\n // s->gzhead->extra + s->gzindex, left);\n s.pending_buf.set(gzhead_extra.subarray(s.gzindex, s.gzindex + left), s.pending);\n s.pending += left;\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = NAME_STATE;\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n s.gzindex = 0;\n }\n s.status = COMMENT_STATE;\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n let beg = s.pending; /* start of bytes to update crc */\n let val;\n do {\n if (s.pending === s.pending_buf_size) {\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n beg = 0;\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n //--- HCRC_UPDATE(beg) ---//\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n //---//\n }\n s.status = HCRC_STATE;\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n }\n s.status = BUSY_STATE;\n\n /* Compression must start with an empty pending buffer */\n flush_pending(strm);\n if (s.pending !== 0) {\n s.last_flush = -1;\n return Z_OK$3;\n }\n }\n//#endif\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) {\n let bstate = s.level === 0 ? deflate_stored(s, flush) :\n s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush);\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK$3;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align(s);\n }\n else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */\n\n _tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH$1) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK$3;\n }\n }\n }\n\n if (flush !== Z_FINISH$3) { return Z_OK$3; }\n if (s.wrap <= 0) { return Z_STREAM_END$3; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3;\n};\n\n\nconst deflateEnd = (strm) => {\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const status = strm.state.status;\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3;\n};\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nconst deflateSetDictionary = (strm, dictionary) => {\n\n let dictLength = dictionary.length;\n\n if (deflateStateCheck(strm)) {\n return Z_STREAM_ERROR$2;\n }\n\n const s = strm.state;\n const wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR$2;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32_1(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n let tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n const avail = strm.avail_in;\n const next = strm.next_in;\n const input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n let str = s.strstart;\n let n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]);\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK$3;\n};\n\n\nvar deflateInit_1 = deflateInit;\nvar deflateInit2_1 = deflateInit2;\nvar deflateReset_1 = deflateReset;\nvar deflateResetKeep_1 = deflateResetKeep;\nvar deflateSetHeader_1 = deflateSetHeader;\nvar deflate_2$1 = deflate$2;\nvar deflateEnd_1 = deflateEnd;\nvar deflateSetDictionary_1 = deflateSetDictionary;\nvar deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.deflateBound = deflateBound;\nmodule.exports.deflateCopy = deflateCopy;\nmodule.exports.deflateGetDictionary = deflateGetDictionary;\nmodule.exports.deflateParams = deflateParams;\nmodule.exports.deflatePending = deflatePending;\nmodule.exports.deflatePrime = deflatePrime;\nmodule.exports.deflateTune = deflateTune;\n*/\n\nvar deflate_1$2 = {\n\tdeflateInit: deflateInit_1,\n\tdeflateInit2: deflateInit2_1,\n\tdeflateReset: deflateReset_1,\n\tdeflateResetKeep: deflateResetKeep_1,\n\tdeflateSetHeader: deflateSetHeader_1,\n\tdeflate: deflate_2$1,\n\tdeflateEnd: deflateEnd_1,\n\tdeflateSetDictionary: deflateSetDictionary_1,\n\tdeflateInfo: deflateInfo\n};\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nvar assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nvar flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n\nvar common = {\n\tassign: assign,\n\tflattenChunks: flattenChunks\n};\n\n// String encode/decode helpers\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nvar string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nvar buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nvar utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\nvar strings = {\n\tstring2buf: string2buf,\n\tbuf2string: buf2string,\n\tutf8border: utf8border\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nvar zstream = ZStream;\n\nconst toString$1 = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2,\n Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2,\n Z_DEFAULT_COMPRESSION,\n Z_DEFAULT_STRATEGY,\n Z_DEFLATED: Z_DEFLATED$1\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate$1(options) {\n this.options = common.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED$1,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = deflate_1$2.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n if (opt.header) {\n deflate_1$2.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n let dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = deflate_1$2.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK$2) {\n throw new Error(messages[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n let status, _flush_mode;\n\n if (this.ended) { return false; }\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1;\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString$1.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n status = deflate_1$2.deflate(strm, _flush_mode);\n\n // Ended => flush and finish\n if (status === Z_STREAM_END$2) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = deflate_1$2.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK$2;\n }\n\n // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n }\n\n // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK$2) {\n this.result = common.flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const data = new Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate$1(input, options) {\n const deflator = new Deflate$1(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || messages[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return deflate$1(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array\n * - data (Uint8Array|ArrayBuffer|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip$1(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate$1(input, options);\n}\n\n\nvar Deflate_1$1 = Deflate$1;\nvar deflate_2 = deflate$1;\nvar deflateRaw_1$1 = deflateRaw$1;\nvar gzip_1$1 = gzip$1;\nvar constants$1 = constants$2;\n\nvar deflate_1$1 = {\n\tDeflate: Deflate_1$1,\n\tdeflate: deflate_2,\n\tdeflateRaw: deflateRaw_1$1,\n\tgzip: gzip_1$1,\n\tconstants: constants$1\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD$1 = 16209; /* got a data error -- remain here until reset */\nconst TYPE$1 = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nvar inffast = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE$1;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS$1 = 852;\nconst ENOUGH_DISTS$1 = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES$1 = 0;\nconst LENS$1 = 1;\nconst DISTS$1 = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES$1 || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES$1) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS$1) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nvar inftrees = inflate_table;\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n\n\n\n\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES,\n Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR,\n Z_DEFLATED\n} = constants$2;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK$1;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR$1;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR$1; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK$1) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate$2 = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR$1;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK$1;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32_1(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT$1;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inffast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END$1;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR$1;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR$1;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR$1;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH$1))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR$1;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK$1;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK$1;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR$1;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32_1(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR$1;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR$1;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK$1;\n};\n\n\nvar inflateReset_1 = inflateReset;\nvar inflateReset2_1 = inflateReset2;\nvar inflateResetKeep_1 = inflateResetKeep;\nvar inflateInit_1 = inflateInit;\nvar inflateInit2_1 = inflateInit2;\nvar inflate_2$1 = inflate$2;\nvar inflateEnd_1 = inflateEnd;\nvar inflateGetHeader_1 = inflateGetHeader;\nvar inflateSetDictionary_1 = inflateSetDictionary;\nvar inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n\nvar inflate_1$2 = {\n\tinflateReset: inflateReset_1,\n\tinflateReset2: inflateReset2_1,\n\tinflateResetKeep: inflateResetKeep_1,\n\tinflateInit: inflateInit_1,\n\tinflateInit2: inflateInit2_1,\n\tinflate: inflate_2$1,\n\tinflateEnd: inflateEnd_1,\n\tinflateGetHeader: inflateGetHeader_1,\n\tinflateSetDictionary: inflateSetDictionary_1,\n\tinflateInfo: inflateInfo\n};\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nvar gzheader = GZheader;\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = constants$2;\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate$1(options) {\n this.options = common.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = inflate_1$2.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n\n this.header = new gzheader();\n\n inflate_1$2.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate$1.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = inflate_1$2.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = inflate_1$2.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = inflate_1$2.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n inflate_1$2.inflateReset(strm);\n status = inflate_1$2.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = inflate_1$2.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate$1.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate$1.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = common.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate$1(input, options) {\n const inflator = new Inflate$1(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || messages[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw$1(input, options) {\n options = options || {};\n options.raw = true;\n return inflate$1(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nvar Inflate_1$1 = Inflate$1;\nvar inflate_2 = inflate$1;\nvar inflateRaw_1$1 = inflateRaw$1;\nvar ungzip$1 = inflate$1;\nvar constants = constants$2;\n\nvar inflate_1$1 = {\n\tInflate: Inflate_1$1,\n\tinflate: inflate_2,\n\tinflateRaw: inflateRaw_1$1,\n\tungzip: ungzip$1,\n\tconstants: constants\n};\n\nconst { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;\n\nconst { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;\n\n\n\nvar Deflate_1 = Deflate;\nvar deflate_1 = deflate;\nvar deflateRaw_1 = deflateRaw;\nvar gzip_1 = gzip;\nvar Inflate_1 = Inflate;\nvar inflate_1 = inflate;\nvar inflateRaw_1 = inflateRaw;\nvar ungzip_1 = ungzip;\nvar constants_1 = constants$2;\n\nvar pako = {\n\tDeflate: Deflate_1,\n\tdeflate: deflate_1,\n\tdeflateRaw: deflateRaw_1,\n\tgzip: gzip_1,\n\tInflate: Inflate_1,\n\tinflate: inflate_1,\n\tinflateRaw: inflateRaw_1,\n\tungzip: ungzip_1,\n\tconstants: constants_1\n};\n\nexport { Deflate_1 as Deflate, Inflate_1 as Inflate, constants_1 as constants, pako as default, deflate_1 as deflate, deflateRaw_1 as deflateRaw, gzip_1 as gzip, inflate_1 as inflate, inflateRaw_1 as inflateRaw, ungzip_1 as ungzip };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","var Browser = (function () {\n function Browser() {\n this.firefox = false;\n this.ie = false;\n this.edge = false;\n this.newEdge = false;\n this.weChat = false;\n }\n return Browser;\n}());\nvar Env = (function () {\n function Env() {\n this.browser = new Browser();\n this.node = false;\n this.wxa = false;\n this.worker = false;\n this.svgSupported = false;\n this.touchEventsSupported = false;\n this.pointerEventsSupported = false;\n this.domSupported = false;\n this.transformSupported = false;\n this.transform3dSupported = false;\n this.hasGlobalWindow = typeof window !== 'undefined';\n }\n return Env;\n}());\nvar env = new Env();\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n env.wxa = true;\n env.touchEventsSupported = true;\n}\nelse if (typeof document === 'undefined' && typeof self !== 'undefined') {\n env.worker = true;\n}\nelse if (typeof navigator === 'undefined') {\n env.node = true;\n env.svgSupported = true;\n}\nelse {\n detect(navigator.userAgent, env);\n}\nfunction detect(ua, env) {\n var browser = env.browser;\n var firefox = ua.match(/Firefox\\/([\\d.]+)/);\n var ie = ua.match(/MSIE\\s([\\d.]+)/)\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge?\\/([\\d.]+)/);\n var weChat = (/micromessenger/i).test(ua);\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n }\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n browser.newEdge = +edge[1].split('.')[0] > 18;\n }\n if (weChat) {\n browser.weChat = true;\n }\n env.svgSupported = typeof SVGRect !== 'undefined';\n env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;\n env.pointerEventsSupported = 'onpointerdown' in window\n && (browser.edge || (browser.ie && +browser.version >= 11));\n env.domSupported = typeof document !== 'undefined';\n var style = document.documentElement.style;\n env.transform3dSupported = ((browser.ie && 'transition' in style)\n || browser.edge\n || (('WebKitCSSMatrix' in window) && ('m11' in new WebKitCSSMatrix()))\n || 'MozPerspective' in style)\n && !('OTransition' in style);\n env.transformSupported = env.transform3dSupported\n || (browser.ie && +browser.version >= 9);\n}\nexport default env;\n","export var DEFAULT_FONT_SIZE = 12;\nexport var DEFAULT_FONT_FAMILY = 'sans-serif';\nexport var DEFAULT_FONT = DEFAULT_FONT_SIZE + \"px \" + DEFAULT_FONT_FAMILY;\nvar OFFSET = 20;\nvar SCALE = 100;\nvar defaultWidthMapStr = \"007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\\\\\WQb\\\\0FWLg\\\\bWb\\\\WQ\\\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\\\FFF5.5N\";\nfunction getTextWidthMap(mapStr) {\n var map = {};\n if (typeof JSON === 'undefined') {\n return map;\n }\n for (var i = 0; i < mapStr.length; i++) {\n var char = String.fromCharCode(i + 32);\n var size = (mapStr.charCodeAt(i) - OFFSET) / SCALE;\n map[char] = size;\n }\n return map;\n}\nexport var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);\nexport var platformApi = {\n createCanvas: function () {\n return typeof document !== 'undefined'\n && document.createElement('canvas');\n },\n measureText: (function () {\n var _ctx;\n var _cachedFont;\n return function (text, font) {\n if (!_ctx) {\n var canvas = platformApi.createCanvas();\n _ctx = canvas && canvas.getContext('2d');\n }\n if (_ctx) {\n if (_cachedFont !== font) {\n _cachedFont = _ctx.font = font || DEFAULT_FONT;\n }\n return _ctx.measureText(text);\n }\n else {\n text = text || '';\n font = font || DEFAULT_FONT;\n var res = /(\\d+)px/.exec(font);\n var fontSize = res && +res[1] || DEFAULT_FONT_SIZE;\n var width = 0;\n if (font.indexOf('mono') >= 0) {\n width = fontSize * text.length;\n }\n else {\n for (var i = 0; i < text.length; i++) {\n var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i]];\n width += preCalcWidth == null ? fontSize : (preCalcWidth * fontSize);\n }\n }\n return { width: width };\n }\n };\n })(),\n loadImage: function (src, onload, onerror) {\n var image = new Image();\n image.onload = onload;\n image.onerror = onerror;\n image.src = src;\n return image;\n }\n};\nexport function setPlatformAPI(newPlatformApis) {\n for (var key in platformApi) {\n if (newPlatformApis[key]) {\n platformApi[key] = newPlatformApis[key];\n }\n }\n}\n","import { platformApi } from './platform.js';\nvar BUILTIN_OBJECT = reduce([\n 'Function',\n 'RegExp',\n 'Date',\n 'Error',\n 'CanvasGradient',\n 'CanvasPattern',\n 'Image',\n 'Canvas'\n], function (obj, val) {\n obj['[object ' + val + ']'] = true;\n return obj;\n}, {});\nvar TYPED_ARRAY = reduce([\n 'Int8',\n 'Uint8',\n 'Uint8Clamped',\n 'Int16',\n 'Uint16',\n 'Int32',\n 'Uint32',\n 'Float32',\n 'Float64'\n], function (obj, val) {\n obj['[object ' + val + 'Array]'] = true;\n return obj;\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 ctorFunction = function () { }.constructor;\nvar protoFunction = ctorFunction ? ctorFunction.prototype : null;\nvar protoKey = '__proto__';\nvar idStart = 0x0907;\nexport function guid() {\n return idStart++;\n}\nexport function logError() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (typeof console !== 'undefined') {\n console.error.apply(console, args);\n }\n}\nexport function clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n var result = source;\n var typeStr = objToString.call(source);\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n if (Ctor.from) {\n result = Ctor.from(source);\n }\n else {\n result = new Ctor(source.length);\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = source[i];\n }\n }\n }\n }\n else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n result[key] = clone(source[key]);\n }\n }\n }\n return result;\n}\nexport function merge(target, source, overwrite) {\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n var targetProp = target[key];\n var sourceProp = source[key];\n if (isObject(sourceProp)\n && isObject(targetProp)\n && !isArray(sourceProp)\n && !isArray(targetProp)\n && !isDom(sourceProp)\n && !isDom(targetProp)\n && !isBuiltInObject(sourceProp)\n && !isBuiltInObject(targetProp)\n && !isPrimitive(sourceProp)\n && !isPrimitive(targetProp)) {\n merge(targetProp, sourceProp, overwrite);\n }\n else if (overwrite || !(key in target)) {\n target[key] = clone(source[key]);\n }\n }\n }\n return target;\n}\nexport function mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n return result;\n}\nexport function extend(target, source) {\n if (Object.assign) {\n Object.assign(target, source);\n }\n else {\n for (var key in source) {\n if (source.hasOwnProperty(key) && key !== protoKey) {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\nexport function defaults(target, source, overlay) {\n var keysArr = keys(source);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if ((overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n return target;\n}\nexport var createCanvas = platformApi.createCanvas;\nexport function indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n return -1;\n}\nexport function inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n function F() { }\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n for (var prop in clazzPrototype) {\n if (clazzPrototype.hasOwnProperty(prop)) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n }\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\nexport function mixin(target, source, override) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n if (Object.getOwnPropertyNames) {\n var keyList = Object.getOwnPropertyNames(source);\n for (var i = 0; i < keyList.length; i++) {\n var key = keyList[i];\n if (key !== 'constructor') {\n if ((override ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n }\n }\n else {\n defaults(target, source, override);\n }\n}\nexport function isArrayLike(data) {\n if (!data) {\n return false;\n }\n if (typeof data === 'string') {\n return false;\n }\n return typeof data.length === 'number';\n}\nexport function each(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n if (arr.forEach && arr.forEach === nativeForEach) {\n arr.forEach(cb, context);\n }\n else if (arr.length === +arr.length) {\n for (var i = 0, len = arr.length; i < len; i++) {\n cb.call(context, arr[i], i, arr);\n }\n }\n else {\n for (var key in arr) {\n if (arr.hasOwnProperty(key)) {\n cb.call(context, arr[key], key, arr);\n }\n }\n }\n}\nexport function map(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.map && arr.map === nativeMap) {\n return arr.map(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n result.push(cb.call(context, arr[i], i, arr));\n }\n return result;\n }\n}\nexport function reduce(arr, cb, memo, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n memo = cb.call(context, memo, arr[i], i, arr);\n }\n return memo;\n}\nexport function filter(arr, cb, context) {\n if (!arr) {\n return [];\n }\n if (!cb) {\n return slice(arr);\n }\n if (arr.filter && arr.filter === nativeFilter) {\n return arr.filter(cb, context);\n }\n else {\n var result = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n}\nexport function find(arr, cb, context) {\n if (!(arr && cb)) {\n return;\n }\n for (var i = 0, len = arr.length; i < len; i++) {\n if (cb.call(context, arr[i], i, arr)) {\n return arr[i];\n }\n }\n}\nexport function keys(obj) {\n if (!obj) {\n return [];\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keyList = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keyList.push(key);\n }\n }\n return keyList;\n}\nfunction bindPolyfill(func, context) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport var bind = (protoFunction && isFunction(protoFunction.bind))\n ? protoFunction.call.bind(protoFunction.bind)\n : bindPolyfill;\nfunction curry(func) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\nexport { curry };\nexport function isArray(value) {\n if (Array.isArray) {\n return Array.isArray(value);\n }\n return objToString.call(value) === '[object Array]';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isString(value) {\n return typeof value === 'string';\n}\nexport function isStringSafe(value) {\n return objToString.call(value) === '[object String]';\n}\nexport function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isObject(value) {\n var type = typeof value;\n return type === 'function' || (!!value && type === 'object');\n}\nexport function isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\nexport function isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\nexport function isDom(value) {\n return typeof value === 'object'\n && typeof value.nodeType === 'number'\n && typeof value.ownerDocument === 'object';\n}\nexport function isGradientObject(value) {\n return value.colorStops != null;\n}\nexport function isImagePatternObject(value) {\n return value.image != null;\n}\nexport function isRegExp(value) {\n return objToString.call(value) === '[object RegExp]';\n}\nexport function eqNaN(value) {\n return value !== value;\n}\nexport function retrieve() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0, len = args.length; i < len; i++) {\n if (args[i] != null) {\n return args[i];\n }\n }\n}\nexport function retrieve2(value0, value1) {\n return value0 != null\n ? value0\n : value1;\n}\nexport function retrieve3(value0, value1, value2) {\n return value0 != null\n ? value0\n : value1 != null\n ? value1\n : value2;\n}\nexport function slice(arr) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return nativeSlice.apply(arr, args);\n}\nexport function normalizeCssArray(val) {\n if (typeof (val) === 'number') {\n return [val, val, val, val];\n }\n var len = val.length;\n if (len === 2) {\n return [val[0], val[1], val[0], val[1]];\n }\n else if (len === 3) {\n return [val[0], val[1], val[2], val[1]];\n }\n return val;\n}\nexport function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\nexport function trim(str) {\n if (str == null) {\n return null;\n }\n else if (typeof str.trim === 'function') {\n return str.trim();\n }\n else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\nvar primitiveKey = '__ec_primitive__';\nexport function setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\nexport function isPrimitive(obj) {\n return obj[primitiveKey];\n}\nvar MapPolyfill = (function () {\n function MapPolyfill() {\n this.data = {};\n }\n MapPolyfill.prototype[\"delete\"] = function (key) {\n var existed = this.has(key);\n if (existed) {\n delete this.data[key];\n }\n return existed;\n };\n MapPolyfill.prototype.has = function (key) {\n return this.data.hasOwnProperty(key);\n };\n MapPolyfill.prototype.get = function (key) {\n return this.data[key];\n };\n MapPolyfill.prototype.set = function (key, value) {\n this.data[key] = value;\n return this;\n };\n MapPolyfill.prototype.keys = function () {\n return keys(this.data);\n };\n MapPolyfill.prototype.forEach = function (callback) {\n var data = this.data;\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n callback(data[key], key);\n }\n }\n };\n return MapPolyfill;\n}());\nvar isNativeMapSupported = typeof Map === 'function';\nfunction maybeNativeMap() {\n return (isNativeMapSupported ? new Map() : new MapPolyfill());\n}\nvar HashMap = (function () {\n function HashMap(obj) {\n var isArr = isArray(obj);\n this.data = maybeNativeMap();\n var thisMap = this;\n (obj instanceof HashMap)\n ? obj.each(visit)\n : (obj && each(obj, visit));\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n }\n HashMap.prototype.hasKey = function (key) {\n return this.data.has(key);\n };\n HashMap.prototype.get = function (key) {\n return this.data.get(key);\n };\n HashMap.prototype.set = function (key, value) {\n this.data.set(key, value);\n return value;\n };\n HashMap.prototype.each = function (cb, context) {\n this.data.forEach(function (value, key) {\n cb.call(context, value, key);\n });\n };\n HashMap.prototype.keys = function () {\n var keys = this.data.keys();\n return isNativeMapSupported\n ? Array.from(keys)\n : keys;\n };\n HashMap.prototype.removeKey = function (key) {\n this.data[\"delete\"](key);\n };\n return HashMap;\n}());\nexport { HashMap };\nexport function createHashMap(obj) {\n return new HashMap(obj);\n}\nexport function concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n var offset = a.length;\n for (var i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n return newArray;\n}\nexport function createObject(proto, properties) {\n var obj;\n if (Object.create) {\n obj = Object.create(proto);\n }\n else {\n var StyleCtor = function () { };\n StyleCtor.prototype = proto;\n obj = new StyleCtor();\n }\n if (properties) {\n extend(obj, properties);\n }\n return obj;\n}\nexport function disableUserSelect(dom) {\n var domStyle = dom.style;\n domStyle.webkitUserSelect = 'none';\n domStyle.userSelect = 'none';\n domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';\n domStyle['-webkit-touch-callout'] = 'none';\n}\nexport function hasOwn(own, prop) {\n return own.hasOwnProperty(prop);\n}\nexport function noop() { }\nexport var RADIAN_TO_DEGREE = 180 / Math.PI;\n","export function create(x, y) {\n if (x == null) {\n x = 0;\n }\n if (y == null) {\n y = 0;\n }\n return [x, y];\n}\nexport function copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\nexport function clone(v) {\n return [v[0], v[1]];\n}\nexport function set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\nexport function add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\nexport function 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}\nexport function sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\nexport function len(v) {\n return Math.sqrt(lenSquare(v));\n}\nexport var length = len;\nexport function lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\nexport var lengthSquare = lenSquare;\nexport function mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\nexport function div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\nexport function dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\nexport function scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\nexport function normalize(out, v) {\n var d = len(v);\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n }\n else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n return out;\n}\nexport function distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\nexport var dist = distance;\nexport function distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0])\n + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\nexport var distSquare = distanceSquare;\nexport function negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\nexport function 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}\nexport function 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}\nexport function 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}\nexport function 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","var Param = (function () {\n function Param(target, e) {\n this.target = target;\n this.topTarget = e && e.topTarget;\n }\n return Param;\n}());\nvar Draggable = (function () {\n function Draggable(handler) {\n this.handler = handler;\n handler.on('mousedown', this._dragStart, this);\n handler.on('mousemove', this._drag, this);\n handler.on('mouseup', this._dragEnd, this);\n }\n Draggable.prototype._dragStart = function (e) {\n var draggingTarget = e.target;\n while (draggingTarget && !draggingTarget.draggable) {\n draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;\n }\n if (draggingTarget) {\n this._draggingTarget = draggingTarget;\n draggingTarget.dragging = true;\n this._x = e.offsetX;\n this._y = e.offsetY;\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);\n }\n };\n Draggable.prototype._drag = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n var x = e.offsetX;\n var y = e.offsetY;\n var dx = x - this._x;\n var dy = y - this._y;\n this._x = x;\n this._y = y;\n draggingTarget.drift(dx, dy, e);\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);\n var dropTarget = this.handler.findHover(x, y, draggingTarget).target;\n var lastDropTarget = this._dropTarget;\n this._dropTarget = dropTarget;\n if (draggingTarget !== dropTarget) {\n if (lastDropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);\n }\n if (dropTarget && dropTarget !== lastDropTarget) {\n this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);\n }\n }\n }\n };\n Draggable.prototype._dragEnd = function (e) {\n var draggingTarget = this._draggingTarget;\n if (draggingTarget) {\n draggingTarget.dragging = false;\n }\n this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);\n if (this._dropTarget) {\n this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);\n }\n this._draggingTarget = null;\n this._dropTarget = null;\n };\n return Draggable;\n}());\nexport default Draggable;\n","var Eventful = (function () {\n function Eventful(eventProcessors) {\n if (eventProcessors) {\n this._$eventProcessor = eventProcessors;\n }\n }\n Eventful.prototype.on = function (event, query, handler, context) {\n if (!this._$handlers) {\n this._$handlers = {};\n }\n var _h = this._$handlers;\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n if (!handler || !event) {\n return this;\n }\n var eventProcessor = this._$eventProcessor;\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n if (!_h[event]) {\n _h[event] = [];\n }\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return this;\n }\n }\n var wrap = {\n h: handler,\n query: query,\n ctx: (context || this),\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n (lastWrap && lastWrap.callAtLast)\n ? _h[event].splice(lastIndex, 0, wrap)\n : _h[event].push(wrap);\n return this;\n };\n Eventful.prototype.isSilent = function (eventName) {\n var _h = this._$handlers;\n return !_h || !_h[eventName] || !_h[eventName].length;\n };\n Eventful.prototype.off = function (eventType, handler) {\n var _h = this._$handlers;\n if (!_h) {\n return this;\n }\n if (!eventType) {\n this._$handlers = {};\n return this;\n }\n if (handler) {\n if (_h[eventType]) {\n var newList = [];\n for (var i = 0, l = _h[eventType].length; i < l; i++) {\n if (_h[eventType][i].h !== handler) {\n newList.push(_h[eventType][i]);\n }\n }\n _h[eventType] = newList;\n }\n if (_h[eventType] && _h[eventType].length === 0) {\n delete _h[eventType];\n }\n }\n else {\n delete _h[eventType];\n }\n return this;\n };\n Eventful.prototype.trigger = function (eventType) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[eventType];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(eventType, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(hItem.ctx);\n break;\n case 1:\n hItem.h.call(hItem.ctx, args[0]);\n break;\n case 2:\n hItem.h.call(hItem.ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(eventType);\n return this;\n };\n Eventful.prototype.triggerWithContext = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!this._$handlers) {\n return this;\n }\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n if (_h) {\n var argLen = args.length;\n var ctx = args[argLen - 1];\n var len = _h.length;\n for (var i = 0; i < len; i++) {\n var hItem = _h[i];\n if (eventProcessor\n && eventProcessor.filter\n && hItem.query != null\n && !eventProcessor.filter(type, hItem.query)) {\n continue;\n }\n switch (argLen) {\n case 0:\n hItem.h.call(ctx);\n break;\n case 1:\n hItem.h.call(ctx, args[0]);\n break;\n case 2:\n hItem.h.call(ctx, args[0], args[1]);\n break;\n default:\n hItem.h.apply(ctx, args.slice(1, argLen - 1));\n break;\n }\n }\n }\n eventProcessor && eventProcessor.afterTrigger\n && eventProcessor.afterTrigger(type);\n return this;\n };\n return Eventful;\n}());\nexport default Eventful;\n","var LN2 = Math.log(2);\nfunction determinant(rows, rank, rowStart, rowMask, colMask, detCache) {\n var cacheKey = rowMask + '-' + colMask;\n var fullRank = rows.length;\n if (detCache.hasOwnProperty(cacheKey)) {\n return detCache[cacheKey];\n }\n if (rank === 1) {\n var colStart = Math.round(Math.log(((1 << fullRank) - 1) & ~colMask) / LN2);\n return rows[rowStart][colStart];\n }\n var subRowMask = rowMask | (1 << rowStart);\n var subRowStart = rowStart + 1;\n while (rowMask & (1 << subRowStart)) {\n subRowStart++;\n }\n var sum = 0;\n for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {\n var colTag = 1 << j;\n if (!(colTag & colMask)) {\n sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j]\n * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);\n colLocalIdx++;\n }\n }\n detCache[cacheKey] = sum;\n return sum;\n}\nexport function buildTransformer(src, dest) {\n var mA = [\n [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],\n [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],\n [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],\n [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],\n [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],\n [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],\n [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],\n [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]\n ];\n var detCache = {};\n var det = determinant(mA, 8, 0, 0, 0, detCache);\n if (det === 0) {\n return;\n }\n var vh = [];\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 8; j++) {\n vh[j] == null && (vh[j] = 0);\n vh[j] += ((i + j) % 2 ? -1 : 1)\n * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache)\n / det * dest[i];\n }\n }\n return function (out, srcPointX, srcPointY) {\n var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;\n out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;\n out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;\n };\n}\n","import env from './env.js';\nimport { buildTransformer } from './fourPointsTransform.js';\nvar EVENT_SAVED_PROP = '___zrEVENTSAVED';\nvar _calcOut = [];\nexport function transformLocalCoord(out, elFrom, elTarget, inX, inY) {\n return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true)\n && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);\n}\nexport function transformCoordWithViewport(out, el, inX, inY, inverse) {\n if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {\n var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});\n var markers = prepareCoordMarkers(el, saved);\n var transformer = preparePointerTransformer(markers, saved, inverse);\n if (transformer) {\n transformer(out, inX, inY);\n return true;\n }\n }\n return false;\n}\nfunction prepareCoordMarkers(el, saved) {\n var markers = saved.markers;\n if (markers) {\n return markers;\n }\n markers = saved.markers = [];\n var propLR = ['left', 'right'];\n var propTB = ['top', 'bottom'];\n for (var i = 0; i < 4; i++) {\n var marker = document.createElement('div');\n var stl = marker.style;\n var idxLR = i % 2;\n var idxTB = (i >> 1) % 2;\n stl.cssText = [\n 'position: absolute',\n 'visibility: hidden',\n 'padding: 0',\n 'margin: 0',\n 'border-width: 0',\n 'user-select: none',\n 'width:0',\n 'height:0',\n propLR[idxLR] + ':0',\n propTB[idxTB] + ':0',\n propLR[1 - idxLR] + ':auto',\n propTB[1 - idxTB] + ':auto',\n ''\n ].join('!important;');\n el.appendChild(marker);\n markers.push(marker);\n }\n return markers;\n}\nfunction preparePointerTransformer(markers, saved, inverse) {\n var transformerName = inverse ? 'invTrans' : 'trans';\n var transformer = saved[transformerName];\n var oldSrcCoords = saved.srcCoords;\n var srcCoords = [];\n var destCoords = [];\n var oldCoordTheSame = true;\n for (var i = 0; i < 4; i++) {\n var rect = markers[i].getBoundingClientRect();\n var ii = 2 * i;\n var x = rect.left;\n var y = rect.top;\n srcCoords.push(x, y);\n oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];\n destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);\n }\n return (oldCoordTheSame && transformer)\n ? transformer\n : (saved.srcCoords = srcCoords,\n saved[transformerName] = inverse\n ? buildTransformer(destCoords, srcCoords)\n : buildTransformer(srcCoords, destCoords));\n}\nexport function isCanvasEl(el) {\n return el.nodeName.toUpperCase() === 'CANVAS';\n}\nvar replaceReg = /([&<>\"'])/g;\nvar replaceMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': '''\n};\nexport function encodeHTML(source) {\n return source == null\n ? ''\n : (source + '').replace(replaceReg, function (str, c) {\n return replaceMap[c];\n });\n}\n","import Eventful from './Eventful.js';\nimport env from './env.js';\nimport { isCanvasEl, transformCoordWithViewport } from './dom.js';\nvar MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;\nvar _calcOut = [];\nvar firefoxNotSupportOffsetXY = env.browser.firefox\n && +env.browser.version.split('.')[0] < 39;\nexport function clientToLocal(el, e, out, calculate) {\n out = out || {};\n if (calculate) {\n calculateZrXY(el, e, out);\n }\n else if (firefoxNotSupportOffsetXY\n && e.layerX != null\n && e.layerX !== e.offsetX) {\n out.zrX = e.layerX;\n out.zrY = e.layerY;\n }\n else if (e.offsetX != null) {\n out.zrX = e.offsetX;\n out.zrY = e.offsetY;\n }\n else {\n calculateZrXY(el, e, out);\n }\n return out;\n}\nfunction calculateZrXY(el, e, out) {\n if (env.domSupported && el.getBoundingClientRect) {\n var ex = e.clientX;\n var ey = e.clientY;\n if (isCanvasEl(el)) {\n var box = el.getBoundingClientRect();\n out.zrX = ex - box.left;\n out.zrY = ey - box.top;\n return;\n }\n else {\n if (transformCoordWithViewport(_calcOut, el, ex, ey)) {\n out.zrX = _calcOut[0];\n out.zrY = _calcOut[1];\n return;\n }\n }\n }\n out.zrX = out.zrY = 0;\n}\nexport function getNativeEvent(e) {\n return e\n || window.event;\n}\nexport function normalizeEvent(el, e, calculate) {\n e = getNativeEvent(e);\n if (e.zrX != null) {\n return e;\n }\n var eventType = e.type;\n var isTouch = eventType && eventType.indexOf('touch') >= 0;\n if (!isTouch) {\n clientToLocal(el, e, e, calculate);\n var wheelDelta = getWheelDeltaMayPolyfill(e);\n e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;\n }\n else {\n var touch = eventType !== 'touchend'\n ? e.targetTouches[0]\n : e.changedTouches[0];\n touch && clientToLocal(el, touch, e, calculate);\n }\n var button = e.button;\n if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {\n e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));\n }\n return e;\n}\nfunction getWheelDeltaMayPolyfill(e) {\n var rawWheelDelta = e.wheelDelta;\n if (rawWheelDelta) {\n return rawWheelDelta;\n }\n var deltaX = e.deltaX;\n var deltaY = e.deltaY;\n if (deltaX == null || deltaY == null) {\n return rawWheelDelta;\n }\n var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);\n var sign = deltaY > 0 ? -1\n : deltaY < 0 ? 1\n : deltaX > 0 ? -1\n : 1;\n return 3 * delta * sign;\n}\nexport function addEventListener(el, name, handler, opt) {\n el.addEventListener(name, handler, opt);\n}\nexport function removeEventListener(el, name, handler, opt) {\n el.removeEventListener(name, handler, opt);\n}\nexport var stop = function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.cancelBubble = true;\n};\nexport function isMiddleOrRightButtonOnMouseUpDown(e) {\n return e.which === 2 || e.which === 3;\n}\nexport { Eventful as Dispatcher };\n","import * as eventUtil from './event.js';\nvar GestureMgr = (function () {\n function GestureMgr() {\n this._track = [];\n }\n GestureMgr.prototype.recognize = function (event, target, root) {\n this._doTrack(event, target, root);\n return this._recognize(event);\n };\n GestureMgr.prototype.clear = function () {\n this._track.length = 0;\n return this;\n };\n GestureMgr.prototype._doTrack = function (event, target, root) {\n var touches = event.touches;\n if (!touches) {\n return;\n }\n var trackItem = {\n points: [],\n touches: [],\n target: target,\n event: event\n };\n for (var i = 0, len = touches.length; i < len; i++) {\n var touch = touches[i];\n var pos = eventUtil.clientToLocal(root, touch, {});\n trackItem.points.push([pos.zrX, pos.zrY]);\n trackItem.touches.push(touch);\n }\n this._track.push(trackItem);\n };\n GestureMgr.prototype._recognize = function (event) {\n for (var eventName in recognizers) {\n if (recognizers.hasOwnProperty(eventName)) {\n var gestureInfo = recognizers[eventName](this._track, event);\n if (gestureInfo) {\n return gestureInfo;\n }\n }\n }\n };\n return GestureMgr;\n}());\nexport { GestureMgr };\nfunction dist(pointPair) {\n var dx = pointPair[1][0] - pointPair[0][0];\n var dy = pointPair[1][1] - pointPair[0][1];\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction center(pointPair) {\n return [\n (pointPair[0][0] + pointPair[1][0]) / 2,\n (pointPair[0][1] + pointPair[1][1]) / 2\n ];\n}\nvar recognizers = {\n pinch: function (tracks, event) {\n var trackLen = tracks.length;\n if (!trackLen) {\n return;\n }\n var pinchEnd = (tracks[trackLen - 1] || {}).points;\n var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;\n if (pinchPre\n && pinchPre.length > 1\n && pinchEnd\n && pinchEnd.length > 1) {\n var pinchScale = dist(pinchEnd) / dist(pinchPre);\n !isFinite(pinchScale) && (pinchScale = 1);\n event.pinchScale = pinchScale;\n var pinchCenter = center(pinchEnd);\n event.pinchX = pinchCenter[0];\n event.pinchY = pinchCenter[1];\n return {\n type: 'pinch',\n target: tracks[0].target,\n event: event\n };\n }\n }\n};\n","export function create() {\n return [1, 0, 0, 1, 0, 0];\n}\nexport function 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}\nexport function 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}\nexport function mul(out, m1, m2) {\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}\nexport function 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}\nexport function 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}\nexport function 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}\nexport function 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 if (!det) {\n return null;\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}\nexport function clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n","var Point = (function () {\n function Point(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n Point.prototype.copy = function (other) {\n this.x = other.x;\n this.y = other.y;\n return this;\n };\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n Point.prototype.set = function (x, y) {\n this.x = x;\n this.y = y;\n return this;\n };\n Point.prototype.equal = function (other) {\n return other.x === this.x && other.y === this.y;\n };\n Point.prototype.add = function (other) {\n this.x += other.x;\n this.y += other.y;\n return this;\n };\n Point.prototype.scale = function (scalar) {\n this.x *= scalar;\n this.y *= scalar;\n };\n Point.prototype.scaleAndAdd = function (other, scalar) {\n this.x += other.x * scalar;\n this.y += other.y * scalar;\n };\n Point.prototype.sub = function (other) {\n this.x -= other.x;\n this.y -= other.y;\n return this;\n };\n Point.prototype.dot = function (other) {\n return this.x * other.x + this.y * other.y;\n };\n Point.prototype.len = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n };\n Point.prototype.lenSquare = function () {\n return this.x * this.x + this.y * this.y;\n };\n Point.prototype.normalize = function () {\n var len = this.len();\n this.x /= len;\n this.y /= len;\n return this;\n };\n Point.prototype.distance = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return Math.sqrt(dx * dx + dy * dy);\n };\n Point.prototype.distanceSquare = function (other) {\n var dx = this.x - other.x;\n var dy = this.y - other.y;\n return dx * dx + dy * dy;\n };\n Point.prototype.negate = function () {\n this.x = -this.x;\n this.y = -this.y;\n return this;\n };\n Point.prototype.transform = function (m) {\n if (!m) {\n return;\n }\n var x = this.x;\n var y = this.y;\n this.x = m[0] * x + m[2] * y + m[4];\n this.y = m[1] * x + m[3] * y + m[5];\n return this;\n };\n Point.prototype.toArray = function (out) {\n out[0] = this.x;\n out[1] = this.y;\n return out;\n };\n Point.prototype.fromArray = function (input) {\n this.x = input[0];\n this.y = input[1];\n };\n Point.set = function (p, x, y) {\n p.x = x;\n p.y = y;\n };\n Point.copy = function (p, p2) {\n p.x = p2.x;\n p.y = p2.y;\n };\n Point.len = function (p) {\n return Math.sqrt(p.x * p.x + p.y * p.y);\n };\n Point.lenSquare = function (p) {\n return p.x * p.x + p.y * p.y;\n };\n Point.dot = function (p0, p1) {\n return p0.x * p1.x + p0.y * p1.y;\n };\n Point.add = function (out, p0, p1) {\n out.x = p0.x + p1.x;\n out.y = p0.y + p1.y;\n };\n Point.sub = function (out, p0, p1) {\n out.x = p0.x - p1.x;\n out.y = p0.y - p1.y;\n };\n Point.scale = function (out, p0, scalar) {\n out.x = p0.x * scalar;\n out.y = p0.y * scalar;\n };\n Point.scaleAndAdd = function (out, p0, p1, scalar) {\n out.x = p0.x + p1.x * scalar;\n out.y = p0.y + p1.y * scalar;\n };\n Point.lerp = function (out, p0, p1, t) {\n var onet = 1 - t;\n out.x = onet * p0.x + t * p1.x;\n out.y = onet * p0.y + t * p1.y;\n };\n return Point;\n}());\nexport default Point;\n","import * as matrix from './matrix.js';\nimport Point from './Point.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar lt = new Point();\nvar rb = new Point();\nvar lb = new Point();\nvar rt = new Point();\nvar minTv = new Point();\nvar maxTv = new Point();\nvar BoundingRect = (function () {\n function BoundingRect(x, y, width, height) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n BoundingRect.prototype.union = function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n if (isFinite(this.x) && isFinite(this.width)) {\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n }\n else {\n this.width = other.width;\n }\n if (isFinite(this.y) && isFinite(this.height)) {\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n }\n else {\n this.height = other.height;\n }\n this.x = x;\n this.y = y;\n };\n BoundingRect.prototype.applyTransform = function (m) {\n BoundingRect.applyTransform(this, this, m);\n };\n BoundingRect.prototype.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 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 BoundingRect.prototype.intersect = function (b, mtv) {\n if (!b) {\n return false;\n }\n if (!(b instanceof BoundingRect)) {\n b = BoundingRect.create(b);\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 var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n if (mtv) {\n var dMin = Infinity;\n var dMax = 0;\n var d0 = Math.abs(ax1 - bx0);\n var d1 = Math.abs(bx1 - ax0);\n var d2 = Math.abs(ay1 - by0);\n var d3 = Math.abs(by1 - ay0);\n var dx = Math.min(d0, d1);\n var dy = Math.min(d2, d3);\n if (ax1 < bx0 || bx1 < ax0) {\n if (dx > dMax) {\n dMax = dx;\n if (d0 < d1) {\n Point.set(maxTv, -d0, 0);\n }\n else {\n Point.set(maxTv, d1, 0);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d0 < d1) {\n Point.set(minTv, d0, 0);\n }\n else {\n Point.set(minTv, -d1, 0);\n }\n }\n }\n if (ay1 < by0 || by1 < ay0) {\n if (dy > dMax) {\n dMax = dy;\n if (d2 < d3) {\n Point.set(maxTv, 0, -d2);\n }\n else {\n Point.set(maxTv, 0, d3);\n }\n }\n }\n else {\n if (dx < dMin) {\n dMin = dx;\n if (d2 < d3) {\n Point.set(minTv, 0, d2);\n }\n else {\n Point.set(minTv, 0, -d3);\n }\n }\n }\n }\n if (mtv) {\n Point.copy(mtv, overlap ? minTv : maxTv);\n }\n return overlap;\n };\n BoundingRect.prototype.contain = function (x, y) {\n var rect = this;\n return x >= rect.x\n && x <= (rect.x + rect.width)\n && y >= rect.y\n && y <= (rect.y + rect.height);\n };\n BoundingRect.prototype.clone = function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n };\n BoundingRect.prototype.copy = function (other) {\n BoundingRect.copy(this, other);\n };\n BoundingRect.prototype.plain = function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n };\n BoundingRect.prototype.isFinite = function () {\n return isFinite(this.x)\n && isFinite(this.y)\n && isFinite(this.width)\n && isFinite(this.height);\n };\n BoundingRect.prototype.isZero = function () {\n return this.width === 0 || this.height === 0;\n };\n BoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n };\n BoundingRect.copy = function (target, source) {\n target.x = source.x;\n target.y = source.y;\n target.width = source.width;\n target.height = source.height;\n };\n BoundingRect.applyTransform = function (target, source, m) {\n if (!m) {\n if (target !== source) {\n BoundingRect.copy(target, source);\n }\n return;\n }\n if (m[1] < 1e-5 && m[1] > -1e-5 && m[2] < 1e-5 && m[2] > -1e-5) {\n var sx = m[0];\n var sy = m[3];\n var tx = m[4];\n var ty = m[5];\n target.x = source.x * sx + tx;\n target.y = source.y * sy + ty;\n target.width = source.width * sx;\n target.height = source.height * sy;\n if (target.width < 0) {\n target.x += target.width;\n target.width = -target.width;\n }\n if (target.height < 0) {\n target.y += target.height;\n target.height = -target.height;\n }\n return;\n }\n lt.x = lb.x = source.x;\n lt.y = rt.y = source.y;\n rb.x = rt.x = source.x + source.width;\n rb.y = lb.y = source.y + source.height;\n lt.transform(m);\n rt.transform(m);\n rb.transform(m);\n lb.transform(m);\n target.x = mathMin(lt.x, rb.x, lb.x, rt.x);\n target.y = mathMin(lt.y, rb.y, lb.y, rt.y);\n var maxX = mathMax(lt.x, rb.x, lb.x, rt.x);\n var maxY = mathMax(lt.y, rb.y, lb.y, rt.y);\n target.width = maxX - target.x;\n target.height = maxY - target.y;\n };\n return BoundingRect;\n}());\nexport default BoundingRect;\n","import { __extends } from \"tslib\";\nimport * as util from './core/util.js';\nimport * as vec2 from './core/vector.js';\nimport Draggable from './mixin/Draggable.js';\nimport Eventful from './core/Eventful.js';\nimport * as eventTool from './core/event.js';\nimport { GestureMgr } from './core/GestureMgr.js';\nimport BoundingRect from './core/BoundingRect.js';\nvar SILENT = 'silent';\nfunction makeEventPacket(eveType, targetInfo, event) {\n return {\n type: eveType,\n event: event,\n target: targetInfo.target,\n topTarget: targetInfo.topTarget,\n cancelBubble: false,\n offsetX: event.zrX,\n offsetY: event.zrY,\n gestureEvent: event.gestureEvent,\n pinchX: event.pinchX,\n pinchY: event.pinchY,\n pinchScale: event.pinchScale,\n wheelDelta: event.zrDelta,\n zrByTouch: event.zrByTouch,\n which: event.which,\n stop: stopEvent\n };\n}\nfunction stopEvent() {\n eventTool.stop(this.event);\n}\nvar EmptyProxy = (function (_super) {\n __extends(EmptyProxy, _super);\n function EmptyProxy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handler = null;\n return _this;\n }\n EmptyProxy.prototype.dispose = function () { };\n EmptyProxy.prototype.setCursor = function () { };\n return EmptyProxy;\n}(Eventful));\nvar HoveredResult = (function () {\n function HoveredResult(x, y) {\n this.x = x;\n this.y = y;\n }\n return HoveredResult;\n}());\nvar handlerNames = [\n 'click', 'dblclick', 'mousewheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n];\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar Handler = (function (_super) {\n __extends(Handler, _super);\n function Handler(storage, painter, proxy, painterRoot, pointerSize) {\n var _this = _super.call(this) || this;\n _this._hovered = new HoveredResult(0, 0);\n _this.storage = storage;\n _this.painter = painter;\n _this.painterRoot = painterRoot;\n _this._pointerSize = pointerSize;\n proxy = proxy || new EmptyProxy();\n _this.proxy = null;\n _this.setHandlerProxy(proxy);\n _this._draggingMgr = new Draggable(_this);\n return _this;\n }\n Handler.prototype.setHandlerProxy = function (proxy) {\n if (this.proxy) {\n this.proxy.dispose();\n }\n if (proxy) {\n util.each(handlerNames, function (name) {\n proxy.on && proxy.on(name, this[name], this);\n }, this);\n proxy.handler = this;\n }\n this.proxy = proxy;\n };\n Handler.prototype.mousemove = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var lastHovered = this._hovered;\n var lastHoveredTarget = lastHovered.target;\n if (lastHoveredTarget && !lastHoveredTarget.__zr) {\n lastHovered = this.findHover(lastHovered.x, lastHovered.y);\n lastHoveredTarget = lastHovered.target;\n }\n var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);\n var hoveredTarget = hovered.target;\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');\n if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(lastHovered, 'mouseout', event);\n }\n this.dispatchToElement(hovered, 'mousemove', event);\n if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {\n this.dispatchToElement(hovered, 'mouseover', event);\n }\n };\n Handler.prototype.mouseout = function (event) {\n var eventControl = event.zrEventControl;\n if (eventControl !== 'only_globalout') {\n this.dispatchToElement(this._hovered, 'mouseout', event);\n }\n if (eventControl !== 'no_globalout') {\n this.trigger('globalout', { type: 'globalout', event: event });\n }\n };\n Handler.prototype.resize = function () {\n this._hovered = new HoveredResult(0, 0);\n };\n Handler.prototype.dispatch = function (eventName, eventArgs) {\n var handler = this[eventName];\n handler && handler.call(this, eventArgs);\n };\n Handler.prototype.dispose = function () {\n this.proxy.dispose();\n this.storage = null;\n this.proxy = null;\n this.painter = null;\n };\n Handler.prototype.setCursorStyle = function (cursorStyle) {\n var proxy = this.proxy;\n proxy.setCursor && proxy.setCursor(cursorStyle);\n };\n Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {\n targetInfo = targetInfo || {};\n var el = targetInfo.target;\n if (el && el.silent) {\n return;\n }\n var eventKey = ('on' + eventName);\n var eventPacket = makeEventPacket(eventName, targetInfo, event);\n while (el) {\n el[eventKey]\n && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));\n el.trigger(eventName, eventPacket);\n el = el.__hostTarget ? el.__hostTarget : el.parent;\n if (eventPacket.cancelBubble) {\n break;\n }\n }\n if (!eventPacket.cancelBubble) {\n this.trigger(eventName, eventPacket);\n if (this.painter && this.painter.eachOtherLayer) {\n this.painter.eachOtherLayer(function (layer) {\n if (typeof (layer[eventKey]) === 'function') {\n layer[eventKey].call(layer, eventPacket);\n }\n if (layer.trigger) {\n layer.trigger(eventName, eventPacket);\n }\n });\n }\n }\n };\n Handler.prototype.findHover = function (x, y, exclude) {\n var list = this.storage.getDisplayList();\n var out = new HoveredResult(x, y);\n setHoverTarget(list, out, x, y, exclude);\n if (this._pointerSize && !out.target) {\n var candidates = [];\n var pointerSize = this._pointerSize;\n var targetSizeHalf = pointerSize / 2;\n var pointerRect = new BoundingRect(x - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n if (el !== exclude\n && !el.ignore\n && !el.ignoreCoarsePointer\n && (!el.parent || !el.parent.ignoreCoarsePointer)) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n if (tmpRect.intersect(pointerRect)) {\n candidates.push(el);\n }\n }\n }\n if (candidates.length) {\n var rStep = 4;\n var thetaStep = Math.PI / 12;\n var PI2 = Math.PI * 2;\n for (var r = 0; r < targetSizeHalf; r += rStep) {\n for (var theta = 0; theta < PI2; theta += thetaStep) {\n var x1 = x + r * Math.cos(theta);\n var y1 = y + r * Math.sin(theta);\n setHoverTarget(candidates, out, x1, y1, exclude);\n if (out.target) {\n return out;\n }\n }\n }\n }\n }\n return out;\n };\n Handler.prototype.processGesture = function (event, stage) {\n if (!this._gestureMgr) {\n this._gestureMgr = new GestureMgr();\n }\n var gestureMgr = this._gestureMgr;\n stage === 'start' && gestureMgr.clear();\n var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);\n stage === 'end' && gestureMgr.clear();\n if (gestureInfo) {\n var type = gestureInfo.type;\n event.gestureEvent = type;\n var res = new HoveredResult();\n res.target = gestureInfo.target;\n this.dispatchToElement(res, type, gestureInfo.event);\n }\n };\n return Handler;\n}(Eventful));\nutil.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {\n Handler.prototype[name] = function (event) {\n var x = event.zrX;\n var y = event.zrY;\n var isOutside = isOutsideBoundary(this, x, y);\n var hovered;\n var hoveredTarget;\n if (name !== 'mouseup' || !isOutside) {\n hovered = this.findHover(x, y);\n hoveredTarget = hovered.target;\n }\n if (name === 'mousedown') {\n this._downEl = hoveredTarget;\n this._downPoint = [event.zrX, event.zrY];\n this._upEl = hoveredTarget;\n }\n else if (name === 'mouseup') {\n this._upEl = hoveredTarget;\n }\n else if (name === 'click') {\n if (this._downEl !== this._upEl\n || !this._downPoint\n || vec2.dist(this._downPoint, [event.zrX, event.zrY]) > 4) {\n return;\n }\n this._downPoint = null;\n }\n this.dispatchToElement(hovered, name, event);\n };\n});\nfunction isHover(displayable, x, y) {\n if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {\n var el = displayable;\n var isSilent = void 0;\n var ignoreClip = false;\n while (el) {\n if (el.ignoreClip) {\n ignoreClip = true;\n }\n if (!ignoreClip) {\n var clipPath = el.getClipPath();\n if (clipPath && !clipPath.contain(x, y)) {\n return false;\n }\n if (el.silent) {\n isSilent = true;\n }\n }\n var hostEl = el.__hostTarget;\n el = hostEl ? hostEl : el.parent;\n }\n return isSilent ? SILENT : true;\n }\n return false;\n}\nfunction setHoverTarget(list, out, x, y, exclude) {\n for (var i = list.length - 1; i >= 0; i--) {\n var el = list[i];\n var hoverCheckResult = void 0;\n if (el !== exclude\n && !el.ignore\n && (hoverCheckResult = isHover(el, x, y))) {\n !out.topTarget && (out.topTarget = el);\n if (hoverCheckResult !== SILENT) {\n out.target = el;\n break;\n }\n }\n }\n}\nfunction isOutsideBoundary(handlerInstance, x, y) {\n var painter = handlerInstance.painter;\n return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();\n}\nexport default Handler;\n","var DEFAULT_MIN_MERGE = 32;\nvar DEFAULT_MIN_GALLOPING = 7;\nvar DEFAULT_TMP_STORAGE_LENGTH = 256;\nfunction minRunLength(n) {\n var r = 0;\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n return n + r;\n}\nfunction makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n if (runHi === hi) {\n return 1;\n }\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n reverseRun(array, lo, runHi);\n }\n else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n return runHi - lo;\n}\nfunction reverseRun(array, lo, hi) {\n hi--;\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n}\nfunction binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n for (; start < hi; start++) {\n var pivot = array[start];\n var left = lo;\n var right = start;\n var mid;\n while (left < right) {\n mid = left + right >>> 1;\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n }\n else {\n left = mid + 1;\n }\n }\n var n = start - left;\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n case 2:\n array[left + 2] = array[left + 1];\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n array[left] = pivot;\n }\n}\nfunction gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n }\n else {\n offset = m;\n }\n }\n return offset;\n}\nfunction gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n else {\n maxOffset = length - hint;\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n lastOffset += hint;\n offset += hint;\n }\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n }\n else {\n lastOffset = m + 1;\n }\n }\n return offset;\n}\nfunction TimSort(array, compare) {\n var minGallop = DEFAULT_MIN_GALLOPING;\n var length = 0;\n var tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;\n var stackLength = 0;\n var runStart;\n var runLength;\n var stackSize = 0;\n length = array.length;\n if (length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {\n tmpStorageLength = length >>> 1;\n }\n var tmp = [];\n stackLength = length < 120 ? 5 : length < 1542 ? 10 : length < 119151 ? 19 : 40;\n runStart = [];\n runLength = [];\n function pushRun(_runStart, _runLength) {\n runStart[stackSize] = _runStart;\n runLength[stackSize] = _runLength;\n stackSize += 1;\n }\n function mergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if ((n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1])\n || (n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1])) {\n if (runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n }\n else if (runLength[n] > runLength[n + 1]) {\n break;\n }\n mergeAt(n);\n }\n }\n function forceMergeRuns() {\n while (stackSize > 1) {\n var n = stackSize - 2;\n if (n > 0 && runLength[n - 1] < runLength[n + 1]) {\n n--;\n }\n mergeAt(n);\n }\n }\n function mergeAt(i) {\n var start1 = runStart[i];\n var length1 = runLength[i];\n var start2 = runStart[i + 1];\n var length2 = runLength[i + 1];\n runLength[i] = length1 + length2;\n if (i === stackSize - 3) {\n runStart[i + 1] = runStart[i + 2];\n runLength[i + 1] = runLength[i + 2];\n }\n stackSize--;\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n if (length1 === 0) {\n return;\n }\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n if (length2 === 0) {\n return;\n }\n if (length1 <= length2) {\n mergeLow(start1, length1, start2, length2);\n }\n else {\n mergeHigh(start1, length1, start2, length2);\n }\n }\n function mergeLow(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n var _minGallop = minGallop;\n var count1;\n var count2;\n var exit;\n while (1) {\n count1 = 0;\n count2 = 0;\n exit = false;\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n if (--length2 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest++] = array[cursor2++];\n if (--length2 === 0) {\n exit = true;\n break;\n }\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n if (--length1 === 1) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n minGallop < 1 && (minGallop = 1);\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n }\n else if (length1 === 0) {\n throw new Error();\n }\n else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n }\n function mergeHigh(start1, length1, start2, length2) {\n var i = 0;\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n return;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n return;\n }\n var _minGallop = minGallop;\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n }\n else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < _minGallop);\n if (exit) {\n break;\n }\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n array[dest--] = tmp[cursor2--];\n if (--length2 === 1) {\n exit = true;\n break;\n }\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n array[dest--] = array[cursor1--];\n if (--length1 === 0) {\n exit = true;\n break;\n }\n _minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n if (exit) {\n break;\n }\n if (_minGallop < 0) {\n _minGallop = 0;\n }\n _minGallop += 2;\n }\n minGallop = _minGallop;\n if (minGallop < 1) {\n minGallop = 1;\n }\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n array[dest] = tmp[cursor2];\n }\n else if (length2 === 0) {\n throw new Error();\n }\n else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n }\n return {\n mergeRuns: mergeRuns,\n forceMergeRuns: forceMergeRuns,\n pushRun: pushRun\n };\n}\nexport default function sort(array, compare, lo, hi) {\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n var remaining = hi - lo;\n if (remaining < 2) {\n return;\n }\n var runLength = 0;\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n var ts = TimSort(array, compare);\n var minRun = minRunLength(remaining);\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n ts.forceMergeRuns();\n}\n","export var REDRAW_BIT = 1;\nexport var STYLE_CHANGED_BIT = 2;\nexport var SHAPE_CHANGED_BIT = 4;\n","import * as util from './core/util.js';\nimport timsort from './core/timsort.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nvar invalidZErrorLogged = false;\nfunction logInvalidZError() {\n if (invalidZErrorLogged) {\n return;\n }\n invalidZErrorLogged = true;\n console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');\n}\nfunction shapeCompareFunc(a, b) {\n if (a.zlevel === b.zlevel) {\n if (a.z === b.z) {\n return a.z2 - b.z2;\n }\n return a.z - b.z;\n }\n return a.zlevel - b.zlevel;\n}\nvar Storage = (function () {\n function Storage() {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n this.displayableSortFunc = shapeCompareFunc;\n }\n Storage.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._roots.length; i++) {\n this._roots[i].traverse(cb, context);\n }\n };\n Storage.prototype.getDisplayList = function (update, includeIgnore) {\n includeIgnore = includeIgnore || false;\n var displayList = this._displayList;\n if (update || !displayList.length) {\n this.updateDisplayList(includeIgnore);\n }\n return displayList;\n };\n Storage.prototype.updateDisplayList = function (includeIgnore) {\n this._displayListLen = 0;\n var roots = this._roots;\n var displayList = this._displayList;\n for (var i = 0, len = roots.length; i < len; i++) {\n this._updateAndAddDisplayable(roots[i], null, includeIgnore);\n }\n displayList.length = this._displayListLen;\n timsort(displayList, shapeCompareFunc);\n };\n Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {\n if (el.ignore && !includeIgnore) {\n return;\n }\n el.beforeUpdate();\n el.update();\n el.afterUpdate();\n var userSetClipPath = el.getClipPath();\n if (el.ignoreClip) {\n clipPaths = null;\n }\n else if (userSetClipPath) {\n if (clipPaths) {\n clipPaths = clipPaths.slice();\n }\n else {\n clipPaths = [];\n }\n var currentClipPath = userSetClipPath;\n var parentClipPath = el;\n while (currentClipPath) {\n currentClipPath.parent = parentClipPath;\n currentClipPath.updateTransform();\n clipPaths.push(currentClipPath);\n parentClipPath = currentClipPath;\n currentClipPath = currentClipPath.getClipPath();\n }\n }\n if (el.childrenRef) {\n var children = el.childrenRef();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (el.__dirty) {\n child.__dirty |= REDRAW_BIT;\n }\n this._updateAndAddDisplayable(child, clipPaths, includeIgnore);\n }\n el.__dirty = 0;\n }\n else {\n var disp = el;\n if (clipPaths && clipPaths.length) {\n disp.__clipPaths = clipPaths;\n }\n else if (disp.__clipPaths && disp.__clipPaths.length > 0) {\n disp.__clipPaths = [];\n }\n if (isNaN(disp.z)) {\n logInvalidZError();\n disp.z = 0;\n }\n if (isNaN(disp.z2)) {\n logInvalidZError();\n disp.z2 = 0;\n }\n if (isNaN(disp.zlevel)) {\n logInvalidZError();\n disp.zlevel = 0;\n }\n this._displayList[this._displayListLen++] = disp;\n }\n var decalEl = el.getDecalElement && el.getDecalElement();\n if (decalEl) {\n this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);\n }\n var textGuide = el.getTextGuideLine();\n if (textGuide) {\n this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);\n }\n var textEl = el.getTextContent();\n if (textEl) {\n this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);\n }\n };\n Storage.prototype.addRoot = function (el) {\n if (el.__zr && el.__zr.storage === this) {\n return;\n }\n this._roots.push(el);\n };\n Storage.prototype.delRoot = function (el) {\n if (el instanceof Array) {\n for (var i = 0, l = el.length; i < l; i++) {\n this.delRoot(el[i]);\n }\n return;\n }\n var idx = util.indexOf(this._roots, el);\n if (idx >= 0) {\n this._roots.splice(idx, 1);\n }\n };\n Storage.prototype.delAllRoots = function () {\n this._roots = [];\n this._displayList = [];\n this._displayListLen = 0;\n return;\n };\n Storage.prototype.getRoots = function () {\n return this._roots;\n };\n Storage.prototype.dispose = function () {\n this._displayList = null;\n this._roots = null;\n };\n return Storage;\n}());\nexport default Storage;\n","import env from '../core/env.js';\nvar requestAnimationFrame;\nrequestAnimationFrame = (env.hasGlobalWindow\n && ((window.requestAnimationFrame && window.requestAnimationFrame.bind(window))\n || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window))\n || window.mozRequestAnimationFrame\n || window.webkitRequestAnimationFrame)) || function (func) {\n return setTimeout(func, 16);\n};\nexport default requestAnimationFrame;\n","var easingFuncs = {\n linear: function (k) {\n return k;\n },\n quadraticIn: function (k) {\n return k * k;\n },\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n return -0.5 * (--k * (k - 2) - 1);\n },\n cubicIn: function (k) {\n return k * k * k;\n },\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n quarticIn: function (k) {\n return k * k * k * k;\n },\n quarticOut: function (k) {\n return 1 - (--k * k * k * k);\n },\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n circularOut: function (k) {\n return Math.sqrt(1 - (--k * k));\n },\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return -(a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n return (a * Math.pow(2, -10 * k)\n * Math.sin((k - s) * (2 * Math.PI) / p) + 1);\n },\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n if (k === 0) {\n return 0;\n }\n if (k === 1) {\n return 1;\n }\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n }\n else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (k -= 1))\n * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n bounceIn: function (k) {\n return 1 - easingFuncs.bounceOut(1 - k);\n },\n bounceOut: function (k) {\n if (k < (1 / 2.75)) {\n return 7.5625 * k * k;\n }\n else if (k < (2 / 2.75)) {\n return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;\n }\n else if (k < (2.5 / 2.75)) {\n return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;\n }\n else {\n return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;\n }\n },\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easingFuncs.bounceIn(k * 2) * 0.5;\n }\n return easingFuncs.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nexport default easingFuncs;\n","import { create as v2Create, distSquare as v2DistSquare } from './vector.js';\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;\nvar _v0 = v2Create();\nvar _v1 = v2Create();\nvar _v2 = v2Create();\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nexport function cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1)\n + t * t * (t * p3 + 3 * onet * p2);\n}\nexport function cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet\n + (p3 - p2) * t * t);\n}\nexport function cubicRootAt(p0, p1, p2, p3, val, roots) {\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 if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n }\n else {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = B * B - 4 * A * C;\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K;\n var t2 = -K / 2;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\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 if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n }\n else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n }\n else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\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 if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n return n;\n}\nexport function 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 if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\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 if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function 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;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123;\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\nexport function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\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;\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 if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n prev = t - interval;\n next = t + interval;\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n }\n return mathSqrt(d);\n}\nexport function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = cubicAt(x0, x1, x2, x3, t);\n var y = cubicAt(y0, y1, y2, y3, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\nexport function quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\nexport function quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\nexport function 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 if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n }\n else {\n var disc = b * b - 4 * a * c;\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\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 if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n return n;\n}\nexport function quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n if (divider === 0) {\n return 0.5;\n }\n else {\n return (p0 - p1) / divider;\n }\n}\nexport function 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;\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\nexport function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y;\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 if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n d = Infinity;\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n var prev = t - interval;\n var next = t + interval;\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n }\n else {\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n }\n else {\n interval *= 0.5;\n }\n }\n }\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n }\n return mathSqrt(d);\n}\nexport function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {\n var px = x0;\n var py = y0;\n var d = 0;\n var step = 1 / iteration;\n for (var i = 1; i <= iteration; i++) {\n var t = i * step;\n var x = quadraticAt(x0, x1, x2, t);\n var y = quadraticAt(y0, y1, y2, t);\n var dx = x - px;\n var dy = y - py;\n d += Math.sqrt(dx * dx + dy * dy);\n px = x;\n py = y;\n }\n return d;\n}\n","import { cubicAt, cubicRootAt } from '../core/curve.js';\nimport { trim } from '../core/util.js';\nvar regexp = /cubic-bezier\\(([0-9,\\.e ]+)\\)/;\nexport function createCubicEasingFunc(cubicEasingStr) {\n var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);\n if (cubic) {\n var points = cubic[1].split(',');\n var a_1 = +trim(points[0]);\n var b_1 = +trim(points[1]);\n var c_1 = +trim(points[2]);\n var d_1 = +trim(points[3]);\n if (isNaN(a_1 + b_1 + c_1 + d_1)) {\n return;\n }\n var roots_1 = [];\n return function (p) {\n return p <= 0\n ? 0 : p >= 1\n ? 1\n : cubicRootAt(0, a_1, c_1, 1, p, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);\n };\n }\n}\n","import easingFuncs from './easing.js';\nimport { isFunction, noop } from '../core/util.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nvar Clip = (function () {\n function Clip(opts) {\n this._inited = false;\n this._startTime = 0;\n this._pausedTime = 0;\n this._paused = false;\n this._life = opts.life || 1000;\n this._delay = opts.delay || 0;\n this.loop = opts.loop || false;\n this.onframe = opts.onframe || noop;\n this.ondestroy = opts.ondestroy || noop;\n this.onrestart = opts.onrestart || noop;\n opts.easing && this.setEasing(opts.easing);\n }\n Clip.prototype.step = function (globalTime, deltaTime) {\n if (!this._inited) {\n this._startTime = globalTime + this._delay;\n this._inited = true;\n }\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n var life = this._life;\n var elapsedTime = globalTime - this._startTime - this._pausedTime;\n var percent = elapsedTime / life;\n if (percent < 0) {\n percent = 0;\n }\n percent = Math.min(percent, 1);\n var easingFunc = this.easingFunc;\n var schedule = easingFunc ? easingFunc(percent) : percent;\n this.onframe(schedule);\n if (percent === 1) {\n if (this.loop) {\n var remainder = elapsedTime % life;\n this._startTime = globalTime - remainder;\n this._pausedTime = 0;\n this.onrestart();\n }\n else {\n return true;\n }\n }\n return false;\n };\n Clip.prototype.pause = function () {\n this._paused = true;\n };\n Clip.prototype.resume = function () {\n this._paused = false;\n };\n Clip.prototype.setEasing = function (easing) {\n this.easing = easing;\n this.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n };\n return Clip;\n}());\nexport default Clip;\n","var Entry = (function () {\n function Entry(val) {\n this.value = val;\n }\n return Entry;\n}());\nexport { Entry };\nvar LinkedList = (function () {\n function LinkedList() {\n this._len = 0;\n }\n LinkedList.prototype.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n };\n LinkedList.prototype.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n }\n else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n this._len++;\n };\n LinkedList.prototype.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this.head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this.tail = prev;\n }\n entry.next = entry.prev = null;\n this._len--;\n };\n LinkedList.prototype.len = function () {\n return this._len;\n };\n LinkedList.prototype.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n };\n return LinkedList;\n}());\nexport { LinkedList };\nvar LRU = (function () {\n function LRU(maxSize) {\n this._list = new LinkedList();\n this._maxSize = 10;\n this._map = {};\n this._maxSize = maxSize;\n }\n LRU.prototype.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n if (map[key] == null) {\n var len = list.len();\n var entry = this._lastRemovedEntry;\n if (len >= this._maxSize && len > 0) {\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n if (entry) {\n entry.value = value;\n }\n else {\n entry = new Entry(value);\n }\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n return removed;\n };\n LRU.prototype.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n if (entry != null) {\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n return entry.value;\n }\n };\n LRU.prototype.clear = function () {\n this._list.clear();\n this._map = {};\n };\n LRU.prototype.len = function () {\n return this._list.len();\n };\n return LRU;\n}());\nexport default LRU;\n","import LRU from '../core/LRU.js';\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0], 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1], 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1], 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1], 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1], 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1], 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1], 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1], 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1], 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1], 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1], 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1], 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1], 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1], 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1], 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1], 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1], 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1], 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1], 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1], 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1], 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1], 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1], 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1], 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1], 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1], 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1], 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1], 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1], 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1], 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1], 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1], 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1], 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1], 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1], 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1], 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1], 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1], 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1], 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1], 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1], 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1], 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1], 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1], 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1], 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1], 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1], 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1], 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1], 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1], 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1], 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1], 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1], 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1], 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1], 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1], 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1], 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1], 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1], 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1], 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1], 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1], 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1], 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1], 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1], 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1], 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1], 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1], 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1], 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1], 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1], 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1], 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1], 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1], 'yellowgreen': [154, 205, 50, 1]\n};\nfunction clampCssByte(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\nfunction clampCssAngle(i) {\n i = Math.round(i);\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\nfunction clampCssFloat(f) {\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\nfunction parseCssInt(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n return clampCssByte(parseInt(str, 10));\n}\nfunction parseCssFloat(val) {\n var str = val;\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n return clampCssFloat(parseFloat(str));\n}\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n }\n else if (h > 1) {\n h -= 1;\n }\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n if (h * 2 < 1) {\n return m2;\n }\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n return m1;\n}\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\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}\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}\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\nfunction putToCache(colorStr, rgbaArr) {\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice()));\n}\nexport function parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n if (cached) {\n return copyRgba(rgbaArr, cached);\n }\n colorStr = colorStr + '';\n var str = colorStr.replace(/ /g, '').toLowerCase();\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n var strLen = str.length;\n if (str.charAt(0) === '#') {\n if (strLen === 4 || strLen === 5) {\n var iv = parseInt(str.slice(1, 4), 16);\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), (iv & 0xf0) | ((iv & 0xf0) >> 4), (iv & 0xf) | ((iv & 0xf) << 4), strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else if (strLen === 7 || strLen === 9) {\n var iv = parseInt(str.slice(1, 7), 16);\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n return;\n }\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === strLen) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1;\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n return params.length === 3\n ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1)\n : setRgba(rgbaArr, 0, 0, 0, 1);\n }\n alpha = parseCssFloat(params.pop());\n case 'rgb':\n if (params.length >= 3) {\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n else {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n default:\n return;\n }\n }\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\nfunction hsla2rgba(hsla, rgba) {\n var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360;\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 if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n return rgba;\n}\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\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);\n var vMax = Math.max(R, G, B);\n var delta = vMax - vMin;\n var L = (vMax + vMin) / 2;\n var H;\n var S;\n if (delta === 0) {\n H = 0;\n S = 0;\n }\n else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n }\n else {\n S = delta / (2 - vMax - vMin);\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 if (R === vMax) {\n H = deltaB - deltaG;\n }\n else if (G === vMax) {\n H = (1 / 3) + deltaR - deltaB;\n }\n else if (B === vMax) {\n H = (2 / 3) + deltaG - deltaR;\n }\n if (H < 0) {\n H += 1;\n }\n if (H > 1) {\n H -= 1;\n }\n }\n var hsla = [H * 360, S, L];\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n return hsla;\n}\nexport function lift(color, level) {\n var colorArr = parse(color);\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n }\n else {\n colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;\n }\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n }\n else if (colorArr[i] < 0) {\n colorArr[i] = 0;\n }\n }\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\nexport function toHex(color) {\n var colorArr = parse(color);\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);\n }\n}\nexport function fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\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}\nexport var fastMapToColor = fastLerp;\nexport function lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length)\n || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\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([\n clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),\n clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),\n clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),\n clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))\n ], 'rgba');\n return fullOutput\n ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n }\n : color;\n}\nexport var mapToColor = lerp;\nexport function modifyHSL(color, h, s, l) {\n var colorArr = parse(color);\n if (color) {\n colorArr = rgba2hsla(colorArr);\n h != null && (colorArr[0] = clampCssAngle(h));\n s != null && (colorArr[1] = parseCssFloat(s));\n l != null && (colorArr[2] = parseCssFloat(l));\n return stringify(hsla2rgba(colorArr), 'rgba');\n }\n}\nexport function modifyAlpha(color, alpha) {\n var colorArr = parse(color);\n if (colorArr && alpha != null) {\n colorArr[3] = clampCssFloat(alpha);\n return stringify(colorArr, 'rgba');\n }\n}\nexport function stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n return type + '(' + colorStr + ')';\n}\nexport function lum(color, backgroundLum) {\n var arr = parse(color);\n return arr\n ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255\n + (1 - arr[3]) * backgroundLum\n : 0;\n}\nexport function random() {\n return stringify([\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255),\n Math.round(Math.random() * 255)\n ], 'rgb');\n}\n","import { RADIAN_TO_DEGREE, retrieve2, logError, isFunction } from '../core/util.js';\nimport { parse } from '../tool/color.js';\nimport env from '../core/env.js';\nvar mathRound = Math.round;\nexport function normalizeColor(color) {\n var opacity;\n if (!color || color === 'transparent') {\n color = 'none';\n }\n else if (typeof color === 'string' && color.indexOf('rgba') > -1) {\n var arr = parse(color);\n if (arr) {\n color = 'rgb(' + arr[0] + ',' + arr[1] + ',' + arr[2] + ')';\n opacity = arr[3];\n }\n }\n return {\n color: color,\n opacity: opacity == null ? 1 : opacity\n };\n}\nvar EPSILON = 1e-4;\nexport function isAroundZero(transform) {\n return transform < EPSILON && transform > -EPSILON;\n}\nexport function round3(transform) {\n return mathRound(transform * 1e3) / 1e3;\n}\nexport function round4(transform) {\n return mathRound(transform * 1e4) / 1e4;\n}\nexport function round1(transform) {\n return mathRound(transform * 10) / 10;\n}\nexport function getMatrixStr(m) {\n return 'matrix('\n + round3(m[0]) + ','\n + round3(m[1]) + ','\n + round3(m[2]) + ','\n + round3(m[3]) + ','\n + round4(m[4]) + ','\n + round4(m[5])\n + ')';\n}\nexport var TEXT_ALIGN_TO_ANCHOR = {\n left: 'start',\n right: 'end',\n center: 'middle',\n middle: 'middle'\n};\nexport function adjustTextY(y, lineHeight, textBaseline) {\n if (textBaseline === 'top') {\n y += lineHeight / 2;\n }\n else if (textBaseline === 'bottom') {\n y -= lineHeight / 2;\n }\n return y;\n}\nexport function hasShadow(style) {\n return style\n && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);\n}\nexport function getShadowKey(displayable) {\n var style = displayable.style;\n var globalScale = displayable.getGlobalScale();\n return [\n style.shadowColor,\n (style.shadowBlur || 0).toFixed(2),\n (style.shadowOffsetX || 0).toFixed(2),\n (style.shadowOffsetY || 0).toFixed(2),\n globalScale[0],\n globalScale[1]\n ].join(',');\n}\nexport function getClipPathsKey(clipPaths) {\n var key = [];\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n key.push(clipPath.id);\n }\n }\n return key.join(',');\n}\nexport function isImagePattern(val) {\n return val && (!!val.image);\n}\nexport function isSVGPattern(val) {\n return val && (!!val.svgElement);\n}\nexport function isPattern(val) {\n return isImagePattern(val) || isSVGPattern(val);\n}\nexport function isLinearGradient(val) {\n return val.type === 'linear';\n}\nexport function isRadialGradient(val) {\n return val.type === 'radial';\n}\nexport function isGradient(val) {\n return val && (val.type === 'linear'\n || val.type === 'radial');\n}\nexport function getIdURL(id) {\n return \"url(#\" + id + \")\";\n}\nexport function getPathPrecision(el) {\n var scale = el.getGlobalScale();\n var size = Math.max(scale[0], scale[1]);\n return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);\n}\nexport function getSRTTransformString(transform) {\n var x = transform.x || 0;\n var y = transform.y || 0;\n var rotation = (transform.rotation || 0) * RADIAN_TO_DEGREE;\n var scaleX = retrieve2(transform.scaleX, 1);\n var scaleY = retrieve2(transform.scaleY, 1);\n var skewX = transform.skewX || 0;\n var skewY = transform.skewY || 0;\n var res = [];\n if (x || y) {\n res.push(\"translate(\" + x + \"px,\" + y + \"px)\");\n }\n if (rotation) {\n res.push(\"rotate(\" + rotation + \")\");\n }\n if (scaleX !== 1 || scaleY !== 1) {\n res.push(\"scale(\" + scaleX + \",\" + scaleY + \")\");\n }\n if (skewX || skewY) {\n res.push(\"skew(\" + mathRound(skewX * RADIAN_TO_DEGREE) + \"deg, \" + mathRound(skewY * RADIAN_TO_DEGREE) + \"deg)\");\n }\n return res.join(' ');\n}\nexport var encodeBase64 = (function () {\n if (env.hasGlobalWindow && isFunction(window.btoa)) {\n return function (str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n };\n }\n if (typeof Buffer !== 'undefined') {\n return function (str) {\n return Buffer.from(str).toString('base64');\n };\n }\n return function (str) {\n if (process.env.NODE_ENV !== 'production') {\n logError('Base64 isn\\'t natively supported in the current environment.');\n }\n return null;\n };\n})();\n","import Clip from './Clip.js';\nimport * as color from '../tool/color.js';\nimport { eqNaN, extend, isArrayLike, isFunction, isGradientObject, isNumber, isString, keys, logError, map } from '../core/util.js';\nimport easingFuncs from './easing.js';\nimport { createCubicEasingFunc } from './cubicEasing.js';\nimport { isLinearGradient, isRadialGradient } from '../svg/helper.js';\n;\nvar arraySlice = Array.prototype.slice;\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\nfunction interpolate1DArray(out, p0, p1, percent) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n return out;\n}\nfunction interpolate2DArray(out, p0, p1, percent) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n return out;\n}\nfunction add1DArray(out, p0, p1, sign) {\n var len = p0.length;\n for (var i = 0; i < len; i++) {\n out[i] = p0[i] + p1[i] * sign;\n }\n return out;\n}\nfunction add2DArray(out, p0, p1, sign) {\n var len = p0.length;\n var len2 = len && p0[0].length;\n for (var i = 0; i < len; i++) {\n if (!out[i]) {\n out[i] = [];\n }\n for (var j = 0; j < len2; j++) {\n out[i][j] = p0[i][j] + p1[i][j] * sign;\n }\n }\n return out;\n}\nfunction fillColorStops(val0, val1) {\n var len0 = val0.length;\n var len1 = val1.length;\n var shorterArr = len0 > len1 ? val1 : val0;\n var shorterLen = Math.min(len0, len1);\n var last = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };\n for (var i = shorterLen; i < Math.max(len0, len1); i++) {\n shorterArr.push({\n offset: last.offset,\n color: last.color.slice()\n });\n }\n}\nfunction fillArray(val0, val1, arrDim) {\n var arr0 = val0;\n var arr1 = val1;\n if (!arr0.push || !arr1.push) {\n return;\n }\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n if (arr0Len !== arr1Len) {\n var isPreviousLarger = arr0Len > arr1Len;\n if (isPreviousLarger) {\n arr0.length = arr1Len;\n }\n else {\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n }\n var len2 = arr0[0] && arr0[0].length;\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 }\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}\nexport function cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n if (isArrayLike(value[0])) {\n var ret = [];\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n return ret;\n }\n return arraySlice.call(value);\n }\n return value;\n}\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]) || 0;\n rgba[1] = Math.floor(rgba[1]) || 0;\n rgba[2] = Math.floor(rgba[2]) || 0;\n rgba[3] = rgba[3] == null ? 1 : rgba[3];\n return 'rgba(' + rgba.join(',') + ')';\n}\nfunction guessArrayDim(value) {\n return isArrayLike(value && value[0]) ? 2 : 1;\n}\nvar VALUE_TYPE_NUMBER = 0;\nvar VALUE_TYPE_1D_ARRAY = 1;\nvar VALUE_TYPE_2D_ARRAY = 2;\nvar VALUE_TYPE_COLOR = 3;\nvar VALUE_TYPE_LINEAR_GRADIENT = 4;\nvar VALUE_TYPE_RADIAL_GRADIENT = 5;\nvar VALUE_TYPE_UNKOWN = 6;\nfunction isGradientValueType(valType) {\n return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;\n}\nfunction isArrayValueType(valType) {\n return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;\n}\nvar tmpRgba = [0, 0, 0, 0];\nvar Track = (function () {\n function Track(propName) {\n this.keyframes = [];\n this.discrete = false;\n this._invalid = false;\n this._needsSort = false;\n this._lastFr = 0;\n this._lastFrP = 0;\n this.propName = propName;\n }\n Track.prototype.isFinished = function () {\n return this._finished;\n };\n Track.prototype.setFinished = function () {\n this._finished = true;\n if (this._additiveTrack) {\n this._additiveTrack.setFinished();\n }\n };\n Track.prototype.needsAnimate = function () {\n return this.keyframes.length >= 1;\n };\n Track.prototype.getAdditiveTrack = function () {\n return this._additiveTrack;\n };\n Track.prototype.addKeyframe = function (time, rawValue, easing) {\n this._needsSort = true;\n var keyframes = this.keyframes;\n var len = keyframes.length;\n var discrete = false;\n var valType = VALUE_TYPE_UNKOWN;\n var value = rawValue;\n if (isArrayLike(rawValue)) {\n var arrayDim = guessArrayDim(rawValue);\n valType = arrayDim;\n if (arrayDim === 1 && !isNumber(rawValue[0])\n || arrayDim === 2 && !isNumber(rawValue[0][0])) {\n discrete = true;\n }\n }\n else {\n if (isNumber(rawValue) && !eqNaN(rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else if (isString(rawValue)) {\n if (!isNaN(+rawValue)) {\n valType = VALUE_TYPE_NUMBER;\n }\n else {\n var colorArray = color.parse(rawValue);\n if (colorArray) {\n value = colorArray;\n valType = VALUE_TYPE_COLOR;\n }\n }\n }\n else if (isGradientObject(rawValue)) {\n var parsedGradient = extend({}, value);\n parsedGradient.colorStops = map(rawValue.colorStops, function (colorStop) { return ({\n offset: colorStop.offset,\n color: color.parse(colorStop.color)\n }); });\n if (isLinearGradient(rawValue)) {\n valType = VALUE_TYPE_LINEAR_GRADIENT;\n }\n else if (isRadialGradient(rawValue)) {\n valType = VALUE_TYPE_RADIAL_GRADIENT;\n }\n value = parsedGradient;\n }\n }\n if (len === 0) {\n this.valType = valType;\n }\n else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {\n discrete = true;\n }\n this.discrete = this.discrete || discrete;\n var kf = {\n time: time,\n value: value,\n rawValue: rawValue,\n percent: 0\n };\n if (easing) {\n kf.easing = easing;\n kf.easingFunc = isFunction(easing)\n ? easing\n : easingFuncs[easing] || createCubicEasingFunc(easing);\n }\n keyframes.push(kf);\n return kf;\n };\n Track.prototype.prepare = function (maxTime, additiveTrack) {\n var kfs = this.keyframes;\n if (this._needsSort) {\n kfs.sort(function (a, b) {\n return a.time - b.time;\n });\n }\n var valType = this.valType;\n var kfsLen = kfs.length;\n var lastKf = kfs[kfsLen - 1];\n var isDiscrete = this.discrete;\n var isArr = isArrayValueType(valType);\n var isGradient = isGradientValueType(valType);\n for (var i = 0; i < kfsLen; i++) {\n var kf = kfs[i];\n var value = kf.value;\n var lastValue = lastKf.value;\n kf.percent = kf.time / maxTime;\n if (!isDiscrete) {\n if (isArr && i !== kfsLen - 1) {\n fillArray(value, lastValue, valType);\n }\n else if (isGradient) {\n fillColorStops(value.colorStops, lastValue.colorStops);\n }\n }\n }\n if (!isDiscrete\n && valType !== VALUE_TYPE_RADIAL_GRADIENT\n && additiveTrack\n && this.needsAnimate()\n && additiveTrack.needsAnimate()\n && valType === additiveTrack.valType\n && !additiveTrack._finished) {\n this._additiveTrack = additiveTrack;\n var startValue = kfs[0].value;\n for (var i = 0; i < kfsLen; i++) {\n if (valType === VALUE_TYPE_NUMBER) {\n kfs[i].additiveValue = kfs[i].value - startValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n kfs[i].additiveValue =\n add1DArray([], kfs[i].value, startValue, -1);\n }\n else if (isArrayValueType(valType)) {\n kfs[i].additiveValue = valType === VALUE_TYPE_1D_ARRAY\n ? add1DArray([], kfs[i].value, startValue, -1)\n : add2DArray([], kfs[i].value, startValue, -1);\n }\n }\n }\n };\n Track.prototype.step = function (target, percent) {\n if (this._finished) {\n return;\n }\n if (this._additiveTrack && this._additiveTrack._finished) {\n this._additiveTrack = null;\n }\n var isAdditive = this._additiveTrack != null;\n var valueKey = isAdditive ? 'additiveValue' : 'value';\n var valType = this.valType;\n var keyframes = this.keyframes;\n var kfsNum = keyframes.length;\n var propName = this.propName;\n var isValueColor = valType === VALUE_TYPE_COLOR;\n var frameIdx;\n var lastFrame = this._lastFr;\n var mathMin = Math.min;\n var frame;\n var nextFrame;\n if (kfsNum === 1) {\n frame = nextFrame = keyframes[0];\n }\n else {\n if (percent < 0) {\n frameIdx = 0;\n }\n else if (percent < this._lastFrP) {\n var start = mathMin(lastFrame + 1, kfsNum - 1);\n for (frameIdx = start; frameIdx >= 0; frameIdx--) {\n if (keyframes[frameIdx].percent <= percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx, kfsNum - 2);\n }\n else {\n for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {\n if (keyframes[frameIdx].percent > percent) {\n break;\n }\n }\n frameIdx = mathMin(frameIdx - 1, kfsNum - 2);\n }\n nextFrame = keyframes[frameIdx + 1];\n frame = keyframes[frameIdx];\n }\n if (!(frame && nextFrame)) {\n return;\n }\n this._lastFr = frameIdx;\n this._lastFrP = percent;\n var interval = (nextFrame.percent - frame.percent);\n var w = interval === 0 ? 1 : mathMin((percent - frame.percent) / interval, 1);\n if (nextFrame.easingFunc) {\n w = nextFrame.easingFunc(w);\n }\n var targetArr = isAdditive ? this._additiveValue\n : (isValueColor ? tmpRgba : target[propName]);\n if ((isArrayValueType(valType) || isValueColor) && !targetArr) {\n targetArr = this._additiveValue = [];\n }\n if (this.discrete) {\n target[propName] = w < 1 ? frame.rawValue : nextFrame.rawValue;\n }\n else if (isArrayValueType(valType)) {\n valType === VALUE_TYPE_1D_ARRAY\n ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w)\n : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n }\n else if (isGradientValueType(valType)) {\n var val = frame[valueKey];\n var nextVal_1 = nextFrame[valueKey];\n var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;\n target[propName] = {\n type: isLinearGradient_1 ? 'linear' : 'radial',\n x: interpolateNumber(val.x, nextVal_1.x, w),\n y: interpolateNumber(val.y, nextVal_1.y, w),\n colorStops: map(val.colorStops, function (colorStop, idx) {\n var nextColorStop = nextVal_1.colorStops[idx];\n return {\n offset: interpolateNumber(colorStop.offset, nextColorStop.offset, w),\n color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w))\n };\n }),\n global: nextVal_1.global\n };\n if (isLinearGradient_1) {\n target[propName].x2 = interpolateNumber(val.x2, nextVal_1.x2, w);\n target[propName].y2 = interpolateNumber(val.y2, nextVal_1.y2, w);\n }\n else {\n target[propName].r = interpolateNumber(val.r, nextVal_1.r, w);\n }\n }\n else if (isValueColor) {\n interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);\n if (!isAdditive) {\n target[propName] = rgba2String(targetArr);\n }\n }\n else {\n var value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);\n if (isAdditive) {\n this._additiveValue = value;\n }\n else {\n target[propName] = value;\n }\n }\n if (isAdditive) {\n this._addToTarget(target);\n }\n };\n Track.prototype._addToTarget = function (target) {\n var valType = this.valType;\n var propName = this.propName;\n var additiveValue = this._additiveValue;\n if (valType === VALUE_TYPE_NUMBER) {\n target[propName] = target[propName] + additiveValue;\n }\n else if (valType === VALUE_TYPE_COLOR) {\n color.parse(target[propName], tmpRgba);\n add1DArray(tmpRgba, tmpRgba, additiveValue, 1);\n target[propName] = rgba2String(tmpRgba);\n }\n else if (valType === VALUE_TYPE_1D_ARRAY) {\n add1DArray(target[propName], target[propName], additiveValue, 1);\n }\n else if (valType === VALUE_TYPE_2D_ARRAY) {\n add2DArray(target[propName], target[propName], additiveValue, 1);\n }\n };\n return Track;\n}());\nvar Animator = (function () {\n function Animator(target, loop, allowDiscreteAnimation, additiveTo) {\n this._tracks = {};\n this._trackKeys = [];\n this._maxTime = 0;\n this._started = 0;\n this._clip = null;\n this._target = target;\n this._loop = loop;\n if (loop && additiveTo) {\n logError('Can\\' use additive animation on looped animation.');\n return;\n }\n this._additiveAnimators = additiveTo;\n this._allowDiscrete = allowDiscreteAnimation;\n }\n Animator.prototype.getMaxTime = function () {\n return this._maxTime;\n };\n Animator.prototype.getDelay = function () {\n return this._delay;\n };\n Animator.prototype.getLoop = function () {\n return this._loop;\n };\n Animator.prototype.getTarget = function () {\n return this._target;\n };\n Animator.prototype.changeTarget = function (target) {\n this._target = target;\n };\n Animator.prototype.when = function (time, props, easing) {\n return this.whenWithKeys(time, props, keys(props), easing);\n };\n Animator.prototype.whenWithKeys = function (time, props, propNames, easing) {\n var tracks = this._tracks;\n for (var i = 0; i < propNames.length; i++) {\n var propName = propNames[i];\n var track = tracks[propName];\n if (!track) {\n track = tracks[propName] = new Track(propName);\n var initialValue = void 0;\n var additiveTrack = this._getAdditiveTrack(propName);\n if (additiveTrack) {\n var addtiveTrackKfs = additiveTrack.keyframes;\n var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];\n initialValue = lastFinalKf && lastFinalKf.value;\n if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {\n initialValue = rgba2String(initialValue);\n }\n }\n else {\n initialValue = this._target[propName];\n }\n if (initialValue == null) {\n continue;\n }\n if (time > 0) {\n track.addKeyframe(0, cloneValue(initialValue), easing);\n }\n this._trackKeys.push(propName);\n }\n track.addKeyframe(time, cloneValue(props[propName]), easing);\n }\n this._maxTime = Math.max(this._maxTime, time);\n return this;\n };\n Animator.prototype.pause = function () {\n this._clip.pause();\n this._paused = true;\n };\n Animator.prototype.resume = function () {\n this._clip.resume();\n this._paused = false;\n };\n Animator.prototype.isPaused = function () {\n return !!this._paused;\n };\n Animator.prototype.duration = function (duration) {\n this._maxTime = duration;\n this._force = true;\n return this;\n };\n Animator.prototype._doneCallback = function () {\n this._setTracksFinished();\n this._clip = null;\n var doneList = this._doneCbs;\n if (doneList) {\n var len = doneList.length;\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n }\n };\n Animator.prototype._abortedCallback = function () {\n this._setTracksFinished();\n var animation = this.animation;\n var abortedList = this._abortedCbs;\n if (animation) {\n animation.removeClip(this._clip);\n }\n this._clip = null;\n if (abortedList) {\n for (var i = 0; i < abortedList.length; i++) {\n abortedList[i].call(this);\n }\n }\n };\n Animator.prototype._setTracksFinished = function () {\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < tracksKeys.length; i++) {\n tracks[tracksKeys[i]].setFinished();\n }\n };\n Animator.prototype._getAdditiveTrack = function (trackName) {\n var additiveTrack;\n var additiveAnimators = this._additiveAnimators;\n if (additiveAnimators) {\n for (var i = 0; i < additiveAnimators.length; i++) {\n var track = additiveAnimators[i].getTrack(trackName);\n if (track) {\n additiveTrack = track;\n }\n }\n }\n return additiveTrack;\n };\n Animator.prototype.start = function (easing) {\n if (this._started > 0) {\n return;\n }\n this._started = 1;\n var self = this;\n var tracks = [];\n var maxTime = this._maxTime || 0;\n for (var i = 0; i < this._trackKeys.length; i++) {\n var propName = this._trackKeys[i];\n var track = this._tracks[propName];\n var additiveTrack = this._getAdditiveTrack(propName);\n var kfs = track.keyframes;\n var kfsNum = kfs.length;\n track.prepare(maxTime, additiveTrack);\n if (track.needsAnimate()) {\n if (!this._allowDiscrete && track.discrete) {\n var lastKf = kfs[kfsNum - 1];\n if (lastKf) {\n self._target[track.propName] = lastKf.rawValue;\n }\n track.setFinished();\n }\n else {\n tracks.push(track);\n }\n }\n }\n if (tracks.length || this._force) {\n var clip = new Clip({\n life: maxTime,\n loop: this._loop,\n delay: this._delay || 0,\n onframe: function (percent) {\n self._started = 2;\n var additiveAnimators = self._additiveAnimators;\n if (additiveAnimators) {\n var stillHasAdditiveAnimator = false;\n for (var i = 0; i < additiveAnimators.length; i++) {\n if (additiveAnimators[i]._clip) {\n stillHasAdditiveAnimator = true;\n break;\n }\n }\n if (!stillHasAdditiveAnimator) {\n self._additiveAnimators = null;\n }\n }\n for (var i = 0; i < tracks.length; i++) {\n tracks[i].step(self._target, percent);\n }\n var onframeList = self._onframeCbs;\n if (onframeList) {\n for (var i = 0; i < onframeList.length; i++) {\n onframeList[i](self._target, percent);\n }\n }\n },\n ondestroy: function () {\n self._doneCallback();\n }\n });\n this._clip = clip;\n if (this.animation) {\n this.animation.addClip(clip);\n }\n if (easing) {\n clip.setEasing(easing);\n }\n }\n else {\n this._doneCallback();\n }\n return this;\n };\n Animator.prototype.stop = function (forwardToLast) {\n if (!this._clip) {\n return;\n }\n var clip = this._clip;\n if (forwardToLast) {\n clip.onframe(1);\n }\n this._abortedCallback();\n };\n Animator.prototype.delay = function (time) {\n this._delay = time;\n return this;\n };\n Animator.prototype.during = function (cb) {\n if (cb) {\n if (!this._onframeCbs) {\n this._onframeCbs = [];\n }\n this._onframeCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.done = function (cb) {\n if (cb) {\n if (!this._doneCbs) {\n this._doneCbs = [];\n }\n this._doneCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.aborted = function (cb) {\n if (cb) {\n if (!this._abortedCbs) {\n this._abortedCbs = [];\n }\n this._abortedCbs.push(cb);\n }\n return this;\n };\n Animator.prototype.getClip = function () {\n return this._clip;\n };\n Animator.prototype.getTrack = function (propName) {\n return this._tracks[propName];\n };\n Animator.prototype.getTracks = function () {\n var _this = this;\n return map(this._trackKeys, function (key) { return _this._tracks[key]; });\n };\n Animator.prototype.stopTracks = function (propNames, forwardToLast) {\n if (!propNames.length || !this._clip) {\n return true;\n }\n var tracks = this._tracks;\n var tracksKeys = this._trackKeys;\n for (var i = 0; i < propNames.length; i++) {\n var track = tracks[propNames[i]];\n if (track && !track.isFinished()) {\n if (forwardToLast) {\n track.step(this._target, 1);\n }\n else if (this._started === 1) {\n track.step(this._target, 0);\n }\n track.setFinished();\n }\n }\n var allAborted = true;\n for (var i = 0; i < tracksKeys.length; i++) {\n if (!tracks[tracksKeys[i]].isFinished()) {\n allAborted = false;\n break;\n }\n }\n if (allAborted) {\n this._abortedCallback();\n }\n return allAborted;\n };\n Animator.prototype.saveTo = function (target, trackKeys, firstOrLast) {\n if (!target) {\n return;\n }\n trackKeys = trackKeys || this._trackKeys;\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track || track.isFinished()) {\n continue;\n }\n var kfs = track.keyframes;\n var kf = kfs[firstOrLast ? 0 : kfs.length - 1];\n if (kf) {\n target[propName] = cloneValue(kf.rawValue);\n }\n }\n };\n Animator.prototype.__changeFinalValue = function (finalProps, trackKeys) {\n trackKeys = trackKeys || keys(finalProps);\n for (var i = 0; i < trackKeys.length; i++) {\n var propName = trackKeys[i];\n var track = this._tracks[propName];\n if (!track) {\n continue;\n }\n var kfs = track.keyframes;\n if (kfs.length > 1) {\n var lastKf = kfs.pop();\n track.addKeyframe(lastKf.time, finalProps[propName]);\n track.prepare(this._maxTime, track.getAdditiveTrack());\n }\n }\n };\n return Animator;\n}());\nexport default Animator;\n","import { __extends } from \"tslib\";\nimport Eventful from '../core/Eventful.js';\nimport requestAnimationFrame from './requestAnimationFrame.js';\nimport Animator from './Animator.js';\nexport function getTime() {\n return new Date().getTime();\n}\nvar Animation = (function (_super) {\n __extends(Animation, _super);\n function Animation(opts) {\n var _this = _super.call(this) || this;\n _this._running = false;\n _this._time = 0;\n _this._pausedTime = 0;\n _this._pauseStart = 0;\n _this._paused = false;\n opts = opts || {};\n _this.stage = opts.stage || {};\n return _this;\n }\n Animation.prototype.addClip = function (clip) {\n if (clip.animation) {\n this.removeClip(clip);\n }\n if (!this._head) {\n this._head = this._tail = clip;\n }\n else {\n this._tail.next = clip;\n clip.prev = this._tail;\n clip.next = null;\n this._tail = clip;\n }\n clip.animation = this;\n };\n Animation.prototype.addAnimator = function (animator) {\n animator.animation = this;\n var clip = animator.getClip();\n if (clip) {\n this.addClip(clip);\n }\n };\n Animation.prototype.removeClip = function (clip) {\n if (!clip.animation) {\n return;\n }\n var prev = clip.prev;\n var next = clip.next;\n if (prev) {\n prev.next = next;\n }\n else {\n this._head = next;\n }\n if (next) {\n next.prev = prev;\n }\n else {\n this._tail = prev;\n }\n clip.next = clip.prev = clip.animation = null;\n };\n Animation.prototype.removeAnimator = function (animator) {\n var clip = animator.getClip();\n if (clip) {\n this.removeClip(clip);\n }\n animator.animation = null;\n };\n Animation.prototype.update = function (notTriggerFrameAndStageUpdate) {\n var time = getTime() - this._pausedTime;\n var delta = time - this._time;\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n var finished = clip.step(time, delta);\n if (finished) {\n clip.ondestroy();\n this.removeClip(clip);\n clip = nextClip;\n }\n else {\n clip = nextClip;\n }\n }\n this._time = time;\n if (!notTriggerFrameAndStageUpdate) {\n this.trigger('frame', delta);\n this.stage.update && this.stage.update();\n }\n };\n Animation.prototype._startLoop = function () {\n var self = this;\n this._running = true;\n function step() {\n if (self._running) {\n requestAnimationFrame(step);\n !self._paused && self.update();\n }\n }\n requestAnimationFrame(step);\n };\n Animation.prototype.start = function () {\n if (this._running) {\n return;\n }\n this._time = getTime();\n this._pausedTime = 0;\n this._startLoop();\n };\n Animation.prototype.stop = function () {\n this._running = false;\n };\n Animation.prototype.pause = function () {\n if (!this._paused) {\n this._pauseStart = getTime();\n this._paused = true;\n }\n };\n Animation.prototype.resume = function () {\n if (this._paused) {\n this._pausedTime += getTime() - this._pauseStart;\n this._paused = false;\n }\n };\n Animation.prototype.clear = function () {\n var clip = this._head;\n while (clip) {\n var nextClip = clip.next;\n clip.prev = clip.next = clip.animation = null;\n clip = nextClip;\n }\n this._head = this._tail = null;\n };\n Animation.prototype.isFinished = function () {\n return this._head == null;\n };\n Animation.prototype.animate = function (target, options) {\n options = options || {};\n this.start();\n var animator = new Animator(target, options.loop);\n this.addAnimator(animator);\n return animator;\n };\n return Animation;\n}(Eventful));\nexport default Animation;\n","import { __extends } from \"tslib\";\nimport { addEventListener, removeEventListener, normalizeEvent, getNativeEvent } from '../core/event.js';\nimport * as zrUtil from '../core/util.js';\nimport Eventful from '../core/Eventful.js';\nimport env from '../core/env.js';\nvar TOUCH_CLICK_DELAY = 300;\nvar globalEventSupported = env.domSupported;\nvar localNativeListenerNames = (function () {\n var mouseHandlerNames = [\n 'click', 'dblclick', 'mousewheel', 'wheel', 'mouseout',\n 'mouseup', 'mousedown', 'mousemove', 'contextmenu'\n ];\n var touchHandlerNames = [\n 'touchstart', 'touchend', 'touchmove'\n ];\n var pointerEventNameMap = {\n pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1\n };\n var pointerHandlerNames = zrUtil.map(mouseHandlerNames, function (name) {\n var nm = name.replace('mouse', 'pointer');\n return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;\n });\n return {\n mouse: mouseHandlerNames,\n touch: touchHandlerNames,\n pointer: pointerHandlerNames\n };\n})();\nvar globalNativeListenerNames = {\n mouse: ['mousemove', 'mouseup'],\n pointer: ['pointermove', 'pointerup']\n};\nvar wheelEventSupported = false;\nfunction isPointerFromTouch(event) {\n var pointerType = event.pointerType;\n return pointerType === 'pen' || pointerType === 'touch';\n}\nfunction setTouchTimer(scope) {\n scope.touching = true;\n if (scope.touchTimer != null) {\n clearTimeout(scope.touchTimer);\n scope.touchTimer = null;\n }\n scope.touchTimer = setTimeout(function () {\n scope.touching = false;\n scope.touchTimer = null;\n }, 700);\n}\nfunction markTouch(event) {\n event && (event.zrByTouch = true);\n}\nfunction normalizeGlobalEvent(instance, event) {\n return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);\n}\nfunction isLocalEl(instance, el) {\n var elTmp = el;\n var isLocal = false;\n while (elTmp && elTmp.nodeType !== 9\n && !(isLocal = elTmp.domBelongToZr\n || (elTmp !== el && elTmp === instance.painterRoot))) {\n elTmp = elTmp.parentNode;\n }\n return isLocal;\n}\nvar FakeGlobalEvent = (function () {\n function FakeGlobalEvent(instance, event) {\n this.stopPropagation = zrUtil.noop;\n this.stopImmediatePropagation = zrUtil.noop;\n this.preventDefault = zrUtil.noop;\n this.type = event.type;\n this.target = this.currentTarget = instance.dom;\n this.pointerType = event.pointerType;\n this.clientX = event.clientX;\n this.clientY = event.clientY;\n }\n return FakeGlobalEvent;\n}());\nvar localDOMHandlers = {\n mousedown: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__mayPointerCapture = [event.zrX, event.zrY];\n this.trigger('mousedown', event);\n },\n mousemove: function (event) {\n event = normalizeEvent(this.dom, event);\n var downPoint = this.__mayPointerCapture;\n if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {\n this.__togglePointerCapture(true);\n }\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n event = normalizeEvent(this.dom, event);\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n },\n mouseout: function (event) {\n event = normalizeEvent(this.dom, event);\n var element = event.toElement || event.relatedTarget;\n if (!isLocalEl(this, element)) {\n if (this.__pointerCapturing) {\n event.zrEventControl = 'no_globalout';\n }\n this.trigger('mouseout', event);\n }\n },\n wheel: function (event) {\n wheelEventSupported = true;\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n mousewheel: function (event) {\n if (wheelEventSupported) {\n return;\n }\n event = normalizeEvent(this.dom, event);\n this.trigger('mousewheel', event);\n },\n touchstart: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.__lastTouchMoment = new Date();\n this.handler.processGesture(event, 'start');\n localDOMHandlers.mousemove.call(this, event);\n localDOMHandlers.mousedown.call(this, event);\n },\n touchmove: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'change');\n localDOMHandlers.mousemove.call(this, event);\n },\n touchend: function (event) {\n event = normalizeEvent(this.dom, event);\n markTouch(event);\n this.handler.processGesture(event, 'end');\n localDOMHandlers.mouseup.call(this, event);\n if (+new Date() - (+this.__lastTouchMoment) < TOUCH_CLICK_DELAY) {\n localDOMHandlers.click.call(this, event);\n }\n },\n pointerdown: function (event) {\n localDOMHandlers.mousedown.call(this, event);\n },\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n localDOMHandlers.mouseup.call(this, event);\n },\n pointerout: function (event) {\n if (!isPointerFromTouch(event)) {\n localDOMHandlers.mouseout.call(this, event);\n }\n }\n};\nzrUtil.each(['click', 'dblclick', 'contextmenu'], function (name) {\n localDOMHandlers[name] = function (event) {\n event = normalizeEvent(this.dom, event);\n this.trigger(name, event);\n };\n});\nvar globalDOMHandlers = {\n pointermove: function (event) {\n if (!isPointerFromTouch(event)) {\n globalDOMHandlers.mousemove.call(this, event);\n }\n },\n pointerup: function (event) {\n globalDOMHandlers.mouseup.call(this, event);\n },\n mousemove: function (event) {\n this.trigger('mousemove', event);\n },\n mouseup: function (event) {\n var pointerCaptureReleasing = this.__pointerCapturing;\n this.__togglePointerCapture(false);\n this.trigger('mouseup', event);\n if (pointerCaptureReleasing) {\n event.zrEventControl = 'only_globalout';\n this.trigger('mouseout', event);\n }\n }\n};\nfunction mountLocalDOMEventListeners(instance, scope) {\n var domHandlers = scope.domHandlers;\n if (env.pointerEventsSupported) {\n zrUtil.each(localNativeListenerNames.pointer, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n });\n });\n }\n else {\n if (env.touchEventsSupported) {\n zrUtil.each(localNativeListenerNames.touch, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n domHandlers[nativeEventName].call(instance, event);\n setTouchTimer(scope);\n });\n });\n }\n zrUtil.each(localNativeListenerNames.mouse, function (nativeEventName) {\n mountSingleDOMEventListener(scope, nativeEventName, function (event) {\n event = getNativeEvent(event);\n if (!scope.touching) {\n domHandlers[nativeEventName].call(instance, event);\n }\n });\n });\n }\n}\nfunction mountGlobalDOMEventListeners(instance, scope) {\n if (env.pointerEventsSupported) {\n zrUtil.each(globalNativeListenerNames.pointer, mount);\n }\n else if (!env.touchEventsSupported) {\n zrUtil.each(globalNativeListenerNames.mouse, mount);\n }\n function mount(nativeEventName) {\n function nativeEventListener(event) {\n event = getNativeEvent(event);\n if (!isLocalEl(instance, event.target)) {\n event = normalizeGlobalEvent(instance, event);\n scope.domHandlers[nativeEventName].call(instance, event);\n }\n }\n mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, { capture: true });\n }\n}\nfunction mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {\n scope.mounted[nativeEventName] = listener;\n scope.listenerOpts[nativeEventName] = opt;\n addEventListener(scope.domTarget, nativeEventName, listener, opt);\n}\nfunction unmountDOMEventListeners(scope) {\n var mounted = scope.mounted;\n for (var nativeEventName in mounted) {\n if (mounted.hasOwnProperty(nativeEventName)) {\n removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);\n }\n }\n scope.mounted = {};\n}\nvar DOMHandlerScope = (function () {\n function DOMHandlerScope(domTarget, domHandlers) {\n this.mounted = {};\n this.listenerOpts = {};\n this.touching = false;\n this.domTarget = domTarget;\n this.domHandlers = domHandlers;\n }\n return DOMHandlerScope;\n}());\nvar HandlerDomProxy = (function (_super) {\n __extends(HandlerDomProxy, _super);\n function HandlerDomProxy(dom, painterRoot) {\n var _this = _super.call(this) || this;\n _this.__pointerCapturing = false;\n _this.dom = dom;\n _this.painterRoot = painterRoot;\n _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);\n if (globalEventSupported) {\n _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);\n }\n mountLocalDOMEventListeners(_this, _this._localHandlerScope);\n return _this;\n }\n HandlerDomProxy.prototype.dispose = function () {\n unmountDOMEventListeners(this._localHandlerScope);\n if (globalEventSupported) {\n unmountDOMEventListeners(this._globalHandlerScope);\n }\n };\n HandlerDomProxy.prototype.setCursor = function (cursorStyle) {\n this.dom.style && (this.dom.style.cursor = cursorStyle || 'default');\n };\n HandlerDomProxy.prototype.__togglePointerCapture = function (isPointerCapturing) {\n this.__mayPointerCapture = null;\n if (globalEventSupported\n && ((+this.__pointerCapturing) ^ (+isPointerCapturing))) {\n this.__pointerCapturing = isPointerCapturing;\n var globalHandlerScope = this._globalHandlerScope;\n isPointerCapturing\n ? mountGlobalDOMEventListeners(this, globalHandlerScope)\n : unmountDOMEventListeners(globalHandlerScope);\n }\n };\n return HandlerDomProxy;\n}(Eventful));\nexport default HandlerDomProxy;\n","import env from './core/env.js';\nvar dpr = 1;\nif (env.hasGlobalWindow) {\n dpr = Math.max(window.devicePixelRatio\n || (window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI)\n || 1, 1);\n}\nexport var debugMode = 0;\nexport var devicePixelRatio = dpr;\nexport var DARK_MODE_THRESHOLD = 0.4;\nexport var DARK_LABEL_COLOR = '#333';\nexport var LIGHT_LABEL_COLOR = '#ccc';\nexport var LIGHTER_LABEL_COLOR = '#eee';\n","import * as matrix from './matrix.js';\nimport * as vector from './vector.js';\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\nvar scaleTmp = [];\nvar tmpTransform = [];\nvar originTransform = matrix.create();\nvar abs = Math.abs;\nvar Transformable = (function () {\n function Transformable() {\n }\n Transformable.prototype.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n };\n Transformable.prototype.setPosition = function (arr) {\n this.x = arr[0];\n this.y = arr[1];\n };\n Transformable.prototype.setScale = function (arr) {\n this.scaleX = arr[0];\n this.scaleY = arr[1];\n };\n Transformable.prototype.setSkew = function (arr) {\n this.skewX = arr[0];\n this.skewY = arr[1];\n };\n Transformable.prototype.setOrigin = function (arr) {\n this.originX = arr[0];\n this.originY = arr[1];\n };\n Transformable.prototype.needLocalTransform = function () {\n return isNotAroundZero(this.rotation)\n || isNotAroundZero(this.x)\n || isNotAroundZero(this.y)\n || isNotAroundZero(this.scaleX - 1)\n || isNotAroundZero(this.scaleY - 1)\n || isNotAroundZero(this.skewX)\n || isNotAroundZero(this.skewY);\n };\n Transformable.prototype.updateTransform = function () {\n var parentTransform = this.parent && this.parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n if (!(needLocalTransform || parentTransform)) {\n if (m) {\n mIdentity(m);\n this.invTransform = null;\n }\n return;\n }\n m = m || matrix.create();\n if (needLocalTransform) {\n this.getLocalTransform(m);\n }\n else {\n mIdentity(m);\n }\n if (parentTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parentTransform, m);\n }\n else {\n matrix.copy(m, parentTransform);\n }\n }\n this.transform = m;\n this._resolveGlobalScaleRatio(m);\n };\n Transformable.prototype._resolveGlobalScaleRatio = function (m) {\n var globalScaleRatio = this.globalScaleRatio;\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 this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n };\n Transformable.prototype.getComputedTransform = function () {\n var transformNode = this;\n var ancestors = [];\n while (transformNode) {\n ancestors.push(transformNode);\n transformNode = transformNode.parent;\n }\n while (transformNode = ancestors.pop()) {\n transformNode.updateTransform();\n }\n return this.transform;\n };\n Transformable.prototype.setLocalTransform = function (m) {\n if (!m) {\n return;\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 rotation = Math.atan2(m[1], m[0]);\n var shearX = Math.PI / 2 + rotation - Math.atan2(m[3], m[2]);\n sy = Math.sqrt(sy) * Math.cos(shearX);\n sx = Math.sqrt(sx);\n this.skewX = shearX;\n this.skewY = 0;\n this.rotation = -rotation;\n this.x = +m[4];\n this.y = +m[5];\n this.scaleX = sx;\n this.scaleY = sy;\n this.originX = 0;\n this.originY = 0;\n };\n Transformable.prototype.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n var parent = this.parent;\n var m = this.transform;\n if (parent && parent.transform) {\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n var ox = this.originX;\n var oy = this.originY;\n if (ox || oy) {\n originTransform[4] = ox;\n originTransform[5] = oy;\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= ox;\n tmpTransform[5] -= oy;\n m = tmpTransform;\n }\n this.setLocalTransform(m);\n };\n Transformable.prototype.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\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 if (m[0] < 0) {\n out[0] = -out[0];\n }\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n return out;\n };\n Transformable.prototype.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n return v2;\n };\n Transformable.prototype.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n return v2;\n };\n Transformable.prototype.getLineScale = function () {\n var m = this.transform;\n return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10\n ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))\n : 1;\n };\n Transformable.prototype.copyTransform = function (source) {\n copyTransform(this, source);\n };\n Transformable.getLocalTransform = function (target, m) {\n m = m || [];\n var ox = target.originX || 0;\n var oy = target.originY || 0;\n var sx = target.scaleX;\n var sy = target.scaleY;\n var ax = target.anchorX;\n var ay = target.anchorY;\n var rotation = target.rotation || 0;\n var x = target.x;\n var y = target.y;\n var skewX = target.skewX ? Math.tan(target.skewX) : 0;\n var skewY = target.skewY ? Math.tan(-target.skewY) : 0;\n if (ox || oy || ax || ay) {\n var dx = ox + ax;\n var dy = oy + ay;\n m[4] = -dx * sx - skewX * dy * sy;\n m[5] = -dy * sy - skewY * dx * sx;\n }\n else {\n m[4] = m[5] = 0;\n }\n m[0] = sx;\n m[3] = sy;\n m[1] = skewY * sx;\n m[2] = skewX * sy;\n rotation && matrix.rotate(m, m, rotation);\n m[4] += ox + x;\n m[5] += oy + y;\n return m;\n };\n Transformable.initDefaultProps = (function () {\n var proto = Transformable.prototype;\n proto.scaleX =\n proto.scaleY =\n proto.globalScaleRatio = 1;\n proto.x =\n proto.y =\n proto.originX =\n proto.originY =\n proto.skewX =\n proto.skewY =\n proto.rotation =\n proto.anchorX =\n proto.anchorY = 0;\n })();\n return Transformable;\n}());\n;\nexport var TRANSFORMABLE_PROPS = [\n 'x', 'y', 'originX', 'originY', 'anchorX', 'anchorY', 'rotation', 'scaleX', 'scaleY', 'skewX', 'skewY'\n];\nexport function copyTransform(target, source) {\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var propName = TRANSFORMABLE_PROPS[i];\n target[propName] = source[propName];\n }\n}\nexport default Transformable;\n","import BoundingRect from '../core/BoundingRect.js';\nimport LRU from '../core/LRU.js';\nimport { DEFAULT_FONT, platformApi } from '../core/platform.js';\nvar textWidthCache = {};\nexport function getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var cacheOfFont = textWidthCache[font];\n if (!cacheOfFont) {\n cacheOfFont = textWidthCache[font] = new LRU(500);\n }\n var width = cacheOfFont.get(text);\n if (width == null) {\n width = platformApi.measureText(text, font).width;\n cacheOfFont.put(text, width);\n }\n return width;\n}\nexport function innerGetBoundingRect(text, font, textAlign, textBaseline) {\n var width = getWidth(text, font);\n var height = getLineHeight(font);\n var x = adjustTextX(0, width, textAlign);\n var y = adjustTextY(0, height, textBaseline);\n var rect = new BoundingRect(x, y, width, height);\n return rect;\n}\nexport function getBoundingRect(text, font, textAlign, textBaseline) {\n var textLines = ((text || '') + '').split('\\n');\n var len = textLines.length;\n if (len === 1) {\n return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);\n }\n else {\n var uniondRect = new BoundingRect(0, 0, 0, 0);\n for (var i = 0; i < textLines.length; i++) {\n var rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);\n i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);\n }\n return uniondRect;\n }\n}\nexport function adjustTextX(x, width, textAlign) {\n if (textAlign === 'right') {\n x -= width;\n }\n else if (textAlign === 'center') {\n x -= width / 2;\n }\n return x;\n}\nexport function adjustTextY(y, height, verticalAlign) {\n if (verticalAlign === 'middle') {\n y -= height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y -= height;\n }\n return y;\n}\nexport function getLineHeight(font) {\n return getWidth('国', font);\n}\nexport function measureText(text, font) {\n return platformApi.measureText(text, font);\n}\nexport function parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n return parseFloat(value);\n }\n return value;\n}\nexport function calculateTextPosition(out, opts, rect) {\n var textPosition = opts.position || 'inside';\n var distance = opts.distance != null ? opts.distance : 5;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var x = rect.x;\n var y = rect.y;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n if (textPosition instanceof Array) {\n x += parsePercent(textPosition[0], rect.width);\n y += parsePercent(textPosition[1], rect.height);\n textAlign = null;\n textVerticalAlign = null;\n }\n else {\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n }\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n}\n","import Transformable, { TRANSFORMABLE_PROPS } from './core/Transformable.js';\nimport Animator, { cloneValue } from './animation/Animator.js';\nimport BoundingRect from './core/BoundingRect.js';\nimport Eventful from './core/Eventful.js';\nimport { calculateTextPosition, parsePercent } from './contain/text.js';\nimport { guid, isObject, keys, extend, indexOf, logError, mixin, isArrayLike, isTypedArray, isGradientObject, filter, reduce } from './core/util.js';\nimport { LIGHT_LABEL_COLOR, DARK_LABEL_COLOR } from './config.js';\nimport { parse, stringify } from './tool/color.js';\nimport { REDRAW_BIT } from './graphic/constants.js';\nexport var PRESERVED_NORMAL_STATE = '__zr_normal__';\nvar PRIMARY_STATES_KEYS = TRANSFORMABLE_PROPS.concat(['ignore']);\nvar DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = true;\n return obj;\n}, { ignore: false });\nvar tmpTextPosCalcRes = {};\nvar tmpBoundingRect = new BoundingRect(0, 0, 0, 0);\nvar Element = (function () {\n function Element(props) {\n this.id = guid();\n this.animators = [];\n this.currentStates = [];\n this.states = {};\n this._init(props);\n }\n Element.prototype._init = function (props) {\n this.attr(props);\n };\n Element.prototype.drift = function (dx, dy, e) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n case 'vertical':\n dx = 0;\n break;\n }\n var m = this.transform;\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.markRedraw();\n };\n Element.prototype.beforeUpdate = function () { };\n Element.prototype.afterUpdate = function () { };\n Element.prototype.update = function () {\n this.updateTransform();\n if (this.__dirty) {\n this.updateInnerText();\n }\n };\n Element.prototype.updateInnerText = function (forceUpdate) {\n var textEl = this._textContent;\n if (textEl && (!textEl.ignore || forceUpdate)) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n var textConfig = this.textConfig;\n var isLocal = textConfig.local;\n var innerTransformable = textEl.innerTransformable;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var textStyleChanged = false;\n innerTransformable.parent = isLocal ? this : null;\n var innerOrigin = false;\n innerTransformable.copyTransform(textEl);\n if (textConfig.position != null) {\n var layoutRect = tmpBoundingRect;\n if (textConfig.layoutRect) {\n layoutRect.copy(textConfig.layoutRect);\n }\n else {\n layoutRect.copy(this.getBoundingRect());\n }\n if (!isLocal) {\n layoutRect.applyTransform(this.transform);\n }\n if (this.calculateTextPosition) {\n this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n else {\n calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);\n }\n innerTransformable.x = tmpTextPosCalcRes.x;\n innerTransformable.y = tmpTextPosCalcRes.y;\n textAlign = tmpTextPosCalcRes.align;\n textVerticalAlign = tmpTextPosCalcRes.verticalAlign;\n var textOrigin = textConfig.origin;\n if (textOrigin && textConfig.rotation != null) {\n var relOriginX = void 0;\n var relOriginY = void 0;\n if (textOrigin === 'center') {\n relOriginX = layoutRect.width * 0.5;\n relOriginY = layoutRect.height * 0.5;\n }\n else {\n relOriginX = parsePercent(textOrigin[0], layoutRect.width);\n relOriginY = parsePercent(textOrigin[1], layoutRect.height);\n }\n innerOrigin = true;\n innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);\n innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);\n }\n }\n if (textConfig.rotation != null) {\n innerTransformable.rotation = textConfig.rotation;\n }\n var textOffset = textConfig.offset;\n if (textOffset) {\n innerTransformable.x += textOffset[0];\n innerTransformable.y += textOffset[1];\n if (!innerOrigin) {\n innerTransformable.originX = -textOffset[0];\n innerTransformable.originY = -textOffset[1];\n }\n }\n var isInside = textConfig.inside == null\n ? (typeof textConfig.position === 'string' && textConfig.position.indexOf('inside') >= 0)\n : textConfig.inside;\n var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});\n var textFill = void 0;\n var textStroke = void 0;\n var autoStroke = void 0;\n if (isInside && this.canBeInsideText()) {\n textFill = textConfig.insideFill;\n textStroke = textConfig.insideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getInsideTextFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getInsideTextStroke(textFill);\n autoStroke = true;\n }\n }\n else {\n textFill = textConfig.outsideFill;\n textStroke = textConfig.outsideStroke;\n if (textFill == null || textFill === 'auto') {\n textFill = this.getOutsideFill();\n }\n if (textStroke == null || textStroke === 'auto') {\n textStroke = this.getOutsideStroke(textFill);\n autoStroke = true;\n }\n }\n textFill = textFill || '#000';\n if (textFill !== innerTextDefaultStyle.fill\n || textStroke !== innerTextDefaultStyle.stroke\n || autoStroke !== innerTextDefaultStyle.autoStroke\n || textAlign !== innerTextDefaultStyle.align\n || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {\n textStyleChanged = true;\n innerTextDefaultStyle.fill = textFill;\n innerTextDefaultStyle.stroke = textStroke;\n innerTextDefaultStyle.autoStroke = autoStroke;\n innerTextDefaultStyle.align = textAlign;\n innerTextDefaultStyle.verticalAlign = textVerticalAlign;\n textEl.setDefaultTextStyle(innerTextDefaultStyle);\n }\n textEl.__dirty |= REDRAW_BIT;\n if (textStyleChanged) {\n textEl.dirtyStyle(true);\n }\n }\n };\n Element.prototype.canBeInsideText = function () {\n return true;\n };\n Element.prototype.getInsideTextFill = function () {\n return '#fff';\n };\n Element.prototype.getInsideTextStroke = function (textFill) {\n return '#000';\n };\n Element.prototype.getOutsideFill = function () {\n return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;\n };\n Element.prototype.getOutsideStroke = function (textFill) {\n var backgroundColor = this.__zr && this.__zr.getBackgroundColor();\n var colorArr = typeof backgroundColor === 'string' && parse(backgroundColor);\n if (!colorArr) {\n colorArr = [255, 255, 255, 1];\n }\n var alpha = colorArr[3];\n var isDark = this.__zr.isDarkMode();\n for (var i = 0; i < 3; i++) {\n colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);\n }\n colorArr[3] = 1;\n return stringify(colorArr, 'rgba');\n };\n Element.prototype.traverse = function (cb, context) { };\n Element.prototype.attrKV = function (key, value) {\n if (key === 'textConfig') {\n this.setTextConfig(value);\n }\n else if (key === 'textContent') {\n this.setTextContent(value);\n }\n else if (key === 'clipPath') {\n this.setClipPath(value);\n }\n else if (key === 'extra') {\n this.extra = this.extra || {};\n extend(this.extra, value);\n }\n else {\n this[key] = value;\n }\n };\n Element.prototype.hide = function () {\n this.ignore = true;\n this.markRedraw();\n };\n Element.prototype.show = function () {\n this.ignore = false;\n this.markRedraw();\n };\n Element.prototype.attr = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.attrKV(keyOrObj, value);\n }\n else if (isObject(keyOrObj)) {\n var obj = keyOrObj;\n var keysArr = keys(obj);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n this.attrKV(key, keyOrObj[key]);\n }\n }\n this.markRedraw();\n return this;\n };\n Element.prototype.saveCurrentToNormalState = function (toState) {\n this._innerSaveToNormal(toState);\n var normalState = this._normalState;\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var fromStateTransition = animator.__fromStateTransition;\n if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {\n continue;\n }\n var targetName = animator.targetName;\n var target = targetName\n ? normalState[targetName] : normalState;\n animator.saveTo(target);\n }\n };\n Element.prototype._innerSaveToNormal = function (toState) {\n var normalState = this._normalState;\n if (!normalState) {\n normalState = this._normalState = {};\n }\n if (toState.textConfig && !normalState.textConfig) {\n normalState.textConfig = this.textConfig;\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Element.prototype._savePrimaryToNormal = function (toState, normalState, primaryKeys) {\n for (var i = 0; i < primaryKeys.length; i++) {\n var key = primaryKeys[i];\n if (toState[key] != null && !(key in normalState)) {\n normalState[key] = this[key];\n }\n }\n };\n Element.prototype.hasState = function () {\n return this.currentStates.length > 0;\n };\n Element.prototype.getState = function (name) {\n return this.states[name];\n };\n Element.prototype.ensureState = function (name) {\n var states = this.states;\n if (!states[name]) {\n states[name] = {};\n }\n return states[name];\n };\n Element.prototype.clearStates = function (noAnimation) {\n this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);\n };\n Element.prototype.useState = function (stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) {\n var toNormalState = stateName === PRESERVED_NORMAL_STATE;\n var hasStates = this.hasState();\n if (!hasStates && toNormalState) {\n return;\n }\n var currentStates = this.currentStates;\n var animationCfg = this.stateTransition;\n if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {\n return;\n }\n var state;\n if (this.stateProxy && !toNormalState) {\n state = this.stateProxy(stateName);\n }\n if (!state) {\n state = (this.states && this.states[stateName]);\n }\n if (!state && !toNormalState) {\n logError(\"State \" + stateName + \" not exists.\");\n return;\n }\n if (!toNormalState) {\n this.saveCurrentToNormalState(state);\n }\n var useHoverLayer = !!((state && state.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);\n }\n if (toNormalState) {\n this.currentStates = [];\n this._normalState = {};\n }\n else {\n if (!keepCurrentStates) {\n this.currentStates = [stateName];\n }\n else {\n this.currentStates.push(stateName);\n }\n }\n this._updateAnimationTargets();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n return state;\n };\n Element.prototype.useStates = function (states, noAnimation, forceUseHoverLayer) {\n if (!states.length) {\n this.clearStates();\n }\n else {\n var stateObjects = [];\n var currentStates = this.currentStates;\n var len = states.length;\n var notChange = len === currentStates.length;\n if (notChange) {\n for (var i = 0; i < len; i++) {\n if (states[i] !== currentStates[i]) {\n notChange = false;\n break;\n }\n }\n }\n if (notChange) {\n return;\n }\n for (var i = 0; i < len; i++) {\n var stateName = states[i];\n var stateObj = void 0;\n if (this.stateProxy) {\n stateObj = this.stateProxy(stateName, states);\n }\n if (!stateObj) {\n stateObj = this.states[stateName];\n }\n if (stateObj) {\n stateObjects.push(stateObj);\n }\n }\n var lastStateObj = stateObjects[len - 1];\n var useHoverLayer = !!((lastStateObj && lastStateObj.hoverLayer) || forceUseHoverLayer);\n if (useHoverLayer) {\n this._toggleHoverLayerFlag(true);\n }\n var mergedState = this._mergeStates(stateObjects);\n var animationCfg = this.stateTransition;\n this.saveCurrentToNormalState(mergedState);\n this._applyStateObj(states.join(','), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.useStates(states, noAnimation, useHoverLayer);\n }\n if (textGuide) {\n textGuide.useStates(states, noAnimation, useHoverLayer);\n }\n this._updateAnimationTargets();\n this.currentStates = states.slice();\n this.markRedraw();\n if (!useHoverLayer && this.__inHover) {\n this._toggleHoverLayerFlag(false);\n this.__dirty &= ~REDRAW_BIT;\n }\n }\n };\n Element.prototype._updateAnimationTargets = function () {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n if (animator.targetName) {\n animator.changeTarget(this[animator.targetName]);\n }\n }\n };\n Element.prototype.removeState = function (state) {\n var idx = indexOf(this.currentStates, state);\n if (idx >= 0) {\n var currentStates = this.currentStates.slice();\n currentStates.splice(idx, 1);\n this.useStates(currentStates);\n }\n };\n Element.prototype.replaceState = function (oldState, newState, forceAdd) {\n var currentStates = this.currentStates.slice();\n var idx = indexOf(currentStates, oldState);\n var newStateExists = indexOf(currentStates, newState) >= 0;\n if (idx >= 0) {\n if (!newStateExists) {\n currentStates[idx] = newState;\n }\n else {\n currentStates.splice(idx, 1);\n }\n }\n else if (forceAdd && !newStateExists) {\n currentStates.push(newState);\n }\n this.useStates(currentStates);\n };\n Element.prototype.toggleState = function (state, enable) {\n if (enable) {\n this.useState(state, true);\n }\n else {\n this.removeState(state);\n }\n };\n Element.prototype._mergeStates = function (states) {\n var mergedState = {};\n var mergedTextConfig;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n extend(mergedState, state);\n if (state.textConfig) {\n mergedTextConfig = mergedTextConfig || {};\n extend(mergedTextConfig, state.textConfig);\n }\n }\n if (mergedTextConfig) {\n mergedState.textConfig = mergedTextConfig;\n }\n return mergedState;\n };\n Element.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n var needsRestoreToNormal = !(state && keepCurrentStates);\n if (state && state.textConfig) {\n this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);\n extend(this.textConfig, state.textConfig);\n }\n else if (needsRestoreToNormal) {\n if (normalState.textConfig) {\n this.textConfig = normalState.textConfig;\n }\n }\n var transitionTarget = {};\n var hasTransition = false;\n for (var i = 0; i < PRIMARY_STATES_KEYS.length; i++) {\n var key = PRIMARY_STATES_KEYS[i];\n var propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];\n if (state && state[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = state[key];\n }\n else {\n this[key] = state[key];\n }\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n if (propNeedsTransition) {\n hasTransition = true;\n transitionTarget[key] = normalState[key];\n }\n else {\n this[key] = normalState[key];\n }\n }\n }\n }\n if (!transition) {\n for (var i = 0; i < this.animators.length; i++) {\n var animator = this.animators[i];\n var targetName = animator.targetName;\n if (!animator.getLoop()) {\n animator.__changeFinalValue(targetName\n ? (state || normalState)[targetName]\n : (state || normalState));\n }\n }\n }\n if (hasTransition) {\n this._transitionState(stateName, transitionTarget, animationCfg);\n }\n };\n Element.prototype._attachComponent = function (componentEl) {\n if (componentEl.__zr && !componentEl.__hostTarget) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Text element has been added to zrender.');\n }\n return;\n }\n if (componentEl === this) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Recursive component attachment.');\n }\n return;\n }\n var zr = this.__zr;\n if (zr) {\n componentEl.addSelfToZr(zr);\n }\n componentEl.__zr = zr;\n componentEl.__hostTarget = this;\n };\n Element.prototype._detachComponent = function (componentEl) {\n if (componentEl.__zr) {\n componentEl.removeSelfFromZr(componentEl.__zr);\n }\n componentEl.__zr = null;\n componentEl.__hostTarget = null;\n };\n Element.prototype.getClipPath = function () {\n return this._clipPath;\n };\n Element.prototype.setClipPath = function (clipPath) {\n if (this._clipPath && this._clipPath !== clipPath) {\n this.removeClipPath();\n }\n this._attachComponent(clipPath);\n this._clipPath = clipPath;\n this.markRedraw();\n };\n Element.prototype.removeClipPath = function () {\n var clipPath = this._clipPath;\n if (clipPath) {\n this._detachComponent(clipPath);\n this._clipPath = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextContent = function () {\n return this._textContent;\n };\n Element.prototype.setTextContent = function (textEl) {\n var previousTextContent = this._textContent;\n if (previousTextContent === textEl) {\n return;\n }\n if (previousTextContent && previousTextContent !== textEl) {\n this.removeTextContent();\n }\n if (process.env.NODE_ENV !== 'production') {\n if (textEl.__zr && !textEl.__hostTarget) {\n throw new Error('Text element has been added to zrender.');\n }\n }\n textEl.innerTransformable = new Transformable();\n this._attachComponent(textEl);\n this._textContent = textEl;\n this.markRedraw();\n };\n Element.prototype.setTextConfig = function (cfg) {\n if (!this.textConfig) {\n this.textConfig = {};\n }\n extend(this.textConfig, cfg);\n this.markRedraw();\n };\n Element.prototype.removeTextConfig = function () {\n this.textConfig = null;\n this.markRedraw();\n };\n Element.prototype.removeTextContent = function () {\n var textEl = this._textContent;\n if (textEl) {\n textEl.innerTransformable = null;\n this._detachComponent(textEl);\n this._textContent = null;\n this._innerTextDefaultStyle = null;\n this.markRedraw();\n }\n };\n Element.prototype.getTextGuideLine = function () {\n return this._textGuide;\n };\n Element.prototype.setTextGuideLine = function (guideLine) {\n if (this._textGuide && this._textGuide !== guideLine) {\n this.removeTextGuideLine();\n }\n this._attachComponent(guideLine);\n this._textGuide = guideLine;\n this.markRedraw();\n };\n Element.prototype.removeTextGuideLine = function () {\n var textGuide = this._textGuide;\n if (textGuide) {\n this._detachComponent(textGuide);\n this._textGuide = null;\n this.markRedraw();\n }\n };\n Element.prototype.markRedraw = function () {\n this.__dirty |= REDRAW_BIT;\n var zr = this.__zr;\n if (zr) {\n if (this.__inHover) {\n zr.refreshHover();\n }\n else {\n zr.refresh();\n }\n }\n if (this.__hostTarget) {\n this.__hostTarget.markRedraw();\n }\n };\n Element.prototype.dirty = function () {\n this.markRedraw();\n };\n Element.prototype._toggleHoverLayerFlag = function (inHover) {\n this.__inHover = inHover;\n var textContent = this._textContent;\n var textGuide = this._textGuide;\n if (textContent) {\n textContent.__inHover = inHover;\n }\n if (textGuide) {\n textGuide.__inHover = inHover;\n }\n };\n Element.prototype.addSelfToZr = function (zr) {\n if (this.__zr === zr) {\n return;\n }\n this.__zr = zr;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.addSelfToZr(zr);\n }\n if (this._textContent) {\n this._textContent.addSelfToZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.addSelfToZr(zr);\n }\n };\n Element.prototype.removeSelfFromZr = function (zr) {\n if (!this.__zr) {\n return;\n }\n this.__zr = null;\n var animators = this.animators;\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n if (this._clipPath) {\n this._clipPath.removeSelfFromZr(zr);\n }\n if (this._textContent) {\n this._textContent.removeSelfFromZr(zr);\n }\n if (this._textGuide) {\n this._textGuide.removeSelfFromZr(zr);\n }\n };\n Element.prototype.animate = function (key, loop, allowDiscreteAnimation) {\n var target = key ? this[key] : this;\n if (process.env.NODE_ENV !== 'production') {\n if (!target) {\n logError('Property \"'\n + key\n + '\" is not existed in element '\n + this.id);\n return;\n }\n }\n var animator = new Animator(target, loop, allowDiscreteAnimation);\n key && (animator.targetName = key);\n this.addAnimator(animator, key);\n return animator;\n };\n Element.prototype.addAnimator = function (animator, key) {\n var zr = this.__zr;\n var el = this;\n animator.during(function () {\n el.updateDuringAnimation(key);\n }).done(function () {\n var animators = el.animators;\n var idx = indexOf(animators, animator);\n if (idx >= 0) {\n animators.splice(idx, 1);\n }\n });\n this.animators.push(animator);\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n zr && zr.wakeUp();\n };\n Element.prototype.updateDuringAnimation = function (key) {\n this.markRedraw();\n };\n Element.prototype.stopAnimation = function (scope, forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n var leftAnimators = [];\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n if (!scope || scope === animator.scope) {\n animator.stop(forwardToLast);\n }\n else {\n leftAnimators.push(animator);\n }\n }\n this.animators = leftAnimators;\n return this;\n };\n Element.prototype.animateTo = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps);\n };\n Element.prototype.animateFrom = function (target, cfg, animationProps) {\n animateTo(this, target, cfg, animationProps, true);\n };\n Element.prototype._transitionState = function (stateName, target, cfg, animationProps) {\n var animators = animateTo(this, target, cfg, animationProps);\n for (var i = 0; i < animators.length; i++) {\n animators[i].__fromStateTransition = stateName;\n }\n };\n Element.prototype.getBoundingRect = function () {\n return null;\n };\n Element.prototype.getPaintRect = function () {\n return null;\n };\n Element.initDefaultProps = (function () {\n var elProto = Element.prototype;\n elProto.type = 'element';\n elProto.name = '';\n elProto.ignore =\n elProto.silent =\n elProto.isGroup =\n elProto.draggable =\n elProto.dragging =\n elProto.ignoreClip =\n elProto.__inHover = false;\n elProto.__dirty = REDRAW_BIT;\n var logs = {};\n function logDeprecatedError(key, xKey, yKey) {\n if (!logs[key + xKey + yKey]) {\n console.warn(\"DEPRECATED: '\" + key + \"' has been deprecated. use '\" + xKey + \"', '\" + yKey + \"' instead\");\n logs[key + xKey + yKey] = true;\n }\n }\n function createLegacyProperty(key, privateKey, xKey, yKey) {\n Object.defineProperty(elProto, key, {\n get: function () {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n if (!this[privateKey]) {\n var pos = this[privateKey] = [];\n enhanceArray(this, pos);\n }\n return this[privateKey];\n },\n set: function (pos) {\n if (process.env.NODE_ENV !== 'production') {\n logDeprecatedError(key, xKey, yKey);\n }\n this[xKey] = pos[0];\n this[yKey] = pos[1];\n this[privateKey] = pos;\n enhanceArray(this, pos);\n }\n });\n function enhanceArray(self, pos) {\n Object.defineProperty(pos, 0, {\n get: function () {\n return self[xKey];\n },\n set: function (val) {\n self[xKey] = val;\n }\n });\n Object.defineProperty(pos, 1, {\n get: function () {\n return self[yKey];\n },\n set: function (val) {\n self[yKey] = val;\n }\n });\n }\n }\n if (Object.defineProperty) {\n createLegacyProperty('position', '_legacyPos', 'x', 'y');\n createLegacyProperty('scale', '_legacyScale', 'scaleX', 'scaleY');\n createLegacyProperty('origin', '_legacyOrigin', 'originX', 'originY');\n }\n })();\n return Element;\n}());\nmixin(Element, Eventful);\nmixin(Element, Transformable);\nfunction animateTo(animatable, target, cfg, animationProps, reverse) {\n cfg = cfg || {};\n var animators = [];\n animateToShallow(animatable, '', animatable, target, cfg, animationProps, animators, reverse);\n var finishCount = animators.length;\n var doneHappened = false;\n var cfgDone = cfg.done;\n var cfgAborted = cfg.aborted;\n var doneCb = function () {\n doneHappened = true;\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n var abortedCb = function () {\n finishCount--;\n if (finishCount <= 0) {\n doneHappened\n ? (cfgDone && cfgDone())\n : (cfgAborted && cfgAborted());\n }\n };\n if (!finishCount) {\n cfgDone && cfgDone();\n }\n if (animators.length > 0 && cfg.during) {\n animators[0].during(function (target, percent) {\n cfg.during(percent);\n });\n }\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i];\n if (doneCb) {\n animator.done(doneCb);\n }\n if (abortedCb) {\n animator.aborted(abortedCb);\n }\n if (cfg.force) {\n animator.duration(cfg.duration);\n }\n animator.start(cfg.easing);\n }\n return animators;\n}\nfunction copyArrShallow(source, target, len) {\n for (var i = 0; i < len; i++) {\n source[i] = target[i];\n }\n}\nfunction is2DArray(value) {\n return isArrayLike(value[0]);\n}\nfunction copyValue(target, source, key) {\n if (isArrayLike(source[key])) {\n if (!isArrayLike(target[key])) {\n target[key] = [];\n }\n if (isTypedArray(source[key])) {\n var len = source[key].length;\n if (target[key].length !== len) {\n target[key] = new (source[key].constructor)(len);\n copyArrShallow(target[key], source[key], len);\n }\n }\n else {\n var sourceArr = source[key];\n var targetArr = target[key];\n var len0 = sourceArr.length;\n if (is2DArray(sourceArr)) {\n var len1 = sourceArr[0].length;\n for (var i = 0; i < len0; i++) {\n if (!targetArr[i]) {\n targetArr[i] = Array.prototype.slice.call(sourceArr[i]);\n }\n else {\n copyArrShallow(targetArr[i], sourceArr[i], len1);\n }\n }\n }\n else {\n copyArrShallow(targetArr, sourceArr, len0);\n }\n targetArr.length = sourceArr.length;\n }\n }\n else {\n target[key] = source[key];\n }\n}\nfunction isValueSame(val1, val2) {\n return val1 === val2\n || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);\n}\nfunction is1DArraySame(arr0, arr1) {\n var len = arr0.length;\n if (len !== arr1.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n return true;\n}\nfunction animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse) {\n var targetKeys = keys(target);\n var duration = cfg.duration;\n var delay = cfg.delay;\n var additive = cfg.additive;\n var setToFinal = cfg.setToFinal;\n var animateAll = !isObject(animationProps);\n var existsAnimators = animatable.animators;\n var animationKeys = [];\n for (var k = 0; k < targetKeys.length; k++) {\n var innerKey = targetKeys[k];\n var targetVal = target[innerKey];\n if (targetVal != null && animateObj[innerKey] != null\n && (animateAll || animationProps[innerKey])) {\n if (isObject(targetVal)\n && !isArrayLike(targetVal)\n && !isGradientObject(targetVal)) {\n if (topKey) {\n if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n }\n continue;\n }\n animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse);\n }\n else {\n animationKeys.push(innerKey);\n }\n }\n else if (!reverse) {\n animateObj[innerKey] = targetVal;\n animatable.updateDuringAnimation(topKey);\n animationKeys.push(innerKey);\n }\n }\n var keyLen = animationKeys.length;\n if (!additive && keyLen) {\n for (var i = 0; i < existsAnimators.length; i++) {\n var animator = existsAnimators[i];\n if (animator.targetName === topKey) {\n var allAborted = animator.stopTracks(animationKeys);\n if (allAborted) {\n var idx = indexOf(existsAnimators, animator);\n existsAnimators.splice(idx, 1);\n }\n }\n }\n }\n if (!cfg.force) {\n animationKeys = filter(animationKeys, function (key) { return !isValueSame(target[key], animateObj[key]); });\n keyLen = animationKeys.length;\n }\n if (keyLen > 0\n || (cfg.force && !animators.length)) {\n var revertedSource = void 0;\n var reversedTarget = void 0;\n var sourceClone = void 0;\n if (reverse) {\n reversedTarget = {};\n if (setToFinal) {\n revertedSource = {};\n }\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n reversedTarget[innerKey] = animateObj[innerKey];\n if (setToFinal) {\n revertedSource[innerKey] = target[innerKey];\n }\n else {\n animateObj[innerKey] = target[innerKey];\n }\n }\n }\n else if (setToFinal) {\n sourceClone = {};\n for (var i = 0; i < keyLen; i++) {\n var innerKey = animationKeys[i];\n sourceClone[innerKey] = cloneValue(animateObj[innerKey]);\n copyValue(animateObj, target, innerKey);\n }\n }\n var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function (animator) { return animator.targetName === topKey; }) : null);\n animator.targetName = topKey;\n if (cfg.scope) {\n animator.scope = cfg.scope;\n }\n if (setToFinal && revertedSource) {\n animator.whenWithKeys(0, revertedSource, animationKeys);\n }\n if (sourceClone) {\n animator.whenWithKeys(0, sourceClone, animationKeys);\n }\n animator.whenWithKeys(duration == null ? 500 : duration, reverse ? reversedTarget : target, animationKeys).delay(delay || 0);\n animatable.addAnimator(animator, topKey);\n animators.push(animator);\n }\n}\nexport default Element;\n","import { __extends } from \"tslib\";\nimport * as zrUtil from '../core/util.js';\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar Group = (function (_super) {\n __extends(Group, _super);\n function Group(opts) {\n var _this = _super.call(this) || this;\n _this.isGroup = true;\n _this._children = [];\n _this.attr(opts);\n return _this;\n }\n Group.prototype.childrenRef = function () {\n return this._children;\n };\n Group.prototype.children = function () {\n return this._children.slice();\n };\n Group.prototype.childAt = function (idx) {\n return this._children[idx];\n };\n Group.prototype.childOfName = function (name) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n };\n Group.prototype.childCount = function () {\n return this._children.length;\n };\n Group.prototype.add = function (child) {\n if (child) {\n if (child !== this && child.parent !== this) {\n this._children.push(child);\n this._doAdd(child);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (child.__hostTarget) {\n throw 'This elemenet has been used as an attachment';\n }\n }\n }\n return this;\n };\n Group.prototype.addBefore = function (child, nextSibling) {\n if (child && child !== this && child.parent !== this\n && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n if (idx >= 0) {\n children.splice(idx, 0, child);\n this._doAdd(child);\n }\n }\n return this;\n };\n Group.prototype.replace = function (oldChild, newChild) {\n var idx = zrUtil.indexOf(this._children, oldChild);\n if (idx >= 0) {\n this.replaceAt(newChild, idx);\n }\n return this;\n };\n Group.prototype.replaceAt = function (child, index) {\n var children = this._children;\n var old = children[index];\n if (child && child !== this && child.parent !== this && child !== old) {\n children[index] = child;\n old.parent = null;\n var zr = this.__zr;\n if (zr) {\n old.removeSelfFromZr(zr);\n }\n this._doAdd(child);\n }\n return this;\n };\n Group.prototype._doAdd = function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n child.parent = this;\n var zr = this.__zr;\n if (zr && zr !== child.__zr) {\n child.addSelfToZr(zr);\n }\n zr && zr.refresh();\n };\n Group.prototype.remove = function (child) {\n var zr = this.__zr;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n if (idx < 0) {\n return this;\n }\n children.splice(idx, 1);\n child.parent = null;\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n zr && zr.refresh();\n return this;\n };\n Group.prototype.removeAll = function () {\n var children = this._children;\n var zr = this.__zr;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (zr) {\n child.removeSelfFromZr(zr);\n }\n child.parent = null;\n }\n children.length = 0;\n return this;\n };\n Group.prototype.eachChild = function (cb, context) {\n var children = this._children;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n return this;\n };\n Group.prototype.traverse = function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n var stopped = cb.call(context, child);\n if (child.isGroup && !stopped) {\n child.traverse(cb, context);\n }\n }\n return this;\n };\n Group.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.addSelfToZr(zr);\n }\n };\n Group.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.removeSelfFromZr(zr);\n }\n };\n Group.prototype.getBoundingRect = function (includeChildren) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.ignore || child.invisible) {\n continue;\n }\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n BoundingRect.applyTransform(tmpRect, childRect, transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n return rect || tmpRect;\n };\n return Group;\n}(Element));\nGroup.prototype.type = 'group';\nexport default Group;\n","/*!\n* ZRender, a high performance 2d drawing library.\n*\n* Copyright (c) 2013, Baidu Inc.\n* All rights reserved.\n*\n* LICENSE\n* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt\n*/\nimport env from './core/env.js';\nimport * as zrUtil from './core/util.js';\nimport Handler from './Handler.js';\nimport Storage from './Storage.js';\nimport Animation, { getTime } from './animation/Animation.js';\nimport HandlerProxy from './dom/HandlerProxy.js';\nimport { lum } from './tool/color.js';\nimport { DARK_MODE_THRESHOLD } from './config.js';\nimport Group from './graphic/Group.js';\nvar painterCtors = {};\nvar instances = {};\nfunction delInstance(id) {\n delete instances[id];\n}\nfunction isDarkMode(backgroundColor) {\n if (!backgroundColor) {\n return false;\n }\n if (typeof backgroundColor === 'string') {\n return lum(backgroundColor, 1) < DARK_MODE_THRESHOLD;\n }\n else if (backgroundColor.colorStops) {\n var colorStops = backgroundColor.colorStops;\n var totalLum = 0;\n var len = colorStops.length;\n for (var i = 0; i < len; i++) {\n totalLum += lum(colorStops[i].color, 1);\n }\n totalLum /= len;\n return totalLum < DARK_MODE_THRESHOLD;\n }\n return false;\n}\nvar ZRender = (function () {\n function ZRender(id, dom, opts) {\n var _this = this;\n this._sleepAfterStill = 10;\n this._stillFrameAccum = 0;\n this._needsRefresh = true;\n this._needsRefreshHover = true;\n this._darkMode = false;\n opts = opts || {};\n this.dom = dom;\n this.id = id;\n var storage = new Storage();\n var rendererType = opts.renderer || 'canvas';\n if (!painterCtors[rendererType]) {\n rendererType = zrUtil.keys(painterCtors)[0];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!painterCtors[rendererType]) {\n throw new Error(\"Renderer '\" + rendererType + \"' is not imported. Please import it first.\");\n }\n }\n opts.useDirtyRect = opts.useDirtyRect == null\n ? false\n : opts.useDirtyRect;\n var painter = new painterCtors[rendererType](dom, storage, opts, id);\n var ssrMode = opts.ssr || painter.ssrOnly;\n this.storage = storage;\n this.painter = painter;\n var handerProxy = (!env.node && !env.worker && !ssrMode)\n ? new HandlerProxy(painter.getViewportRoot(), painter.root)\n : null;\n var useCoarsePointer = opts.useCoarsePointer;\n var usePointerSize = (useCoarsePointer == null || useCoarsePointer === 'auto')\n ? env.touchEventsSupported\n : !!useCoarsePointer;\n var defaultPointerSize = 44;\n var pointerSize;\n if (usePointerSize) {\n pointerSize = zrUtil.retrieve2(opts.pointerSize, defaultPointerSize);\n }\n this.handler = new Handler(storage, painter, handerProxy, painter.root, pointerSize);\n this.animation = new Animation({\n stage: {\n update: ssrMode ? null : function () { return _this._flush(true); }\n }\n });\n if (!ssrMode) {\n this.animation.start();\n }\n }\n ZRender.prototype.add = function (el) {\n if (!el) {\n return;\n }\n this.storage.addRoot(el);\n el.addSelfToZr(this);\n this.refresh();\n };\n ZRender.prototype.remove = function (el) {\n if (!el) {\n return;\n }\n this.storage.delRoot(el);\n el.removeSelfFromZr(this);\n this.refresh();\n };\n ZRender.prototype.configLayer = function (zLevel, config) {\n if (this.painter.configLayer) {\n this.painter.configLayer(zLevel, config);\n }\n this.refresh();\n };\n ZRender.prototype.setBackgroundColor = function (backgroundColor) {\n if (this.painter.setBackgroundColor) {\n this.painter.setBackgroundColor(backgroundColor);\n }\n this.refresh();\n this._backgroundColor = backgroundColor;\n this._darkMode = isDarkMode(backgroundColor);\n };\n ZRender.prototype.getBackgroundColor = function () {\n return this._backgroundColor;\n };\n ZRender.prototype.setDarkMode = function (darkMode) {\n this._darkMode = darkMode;\n };\n ZRender.prototype.isDarkMode = function () {\n return this._darkMode;\n };\n ZRender.prototype.refreshImmediately = function (fromInside) {\n if (!fromInside) {\n this.animation.update(true);\n }\n this._needsRefresh = false;\n this.painter.refresh();\n this._needsRefresh = false;\n };\n ZRender.prototype.refresh = function () {\n this._needsRefresh = true;\n this.animation.start();\n };\n ZRender.prototype.flush = function () {\n this._flush(false);\n };\n ZRender.prototype._flush = function (fromInside) {\n var triggerRendered;\n var start = getTime();\n if (this._needsRefresh) {\n triggerRendered = true;\n this.refreshImmediately(fromInside);\n }\n if (this._needsRefreshHover) {\n triggerRendered = true;\n this.refreshHoverImmediately();\n }\n var end = getTime();\n if (triggerRendered) {\n this._stillFrameAccum = 0;\n this.trigger('rendered', {\n elapsedTime: end - start\n });\n }\n else if (this._sleepAfterStill > 0) {\n this._stillFrameAccum++;\n if (this._stillFrameAccum > this._sleepAfterStill) {\n this.animation.stop();\n }\n }\n };\n ZRender.prototype.setSleepAfterStill = function (stillFramesCount) {\n this._sleepAfterStill = stillFramesCount;\n };\n ZRender.prototype.wakeUp = function () {\n this.animation.start();\n this._stillFrameAccum = 0;\n };\n ZRender.prototype.refreshHover = function () {\n this._needsRefreshHover = true;\n };\n ZRender.prototype.refreshHoverImmediately = function () {\n this._needsRefreshHover = false;\n if (this.painter.refreshHover && this.painter.getType() === 'canvas') {\n this.painter.refreshHover();\n }\n };\n ZRender.prototype.resize = function (opts) {\n opts = opts || {};\n this.painter.resize(opts.width, opts.height);\n this.handler.resize();\n };\n ZRender.prototype.clearAnimation = function () {\n this.animation.clear();\n };\n ZRender.prototype.getWidth = function () {\n return this.painter.getWidth();\n };\n ZRender.prototype.getHeight = function () {\n return this.painter.getHeight();\n };\n ZRender.prototype.setCursorStyle = function (cursorStyle) {\n this.handler.setCursorStyle(cursorStyle);\n };\n ZRender.prototype.findHover = function (x, y) {\n return this.handler.findHover(x, y);\n };\n ZRender.prototype.on = function (eventName, eventHandler, context) {\n this.handler.on(eventName, eventHandler, context);\n return this;\n };\n ZRender.prototype.off = function (eventName, eventHandler) {\n this.handler.off(eventName, eventHandler);\n };\n ZRender.prototype.trigger = function (eventName, event) {\n this.handler.trigger(eventName, event);\n };\n ZRender.prototype.clear = function () {\n var roots = this.storage.getRoots();\n for (var i = 0; i < roots.length; i++) {\n if (roots[i] instanceof Group) {\n roots[i].removeSelfFromZr(this);\n }\n }\n this.storage.delAllRoots();\n this.painter.clear();\n };\n ZRender.prototype.dispose = function () {\n this.animation.stop();\n this.clear();\n this.storage.dispose();\n this.painter.dispose();\n this.handler.dispose();\n this.animation =\n this.storage =\n this.painter =\n this.handler = null;\n delInstance(this.id);\n };\n return ZRender;\n}());\nexport function init(dom, opts) {\n var zr = new ZRender(zrUtil.guid(), dom, opts);\n instances[zr.id] = zr;\n return zr;\n}\nexport function dispose(zr) {\n zr.dispose();\n}\nexport function disposeAll() {\n for (var key in instances) {\n if (instances.hasOwnProperty(key)) {\n instances[key].dispose();\n }\n }\n instances = {};\n}\nexport function getInstance(id) {\n return instances[id];\n}\nexport function registerPainter(name, Ctor) {\n painterCtors[name] = Ctor;\n}\nexport var version = '5.4.4';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The method \"quantile\" was copied from \"d3.js\".\r\n* (See more details in the comment of the method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar RADIAN_EPSILON = 1e-4; // Although chrome already enlarge this number to 100 for `toFixed`, but\n// we sill follow the spec for compatibility.\n\nvar ROUND_SUPPORTED_PRECISION_MAX = 20;\n\nfunction _trim(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n/**\r\n * Linear mapping a value from domain to range\r\n * @param val\r\n * @param domain Domain extent domain[0] can be bigger than domain[1]\r\n * @param range Range extent range[0] can be bigger than range[1]\r\n * @param clamp Default to be false\r\n */\n\n\nexport function linearMap(val, domain, range, clamp) {\n var d0 = domain[0];\n var d1 = domain[1];\n var r0 = range[0];\n var r1 = range[1];\n var subDomain = d1 - d0;\n var subRange = r1 - r0;\n\n if (subDomain === 0) {\n return subRange === 0 ? r0 : (r0 + r1) / 2;\n } // Avoid accuracy problem in edge, such as\n // 146.39 - 62.83 === 83.55999999999999.\n // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError\n // It is a little verbose for efficiency considering this method\n // is a hotspot.\n\n\n if (clamp) {\n if (subDomain > 0) {\n if (val <= d0) {\n return r0;\n } else if (val >= d1) {\n return r1;\n }\n } else {\n if (val >= d0) {\n return r0;\n } else if (val <= d1) {\n return r1;\n }\n }\n } else {\n if (val === d0) {\n return r0;\n }\n\n if (val === d1) {\n return r1;\n }\n }\n\n return (val - d0) / subDomain * subRange + r0;\n}\n/**\r\n * Convert a percent string to absolute number.\r\n * Returns NaN if percent is not a valid string or number\r\n */\n\nexport function parsePercent(percent, all) {\n switch (percent) {\n case 'center':\n case 'middle':\n percent = '50%';\n break;\n\n case 'left':\n case 'top':\n percent = '0%';\n break;\n\n case 'right':\n case 'bottom':\n percent = '100%';\n break;\n }\n\n if (zrUtil.isString(percent)) {\n if (_trim(percent).match(/%$/)) {\n return parseFloat(percent) / 100 * all;\n }\n\n return parseFloat(percent);\n }\n\n return percent == null ? NaN : +percent;\n}\nexport function round(x, precision, returnStr) {\n if (precision == null) {\n precision = 10;\n } // Avoid range error\n\n\n precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX); // PENDING: 1.005.toFixed(2) is '1.00' rather than '1.01'\n\n x = (+x).toFixed(precision);\n return returnStr ? x : +x;\n}\n/**\r\n * Inplacd asc sort arr.\r\n * The input arr will be modified.\r\n */\n\nexport function asc(arr) {\n arr.sort(function (a, b) {\n return a - b;\n });\n return arr;\n}\n/**\r\n * Get precision.\r\n */\n\nexport function getPrecision(val) {\n val = +val;\n\n if (isNaN(val)) {\n return 0;\n } // It is much faster than methods converting number to string as follows\n // let tmp = val.toString();\n // return tmp.length - 1 - tmp.indexOf('.');\n // especially when precision is low\n // Notice:\n // (1) If the loop count is over about 20, it is slower than `getPrecisionSafe`.\n // (see https://jsbench.me/2vkpcekkvw/1)\n // (2) If the val is less than for example 1e-15, the result may be incorrect.\n // (see test/ut/spec/util/number.test.ts `getPrecision_equal_random`)\n\n\n if (val > 1e-14) {\n var e = 1;\n\n for (var i = 0; i < 15; i++, e *= 10) {\n if (Math.round(val * e) / e === val) {\n return i;\n }\n }\n }\n\n return getPrecisionSafe(val);\n}\n/**\r\n * Get precision with slow but safe method\r\n */\n\nexport function getPrecisionSafe(val) {\n // toLowerCase for: '3.4E-12'\n var str = val.toString().toLowerCase(); // Consider scientific notation: '3.4e-12' '3.4e+12'\n\n var eIndex = str.indexOf('e');\n var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;\n var significandPartLen = eIndex > 0 ? eIndex : str.length;\n var dotIndex = str.indexOf('.');\n var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;\n return Math.max(0, decimalPartLen - exp);\n}\n/**\r\n * Minimal dicernible data precisioin according to a single pixel.\r\n */\n\nexport function getPixelPrecision(dataExtent, pixelExtent) {\n var log = Math.log;\n var LN10 = Math.LN10;\n var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);\n var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10); // toFixed() digits argument must be between 0 and 20.\n\n var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);\n return !isFinite(precision) ? 20 : precision;\n}\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param idx index of the data to be processed in valueList\r\n * @param precision integer number showing digits of precision\r\n * @return percent ranging from 0 to 100\r\n */\n\nexport function getPercentWithPrecision(valueList, idx, precision) {\n if (!valueList[idx]) {\n return 0;\n }\n\n var seats = getPercentSeats(valueList, precision);\n return seats[idx] || 0;\n}\n/**\r\n * Get a data of given precision, assuring the sum of percentages\r\n * in valueList is 1.\r\n * The largest remainder method is used.\r\n * https://en.wikipedia.org/wiki/Largest_remainder_method\r\n *\r\n * @param valueList a list of all data\r\n * @param precision integer number showing digits of precision\r\n * @return {Array}\r\n */\n\nexport function getPercentSeats(valueList, precision) {\n var sum = zrUtil.reduce(valueList, function (acc, val) {\n return acc + (isNaN(val) ? 0 : val);\n }, 0);\n\n if (sum === 0) {\n return [];\n }\n\n var digits = Math.pow(10, precision);\n var votesPerQuota = zrUtil.map(valueList, function (val) {\n return (isNaN(val) ? 0 : val) / sum * digits * 100;\n });\n var targetSeats = digits * 100;\n var seats = zrUtil.map(votesPerQuota, function (votes) {\n // Assign automatic seats.\n return Math.floor(votes);\n });\n var currentSum = zrUtil.reduce(seats, function (acc, val) {\n return acc + val;\n }, 0);\n var remainder = zrUtil.map(votesPerQuota, function (votes, idx) {\n return votes - seats[idx];\n }); // Has remainding votes.\n\n while (currentSum < targetSeats) {\n // Find next largest remainder.\n var max = Number.NEGATIVE_INFINITY;\n var maxId = null;\n\n for (var i = 0, len = remainder.length; i < len; ++i) {\n if (remainder[i] > max) {\n max = remainder[i];\n maxId = i;\n }\n } // Add a vote to max remainder.\n\n\n ++seats[maxId];\n remainder[maxId] = 0;\n ++currentSum;\n }\n\n return zrUtil.map(seats, function (seat) {\n return seat / digits;\n });\n}\n/**\r\n * Solve the floating point adding problem like 0.1 + 0.2 === 0.30000000000000004\r\n * See \r\n */\n\nexport function addSafe(val0, val1) {\n var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1)); // const multiplier = Math.pow(10, maxPrecision);\n // return (Math.round(val0 * multiplier) + Math.round(val1 * multiplier)) / multiplier;\n\n var sum = val0 + val1; // // PENDING: support more?\n\n return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum : round(sum, maxPrecision);\n} // Number.MAX_SAFE_INTEGER, ie do not support.\n\nexport var MAX_SAFE_INTEGER = 9007199254740991;\n/**\r\n * To 0 - 2 * PI, considering negative radian.\r\n */\n\nexport function remRadian(radian) {\n var pi2 = Math.PI * 2;\n return (radian % pi2 + pi2) % pi2;\n}\n/**\r\n * @param {type} radian\r\n * @return {boolean}\r\n */\n\nexport function isRadianAroundZero(val) {\n return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;\n} // eslint-disable-next-line\n\nvar TIME_REG = /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // jshint ignore:line\n\n/**\r\n * @param value valid type: number | string | Date, otherwise return `new Date(NaN)`\r\n * These values can be accepted:\r\n * + An instance of Date, represent a time in its own time zone.\r\n * + Or string in a subset of ISO 8601, only including:\r\n * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',\r\n * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',\r\n * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',\r\n * all of which will be treated as local time if time zone is not specified\r\n * (see ).\r\n * + Or other string format, including (all of which will be treated as local time):\r\n * '2012', '2012-3-1', '2012/3/1', '2012/03/01',\r\n * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'\r\n * + a timestamp, which represent a time in UTC.\r\n * @return date Never be null/undefined. If invalid, return `new Date(NaN)`.\r\n */\n\nexport function parseDate(value) {\n if (value instanceof Date) {\n return value;\n } else if (zrUtil.isString(value)) {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n var match = TIME_REG.exec(value);\n\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n } // Use local time when no timezone offset is specified.\n\n\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);\n } // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n else {\n var hour = +match[4] || 0;\n\n if (match[8].toUpperCase() !== 'Z') {\n hour -= +match[8].slice(0, 3);\n }\n\n return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));\n }\n } else if (value == null) {\n return new Date(NaN);\n }\n\n return new Date(Math.round(value));\n}\n/**\r\n * Quantity of a number. e.g. 0.1, 1, 10, 100\r\n *\r\n * @param val\r\n * @return\r\n */\n\nexport function quantity(val) {\n return Math.pow(10, quantityExponent(val));\n}\n/**\r\n * Exponent of the quantity of a number\r\n * e.g., 1234 equals to 1.234*10^3, so quantityExponent(1234) is 3\r\n *\r\n * @param val non-negative value\r\n * @return\r\n */\n\nexport function quantityExponent(val) {\n if (val === 0) {\n return 0;\n }\n\n var exp = Math.floor(Math.log(val) / Math.LN10);\n /**\r\n * exp is expected to be the rounded-down result of the base-10 log of val.\r\n * But due to the precision loss with Math.log(val), we need to restore it\r\n * using 10^exp to make sure we can get val back from exp. #11249\r\n */\n\n if (val / Math.pow(10, exp) >= 10) {\n exp++;\n }\n\n return exp;\n}\n/**\r\n * find a “nice” number approximately equal to x. Round the number if round = true,\r\n * take ceiling if round = false. The primary observation is that the “nicest”\r\n * numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.\r\n *\r\n * See \"Nice Numbers for Graph Labels\" of Graphic Gems.\r\n *\r\n * @param val Non-negative value.\r\n * @param round\r\n * @return Niced number\r\n */\n\nexport function nice(val, round) {\n var exponent = quantityExponent(val);\n var exp10 = Math.pow(10, exponent);\n var f = val / exp10; // 1 <= f < 10\n\n var nf;\n\n if (round) {\n if (f < 1.5) {\n nf = 1;\n } else if (f < 2.5) {\n nf = 2;\n } else if (f < 4) {\n nf = 3;\n } else if (f < 7) {\n nf = 5;\n } else {\n nf = 10;\n }\n } else {\n if (f < 1) {\n nf = 1;\n } else if (f < 2) {\n nf = 2;\n } else if (f < 3) {\n nf = 3;\n } else if (f < 5) {\n nf = 5;\n } else {\n nf = 10;\n }\n }\n\n val = nf * exp10; // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754).\n // 20 is the uppper bound of toFixed.\n\n return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;\n}\n/**\r\n * This code was copied from \"d3.js\"\r\n * .\r\n * See the license statement at the head of this file.\r\n * @param ascArr\r\n */\n\nexport function quantile(ascArr, p) {\n var H = (ascArr.length - 1) * p + 1;\n var h = Math.floor(H);\n var v = +ascArr[h - 1];\n var e = H - h;\n return e ? v + e * (ascArr[h] - v) : v;\n}\n/**\r\n * Order intervals asc, and split them when overlap.\r\n * expect(numberUtil.reformIntervals([\r\n * {interval: [18, 62], close: [1, 1]},\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [1, 1]},\r\n * {interval: [62, 150], close: [1, 1]},\r\n * {interval: [106, 150], close: [1, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ])).toEqual([\r\n * {interval: [-Infinity, -70], close: [0, 0]},\r\n * {interval: [-70, -26], close: [1, 1]},\r\n * {interval: [-26, 18], close: [0, 1]},\r\n * {interval: [18, 62], close: [0, 1]},\r\n * {interval: [62, 150], close: [0, 1]},\r\n * {interval: [150, Infinity], close: [0, 0]}\r\n * ]);\r\n * @param list, where `close` mean open or close\r\n * of the interval, and Infinity can be used.\r\n * @return The origin list, which has been reformed.\r\n */\n\nexport function reformIntervals(list) {\n list.sort(function (a, b) {\n return littleThan(a, b, 0) ? -1 : 1;\n });\n var curr = -Infinity;\n var currClose = 1;\n\n for (var i = 0; i < list.length;) {\n var interval = list[i].interval;\n var close_1 = list[i].close;\n\n for (var lg = 0; lg < 2; lg++) {\n if (interval[lg] <= curr) {\n interval[lg] = curr;\n close_1[lg] = !lg ? 1 - currClose : 1;\n }\n\n curr = interval[lg];\n currClose = close_1[lg];\n }\n\n if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {\n list.splice(i, 1);\n } else {\n i++;\n }\n }\n\n return list;\n\n function littleThan(a, b, lg) {\n 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));\n }\n}\n/**\r\n * [Numeric is defined as]:\r\n * `parseFloat(val) == val`\r\n * For example:\r\n * numeric:\r\n * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity,\r\n * and they rounded by white-spaces or line-terminal like ' -123 \\n ' (see es spec)\r\n * not-numeric:\r\n * null, undefined, [], {}, true, false, 'NaN', NaN, '123ab',\r\n * empty string, string with only white-spaces or line-terminal (see es spec),\r\n * 0x12, '0x12', '-0x12', 012, '012', '-012',\r\n * non-string, ...\r\n *\r\n * @test See full test cases in `test/ut/spec/util/number.js`.\r\n * @return Must be a typeof number. If not numeric, return NaN.\r\n */\n\nexport function numericToNumber(val) {\n var valFloat = parseFloat(val);\n return valFloat == val // eslint-disable-line eqeqeq\n && (valFloat !== 0 || !zrUtil.isString(val) || val.indexOf('x') <= 0) // For case ' 0x0 '.\n ? valFloat : NaN;\n}\n/**\r\n * Definition of \"numeric\": see `numericToNumber`.\r\n */\n\nexport function isNumeric(val) {\n return !isNaN(numericToNumber(val));\n}\n/**\r\n * Use random base to prevent users hard code depending on\r\n * this auto generated marker id.\r\n * @return An positive integer.\r\n */\n\nexport function getRandomIdBase() {\n return Math.round(Math.random() * 9);\n}\n/**\r\n * Get the greatest common divisor.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\n\nexport function getGreatestCommonDividor(a, b) {\n if (b === 0) {\n return a;\n }\n\n return getGreatestCommonDividor(b, a % b);\n}\n/**\r\n * Get the least common multiple.\r\n *\r\n * @param {number} a one number\r\n * @param {number} b the other number\r\n */\n\nexport function getLeastCommonMultiple(a, b) {\n if (a == null) {\n return b;\n }\n\n if (b == null) {\n return a;\n }\n\n return a * b / getGreatestCommonDividor(a, b);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isObject, isArray, createHashMap, map, assert, isString, indexOf, isStringSafe, isNumber } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { isNumeric, getRandomIdBase, getPrecision, round } from './number.js';\nimport { warn } from './log.js';\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\r\n * Make the name displayable. But we should\r\n * make sure it is not duplicated with user\r\n * specified name, so use '\\0';\r\n */\n\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\nvar INTERNAL_COMPONENT_ID_PREFIX = '\\0_ec_\\0';\n/**\r\n * If value is not array, then translate it to array.\r\n * @param {*} value\r\n * @return {Array} [value] or value\r\n */\n\nexport function normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\r\n * Sync default option between normal and emphasis like `position` and `show`\r\n * In case some one will write code like\r\n * label: {\r\n * show: false,\r\n * position: 'outside',\r\n * fontSize: 18\r\n * },\r\n * emphasis: {\r\n * label: { show: true }\r\n * }\r\n */\n\nexport function 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}\nexport 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([\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/**\r\n * The method does not ensure performance.\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method retrieves value from data.\r\n */\n\nexport function getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\r\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\r\n * This helper method determine if dataItem has extra option besides value\r\n */\n\nexport function 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/**\r\n * Mapping to existings for merge.\r\n *\r\n * Mode \"normalMege\":\r\n * The mapping result (merge result) will keep the order of the existing\r\n * component, rather than the order of new option. Because we should ensure\r\n * some specified index reference (like xAxisIndex) keep work.\r\n * And in most cases, \"merge option\" is used to update partial option but not\r\n * be expected to change the order.\r\n *\r\n * Mode \"replaceMege\":\r\n * (1) Only the id mapped components will be merged.\r\n * (2) Other existing components (except internal components) will be removed.\r\n * (3) Other new options will be used to create new component.\r\n * (4) The index of the existing components will not be modified.\r\n * That means their might be \"hole\" after the removal.\r\n * The new components are created first at those available index.\r\n *\r\n * Mode \"replaceAll\":\r\n * This mode try to support that reproduce an echarts instance from another\r\n * echarts instance (via `getOption`) in some simple cases.\r\n * In this scenario, the `result` index are exactly the consistent with the `newCmptOptions`,\r\n * which ensures the component index referring (like `xAxisIndex: ?`) corrent. That is,\r\n * the \"hole\" in `newCmptOptions` will also be kept.\r\n * On the contrary, other modes try best to eliminate holes.\r\n * PENDING: This is an experimental mode yet.\r\n *\r\n * @return See the comment of .\r\n */\n\nexport function mappingToExists(existings, newCmptOptions, mode) {\n var isNormalMergeMode = mode === 'normalMerge';\n var isReplaceMergeMode = mode === 'replaceMerge';\n var isReplaceAllMode = mode === 'replaceAll';\n existings = existings || [];\n newCmptOptions = (newCmptOptions || []).slice();\n var existingIdIdxMap = createHashMap(); // Validate id and name on user input option.\n\n each(newCmptOptions, function (cmptOption, index) {\n if (!isObject(cmptOption)) {\n newCmptOptions[index] = null;\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // There is some legacy case that name is set as `false`.\n // But should work normally rather than throw error.\n if (cmptOption.id != null && !isValidIdOrName(cmptOption.id)) {\n warnInvalidateIdOrName(cmptOption.id);\n }\n\n if (cmptOption.name != null && !isValidIdOrName(cmptOption.name)) {\n warnInvalidateIdOrName(cmptOption.name);\n }\n }\n });\n var result = prepareResult(existings, existingIdIdxMap, mode);\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingById(result, existings, existingIdIdxMap, newCmptOptions);\n }\n\n if (isNormalMergeMode) {\n mappingByName(result, newCmptOptions);\n }\n\n if (isNormalMergeMode || isReplaceMergeMode) {\n mappingByIndex(result, newCmptOptions, isReplaceMergeMode);\n } else if (isReplaceAllMode) {\n mappingInReplaceAllMode(result, newCmptOptions);\n }\n\n makeIdAndName(result); // The array `result` MUST NOT contain elided items, otherwise the\n // forEach will omit those items and result in incorrect result.\n\n return result;\n}\n\nfunction prepareResult(existings, existingIdIdxMap, mode) {\n var result = [];\n\n if (mode === 'replaceAll') {\n return result;\n } // Do not use native `map` to in case that the array `existings`\n // contains elided items, which will be omitted.\n\n\n for (var index = 0; index < existings.length; index++) {\n var existing = existings[index]; // Because of replaceMerge, `existing` may be null/undefined.\n\n if (existing && existing.id != null) {\n existingIdIdxMap.set(existing.id, index);\n } // For non-internal-componnets:\n // Mode \"normalMerge\": all existings kept.\n // Mode \"replaceMerge\": all existing removed unless mapped by id.\n // For internal-components:\n // go with \"replaceMerge\" approach in both mode.\n\n\n result.push({\n existing: mode === 'replaceMerge' || isComponentIdInternal(existing) ? null : existing,\n newOption: null,\n keyInfo: null,\n brandNew: null\n });\n }\n\n return result;\n}\n\nfunction mappingById(result, existings, existingIdIdxMap, newCmptOptions) {\n // Mapping by id if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.id == null) {\n return;\n }\n\n var optionId = makeComparableKey(cmptOption.id);\n var existingIdx = existingIdIdxMap.get(optionId);\n\n if (existingIdx != null) {\n var resultItem = result[existingIdx];\n assert(!resultItem.newOption, 'Duplicated option on id \"' + optionId + '\".');\n resultItem.newOption = cmptOption; // In both mode, if id matched, new option will be merged to\n // the existings rather than creating new component model.\n\n resultItem.existing = existings[existingIdx];\n newCmptOptions[index] = null;\n }\n });\n}\n\nfunction mappingByName(result, newCmptOptions) {\n // Mapping by name if specified.\n each(newCmptOptions, function (cmptOption, index) {\n if (!cmptOption || cmptOption.name == null) {\n return;\n }\n\n for (var i = 0; i < result.length; i++) {\n var existing = result[i].existing;\n\n if (!result[i].newOption // Consider name: two map to one.\n // Can not match when both ids existing but different.\n && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) {\n result[i].newOption = cmptOption;\n newCmptOptions[index] = null;\n return;\n }\n }\n });\n}\n\nfunction mappingByIndex(result, newCmptOptions, brandNew) {\n each(newCmptOptions, function (cmptOption) {\n if (!cmptOption) {\n return;\n } // Find the first place that not mapped by id and not internal component (consider the \"hole\").\n\n\n var resultItem;\n var nextIdx = 0;\n\n while ( // Be `!resultItem` only when `nextIdx >= result.length`.\n (resultItem = result[nextIdx]) && ( // (1) Existing models that already have id should be able to mapped to. Because\n // after mapping performed, model will always be assigned with an id if user not given.\n // After that all models have id.\n // (2) If new option has id, it can only set to a hole or append to the last. It should\n // not be merged to the existings with different id. Because id should not be overwritten.\n // (3) Name can be overwritten, because axis use name as 'show label text'.\n resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode \"replaceMerge\", here no not-mapped-non-internal-existing.\n resultItem.existing && cmptOption.id != null && !keyExistAndEqual('id', cmptOption, resultItem.existing))) {\n nextIdx++;\n }\n\n if (resultItem) {\n resultItem.newOption = cmptOption;\n resultItem.brandNew = brandNew;\n } else {\n result.push({\n newOption: cmptOption,\n brandNew: brandNew,\n existing: null,\n keyInfo: null\n });\n }\n\n nextIdx++;\n });\n}\n\nfunction mappingInReplaceAllMode(result, newCmptOptions) {\n each(newCmptOptions, function (cmptOption) {\n // The feature \"reproduce\" requires \"hole\" will also reproduced\n // in case that component index referring are broken.\n result.push({\n newOption: cmptOption,\n brandNew: true,\n existing: null,\n keyInfo: null\n });\n });\n}\n/**\r\n * Make id and name for mapping result (result of mappingToExists)\r\n * into `keyInfo` field.\r\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 = createHashMap();\n each(mapResult, function (item) {\n var existing = item.existing;\n existing && idMap.set(existing.id, item);\n });\n each(mapResult, function (item) {\n var opt = item.newOption; // Force ensure id not duplicated.\n\n 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 existing = item.existing;\n var opt = item.newOption;\n var keyInfo = item.keyInfo;\n\n if (!isObject(opt)) {\n return;\n } // Name can be overwritten. 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 ? makeComparableKey(opt.name) : existing ? existing.name // Avoid that different series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n\n if (existing) {\n keyInfo.id = makeComparableKey(existing.id);\n } else if (opt.id != null) {\n keyInfo.id = makeComparableKey(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 keyExistAndEqual(attr, obj1, obj2) {\n var key1 = convertOptionIdName(obj1[attr], null);\n var key2 = convertOptionIdName(obj2[attr], null); // See `MappingExistingItem`. `id` and `name` trade string equals to number.\n\n return key1 != null && key2 != null && key1 === key2;\n}\n/**\r\n * @return return null if not exist.\r\n */\n\n\nfunction makeComparableKey(val) {\n if (process.env.NODE_ENV !== 'production') {\n if (val == null) {\n throw new Error();\n }\n }\n\n return convertOptionIdName(val, '');\n}\n\nexport function convertOptionIdName(idOrName, defaultValue) {\n if (idOrName == null) {\n return defaultValue;\n }\n\n return isString(idOrName) ? idOrName : isNumber(idOrName) || isStringSafe(idOrName) ? idOrName + '' : defaultValue;\n}\n\nfunction warnInvalidateIdOrName(idOrName) {\n if (process.env.NODE_ENV !== 'production') {\n warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');\n }\n}\n\nfunction isValidIdOrName(idOrName) {\n return isStringSafe(idOrName) || isNumeric(idOrName);\n}\n\nexport function 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/**\r\n * @public\r\n * @param {Object} cmptOption\r\n * @return {boolean}\r\n */\n\nexport function isComponentIdInternal(cmptOption) {\n return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;\n}\nexport function makeInternalComponentId(idSuffix) {\n return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;\n}\nexport function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {\n // Set mainType and complete subType.\n each(mappingResult, function (item) {\n var newOption = item.newOption;\n\n if (isObject(newOption)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);\n }\n });\n}\n\nfunction determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {\n var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : componentModelCtor.determineSubType(mainType, newCmptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\r\n * A helper for removing duplicate items between batchA and batchB,\r\n * and in themselves, and categorize by series.\r\n *\r\n * @param batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @param batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\r\n * @return result: [resultBatchA, resultBatchB]\r\n */\n\n\nexport function 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 = convertOptionIdName(sourceBatch[i].seriesId, null);\n\n if (seriesId == null) {\n return;\n }\n\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/**\r\n * @param payload Contains dataIndex (means rawIndex) / dataIndexInside / name\r\n * each of which can be Array or primary type.\r\n * @return dataIndex If not found, return undefined/null.\r\n */\n\nexport function queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return isArray(payload.dataIndex) ? map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return isArray(payload.name) ? map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\r\n * Enable property storage to any host object.\r\n * Notice: Serialization is not supported.\r\n *\r\n * For example:\r\n * let inner = zrUitl.makeInner();\r\n *\r\n * function some1(hostObj) {\r\n * inner(hostObj).someProperty = 1212;\r\n * ...\r\n * }\r\n * function some2() {\r\n * let fields = inner(this);\r\n * fields.someProperty1 = 1212;\r\n * fields.someProperty2 = 'xx';\r\n * ...\r\n * }\r\n *\r\n * @return {Function}\r\n */\n\nexport function makeInner() {\n var key = '__ec_inner_' + innerUniqueIndex++;\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\nvar innerUniqueIndex = getRandomIdBase();\n/**\r\n * The same behavior as `component.getReferringComponents`.\r\n */\n\nexport function parseFinder(ecModel, finderInput, opt) {\n var _a = preParseFinder(finderInput, opt),\n mainTypeSpecified = _a.mainTypeSpecified,\n queryOptionMap = _a.queryOptionMap,\n others = _a.others;\n\n var result = others;\n var defaultMainType = opt ? opt.defaultMainType : null;\n\n if (!mainTypeSpecified && defaultMainType) {\n queryOptionMap.set(defaultMainType, {});\n }\n\n queryOptionMap.each(function (queryOption, mainType) {\n var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {\n useDefault: defaultMainType === mainType,\n enableAll: opt && opt.enableAll != null ? opt.enableAll : true,\n enableNone: opt && opt.enableNone != null ? opt.enableNone : true\n });\n result[mainType + 'Models'] = queryResult.models;\n result[mainType + 'Model'] = queryResult.models[0];\n });\n return result;\n}\nexport function preParseFinder(finderInput, opt) {\n var finder;\n\n if (isString(finderInput)) {\n var obj = {};\n obj[finderInput + 'Index'] = 0;\n finder = obj;\n } else {\n finder = finderInput;\n }\n\n var queryOptionMap = createHashMap();\n var others = {};\n var mainTypeSpecified = false;\n each(finder, function (value, key) {\n // Exclude 'dataIndex' and other illgal keys.\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n others[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 || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n\n mainTypeSpecified = mainTypeSpecified || !!mainType;\n var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});\n queryOption[queryType] = value;\n });\n return {\n mainTypeSpecified: mainTypeSpecified,\n queryOptionMap: queryOptionMap,\n others: others\n };\n}\nexport var SINGLE_REFERRING = {\n useDefault: true,\n enableAll: false,\n enableNone: false\n};\nexport var MULTIPLE_REFERRING = {\n useDefault: false,\n enableAll: true,\n enableNone: true\n};\nexport function queryReferringComponents(ecModel, mainType, userOption, opt) {\n opt = opt || SINGLE_REFERRING;\n var indexOption = userOption.index;\n var idOption = userOption.id;\n var nameOption = userOption.name;\n var result = {\n models: null,\n specified: indexOption != null || idOption != null || nameOption != null\n };\n\n if (!result.specified) {\n // Use the first as default if `useDefault`.\n var firstCmpt = void 0;\n result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];\n return result;\n }\n\n if (indexOption === 'none' || indexOption === false) {\n assert(opt.enableNone, '`\"none\"` or `false` is not a valid value on index option.');\n result.models = [];\n return result;\n } // `queryComponents` will return all components if\n // both all of index/id/name are null/undefined.\n\n\n if (indexOption === 'all') {\n assert(opt.enableAll, '`\"all\"` is not a valid value on index option.');\n indexOption = idOption = nameOption = null;\n }\n\n result.models = ecModel.queryComponents({\n mainType: mainType,\n index: indexOption,\n id: idOption,\n name: nameOption\n });\n return result;\n}\nexport function setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\nexport function getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\nexport function 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/**\r\n * Group a list by key.\r\n */\n\nexport function groupData(array, getKey // return key\n) {\n var buckets = createHashMap();\n var keys = [];\n 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/**\r\n * Interpolate raw values of a series with percent\r\n *\r\n * @param data data\r\n * @param labelModel label model of the text element\r\n * @param sourceValue start value. May be null/undefined when init.\r\n * @param targetValue end value\r\n * @param percent 0~1 percentage; 0 uses start value while 1 uses end value\r\n * @return interpolated values\r\n * If `sourceValue` and `targetValue` are `number`, return `number`.\r\n * If `sourceValue` and `targetValue` are `string`, return `string`.\r\n * If `sourceValue` and `targetValue` are `(string | number)[]`, return `(string | number)[]`.\r\n * Other cases do not supported.\r\n */\n\nexport function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {\n var isAutoPrecision = precision == null || precision === 'auto';\n\n if (targetValue == null) {\n return targetValue;\n }\n\n if (isNumber(targetValue)) {\n var value = interpolateNumber(sourceValue || 0, targetValue, percent);\n return round(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision);\n } else if (isString(targetValue)) {\n return percent < 1 ? sourceValue : targetValue;\n } else {\n var interpolated = [];\n var leftArr = sourceValue;\n var rightArr = targetValue;\n var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);\n\n for (var i = 0; i < length_1; ++i) {\n var info = data.getDimensionInfo(i); // Don't interpolate ordinal dims\n\n if (info && info.type === 'ordinal') {\n // In init, there is no `sourceValue`, but should better not to get undefined result.\n interpolated[i] = (percent < 1 && leftArr ? leftArr : rightArr)[i];\n } else {\n var leftVal = leftArr && leftArr[i] ? leftArr[i] : 0;\n var rightVal = rightArr[i];\n var value = interpolateNumber(leftVal, rightVal, percent);\n interpolated[i] = round(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision);\n }\n }\n\n return interpolated;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\nvar IS_EXTENDED_CLASS = '___EC__EXTENDED_CLASS___';\n/**\r\n * Notice, parseClassType('') should returns {main: '', sub: ''}\r\n * @public\r\n */\n\nexport function parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n\n if (componentType) {\n var typeArr = componentType.split(TYPE_DELIMITER);\n ret.main = typeArr[0] || '';\n ret.sub = typeArr[1] || '';\n }\n\n return ret;\n}\n/**\r\n * @public\r\n */\n\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\n\nexport function isExtendedClass(clz) {\n return !!(clz && clz[IS_EXTENDED_CLASS]);\n}\n/**\r\n * Implements `ExtendableConstructor` for `rootClz`.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ExtendableConstructor\r\n * enableClassExtend(Xxx as XxxConstructor);\r\n * ```\r\n */\n\nexport function enableClassExtend(rootClz, mandatoryMethods) {\n rootClz.$constructor = rootClz; // FIXME: not necessary?\n\n rootClz.extend = function (proto) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(mandatoryMethods, function (method) {\n if (!proto[method]) {\n console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');\n }\n });\n }\n\n var superClass = this;\n var ExtendedClass;\n\n if (isESClass(superClass)) {\n ExtendedClass =\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super.apply(this, arguments) || this;\n }\n\n return class_1;\n }(superClass);\n } else {\n // For backward compat, we both support ts class inheritance and this\n // \"extend\" approach.\n // The constructor should keep the same behavior as ts class inheritance:\n // If this constructor/$constructor is not declared, auto invoke the super\n // constructor.\n // If this constructor/$constructor is declared, it is responsible for\n // calling the super constructor.\n ExtendedClass = function () {\n (proto.$constructor || superClass).apply(this, arguments);\n };\n\n zrUtil.inherits(ExtendedClass, this);\n }\n\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass[IS_EXTENDED_CLASS] = true;\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\n\nfunction isESClass(fn) {\n return zrUtil.isFunction(fn) && /^class\\s/.test(Function.prototype.toString.call(fn));\n}\n/**\r\n * A work around to both support ts extend and this extend mechanism.\r\n * on sub-class.\r\n * @usage\r\n * ```ts\r\n * class Component { ... }\r\n * classUtil.enableClassExtend(Component);\r\n * classUtil.enableClassManagement(Component, {registerWhenExtend: true});\r\n *\r\n * class Series extends Component { ... }\r\n * // Without calling `markExtend`, `registerWhenExtend` will not work.\r\n * Component.markExtend(Series);\r\n * ```\r\n */\n\n\nexport function mountExtend(SubClz, SupperClz) {\n SubClz.extend = SupperClz.extend;\n} // A random offset.\n\nvar classBase = Math.round(Math.random() * 10);\n/**\r\n * Implements `CheckableConstructor` for `target`.\r\n * Can not use instanceof, consider different scope by\r\n * cross domain or es module import in ec extensions.\r\n * Mount a method \"isInstance()\" to Clz.\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & CheckableConstructor;\r\n * enableClassCheck(Xxx as XxxConstructor)\r\n * ```\r\n */\n\nexport function enableClassCheck(target) {\n var classAttr = ['__\\0is_clz', classBase++].join('_');\n target.prototype[classAttr] = true;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(!target.isInstance, 'The method \"is\" can not be defined.');\n }\n\n target.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n} // superCall should have class info, which can not be fetched 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, does not override method f,\n// then when method of class C is called, dead loop occurred.\n\nfunction superCall(context, methodName) {\n var args = [];\n\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n\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/**\r\n * Implements `ClassManager` for `target`\r\n *\r\n * @usage\r\n * ```ts\r\n * class Xxx {}\r\n * type XxxConstructor = typeof Xxx & ClassManager\r\n * enableClassManagement(Xxx as XxxConstructor);\r\n * ```\r\n */\n\n\nexport function enableClassManagement(target) {\n /**\r\n * Component model classes\r\n * key: componentType,\r\n * value:\r\n * componentClass, when componentType is 'a'\r\n * or Object., when componentType is 'a.b'\r\n */\n var storage = {};\n\n target.registerClass = function (clz) {\n // `type` should not be a \"instance member\".\n // If using TS class, should better declared as `static type = 'series.pie'`.\n // otherwise users have to mount `type` on prototype manually.\n // For backward compat and enable instance visit type via `this.type`,\n // we still support fetch `type` from prototype.\n var componentFullType = clz.type || clz.prototype.type;\n\n if (componentFullType) {\n checkClassType(componentFullType); // If only static type declared, we assign it to prototype mandatorily.\n\n clz.prototype.type = componentFullType;\n var componentTypeInfo = parseClassType(componentFullType);\n\n if (!componentTypeInfo.sub) {\n if (process.env.NODE_ENV !== 'production') {\n if (storage[componentTypeInfo.main]) {\n console.warn(componentTypeInfo.main + ' exists.');\n }\n }\n\n storage[componentTypeInfo.main] = clz;\n } else if (componentTypeInfo.sub !== IS_CONTAINER) {\n var container = makeContainer(componentTypeInfo);\n container[componentTypeInfo.sub] = clz;\n }\n }\n\n return clz;\n };\n\n target.getClass = function (mainType, subType, throwWhenNotFound) {\n var clz = storage[mainType];\n\n if (clz && clz[IS_CONTAINER]) {\n clz = subType ? clz[subType] : null;\n }\n\n if (throwWhenNotFound && !clz) {\n throw new Error(!subType ? mainType + '.' + 'type should be specified.' : 'Component ' + mainType + '.' + (subType || '') + ' is used but not imported.');\n }\n\n return clz;\n };\n\n target.getClassesByMainType = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var result = [];\n var obj = storage[componentTypeInfo.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 target.hasClass = function (componentType) {\n // Just consider componentType.main.\n var componentTypeInfo = parseClassType(componentType);\n return !!storage[componentTypeInfo.main];\n };\n /**\r\n * @return Like ['aa', 'bb'], but can not be ['aa.xx']\r\n */\n\n\n target.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\r\n * If a main type is container and has sub types\r\n */\n\n\n target.hasSubTypes = function (componentType) {\n var componentTypeInfo = parseClassType(componentType);\n var obj = storage[componentTypeInfo.main];\n return obj && obj[IS_CONTAINER];\n };\n\n function makeContainer(componentTypeInfo) {\n var container = storage[componentTypeInfo.main];\n\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentTypeInfo.main] = {};\n container[IS_CONTAINER] = true;\n }\n\n return container;\n }\n} // /**\n// * @param {string|Array.} properties\n// */\n// export function setReadOnly(obj, properties) {\n// 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// let 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/*\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO Parse shadow style\n// TODO Only shallow path support\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function makeStyleMapper(properties, ignoreParent) {\n // Normalize\n for (var i = 0; i < properties.length; i++) {\n if (!properties[i][1]) {\n properties[i][1] = properties[i][0];\n }\n }\n\n ignoreParent = ignoreParent || false;\n return function (model, excludes, includes) {\n var style = {};\n\n for (var i = 0; i < properties.length; i++) {\n var propName = properties[i][1];\n\n if (excludes && zrUtil.indexOf(excludes, propName) >= 0 || includes && zrUtil.indexOf(includes, propName) < 0) {\n continue;\n }\n\n var val = model.getShallow(propName, ignoreParent);\n\n if (val != null) {\n style[properties[i][0]] = val;\n }\n } // TODO Text or image?\n\n\n return style;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var AREA_STYLE_KEY_MAP = [['fill', 'color'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['opacity'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);\n\nvar AreaStyleMixin =\n/** @class */\nfunction () {\n function AreaStyleMixin() {}\n\n AreaStyleMixin.prototype.getAreaStyle = function (excludes, includes) {\n return getAreaStyle(this, excludes, includes);\n };\n\n return AreaStyleMixin;\n}();\n\n;\nexport { AreaStyleMixin };","import LRU from '../../core/LRU.js';\nimport { platformApi } from '../../core/platform.js';\nvar globalImageCache = new LRU(50);\nexport function findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n }\n else {\n return newImageOrSrc;\n }\n}\nexport function createOrUpdateImage(newImageOrSrc, image, hostEl, onload, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n }\n else if (typeof newImageOrSrc === 'string') {\n if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) {\n return image;\n }\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = { hostEl: hostEl, cb: onload, cbPayload: cbPayload };\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n }\n else {\n image = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);\n image.__zrImageSrc = newImageOrSrc;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n }\n return image;\n }\n else {\n return newImageOrSrc;\n }\n}\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\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 cachedImgObj.pending.length = 0;\n}\nexport function isImageReady(image) {\n return image && image.width && image.height;\n}\n","import * as imageHelper from '../helper/image.js';\nimport { extend, retrieve2, retrieve3, reduce } from '../../core/util.js';\nimport { getLineHeight, getWidth, parsePercent } from '../../contain/text.js';\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nexport function truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options);\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n return textLines.join('\\n');\n}\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = options || {};\n var preparedOpts = extend({}, options);\n preparedOpts.font = font;\n ellipsis = retrieve2(ellipsis, '...');\n preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);\n preparedOpts.cnCharWidth = getWidth('国', font);\n var ascCharWidth = preparedOpts.ascCharWidth = getWidth('a', font);\n preparedOpts.placeholder = retrieve2(options.placeholder, '');\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1);\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n var ellipsisWidth = getWidth(ellipsis, font);\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n contentWidth = containerWidth - ellipsisWidth;\n preparedOpts.ellipsis = ellipsis;\n preparedOpts.ellipsisWidth = ellipsisWidth;\n preparedOpts.contentWidth = contentWidth;\n preparedOpts.containerWidth = containerWidth;\n return preparedOpts;\n}\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n if (!containerWidth) {\n return '';\n }\n var lineWidth = getWidth(textLine, font);\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n var subLength = j === 0\n ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth)\n : lineWidth > 0\n ? Math.floor(textLine.length * contentWidth / lineWidth)\n : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n if (textLine === '') {\n textLine = options.placeholder;\n }\n return textLine;\n}\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\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 return i;\n}\nexport function parsePlainText(text, style) {\n text != null && (text += '');\n var overflow = style.overflow;\n var padding = style.padding;\n var font = style.font;\n var truncate = overflow === 'truncate';\n var calculatedLineHeight = getLineHeight(font);\n var lineHeight = retrieve2(style.lineHeight, calculatedLineHeight);\n var bgColorDrawn = !!(style.backgroundColor);\n var truncateLineOverflow = style.lineOverflow === 'truncate';\n var width = style.width;\n var lines;\n if (width != null && (overflow === 'break' || overflow === 'breakAll')) {\n lines = text ? wrapText(text, style.font, width, overflow === 'breakAll', 0).lines : [];\n }\n else {\n lines = text ? text.split('\\n') : [];\n }\n var contentHeight = lines.length * lineHeight;\n var height = retrieve2(style.height, contentHeight);\n if (contentHeight > height && truncateLineOverflow) {\n var lineCount = Math.floor(height / lineHeight);\n lines = lines.slice(0, lineCount);\n }\n if (text && truncate && width != null) {\n var options = prepareTruncateOptions(width, font, style.ellipsis, {\n minChar: style.truncateMinChar,\n placeholder: style.placeholder\n });\n for (var i = 0; i < lines.length; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n var outerHeight = height;\n var contentWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n contentWidth = Math.max(getWidth(lines[i], font), contentWidth);\n }\n if (width == null) {\n width = contentWidth;\n }\n var outerWidth = contentWidth;\n if (padding) {\n outerHeight += padding[0] + padding[2];\n outerWidth += padding[1] + padding[3];\n width += padding[1] + padding[3];\n }\n if (bgColorDrawn) {\n outerWidth = width;\n }\n return {\n lines: lines,\n height: height,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n lineHeight: lineHeight,\n calculatedLineHeight: calculatedLineHeight,\n contentWidth: contentWidth,\n contentHeight: contentHeight,\n width: width\n };\n}\nvar RichTextToken = (function () {\n function RichTextToken() {\n }\n return RichTextToken;\n}());\nvar RichTextLine = (function () {\n function RichTextLine(tokens) {\n this.tokens = [];\n if (tokens) {\n this.tokens = tokens;\n }\n }\n return RichTextLine;\n}());\nvar RichTextContentBlock = (function () {\n function RichTextContentBlock() {\n this.width = 0;\n this.height = 0;\n this.contentWidth = 0;\n this.contentHeight = 0;\n this.outerWidth = 0;\n this.outerHeight = 0;\n this.lines = [];\n }\n return RichTextContentBlock;\n}());\nexport { RichTextContentBlock };\nexport function parseRichText(text, style) {\n var contentBlock = new RichTextContentBlock();\n text != null && (text += '');\n if (!text) {\n return contentBlock;\n }\n var topWidth = style.width;\n var topHeight = style.height;\n var overflow = style.overflow;\n var wrapInfo = (overflow === 'break' || overflow === 'breakAll') && topWidth != null\n ? { width: topWidth, accumWidth: 0, breakAll: overflow === 'breakAll' }\n : null;\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);\n }\n pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);\n }\n var pendingList = [];\n var calculatedHeight = 0;\n var calculatedWidth = 0;\n var stlPadding = style.padding;\n var truncate = overflow === 'truncate';\n var truncateLine = style.lineOverflow === 'truncate';\n function finishLine(line, lineWidth, lineHeight) {\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n calculatedHeight += lineHeight;\n calculatedWidth = Math.max(calculatedWidth, lineWidth);\n }\n outer: for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\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] || {};\n var textPadding = token.textPadding = tokenStyle.padding;\n var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;\n var font = token.font = tokenStyle.font || style.font;\n token.contentHeight = getLineHeight(font);\n var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);\n token.innerHeight = tokenHeight;\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);\n token.align = tokenStyle && tokenStyle.align || style.align;\n token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || 'middle';\n if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {\n if (j > 0) {\n line.tokens = line.tokens.slice(0, j);\n finishLine(line, lineWidth, lineHeight);\n contentBlock.lines = contentBlock.lines.slice(0, i + 1);\n }\n else {\n contentBlock.lines = contentBlock.lines.slice(0, i);\n }\n break outer;\n }\n var styleTokenWidth = tokenStyle.width;\n var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === 'auto';\n if (typeof styleTokenWidth === 'string' && styleTokenWidth.charAt(styleTokenWidth.length - 1) === '%') {\n token.percentWidth = styleTokenWidth;\n pendingList.push(token);\n token.contentWidth = getWidth(token.text, font);\n }\n else {\n if (tokenWidthNotSpecified) {\n var textBackgroundColor = tokenStyle.backgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image;\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n if (imageHelper.isImageReady(bgImg)) {\n token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n var remainTruncWidth = truncate && topWidth != null\n ? topWidth - lineWidth : null;\n if (remainTruncWidth != null && remainTruncWidth < token.width) {\n if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {\n token.text = '';\n token.width = token.contentWidth = 0;\n }\n else {\n token.text = truncateText(token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });\n token.width = token.contentWidth = getWidth(token.text, font);\n }\n }\n else {\n token.contentWidth = getWidth(token.text, font);\n }\n }\n token.width += paddingH;\n lineWidth += token.width;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n finishLine(line, lineWidth, lineHeight);\n }\n contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);\n contentBlock.contentHeight = calculatedHeight;\n contentBlock.contentWidth = calculatedWidth;\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth;\n token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;\n }\n return contentBlock;\n}\nfunction pushTokens(block, str, style, wrapInfo, styleName) {\n var isEmptyStr = str === '';\n var tokenStyle = styleName && style.rich[styleName] || {};\n var lines = block.lines;\n var font = tokenStyle.font || style.font;\n var newLine = false;\n var strLines;\n var linesWidths;\n if (wrapInfo) {\n var tokenPadding = tokenStyle.padding;\n var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;\n if (tokenStyle.width != null && tokenStyle.width !== 'auto') {\n var outerWidth_1 = parsePercent(tokenStyle.width, wrapInfo.width) + tokenPaddingH;\n if (lines.length > 0) {\n if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {\n strLines = str.split('\\n');\n newLine = true;\n }\n }\n wrapInfo.accumWidth = outerWidth_1;\n }\n else {\n var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);\n wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;\n linesWidths = res.linesWidths;\n strLines = res.lines;\n }\n }\n else {\n strLines = str.split('\\n');\n }\n for (var i = 0; i < strLines.length; i++) {\n var text = strLines[i];\n var token = new RichTextToken();\n token.styleName = styleName;\n token.text = text;\n token.isLineHolder = !text && !isEmptyStr;\n if (typeof tokenStyle.width === 'number') {\n token.width = tokenStyle.width;\n }\n else {\n token.width = linesWidths\n ? linesWidths[i]\n : getWidth(text, font);\n }\n if (!i && !newLine) {\n var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;\n var tokensLen = tokens.length;\n (tokensLen === 1 && tokens[0].isLineHolder)\n ? (tokens[0] = token)\n : ((text || !tokensLen || isEmptyStr) && tokens.push(token));\n }\n else {\n lines.push(new RichTextLine([token]));\n }\n }\n}\nfunction isAlphabeticLetter(ch) {\n var code = ch.charCodeAt(0);\n return code >= 0x20 && code <= 0x24F\n || code >= 0x370 && code <= 0x10FF\n || code >= 0x1200 && code <= 0x13FF\n || code >= 0x1E00 && code <= 0x206F;\n}\nvar breakCharMap = reduce(',&?/;] '.split(''), function (obj, ch) {\n obj[ch] = true;\n return obj;\n}, {});\nfunction isWordBreakChar(ch) {\n if (isAlphabeticLetter(ch)) {\n if (breakCharMap[ch]) {\n return true;\n }\n return false;\n }\n return true;\n}\nfunction wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {\n var lines = [];\n var linesWidths = [];\n var line = '';\n var currentWord = '';\n var currentWordWidth = 0;\n var accumWidth = 0;\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch === '\\n') {\n if (currentWord) {\n line += currentWord;\n accumWidth += currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = '';\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = 0;\n continue;\n }\n var chWidth = getWidth(ch, font);\n var inWord = isBreakAll ? false : !isWordBreakChar(ch);\n if (!lines.length\n ? lastAccumWidth + accumWidth + chWidth > lineWidth\n : accumWidth + chWidth > lineWidth) {\n if (!accumWidth) {\n if (inWord) {\n lines.push(currentWord);\n linesWidths.push(currentWordWidth);\n currentWord = ch;\n currentWordWidth = chWidth;\n }\n else {\n lines.push(ch);\n linesWidths.push(chWidth);\n }\n }\n else if (line || currentWord) {\n if (inWord) {\n if (!line) {\n line = currentWord;\n currentWord = '';\n currentWordWidth = 0;\n accumWidth = currentWordWidth;\n }\n lines.push(line);\n linesWidths.push(accumWidth - currentWordWidth);\n currentWord += ch;\n currentWordWidth += chWidth;\n line = '';\n accumWidth = currentWordWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n lines.push(line);\n linesWidths.push(accumWidth);\n line = ch;\n accumWidth = chWidth;\n }\n }\n continue;\n }\n accumWidth += chWidth;\n if (inWord) {\n currentWord += ch;\n currentWordWidth += chWidth;\n }\n else {\n if (currentWord) {\n line += currentWord;\n currentWord = '';\n currentWordWidth = 0;\n }\n line += ch;\n }\n }\n if (!lines.length && !line) {\n line = text;\n currentWord = '';\n currentWordWidth = 0;\n }\n if (currentWord) {\n line += currentWord;\n }\n if (line) {\n lines.push(line);\n linesWidths.push(accumWidth);\n }\n if (lines.length === 1) {\n accumWidth += lastAccumWidth;\n }\n return {\n accumWidth: accumWidth,\n lines: lines,\n linesWidths: linesWidths\n };\n}\n","import { __extends } from \"tslib\";\nimport Element from '../Element.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { keys, extend, createObject } from '../core/util.js';\nimport { REDRAW_BIT, STYLE_CHANGED_BIT } from './constants.js';\nvar STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));\nexport var DEFAULT_COMMON_STYLE = {\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowColor: '#000',\n opacity: 1,\n blend: 'source-over'\n};\nexport var DEFAULT_COMMON_ANIMATION_PROPS = {\n style: {\n shadowBlur: true,\n shadowOffsetX: true,\n shadowOffsetY: true,\n shadowColor: true,\n opacity: true\n }\n};\nDEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;\nvar PRIMARY_STATES_KEYS = ['z', 'z2', 'invisible'];\nvar PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ['invisible'];\nvar Displayable = (function (_super) {\n __extends(Displayable, _super);\n function Displayable(props) {\n return _super.call(this, props) || this;\n }\n Displayable.prototype._init = function (props) {\n var keysArr = keys(props);\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n if (key === 'style') {\n this.useStyle(props[key]);\n }\n else {\n _super.prototype.attrKV.call(this, key, props[key]);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Displayable.prototype.beforeBrush = function () { };\n Displayable.prototype.afterBrush = function () { };\n Displayable.prototype.innerBeforeBrush = function () { };\n Displayable.prototype.innerAfterBrush = function () { };\n Displayable.prototype.shouldBePainted = function (viewWidth, viewHeight, considerClipPath, considerAncestors) {\n var m = this.transform;\n if (this.ignore\n || this.invisible\n || this.style.opacity === 0\n || (this.culling\n && isDisplayableCulled(this, viewWidth, viewHeight))\n || (m && !m[0] && !m[3])) {\n return false;\n }\n if (considerClipPath && this.__clipPaths) {\n for (var i = 0; i < this.__clipPaths.length; ++i) {\n if (this.__clipPaths[i].isZeroArea()) {\n return false;\n }\n }\n }\n if (considerAncestors && this.parent) {\n var parent_1 = this.parent;\n while (parent_1) {\n if (parent_1.ignore) {\n return false;\n }\n parent_1 = parent_1.parent;\n }\n }\n return true;\n };\n Displayable.prototype.contain = function (x, y) {\n return this.rectContain(x, y);\n };\n Displayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n Displayable.prototype.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 Displayable.prototype.getPaintRect = function () {\n var rect = this._paintRect;\n if (!this._paintRect || this.__dirty) {\n var transform = this.transform;\n var elRect = this.getBoundingRect();\n var style = this.style;\n var shadowSize = style.shadowBlur || 0;\n var shadowOffsetX = style.shadowOffsetX || 0;\n var shadowOffsetY = style.shadowOffsetY || 0;\n rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));\n if (transform) {\n BoundingRect.applyTransform(rect, elRect, transform);\n }\n else {\n rect.copy(elRect);\n }\n if (shadowSize || shadowOffsetX || shadowOffsetY) {\n rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);\n rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);\n rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);\n rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);\n }\n var tolerance = this.dirtyRectTolerance;\n if (!rect.isZero()) {\n rect.x = Math.floor(rect.x - tolerance);\n rect.y = Math.floor(rect.y - tolerance);\n rect.width = Math.ceil(rect.width + 1 + tolerance * 2);\n rect.height = Math.ceil(rect.height + 1 + tolerance * 2);\n }\n }\n return rect;\n };\n Displayable.prototype.setPrevPaintRect = function (paintRect) {\n if (paintRect) {\n this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);\n this._prevPaintRect.copy(paintRect);\n }\n else {\n this._prevPaintRect = null;\n }\n };\n Displayable.prototype.getPrevPaintRect = function () {\n return this._prevPaintRect;\n };\n Displayable.prototype.animateStyle = function (loop) {\n return this.animate('style', loop);\n };\n Displayable.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else {\n this.markRedraw();\n }\n };\n Displayable.prototype.attrKV = function (key, value) {\n if (key !== 'style') {\n _super.prototype.attrKV.call(this, key, value);\n }\n else {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n this.setStyle(value);\n }\n }\n };\n Displayable.prototype.setStyle = function (keyOrObj, value) {\n if (typeof keyOrObj === 'string') {\n this.style[keyOrObj] = value;\n }\n else {\n extend(this.style, keyOrObj);\n }\n this.dirtyStyle();\n return this;\n };\n Displayable.prototype.dirtyStyle = function (notRedraw) {\n if (!notRedraw) {\n this.markRedraw();\n }\n this.__dirty |= STYLE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n };\n Displayable.prototype.dirty = function () {\n this.dirtyStyle();\n };\n Displayable.prototype.styleChanged = function () {\n return !!(this.__dirty & STYLE_CHANGED_BIT);\n };\n Displayable.prototype.styleUpdated = function () {\n this.__dirty &= ~STYLE_CHANGED_BIT;\n };\n Displayable.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_COMMON_STYLE, obj);\n };\n Displayable.prototype.useStyle = function (obj) {\n if (!obj[STYLE_MAGIC_KEY]) {\n obj = this.createStyle(obj);\n }\n if (this.__inHover) {\n this.__hoverStyle = obj;\n }\n else {\n this.style = obj;\n }\n this.dirtyStyle();\n };\n Displayable.prototype.isStyleObject = function (obj) {\n return obj[STYLE_MAGIC_KEY];\n };\n Displayable.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.style && !normalState.style) {\n normalState.style = this._mergeStyle(this.createStyle(), this.style);\n }\n this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);\n };\n Displayable.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetStyle;\n if (state && state.style) {\n if (transition) {\n if (keepCurrentStates) {\n targetStyle = state.style;\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else {\n targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);\n this._mergeStyle(targetStyle, state.style);\n }\n }\n else if (needsRestoreToNormal) {\n targetStyle = normalState.style;\n }\n if (targetStyle) {\n if (transition) {\n var sourceStyle = this.style;\n this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);\n if (needsRestoreToNormal) {\n var changedKeys = keys(sourceStyle);\n for (var i = 0; i < changedKeys.length; i++) {\n var key = changedKeys[i];\n if (key in targetStyle) {\n targetStyle[key] = targetStyle[key];\n this.style[key] = sourceStyle[key];\n }\n }\n }\n var targetKeys = keys(targetStyle);\n for (var i = 0; i < targetKeys.length; i++) {\n var key = targetKeys[i];\n this.style[key] = this.style[key];\n }\n this._transitionState(stateName, {\n style: targetStyle\n }, animationCfg, this.getAnimationStyleProps());\n }\n else {\n this.useStyle(targetStyle);\n }\n }\n var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;\n for (var i = 0; i < statesKeys.length; i++) {\n var key = statesKeys[i];\n if (state && state[key] != null) {\n this[key] = state[key];\n }\n else if (needsRestoreToNormal) {\n if (normalState[key] != null) {\n this[key] = normalState[key];\n }\n }\n }\n };\n Displayable.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedStyle;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.style) {\n mergedStyle = mergedStyle || {};\n this._mergeStyle(mergedStyle, state.style);\n }\n }\n if (mergedStyle) {\n mergedState.style = mergedStyle;\n }\n return mergedState;\n };\n Displayable.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n extend(targetStyle, sourceStyle);\n return targetStyle;\n };\n Displayable.prototype.getAnimationStyleProps = function () {\n return DEFAULT_COMMON_ANIMATION_PROPS;\n };\n Displayable.initDefaultProps = (function () {\n var dispProto = Displayable.prototype;\n dispProto.type = 'displayable';\n dispProto.invisible = false;\n dispProto.z = 0;\n dispProto.z2 = 0;\n dispProto.zlevel = 0;\n dispProto.culling = false;\n dispProto.cursor = 'pointer';\n dispProto.rectHover = false;\n dispProto.incremental = false;\n dispProto._rect = null;\n dispProto.dirtyRectTolerance = 0;\n dispProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT;\n })();\n return Displayable;\n}(Element));\nvar tmpRect = new BoundingRect(0, 0, 0, 0);\nvar viewRect = new BoundingRect(0, 0, 0, 0);\nfunction isDisplayableCulled(el, width, height) {\n tmpRect.copy(el.getBoundingRect());\n if (el.transform) {\n tmpRect.applyTransform(el.transform);\n }\n viewRect.width = width;\n viewRect.height = height;\n return !tmpRect.intersect(viewRect);\n}\nexport default Displayable;\n","import * as vec2 from './vector.js';\nimport * as curve from './curve.js';\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();\nexport function fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\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 for (var 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 min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\nexport function 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}\nvar xDim = [];\nvar yDim = [];\nexport function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\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 for (var 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 = cubicExtrema(y0, y1, y2, y3, yDim);\n for (var 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 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}\nexport function fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt;\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}\nexport function 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 if (diff % PI2 < 1e-4 && diff > 1e-4) {\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\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);\n startAngle = startAngle % (PI2);\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n endAngle = endAngle % (PI2);\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n }\n else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\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","import * as vec2 from './vector.js';\nimport BoundingRect from './BoundingRect.js';\nimport { devicePixelRatio as dpr } from '../config.js';\nimport { fromLine, fromCubic, fromQuadratic, fromArc } from './bbox.js';\nimport { cubicLength, cubicSubdivide, quadraticLength, quadraticSubdivide } from './curve.js';\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n R: 7\n};\nvar tmpOutX = [];\nvar tmpOutY = [];\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 mathAbs = Math.abs;\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\nvar tmpAngles = [];\nfunction modPI2(radian) {\n var n = Math.round(radian / PI * 1e8) / 1e8;\n return (n % 2) * PI;\n}\nexport function normalizeArcAngles(angles, anticlockwise) {\n var newStartAngle = modPI2(angles[0]);\n if (newStartAngle < 0) {\n newStartAngle += PI2;\n }\n var delta = newStartAngle - angles[0];\n var newEndAngle = angles[1];\n newEndAngle += delta;\n if (!anticlockwise && newEndAngle - newStartAngle >= PI2) {\n newEndAngle = newStartAngle + PI2;\n }\n else if (anticlockwise && newStartAngle - newEndAngle >= PI2) {\n newEndAngle = newStartAngle - PI2;\n }\n else if (!anticlockwise && newStartAngle > newEndAngle) {\n newEndAngle = newStartAngle + (PI2 - modPI2(newStartAngle - newEndAngle));\n }\n else if (anticlockwise && newStartAngle < newEndAngle) {\n newEndAngle = newStartAngle - (PI2 - modPI2(newEndAngle - newStartAngle));\n }\n angles[0] = newStartAngle;\n angles[1] = newEndAngle;\n}\nvar PathProxy = (function () {\n function PathProxy(notSaveData) {\n this.dpr = 1;\n this._xi = 0;\n this._yi = 0;\n this._x0 = 0;\n this._y0 = 0;\n this._len = 0;\n if (notSaveData) {\n this._saveData = false;\n }\n if (this._saveData) {\n this.data = [];\n }\n }\n PathProxy.prototype.increaseVersion = function () {\n this._version++;\n };\n PathProxy.prototype.getVersion = function () {\n return this._version;\n };\n PathProxy.prototype.setScale = function (sx, sy, segmentIgnoreThreshold) {\n segmentIgnoreThreshold = segmentIgnoreThreshold || 0;\n if (segmentIgnoreThreshold > 0) {\n this._ux = mathAbs(segmentIgnoreThreshold / dpr / sx) || 0;\n this._uy = mathAbs(segmentIgnoreThreshold / dpr / sy) || 0;\n }\n };\n PathProxy.prototype.setDPR = function (dpr) {\n this.dpr = dpr;\n };\n PathProxy.prototype.setContext = function (ctx) {\n this._ctx = ctx;\n };\n PathProxy.prototype.getContext = function () {\n return this._ctx;\n };\n PathProxy.prototype.beginPath = function () {\n this._ctx && this._ctx.beginPath();\n this.reset();\n return this;\n };\n PathProxy.prototype.reset = function () {\n if (this._saveData) {\n this._len = 0;\n }\n if (this._pathSegLen) {\n this._pathSegLen = null;\n this._pathLen = 0;\n }\n this._version++;\n };\n PathProxy.prototype.moveTo = function (x, y) {\n this._drawPendingPt();\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y);\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n };\n PathProxy.prototype.lineTo = function (x, y) {\n var dx = mathAbs(x - this._xi);\n var dy = mathAbs(y - this._yi);\n var exceedUnit = dx > this._ux || dy > this._uy;\n this.addData(CMD.L, x, y);\n if (this._ctx && exceedUnit) {\n this._ctx.lineTo(x, y);\n }\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n this._pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > this._pendingPtDist) {\n this._pendingPtX = x;\n this._pendingPtY = y;\n this._pendingPtDist = d2;\n }\n }\n return this;\n };\n PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) {\n this._drawPendingPt();\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n if (this._ctx) {\n this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n this._xi = x3;\n this._yi = y3;\n return this;\n };\n PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) {\n this._drawPendingPt();\n this.addData(CMD.Q, x1, y1, x2, y2);\n if (this._ctx) {\n this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n this._xi = x2;\n this._yi = y2;\n return this;\n };\n PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this._drawPendingPt();\n tmpAngles[0] = startAngle;\n tmpAngles[1] = endAngle;\n normalizeArcAngles(tmpAngles, anticlockwise);\n startAngle = tmpAngles[0];\n endAngle = tmpAngles[1];\n var delta = endAngle - startAngle;\n this.addData(CMD.A, cx, cy, r, r, startAngle, delta, 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 PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._drawPendingPt();\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n return this;\n };\n PathProxy.prototype.rect = function (x, y, w, h) {\n this._drawPendingPt();\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n };\n PathProxy.prototype.closePath = function () {\n this._drawPendingPt();\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n if (ctx) {\n ctx.closePath();\n }\n this._xi = x0;\n this._yi = y0;\n return this;\n };\n PathProxy.prototype.fill = function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n };\n PathProxy.prototype.stroke = function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n };\n PathProxy.prototype.len = function () {\n return this._len;\n };\n PathProxy.prototype.setData = function (data) {\n var len = data.length;\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n this._len = len;\n };\n PathProxy.prototype.appendPath = function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n if (hasTypedArray && (this.data instanceof Float32Array)) {\n this.data = new Float32Array(offset + appendSize);\n }\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n this._len = offset;\n };\n PathProxy.prototype.addData = function (cmd, a, b, c, d, e, f, g, h) {\n if (!this._saveData) {\n return;\n }\n var data = this.data;\n if (this._len + arguments.length > data.length) {\n this._expandData();\n data = this.data;\n }\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n };\n PathProxy.prototype._drawPendingPt = function () {\n if (this._pendingPtDist > 0) {\n this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);\n this._pendingPtDist = 0;\n }\n };\n PathProxy.prototype._expandData = function () {\n if (!(this.data instanceof Array)) {\n var newData = [];\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n this.data = newData;\n }\n };\n PathProxy.prototype.toStatic = function () {\n if (!this._saveData) {\n return;\n }\n this._drawPendingPt();\n var data = this.data;\n if (data instanceof Array) {\n data.length = this._len;\n if (hasTypedArray && this._len > 11) {\n this.data = new Float32Array(data);\n }\n }\n };\n PathProxy.prototype.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 var i;\n for (i = 0; i < this._len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n case CMD.L:\n fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.C:\n 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 case CMD.Q:\n 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 case CMD.A:\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;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n 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 case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n }\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n }\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n PathProxy.prototype._calculateLength = function () {\n var data = this.data;\n var len = this._len;\n var ux = this._ux;\n var uy = this._uy;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n if (!this._pathSegLen) {\n this._pathSegLen = [];\n }\n var pathSegLen = this._pathSegLen;\n var pathTotalLen = 0;\n var segCount = 0;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n var l = -1;\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n break;\n case CMD.L: {\n var x2 = data[i++];\n var y2 = data[i++];\n var dx = x2 - xi;\n var dy = y2 - yi;\n if (mathAbs(dx) > ux || mathAbs(dy) > uy || i === len - 1) {\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x2;\n yi = y2;\n }\n break;\n }\n case CMD.C: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n var x3 = data[i++];\n var y3 = data[i++];\n l = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = data[i++];\n var y1 = data[i++];\n var x2 = data[i++];\n var y2 = data[i++];\n l = quadraticLength(xi, yi, x1, y1, x2, y2, 10);\n xi = x2;\n yi = y2;\n break;\n }\n case CMD.A:\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 delta = data[i++];\n var endAngle = delta + startAngle;\n i += 1;\n var anticlockwise = !data[i++];\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n l = mathMax(rx, ry) * mathMin(PI2, Math.abs(delta));\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\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 l = width * 2 + height * 2;\n break;\n }\n case CMD.Z: {\n var dx = x0 - xi;\n var dy = y0 - yi;\n l = Math.sqrt(dx * dx + dy * dy);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (l >= 0) {\n pathSegLen[segCount++] = l;\n pathTotalLen += l;\n }\n }\n this._pathLen = pathTotalLen;\n return pathTotalLen;\n };\n PathProxy.prototype.rebuildPath = function (ctx, percent) {\n var d = this.data;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n var x0;\n var y0;\n var xi;\n var yi;\n var x;\n var y;\n var drawPart = percent < 1;\n var pathSegLen;\n var pathTotalLen;\n var accumLength = 0;\n var segCount = 0;\n var displayedLength;\n var pendingPtDist = 0;\n var pendingPtX;\n var pendingPtY;\n if (drawPart) {\n if (!this._pathSegLen) {\n this._calculateLength();\n }\n pathSegLen = this._pathSegLen;\n pathTotalLen = this._pathLen;\n displayedLength = percent * pathTotalLen;\n if (!displayedLength) {\n return;\n }\n }\n lo: for (var i = 0; i < len;) {\n var cmd = d[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n if (cmd !== CMD.L && pendingPtDist > 0) {\n ctx.lineTo(pendingPtX, pendingPtY);\n pendingPtDist = 0;\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 case CMD.L: {\n x = d[i++];\n y = d[i++];\n var dx = mathAbs(x - xi);\n var dy = mathAbs(y - yi);\n if (dx > ux || dy > uy) {\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x * t, yi * (1 - t) + y * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n pendingPtDist = 0;\n }\n else {\n var d2 = dx * dx + dy * dy;\n if (d2 > pendingPtDist) {\n pendingPtX = x;\n pendingPtY = y;\n pendingPtDist = d2;\n }\n }\n break;\n }\n case CMD.C: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n var x3 = d[i++];\n var y3 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n cubicSubdivide(xi, x1, x2, x3, t, tmpOutX);\n cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);\n ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);\n break lo;\n }\n accumLength += l;\n }\n ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n xi = x3;\n yi = y3;\n break;\n }\n case CMD.Q: {\n var x1 = d[i++];\n var y1 = d[i++];\n var x2 = d[i++];\n var y2 = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n quadraticSubdivide(xi, x1, x2, t, tmpOutX);\n quadraticSubdivide(yi, y1, y2, t, tmpOutY);\n ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);\n break lo;\n }\n accumLength += l;\n }\n ctx.quadraticCurveTo(x1, y1, x2, y2);\n xi = x2;\n yi = y2;\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 startAngle = d[i++];\n var delta = d[i++];\n var psi = d[i++];\n var anticlockwise = !d[i++];\n var r = (rx > ry) ? rx : ry;\n var isEllipse = mathAbs(rx - ry) > 1e-3;\n var endAngle = startAngle + delta;\n var breakBuild = false;\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n endAngle = startAngle + delta * (displayedLength - accumLength) / l;\n breakBuild = true;\n }\n accumLength += l;\n }\n if (isEllipse && ctx.ellipse) {\n ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);\n }\n else {\n ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n }\n if (breakBuild) {\n break lo;\n }\n if (isFirst) {\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n x = d[i++];\n y = d[i++];\n var width = d[i++];\n var height = d[i++];\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var d_1 = displayedLength - accumLength;\n ctx.moveTo(x, y);\n ctx.lineTo(x + mathMin(d_1, width), y);\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x + width, y + mathMin(d_1, height));\n }\n d_1 -= height;\n if (d_1 > 0) {\n ctx.lineTo(x + mathMax(width - d_1, 0), y + height);\n }\n d_1 -= width;\n if (d_1 > 0) {\n ctx.lineTo(x, y + mathMax(height - d_1, 0));\n }\n break lo;\n }\n accumLength += l;\n }\n ctx.rect(x, y, width, height);\n break;\n case CMD.Z:\n if (drawPart) {\n var l = pathSegLen[segCount++];\n if (accumLength + l > displayedLength) {\n var t = (displayedLength - accumLength) / l;\n ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);\n break lo;\n }\n accumLength += l;\n }\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n };\n PathProxy.prototype.clone = function () {\n var newProxy = new PathProxy();\n var data = this.data;\n newProxy.data = data.slice ? data.slice()\n : Array.prototype.slice.call(data);\n newProxy._len = this._len;\n return newProxy;\n };\n PathProxy.CMD = CMD;\n PathProxy.initDefaultProps = (function () {\n var proto = PathProxy.prototype;\n proto._saveData = true;\n proto._ux = 0;\n proto._uy = 0;\n proto._pendingPtDist = 0;\n proto._version = 0;\n })();\n return PathProxy;\n}());\nexport default PathProxy;\n","export function containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n var _a = 0;\n var _b = x0;\n if ((y > y0 + _l && y > y1 + _l)\n || (y < y0 - _l && y < y1 - _l)\n || (x > x0 + _l && x > x1 + _l)\n || (x < x0 - _l && x < x1 - _l)) {\n return false;\n }\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n }\n else {\n return Math.abs(x - x0) <= _l / 2;\n }\n var tmp = _a * x - y + _b;\n var _s = tmp * tmp / (_a * _a + 1);\n return _s <= _l / 2 * _l / 2;\n}\n","import * as curve from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) {\n return false;\n }\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n","import { quadraticProjectPoint } from '../core/curve.js';\nexport function containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n if ((y > y0 + _l && y > y1 + _l && y > y2 + _l)\n || (y < y0 - _l && y < y1 - _l && y < y2 - _l)\n || (x > x0 + _l && x > x1 + _l && x > x2 + _l)\n || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) {\n return false;\n }\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n","var PI2 = Math.PI * 2;\nexport function normalizeRadian(angle) {\n angle %= PI2;\n if (angle < 0) {\n angle += PI2;\n }\n return angle;\n}\n","import { normalizeRadian } from './util.js';\nvar PI2 = Math.PI * 2;\nexport function containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n if ((d - _l > r) || (d + _l < r)) {\n return false;\n }\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n return true;\n }\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n }\n else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n var angle = Math.atan2(y, x);\n if (angle < 0) {\n angle += PI2;\n }\n return (angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);\n}\n","export default function windingLine(x0, y0, x1, y1, x, y) {\n if ((y > y0 && y > y1) || (y < y0 && y < y1)) {\n return 0;\n }\n if (y1 === y0) {\n return 0;\n }\n var t = (y - y0) / (y1 - y0);\n var dir = y1 < y0 ? 1 : -1;\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n var x_ = t * (x1 - x0) + x0;\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n","import PathProxy from '../core/PathProxy.js';\nimport * as line from './line.js';\nimport * as cubic from './cubic.js';\nimport * as quadratic from './quadratic.js';\nimport * as arc from './arc.js';\nimport * as curve from '../core/curve.js';\nimport windingLine from './windingLine.js';\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n if ((y > y0 && y > y1 && y > y2 && y > y3)\n || (y < y0 && y < y1 && y < y2 && y < y3)) {\n return 0;\n }\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var w = 0;\n var nExtrema = -1;\n var y0_ = void 0;\n var y1_ = void 0;\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i];\n var unit = (t === 0 || t === 1) ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n if (x_ < x) {\n continue;\n }\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n if (nExtrema === 2) {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n }\n else {\n w += y3 < y1_ ? unit : -unit;\n }\n }\n else {\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n }\n else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n return w;\n }\n}\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n if ((y > y0 && y > y1 && y > y2)\n || (y < y0 && y < y1 && y < y2)) {\n return 0;\n }\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n if (nRoots === 0) {\n return 0;\n }\n else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n for (var i = 0; i < nRoots; i++) {\n var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n if (x_ < x) {\n continue;\n }\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n }\n else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n return w;\n }\n else {\n var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n if (x_ < x) {\n return 0;\n }\n return y2 < y0 ? unit : -unit;\n }\n }\n}\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n if (y > r || y < -r) {\n return 0;\n }\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var dTheta = Math.abs(startAngle - endAngle);\n if (dTheta < 1e-4) {\n return 0;\n }\n if (dTheta >= PI2 - 1e-4) {\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n }\n else {\n return 0;\n }\n }\n if (startAngle > endAngle) {\n var tmp_1 = startAngle;\n startAngle = endAngle;\n endAngle = tmp_1;\n }\n if (startAngle < 0) {\n startAngle += PI2;\n endAngle += PI2;\n }\n var w = 0;\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n if (angle < 0) {\n angle = PI2 + angle;\n }\n if ((angle >= startAngle && angle <= endAngle)\n || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n w += dir;\n }\n }\n }\n return w;\n}\nfunction containPath(path, lineWidth, isStroke, x, y) {\n var data = path.data;\n var len = path.len();\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (cmd === CMD.M && i > 1) {\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n }\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\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 }\n else {\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\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 }\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 xi = data[i++];\n yi = data[i++];\n break;\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 }\n else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n xi = data[i++];\n yi = data[i++];\n break;\n case CMD.A:\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++];\n i += 1;\n var anticlockwise = !!(1 - data[i++]);\n x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy;\n if (!isFirst) {\n w += windingLine(xi, yi, x1, y1, x, y);\n }\n else {\n x0 = x1;\n y0 = y1;\n }\n var _x = (x - cx) * ry / rx + cx;\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n }\n else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\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 x1 = x0 + width;\n y1 = y0 + height;\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y)\n || line.containStroke(x1, y0, x1, y1, lineWidth, x, y)\n || line.containStroke(x1, y1, x0, y1, lineWidth, x, y)\n || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n break;\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n }\n else {\n w += windingLine(xi, yi, x0, y0, x, y);\n }\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n return w !== 0;\n}\nexport function contain(pathProxy, x, y) {\n return containPath(pathProxy, 0, false, x, y);\n}\nexport function containStroke(pathProxy, lineWidth, x, y) {\n return containPath(pathProxy, lineWidth, true, x, y);\n}\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport * as pathContain from '../contain/path.js';\nimport { defaults, keys, extend, clone, isString, createObject } from '../core/util.js';\nimport { lum } from '../tool/color.js';\nimport { DARK_LABEL_COLOR, LIGHT_LABEL_COLOR, DARK_MODE_THRESHOLD, LIGHTER_LABEL_COLOR } from '../config.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT, STYLE_CHANGED_BIT } from './constants.js';\nimport { TRANSFORMABLE_PROPS } from '../core/Transformable.js';\nexport var DEFAULT_PATH_STYLE = defaults({\n fill: '#000',\n stroke: null,\n strokePercent: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n miterLimit: 10,\n strokeNoScale: false,\n strokeFirst: false\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_PATH_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n strokePercent: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineDashOffset: true,\n lineWidth: true,\n miterLimit: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar pathCopyParams = TRANSFORMABLE_PROPS.concat(['invisible',\n 'culling', 'z', 'z2', 'zlevel', 'parent'\n]);\nvar Path = (function (_super) {\n __extends(Path, _super);\n function Path(opts) {\n return _super.call(this, opts) || this;\n }\n Path.prototype.update = function () {\n var _this = this;\n _super.prototype.update.call(this);\n var style = this.style;\n if (style.decal) {\n var decalEl = this._decalEl = this._decalEl || new Path();\n if (decalEl.buildPath === Path.prototype.buildPath) {\n decalEl.buildPath = function (ctx) {\n _this.buildPath(ctx, _this.shape);\n };\n }\n decalEl.silent = true;\n var decalElStyle = decalEl.style;\n for (var key in style) {\n if (decalElStyle[key] !== style[key]) {\n decalElStyle[key] = style[key];\n }\n }\n decalElStyle.fill = style.fill ? style.decal : null;\n decalElStyle.decal = null;\n decalElStyle.shadowColor = null;\n style.strokeFirst && (decalElStyle.stroke = null);\n for (var i = 0; i < pathCopyParams.length; ++i) {\n decalEl[pathCopyParams[i]] = this[pathCopyParams[i]];\n }\n decalEl.__dirty |= REDRAW_BIT;\n }\n else if (this._decalEl) {\n this._decalEl = null;\n }\n };\n Path.prototype.getDecalElement = function () {\n return this._decalEl;\n };\n Path.prototype._init = function (props) {\n var keysArr = keys(props);\n this.shape = this.getDefaultShape();\n var defaultStyle = this.getDefaultStyle();\n if (defaultStyle) {\n this.useStyle(defaultStyle);\n }\n for (var i = 0; i < keysArr.length; i++) {\n var key = keysArr[i];\n var value = props[key];\n if (key === 'style') {\n if (!this.style) {\n this.useStyle(value);\n }\n else {\n extend(this.style, value);\n }\n }\n else if (key === 'shape') {\n extend(this.shape, value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n }\n if (!this.style) {\n this.useStyle({});\n }\n };\n Path.prototype.getDefaultStyle = function () {\n return null;\n };\n Path.prototype.getDefaultShape = function () {\n return {};\n };\n Path.prototype.canBeInsideText = function () {\n return this.hasFill();\n };\n Path.prototype.getInsideTextFill = function () {\n var pathFill = this.style.fill;\n if (pathFill !== 'none') {\n if (isString(pathFill)) {\n var fillLum = lum(pathFill, 0);\n if (fillLum > 0.5) {\n return DARK_LABEL_COLOR;\n }\n else if (fillLum > 0.2) {\n return LIGHTER_LABEL_COLOR;\n }\n return LIGHT_LABEL_COLOR;\n }\n else if (pathFill) {\n return LIGHT_LABEL_COLOR;\n }\n }\n return DARK_LABEL_COLOR;\n };\n Path.prototype.getInsideTextStroke = function (textFill) {\n var pathFill = this.style.fill;\n if (isString(pathFill)) {\n var zr = this.__zr;\n var isDarkMode = !!(zr && zr.isDarkMode());\n var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;\n if (isDarkMode === isDarkLabel) {\n return pathFill;\n }\n }\n };\n Path.prototype.buildPath = function (ctx, shapeCfg, inBatch) { };\n Path.prototype.pathUpdated = function () {\n this.__dirty &= ~SHAPE_CHANGED_BIT;\n };\n Path.prototype.getUpdatedPathProxy = function (inBatch) {\n !this.path && this.createPathProxy();\n this.path.beginPath();\n this.buildPath(this.path, this.shape, inBatch);\n return this.path;\n };\n Path.prototype.createPathProxy = function () {\n this.path = new PathProxy(false);\n };\n Path.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n };\n Path.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n Path.prototype.getBoundingRect = function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n if (needsUpdateRect) {\n var firstInvoke = false;\n if (!this.path) {\n firstInvoke = true;\n this.createPathProxy();\n }\n var path = this.path;\n if (firstInvoke || (this.__dirty & SHAPE_CHANGED_BIT)) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n this.pathUpdated();\n }\n rect = path.getBoundingRect();\n }\n this._rect = rect;\n if (this.hasStroke() && this.path && this.path.len() > 0) {\n var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());\n if (this.__dirty || needsUpdateRect) {\n rectStroke.copy(rect);\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n var w = style.lineWidth;\n if (!this.hasFill()) {\n var strokeContainThreshold = this.strokeContainThreshold;\n w = Math.max(w, strokeContainThreshold == null ? 4 : strokeContainThreshold);\n }\n if (lineScale > 1e-10) {\n rectStroke.width += w / lineScale;\n rectStroke.height += w / lineScale;\n rectStroke.x -= w / lineScale / 2;\n rectStroke.y -= w / lineScale / 2;\n }\n }\n return rectStroke;\n }\n return rect;\n };\n Path.prototype.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 if (rect.contain(x, y)) {\n var pathProxy = this.path;\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1;\n if (lineScale > 1e-10) {\n if (!this.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n if (pathContain.containStroke(pathProxy, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n if (this.hasFill()) {\n return pathContain.contain(pathProxy, x, y);\n }\n }\n return false;\n };\n Path.prototype.dirtyShape = function () {\n this.__dirty |= SHAPE_CHANGED_BIT;\n if (this._rect) {\n this._rect = null;\n }\n if (this._decalEl) {\n this._decalEl.dirtyShape();\n }\n this.markRedraw();\n };\n Path.prototype.dirty = function () {\n this.dirtyStyle();\n this.dirtyShape();\n };\n Path.prototype.animateShape = function (loop) {\n return this.animate('shape', loop);\n };\n Path.prototype.updateDuringAnimation = function (targetKey) {\n if (targetKey === 'style') {\n this.dirtyStyle();\n }\n else if (targetKey === 'shape') {\n this.dirtyShape();\n }\n else {\n this.markRedraw();\n }\n };\n Path.prototype.attrKV = function (key, value) {\n if (key === 'shape') {\n this.setShape(value);\n }\n else {\n _super.prototype.attrKV.call(this, key, value);\n }\n };\n Path.prototype.setShape = function (keyOrObj, value) {\n var shape = this.shape;\n if (!shape) {\n shape = this.shape = {};\n }\n if (typeof keyOrObj === 'string') {\n shape[keyOrObj] = value;\n }\n else {\n extend(shape, keyOrObj);\n }\n this.dirtyShape();\n return this;\n };\n Path.prototype.shapeChanged = function () {\n return !!(this.__dirty & SHAPE_CHANGED_BIT);\n };\n Path.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_PATH_STYLE, obj);\n };\n Path.prototype._innerSaveToNormal = function (toState) {\n _super.prototype._innerSaveToNormal.call(this, toState);\n var normalState = this._normalState;\n if (toState.shape && !normalState.shape) {\n normalState.shape = extend({}, this.shape);\n }\n };\n Path.prototype._applyStateObj = function (stateName, state, normalState, keepCurrentStates, transition, animationCfg) {\n _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);\n var needsRestoreToNormal = !(state && keepCurrentStates);\n var targetShape;\n if (state && state.shape) {\n if (transition) {\n if (keepCurrentStates) {\n targetShape = state.shape;\n }\n else {\n targetShape = extend({}, normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else {\n targetShape = extend({}, keepCurrentStates ? this.shape : normalState.shape);\n extend(targetShape, state.shape);\n }\n }\n else if (needsRestoreToNormal) {\n targetShape = normalState.shape;\n }\n if (targetShape) {\n if (transition) {\n this.shape = extend({}, this.shape);\n var targetShapePrimaryProps = {};\n var shapeKeys = keys(targetShape);\n for (var i = 0; i < shapeKeys.length; i++) {\n var key = shapeKeys[i];\n if (typeof targetShape[key] === 'object') {\n this.shape[key] = targetShape[key];\n }\n else {\n targetShapePrimaryProps[key] = targetShape[key];\n }\n }\n this._transitionState(stateName, {\n shape: targetShapePrimaryProps\n }, animationCfg);\n }\n else {\n this.shape = targetShape;\n this.dirtyShape();\n }\n }\n };\n Path.prototype._mergeStates = function (states) {\n var mergedState = _super.prototype._mergeStates.call(this, states);\n var mergedShape;\n for (var i = 0; i < states.length; i++) {\n var state = states[i];\n if (state.shape) {\n mergedShape = mergedShape || {};\n this._mergeStyle(mergedShape, state.shape);\n }\n }\n if (mergedShape) {\n mergedState.shape = mergedShape;\n }\n return mergedState;\n };\n Path.prototype.getAnimationStyleProps = function () {\n return DEFAULT_PATH_ANIMATION_PROPS;\n };\n Path.prototype.isZeroArea = function () {\n return false;\n };\n Path.extend = function (defaultProps) {\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n defaultProps.init && defaultProps.init.call(_this, opts);\n return _this;\n }\n Sub.prototype.getDefaultStyle = function () {\n return clone(defaultProps.style);\n };\n Sub.prototype.getDefaultShape = function () {\n return clone(defaultProps.shape);\n };\n return Sub;\n }(Path));\n for (var key in defaultProps) {\n if (typeof defaultProps[key] === 'function') {\n Sub.prototype[key] = defaultProps[key];\n }\n }\n return Sub;\n };\n Path.initDefaultProps = (function () {\n var pathProto = Path.prototype;\n pathProto.type = 'path';\n pathProto.strokeContainThreshold = 5;\n pathProto.segmentIgnoreThreshold = 0;\n pathProto.subPixelOptimize = false;\n pathProto.autoBatch = false;\n pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;\n })();\n return Path;\n}(Displayable));\nexport default Path;\n","import { __extends } from \"tslib\";\nimport Displayable from './Displayable.js';\nimport { getBoundingRect } from '../contain/text.js';\nimport { DEFAULT_PATH_STYLE } from './Path.js';\nimport { createObject, defaults } from '../core/util.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nexport var DEFAULT_TSPAN_STYLE = defaults({\n strokeFirst: true,\n font: DEFAULT_FONT,\n x: 0,\n y: 0,\n textAlign: 'left',\n textBaseline: 'top',\n miterLimit: 2\n}, DEFAULT_PATH_STYLE);\nvar TSpan = (function (_super) {\n __extends(TSpan, _super);\n function TSpan() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TSpan.prototype.hasStroke = function () {\n var style = this.style;\n var stroke = style.stroke;\n return stroke != null && stroke !== 'none' && style.lineWidth > 0;\n };\n TSpan.prototype.hasFill = function () {\n var style = this.style;\n var fill = style.fill;\n return fill != null && fill !== 'none';\n };\n TSpan.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_TSPAN_STYLE, obj);\n };\n TSpan.prototype.setBoundingRect = function (rect) {\n this._rect = rect;\n };\n TSpan.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n var text = style.text;\n text != null ? (text += '') : (text = '');\n var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n if (this.hasStroke()) {\n var w = style.lineWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n this._rect = rect;\n }\n return this._rect;\n };\n TSpan.initDefaultProps = (function () {\n var tspanProto = TSpan.prototype;\n tspanProto.dirtyRectTolerance = 10;\n })();\n return TSpan;\n}(Displayable));\nTSpan.prototype.type = 'tspan';\nexport default TSpan;\n","import { __extends } from \"tslib\";\nimport Displayable, { DEFAULT_COMMON_STYLE, DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { defaults, createObject } from '../core/util.js';\nexport var DEFAULT_IMAGE_STYLE = defaults({\n x: 0,\n y: 0\n}, DEFAULT_COMMON_STYLE);\nexport var DEFAULT_IMAGE_ANIMATION_PROPS = {\n style: defaults({\n x: true,\n y: true,\n width: true,\n height: true,\n sx: true,\n sy: true,\n sWidth: true,\n sHeight: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nfunction isImageLike(source) {\n return !!(source\n && typeof source !== 'string'\n && source.width && source.height);\n}\nvar ZRImage = (function (_super) {\n __extends(ZRImage, _super);\n function ZRImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ZRImage.prototype.createStyle = function (obj) {\n return createObject(DEFAULT_IMAGE_STYLE, obj);\n };\n ZRImage.prototype._getSize = function (dim) {\n var style = this.style;\n var size = style[dim];\n if (size != null) {\n return size;\n }\n var imageSource = isImageLike(style.image)\n ? style.image : this.__image;\n if (!imageSource) {\n return 0;\n }\n var otherDim = dim === 'width' ? 'height' : 'width';\n var otherDimSize = style[otherDim];\n if (otherDimSize == null) {\n return imageSource[dim];\n }\n else {\n return imageSource[dim] / imageSource[otherDim] * otherDimSize;\n }\n };\n ZRImage.prototype.getWidth = function () {\n return this._getSize('width');\n };\n ZRImage.prototype.getHeight = function () {\n return this._getSize('height');\n };\n ZRImage.prototype.getAnimationStyleProps = function () {\n return DEFAULT_IMAGE_ANIMATION_PROPS;\n };\n ZRImage.prototype.getBoundingRect = function () {\n var style = this.style;\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());\n }\n return this._rect;\n };\n return ZRImage;\n}(Displayable));\nZRImage.prototype.type = 'image';\nexport default ZRImage;\n","export function 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;\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n }\n else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n }\n else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n }\n else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n }\n else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = 0;\n }\n var total;\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\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","var round = Math.round;\nexport function subPixelOptimizeLine(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n }\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n }\n return outputShape;\n}\nexport function subPixelOptimizeRect(outputShape, inputShape, style) {\n if (!inputShape) {\n return;\n }\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = originX;\n outputShape.y = originY;\n outputShape.width = originWidth;\n outputShape.height = originHeight;\n var lineWidth = style && style.lineWidth;\n if (!lineWidth) {\n return outputShape;\n }\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 return outputShape;\n}\nexport function subPixelOptimize(position, lineWidth, positiveOrNegative) {\n if (!lineWidth) {\n return position;\n }\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0\n ? doubledPosition / 2\n : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundRectHelper from '../helper/roundRect.js';\nimport { subPixelOptimizeRect } from '../helper/subPixelOptimize.js';\nvar RectShape = (function () {\n function RectShape() {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n }\n return RectShape;\n}());\nexport { RectShape };\nvar subPixelOptimizeOutputShape = {};\nvar Rect = (function (_super) {\n __extends(Rect, _super);\n function Rect(opts) {\n return _super.call(this, opts) || this;\n }\n Rect.prototype.getDefaultShape = function () {\n return new RectShape();\n };\n Rect.prototype.buildPath = function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = optimizedShape.x;\n y = optimizedShape.y;\n width = optimizedShape.width;\n height = optimizedShape.height;\n optimizedShape.r = shape.r;\n shape = optimizedShape;\n }\n else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n }\n else {\n roundRectHelper.buildPath(ctx, shape);\n }\n };\n Rect.prototype.isZeroArea = function () {\n return !this.shape.width || !this.shape.height;\n };\n return Rect;\n}(Path));\nRect.prototype.type = 'rect';\nexport default Rect;\n","import { __extends } from \"tslib\";\nimport { parseRichText, parsePlainText } from './helper/parseText.js';\nimport TSpan from './TSpan.js';\nimport { retrieve2, each, normalizeCssArray, trim, retrieve3, extend, keys, defaults } from '../core/util.js';\nimport { adjustTextX, adjustTextY } from '../contain/text.js';\nimport ZRImage from './Image.js';\nimport Rect from './shape/Rect.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Displayable, { DEFAULT_COMMON_ANIMATION_PROPS } from './Displayable.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_SIZE } from '../core/platform.js';\nvar DEFAULT_RICH_TEXT_COLOR = {\n fill: '#000'\n};\nvar DEFAULT_STROKE_LINE_WIDTH = 2;\nexport var DEFAULT_TEXT_ANIMATION_PROPS = {\n style: defaults({\n fill: true,\n stroke: true,\n fillOpacity: true,\n strokeOpacity: true,\n lineWidth: true,\n fontSize: true,\n lineHeight: true,\n width: true,\n height: true,\n textShadowColor: true,\n textShadowBlur: true,\n textShadowOffsetX: true,\n textShadowOffsetY: true,\n backgroundColor: true,\n padding: true,\n borderColor: true,\n borderWidth: true,\n borderRadius: true\n }, DEFAULT_COMMON_ANIMATION_PROPS.style)\n};\nvar ZRText = (function (_super) {\n __extends(ZRText, _super);\n function ZRText(opts) {\n var _this = _super.call(this) || this;\n _this.type = 'text';\n _this._children = [];\n _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;\n _this.attr(opts);\n return _this;\n }\n ZRText.prototype.childrenRef = function () {\n return this._children;\n };\n ZRText.prototype.update = function () {\n _super.prototype.update.call(this);\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n child.zlevel = this.zlevel;\n child.z = this.z;\n child.z2 = this.z2;\n child.culling = this.culling;\n child.cursor = this.cursor;\n child.invisible = this.invisible;\n }\n };\n ZRText.prototype.updateTransform = function () {\n var innerTransformable = this.innerTransformable;\n if (innerTransformable) {\n innerTransformable.updateTransform();\n if (innerTransformable.transform) {\n this.transform = innerTransformable.transform;\n }\n }\n else {\n _super.prototype.updateTransform.call(this);\n }\n };\n ZRText.prototype.getLocalTransform = function (m) {\n var innerTransformable = this.innerTransformable;\n return innerTransformable\n ? innerTransformable.getLocalTransform(m)\n : _super.prototype.getLocalTransform.call(this, m);\n };\n ZRText.prototype.getComputedTransform = function () {\n if (this.__hostTarget) {\n this.__hostTarget.getComputedTransform();\n this.__hostTarget.updateInnerText(true);\n }\n return _super.prototype.getComputedTransform.call(this);\n };\n ZRText.prototype._updateSubTexts = function () {\n this._childCursor = 0;\n normalizeTextStyle(this.style);\n this.style.rich\n ? this._updateRichTexts()\n : this._updatePlainTexts();\n this._children.length = this._childCursor;\n this.styleUpdated();\n };\n ZRText.prototype.addSelfToZr = function (zr) {\n _super.prototype.addSelfToZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = zr;\n }\n };\n ZRText.prototype.removeSelfFromZr = function (zr) {\n _super.prototype.removeSelfFromZr.call(this, zr);\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].__zr = null;\n }\n };\n ZRText.prototype.getBoundingRect = function () {\n if (this.styleChanged()) {\n this._updateSubTexts();\n }\n if (!this._rect) {\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = this._children;\n var tmpMat = [];\n var rect = null;\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat);\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n }\n else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n this._rect = rect || tmpRect;\n }\n return this._rect;\n };\n ZRText.prototype.setDefaultTextStyle = function (defaultTextStyle) {\n this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;\n };\n ZRText.prototype.setTextContent = function (textContent) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Can\\'t attach text on another text');\n }\n };\n ZRText.prototype._mergeStyle = function (targetStyle, sourceStyle) {\n if (!sourceStyle) {\n return targetStyle;\n }\n var sourceRich = sourceStyle.rich;\n var targetRich = targetStyle.rich || (sourceRich && {});\n extend(targetStyle, sourceStyle);\n if (sourceRich && targetRich) {\n this._mergeRich(targetRich, sourceRich);\n targetStyle.rich = targetRich;\n }\n else if (targetRich) {\n targetStyle.rich = targetRich;\n }\n return targetStyle;\n };\n ZRText.prototype._mergeRich = function (targetRich, sourceRich) {\n var richNames = keys(sourceRich);\n for (var i = 0; i < richNames.length; i++) {\n var richName = richNames[i];\n targetRich[richName] = targetRich[richName] || {};\n extend(targetRich[richName], sourceRich[richName]);\n }\n };\n ZRText.prototype.getAnimationStyleProps = function () {\n return DEFAULT_TEXT_ANIMATION_PROPS;\n };\n ZRText.prototype._getOrCreateChild = function (Ctor) {\n var child = this._children[this._childCursor];\n if (!child || !(child instanceof Ctor)) {\n child = new Ctor();\n }\n this._children[this._childCursor++] = child;\n child.__zr = this.__zr;\n child.parent = this;\n return child;\n };\n ZRText.prototype._updatePlainTexts = function () {\n var style = this.style;\n var textFont = style.font || DEFAULT_FONT;\n var textPadding = style.padding;\n var text = getStyleText(style);\n var contentBlock = parsePlainText(text, style);\n var needDrawBg = needDrawBackground(style);\n var bgColorDrawn = !!(style.backgroundColor);\n var outerHeight = contentBlock.outerHeight;\n var outerWidth = contentBlock.outerWidth;\n var contentWidth = contentBlock.contentWidth;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var defaultStyle = this._defaultStyle;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.align || defaultStyle.align || 'left';\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || 'top';\n var textX = baseX;\n var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);\n if (needDrawBg || textPadding) {\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n textY += lineHeight / 2;\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n if (verticalAlign === 'top') {\n textY += textPadding[0];\n }\n else if (verticalAlign === 'bottom') {\n textY -= textPadding[2];\n }\n }\n var defaultLineWidth = 0;\n var useDefaultFill = false;\n var textFill = getFill('fill' in style\n ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in style\n ? style.stroke\n : (!bgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill))\n ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = style.textShadowBlur > 0;\n var fixedBoundingRect = style.width != null\n && (style.overflow === 'truncate' || style.overflow === 'break' || style.overflow === 'breakAll');\n var calculatedLineHeight = contentBlock.calculatedLineHeight;\n for (var i = 0; i < textLines.length; i++) {\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n subElStyle.text = textLines[i];\n subElStyle.x = textX;\n subElStyle.y = textY;\n if (textAlign) {\n subElStyle.textAlign = textAlign;\n }\n subElStyle.textBaseline = 'middle';\n subElStyle.opacity = style.opacity;\n subElStyle.strokeFirst = true;\n if (hasShadow) {\n subElStyle.shadowBlur = style.textShadowBlur || 0;\n subElStyle.shadowColor = style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;\n }\n subElStyle.stroke = textStroke;\n subElStyle.fill = textFill;\n if (textStroke) {\n subElStyle.lineWidth = style.lineWidth || defaultLineWidth;\n subElStyle.lineDash = style.lineDash;\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n }\n subElStyle.font = textFont;\n setSeparateFont(subElStyle, style);\n textY += lineHeight;\n if (fixedBoundingRect) {\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, style.width, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight));\n }\n }\n };\n ZRText.prototype._updateRichTexts = function () {\n var style = this.style;\n var text = getStyleText(style);\n var contentBlock = parseRichText(text, style);\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.padding;\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var defaultStyle = this._defaultStyle;\n var textAlign = style.align || defaultStyle.align;\n var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;\n var boxX = adjustTextX(baseX, outerWidth, textAlign);\n var boxY = adjustTextY(baseY, outerHeight, verticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n var xRight = xLeft + contentWidth;\n if (needDrawBackground(style)) {\n this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);\n }\n var bgColorDrawn = !!(style.backgroundColor);\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 remainedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token = void 0;\n while (leftIndex < tokenCount\n && (token = tokens[leftIndex], !token.align || token.align === 'left')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft, 'left', bgColorDrawn);\n remainedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n while (rightIndex >= 0\n && (token = tokens[rightIndex], token.align === 'right')) {\n this._placeToken(token, style, lineHeight, lineTop, lineXRight, 'right', bgColorDrawn);\n remainedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n }\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex];\n this._placeToken(token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center', bgColorDrawn);\n lineXLeft += token.width;\n leftIndex++;\n }\n lineTop += lineHeight;\n }\n };\n ZRText.prototype._placeToken = function (token, style, lineHeight, lineTop, x, textAlign, parentBgColorDrawn) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text;\n var verticalAlign = token.verticalAlign;\n var y = lineTop + lineHeight / 2;\n if (verticalAlign === 'top') {\n y = lineTop + token.height / 2;\n }\n else if (verticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);\n needDrawBg && this._renderBackground(tokenStyle, style, textAlign === 'right'\n ? x - token.width\n : textAlign === 'center'\n ? x - token.width / 2\n : x, y - token.height / 2, token.width, token.height);\n var bgColorDrawn = !!tokenStyle.backgroundColor;\n var textPadding = token.textPadding;\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;\n }\n var el = this._getOrCreateChild(TSpan);\n var subElStyle = el.createStyle();\n el.useStyle(subElStyle);\n var defaultStyle = this._defaultStyle;\n var useDefaultFill = false;\n var defaultLineWidth = 0;\n var textFill = getFill('fill' in tokenStyle ? tokenStyle.fill\n : 'fill' in style ? style.fill\n : (useDefaultFill = true, defaultStyle.fill));\n var textStroke = getStroke('stroke' in tokenStyle ? tokenStyle.stroke\n : 'stroke' in style ? style.stroke\n : (!bgColorDrawn\n && !parentBgColorDrawn\n && (!defaultStyle.autoStroke || useDefaultFill)) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke)\n : null);\n var hasShadow = tokenStyle.textShadowBlur > 0\n || style.textShadowBlur > 0;\n subElStyle.text = token.text;\n subElStyle.x = x;\n subElStyle.y = y;\n if (hasShadow) {\n subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;\n subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || 'transparent';\n subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;\n subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;\n }\n subElStyle.textAlign = textAlign;\n subElStyle.textBaseline = 'middle';\n subElStyle.font = token.font || DEFAULT_FONT;\n subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);\n setSeparateFont(subElStyle, tokenStyle);\n if (textStroke) {\n subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);\n subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);\n subElStyle.lineDashOffset = style.lineDashOffset || 0;\n subElStyle.stroke = textStroke;\n }\n if (textFill) {\n subElStyle.fill = textFill;\n }\n var textWidth = token.contentWidth;\n var textHeight = token.contentHeight;\n el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));\n };\n ZRText.prototype._renderBackground = function (style, topStyle, x, y, width, height) {\n var textBackgroundColor = style.backgroundColor;\n var textBorderWidth = style.borderWidth;\n var textBorderColor = style.borderColor;\n var isImageBg = textBackgroundColor && textBackgroundColor.image;\n var isPlainOrGradientBg = textBackgroundColor && !isImageBg;\n var textBorderRadius = style.borderRadius;\n var self = this;\n var rectEl;\n var imgEl;\n if (isPlainOrGradientBg || style.lineHeight || (textBorderWidth && textBorderColor)) {\n rectEl = this._getOrCreateChild(Rect);\n rectEl.useStyle(rectEl.createStyle());\n rectEl.style.fill = null;\n var rectShape = rectEl.shape;\n rectShape.x = x;\n rectShape.y = y;\n rectShape.width = width;\n rectShape.height = height;\n rectShape.r = textBorderRadius;\n rectEl.dirtyShape();\n }\n if (isPlainOrGradientBg) {\n var rectStyle = rectEl.style;\n rectStyle.fill = textBackgroundColor || null;\n rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);\n }\n else if (isImageBg) {\n imgEl = this._getOrCreateChild(ZRImage);\n imgEl.onload = function () {\n self.dirtyStyle();\n };\n var imgStyle = imgEl.style;\n imgStyle.image = textBackgroundColor.image;\n imgStyle.x = x;\n imgStyle.y = y;\n imgStyle.width = width;\n imgStyle.height = height;\n }\n if (textBorderWidth && textBorderColor) {\n var rectStyle = rectEl.style;\n rectStyle.lineWidth = textBorderWidth;\n rectStyle.stroke = textBorderColor;\n rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);\n rectStyle.lineDash = style.borderDash;\n rectStyle.lineDashOffset = style.borderDashOffset || 0;\n rectEl.strokeContainThreshold = 0;\n if (rectEl.hasFill() && rectEl.hasStroke()) {\n rectStyle.strokeFirst = true;\n rectStyle.lineWidth *= 2;\n }\n }\n var commonStyle = (rectEl || imgEl).style;\n commonStyle.shadowBlur = style.shadowBlur || 0;\n commonStyle.shadowColor = style.shadowColor || 'transparent';\n commonStyle.shadowOffsetX = style.shadowOffsetX || 0;\n commonStyle.shadowOffsetY = style.shadowOffsetY || 0;\n commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);\n };\n ZRText.makeFont = function (style) {\n var font = '';\n if (hasSeparateFont(style)) {\n font = [\n style.fontStyle,\n style.fontWeight,\n parseFontSize(style.fontSize),\n style.fontFamily || 'sans-serif'\n ].join(' ');\n }\n return font && trim(font) || style.textFont || style.font;\n };\n return ZRText;\n}(Displayable));\nvar VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };\nvar VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };\nvar FONT_PARTS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];\nexport function parseFontSize(fontSize) {\n if (typeof fontSize === 'string'\n && (fontSize.indexOf('px') !== -1\n || fontSize.indexOf('rem') !== -1\n || fontSize.indexOf('em') !== -1)) {\n return fontSize;\n }\n else if (!isNaN(+fontSize)) {\n return fontSize + 'px';\n }\n else {\n return DEFAULT_FONT_SIZE + 'px';\n }\n}\nfunction setSeparateFont(targetStyle, sourceStyle) {\n for (var i = 0; i < FONT_PARTS.length; i++) {\n var fontProp = FONT_PARTS[i];\n var val = sourceStyle[fontProp];\n if (val != null) {\n targetStyle[fontProp] = val;\n }\n }\n}\nexport function hasSeparateFont(style) {\n return style.fontSize != null || style.fontFamily || style.fontWeight;\n}\nexport function normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\nfunction normalizeStyle(style) {\n if (style) {\n style.font = ZRText.makeFont(style);\n var textAlign = style.align;\n textAlign === 'middle' && (textAlign = 'center');\n style.align = (textAlign == null || VALID_TEXT_ALIGN[textAlign]) ? textAlign : 'left';\n var verticalAlign = style.verticalAlign;\n verticalAlign === 'center' && (verticalAlign = 'middle');\n style.verticalAlign = (verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign]) ? verticalAlign : 'top';\n var textPadding = style.padding;\n if (textPadding) {\n style.padding = normalizeCssArray(style.padding);\n }\n }\n}\nfunction getStroke(stroke, lineWidth) {\n return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none')\n ? null\n : (stroke.image || stroke.colorStops)\n ? '#000'\n : stroke;\n}\nfunction getFill(fill) {\n return (fill == null || fill === 'none')\n ? null\n : (fill.image || fill.colorStops)\n ? '#000'\n : fill;\n}\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right'\n ? (x - textPadding[1])\n : textAlign === 'center'\n ? (x + textPadding[3] / 2 - textPadding[1] / 2)\n : (x + textPadding[3]);\n}\nfunction getStyleText(style) {\n var text = style.text;\n text != null && (text += '');\n return text;\n}\nfunction needDrawBackground(style) {\n return !!(style.backgroundColor\n || style.lineHeight\n || (style.borderWidth && style.borderColor));\n}\nexport default ZRText;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from './model.js';\nexport var getECData = makeInner();\nexport var setCommonECData = function (seriesIndex, dataType, dataIdx, el) {\n if (el) {\n var ecData = getECData(el); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n ecData.dataIndex = dataIdx;\n ecData.dataType = dataType;\n ecData.seriesIndex = seriesIndex; // TODO: not store dataIndex on children.\n\n if (el.type === 'group') {\n el.traverse(function (child) {\n var childECData = getECData(child);\n childECData.seriesIndex = seriesIndex;\n childECData.dataIndex = dataIdx;\n childECData.dataType = dataType;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { extend, indexOf, isArrayLike, isObject, keys, isArray, each, isString, isGradientObject, map } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport * as colorTool from 'zrender/lib/tool/color.js';\nimport { queryDataIndex, makeInner } from './model.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { error } from './log.js'; // Reserve 0 as default.\n\nvar _highlightNextDigit = 1;\nvar _highlightKeyMap = {};\nvar getSavedStates = makeInner();\nvar getComponentStates = makeInner();\nexport var HOVER_STATE_NORMAL = 0;\nexport var HOVER_STATE_BLUR = 1;\nexport var HOVER_STATE_EMPHASIS = 2;\nexport var SPECIAL_STATES = ['emphasis', 'blur', 'select'];\nexport var DISPLAY_STATES = ['normal', 'emphasis', 'blur', 'select'];\nexport var Z2_EMPHASIS_LIFT = 10;\nexport var Z2_SELECT_LIFT = 9;\nexport var HIGHLIGHT_ACTION_TYPE = 'highlight';\nexport var DOWNPLAY_ACTION_TYPE = 'downplay';\nexport var SELECT_ACTION_TYPE = 'select';\nexport var UNSELECT_ACTION_TYPE = 'unselect';\nexport var TOGGLE_SELECT_ACTION_TYPE = 'toggleSelect';\n\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n} // Most lifted color are duplicated.\n\n\nvar liftedColorCache = new LRU(100);\n\nfunction liftColor(color) {\n if (isString(color)) {\n var liftedColor = liftedColorCache.get(color);\n\n if (!liftedColor) {\n liftedColor = colorTool.lift(color, -0.1);\n liftedColorCache.put(color, liftedColor);\n }\n\n return liftedColor;\n } else if (isGradientObject(color)) {\n var ret = extend({}, color);\n ret.colorStops = map(color.colorStops, function (stop) {\n return {\n offset: stop.offset,\n color: colorTool.lift(stop.color, -0.1)\n };\n });\n return ret;\n } // Change nothing.\n\n\n return color;\n}\n\nfunction doChangeHoverState(el, stateName, hoverStateEnum) {\n if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {\n el.onHoverStateChange(stateName);\n }\n\n el.hoverState = hoverStateEnum;\n}\n\nfunction singleEnterEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n doChangeHoverState(el, 'emphasis', HOVER_STATE_EMPHASIS);\n}\n\nfunction singleLeaveEmphasis(el) {\n // Only mark the flag.\n // States will be applied in the echarts.ts in next frame.\n if (el.hoverState === HOVER_STATE_EMPHASIS) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterBlur(el) {\n doChangeHoverState(el, 'blur', HOVER_STATE_BLUR);\n}\n\nfunction singleLeaveBlur(el) {\n if (el.hoverState === HOVER_STATE_BLUR) {\n doChangeHoverState(el, 'normal', HOVER_STATE_NORMAL);\n }\n}\n\nfunction singleEnterSelect(el) {\n el.selected = true;\n}\n\nfunction singleLeaveSelect(el) {\n el.selected = false;\n}\n\nfunction updateElementState(el, updater, commonParam) {\n updater(el, commonParam);\n}\n\nfunction traverseUpdateState(el, updater, commonParam) {\n updateElementState(el, updater, commonParam);\n el.isGroup && el.traverse(function (child) {\n updateElementState(child, updater, commonParam);\n });\n}\n\nexport function setStatesFlag(el, stateName) {\n switch (stateName) {\n case 'emphasis':\n el.hoverState = HOVER_STATE_EMPHASIS;\n break;\n\n case 'normal':\n el.hoverState = HOVER_STATE_NORMAL;\n break;\n\n case 'blur':\n el.hoverState = HOVER_STATE_BLUR;\n break;\n\n case 'select':\n el.selected = true;\n }\n}\n/**\r\n * If we reuse elements when rerender.\r\n * DON'T forget to clearStates before we update the style and shape.\r\n * Or we may update on the wrong state instead of normal state.\r\n */\n\nexport function clearStates(el) {\n if (el.isGroup) {\n el.traverse(function (child) {\n child.clearStates();\n });\n } else {\n el.clearStates();\n }\n}\n\nfunction getFromStateStyle(el, props, toStateName, defaultValue) {\n var style = el.style;\n var fromState = {};\n\n for (var i = 0; i < props.length; i++) {\n var propName = props[i];\n var val = style[propName];\n fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.__fromStateTransition // Don't consider the animation to emphasis state.\n && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === 'style') {\n animator.saveTo(fromState, props);\n }\n }\n\n return fromState;\n}\n\nfunction createEmphasisDefaultState(el, stateName, targetStates, state) {\n var hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;\n var cloned = false;\n\n if (el instanceof Path) {\n var store = getSavedStates(el);\n var fromFill = hasSelect ? store.selectFill || store.normalFill : store.normalFill;\n var fromStroke = hasSelect ? store.selectStroke || store.normalStroke : store.normalStroke;\n\n if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {\n state = state || {};\n var emphasisStyle = state.style || {}; // inherit case\n\n if (emphasisStyle.fill === 'inherit') {\n cloned = true;\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n emphasisStyle.fill = fromFill;\n } // Apply default color lift\n else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {\n cloned = true; // Not modify the original value.\n\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle); // Already being applied 'emphasis'. DON'T lift color multiple times.\n\n emphasisStyle.fill = liftColor(fromFill);\n } // Not highlight stroke if fill has been highlighted.\n else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {\n if (!cloned) {\n state = extend({}, state);\n emphasisStyle = extend({}, emphasisStyle);\n }\n\n emphasisStyle.stroke = liftColor(fromStroke);\n }\n\n state.style = emphasisStyle;\n }\n }\n\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n if (!cloned) {\n state = extend({}, state);\n }\n\n var z2EmphasisLift = el.z2EmphasisLift;\n state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createSelectDefaultState(el, stateName, state) {\n // const hasSelect = indexOf(el.currentStates, stateName) >= 0;\n if (state) {\n // TODO Share with textContent?\n if (state.z2 == null) {\n state = extend({}, state);\n var z2SelectLift = el.z2SelectLift;\n state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);\n }\n }\n\n return state;\n}\n\nfunction createBlurDefaultState(el, stateName, state) {\n var hasBlur = indexOf(el.currentStates, stateName) >= 0;\n var currentOpacity = el.style.opacity;\n var fromState = !hasBlur ? getFromStateStyle(el, ['opacity'], stateName, {\n opacity: 1\n }) : null;\n state = state || {};\n var blurStyle = state.style || {};\n\n if (blurStyle.opacity == null) {\n // clone state\n state = extend({}, state);\n blurStyle = extend({\n // Already being applied 'emphasis'. DON'T mul opacity multiple times.\n opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1\n }, blurStyle);\n state.style = blurStyle;\n }\n\n return state;\n}\n\nfunction elementStateProxy(stateName, targetStates) {\n var state = this.states[stateName];\n\n if (this.style) {\n if (stateName === 'emphasis') {\n return createEmphasisDefaultState(this, stateName, targetStates, state);\n } else if (stateName === 'blur') {\n return createBlurDefaultState(this, stateName, state);\n } else if (stateName === 'select') {\n return createSelectDefaultState(this, stateName, state);\n }\n }\n\n return state;\n}\n/**\r\n * Set hover style (namely \"emphasis style\") of element.\r\n * @param el Should not be `zrender/graphic/Group`.\r\n * @param focus 'self' | 'selfInSeries' | 'series'\r\n */\n\n\nexport function setDefaultStateProxy(el) {\n el.stateProxy = elementStateProxy;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (textContent) {\n textContent.stateProxy = elementStateProxy;\n }\n\n if (textGuide) {\n textGuide.stateProxy = elementStateProxy;\n }\n}\nexport function enterEmphasisWhenMouseOver(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasisWhenMouseOut(el, e) {\n !shouldSilent(el, e) // \"emphasis\" event highlight has higher priority than mouse highlight.\n && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterEmphasis(el, highlightDigit) {\n el.__highByOuter |= 1 << (highlightDigit || 0);\n traverseUpdateState(el, singleEnterEmphasis);\n}\nexport function leaveEmphasis(el, highlightDigit) {\n !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);\n}\nexport function enterBlur(el) {\n traverseUpdateState(el, singleEnterBlur);\n}\nexport function leaveBlur(el) {\n traverseUpdateState(el, singleLeaveBlur);\n}\nexport function enterSelect(el) {\n traverseUpdateState(el, singleEnterSelect);\n}\nexport function leaveSelect(el) {\n traverseUpdateState(el, singleLeaveSelect);\n}\n\nfunction shouldSilent(el, e) {\n return el.__highDownSilentOnTouch && e.zrByTouch;\n}\n\nexport function allLeaveBlur(api) {\n var model = api.getModel();\n var leaveBlurredSeries = [];\n var allComponentViews = [];\n model.eachComponent(function (componentType, componentModel) {\n var componentStates = getComponentStates(componentModel);\n var isSeries = componentType === 'series';\n var view = isSeries ? api.getViewOfSeriesModel(componentModel) : api.getViewOfComponentModel(componentModel);\n !isSeries && allComponentViews.push(view);\n\n if (componentStates.isBlured) {\n // Leave blur anyway\n view.group.traverse(function (child) {\n singleLeaveBlur(child);\n });\n isSeries && leaveBlurredSeries.push(componentModel);\n }\n\n componentStates.isBlured = false;\n });\n each(allComponentViews, function (view) {\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(leaveBlurredSeries, false, model);\n }\n });\n}\nexport function blurSeries(targetSeriesIndex, focus, blurScope, api) {\n var ecModel = api.getModel();\n blurScope = blurScope || 'coordinateSystem';\n\n function leaveBlurOfIndices(data, dataIndices) {\n for (var i = 0; i < dataIndices.length; i++) {\n var itemEl = data.getItemGraphicEl(dataIndices[i]);\n itemEl && leaveBlur(itemEl);\n }\n }\n\n if (targetSeriesIndex == null) {\n return;\n }\n\n if (!focus || focus === 'none') {\n return;\n }\n\n var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);\n var targetCoordSys = targetSeriesModel.coordinateSystem;\n\n if (targetCoordSys && targetCoordSys.master) {\n targetCoordSys = targetCoordSys.master;\n }\n\n var blurredSeries = [];\n ecModel.eachSeries(function (seriesModel) {\n var sameSeries = targetSeriesModel === seriesModel;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.master) {\n coordSys = coordSys.master;\n }\n\n var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries; // If there is no coordinate system. use sameSeries instead.\n\n if (!( // Not blur other series if blurScope series\n blurScope === 'series' && !sameSeries // Not blur other coordinate system if blurScope is coordinateSystem\n || blurScope === 'coordinateSystem' && !sameCoordSys // Not blur self series if focus is series.\n || focus === 'series' && sameSeries // TODO blurScope: coordinate system\n )) {\n var view = api.getViewOfSeriesModel(seriesModel);\n view.group.traverse(function (child) {\n // For the elements that have been triggered by other components,\n // and are still required to be highlighted,\n // because the current is directly forced to blur the element,\n // it will cause the focus self to be unable to highlight, so skip the blur of this element.\n if (child.__highByOuter && sameSeries && focus === 'self') {\n return;\n }\n\n singleEnterBlur(child);\n });\n\n if (isArrayLike(focus)) {\n leaveBlurOfIndices(seriesModel.getData(), focus);\n } else if (isObject(focus)) {\n var dataTypes = keys(focus);\n\n for (var d = 0; d < dataTypes.length; d++) {\n leaveBlurOfIndices(seriesModel.getData(dataTypes[d]), focus[dataTypes[d]]);\n }\n }\n\n blurredSeries.push(seriesModel);\n getComponentStates(seriesModel).isBlured = true;\n }\n });\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (view && view.toggleBlurSeries) {\n view.toggleBlurSeries(blurredSeries, true, ecModel);\n }\n });\n}\nexport function blurComponent(componentMainType, componentIndex, api) {\n if (componentMainType == null || componentIndex == null) {\n return;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return;\n }\n\n getComponentStates(componentModel).isBlured = true;\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.focusBlurEnabled) {\n return;\n }\n\n view.group.traverse(function (child) {\n singleEnterBlur(child);\n });\n}\nexport function blurSeriesFromHighlightPayload(seriesModel, payload, api) {\n var seriesIndex = seriesModel.seriesIndex;\n var data = seriesModel.getData(payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n var dataIndex = queryDataIndex(data, payload); // Pick the first one if there is multiple/none exists.\n\n dataIndex = (isArray(dataIndex) ? dataIndex[0] : dataIndex) || 0;\n var el = data.getItemGraphicEl(dataIndex);\n\n if (!el) {\n var count = data.count();\n var current = 0; // If data on dataIndex is NaN.\n\n while (!el && current < count) {\n el = data.getItemGraphicEl(current++);\n }\n }\n\n if (el) {\n var ecData = getECData(el);\n blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api);\n } else {\n // If there is no element put on the data. Try getting it from raw option\n // TODO Should put it on seriesModel?\n var focus_1 = seriesModel.get(['emphasis', 'focus']);\n var blurScope = seriesModel.get(['emphasis', 'blurScope']);\n\n if (focus_1 != null) {\n blurSeries(seriesIndex, focus_1, blurScope, api);\n }\n }\n}\nexport function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api) {\n var ret = {\n focusSelf: false,\n dispatchers: null\n };\n\n if (componentMainType == null || componentMainType === 'series' || componentIndex == null || name == null) {\n return ret;\n }\n\n var componentModel = api.getModel().getComponent(componentMainType, componentIndex);\n\n if (!componentModel) {\n return ret;\n }\n\n var view = api.getViewOfComponentModel(componentModel);\n\n if (!view || !view.findHighDownDispatchers) {\n return ret;\n }\n\n var dispatchers = view.findHighDownDispatchers(name); // At presnet, the component (like Geo) only blur inside itself.\n // So we do not use `blurScope` in component.\n\n var focusSelf;\n\n for (var i = 0; i < dispatchers.length; i++) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatchers[i])) {\n error('param should be highDownDispatcher');\n }\n\n if (getECData(dispatchers[i]).focus === 'self') {\n focusSelf = true;\n break;\n }\n }\n\n return {\n focusSelf: focusSelf,\n dispatchers: dispatchers\n };\n}\nexport function handleGlobalMouseOverForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n var ecData = getECData(dispatcher);\n\n var _a = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api),\n dispatchers = _a.dispatchers,\n focusSelf = _a.focusSelf; // If `findHighDownDispatchers` is supported on the component,\n // highlight/downplay elements with the same name.\n\n\n if (dispatchers) {\n if (focusSelf) {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n }\n\n each(dispatchers, function (dispatcher) {\n return enterEmphasisWhenMouseOver(dispatcher, e);\n });\n } else {\n // Try blur all in the related series. Then emphasis the hoverred.\n // TODO. progressive mode.\n blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api);\n\n if (ecData.focus === 'self') {\n blurComponent(ecData.componentMainType, ecData.componentIndex, api);\n } // Other than series, component that not support `findHighDownDispatcher` will\n // also use it. But in this case, highlight/downplay are only supported in\n // mouse hover but not in dispatchAction.\n\n\n enterEmphasisWhenMouseOver(dispatcher, e);\n }\n}\nexport function handleGlobalMouseOutForHighDown(dispatcher, e, api) {\n if (process.env.NODE_ENV !== 'production' && !isHighDownDispatcher(dispatcher)) {\n error('param should be highDownDispatcher');\n }\n\n allLeaveBlur(api);\n var ecData = getECData(dispatcher);\n var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api).dispatchers;\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n return leaveEmphasisWhenMouseOut(dispatcher, e);\n });\n } else {\n leaveEmphasisWhenMouseOut(dispatcher, e);\n }\n}\nexport function toggleSelectionFromPayload(seriesModel, payload, api) {\n if (!isSelectChangePayload(payload)) {\n return;\n }\n\n var dataType = payload.dataType;\n var data = seriesModel.getData(dataType);\n var dataIndex = queryDataIndex(data, payload);\n\n if (!isArray(dataIndex)) {\n dataIndex = [dataIndex];\n }\n\n seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? 'toggleSelect' : payload.type === SELECT_ACTION_TYPE ? 'select' : 'unselect'](dataIndex, dataType);\n}\nexport function updateSeriesElementSelection(seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n data.eachItemGraphicEl(function (el, idx) {\n seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);\n });\n });\n}\nexport function getAllSelectedIndices(ecModel) {\n var ret = [];\n ecModel.eachSeries(function (seriesModel) {\n var allData = seriesModel.getAllData();\n each(allData, function (_a) {\n var data = _a.data,\n type = _a.type;\n var dataIndices = seriesModel.getSelectedDataIndices();\n\n if (dataIndices.length > 0) {\n var item = {\n dataIndex: dataIndices,\n seriesIndex: seriesModel.seriesIndex\n };\n\n if (type != null) {\n item.dataType = type;\n }\n\n ret.push(item);\n }\n });\n });\n return ret;\n}\n/**\r\n * Enable the function that mouseover will trigger the emphasis state.\r\n *\r\n * NOTE:\r\n * This function should be used on the element with dataIndex, seriesIndex.\r\n *\r\n */\n\nexport function enableHoverEmphasis(el, focus, blurScope) {\n setAsHighDownDispatcher(el, true);\n traverseUpdateState(el, setDefaultStateProxy);\n enableHoverFocus(el, focus, blurScope);\n}\nexport function disableHoverEmphasis(el) {\n setAsHighDownDispatcher(el, false);\n}\nexport function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {\n isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope);\n}\nexport function enableHoverFocus(el, focus, blurScope) {\n var ecData = getECData(el);\n\n if (focus != null) {\n // TODO dataIndex may be set after this function. This check is not useful.\n // if (ecData.dataIndex == null) {\n // if (__DEV__) {\n // console.warn('focus can only been set on element with dataIndex');\n // }\n // }\n // else {\n ecData.focus = focus;\n ecData.blurScope = blurScope; // }\n } else if (ecData.focus) {\n ecData.focus = null;\n }\n}\nvar OTHER_STATES = ['emphasis', 'blur', 'select'];\nvar defaultStyleGetterMap = {\n itemStyle: 'getItemStyle',\n lineStyle: 'getLineStyle',\n areaStyle: 'getAreaStyle'\n};\n/**\r\n * Set emphasis/blur/selected states of element.\r\n */\n\nexport function setStatesStylesFromModel(el, itemModel, styleType, // default itemStyle\ngetter) {\n styleType = styleType || 'itemStyle';\n\n for (var i = 0; i < OTHER_STATES.length; i++) {\n var stateName = OTHER_STATES[i];\n var model = itemModel.getModel([stateName, styleType]);\n var state = el.ensureState(stateName); // Let it throw error if getterType is not found.\n\n state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType]]();\n }\n}\n/**\r\n *\r\n * Set element as highlight / downplay dispatcher.\r\n * It will be checked when element received mouseover event or from highlight action.\r\n * It's in change of all highlight/downplay behavior of it's children.\r\n *\r\n * @param el\r\n * @param el.highDownSilentOnTouch\r\n * In touch device, mouseover event will be trigger on touchstart event\r\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\r\n * conveniently use hoverStyle when tap on touch screen without additional\r\n * code for compatibility.\r\n * But if the chart/component has select feature, which usually also use\r\n * hoverStyle, there might be conflict between 'select-highlight' and\r\n * 'hover-highlight' especially when roam is enabled (see geo for example).\r\n * In this case, `highDownSilentOnTouch` should be used to disable\r\n * hover-highlight on touch device.\r\n * @param asDispatcher If `false`, do not set as \"highDownDispatcher\".\r\n */\n\nexport function setAsHighDownDispatcher(el, asDispatcher) {\n var disable = asDispatcher === false;\n var extendedEl = el; // Make `highDownSilentOnTouch` and `onStateChange` only work after\n // `setAsHighDownDispatcher` called. Avoid it is modified by user unexpectedly.\n\n if (el.highDownSilentOnTouch) {\n extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;\n } // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n\n if (!disable || extendedEl.__highDownDispatcher) {\n // Emphasis, normal can be triggered manually by API or other components like hover link.\n // el[method]('emphasis', onElementEmphasisEvent)[method]('normal', onElementNormalEvent);\n // Also keep previous record.\n extendedEl.__highByOuter = extendedEl.__highByOuter || 0;\n extendedEl.__highDownDispatcher = !disable;\n }\n}\nexport function isHighDownDispatcher(el) {\n return !!(el && el.__highDownDispatcher);\n}\n/**\r\n * Enable component highlight/downplay features:\r\n * + hover link (within the same name)\r\n * + focus blur in component\r\n */\n\nexport function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {\n var ecData = getECData(el);\n ecData.componentMainType = componentModel.mainType;\n ecData.componentIndex = componentModel.componentIndex;\n ecData.componentHighDownName = componentHighDownName;\n}\n/**\r\n * Support highlight/downplay record on each elements.\r\n * For the case: hover highlight/downplay (legend, visualMap, ...) and\r\n * user triggered highlight/downplay should not conflict.\r\n * Only all of the highlightDigit cleared, return to normal.\r\n * @param {string} highlightKey\r\n * @return {number} highlightDigit\r\n */\n\nexport function getHighlightDigit(highlightKey) {\n var highlightDigit = _highlightKeyMap[highlightKey];\n\n if (highlightDigit == null && _highlightNextDigit <= 32) {\n highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;\n }\n\n return highlightDigit;\n}\nexport function isSelectChangePayload(payload) {\n var payloadType = payload.type;\n return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;\n}\nexport function isHighDownPayload(payload) {\n var payloadType = payload.type;\n return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;\n}\nexport function savePathStates(el) {\n var store = getSavedStates(el);\n store.normalFill = el.style.fill;\n store.normalStroke = el.style.stroke;\n var selectState = el.states.select || {};\n store.selectFill = selectState.style && selectState.style.fill || null;\n store.selectStroke = selectState.style && selectState.style.stroke || null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js'; // Stored properties for further transition.\n\nexport var transitionStore = makeInner();\n/**\r\n * Return null if animation is disabled.\r\n */\n\nexport function getAnimationConfig(animationType, animatableModel, dataIndex, // Extra opts can override the option in animatable model.\nextraOpts, // TODO It's only for pictorial bar now.\nextraDelayParams) {\n var animationPayload; // Check if there is global animation configuration from dataZoom/resize can override the config in option.\n // If animation is enabled. Will use this animation config in payload.\n // If animation is disabled. Just ignore it.\n\n if (animatableModel && animatableModel.ecModel) {\n var updatePayload = animatableModel.ecModel.getUpdatePayload();\n animationPayload = updatePayload && updatePayload.animation;\n }\n\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n var isUpdate = animationType === 'update';\n\n if (animationEnabled) {\n var duration = void 0;\n var easing = void 0;\n var delay = void 0;\n\n if (extraOpts) {\n duration = retrieve2(extraOpts.duration, 200);\n easing = retrieve2(extraOpts.easing, 'cubicOut');\n delay = 0;\n } else {\n duration = animatableModel.getShallow(isUpdate ? 'animationDurationUpdate' : 'animationDuration');\n easing = animatableModel.getShallow(isUpdate ? 'animationEasingUpdate' : 'animationEasing');\n delay = animatableModel.getShallow(isUpdate ? 'animationDelayUpdate' : 'animationDelay');\n } // animation from payload has highest priority.\n\n\n if (animationPayload) {\n animationPayload.duration != null && (duration = animationPayload.duration);\n animationPayload.easing != null && (easing = animationPayload.easing);\n animationPayload.delay != null && (delay = animationPayload.delay);\n }\n\n if (isFunction(delay)) {\n delay = delay(dataIndex, extraDelayParams);\n }\n\n if (isFunction(duration)) {\n duration = duration(dataIndex);\n }\n\n var config = {\n duration: duration || 0,\n delay: delay,\n easing: easing\n };\n return config;\n } else {\n return null;\n }\n}\n\nfunction animateOrSetProps(animationType, el, props, animatableModel, dataIndex, cb, during) {\n var isFrom = false;\n var removeOpt;\n\n if (isFunction(dataIndex)) {\n during = cb;\n cb = dataIndex;\n dataIndex = null;\n } else if (isObject(dataIndex)) {\n cb = dataIndex.cb;\n during = dataIndex.during;\n isFrom = dataIndex.isFrom;\n removeOpt = dataIndex.removeOpt;\n dataIndex = dataIndex.dataIndex;\n }\n\n var isRemove = animationType === 'leave';\n\n if (!isRemove) {\n // Must stop the remove animation.\n el.stopAnimation('leave');\n }\n\n var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n\n if (animationConfig && animationConfig.duration > 0) {\n var duration = animationConfig.duration;\n var animationDelay = animationConfig.delay;\n var animationEasing = animationConfig.easing;\n var animateConfig = {\n duration: duration,\n delay: animationDelay || 0,\n easing: animationEasing,\n done: cb,\n force: !!cb || !!during,\n // Set to final state in update/init animation.\n // So the post processing based on the path shape can be done correctly.\n setToFinal: !isRemove,\n scope: animationType,\n during: during\n };\n isFrom ? el.animateFrom(props, animateConfig) : el.animateTo(props, animateConfig);\n } else {\n el.stopAnimation(); // If `isFrom`, the props is the \"from\" props.\n\n !isFrom && el.attr(props); // Call during at least once.\n\n during && during(1);\n cb && cb();\n }\n}\n/**\r\n * Update graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n * @example\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\r\n * // Or\r\n * graphic.updateProps(el, {\r\n * position: [100, 100]\r\n * }, seriesModel, function () { console.log('Animation done!'); });\r\n */\n\n\nfunction updateProps(el, props, // TODO: TYPE AnimatableModel\nanimatableModel, dataIndex, cb, during) {\n animateOrSetProps('update', el, props, animatableModel, dataIndex, cb, during);\n}\n\nexport { updateProps };\n/**\r\n * Init graphic element properties with or without animation according to the\r\n * configuration in series.\r\n *\r\n * Caution: this method will stop previous animation.\r\n * So do not use this method to one element twice before\r\n * animation starts, unless you know what you are doing.\r\n */\n\nexport function initProps(el, props, animatableModel, dataIndex, cb, during) {\n animateOrSetProps('enter', el, props, animatableModel, dataIndex, cb, during);\n}\n/**\r\n * If element is removed.\r\n * It can determine if element is having remove animation.\r\n */\n\nexport function isElementRemoved(el) {\n if (!el.__zr) {\n return true;\n }\n\n for (var i = 0; i < el.animators.length; i++) {\n var animator = el.animators[i];\n\n if (animator.scope === 'leave') {\n return true;\n }\n }\n\n return false;\n}\n/**\r\n * Remove graphic element\r\n */\n\nexport function removeElement(el, props, animatableModel, dataIndex, cb, during) {\n // Don't do remove animation twice.\n if (isElementRemoved(el)) {\n return;\n }\n\n animateOrSetProps('leave', el, props, animatableModel, dataIndex, cb, during);\n}\n\nfunction fadeOutDisplayable(el, animatableModel, dataIndex, done) {\n el.removeTextContent();\n el.removeTextGuideLine();\n removeElement(el, {\n style: {\n opacity: 0\n }\n }, animatableModel, dataIndex, done);\n}\n\nexport function removeElementWithFadeOut(el, animatableModel, dataIndex) {\n function doRemove() {\n el.parent && el.parent.remove(el);\n } // Hide label and labelLine first\n // TODO Also use fade out animation?\n\n\n if (!el.isGroup) {\n fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);\n } else {\n el.traverse(function (disp) {\n if (!disp.isGroup) {\n // Can invoke doRemove multiple times.\n fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);\n }\n });\n }\n}\n/**\r\n * Save old style for style transition in universalTransition module.\r\n * It's used when element will be reused in each render.\r\n * For chart like map, heatmap, which will always create new element.\r\n * We don't need to save this because universalTransition can get old style from the old element\r\n */\n\nexport function saveOldStyle(el) {\n transitionStore(el).oldStyle = el.style;\n}\nexport function getOldStyle(el) {\n return transitionStore(el).oldStyle;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { isFunction, retrieve2, extend, keys, trim } from 'zrender/lib/core/util.js';\nimport { SPECIAL_STATES, DISPLAY_STATES } from '../util/states.js';\nimport { deprecateReplaceLog } from '../util/log.js';\nimport { makeInner, interpolateRawValues } from '../util/model.js';\nimport { initProps, updateProps } from '../util/graphic.js';\nvar EMPTY_OBJ = {};\nexport function setLabelText(label, labelTexts) {\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var text = labelTexts[stateName];\n var state = label.ensureState(stateName);\n state.style = state.style || {};\n state.style.text = text;\n }\n\n var oldStates = label.currentStates.slice();\n label.clearStates(true);\n label.setStyle({\n text: labelTexts.normal\n });\n label.useStates(oldStates, true);\n}\n\nfunction getLabelText(opt, stateModels, interpolatedValue) {\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex;\n var normalModel = stateModels.normal;\n var baseText;\n\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex, normalModel && normalModel.get('formatter'), interpolatedValue != null ? {\n interpolatedValue: interpolatedValue\n } : null);\n }\n\n if (baseText == null) {\n baseText = isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;\n }\n\n var statesText = {\n normal: baseText\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = stateModels[stateName];\n statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get('formatter')) : null, baseText);\n }\n\n return statesText;\n}\n\nfunction setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified // TODO specified position?\n) {\n opt = opt || EMPTY_OBJ;\n var isSetOnText = targetEl instanceof ZRText;\n var needsCreateText = false;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateModel = labelStatesModels[DISPLAY_STATES[i]];\n\n if (stateModel && stateModel.getShallow('show')) {\n needsCreateText = true;\n break;\n }\n }\n\n var textContent = isSetOnText ? targetEl : targetEl.getTextContent();\n\n if (needsCreateText) {\n if (!isSetOnText) {\n // Reuse the previous\n if (!textContent) {\n textContent = new ZRText();\n targetEl.setTextContent(textContent);\n } // Use same state proxy\n\n\n if (targetEl.stateProxy) {\n textContent.stateProxy = targetEl.stateProxy;\n }\n }\n\n var labelStatesTexts = getLabelText(opt, labelStatesModels);\n var normalModel = labelStatesModels.normal;\n var showNormal = !!normalModel.getShallow('show');\n var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);\n normalStyle.text = labelStatesTexts.normal;\n\n if (!isSetOnText) {\n // Always create new\n targetEl.setTextConfig(createTextConfig(normalModel, opt, false));\n }\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var stateModel = labelStatesModels[stateName];\n\n if (stateModel) {\n var stateObj = textContent.ensureState(stateName);\n var stateShow = !!retrieve2(stateModel.getShallow('show'), showNormal);\n\n if (stateShow !== showNormal) {\n stateObj.ignore = !stateShow;\n }\n\n stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);\n stateObj.style.text = labelStatesTexts[stateName];\n\n if (!isSetOnText) {\n var targetElEmphasisState = targetEl.ensureState(stateName);\n targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);\n }\n }\n } // PENDING: if there is many requirements that emphasis position\n // need to be different from normal position, we might consider\n // auto silent is those cases.\n\n\n textContent.silent = !!normalModel.getShallow('silent'); // Keep x and y\n\n if (textContent.style.x != null) {\n normalStyle.x = textContent.style.x;\n }\n\n if (textContent.style.y != null) {\n normalStyle.y = textContent.style.y;\n }\n\n textContent.ignore = !showNormal; // Always create new style.\n\n textContent.useStyle(normalStyle);\n textContent.dirty();\n\n if (opt.enableTextSetter) {\n labelInner(textContent).setLabelText = function (interpolatedValue) {\n var labelStatesTexts = getLabelText(opt, labelStatesModels, interpolatedValue);\n setLabelText(textContent, labelStatesTexts);\n };\n }\n } else if (textContent) {\n // Not display rich text.\n textContent.ignore = true;\n }\n\n targetEl.dirty();\n}\n\nexport { setLabelStyle };\nexport function getLabelStatesModels(itemModel, labelName) {\n labelName = labelName || 'label';\n var statesModels = {\n normal: itemModel.getModel(labelName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelName]);\n }\n\n return statesModels;\n}\n/**\r\n * Set basic textStyle properties.\r\n */\n\nexport function createTextStyle(textStyleModel, specifiedTextStyle, // Fixed style in the code. Can't be set by model.\nopt, isNotNormal, isAttached // If text is attached on an element. If so, auto color will handling in zrender.\n) {\n var textStyle = {};\n setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);\n specifiedTextStyle && extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}\nexport function createTextConfig(textStyleModel, opt, isNotNormal) {\n opt = opt || {};\n var textConfig = {};\n var labelPosition;\n var labelRotate = textStyleModel.getShallow('rotate');\n var labelDistance = retrieve2(textStyleModel.getShallow('distance'), isNotNormal ? null : 5);\n var labelOffset = textStyleModel.getShallow('offset');\n labelPosition = textStyleModel.getShallow('position') || (isNotNormal ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n\n labelPosition === 'outside' && (labelPosition = opt.defaultOutsidePosition || 'top');\n\n if (labelPosition != null) {\n textConfig.position = labelPosition;\n }\n\n if (labelOffset != null) {\n textConfig.offset = labelOffset;\n }\n\n if (labelRotate != null) {\n labelRotate *= Math.PI / 180;\n textConfig.rotation = labelRotate;\n }\n\n if (labelDistance != null) {\n textConfig.distance = labelDistance;\n } // fill and auto is determined by the color of path fill if it's not specified by developers.\n\n\n textConfig.outsideFill = textStyleModel.get('color') === 'inherit' ? opt.inheritColor || null : 'auto';\n return textConfig;\n}\n/**\r\n * The uniform entry of set text style, that is, retrieve style definitions\r\n * from `model` and set to `textStyle` object.\r\n *\r\n * Never in merge mode, but in overwrite mode, that is, all of the text style\r\n * properties will be set. (Consider the states of normal and emphasis and\r\n * default value can be adopted, merge would make the logic too complicated\r\n * to manage.)\r\n */\n\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\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_1 in richItemNames) {\n if (richItemNames.hasOwnProperty(name_1)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name_1]); // In rich, never `disableBox`.\n // FIXME: consider `label: {formatter: '{a|xx}', color: 'blue', rich: {a: {}}}`,\n // the default color `'blue'` will not be adopted if no color declared in `rich`.\n // That might confuses users. So probably we should put `textStyleModel` as the\n // root ancestor of the `richTextStyle`. But that would be a break change.\n\n setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);\n }\n }\n }\n\n if (richResult) {\n textStyle.rich = richResult;\n }\n\n var overflow = textStyleModel.get('overflow');\n\n if (overflow) {\n textStyle.overflow = overflow;\n }\n\n var margin = textStyleModel.get('minMargin');\n\n if (margin != null) {\n textStyle.margin = margin;\n }\n\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);\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// TODO TextStyleModel\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 var richKeys = keys(rich);\n\n for (var i = 0; i < richKeys.length; i++) {\n var richKey = richKeys[i];\n richItemNameMap[richKey] = 1;\n }\n }\n\n textStyleModel = textStyleModel.parentModel;\n }\n\n return richItemNameMap;\n}\n\nvar TEXT_PROPS_WITH_GLOBAL = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'];\nvar TEXT_PROPS_SELF = ['align', 'lineHeight', 'width', 'height', 'tag', 'verticalAlign', 'ellipsis'];\nvar TEXT_PROPS_BOX = ['padding', 'borderWidth', 'borderRadius', 'borderDashOffset', 'backgroundColor', 'borderColor', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\n\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;\n var inheritColor = opt && opt.inheritColor;\n var fillColor = textStyleModel.getShallow('color');\n var strokeColor = textStyleModel.getShallow('textBorderColor');\n var opacity = retrieve2(textStyleModel.getShallow('opacity'), globalTextStyle.opacity);\n\n if (fillColor === 'inherit' || fillColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (fillColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n fillColor = inheritColor;\n } else {\n fillColor = null;\n }\n }\n\n if (strokeColor === 'inherit' || strokeColor === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n if (strokeColor === 'auto') {\n deprecateReplaceLog('color: \\'auto\\'', 'color: \\'inherit\\'');\n }\n }\n\n if (inheritColor) {\n strokeColor = inheritColor;\n } else {\n strokeColor = null;\n }\n }\n\n if (!isAttached) {\n // Only use default global textStyle.color if text is individual.\n // Otherwise it will use the strategy of attached text color because text may be on a path.\n fillColor = fillColor || globalTextStyle.color;\n strokeColor = strokeColor || globalTextStyle.textBorderColor;\n }\n\n if (fillColor != null) {\n textStyle.fill = fillColor;\n }\n\n if (strokeColor != null) {\n textStyle.stroke = strokeColor;\n }\n\n var textBorderWidth = retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth);\n\n if (textBorderWidth != null) {\n textStyle.lineWidth = textBorderWidth;\n }\n\n var textBorderType = retrieve2(textStyleModel.getShallow('textBorderType'), globalTextStyle.textBorderType);\n\n if (textBorderType != null) {\n textStyle.lineDash = textBorderType;\n }\n\n var textBorderDashOffset = retrieve2(textStyleModel.getShallow('textBorderDashOffset'), globalTextStyle.textBorderDashOffset);\n\n if (textBorderDashOffset != null) {\n textStyle.lineDashOffset = textBorderDashOffset;\n }\n\n if (!isNotNormal && opacity == null && !inRich) {\n opacity = opt && opt.defaultOpacity;\n }\n\n if (opacity != null) {\n textStyle.opacity = opacity;\n } // TODO\n\n\n if (!isNotNormal && !isAttached) {\n // Set default finally.\n if (textStyle.fill == null && opt.inheritColor) {\n textStyle.fill = opt.inheritColor;\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 for (var i = 0; i < TEXT_PROPS_WITH_GLOBAL.length; i++) {\n var key = TEXT_PROPS_WITH_GLOBAL[i];\n var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n for (var i = 0; i < TEXT_PROPS_SELF.length; i++) {\n var key = TEXT_PROPS_SELF[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n if (textStyle.verticalAlign == null) {\n var baseline = textStyleModel.getShallow('baseline');\n\n if (baseline != null) {\n textStyle.verticalAlign = baseline;\n }\n }\n\n if (!isBlock || !opt.disableBox) {\n for (var i = 0; i < TEXT_PROPS_BOX.length; i++) {\n var key = TEXT_PROPS_BOX[i];\n var val = textStyleModel.getShallow(key);\n\n if (val != null) {\n textStyle[key] = val;\n }\n }\n\n var borderType = textStyleModel.getShallow('borderType');\n\n if (borderType != null) {\n textStyle.borderDash = borderType;\n }\n\n if ((textStyle.backgroundColor === 'auto' || textStyle.backgroundColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.backgroundColor === 'auto') {\n deprecateReplaceLog('backgroundColor: \\'auto\\'', 'backgroundColor: \\'inherit\\'');\n }\n }\n\n textStyle.backgroundColor = inheritColor;\n }\n\n if ((textStyle.borderColor === 'auto' || textStyle.borderColor === 'inherit') && inheritColor) {\n if (process.env.NODE_ENV !== 'production') {\n if (textStyle.borderColor === 'auto') {\n deprecateReplaceLog('borderColor: \\'auto\\'', 'borderColor: \\'inherit\\'');\n }\n }\n\n textStyle.borderColor = inheritColor;\n }\n }\n}\n\nexport function getFont(opt, ecModel) {\n var gTextStyleModel = ecModel && ecModel.getModel('textStyle');\n return 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}\nexport var labelInner = makeInner();\nexport function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {\n if (!label) {\n return;\n }\n\n var obj = labelInner(label);\n obj.prevValue = obj.value;\n obj.value = value;\n var normalLabelModel = labelStatesModels.normal;\n obj.valueAnimation = normalLabelModel.get('valueAnimation');\n\n if (obj.valueAnimation) {\n obj.precision = normalLabelModel.get('precision');\n obj.defaultInterpolatedText = getDefaultText;\n obj.statesModels = labelStatesModels;\n }\n}\nexport function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {\n var labelInnerStore = labelInner(textEl);\n\n if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {\n // Value not changed, no new label animation\n return;\n }\n\n var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText; // Consider the case that being animating, do not use the `obj.value`,\n // Otherwise it will jump to the `obj.value` when this new animation started.\n\n var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);\n var targetValue = labelInnerStore.value;\n\n function during(percent) {\n var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);\n labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;\n var labelText = getLabelText({\n labelDataIndex: dataIndex,\n labelFetcher: labelFetcher,\n defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ''\n }, labelInnerStore.statesModels, interpolated);\n setLabelText(textEl, labelText);\n }\n\n textEl.percent = 0;\n (labelInnerStore.prevValue == null ? initProps : updateProps)(textEl, {\n // percent is used to prevent animation from being aborted #15916\n percent: 1\n }, animatableModel, dataIndex, null, during);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getFont } from '../../label/labelStyle.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nvar PATH_COLOR = ['textStyle', 'color'];\nvar textStyleParams = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'padding', 'lineHeight', 'rich', 'width', 'height', 'overflow']; // TODO Performance improvement?\n\nvar tmpText = new ZRText();\n\nvar TextStyleMixin =\n/** @class */\nfunction () {\n function TextStyleMixin() {}\n /**\r\n * Get color property or get color from option.textStyle.color\r\n */\n // TODO Callback\n\n\n TextStyleMixin.prototype.getTextColor = function (isEmphasis) {\n var ecModel = this.ecModel;\n return this.getShallow('color') || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);\n };\n /**\r\n * Create font string from fontStyle, fontWeight, fontSize, fontFamily\r\n * @return {string}\r\n */\n\n\n TextStyleMixin.prototype.getFont = function () {\n return getFont({\n fontStyle: this.getShallow('fontStyle'),\n fontWeight: this.getShallow('fontWeight'),\n fontSize: this.getShallow('fontSize'),\n fontFamily: this.getShallow('fontFamily')\n }, this.ecModel);\n };\n\n TextStyleMixin.prototype.getTextRect = function (text) {\n var style = {\n text: text,\n verticalAlign: this.getShallow('verticalAlign') || this.getShallow('baseline')\n };\n\n for (var i = 0; i < textStyleParams.length; i++) {\n style[textStyleParams[i]] = this.getShallow(textStyleParams[i]);\n }\n\n tmpText.useStyle(style);\n tmpText.update();\n return tmpText.getBoundingRect();\n };\n\n return TextStyleMixin;\n}();\n\n;\nexport default TextStyleMixin;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var LINE_STYLE_KEY_MAP = [['lineWidth', 'width'], ['stroke', 'color'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'type'], ['lineDashOffset', 'dashOffset'], ['lineCap', 'cap'], ['lineJoin', 'join'], ['miterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);\n\nvar LineStyleMixin =\n/** @class */\nfunction () {\n function LineStyleMixin() {}\n\n LineStyleMixin.prototype.getLineStyle = function (excludes) {\n return getLineStyle(this, excludes);\n };\n\n return LineStyleMixin;\n}();\n\n;\nexport { LineStyleMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport makeStyleMapper from './makeStyleMapper.js';\nexport var ITEM_STYLE_KEY_MAP = [['fill', 'color'], ['stroke', 'borderColor'], ['lineWidth', 'borderWidth'], ['opacity'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'], ['lineDash', 'borderType'], ['lineDashOffset', 'borderDashOffset'], ['lineCap', 'borderCap'], ['lineJoin', 'borderJoin'], ['miterLimit', 'borderMiterLimit'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n];\nvar getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);\n\nvar ItemStyleMixin =\n/** @class */\nfunction () {\n function ItemStyleMixin() {}\n\n ItemStyleMixin.prototype.getItemStyle = function (excludes, includes) {\n return getItemStyle(this, excludes, includes);\n };\n\n return ItemStyleMixin;\n}();\n\nexport { ItemStyleMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport env from 'zrender/lib/core/env.js';\nimport { enableClassExtend, enableClassCheck } from '../util/clazz.js';\nimport { AreaStyleMixin } from './mixin/areaStyle.js';\nimport TextStyleMixin from './mixin/textStyle.js';\nimport { LineStyleMixin } from './mixin/lineStyle.js';\nimport { ItemStyleMixin } from './mixin/itemStyle.js';\nimport { mixin, clone, merge } from 'zrender/lib/core/util.js';\n\nvar Model =\n/** @class */\nfunction () {\n function Model(option, parentModel, ecModel) {\n this.parentModel = parentModel;\n this.ecModel = ecModel;\n this.option = option; // Simple optimization\n // if (this.init) {\n // if (arguments.length <= 4) {\n // this.init(option, parentModel, ecModel, extraOpt);\n // }\n // else {\n // this.init.apply(this, arguments);\n // }\n // }\n }\n\n Model.prototype.init = function (option, parentModel, ecModel) {\n var rest = [];\n\n for (var _i = 3; _i < arguments.length; _i++) {\n rest[_i - 3] = arguments[_i];\n }\n };\n /**\r\n * Merge the input option to me.\r\n */\n\n\n Model.prototype.mergeOption = function (option, ecModel) {\n merge(this.option, option, true);\n }; // `path` can be 'a.b.c', so the return value type have to be `ModelOption`\n // TODO: TYPE strict key check?\n // get(path: string | string[], ignoreParent?: boolean): ModelOption;\n\n\n Model.prototype.get = function (path, ignoreParent) {\n if (path == null) {\n return this.option;\n }\n\n return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);\n };\n\n Model.prototype.getShallow = function (key, ignoreParent) {\n var option = this.option;\n var val = option == null ? option : option[key];\n\n if (val == null && !ignoreParent) {\n var parentModel = this.parentModel;\n\n if (parentModel) {\n // FIXME:TS do not know how to make it works\n val = parentModel.getShallow(key);\n }\n }\n\n return val;\n }; // `path` can be 'a.b.c', so the return value type have to be `Model`\n // getModel(path: string | string[], parentModel?: Model): Model;\n // TODO 'a.b.c' is deprecated\n\n\n Model.prototype.getModel = function (path, parentModel) {\n var hasPath = path != null;\n var pathFinal = hasPath ? this.parsePath(path) : null;\n var obj = hasPath ? this._doGet(pathFinal) : this.option;\n parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));\n return new Model(obj, parentModel, this.ecModel);\n };\n /**\r\n * If model has option\r\n */\n\n\n Model.prototype.isEmpty = function () {\n return this.option == null;\n };\n\n Model.prototype.restoreData = function () {}; // Pending\n\n\n Model.prototype.clone = function () {\n var Ctor = this.constructor;\n return new Ctor(clone(this.option));\n }; // setReadOnly(properties): void {\n // clazzUtil.setReadOnly(this, properties);\n // }\n // If path is null/undefined, return null/undefined.\n\n\n Model.prototype.parsePath = function (path) {\n if (typeof path === 'string') {\n return path.split('.');\n }\n\n return path;\n }; // Resolve path for parent. Perhaps useful when parent use a different property.\n // Default to be a identity resolver.\n // Can be modified to a different resolver.\n\n\n Model.prototype.resolveParentPath = function (path) {\n return path;\n }; // FIXME:TS check whether put this method here\n\n\n Model.prototype.isAnimationEnabled = function () {\n if (!env.node && this.option) {\n if (this.option.animation != null) {\n return !!this.option.animation;\n } else if (this.parentModel) {\n return this.parentModel.isAnimationEnabled();\n }\n }\n };\n\n Model.prototype._doGet = function (pathArr, parentModel) {\n var obj = this.option;\n\n if (!pathArr) {\n return obj;\n }\n\n for (var i = 0; i < pathArr.length; i++) {\n // Ignore empty\n if (!pathArr[i]) {\n continue;\n } // obj could be number/string/... (like 0)\n\n\n obj = obj && typeof obj === 'object' ? obj[pathArr[i]] : null;\n\n if (obj == null) {\n break;\n }\n }\n\n if (obj == null && parentModel) {\n obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);\n }\n\n return obj;\n };\n\n return Model;\n}();\n\n; // Enable Model.extend.\n\nenableClassExtend(Model);\nenableClassCheck(Model);\nmixin(Model, LineStyleMixin);\nmixin(Model, ItemStyleMixin);\nmixin(Model, AreaStyleMixin);\nmixin(Model, TextStyleMixin);\nexport default Model;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\nimport { makePrintable } from './log.js'; // A random offset\n\nvar base = Math.round(Math.random() * 10);\n/**\r\n * @public\r\n * @param {string} type\r\n * @return {string}\r\n */\n\nexport function getUID(type) {\n // Considering the case of crossing js context,\n // use Math.random to make id as unique as possible.\n return [type || '', base++].join('_');\n}\n/**\r\n * Implements `SubTypeDefaulterManager` for `target`.\r\n */\n\nexport function enableSubTypeDefaulter(target) {\n var subTypeDefaulters = {};\n\n target.registerSubTypeDefaulter = function (componentType, defaulter) {\n var componentTypeInfo = parseClassType(componentType);\n subTypeDefaulters[componentTypeInfo.main] = defaulter;\n };\n\n target.determineSubType = function (componentType, option) {\n var type = option.type;\n\n if (!type) {\n var componentTypeMain = parseClassType(componentType).main;\n\n if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {\n type = subTypeDefaulters[componentTypeMain](option);\n }\n }\n\n return type;\n };\n}\n/**\r\n * Implements `TopologicalTravelable` for `entity`.\r\n *\r\n * Topological travel on Activity Network (Activity On Vertices).\r\n * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].\r\n * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.\r\n * If there is circular dependencey, Error will be thrown.\r\n */\n\nexport function enableTopologicalTravel(entity, dependencyGetter) {\n /**\r\n * @param targetNameList Target Component type list.\r\n * Can be ['aa', 'bb', 'aa.xx']\r\n * @param fullNameList By which we can build dependency graph.\r\n * @param callback Params: componentType, dependencies.\r\n * @param context Scope of callback.\r\n */\n entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {\n if (!targetNameList.length) {\n return;\n }\n\n var result = makeDepndencyGraph(fullNameList);\n var graph = result.graph;\n var noEntryList = result.noEntryList;\n var targetNameSet = {};\n zrUtil.each(targetNameList, function (name) {\n targetNameSet[name] = true;\n });\n\n while (noEntryList.length) {\n var currComponentType = noEntryList.pop();\n var currVertex = graph[currComponentType];\n var isInTargetNameSet = !!targetNameSet[currComponentType];\n\n if (isInTargetNameSet) {\n callback.call(context, currComponentType, currVertex.originalDeps.slice());\n delete targetNameSet[currComponentType];\n }\n\n zrUtil.each(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);\n }\n\n zrUtil.each(targetNameSet, function () {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Circular dependency may exists: ', targetNameSet, targetNameList, fullNameList);\n }\n\n throw new Error(errMsg);\n });\n\n function removeEdge(succComponentType) {\n graph[succComponentType].entryCount--;\n\n if (graph[succComponentType].entryCount === 0) {\n noEntryList.push(succComponentType);\n }\n } // Consider this case: legend depends on series, and we call\n // chart.setOption({series: [...]}), where only series is in option.\n // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will\n // not be called, but only sereis.mergeOption is called. Thus legend\n // have no chance to update its local record about series (like which\n // name of series is available in legend).\n\n\n function removeEdgeAndAdd(succComponentType) {\n targetNameSet[succComponentType] = true;\n removeEdge(succComponentType);\n }\n };\n\n function makeDepndencyGraph(fullNameList) {\n var graph = {};\n var noEntryList = [];\n zrUtil.each(fullNameList, function (name) {\n var thisItem = createDependencyGraphItem(graph, name);\n var originalDeps = thisItem.originalDeps = dependencyGetter(name);\n var availableDeps = getAvailableDependencies(originalDeps, fullNameList);\n thisItem.entryCount = availableDeps.length;\n\n if (thisItem.entryCount === 0) {\n noEntryList.push(name);\n }\n\n zrUtil.each(availableDeps, function (dependentName) {\n if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {\n thisItem.predecessor.push(dependentName);\n }\n\n var thatItem = createDependencyGraphItem(graph, dependentName);\n\n if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {\n thatItem.successor.push(name);\n }\n });\n });\n return {\n graph: graph,\n noEntryList: noEntryList\n };\n }\n\n function createDependencyGraphItem(graph, name) {\n if (!graph[name]) {\n graph[name] = {\n predecessor: [],\n successor: []\n };\n }\n\n return graph[name];\n }\n\n function getAvailableDependencies(originalDeps, fullNameList) {\n var availableDeps = [];\n zrUtil.each(originalDeps, function (dep) {\n zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);\n });\n return availableDeps;\n }\n}\nexport function inheritDefaultOption(superOption, subOption) {\n // See also `model/Component.ts#getDefaultOption`\n return zrUtil.merge(zrUtil.merge({}, superOption, true), subOption, true);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\n\n/**\r\n * Language: English.\r\n */\nexport default {\n time: {\n month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthAbbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n dayOfWeek: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n dayOfWeekAbbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n },\n legend: {\n selector: {\n all: 'All',\n inverse: 'Inv'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: 'Box Select',\n polygon: 'Lasso Select',\n lineX: 'Horizontally Select',\n lineY: 'Vertically Select',\n keep: 'Keep Selections',\n clear: 'Clear Selections'\n }\n },\n dataView: {\n title: 'Data View',\n lang: ['Data View', 'Close', 'Refresh']\n },\n dataZoom: {\n title: {\n zoom: 'Zoom',\n back: 'Zoom Reset'\n }\n },\n magicType: {\n title: {\n line: 'Switch to Line Chart',\n bar: 'Switch to Bar Chart',\n stack: 'Stack',\n tiled: 'Tile'\n }\n },\n restore: {\n title: 'Restore'\n },\n saveAsImage: {\n title: 'Save as Image',\n lang: ['Right Click to Save Image']\n }\n },\n series: {\n typeNames: {\n pie: 'Pie chart',\n bar: 'Bar chart',\n line: 'Line chart',\n scatter: 'Scatter plot',\n effectScatter: 'Ripple scatter plot',\n radar: 'Radar chart',\n tree: 'Tree',\n treemap: 'Treemap',\n boxplot: 'Boxplot',\n candlestick: 'Candlestick',\n k: 'K line chart',\n heatmap: 'Heat map',\n map: 'Map',\n parallel: 'Parallel coordinate map',\n lines: 'Line graph',\n graph: 'Relationship graph',\n sankey: 'Sankey diagram',\n funnel: 'Funnel chart',\n gauge: 'Gauge',\n pictorialBar: 'Pictorial bar',\n themeRiver: 'Theme River Map',\n sunburst: 'Sunburst'\n }\n },\n aria: {\n general: {\n withTitle: 'This is a chart about \"{title}\"',\n withoutTitle: 'This is a chart'\n },\n series: {\n single: {\n prefix: '',\n withName: ' with type {seriesType} named {seriesName}.',\n withoutName: ' with type {seriesType}.'\n },\n multiple: {\n prefix: '. It consists of {seriesCount} series count.',\n withName: ' The {seriesId} series is a {seriesType} representing {seriesName}.',\n withoutName: ' The {seriesId} series is a {seriesType}.',\n separator: {\n middle: '',\n end: ''\n }\n }\n },\n data: {\n allData: 'The data is as follows: ',\n partialData: 'The first {displayCnt} items are: ',\n withName: 'the data for {name} is {value}',\n withoutName: '{value}',\n separator: {\n middle: ', ',\n end: '. '\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n * Licensed to the Apache Software Foundation (ASF) under one\r\n * or more contributor license agreements. See the NOTICE file\r\n * distributed with this work for additional information\r\n * regarding copyright ownership. The ASF licenses this file\r\n * to you under the Apache License, Version 2.0 (the\r\n * \"License\"); you may not use this file except in compliance\r\n * with the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing,\r\n * software distributed under the License is distributed on an\r\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n * KIND, either express or implied. See the License for the\r\n * specific language governing permissions and limitations\r\n * under the License.\r\n */\nexport default {\n time: {\n month: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],\n monthAbbr: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n dayOfWeek: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],\n dayOfWeekAbbr: ['日', '一', '二', '三', '四', '五', '六']\n },\n legend: {\n selector: {\n all: '全选',\n inverse: '反选'\n }\n },\n toolbox: {\n brush: {\n title: {\n rect: '矩形选择',\n polygon: '圈选',\n lineX: '横向选择',\n lineY: '纵向选择',\n keep: '保持选择',\n clear: '清除选择'\n }\n },\n dataView: {\n title: '数据视图',\n lang: ['数据视图', '关闭', '刷新']\n },\n dataZoom: {\n title: {\n zoom: '区域缩放',\n back: '区域缩放还原'\n }\n },\n magicType: {\n title: {\n line: '切换为折线图',\n bar: '切换为柱状图',\n stack: '切换为堆叠',\n tiled: '切换为平铺'\n }\n },\n restore: {\n title: '还原'\n },\n saveAsImage: {\n title: '保存为图片',\n lang: ['右键另存为图片']\n }\n },\n series: {\n typeNames: {\n pie: '饼图',\n bar: '柱状图',\n line: '折线图',\n scatter: '散点图',\n effectScatter: '涟漪散点图',\n radar: '雷达图',\n tree: '树图',\n treemap: '矩形树图',\n boxplot: '箱型图',\n candlestick: 'K线图',\n k: 'K线图',\n heatmap: '热力图',\n map: '地图',\n parallel: '平行坐标图',\n lines: '线图',\n graph: '关系图',\n sankey: '桑基图',\n funnel: '漏斗图',\n gauge: '仪表盘图',\n pictorialBar: '象形柱图',\n themeRiver: '主题河流图',\n sunburst: '旭日图'\n }\n },\n aria: {\n general: {\n withTitle: '这是一个关于“{title}”的图表。',\n withoutTitle: '这是一个图表,'\n },\n series: {\n single: {\n prefix: '',\n withName: '图表类型是{seriesType},表示{seriesName}。',\n withoutName: '图表类型是{seriesType}。'\n },\n multiple: {\n prefix: '它由{seriesCount}个图表系列组成。',\n withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},',\n withoutName: '第{seriesId}个系列是一个{seriesType},',\n separator: {\n middle: ';',\n end: '。'\n }\n }\n },\n data: {\n allData: '其数据是——',\n partialData: '其中,前{displayCnt}项是——',\n withName: '{name}的数据是{value}',\n withoutName: '{value}',\n separator: {\n middle: ',',\n end: ''\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Model from '../model/Model.js';\nimport env from 'zrender/lib/core/env.js'; // default import ZH and EN lang\n\nimport langEN from '../i18n/langEN.js';\nimport langZH from '../i18n/langZH.js';\nimport { isString, clone, merge } from 'zrender/lib/core/util.js';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n var langStr = (\n /* eslint-disable-next-line */\n document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n locale = locale.toUpperCase();\n localeModels[locale] = new Model(localeObj);\n localeStorage[locale] = localeObj;\n} // export function getLocale(locale: string) {\n// return localeStorage[locale];\n// }\n\nexport function createLocaleObject(locale) {\n if (isString(locale)) {\n var localeObj = localeStorage[locale.toUpperCase()] || {};\n\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n return clone(localeObj);\n } else {\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n } else {\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n}\nexport function getLocaleModel(lang) {\n return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n return localeModels[DEFAULT_LOCALE];\n} // Default locale\n\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from './number.js';\nimport { getDefaultLocaleModel, getLocaleModel, SYSTEM_LANG } from '../core/locale.js';\nimport Model from '../model/Model.js';\nexport var ONE_SECOND = 1000;\nexport var ONE_MINUTE = ONE_SECOND * 60;\nexport var ONE_HOUR = ONE_MINUTE * 60;\nexport var ONE_DAY = ONE_HOUR * 24;\nexport var ONE_YEAR = ONE_DAY * 365;\nexport var defaultLeveledFormatter = {\n year: '{yyyy}',\n month: '{MMM}',\n day: '{d}',\n hour: '{HH}:{mm}',\n minute: '{HH}:{mm}',\n second: '{HH}:{mm}:{ss}',\n millisecond: '{HH}:{mm}:{ss} {SSS}',\n none: '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}'\n};\nvar fullDayFormatter = '{yyyy}-{MM}-{dd}';\nexport var fullLeveledFormatter = {\n year: '{yyyy}',\n month: '{yyyy}-{MM}',\n day: fullDayFormatter,\n hour: fullDayFormatter + ' ' + defaultLeveledFormatter.hour,\n minute: fullDayFormatter + ' ' + defaultLeveledFormatter.minute,\n second: fullDayFormatter + ' ' + defaultLeveledFormatter.second,\n millisecond: defaultLeveledFormatter.none\n};\nexport var primaryTimeUnits = ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'];\nexport var timeUnits = ['year', 'half-year', 'quarter', 'month', 'week', 'half-week', 'day', 'half-day', 'quarter-day', 'hour', 'minute', 'second', 'millisecond'];\nexport function pad(str, len) {\n str += '';\n return '0000'.substr(0, len - str.length) + str;\n}\nexport function getPrimaryTimeUnit(timeUnit) {\n switch (timeUnit) {\n case 'half-year':\n case 'quarter':\n return 'month';\n\n case 'week':\n case 'half-week':\n return 'day';\n\n case 'half-day':\n case 'quarter-day':\n return 'hour';\n\n default:\n // year, minutes, second, milliseconds\n return timeUnit;\n }\n}\nexport function isPrimaryTimeUnit(timeUnit) {\n return timeUnit === getPrimaryTimeUnit(timeUnit);\n}\nexport function getDefaultFormatPrecisionOfInterval(timeUnit) {\n switch (timeUnit) {\n case 'year':\n case 'month':\n return 'day';\n\n case 'millisecond':\n return 'millisecond';\n\n default:\n // Also for day, hour, minute, second\n return 'second';\n }\n}\nexport function format( // Note: The result based on `isUTC` are totally different, which can not be just simply\n// substituted by the result without `isUTC`. So we make the param `isUTC` mandatory.\ntime, template, isUTC, lang) {\n var date = numberUtil.parseDate(time);\n var y = date[fullYearGetterName(isUTC)]();\n var M = date[monthGetterName(isUTC)]() + 1;\n var q = Math.floor((M - 1) / 3) + 1;\n var d = date[dateGetterName(isUTC)]();\n var e = date['get' + (isUTC ? 'UTC' : '') + 'Day']();\n var H = date[hoursGetterName(isUTC)]();\n var h = (H - 1) % 12 + 1;\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();\n var timeModel = localeModel.getModel('time');\n var month = timeModel.get('month');\n var monthAbbr = timeModel.get('monthAbbr');\n var dayOfWeek = timeModel.get('dayOfWeek');\n var dayOfWeekAbbr = timeModel.get('dayOfWeekAbbr');\n return (template || '').replace(/{yyyy}/g, y + '').replace(/{yy}/g, pad(y % 100 + '', 2)).replace(/{Q}/g, q + '').replace(/{MMMM}/g, month[M - 1]).replace(/{MMM}/g, monthAbbr[M - 1]).replace(/{MM}/g, pad(M, 2)).replace(/{M}/g, M + '').replace(/{dd}/g, pad(d, 2)).replace(/{d}/g, d + '').replace(/{eeee}/g, dayOfWeek[e]).replace(/{ee}/g, dayOfWeekAbbr[e]).replace(/{e}/g, e + '').replace(/{HH}/g, pad(H, 2)).replace(/{H}/g, H + '').replace(/{hh}/g, pad(h + '', 2)).replace(/{h}/g, h + '').replace(/{mm}/g, pad(m, 2)).replace(/{m}/g, m + '').replace(/{ss}/g, pad(s, 2)).replace(/{s}/g, s + '').replace(/{SSS}/g, pad(S, 3)).replace(/{S}/g, S + '');\n}\nexport function leveledFormat(tick, idx, formatter, lang, isUTC) {\n var template = null;\n\n if (zrUtil.isString(formatter)) {\n // Single formatter for all units at all levels\n template = formatter;\n } else if (zrUtil.isFunction(formatter)) {\n // Callback formatter\n template = formatter(tick.value, idx, {\n level: tick.level\n });\n } else {\n var defaults = zrUtil.extend({}, defaultLeveledFormatter);\n\n if (tick.level > 0) {\n for (var i = 0; i < primaryTimeUnits.length; ++i) {\n defaults[primaryTimeUnits[i]] = \"{primary|\" + defaults[primaryTimeUnits[i]] + \"}\";\n }\n }\n\n var mergedFormatter = formatter ? formatter.inherit === false ? formatter // Use formatter with bigger units\n : zrUtil.defaults(formatter, defaults) : defaults;\n var unit = getUnitFromValue(tick.value, isUTC);\n\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n } else if (mergedFormatter.inherit) {\n // Unit formatter is not defined and should inherit from bigger units\n var targetId = timeUnits.indexOf(unit);\n\n for (var i = targetId - 1; i >= 0; --i) {\n if (mergedFormatter[unit]) {\n template = mergedFormatter[unit];\n break;\n }\n }\n\n template = template || defaults.none;\n }\n\n if (zrUtil.isArray(template)) {\n var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level;\n levelId = Math.min(levelId, template.length - 1);\n template = template[levelId];\n }\n }\n\n return format(new Date(tick.value), template, isUTC, lang);\n}\nexport function getUnitFromValue(value, isUTC) {\n var date = numberUtil.parseDate(value);\n var M = date[monthGetterName(isUTC)]() + 1;\n var d = date[dateGetterName(isUTC)]();\n var h = date[hoursGetterName(isUTC)]();\n var m = date[minutesGetterName(isUTC)]();\n var s = date[secondsGetterName(isUTC)]();\n var S = date[millisecondsGetterName(isUTC)]();\n var isSecond = S === 0;\n var isMinute = isSecond && s === 0;\n var isHour = isMinute && m === 0;\n var isDay = isHour && h === 0;\n var isMonth = isDay && d === 1;\n var isYear = isMonth && M === 1;\n\n if (isYear) {\n return 'year';\n } else if (isMonth) {\n return 'month';\n } else if (isDay) {\n return 'day';\n } else if (isHour) {\n return 'hour';\n } else if (isMinute) {\n return 'minute';\n } else if (isSecond) {\n return 'second';\n } else {\n return 'millisecond';\n }\n}\nexport function getUnitValue(value, unit, isUTC) {\n var date = zrUtil.isNumber(value) ? numberUtil.parseDate(value) : value;\n unit = unit || getUnitFromValue(value, isUTC);\n\n switch (unit) {\n case 'year':\n return date[fullYearGetterName(isUTC)]();\n\n case 'half-year':\n return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;\n\n case 'quarter':\n return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);\n\n case 'month':\n return date[monthGetterName(isUTC)]();\n\n case 'day':\n return date[dateGetterName(isUTC)]();\n\n case 'half-day':\n return date[hoursGetterName(isUTC)]() / 24;\n\n case 'hour':\n return date[hoursGetterName(isUTC)]();\n\n case 'minute':\n return date[minutesGetterName(isUTC)]();\n\n case 'second':\n return date[secondsGetterName(isUTC)]();\n\n case 'millisecond':\n return date[millisecondsGetterName(isUTC)]();\n }\n}\nexport function fullYearGetterName(isUTC) {\n return isUTC ? 'getUTCFullYear' : 'getFullYear';\n}\nexport function monthGetterName(isUTC) {\n return isUTC ? 'getUTCMonth' : 'getMonth';\n}\nexport function dateGetterName(isUTC) {\n return isUTC ? 'getUTCDate' : 'getDate';\n}\nexport function hoursGetterName(isUTC) {\n return isUTC ? 'getUTCHours' : 'getHours';\n}\nexport function minutesGetterName(isUTC) {\n return isUTC ? 'getUTCMinutes' : 'getMinutes';\n}\nexport function secondsGetterName(isUTC) {\n return isUTC ? 'getUTCSeconds' : 'getSeconds';\n}\nexport function millisecondsGetterName(isUTC) {\n return isUTC ? 'getUTCMilliseconds' : 'getMilliseconds';\n}\nexport function fullYearSetterName(isUTC) {\n return isUTC ? 'setUTCFullYear' : 'setFullYear';\n}\nexport function monthSetterName(isUTC) {\n return isUTC ? 'setUTCMonth' : 'setMonth';\n}\nexport function dateSetterName(isUTC) {\n return isUTC ? 'setUTCDate' : 'setDate';\n}\nexport function hoursSetterName(isUTC) {\n return isUTC ? 'setUTCHours' : 'setHours';\n}\nexport function minutesSetterName(isUTC) {\n return isUTC ? 'setUTCMinutes' : 'setMinutes';\n}\nexport function secondsSetterName(isUTC) {\n return isUTC ? 'setUTCSeconds' : 'setSeconds';\n}\nexport function millisecondsSetterName(isUTC) {\n return isUTC ? 'setUTCMilliseconds' : 'setMilliseconds';\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { encodeHTML } from 'zrender/lib/core/dom.js';\nimport { parseDate, isNumeric, numericToNumber } from './number.js';\nimport { format as timeFormat, pad } from './time.js';\nimport { deprecateReplaceLog } from './log.js';\n/**\r\n * Add a comma each three digit.\r\n */\n\nexport function addCommas(x) {\n if (!isNumeric(x)) {\n return zrUtil.isString(x) ? x : '-';\n }\n\n var parts = (x + '').split('.');\n return parts[0].replace(/(\\d{1,3})(?=(?:\\d{3})+(?!\\d))/g, '$1,') + (parts.length > 1 ? '.' + parts[1] : '');\n}\nexport function toCamelCase(str, upperCaseFirst) {\n str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) {\n return group1.toUpperCase();\n });\n\n if (upperCaseFirst && str) {\n str = str.charAt(0).toUpperCase() + str.slice(1);\n }\n\n return str;\n}\nexport var normalizeCssArray = zrUtil.normalizeCssArray;\nexport { encodeHTML };\n/**\r\n * Make value user readable for tooltip and label.\r\n * \"User readable\":\r\n * Try to not print programmer-specific text like NaN, Infinity, null, undefined.\r\n * Avoid to display an empty string, which users can not recognize there is\r\n * a value and it might look like a bug.\r\n */\n\nexport function makeValueReadable(value, valueType, useUTC) {\n var USER_READABLE_DEFUALT_TIME_PATTERN = '{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}';\n\n function stringToUserReadable(str) {\n return str && zrUtil.trim(str) ? str : '-';\n }\n\n function isNumberUserReadable(num) {\n return !!(num != null && !isNaN(num) && isFinite(num));\n }\n\n var isTypeTime = valueType === 'time';\n var isValueDate = value instanceof Date;\n\n if (isTypeTime || isValueDate) {\n var date = isTypeTime ? parseDate(value) : value;\n\n if (!isNaN(+date)) {\n return timeFormat(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);\n } else if (isValueDate) {\n return '-';\n } // In other cases, continue to try to display the value in the following code.\n\n }\n\n if (valueType === 'ordinal') {\n return zrUtil.isStringSafe(value) ? stringToUserReadable(value) : zrUtil.isNumber(value) ? isNumberUserReadable(value) ? value + '' : '-' : '-';\n } // By default.\n\n\n var numericResult = numericToNumber(value);\n return isNumberUserReadable(numericResult) ? addCommas(numericResult) : zrUtil.isStringSafe(value) ? stringToUserReadable(value) : typeof value === 'boolean' ? value + '' : '-';\n}\nvar TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];\n\nvar wrapVar = function (varName, seriesIdx) {\n return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';\n};\n/**\r\n * Template formatter\r\n * @param {Array.|Object} paramsList\r\n */\n\n\nexport function formatTpl(tpl, paramsList, encode) {\n if (!zrUtil.isArray(paramsList)) {\n paramsList = [paramsList];\n }\n\n var seriesLen = paramsList.length;\n\n if (!seriesLen) {\n return '';\n }\n\n var $vars = paramsList[0].$vars || [];\n\n for (var i = 0; i < $vars.length; i++) {\n var alias = TPL_VAR_ALIAS[i];\n tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));\n }\n\n for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {\n for (var k = 0; k < $vars.length; k++) {\n var val = paramsList[seriesIdx][$vars[k]];\n tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k], seriesIdx), encode ? encodeHTML(val) : val);\n }\n }\n\n return tpl;\n}\n/**\r\n * simple Template formatter\r\n */\n\nexport function formatTplSimple(tpl, param, encode) {\n zrUtil.each(param, function (value, key) {\n tpl = tpl.replace('{' + key + '}', encode ? encodeHTML(value) : value);\n });\n return tpl;\n}\nexport function getTooltipMarker(inOpt, extraCssText) {\n var opt = zrUtil.isString(inOpt) ? {\n color: inOpt,\n extraCssText: extraCssText\n } : inOpt || {};\n var color = opt.color;\n var type = opt.type;\n extraCssText = opt.extraCssText;\n var renderMode = opt.renderMode || 'html';\n\n if (!color) {\n return '';\n }\n\n if (renderMode === 'html') {\n return type === 'subItem' ? '' : '';\n } else {\n // Should better not to auto generate style name by auto-increment number here.\n // Because this util is usually called in tooltip formatter, which is probably\n // called repeatedly when mouse move and the auto-increment number increases fast.\n // Users can make their own style name by theirselves, make it unique and readable.\n var markerId = opt.markerId || 'markerX';\n return {\n renderMode: renderMode,\n content: '{' + markerId + '|} ',\n style: type === 'subItem' ? {\n width: 4,\n height: 4,\n borderRadius: 2,\n backgroundColor: color\n } : {\n width: 10,\n height: 10,\n borderRadius: 5,\n backgroundColor: color\n }\n };\n }\n}\n/**\r\n * @deprecated Use `time/format` instead.\r\n * ISO Date format\r\n * @param {string} tpl\r\n * @param {number} value\r\n * @param {boolean} [isUTC=false] Default in local time.\r\n * see `module:echarts/scale/Time`\r\n * and `module:echarts/util/number#parseDate`.\r\n * @inner\r\n */\n\nexport function formatTime(tpl, value, isUTC) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('echarts.format.formatTime', 'echarts.time.format');\n }\n\n if (tpl === 'week' || tpl === 'month' || tpl === 'quarter' || tpl === 'half-year' || tpl === 'year') {\n tpl = 'MM-dd\\nyyyy';\n }\n\n var date = parseDate(value);\n var getUTC = isUTC ? 'getUTC' : 'get';\n var y = date[getUTC + 'FullYear']();\n var M = date[getUTC + 'Month']() + 1;\n var d = date[getUTC + 'Date']();\n var h = date[getUTC + 'Hours']();\n var m = date[getUTC + 'Minutes']();\n var s = date[getUTC + 'Seconds']();\n var S = date[getUTC + 'Milliseconds']();\n tpl = tpl.replace('MM', pad(M, 2)).replace('M', M).replace('yyyy', y).replace('yy', pad(y % 100 + '', 2)).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));\n return tpl;\n}\n/**\r\n * Capital first\r\n * @param {string} str\r\n * @return {string}\r\n */\n\nexport function capitalFirst(str) {\n return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;\n}\n/**\r\n * @return Never be null/undefined.\r\n */\n\nexport function convertToColorString(color, defaultColor) {\n defaultColor = defaultColor || 'transparent';\n return zrUtil.isString(color) ? color : zrUtil.isObject(color) ? color.colorStops && (color.colorStops[0] || {}).color || defaultColor : defaultColor;\n}\nexport { truncateText } from 'zrender/lib/graphic/helper/parseText.js';\n/**\r\n * open new tab\r\n * @param link url\r\n * @param target blank or self\r\n */\n\nexport function windowOpen(link, target) {\n /* global window */\n if (target === '_blank' || target === 'blank') {\n var blank = window.open();\n blank.opener = null;\n blank.location.href = link;\n } else {\n window.open(link, target);\n }\n}\nexport { getTextRect } from '../legacy/getTextRect.js';","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Layout helpers for each component positioning\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent } from './number.js';\nimport * as formatUtil from './format.js';\nvar each = zrUtil.each;\n/**\r\n * @public\r\n */\n\nexport var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];\n/**\r\n * @public\r\n */\n\nexport var HV_NAMES = [['width', 'left', 'right'], ['height', 'top', 'bottom']];\n\nfunction boxLayout(orient, group, gap, maxWidth, maxHeight) {\n var x = 0;\n var y = 0;\n\n if (maxWidth == null) {\n maxWidth = Infinity;\n }\n\n if (maxHeight == null) {\n maxHeight = Infinity;\n }\n\n var currentLineMaxSize = 0;\n group.eachChild(function (child, idx) {\n var rect = child.getBoundingRect();\n var nextChild = group.childAt(idx + 1);\n var nextChildRect = nextChild && nextChild.getBoundingRect();\n var nextX;\n var nextY;\n\n if (orient === 'horizontal') {\n var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);\n nextX = x + moveX; // Wrap when width exceeds maxWidth or meet a `newline` group\n // FIXME compare before adding gap?\n\n if (nextX > maxWidth || child.newline) {\n x = 0;\n nextX = moveX;\n y += currentLineMaxSize + gap;\n currentLineMaxSize = rect.height;\n } else {\n // FIXME: consider rect.y is not `0`?\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);\n }\n } else {\n var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);\n nextY = y + moveY; // Wrap when width exceeds maxHeight or meet a `newline` group\n\n if (nextY > maxHeight || child.newline) {\n x += currentLineMaxSize + gap;\n y = 0;\n nextY = moveY;\n currentLineMaxSize = rect.width;\n } else {\n currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);\n }\n }\n\n if (child.newline) {\n return;\n }\n\n child.x = x;\n child.y = y;\n child.markRedraw();\n orient === 'horizontal' ? x = nextX + gap : y = nextY + gap;\n });\n}\n/**\r\n * VBox or HBox layouting\r\n * @param {string} orient\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\n\nexport var box = boxLayout;\n/**\r\n * VBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\nexport var vbox = zrUtil.curry(boxLayout, 'vertical');\n/**\r\n * HBox layouting\r\n * @param {module:zrender/graphic/Group} group\r\n * @param {number} gap\r\n * @param {number} [width=Infinity]\r\n * @param {number} [height=Infinity]\r\n */\n\nexport var hbox = zrUtil.curry(boxLayout, 'horizontal');\n/**\r\n * If x or x2 is not specified or 'center' 'left' 'right',\r\n * the width would be as long as possible.\r\n * If y or y2 is not specified or 'middle' 'top' 'bottom',\r\n * the height would be as long as possible.\r\n */\n\nexport function getAvailableSize(positionInfo, containerRect, margin) {\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var x = parsePercent(positionInfo.left, containerWidth);\n var y = parsePercent(positionInfo.top, containerHeight);\n var x2 = parsePercent(positionInfo.right, containerWidth);\n var y2 = parsePercent(positionInfo.bottom, containerHeight);\n (isNaN(x) || isNaN(parseFloat(positionInfo.left))) && (x = 0);\n (isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);\n (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);\n (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);\n margin = formatUtil.normalizeCssArray(margin || 0);\n return {\n width: Math.max(x2 - x - margin[1] - margin[3], 0),\n height: Math.max(y2 - y - margin[0] - margin[2], 0)\n };\n}\n/**\r\n * Parse position info.\r\n */\n\nexport function getLayoutRect(positionInfo, containerRect, margin) {\n margin = formatUtil.normalizeCssArray(margin || 0);\n var containerWidth = containerRect.width;\n var containerHeight = containerRect.height;\n var left = parsePercent(positionInfo.left, containerWidth);\n var top = parsePercent(positionInfo.top, containerHeight);\n var right = parsePercent(positionInfo.right, containerWidth);\n var bottom = parsePercent(positionInfo.bottom, containerHeight);\n var width = parsePercent(positionInfo.width, containerWidth);\n var height = parsePercent(positionInfo.height, containerHeight);\n var verticalMargin = margin[2] + margin[0];\n var horizontalMargin = margin[1] + margin[3];\n var aspect = positionInfo.aspect; // If width is not specified, calculate width from left and right\n\n if (isNaN(width)) {\n width = containerWidth - right - horizontalMargin - left;\n }\n\n if (isNaN(height)) {\n height = containerHeight - bottom - verticalMargin - top;\n }\n\n if (aspect != null) {\n // If width and height are not given\n // 1. Graph should not exceeds the container\n // 2. Aspect must be keeped\n // 3. Graph should take the space as more as possible\n // FIXME\n // Margin is not considered, because there is no case that both\n // using margin and aspect so far.\n if (isNaN(width) && isNaN(height)) {\n if (aspect > containerWidth / containerHeight) {\n width = containerWidth * 0.8;\n } else {\n height = containerHeight * 0.8;\n }\n } // Calculate width or height with given aspect\n\n\n if (isNaN(width)) {\n width = aspect * height;\n }\n\n if (isNaN(height)) {\n height = width / aspect;\n }\n } // If left is not specified, calculate left from right and width\n\n\n if (isNaN(left)) {\n left = containerWidth - right - width - horizontalMargin;\n }\n\n if (isNaN(top)) {\n top = containerHeight - bottom - height - verticalMargin;\n } // Align left and top\n\n\n switch (positionInfo.left || positionInfo.right) {\n case 'center':\n left = containerWidth / 2 - width / 2 - margin[3];\n break;\n\n case 'right':\n left = containerWidth - width - horizontalMargin;\n break;\n }\n\n switch (positionInfo.top || positionInfo.bottom) {\n case 'middle':\n case 'center':\n top = containerHeight / 2 - height / 2 - margin[0];\n break;\n\n case 'bottom':\n top = containerHeight - height - verticalMargin;\n break;\n } // If something is wrong and left, top, width, height are calculated as NaN\n\n\n left = left || 0;\n top = top || 0;\n\n if (isNaN(width)) {\n // Width may be NaN if only one value is given except width\n width = containerWidth - horizontalMargin - left - (right || 0);\n }\n\n if (isNaN(height)) {\n // Height may be NaN if only one value is given except height\n height = containerHeight - verticalMargin - top - (bottom || 0);\n }\n\n var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);\n rect.margin = margin;\n return rect;\n}\n/**\r\n * Position a zr element in viewport\r\n * Group position is specified by either\r\n * {left, top}, {right, bottom}\r\n * If all properties exists, right and bottom will be igonred.\r\n *\r\n * Logic:\r\n * 1. Scale (against origin point in parent coord)\r\n * 2. Rotate (against origin point in parent coord)\r\n * 3. Translate (with el.position by this method)\r\n * So this method only fixes the last step 'Translate', which does not affect\r\n * scaling and rotating.\r\n *\r\n * If be called repeatedly with the same input el, the same result will be gotten.\r\n *\r\n * Return true if the layout happened.\r\n *\r\n * @param el Should have `getBoundingRect` method.\r\n * @param positionInfo\r\n * @param positionInfo.left\r\n * @param positionInfo.top\r\n * @param positionInfo.right\r\n * @param positionInfo.bottom\r\n * @param positionInfo.width Only for opt.boundingModel: 'raw'\r\n * @param positionInfo.height Only for opt.boundingModel: 'raw'\r\n * @param containerRect\r\n * @param margin\r\n * @param opt\r\n * @param opt.hv Only horizontal or only vertical. Default to be [1, 1]\r\n * @param opt.boundingMode\r\n * Specify how to calculate boundingRect when locating.\r\n * 'all': Position the boundingRect that is transformed and uioned\r\n * both itself and its descendants.\r\n * This mode simplies confine the elements in the bounding\r\n * of their container (e.g., using 'right: 0').\r\n * 'raw': Position the boundingRect that is not transformed and only itself.\r\n * This mode is useful when you want a element can overflow its\r\n * container. (Consider a rotated circle needs to be located in a corner.)\r\n * In this mode positionInfo.width/height can only be number.\r\n */\n\nexport function positionElement(el, positionInfo, containerRect, margin, opt, out) {\n var h = !opt || !opt.hv || opt.hv[0];\n var v = !opt || !opt.hv || opt.hv[1];\n var boundingMode = opt && opt.boundingMode || 'all';\n out = out || el;\n out.x = el.x;\n out.y = el.y;\n\n if (!h && !v) {\n return false;\n }\n\n var rect;\n\n if (boundingMode === 'raw') {\n rect = el.type === 'group' ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();\n } else {\n rect = el.getBoundingRect();\n\n if (el.needLocalTransform()) {\n var transform = el.getLocalTransform(); // Notice: raw rect may be inner object of el,\n // which should not be modified.\n\n rect = rect.clone();\n rect.applyTransform(transform);\n }\n } // The real width and height can not be specified but calculated by the given el.\n\n\n var layoutRect = getLayoutRect(zrUtil.defaults({\n width: rect.width,\n height: rect.height\n }, positionInfo), containerRect, margin); // Because 'tranlate' is the last step in transform\n // (see zrender/core/Transformable#getLocalTransform),\n // we can just only modify el.position to get final result.\n\n var dx = h ? layoutRect.x - rect.x : 0;\n var dy = v ? layoutRect.y - rect.y : 0;\n\n if (boundingMode === 'raw') {\n out.x = dx;\n out.y = dy;\n } else {\n out.x += dx;\n out.y += dy;\n }\n\n if (out === el) {\n el.markRedraw();\n }\n\n return true;\n}\n/**\r\n * @param option Contains some of the properties in HV_NAMES.\r\n * @param hvIdx 0: horizontal; 1: vertical.\r\n */\n\nexport function sizeCalculable(option, hvIdx) {\n return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;\n}\nexport function fetchLayoutMode(ins) {\n var layoutMode = ins.layoutMode || ins.constructor.layoutMode;\n return zrUtil.isObject(layoutMode) ? layoutMode : layoutMode ? {\n type: layoutMode\n } : null;\n}\n/**\r\n * Consider Case:\r\n * When default option has {left: 0, width: 100}, and we set {right: 0}\r\n * through setOption or media query, using normal zrUtil.merge will cause\r\n * {right: 0} does not take effect.\r\n *\r\n * @example\r\n * ComponentModel.extend({\r\n * init: function () {\r\n * ...\r\n * let inputPositionParams = layout.getLayoutParams(option);\r\n * this.mergeOption(inputPositionParams);\r\n * },\r\n * mergeOption: function (newOption) {\r\n * newOption && zrUtil.merge(thisOption, newOption, true);\r\n * layout.mergeLayoutParam(thisOption, newOption);\r\n * }\r\n * });\r\n *\r\n * @param targetOption\r\n * @param newOption\r\n * @param opt\r\n */\n\nexport function mergeLayoutParam(targetOption, newOption, opt) {\n var ignoreSize = opt && opt.ignoreSize;\n !zrUtil.isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);\n var hResult = merge(HV_NAMES[0], 0);\n var vResult = merge(HV_NAMES[1], 1);\n copy(HV_NAMES[0], targetOption, hResult);\n copy(HV_NAMES[1], targetOption, vResult);\n\n function merge(names, hvIdx) {\n var newParams = {};\n var newValueCount = 0;\n var merged = {};\n var mergedValueCount = 0;\n var enoughParamNumber = 2;\n each(names, function (name) {\n merged[name] = targetOption[name];\n });\n each(names, function (name) {\n // Consider case: newOption.width is null, which is\n // set by user for removing width setting.\n hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);\n hasValue(newParams, name) && newValueCount++;\n hasValue(merged, name) && mergedValueCount++;\n });\n\n if (ignoreSize[hvIdx]) {\n // Only one of left/right is premitted to exist.\n if (hasValue(newOption, names[1])) {\n merged[names[2]] = null;\n } else if (hasValue(newOption, names[2])) {\n merged[names[1]] = null;\n }\n\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // or targetOption: {right: ...} and newOption: {width: ...},\n // There is no conflict when merged only has params count\n // little than enoughParamNumber.\n\n\n if (mergedValueCount === enoughParamNumber || !newValueCount) {\n return merged;\n } // Case: newOption: {width: ..., right: ...},\n // Than we can make sure user only want those two, and ignore\n // all origin params in targetOption.\n else if (newValueCount >= enoughParamNumber) {\n return newParams;\n } else {\n // Chose another param from targetOption by priority.\n for (var i = 0; i < names.length; i++) {\n var name_1 = names[i];\n\n if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {\n newParams[name_1] = targetOption[name_1];\n break;\n }\n }\n\n return newParams;\n }\n }\n\n function hasProp(obj, name) {\n return obj.hasOwnProperty(name);\n }\n\n function hasValue(obj, name) {\n return obj[name] != null && obj[name] !== 'auto';\n }\n\n function copy(names, target, source) {\n each(names, function (name) {\n target[name] = source[name];\n });\n }\n}\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n */\n\nexport function getLayoutParams(source) {\n return copyLayoutParams({}, source);\n}\n/**\r\n * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.\r\n * @param {Object} source\r\n * @return {Object} Result contains those props.\r\n */\n\nexport function copyLayoutParams(target, source) {\n source && target && each(LOCATION_PARAMS, function (name) {\n source.hasOwnProperty(name) && (target[name] = source[name]);\n });\n return target;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from './Model.js';\nimport * as componentUtil from '../util/component.js';\nimport { enableClassManagement, parseClassType, isExtendedClass, mountExtend } from '../util/clazz.js';\nimport { makeInner, queryReferringComponents } from '../util/model.js';\nimport * as layout from '../util/layout.js';\nvar inner = makeInner();\n\nvar ComponentModel =\n/** @class */\nfunction (_super) {\n __extends(ComponentModel, _super);\n\n function ComponentModel(option, parentModel, ecModel) {\n var _this = _super.call(this, option, parentModel, ecModel) || this;\n\n _this.uid = componentUtil.getUID('ec_cpt_model');\n return _this;\n }\n\n ComponentModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n\n ComponentModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = layout.fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? layout.getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n zrUtil.merge(option, themeModel.get(this.mainType));\n zrUtil.merge(option, this.getDefaultOption());\n\n if (layoutMode) {\n layout.mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n ComponentModel.prototype.mergeOption = function (option, ecModel) {\n zrUtil.merge(this.option, option, true);\n var layoutMode = layout.fetchLayoutMode(this);\n\n if (layoutMode) {\n layout.mergeLayoutParam(this.option, option, layoutMode);\n }\n };\n /**\r\n * Called immediately after `init` or `mergeOption` of this instance called.\r\n */\n\n\n ComponentModel.prototype.optionUpdated = function (newCptOption, isInit) {};\n /**\r\n * [How to declare defaultOption]:\r\n *\r\n * (A) If using class declaration in typescript (since echarts 5):\r\n * ```ts\r\n * import {ComponentOption} from '../model/option.js';\r\n * export interface XxxOption extends ComponentOption {\r\n * aaa: number\r\n * }\r\n * export class XxxModel extends Component {\r\n * static type = 'xxx';\r\n * static defaultOption: XxxOption = {\r\n * aaa: 123\r\n * }\r\n * }\r\n * Component.registerClass(XxxModel);\r\n * ```\r\n * ```ts\r\n * import {inheritDefaultOption} from '../util/component.js';\r\n * import {XxxModel, XxxOption} from './XxxModel.js';\r\n * export interface XxxSubOption extends XxxOption {\r\n * bbb: number\r\n * }\r\n * class XxxSubModel extends XxxModel {\r\n * static defaultOption: XxxSubOption = inheritDefaultOption(XxxModel.defaultOption, {\r\n * bbb: 456\r\n * })\r\n * fn() {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {aaa: 123, bbb: 456}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * (B) If using class extend (previous approach in echarts 3 & 4):\r\n * ```js\r\n * let XxxComponent = Component.extend({\r\n * defaultOption: {\r\n * xx: 123\r\n * }\r\n * })\r\n * ```\r\n * ```js\r\n * let XxxSubComponent = XxxComponent.extend({\r\n * defaultOption: {\r\n * yy: 456\r\n * },\r\n * fn: function () {\r\n * let opt = this.getDefaultOption();\r\n * // opt is {xx: 123, yy: 456}\r\n * }\r\n * })\r\n * ```\r\n */\n\n\n ComponentModel.prototype.getDefaultOption = function () {\n var ctor = this.constructor; // If using class declaration, it is different to travel super class\n // in legacy env and auto merge defaultOption. So if using class\n // declaration, defaultOption should be merged manually.\n\n if (!isExtendedClass(ctor)) {\n // When using ts class, defaultOption must be declared as static.\n return ctor.defaultOption;\n } // FIXME: remove this approach?\n\n\n var fields = inner(this);\n\n if (!fields.defaultOption) {\n var optList = [];\n var clz = ctor;\n\n while (clz) {\n var opt = clz.prototype.defaultOption;\n opt && optList.push(opt);\n clz = clz.superClass;\n }\n\n var defaultOption = {};\n\n for (var i = optList.length - 1; i >= 0; i--) {\n defaultOption = zrUtil.merge(defaultOption, optList[i], true);\n }\n\n fields.defaultOption = defaultOption;\n }\n\n return fields.defaultOption;\n };\n /**\r\n * Notice: always force to input param `useDefault` in case that forget to consider it.\r\n * The same behavior as `modelUtil.parseFinder`.\r\n *\r\n * @param useDefault In many cases like series refer axis and axis refer grid,\r\n * If axis index / axis id not specified, use the first target as default.\r\n * In other cases like dataZoom refer axis, if not specified, measn no refer.\r\n */\n\n\n ComponentModel.prototype.getReferringComponents = function (mainType, opt) {\n var indexKey = mainType + 'Index';\n var idKey = mainType + 'Id';\n return queryReferringComponents(this.ecModel, mainType, {\n index: this.get(indexKey, true),\n id: this.get(idKey, true)\n }, opt);\n };\n\n ComponentModel.prototype.getBoxLayoutParams = function () {\n // Consider itself having box layout configs.\n var boxLayoutModel = this;\n return {\n left: boxLayoutModel.get('left'),\n top: boxLayoutModel.get('top'),\n right: boxLayoutModel.get('right'),\n bottom: boxLayoutModel.get('bottom'),\n width: boxLayoutModel.get('width'),\n height: boxLayoutModel.get('height')\n };\n };\n /**\r\n * Get key for zlevel.\r\n * If developers don't configure zlevel. We will assign zlevel to series based on the key.\r\n * For example, lines with trail effect and progressive series will in an individual zlevel.\r\n */\n\n\n ComponentModel.prototype.getZLevelKey = function () {\n return '';\n };\n\n ComponentModel.prototype.setZLevel = function (zlevel) {\n this.option.zlevel = zlevel;\n };\n\n ComponentModel.protoInitialize = function () {\n var proto = ComponentModel.prototype;\n proto.type = 'component';\n proto.id = '';\n proto.name = '';\n proto.mainType = '';\n proto.subType = '';\n proto.componentIndex = 0;\n }();\n\n return ComponentModel;\n}(Model);\n\nmountExtend(ComponentModel, Model);\nenableClassManagement(ComponentModel);\ncomponentUtil.enableSubTypeDefaulter(ComponentModel);\ncomponentUtil.enableTopologicalTravel(ComponentModel, getDependencies);\n\nfunction getDependencies(componentType) {\n var deps = [];\n zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (clz) {\n deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);\n }); // Ensure main type.\n\n deps = zrUtil.map(deps, function (type) {\n return parseClassType(type).main;\n }); // Hack dataset for convenience.\n\n if (componentType !== 'dataset' && zrUtil.indexOf(deps, 'dataset') <= 0) {\n deps.unshift('dataset');\n }\n\n return deps;\n}\n\nexport default ComponentModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar platform = ''; // Navigator not exists in node\n\nif (typeof navigator !== 'undefined') {\n /* global navigator */\n platform = navigator.platform || '';\n}\n\nvar decalColor = 'rgba(0, 0, 0, 0.2)';\nexport default {\n darkMode: 'auto',\n // backgroundColor: 'rgba(0,0,0,0)',\n colorBy: 'series',\n color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],\n gradientColor: ['#f6efa6', '#d88273', '#bf444c'],\n aria: {\n decal: {\n decals: [{\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [2, 5],\n symbolSize: 1,\n rotation: Math.PI / 6\n }, {\n color: decalColor,\n symbol: 'circle',\n dashArrayX: [[8, 8], [0, 8, 8, 0]],\n dashArrayY: [6, 0],\n symbolSize: 0.8\n }, {\n color: decalColor,\n dashArrayX: [1, 0],\n dashArrayY: [4, 3],\n rotation: -Math.PI / 4\n }, {\n color: decalColor,\n dashArrayX: [[6, 6], [0, 6, 6, 0]],\n dashArrayY: [6, 0]\n }, {\n color: decalColor,\n dashArrayX: [[1, 0], [1, 6]],\n dashArrayY: [1, 0, 6, 0],\n rotation: Math.PI / 4\n }, {\n color: decalColor,\n symbol: 'triangle',\n dashArrayX: [[9, 9], [0, 9, 9, 0]],\n dashArrayY: [7, 2],\n symbolSize: 0.75\n }]\n }\n },\n // If xAxis and yAxis declared, grid is created by default.\n // grid: {},\n textStyle: {\n // color: '#000',\n // decoration: 'none',\n // PENDING\n fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',\n // fontFamily: 'Arial, Verdana, sans-serif',\n fontSize: 12,\n fontStyle: 'normal',\n fontWeight: 'normal'\n },\n // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n // Default is source-over\n blendMode: null,\n stateAnimation: {\n duration: 300,\n easing: 'cubicOut'\n },\n animation: 'auto',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut',\n animationEasingUpdate: 'cubicInOut',\n animationThreshold: 2000,\n // Configuration for progressive/incremental rendering\n progressiveThreshold: 3000,\n progressive: 400,\n // Threshold of if use single hover layer to optimize.\n // It is recommended that `hoverLayerThreshold` is equivalent to or less than\n // `progressiveThreshold`, otherwise hover will cause restart of progressive,\n // which is unexpected.\n // see example .\n hoverLayerThreshold: 3000,\n // See: module:echarts/scale/Time\n useUTC: false\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\n;\n;\n;\nexport var VISUAL_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'itemGroupId', 'seriesName']);\nexport var SOURCE_FORMAT_ORIGINAL = 'original';\nexport var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nexport var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nexport var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nexport var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nexport var SOURCE_FORMAT_UNKNOWN = 'unknown';\nexport var SERIES_LAYOUT_BY_COLUMN = 'column';\nexport var SERIES_LAYOUT_BY_ROW = 'row';\n;\n;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, getDataItemValue, queryReferringComponents, SINGLE_REFERRING } from '../../util/model.js';\nimport { createHashMap, each, isArray, isString, isObject, isTypedArray } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW, SOURCE_FORMAT_KEYED_COLUMNS } from '../../util/types.js'; // The result of `guessOrdinal`.\n\nexport var BE_ORDINAL = {\n Must: 1,\n Might: 2,\n Not: 3 // Other cases\n\n};\nvar innerGlobalModel = makeInner();\n/**\r\n * MUST be called before mergeOption of all series.\r\n */\n\nexport function resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n innerGlobalModel(ecModel).datasetMap = createHashMap();\n}\n/**\r\n * [The strategy of the arrengment of data dimensions for dataset]:\r\n * \"value way\": all axes are non-category axes. So series one by one take\r\n * several (the number is coordSysDims.length) dimensions from dataset.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser0_x | ser0_y | ser1_x | ser1_y | ser2_x | ser2_y |\r\n * \"category way\": at least one axis is category axis. So the the first data\r\n * dimension is always mapped to the first category axis and shared by\r\n * all of the series. The other data dimensions are taken by series like\r\n * \"value way\" does.\r\n * The result of data arrengment of data dimensions like:\r\n * | ser_shared_x | ser0_y | ser1_y | ser2_y |\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\n\nexport function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel || !coordDimensions) {\n return encode;\n }\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var ecModel = seriesModel.ecModel;\n var datasetMap = innerGlobalModel(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + source.seriesLayoutBy;\n var baseCategoryDimIndex;\n var categoryWayValueDimStart;\n coordDimensions = coordDimensions.slice();\n each(coordDimensions, function (coordDimInfoLoose, coordDimIdx) {\n var coordDimInfo = isObject(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {\n name: coordDimInfoLoose\n };\n\n if (coordDimInfo.type === 'ordinal' && baseCategoryDimIndex == null) {\n baseCategoryDimIndex = coordDimIdx;\n categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);\n }\n\n encode[coordDimInfo.name] = [];\n });\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: categoryWayValueDimStart,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordDimensions, function (coordDimInfo, coordDimIdx) {\n var coordDimName = coordDimInfo.name;\n var count = getDataDimCountOnCoordDim(coordDimInfo); // In value way.\n\n if (baseCategoryDimIndex == null) {\n var start = datasetRecord.valueWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.valueWayDim += count; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when multiple series share one dimension\n // category axis, series name should better use\n // the other dimension name. On the other hand, use\n // both dimensions name.\n } // In category way, the first category axis.\n else if (baseCategoryDimIndex === coordDimIdx) {\n pushDim(encode[coordDimName], 0, count);\n pushDim(encodeItemName, 0, count);\n } // In category way, the other axis.\n else {\n var start = datasetRecord.categoryWayDim;\n pushDim(encode[coordDimName], start, count);\n pushDim(encodeSeriesName, start, count);\n datasetRecord.categoryWayDim += count;\n }\n });\n\n function pushDim(dimIdxArr, idxFrom, idxCount) {\n for (var i = 0; i < idxCount; i++) {\n dimIdxArr.push(idxFrom + i);\n }\n }\n\n function getDataDimCountOnCoordDim(coordDimInfo) {\n var dimsDef = coordDimInfo.dimsDef;\n return dimsDef ? dimsDef.length : 1;\n }\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\r\n * Work for data like [{name: ..., value: ...}, ...].\r\n *\r\n * @return encode Never be `null/undefined`.\r\n */\n\nexport function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {\n var encode = {};\n var datasetModel = querySeriesUpstreamDatasetModel(seriesModel); // Currently only make default when using dataset, util more reqirements occur.\n\n if (!datasetModel) {\n return encode;\n }\n\n var sourceFormat = source.sourceFormat;\n var dimensionsDefine = source.dimensionsDefine;\n var potentialNameDimIndex;\n\n if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n var idxResult = function () {\n var idxRes0 = {};\n var idxRes1 = {};\n var guessRecords = []; // 5 is an experience value.\n\n for (var i = 0, len = Math.min(5, dimCount); i < len; i++) {\n var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i);\n guessRecords.push(guessResult);\n var isPureNumber = guessResult === BE_ORDINAL.Not; // [Strategy of idxRes0]: find the first BE_ORDINAL.Not as the value dim,\n // and then find a name dim with the priority:\n // \"BE_ORDINAL.Might|BE_ORDINAL.Must\" > \"other dim\" > \"the value dim itself\".\n\n if (isPureNumber && idxRes0.v == null && i !== potentialNameDimIndex) {\n idxRes0.v = i;\n }\n\n if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {\n idxRes0.n = i;\n }\n\n if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {\n return idxRes0;\n } // [Strategy of idxRes1]: if idxRes0 not satisfied (that is, no BE_ORDINAL.Not),\n // find the first BE_ORDINAL.Might as the value dim,\n // and then find a name dim with the priority:\n // \"other dim\" > \"the value dim itself\".\n // That is for backward compat: number-like (e.g., `'3'`, `'55'`) can be\n // treated as number.\n\n\n if (!isPureNumber) {\n if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i !== potentialNameDimIndex) {\n idxRes1.v = i;\n }\n\n if (idxRes1.n == null || idxRes1.n === idxRes1.v) {\n idxRes1.n = i;\n }\n }\n }\n\n function fulfilled(idxResult) {\n return idxResult.v != null && idxResult.n != null;\n }\n\n return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;\n }();\n\n if (idxResult) {\n encode.value = [idxResult.v]; // `potentialNameDimIndex` has highest priority.\n\n var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n; // By default, label uses itemName in charts.\n // So we don't set encodeLabel here.\n\n encode.itemName = [nameDimIndex];\n encode.seriesName = [nameDimIndex];\n }\n\n return encode;\n}\n/**\r\n * @return If return null/undefined, indicate that should not use datasetModel.\r\n */\n\nexport function querySeriesUpstreamDatasetModel(seriesModel) {\n // 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 var thisData = seriesModel.get('data', true);\n\n if (!thisData) {\n return queryReferringComponents(seriesModel.ecModel, 'dataset', {\n index: seriesModel.get('datasetIndex', true),\n id: seriesModel.get('datasetId', true)\n }, SINGLE_REFERRING).models[0];\n }\n}\n/**\r\n * @return Always return an array event empty.\r\n */\n\nexport function queryDatasetUpstreamDatasetModels(datasetModel) {\n // Only these attributes declared, we by defualt reference to `datasetIndex: 0`.\n // Otherwise, no reference.\n if (!datasetModel.get('transform', true) && !datasetModel.get('fromTransformResult', true)) {\n return [];\n }\n\n return queryReferringComponents(datasetModel.ecModel, 'dataset', {\n index: datasetModel.get('fromDatasetIndex', true),\n id: datasetModel.get('fromDatasetId', true)\n }, SINGLE_REFERRING).models;\n}\n/**\r\n * The rule should not be complex, otherwise user might not\r\n * be able to known where the data is wrong.\r\n * The code is ugly, but how to make it neat?\r\n */\n\nexport function 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// return {BE_ORDINAL}\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 BE_ORDINAL.Not;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n var dimType;\n\n if (dimensionsDefine) {\n var dimDefItem = dimensionsDefine[dimIndex];\n\n if (isObject(dimDefItem)) {\n dimName = dimDefItem.name;\n dimType = dimDefItem.type;\n } else if (isString(dimDefItem)) {\n dimName = dimDefItem;\n }\n }\n\n if (dimType != null) {\n return dimType === 'ordinal' ? BE_ORDINAL.Must : BE_ORDINAL.Not;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data;\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = dataArrayRows[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 < dataArrayRows.length && i < maxLoop; i++) {\n var row = dataArrayRows[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 var dataObjectRows = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n for (var i = 0; i < dataObjectRows.length && i < maxLoop; i++) {\n var item = dataObjectRows[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n var dataKeyedColumns = data;\n\n if (!dimName) {\n return BE_ORDINAL.Not;\n }\n\n var sample = dataKeyedColumns[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return BE_ORDINAL.Not;\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 var dataOriginal = data;\n\n for (var i = 0; i < dataOriginal.length && i < maxLoop; i++) {\n var item = dataOriginal[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return BE_ORDINAL.Not;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n var beStr = isString(val); // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n\n if (val != null && isFinite(val) && val !== '') {\n return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;\n } else if (beStr && val !== '-') {\n return BE_ORDINAL.Must;\n }\n }\n\n return BE_ORDINAL.Not;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, assert } from 'zrender/lib/core/util.js';\nimport { isComponentIdInternal } from '../util/model.js';\nvar internalOptionCreatorMap = createHashMap();\nexport function registerInternalOptionCreator(mainType, creator) {\n assert(internalOptionCreatorMap.get(mainType) == null && creator);\n internalOptionCreatorMap.set(mainType, creator);\n}\nexport function concatInternalOptions(ecModel, mainType, newCmptOptionList) {\n var internalOptionCreator = internalOptionCreatorMap.get(mainType);\n\n if (!internalOptionCreator) {\n return newCmptOptionList;\n }\n\n var internalOptions = internalOptionCreator(ecModel);\n\n if (!internalOptions) {\n return newCmptOptionList;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n for (var i = 0; i < internalOptions.length; i++) {\n assert(isComponentIdInternal(internalOptions[i]));\n }\n }\n\n return newCmptOptionList.concat(internalOptions);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, normalizeToArray } from '../../util/model.js';\nvar innerColor = makeInner();\nvar innerDecal = makeInner();\n\nvar PaletteMixin =\n/** @class */\nfunction () {\n function PaletteMixin() {}\n\n PaletteMixin.prototype.getColorFromPalette = function (name, scope, requestNum) {\n var defaultPalette = normalizeToArray(this.get('color', true));\n var layeredPalette = this.get('colorLayer', true);\n return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);\n };\n\n PaletteMixin.prototype.clearColorPalette = function () {\n clearPalette(this, innerColor);\n };\n\n return PaletteMixin;\n}();\n\nexport function getDecalFromPalette(ecModel, name, scope, requestNum) {\n var defaultDecals = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);\n}\n\nfunction getNearestPalette(palettes, requestColorNum) {\n var paletteNum = palettes.length; // TODO palettes must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (palettes[i].length > requestColorNum) {\n return palettes[i];\n }\n }\n\n return palettes[paletteNum - 1];\n}\n/**\r\n * @param name MUST NOT be null/undefined. Otherwise call this function\r\n * twise with the same parameters will get different result.\r\n * @param scope default this.\r\n * @return Can be null/undefined\r\n */\n\n\nfunction getFromPalette(that, inner, defaultPalette, layeredPalette, name, scope, requestNum) {\n scope = scope || that;\n var scopeFields = inner(scope);\n var paletteIdx = scopeFields.paletteIdx || 0;\n var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (paletteNameMap.hasOwnProperty(name)) {\n return paletteNameMap[name];\n }\n\n var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum); // In case can't find in layered color palette.\n\n palette = palette || defaultPalette;\n\n if (!palette || !palette.length) {\n return;\n }\n\n var pickedPaletteItem = palette[paletteIdx];\n\n if (name) {\n paletteNameMap[name] = pickedPaletteItem;\n }\n\n scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;\n return pickedPaletteItem;\n}\n\nfunction clearPalette(that, inner) {\n inner(that).paletteIdx = 0;\n inner(that).paletteNameMap = {};\n}\n\nexport { PaletteMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Caution: If the mechanism should be changed some day, these cases\r\n * should be considered:\r\n *\r\n * (1) In `merge option` mode, if using the same option to call `setOption`\r\n * many times, the result should be the same (try our best to ensure that).\r\n * (2) In `merge option` mode, if a component has no id/name specified, it\r\n * will be merged by index, and the result sequence of the components is\r\n * consistent to the original sequence.\r\n * (3) In `replaceMerge` mode, keep the result sequence of the components is\r\n * consistent to the original sequence, even though there might result in \"hole\".\r\n * (4) `reset` feature (in toolbox). Find detailed info in comments about\r\n * `mergeOption` in module:echarts/model/OptionManager.\r\n */\n\nimport { each, filter, isArray, isObject, isString, createHashMap, assert, clone, merge, extend, mixin, isFunction } from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../util/model.js';\nimport Model from './Model.js';\nimport ComponentModel from './Component.js';\nimport globalDefault from './globalDefault.js';\nimport { resetSourceDefaulter } from '../data/helper/sourceHelper.js';\nimport { concatInternalOptions } from './internalComponentCreator.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { error, warn } from '../util/log.js'; // -----------------------\n// Internal method names:\n// -----------------------\n\nvar reCreateSeriesIndices;\nvar assertSeriesInitialized;\nvar initBase;\nvar OPTION_INNER_KEY = '\\0_ec_inner';\nvar OPTION_INNER_VALUE = 1;\nvar BUITIN_COMPONENTS_MAP = {\n grid: 'GridComponent',\n polar: 'PolarComponent',\n geo: 'GeoComponent',\n singleAxis: 'SingleAxisComponent',\n parallel: 'ParallelComponent',\n calendar: 'CalendarComponent',\n graphic: 'GraphicComponent',\n toolbox: 'ToolboxComponent',\n tooltip: 'TooltipComponent',\n axisPointer: 'AxisPointerComponent',\n brush: 'BrushComponent',\n title: 'TitleComponent',\n timeline: 'TimelineComponent',\n markPoint: 'MarkPointComponent',\n markLine: 'MarkLineComponent',\n markArea: 'MarkAreaComponent',\n legend: 'LegendComponent',\n dataZoom: 'DataZoomComponent',\n visualMap: 'VisualMapComponent',\n // aria: 'AriaComponent',\n // dataset: 'DatasetComponent',\n // Dependencies\n xAxis: 'GridComponent',\n yAxis: 'GridComponent',\n angleAxis: 'PolarComponent',\n radiusAxis: 'PolarComponent'\n};\nvar BUILTIN_CHARTS_MAP = {\n line: 'LineChart',\n bar: 'BarChart',\n pie: 'PieChart',\n scatter: 'ScatterChart',\n radar: 'RadarChart',\n map: 'MapChart',\n tree: 'TreeChart',\n treemap: 'TreemapChart',\n graph: 'GraphChart',\n gauge: 'GaugeChart',\n funnel: 'FunnelChart',\n parallel: 'ParallelChart',\n sankey: 'SankeyChart',\n boxplot: 'BoxplotChart',\n candlestick: 'CandlestickChart',\n effectScatter: 'EffectScatterChart',\n lines: 'LinesChart',\n heatmap: 'HeatmapChart',\n pictorialBar: 'PictorialBarChart',\n themeRiver: 'ThemeRiverChart',\n sunburst: 'SunburstChart',\n custom: 'CustomChart'\n};\nvar componetsMissingLogPrinted = {};\n\nfunction checkMissingComponents(option) {\n each(option, function (componentOption, mainType) {\n if (!ComponentModel.hasClass(mainType)) {\n var componentImportName = BUITIN_COMPONENTS_MAP[mainType];\n\n if (componentImportName && !componetsMissingLogPrinted[componentImportName]) {\n error(\"Component \" + mainType + \" is used but not imported.\\nimport { \" + componentImportName + \" } from 'echarts/components';\\necharts.use([\" + componentImportName + \"]);\");\n componetsMissingLogPrinted[componentImportName] = true;\n }\n }\n });\n}\n\nvar GlobalModel =\n/** @class */\nfunction (_super) {\n __extends(GlobalModel, _super);\n\n function GlobalModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GlobalModel.prototype.init = function (option, parentModel, ecModel, theme, locale, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n this._theme = new Model(theme);\n this._locale = new Model(locale);\n this._optionManager = optionManager;\n };\n\n GlobalModel.prototype.setOption = function (option, opts, optionPreprocessorFuncs) {\n if (process.env.NODE_ENV !== 'production') {\n assert(option != null, 'option is null/undefined');\n assert(option[OPTION_INNER_KEY] !== OPTION_INNER_VALUE, 'please use chart.getOption()');\n }\n\n var innerOpt = normalizeSetOptionInput(opts);\n\n this._optionManager.setOption(option, optionPreprocessorFuncs, innerOpt);\n\n this._resetOption(null, innerOpt);\n };\n /**\r\n * @param type null/undefined: reset all.\r\n * 'recreate': force recreate all.\r\n * 'timeline': only reset timeline option\r\n * 'media': only reset media query option\r\n * @return Whether option changed.\r\n */\n\n\n GlobalModel.prototype.resetOption = function (type, opt) {\n return this._resetOption(type, normalizeSetOptionInput(opt));\n };\n\n GlobalModel.prototype._resetOption = function (type, opt) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (process.env.NODE_ENV !== 'production') {\n checkMissingComponents(baseOption);\n }\n\n if (!this.option || type === 'recreate') {\n initBase(this, baseOption);\n } else {\n this.restoreData();\n\n this._mergeOption(baseOption, opt);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n } // By design, if `setOption(option2)` at the second time, and `option2` is a `ECUnitOption`,\n // it should better not have the same props with `MediaUnit['option']`.\n // Because either `option2` or `MediaUnit['option']` will be always merged to \"current option\"\n // rather than original \"baseOption\". If they both override a prop, the result might be\n // unexpected when media state changed after `setOption` called.\n // If we really need to modify a props in each `MediaUnit['option']`, use the full version\n // (`{baseOption, media}`) in `setOption`.\n // For `timeline`, the case is the same.\n\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n\n if (timelineOption) {\n optionChanged = true;\n\n this._mergeOption(timelineOption, opt);\n }\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n optionChanged = true;\n\n this._mergeOption(mediaOption, opt);\n }, this);\n }\n }\n\n return optionChanged;\n };\n\n GlobalModel.prototype.mergeOption = function (option) {\n this._mergeOption(option, null);\n };\n\n GlobalModel.prototype._mergeOption = function (newOption, opt) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var componentsCount = this._componentsCount;\n var newCmptTypes = [];\n var newCmptTypeMap = createHashMap();\n var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCmptTypes.push(mainType);\n newCmptTypeMap.set(mainType, true);\n }\n });\n\n if (replaceMergeMainTypeMap) {\n // If there is a mainType `xxx` in `replaceMerge` but not declared in option,\n // we trade it as it is declared in option as `{xxx: []}`. Because:\n // (1) for normal merge, `{xxx: null/undefined}` are the same meaning as `{xxx: []}`.\n // (2) some preprocessor may convert some of `{xxx: null/undefined}` to `{xxx: []}`.\n replaceMergeMainTypeMap.each(function (val, mainTypeInReplaceMerge) {\n if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {\n newCmptTypes.push(mainTypeInReplaceMerge);\n newCmptTypeMap.set(mainTypeInReplaceMerge, true);\n }\n });\n }\n\n ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType) {\n var newCmptOptionList = concatInternalOptions(this, mainType, modelUtil.normalizeToArray(newOption[mainType]));\n var oldCmptList = componentsMap.get(mainType);\n var mergeMode = // `!oldCmptList` means init. See the comment in `mappingToExists`\n !oldCmptList ? 'replaceAll' : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? 'replaceMerge' : 'normalMerge';\n var mappingResult = modelUtil.mappingToExists(oldCmptList, newCmptOptionList, mergeMode); // Set mainType and complete subType.\n\n modelUtil.setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel); // Empty it before the travel, in order to prevent `this._componentsMap`\n // from being used in the `init`/`mergeOption`/`optionUpdated` of some\n // components, which is probably incorrect logic.\n\n option[mainType] = null;\n componentsMap.set(mainType, null);\n componentsCount.set(mainType, 0);\n var optionsByMainType = [];\n var cmptsByMainType = [];\n var cmptsCountByMainType = 0;\n var tooltipExists;\n var tooltipWarningLogged;\n each(mappingResult, function (resultItem, index) {\n var componentModel = resultItem.existing;\n var newCmptOption = resultItem.newOption;\n\n if (!newCmptOption) {\n if (componentModel) {\n // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } // If no both `resultItem.exist` and `resultItem.option`,\n // either it is in `replaceMerge` and not matched by any id,\n // or it has been removed in previous `replaceMerge` and left a \"hole\" in this component index.\n\n } else {\n var isSeriesType = mainType === 'series';\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, !isSeriesType // Give a more detailed warn later if series don't exists\n );\n\n if (!ComponentModelClass) {\n if (process.env.NODE_ENV !== 'production') {\n var subType = resultItem.keyInfo.subType;\n var seriesImportName = BUILTIN_CHARTS_MAP[subType];\n\n if (!componetsMissingLogPrinted[subType]) {\n componetsMissingLogPrinted[subType] = true;\n\n if (seriesImportName) {\n error(\"Series \" + subType + \" is used but not imported.\\nimport { \" + seriesImportName + \" } from 'echarts/charts';\\necharts.use([\" + seriesImportName + \"]);\");\n } else {\n error(\"Unknown series \" + subType);\n }\n }\n }\n\n return;\n } // TODO Before multiple tooltips get supported, we do this check to avoid unexpected exception.\n\n\n if (mainType === 'tooltip') {\n if (tooltipExists) {\n if (process.env.NODE_ENV !== 'production') {\n if (!tooltipWarningLogged) {\n warn('Currently only one tooltip component is allowed.');\n tooltipWarningLogged = true;\n }\n }\n\n return;\n }\n\n tooltipExists = true;\n }\n\n if (componentModel && componentModel.constructor === ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCmptOption, this);\n componentModel.optionUpdated(newCmptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt); // Assign `keyInfo`\n\n extend(componentModel, extraOpt);\n\n if (resultItem.brandNew) {\n componentModel.__requireNewView = true;\n }\n\n componentModel.init(newCmptOption, this, this); // Call optionUpdated after init.\n // newCmptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n if (componentModel) {\n optionsByMainType.push(componentModel.option);\n cmptsByMainType.push(componentModel);\n cmptsCountByMainType++;\n } else {\n // Always do assign to avoid elided item in array.\n optionsByMainType.push(void 0);\n cmptsByMainType.push(void 0);\n }\n }, this);\n option[mainType] = optionsByMainType;\n componentsMap.set(mainType, cmptsByMainType);\n componentsCount.set(mainType, cmptsCountByMainType); // Backup series for filtering.\n\n if (mainType === 'series') {\n reCreateSeriesIndices(this);\n }\n } // If no series declared, ensure `_seriesIndices` initialized.\n\n\n if (!this._seriesIndices) {\n reCreateSeriesIndices(this);\n }\n };\n /**\r\n * Get option for output (cloned option and inner info removed)\r\n */\n\n\n GlobalModel.prototype.getOption = function () {\n var option = clone(this.option);\n each(option, function (optInMainType, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(optInMainType); // Inner cmpts need to be removed.\n // Inner cmpts might not be at last since ec5.0, but still\n // compatible for users: if inner cmpt at last, splice the returned array.\n\n var realLen = opts.length;\n var metNonInner = false;\n\n for (var i = realLen - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (opts[i] && !modelUtil.isComponentIdInternal(opts[i])) {\n metNonInner = true;\n } else {\n opts[i] = null;\n !metNonInner && realLen--;\n }\n }\n\n opts.length = realLen;\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n };\n\n GlobalModel.prototype.getTheme = function () {\n return this._theme;\n };\n\n GlobalModel.prototype.getLocaleModel = function () {\n return this._locale;\n };\n\n GlobalModel.prototype.setUpdatePayload = function (payload) {\n this._payload = payload;\n };\n\n GlobalModel.prototype.getUpdatePayload = function () {\n return this._payload;\n };\n /**\r\n * @param idx If not specified, return the first one.\r\n */\n\n\n GlobalModel.prototype.getComponent = function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n var cmpt = list[idx || 0];\n\n if (cmpt) {\n return cmpt;\n } else if (idx == null) {\n for (var i = 0; i < list.length; i++) {\n if (list[i]) {\n return list[i];\n }\n }\n }\n }\n };\n /**\r\n * @return Never be null/undefined.\r\n */\n\n\n GlobalModel.prototype.queryComponents = function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cmpts = this._componentsMap.get(mainType);\n\n if (!cmpts || !cmpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n result = [];\n each(modelUtil.normalizeToArray(index), function (idx) {\n cmpts[idx] && result.push(cmpts[idx]);\n });\n } else if (id != null) {\n result = queryByIdOrName('id', id, cmpts);\n } else if (name != null) {\n result = queryByIdOrName('name', name, cmpts);\n } else {\n // Return all non-empty components in that mainType\n result = filter(cmpts, function (cmpt) {\n return !!cmpt;\n });\n }\n\n return filterBySubType(result, condition);\n };\n /**\r\n * The interface is different from queryComponents,\r\n * which is convenient for inner usage.\r\n *\r\n * @usage\r\n * let result = findComponents(\r\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\r\n * );\r\n * let result = findComponents(\r\n * {mainType: 'series',\r\n * filter: function (model, index) {...}}\r\n * );\r\n * // result like [component0, componnet1, ...]\r\n */\n\n\n GlobalModel.prototype.findComponents = function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) // Retrieve all non-empty components.\n : filter(this._componentsMap.get(mainType), function (cmpt) {\n return !!cmpt;\n });\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n };\n\n GlobalModel.prototype.eachComponent = function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (isFunction(mainType)) {\n var ctxForAll_1 = cb;\n var cbForAll_1 = mainType;\n componentsMap.each(function (cmpts, componentType) {\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cbForAll_1.call(ctxForAll_1, componentType, cmpt, cmpt.componentIndex);\n }\n });\n } else {\n var cmpts = isString(mainType) ? componentsMap.get(mainType) : isObject(mainType) ? this.findComponents(mainType) : null;\n\n for (var i = 0; cmpts && i < cmpts.length; i++) {\n var cmpt = cmpts[i];\n cmpt && cb.call(context, cmpt, cmpt.componentIndex);\n }\n }\n };\n /**\r\n * Get series list before filtered by name.\r\n */\n\n\n GlobalModel.prototype.getSeriesByName = function (name) {\n var nameStr = modelUtil.convertOptionIdName(name, null);\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && nameStr != null && oneSeries.name === nameStr;\n });\n };\n /**\r\n * Get series list before filtered by index.\r\n */\n\n\n GlobalModel.prototype.getSeriesByIndex = function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n };\n /**\r\n * Get series list before filtered by type.\r\n * FIXME: rename to getRawSeriesByType?\r\n */\n\n\n GlobalModel.prototype.getSeriesByType = function (subType) {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries && oneSeries.subType === subType;\n });\n };\n /**\r\n * Get all series before filtered.\r\n */\n\n\n GlobalModel.prototype.getSeries = function () {\n return filter(this._componentsMap.get('series'), function (oneSeries) {\n return !!oneSeries;\n });\n };\n /**\r\n * Count series before filtered.\r\n */\n\n\n GlobalModel.prototype.getSeriesCount = function () {\n return this._componentsCount.get('series');\n };\n /**\r\n * After filtering, series may be different\r\n * from raw series.\r\n */\n\n\n GlobalModel.prototype.eachSeries = function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n };\n /**\r\n * Iterate raw series before filtered.\r\n *\r\n * @param {Function} cb\r\n * @param {*} context\r\n */\n\n\n GlobalModel.prototype.eachRawSeries = function (cb, context) {\n each(this._componentsMap.get('series'), function (series) {\n series && cb.call(context, series, series.componentIndex);\n });\n };\n /**\r\n * After filtering, series may be different.\r\n * from raw series.\r\n */\n\n\n GlobalModel.prototype.eachSeriesByType = function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n };\n /**\r\n * Iterate raw series before filtered of given type.\r\n */\n\n\n GlobalModel.prototype.eachRawSeriesByType = function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n };\n\n GlobalModel.prototype.isSeriesFiltered = function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n };\n\n GlobalModel.prototype.getCurrentSeriesIndices = function () {\n return (this._seriesIndices || []).slice();\n };\n\n GlobalModel.prototype.filterSeries = function (cb, context) {\n assertSeriesInitialized(this);\n var newSeriesIndices = [];\n each(this._seriesIndices, function (seriesRawIdx) {\n var series = this._componentsMap.get('series')[seriesRawIdx];\n\n cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);\n }, this);\n this._seriesIndices = newSeriesIndices;\n this._seriesIndicesMap = createHashMap(newSeriesIndices);\n };\n\n GlobalModel.prototype.restoreData = function (payload) {\n reCreateSeriesIndices(this);\n var componentsMap = this._componentsMap;\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n if (ComponentModel.hasClass(componentType)) {\n componentTypes.push(componentType);\n }\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType) {\n each(componentsMap.get(componentType), function (component) {\n if (component && (componentType !== 'series' || !isNotTargetSeries(component, payload))) {\n component.restoreData();\n }\n });\n });\n };\n\n GlobalModel.internalField = function () {\n reCreateSeriesIndices = function (ecModel) {\n var seriesIndices = ecModel._seriesIndices = [];\n each(ecModel._componentsMap.get('series'), function (series) {\n // series may have been removed by `replaceMerge`.\n series && seriesIndices.push(series.componentIndex);\n });\n ecModel._seriesIndicesMap = createHashMap(seriesIndices);\n };\n\n assertSeriesInitialized = function (ecModel) {\n // Components that use _seriesIndices should depends on series component,\n // which make sure that their initialization is after series.\n if (process.env.NODE_ENV !== 'production') {\n if (!ecModel._seriesIndices) {\n throw new Error('Option should contains series.');\n }\n }\n };\n\n initBase = function (ecModel, baseOption) {\n // Using OPTION_INNER_KEY to mark that this option cannot be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbidden.\n ecModel.option = {};\n ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE; // Init with series: [], in case of calling findSeries method\n // before series initialized.\n\n ecModel._componentsMap = createHashMap({\n series: []\n });\n ecModel._componentsCount = createHashMap(); // If user spefied `option.aria`, aria will be enable. This detection should be\n // performed before theme and globalDefault merge.\n\n var airaOption = baseOption.aria;\n\n if (isObject(airaOption) && airaOption.enabled == null) {\n airaOption.enabled = true;\n }\n\n mergeTheme(baseOption, ecModel._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n\n ecModel._mergeOption(baseOption, null);\n };\n }();\n\n return GlobalModel;\n}(Model);\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seriesIndex;\n var id = payload.seriesId;\n var name_1 = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;\n }\n}\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // If it is component model mainType, the model handles that merge later.\n // otherwise, merge them here.\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction queryByIdOrName(attr, idOrName, cmpts) {\n // Here is a break from echarts4: string and number are\n // treated as equal.\n if (isArray(idOrName)) {\n var keyMap_1 = createHashMap();\n each(idOrName, function (idOrNameItem) {\n if (idOrNameItem != null) {\n var idName = modelUtil.convertOptionIdName(idOrNameItem, null);\n idName != null && keyMap_1.set(idOrNameItem, true);\n }\n });\n return filter(cmpts, function (cmpt) {\n return cmpt && keyMap_1.get(cmpt[attr]);\n });\n } else {\n var idName_1 = modelUtil.convertOptionIdName(idOrName, null);\n return filter(cmpts, function (cmpt) {\n return cmpt && idName_1 != null && cmpt[attr] === idName_1;\n });\n }\n}\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cmpt) {\n return cmpt && cmpt.subType === condition.subType;\n }) : components;\n}\n\nfunction normalizeSetOptionInput(opts) {\n var replaceMergeMainTypeMap = createHashMap();\n opts && each(modelUtil.normalizeToArray(opts.replaceMerge), function (mainType) {\n if (process.env.NODE_ENV !== 'production') {\n assert(ComponentModel.hasClass(mainType), '\"' + mainType + '\" is not valid component main type in \"replaceMerge\"');\n }\n\n replaceMergeMainTypeMap.set(mainType, true);\n });\n return {\n replaceMergeMainTypeMap: replaceMergeMainTypeMap\n };\n}\n\nmixin(GlobalModel, PaletteMixin);\nexport default GlobalModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isSSR', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', // 'getModel',\n'getOption', // 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\n\nvar ExtensionAPI =\n/** @class */\nfunction () {\n function ExtensionAPI(ecInstance) {\n zrUtil.each(availableMethods, function (methodName) {\n this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n }, this);\n }\n\n return ExtensionAPI;\n}();\n\nexport default ExtensionAPI;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar coordinateSystemCreators = {};\n\nvar CoordinateSystemManager =\n/** @class */\nfunction () {\n function CoordinateSystemManager() {\n this._coordinateSystems = [];\n }\n\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creator, type) {\n var list = creator.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n };\n\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n };\n\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n return this._coordinateSystems.slice();\n };\n\n CoordinateSystemManager.register = function (type, creator) {\n coordinateSystemCreators[type] = creator;\n };\n\n CoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n };\n\n return CoordinateSystemManager;\n}();\n\nexport default CoordinateSystemManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { normalizeToArray // , MappingExistingItem, setComponentTypeToKeyInfo, mappingToExists\n} from '../util/model.js';\nimport { each, clone, map, isTypedArray, setAsPrimitive, isArray, isObject // , HashMap , createHashMap, extend, merge,\n} from 'zrender/lib/core/util.js';\nimport { error } from '../util/log.js';\nvar QUERY_REG = /^(min|max)?(.+)$/; // Key: mainType\n// type FakeComponentsMap = HashMap<(MappingExistingItem & { subType: string })[]>;\n\n/**\r\n * TERM EXPLANATIONS:\r\n * See `ECOption` and `ECUnitOption` in `src/util/types.ts`.\r\n */\n\nvar OptionManager =\n/** @class */\nfunction () {\n // timeline.notMerge is not supported in ec3. Firstly there is rearly\n // case that notMerge is needed. Secondly supporting 'notMerge' requires\n // rawOption cloned and backuped when timeline changed, which does no\n // good to performance. What's more, that both timeline and setOption\n // method supply 'notMerge' brings complex and some problems.\n // Consider this case:\n // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);\n // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);\n function OptionManager(api) {\n this._timelineOptions = [];\n this._mediaList = [];\n /**\r\n * -1, means default.\r\n * empty means no media.\r\n */\n\n this._currentMediaIndices = [];\n this._api = api;\n }\n\n OptionManager.prototype.setOption = function (rawOption, optionPreprocessorFuncs, opt) {\n if (rawOption) {\n // That set dat primitive is dangerous if user reuse the data when setOption again.\n each(normalizeToArray(rawOption.series), function (series) {\n series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data);\n });\n each(normalizeToArray(rawOption.dataset), function (dataset) {\n dataset && dataset.source && isTypedArray(dataset.source) && setAsPrimitive(dataset.source);\n });\n } // Caution: some series modify option data, if do not clone,\n // it should ensure that the repeat modify correctly\n // (create a new object when modify itself).\n\n\n rawOption = clone(rawOption); // FIXME\n // If some property is set in timeline options or media option but\n // not set in baseOption, a warning should be given.\n\n var optionBackup = this._optionBackup;\n var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs, !optionBackup);\n this._newBaseOption = newParsedOption.baseOption; // For setOption at second time (using merge mode);\n\n if (optionBackup) {\n // FIXME\n // the restore merge solution is essentially incorrect.\n // the mapping can not be 100% consistent with ecModel, which probably brings\n // potential bug!\n // The first merge is delayed, because in most cases, users do not call `setOption` twice.\n // let fakeCmptsMap = this._fakeCmptsMap;\n // if (!fakeCmptsMap) {\n // fakeCmptsMap = this._fakeCmptsMap = createHashMap();\n // mergeToBackupOption(fakeCmptsMap, null, optionBackup.baseOption, null);\n // }\n // mergeToBackupOption(\n // fakeCmptsMap, optionBackup.baseOption, newParsedOption.baseOption, opt\n // );\n // For simplicity, timeline options and media options do not support merge,\n // that is, if you `setOption` twice and both has timeline options, the latter\n // timeline options will not be merged to the former, but just substitute them.\n if (newParsedOption.timelineOptions.length) {\n optionBackup.timelineOptions = newParsedOption.timelineOptions;\n }\n\n if (newParsedOption.mediaList.length) {\n optionBackup.mediaList = newParsedOption.mediaList;\n }\n\n if (newParsedOption.mediaDefault) {\n optionBackup.mediaDefault = newParsedOption.mediaDefault;\n }\n } else {\n this._optionBackup = newParsedOption;\n }\n };\n\n OptionManager.prototype.mountOption = function (isRecreate) {\n var optionBackup = this._optionBackup;\n this._timelineOptions = optionBackup.timelineOptions;\n this._mediaList = optionBackup.mediaList;\n this._mediaDefault = optionBackup.mediaDefault;\n this._currentMediaIndices = [];\n return clone(isRecreate // this._optionBackup.baseOption, which is created at the first `setOption`\n // called, and is merged into every new option by inner method `mergeToBackupOption`\n // each time `setOption` called, can be only used in `isRecreate`, because\n // its reliability is under suspicion. In other cases option merge is\n // performed by `model.mergeOption`.\n ? optionBackup.baseOption : this._newBaseOption);\n };\n\n OptionManager.prototype.getTimelineOption = function (ecModel) {\n var option;\n var timelineOptions = this._timelineOptions;\n\n if (timelineOptions.length) {\n // getTimelineOption can only be called after ecModel inited,\n // so we can get currentIndex from timelineModel.\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel) {\n option = clone( // FIXME:TS as TimelineModel or quivlant interface\n timelineOptions[timelineModel.getCurrentIndex()]);\n }\n }\n\n return option;\n };\n\n OptionManager.prototype.getMediaOption = function (ecModel) {\n var ecWidth = this._api.getWidth();\n\n var ecHeight = this._api.getHeight();\n\n var mediaList = this._mediaList;\n var mediaDefault = this._mediaDefault;\n var indices = [];\n var result = []; // No media defined.\n\n if (!mediaList.length && !mediaDefault) {\n return result;\n } // Multi media may be applied, the latter defined media has higher priority.\n\n\n for (var i = 0, len = mediaList.length; i < len; i++) {\n if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {\n indices.push(i);\n }\n } // FIXME\n // Whether mediaDefault should force users to provide? Otherwise\n // the change by media query can not be recorvered.\n\n\n if (!indices.length && mediaDefault) {\n indices = [-1];\n }\n\n if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {\n result = map(indices, function (index) {\n return clone(index === -1 ? mediaDefault.option : mediaList[index].option);\n });\n } // Otherwise return nothing.\n\n\n this._currentMediaIndices = indices;\n return result;\n };\n\n return OptionManager;\n}();\n/**\r\n * [RAW_OPTION_PATTERNS]\r\n * (Note: \"series: []\" represents all other props in `ECUnitOption`)\r\n *\r\n * (1) No prop \"baseOption\" declared:\r\n * Root option is used as \"baseOption\" (except prop \"options\" and \"media\").\r\n * ```js\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * };\r\n * option = {\r\n * series: [],\r\n * media: {},\r\n * };\r\n * option = {\r\n * series: [],\r\n * timeline: {},\r\n * options: [],\r\n * media: {},\r\n * }\r\n * ```\r\n *\r\n * (2) Prop \"baseOption\" declared:\r\n * If \"baseOption\" declared, `ECUnitOption` props can only be declared\r\n * inside \"baseOption\" except prop \"timeline\" (compat ec2).\r\n * ```js\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * media: []\r\n * };\r\n * option = {\r\n * baseOption: {\r\n * timeline: {},\r\n * series: [],\r\n * },\r\n * options: []\r\n * media: []\r\n * };\r\n * option = {\r\n * // ec3 compat ec2: allow (only) `timeline` declared\r\n * // outside baseOption. Keep this setting for compat.\r\n * timeline: {},\r\n * baseOption: {\r\n * series: [],\r\n * },\r\n * options: [],\r\n * media: []\r\n * };\r\n * ```\r\n */\n\n\nfunction parseRawOption( // `rawOption` May be modified\nrawOption, optionPreprocessorFuncs, isNew) {\n var mediaList = [];\n var mediaDefault;\n var baseOption;\n var declaredBaseOption = rawOption.baseOption; // Compatible with ec2, [RAW_OPTION_PATTERNS] above.\n\n var timelineOnRoot = rawOption.timeline;\n var timelineOptionsOnRoot = rawOption.options;\n var mediaOnRoot = rawOption.media;\n var hasMedia = !!rawOption.media;\n var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);\n\n if (declaredBaseOption) {\n baseOption = declaredBaseOption; // For merge option.\n\n if (!baseOption.timeline) {\n baseOption.timeline = timelineOnRoot;\n }\n } // For convenience, enable to use the root option as the `baseOption`:\n // `{ ...normalOptionProps, media: [{ ... }, { ... }] }`\n else {\n if (hasTimeline || hasMedia) {\n rawOption.options = rawOption.media = null;\n }\n\n baseOption = rawOption;\n }\n\n if (hasMedia) {\n if (isArray(mediaOnRoot)) {\n each(mediaOnRoot, function (singleMedia) {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n if (singleMedia && !singleMedia.option && isObject(singleMedia.query) && isObject(singleMedia.query.option)) {\n error('Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }');\n }\n }\n\n if (singleMedia && singleMedia.option) {\n if (singleMedia.query) {\n mediaList.push(singleMedia);\n } else if (!mediaDefault) {\n // Use the first media default.\n mediaDefault = singleMedia;\n }\n }\n });\n } else {\n if (process.env.NODE_ENV !== 'production') {\n // Real case of wrong config.\n error('Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }');\n }\n }\n }\n\n doPreprocess(baseOption);\n each(timelineOptionsOnRoot, function (option) {\n return doPreprocess(option);\n });\n each(mediaList, function (media) {\n return doPreprocess(media.option);\n });\n\n function doPreprocess(option) {\n each(optionPreprocessorFuncs, function (preProcess) {\n preProcess(option, isNew);\n });\n }\n\n return {\n baseOption: baseOption,\n timelineOptions: timelineOptionsOnRoot || [],\n mediaDefault: mediaDefault,\n mediaList: mediaList\n };\n}\n/**\r\n * @see \r\n * Support: width, height, aspectRatio\r\n * Can use max or min as prefix.\r\n */\n\n\nfunction applyMediaQuery(query, ecWidth, ecHeight) {\n var realMap = {\n width: ecWidth,\n height: ecHeight,\n aspectratio: ecWidth / ecHeight // lower case for convenience.\n\n };\n var applicable = true;\n each(query, function (value, attr) {\n var matched = attr.match(QUERY_REG);\n\n if (!matched || !matched[1] || !matched[2]) {\n return;\n }\n\n var operator = matched[1];\n var realAttr = matched[2].toLowerCase();\n\n if (!compare(realMap[realAttr], value, operator)) {\n applicable = false;\n }\n });\n return applicable;\n}\n\nfunction compare(real, expect, operator) {\n if (operator === 'min') {\n return real >= expect;\n } else if (operator === 'max') {\n return real <= expect;\n } else {\n // Equals\n return real === expect;\n }\n}\n\nfunction indicesEquals(indices1, indices2) {\n // indices is always order by asc and has only finite number.\n return indices1.join(',') === indices2.join(',');\n}\n/**\r\n * Consider case:\r\n * `chart.setOption(opt1);`\r\n * Then user do some interaction like dataZoom, dataView changing.\r\n * `chart.setOption(opt2);`\r\n * Then user press 'reset button' in toolbox.\r\n *\r\n * After doing that all of the interaction effects should be reset, the\r\n * chart should be the same as the result of invoke\r\n * `chart.setOption(opt1); chart.setOption(opt2);`.\r\n *\r\n * Although it is not able ensure that\r\n * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to\r\n * `chart.setOption(merge(opt1, opt2));` exactly,\r\n * this might be the only simple way to implement that feature.\r\n *\r\n * MEMO: We've considered some other approaches:\r\n * 1. Each model handles its self restoration but not uniform treatment.\r\n * (Too complex in logic and error-prone)\r\n * 2. Use a shadow ecModel. (Performance expensive)\r\n *\r\n * FIXME: A possible solution:\r\n * Add a extra level of model for each component model. The inheritance chain would be:\r\n * ecModel <- componentModel <- componentActionModel <- dataItemModel\r\n * And all of the actions can only modify the `componentActionModel` rather than\r\n * `componentModel`. `setOption` will only modify the `ecModel` and `componentModel`.\r\n * When \"resotre\" action triggered, model from `componentActionModel` will be discarded\r\n * instead of recreating the \"ecModel\" from the \"_optionBackup\".\r\n */\n// function mergeToBackupOption(\n// fakeCmptsMap: FakeComponentsMap,\n// // `tarOption` Can be null/undefined, means init\n// tarOption: ECUnitOption,\n// newOption: ECUnitOption,\n// // Can be null/undefined\n// opt: InnerSetOptionOpts\n// ): void {\n// newOption = newOption || {} as ECUnitOption;\n// const notInit = !!tarOption;\n// each(newOption, function (newOptsInMainType, mainType) {\n// if (newOptsInMainType == null) {\n// return;\n// }\n// if (!ComponentModel.hasClass(mainType)) {\n// if (tarOption) {\n// tarOption[mainType] = merge(tarOption[mainType], newOptsInMainType, true);\n// }\n// }\n// else {\n// const oldTarOptsInMainType = notInit ? normalizeToArray(tarOption[mainType]) : null;\n// const oldFakeCmptsInMainType = fakeCmptsMap.get(mainType) || [];\n// const resultTarOptsInMainType = notInit ? (tarOption[mainType] = [] as ComponentOption[]) : null;\n// const resultFakeCmptsInMainType = fakeCmptsMap.set(mainType, []);\n// const mappingResult = mappingToExists(\n// oldFakeCmptsInMainType,\n// normalizeToArray(newOptsInMainType),\n// (opt && opt.replaceMergeMainTypeMap.get(mainType)) ? 'replaceMerge' : 'normalMerge'\n// );\n// setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel as ComponentModelConstructor);\n// each(mappingResult, function (resultItem, index) {\n// // The same logic as `Global.ts#_mergeOption`.\n// let fakeCmpt = resultItem.existing;\n// const newOption = resultItem.newOption;\n// const keyInfo = resultItem.keyInfo;\n// let fakeCmptOpt;\n// if (!newOption) {\n// fakeCmptOpt = oldTarOptsInMainType[index];\n// }\n// else {\n// if (fakeCmpt && fakeCmpt.subType === keyInfo.subType) {\n// fakeCmpt.name = keyInfo.name;\n// if (notInit) {\n// fakeCmptOpt = merge(oldTarOptsInMainType[index], newOption, true);\n// }\n// }\n// else {\n// fakeCmpt = extend({}, keyInfo);\n// if (notInit) {\n// fakeCmptOpt = clone(newOption);\n// }\n// }\n// }\n// if (fakeCmpt) {\n// notInit && resultTarOptsInMainType.push(fakeCmptOpt);\n// resultFakeCmptsInMainType.push(fakeCmpt);\n// }\n// else {\n// notInit && resultTarOptsInMainType.push(void 0);\n// resultFakeCmptsInMainType.push(void 0);\n// }\n// });\n// }\n// });\n// }\n\n\nexport default OptionManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar POSSIBLE_STYLES = ['areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', 'chordStyle', 'label', 'labelLine'];\n\nfunction compatEC2ItemStyle(opt) {\n var itemStyleOpt = opt && opt.itemStyle;\n\n if (!itemStyleOpt) {\n return;\n }\n\n for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) {\n var styleName = POSSIBLE_STYLES[i];\n var normalItemStyleOpt = itemStyleOpt.normal;\n var emphasisItemStyleOpt = itemStyleOpt.emphasis;\n\n if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.normal.\" + styleName, styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].normal) {\n opt[styleName].normal = normalItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);\n }\n\n normalItemStyleOpt[styleName] = null;\n }\n\n if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(\"itemStyle.emphasis.\" + styleName, \"emphasis.\" + styleName);\n }\n\n opt[styleName] = opt[styleName] || {};\n\n if (!opt[styleName].emphasis) {\n opt[styleName].emphasis = emphasisItemStyleOpt[styleName];\n } else {\n zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);\n }\n\n emphasisItemStyleOpt[styleName] = null;\n }\n }\n}\n\nfunction convertNormalEmphasis(opt, optType, useExtend) {\n if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {\n var normalOpt = opt[optType].normal;\n var emphasisOpt = opt[optType].emphasis;\n\n if (normalOpt) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"'normal' hierarchy in \" + optType + \" has been removed since 4.0. All style properties are configured in \" + optType + \" directly now.\");\n } // Timeline controlStyle has other properties besides normal and emphasis\n\n\n if (useExtend) {\n opt[optType].normal = opt[optType].emphasis = null;\n zrUtil.defaults(opt[optType], normalOpt);\n } else {\n opt[optType] = normalOpt;\n }\n }\n\n if (emphasisOpt) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(optType + \".emphasis has been changed to emphasis.\" + optType + \" since 4.0\");\n }\n\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[optType] = emphasisOpt; // Also compat the case user mix the style and focus together in ec3 style\n // for example: { itemStyle: { normal: {}, emphasis: {focus, shadowBlur} } }\n\n if (emphasisOpt.focus) {\n opt.emphasis.focus = emphasisOpt.focus;\n }\n\n if (emphasisOpt.blurScope) {\n opt.emphasis.blurScope = emphasisOpt.blurScope;\n }\n }\n }\n}\n\nfunction removeEC3NormalStatus(opt) {\n convertNormalEmphasis(opt, 'itemStyle');\n convertNormalEmphasis(opt, 'lineStyle');\n convertNormalEmphasis(opt, 'areaStyle');\n convertNormalEmphasis(opt, 'label');\n convertNormalEmphasis(opt, 'labelLine'); // treemap\n\n convertNormalEmphasis(opt, 'upperLabel'); // graph\n\n convertNormalEmphasis(opt, 'edgeLabel');\n}\n\nfunction compatTextStyle(opt, propName) {\n // Check whether is not object (string\\null\\undefined ...)\n var labelOptSingle = isObject(opt) && opt[propName];\n var textStyle = isObject(labelOptSingle) && labelOptSingle.textStyle;\n\n if (textStyle) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line max-len\n deprecateLog(\"textStyle hierarchy in \" + propName + \" has been removed since 4.0. All textStyle properties are configured in \" + propName + \" directly now.\");\n }\n\n for (var i = 0, len = modelUtil.TEXT_STYLE_OPTIONS.length; i < len; i++) {\n var textPropName = modelUtil.TEXT_STYLE_OPTIONS[i];\n\n if (textStyle.hasOwnProperty(textPropName)) {\n labelOptSingle[textPropName] = textStyle[textPropName];\n }\n }\n }\n}\n\nfunction compatEC3CommonStyles(opt) {\n if (opt) {\n removeEC3NormalStatus(opt);\n compatTextStyle(opt, 'label');\n opt.emphasis && compatTextStyle(opt.emphasis, 'label');\n }\n}\n\nfunction processSeries(seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n compatEC2ItemStyle(seriesOpt);\n removeEC3NormalStatus(seriesOpt);\n compatTextStyle(seriesOpt, 'label'); // treemap\n\n compatTextStyle(seriesOpt, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt, 'edgeLabel');\n\n if (seriesOpt.emphasis) {\n compatTextStyle(seriesOpt.emphasis, 'label'); // treemap\n\n compatTextStyle(seriesOpt.emphasis, 'upperLabel'); // graph\n\n compatTextStyle(seriesOpt.emphasis, 'edgeLabel');\n }\n\n var markPoint = seriesOpt.markPoint;\n\n if (markPoint) {\n compatEC2ItemStyle(markPoint);\n compatEC3CommonStyles(markPoint);\n }\n\n var markLine = seriesOpt.markLine;\n\n if (markLine) {\n compatEC2ItemStyle(markLine);\n compatEC3CommonStyles(markLine);\n }\n\n var markArea = seriesOpt.markArea;\n\n if (markArea) {\n compatEC3CommonStyles(markArea);\n }\n\n var data = seriesOpt.data; // Break with ec3: if `setOption` again, there may be no `type` in option,\n // then the backward compat based on option type will not be performed.\n\n if (seriesOpt.type === 'graph') {\n data = data || seriesOpt.nodes;\n var edgeData = seriesOpt.links || seriesOpt.edges;\n\n if (edgeData && !zrUtil.isTypedArray(edgeData)) {\n for (var i = 0; i < edgeData.length; i++) {\n compatEC3CommonStyles(edgeData[i]);\n }\n }\n\n zrUtil.each(seriesOpt.categories, function (opt) {\n removeEC3NormalStatus(opt);\n });\n }\n\n if (data && !zrUtil.isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatEC3CommonStyles(data[i]);\n }\n } // mark point data\n\n\n markPoint = seriesOpt.markPoint;\n\n if (markPoint && markPoint.data) {\n var mpData = markPoint.data;\n\n for (var i = 0; i < mpData.length; i++) {\n compatEC3CommonStyles(mpData[i]);\n }\n } // mark line data\n\n\n markLine = seriesOpt.markLine;\n\n if (markLine && markLine.data) {\n var mlData = markLine.data;\n\n for (var i = 0; i < mlData.length; i++) {\n if (zrUtil.isArray(mlData[i])) {\n compatEC3CommonStyles(mlData[i][0]);\n compatEC3CommonStyles(mlData[i][1]);\n } else {\n compatEC3CommonStyles(mlData[i]);\n }\n }\n } // Series\n\n\n if (seriesOpt.type === 'gauge') {\n compatTextStyle(seriesOpt, 'axisLabel');\n compatTextStyle(seriesOpt, 'title');\n compatTextStyle(seriesOpt, 'detail');\n } else if (seriesOpt.type === 'treemap') {\n convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle');\n zrUtil.each(seriesOpt.levels, function (opt) {\n removeEC3NormalStatus(opt);\n });\n } else if (seriesOpt.type === 'tree') {\n removeEC3NormalStatus(seriesOpt.leaves);\n } // sunburst starts from ec4, so it does not need to compat levels.\n\n}\n\nfunction toArr(o) {\n return zrUtil.isArray(o) ? o : o ? [o] : [];\n}\n\nfunction toObj(o) {\n return (zrUtil.isArray(o) ? o[0] : o) || {};\n}\n\nexport default function globalCompatStyle(option, isTheme) {\n each(toArr(option.series), function (seriesOpt) {\n isObject(seriesOpt) && processSeries(seriesOpt);\n });\n var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar'];\n isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis');\n each(axes, function (axisName) {\n each(toArr(option[axisName]), function (axisOpt) {\n if (axisOpt) {\n compatTextStyle(axisOpt, 'axisLabel');\n compatTextStyle(axisOpt.axisPointer, 'label');\n }\n });\n });\n each(toArr(option.parallel), function (parallelOpt) {\n var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;\n compatTextStyle(parallelAxisDefault, 'axisLabel');\n compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label');\n });\n each(toArr(option.calendar), function (calendarOpt) {\n convertNormalEmphasis(calendarOpt, 'itemStyle');\n compatTextStyle(calendarOpt, 'dayLabel');\n compatTextStyle(calendarOpt, 'monthLabel');\n compatTextStyle(calendarOpt, 'yearLabel');\n }); // radar.name.textStyle\n\n each(toArr(option.radar), function (radarOpt) {\n compatTextStyle(radarOpt, 'name'); // Use axisName instead of name because component has name property\n\n if (radarOpt.name && radarOpt.axisName == null) {\n radarOpt.axisName = radarOpt.name;\n delete radarOpt.name;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('name property in radar component has been changed to axisName');\n }\n }\n\n if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {\n radarOpt.axisNameGap = radarOpt.nameGap;\n delete radarOpt.nameGap;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('nameGap property in radar component has been changed to axisNameGap');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n each(radarOpt.indicator, function (indicatorOpt) {\n if (indicatorOpt.text) {\n deprecateReplaceLog('text', 'name', 'radar.indicator');\n }\n });\n }\n });\n each(toArr(option.geo), function (geoOpt) {\n if (isObject(geoOpt)) {\n compatEC3CommonStyles(geoOpt);\n each(toArr(geoOpt.regions), function (regionObj) {\n compatEC3CommonStyles(regionObj);\n });\n }\n });\n each(toArr(option.timeline), function (timelineOpt) {\n compatEC3CommonStyles(timelineOpt);\n convertNormalEmphasis(timelineOpt, 'label');\n convertNormalEmphasis(timelineOpt, 'itemStyle');\n convertNormalEmphasis(timelineOpt, 'controlStyle', true);\n var data = timelineOpt.data;\n zrUtil.isArray(data) && zrUtil.each(data, function (item) {\n if (zrUtil.isObject(item)) {\n convertNormalEmphasis(item, 'label');\n convertNormalEmphasis(item, 'itemStyle');\n }\n });\n });\n each(toArr(option.toolbox), function (toolboxOpt) {\n convertNormalEmphasis(toolboxOpt, 'iconStyle');\n each(toolboxOpt.feature, function (featureOpt) {\n convertNormalEmphasis(featureOpt, 'iconStyle');\n });\n });\n compatTextStyle(toObj(option.axisPointer), 'label');\n compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); // Clean logs\n // storedLogs = {};\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isArray, isObject, isTypedArray, defaults } from 'zrender/lib/core/util.js';\nimport compatStyle from './helper/compatStyle.js';\nimport { normalizeToArray } from '../util/model.js';\nimport { deprecateLog, deprecateReplaceLog } from '../util/log.js';\n\nfunction get(opt, path) {\n var pathArr = path.split(',');\n var obj = opt;\n\n for (var i = 0; i < pathArr.length; i++) {\n obj = obj && obj[pathArr[i]];\n\n if (obj == null) {\n break;\n }\n }\n\n return obj;\n}\n\nfunction set(opt, path, val, overwrite) {\n var pathArr = path.split(',');\n var obj = opt;\n var key;\n var i = 0;\n\n for (; i < pathArr.length - 1; i++) {\n key = pathArr[i];\n\n if (obj[key] == null) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n if (overwrite || obj[pathArr[i]] == null) {\n obj[pathArr[i]] = val;\n }\n}\n\nfunction compatLayoutProperties(option) {\n option && each(LAYOUT_PROPERTIES, function (prop) {\n if (prop[0] in option && !(prop[1] in option)) {\n option[prop[1]] = option[prop[0]];\n }\n });\n}\n\nvar LAYOUT_PROPERTIES = [['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']];\nvar COMPATITABLE_COMPONENTS = ['grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'];\nvar BAR_ITEM_STYLE_MAP = [['borderRadius', 'barBorderRadius'], ['borderColor', 'barBorderColor'], ['borderWidth', 'barBorderWidth']];\n\nfunction compatBarItemStyle(option) {\n var itemStyle = option && option.itemStyle;\n\n if (itemStyle) {\n for (var i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {\n var oldName = BAR_ITEM_STYLE_MAP[i][1];\n var newName = BAR_ITEM_STYLE_MAP[i][0];\n\n if (itemStyle[oldName] != null) {\n itemStyle[newName] = itemStyle[oldName];\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(oldName, newName);\n }\n }\n }\n }\n}\n\nfunction compatPieLabel(option) {\n if (!option) {\n return;\n }\n\n if (option.alignTo === 'edge' && option.margin != null && option.edgeDistance == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('label.margin', 'label.edgeDistance', 'pie');\n }\n\n option.edgeDistance = option.margin;\n }\n}\n\nfunction compatSunburstState(option) {\n if (!option) {\n return;\n }\n\n if (option.downplay && !option.blur) {\n option.blur = option.downplay;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('downplay', 'blur', 'sunburst');\n }\n }\n}\n\nfunction compatGraphFocus(option) {\n if (!option) {\n return;\n }\n\n if (option.focusNodeAdjacency != null) {\n option.emphasis = option.emphasis || {};\n\n if (option.emphasis.focus == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('focusNodeAdjacency', 'emphasis: { focus: \\'adjacency\\'}', 'graph/sankey');\n }\n\n option.emphasis.focus = 'adjacency';\n }\n }\n}\n\nfunction traverseTree(data, cb) {\n if (data) {\n for (var i = 0; i < data.length; i++) {\n cb(data[i]);\n data[i] && traverseTree(data[i].children, cb);\n }\n }\n}\n\nexport default function globalBackwardCompat(option, isTheme) {\n compatStyle(option, isTheme); // Make sure series array for model initialization.\n\n option.series = normalizeToArray(option.series);\n each(option.series, function (seriesOpt) {\n if (!isObject(seriesOpt)) {\n return;\n }\n\n var seriesType = seriesOpt.type;\n\n if (seriesType === 'line') {\n if (seriesOpt.clipOverflow != null) {\n seriesOpt.clip = seriesOpt.clipOverflow;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clipOverflow', 'clip', 'line');\n }\n }\n } else if (seriesType === 'pie' || seriesType === 'gauge') {\n if (seriesOpt.clockWise != null) {\n seriesOpt.clockwise = seriesOpt.clockWise;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('clockWise', 'clockwise');\n }\n }\n\n compatPieLabel(seriesOpt.label);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n compatPieLabel(data[i]);\n }\n }\n\n if (seriesOpt.hoverOffset != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis.scaleSize = null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverOffset', 'emphasis.scaleSize');\n }\n\n seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;\n }\n }\n } else if (seriesType === 'gauge') {\n var pointerColor = get(seriesOpt, 'pointer.color');\n pointerColor != null && set(seriesOpt, 'itemStyle.color', pointerColor);\n } else if (seriesType === 'bar') {\n compatBarItemStyle(seriesOpt);\n compatBarItemStyle(seriesOpt.backgroundStyle);\n compatBarItemStyle(seriesOpt.emphasis);\n var data = seriesOpt.data;\n\n if (data && !isTypedArray(data)) {\n for (var i = 0; i < data.length; i++) {\n if (typeof data[i] === 'object') {\n compatBarItemStyle(data[i]);\n compatBarItemStyle(data[i] && data[i].emphasis);\n }\n }\n }\n } else if (seriesType === 'sunburst') {\n var highlightPolicy = seriesOpt.highlightPolicy;\n\n if (highlightPolicy) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (!seriesOpt.emphasis.focus) {\n seriesOpt.emphasis.focus = highlightPolicy;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('highlightPolicy', 'emphasis.focus', 'sunburst');\n }\n }\n }\n\n compatSunburstState(seriesOpt);\n traverseTree(seriesOpt.data, compatSunburstState);\n } else if (seriesType === 'graph' || seriesType === 'sankey') {\n compatGraphFocus(seriesOpt); // TODO nodes, edges?\n } else if (seriesType === 'map') {\n if (seriesOpt.mapType && !seriesOpt.map) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('mapType', 'map', 'map');\n }\n\n seriesOpt.map = seriesOpt.mapType;\n }\n\n if (seriesOpt.mapLocation) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('`mapLocation` is not used anymore.');\n }\n\n defaults(seriesOpt, seriesOpt.mapLocation);\n }\n }\n\n if (seriesOpt.hoverAnimation != null) {\n seriesOpt.emphasis = seriesOpt.emphasis || {};\n\n if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('hoverAnimation', 'emphasis.scale');\n }\n\n seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;\n }\n }\n\n compatLayoutProperties(seriesOpt);\n }); // dataRange has changed to visualMap\n\n if (option.dataRange) {\n option.visualMap = option.dataRange;\n }\n\n each(COMPATITABLE_COMPONENTS, function (componentName) {\n var options = option[componentName];\n\n if (options) {\n if (!isArray(options)) {\n options = [options];\n }\n\n each(options, function (option) {\n compatLayoutProperties(option);\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { addSafe } from '../util/number.js'; // (1) [Caution]: the logic is correct based on the premises:\n// data processing stage is blocked in stream.\n// See \n// (2) Only register once when import repeatedly.\n// Should be executed after series is filtered and before stack calculation.\n\nexport default function dataStack(ecModel) {\n var stackInfoMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var stack = seriesModel.get('stack'); // Compatible: when `stack` is set as '', do not stack.\n\n if (stack) {\n var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []);\n var data = seriesModel.getData();\n var stackInfo = {\n // Used for calculate axis extent automatically.\n // TODO: Type getCalculationInfo return more specific type?\n stackResultDimension: data.getCalculationInfo('stackResultDimension'),\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension'),\n stackedDimension: data.getCalculationInfo('stackedDimension'),\n stackedByDimension: data.getCalculationInfo('stackedByDimension'),\n isStackedByIndex: data.getCalculationInfo('isStackedByIndex'),\n data: data,\n seriesModel: seriesModel\n }; // If stacked on axis that do not support data stack.\n\n if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {\n return;\n }\n\n stackInfoList.length && data.setCalculationInfo('stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel);\n stackInfoList.push(stackInfo);\n }\n });\n stackInfoMap.each(calculateStack);\n}\n\nfunction calculateStack(stackInfoList) {\n each(stackInfoList, function (targetStackInfo, idxInStack) {\n var resultVal = [];\n var resultNaN = [NaN, NaN];\n var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];\n var targetData = targetStackInfo.data;\n var isStackedByIndex = targetStackInfo.isStackedByIndex;\n var stackStrategy = targetStackInfo.seriesModel.get('stackStrategy') || 'samesign'; // Should not write on raw data, because stack series model list changes\n // depending on legend selection.\n\n targetData.modify(dims, function (v0, v1, dataIndex) {\n var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); // Consider `connectNulls` of line area, if value is NaN, stackedOver\n // should also be NaN, to draw a appropriate belt area.\n\n if (isNaN(sum)) {\n return resultNaN;\n }\n\n var byValue;\n var stackedDataRawIndex;\n\n if (isStackedByIndex) {\n stackedDataRawIndex = targetData.getRawIndex(dataIndex);\n } else {\n byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);\n } // If stackOver is NaN, chart view will render point on value start.\n\n\n var stackedOver = NaN;\n\n for (var j = idxInStack - 1; j >= 0; j--) {\n var stackInfo = stackInfoList[j]; // Has been optimized by inverted indices on `stackedByDimension`.\n\n if (!isStackedByIndex) {\n stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);\n }\n\n if (stackedDataRawIndex >= 0) {\n var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); // Considering positive stack, negative stack and empty data\n\n if (stackStrategy === 'all' // single stack group\n || stackStrategy === 'positive' && val > 0 || stackStrategy === 'negative' && val < 0 || stackStrategy === 'samesign' && sum >= 0 && val > 0 // All positive stack\n || stackStrategy === 'samesign' && sum <= 0 && val < 0 // All negative stack\n ) {\n // The sum has to be very small to be affected by the\n // floating arithmetic problem. An incorrect result will probably\n // cause axis min/max to be filtered incorrectly.\n sum = addSafe(sum, val);\n stackedOver = val;\n break;\n }\n }\n }\n\n resultVal[0] = sum;\n resultVal[1] = stackedOver;\n return resultVal;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString, keys } from 'zrender/lib/core/util.js';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types.js';\nimport { getDataItemValue } from '../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper.js';\n; // @inner\n\nvar SourceImpl =\n/** @class */\nfunction () {\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.metaRawOption = fields.metaRawOption;\n var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\n\n if (dimensionsDefine) {\n for (var i = 0; i < dimensionsDefine.length; i++) {\n var dim = dimensionsDefine[i];\n\n if (dim.type == null) {\n if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\n dim.type = 'ordinal';\n }\n }\n }\n }\n }\n\n return SourceImpl;\n}();\n\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\n/**\r\n * Create a source from option.\r\n * NOTE: Created source is immutable. Don't change any properties in it.\r\n */\n\nexport function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\r\n * Wrap original series data for some compatibility cases.\r\n */\n\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\r\n * Clone source but excludes source data.\r\n */\n\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount\n });\n}\n/**\r\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\r\n */\n\nexport function detectSourceFormat(data) {\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 (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n\n return sourceFormat;\n}\n/**\r\n * Determine the source definitions from data standalone dimensions definitions\r\n * are not specified.\r\n */\n\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PENDING: Could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data; // 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\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, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : 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, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\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 dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\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 return keys(obj);\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/undefined or string.\n\n\nfunction normalizeDimensionsOption(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 (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We don't auto specify name, otherwise a given name may\n // cause it to be referred 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 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\nexport function shouldRetrieveDataByName(source) {\n var sourceFormat = source.sourceFormat;\n return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === 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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar _a, _b, _c; // TODO\n// ??? refactor? check the outer usage of data provider.\n// merge with defaultDimValueGetter?\n\n\nimport { isTypedArray, extend, assert, each, isObject, bind } from 'zrender/lib/core/util.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { SOURCE_FORMAT_ORIGINAL, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SERIES_LAYOUT_BY_COLUMN, SERIES_LAYOUT_BY_ROW } from '../../util/types.js';\nvar providerMethods;\nvar mountMethods;\n/**\r\n * If normal array used, mutable chunk size is supported.\r\n * If typed array used, chunk size must be fixed.\r\n */\n\nvar DefaultDataProvider =\n/** @class */\nfunction () {\n function DefaultDataProvider(sourceParam, dimSize) {\n // let source: Source;\n var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam; // declare source is Source;\n\n this._source = source;\n var data = this._data = source.data; // Typed array. TODO IE10+?\n\n if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n if (dimSize == null) {\n throw new Error('Typed array data must specify dimension size');\n }\n }\n\n this._offset = 0;\n this._dimSize = dimSize;\n this._data = data;\n }\n\n mountMethods(this, data, source);\n }\n\n DefaultDataProvider.prototype.getSource = function () {\n return this._source;\n };\n\n DefaultDataProvider.prototype.count = function () {\n return 0;\n };\n\n DefaultDataProvider.prototype.getItem = function (idx, out) {\n return;\n };\n\n DefaultDataProvider.prototype.appendData = function (newData) {};\n\n DefaultDataProvider.prototype.clean = function () {};\n\n DefaultDataProvider.protoInitialize = function () {\n // PENDING: To avoid potential incompat (e.g., prototype\n // is visited somewhere), still init them on prototype.\n var proto = DefaultDataProvider.prototype;\n proto.pure = false;\n proto.persistent = true;\n }();\n\n DefaultDataProvider.internalField = function () {\n var _a;\n\n mountMethods = function (provider, data, source) {\n var sourceFormat = source.sourceFormat;\n var seriesLayoutBy = source.seriesLayoutBy;\n var startIndex = source.startIndex;\n var dimsDef = source.dimensionsDefine;\n var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(methods, 'Invalide sourceFormat: ' + sourceFormat);\n }\n\n extend(provider, methods);\n\n if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n provider.getItem = getItemForTypedArray;\n provider.count = countForTypedArray;\n provider.fillStorage = fillStorageForTypedArray;\n } else {\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);\n provider.getItem = bind(rawItemGetter, null, data, startIndex, dimsDef);\n var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);\n provider.count = bind(rawCounter, null, data, startIndex, dimsDef);\n }\n };\n\n var getItemForTypedArray = function (idx, out) {\n idx = idx - this._offset;\n out = out || [];\n var data = this._data;\n var dimSize = this._dimSize;\n var offset = dimSize * idx;\n\n for (var i = 0; i < dimSize; i++) {\n out[i] = data[offset + i];\n }\n\n return out;\n };\n\n var fillStorageForTypedArray = function (start, end, storage, extent) {\n var data = this._data;\n var dimSize = this._dimSize;\n\n for (var dim = 0; dim < dimSize; dim++) {\n var dimExtent = extent[dim];\n var min = dimExtent[0] == null ? Infinity : dimExtent[0];\n var max = dimExtent[1] == null ? -Infinity : dimExtent[1];\n var count = end - start;\n var arr = storage[dim];\n\n for (var i = 0; i < count; i++) {\n // appendData with TypedArray will always do replace in provider.\n var val = data[i * dimSize + dim];\n arr[start + i] = val;\n val < min && (min = val);\n val > max && (max = val);\n }\n\n dimExtent[0] = min;\n dimExtent[1] = max;\n }\n };\n\n var countForTypedArray = function () {\n return this._data ? this._data.length / this._dimSize : 0;\n };\n\n providerMethods = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = {\n pure: true,\n appendData: function () {\n throw new Error('Do not support appendData when set seriesLayoutBy: \"row\".');\n }\n }, _a[SOURCE_FORMAT_OBJECT_ROWS] = {\n pure: true,\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_KEYED_COLUMNS] = {\n pure: true,\n appendData: function (newData) {\n var data = this._data;\n each(newData, function (newCol, key) {\n var oldCol = data[key] || (data[key] = []);\n\n for (var i = 0; i < (newCol || []).length; i++) {\n oldCol.push(newCol[i]);\n }\n });\n }\n }, _a[SOURCE_FORMAT_ORIGINAL] = {\n appendData: appendDataSimply\n }, _a[SOURCE_FORMAT_TYPED_ARRAY] = {\n persistent: false,\n pure: true,\n appendData: function (newData) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isTypedArray(newData), 'Added data must be TypedArray if data in initialization is TypedArray');\n }\n\n this._data = newData;\n },\n // Clean self if data is already used.\n clean: function () {\n // PENDING\n this._offset += this.count();\n this._data = null;\n }\n }, _a);\n\n function appendDataSimply(newData) {\n for (var i = 0; i < newData.length; i++) {\n this._data.push(newData[i]);\n }\n }\n }();\n\n return DefaultDataProvider;\n}();\n\nexport { DefaultDataProvider };\n\nvar getItemSimply = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx];\n};\n\nvar rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef, idx) {\n return rawData[idx + startIndex];\n}, _a[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef, idx, out) {\n idx += startIndex;\n var item = out || [];\n var data = rawData;\n\n for (var i = 0; i < data.length; i++) {\n var row = data[i];\n item[i] = row ? row[idx] : null;\n }\n\n return item;\n}, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef, idx, out) {\n var item = out || [];\n\n for (var i = 0; i < dimsDef.length; i++) {\n var dimName = dimsDef[i].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n item[i] = col ? col[idx] : null;\n }\n\n return item;\n}, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);\nexport function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get item on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar countSimply = function (rawData, startIndex, dimsDef) {\n return rawData.length;\n};\n\nvar rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_COLUMN] = function (rawData, startIndex, dimsDef) {\n return Math.max(0, rawData.length - startIndex);\n}, _b[SOURCE_FORMAT_ARRAY_ROWS + '_' + SERIES_LAYOUT_BY_ROW] = function (rawData, startIndex, dimsDef) {\n var row = rawData[0];\n return row ? Math.max(0, row.length - startIndex) : 0;\n}, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function (rawData, startIndex, dimsDef) {\n var dimName = dimsDef[0].name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimName == null) {\n throw new Error();\n }\n }\n\n var col = rawData[dimName];\n return col ? col.length : 0;\n}, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);\nexport function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {\n var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support count on \"' + sourceFormat + '\", \"' + seriesLayoutBy + '\".');\n }\n\n return method;\n}\n\nvar getRawValueSimply = function (dataItem, dimIndex, property) {\n return dataItem[dimIndex];\n};\n\nvar rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function (dataItem, dimIndex, property) {\n return dataItem[property];\n}, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function (dataItem, dimIndex, property) {\n // FIXME: In some case (markpoint in geo (geo-map.html)),\n // dataItem is {coord: [...]}\n var value = getDataItemValue(dataItem);\n return !(value instanceof Array) ? value : value[dimIndex];\n}, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);\nexport function getRawSourceValueGetter(sourceFormat) {\n var method = rawSourceValueGetterMap[sourceFormat];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(method, 'Do not support get value on \"' + sourceFormat + '\".');\n }\n\n return method;\n}\n\nfunction getMethodMapKey(sourceFormat, seriesLayoutBy) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + '_' + seriesLayoutBy : sourceFormat;\n} // ??? FIXME can these logic be more neat: getRawValue, getRawDataItem,\n// Consider persistent.\n// Caution: why use raw value to display on label or tooltip?\n// A reason is to avoid format. For example time value we do not know\n// how to format is expected. More over, if stack is used, calculated\n// value may be 0.91000000001, which have brings trouble to display.\n// TODO: consider how to treat null/undefined/NaN when display?\n\n\nexport function retrieveRawValue(data, dataIndex, // If dimIndex is null/undefined, return OptionDataItem.\n// Otherwise, return OptionDataValue.\ndim) {\n if (!data) {\n return;\n } // Consider data may be not persistent.\n\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (dataItem == null) {\n return;\n }\n\n var store = data.getStore();\n var sourceFormat = store.getSource().sourceFormat;\n\n if (dim != null) {\n var dimIndex = data.getDimensionIndex(dim);\n var property = store.getDimensionProperty(dimIndex);\n return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property);\n } else {\n var result = dataItem;\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n result = getDataItemValue(dataItem);\n }\n\n return result;\n }\n}\n/**\r\n * Compatible with some cases (in pie, map) like:\r\n * data: [{name: 'xx', value: 5, selected: true}, ...]\r\n * where only sourceFormat is 'original' and 'objectRows' supported.\r\n *\r\n * // TODO\r\n * Supported detail options in data item when using 'arrayRows'.\r\n *\r\n * @param data\r\n * @param dataIndex\r\n * @param attr like 'selected'\r\n */\n\nexport function retrieveRawAttr(data, dataIndex, attr) {\n if (!data) {\n return;\n }\n\n var sourceFormat = data.getStore().getSource().sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ORIGINAL && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n return;\n }\n\n var dataItem = data.getRawDataItem(dataIndex);\n\n if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject(dataItem)) {\n dataItem = null;\n }\n\n if (dataItem) {\n return dataItem[attr];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { formatTpl } from '../../util/format.js';\nimport { error, makePrintable } from '../../util/log.js';\nvar DIMENSION_LABEL_REG = /\\{@(.+?)\\}/g;\n\nvar DataFormatMixin =\n/** @class */\nfunction () {\n function DataFormatMixin() {}\n /**\r\n * Get params for formatter\r\n */\n\n\n DataFormatMixin.prototype.getDataParams = function (dataIndex, dataType) {\n var data = this.getData(dataType);\n var rawValue = this.getRawValue(dataIndex, dataType);\n var rawDataIndex = data.getRawIndex(dataIndex);\n var name = data.getName(dataIndex);\n var itemOpt = data.getRawDataItem(dataIndex);\n var style = data.getItemVisual(dataIndex, 'style');\n var color = style && style[data.getItemVisual(dataIndex, 'drawType') || 'fill'];\n var borderColor = style && style.stroke;\n var mainType = this.mainType;\n var isSeries = mainType === 'series';\n var userOutput = data.userOutput && data.userOutput.get();\n return {\n componentType: mainType,\n componentSubType: this.subType,\n componentIndex: this.componentIndex,\n seriesType: isSeries ? this.subType : null,\n seriesIndex: this.seriesIndex,\n seriesId: isSeries ? this.id : null,\n seriesName: isSeries ? this.name : null,\n name: name,\n dataIndex: rawDataIndex,\n data: itemOpt,\n dataType: dataType,\n value: rawValue,\n color: color,\n borderColor: borderColor,\n dimensionNames: userOutput ? userOutput.fullDimensions : null,\n encode: userOutput ? userOutput.encode : null,\n // Param name list for mapping `a`, `b`, `c`, `d`, `e`\n $vars: ['seriesName', 'name', 'value']\n };\n };\n /**\r\n * Format label\r\n * @param dataIndex\r\n * @param status 'normal' by default\r\n * @param dataType\r\n * @param labelDimIndex Only used in some chart that\r\n * use formatter in different dimensions, like radar.\r\n * @param formatter Formatter given outside.\r\n * @return return null/undefined if no formatter\r\n */\n\n\n DataFormatMixin.prototype.getFormattedLabel = function (dataIndex, status, dataType, labelDimIndex, formatter, extendParams) {\n status = status || 'normal';\n var data = this.getData(dataType);\n var params = this.getDataParams(dataIndex, dataType);\n\n if (extendParams) {\n params.value = extendParams.interpolatedValue;\n }\n\n if (labelDimIndex != null && zrUtil.isArray(params.value)) {\n params.value = params.value[labelDimIndex];\n }\n\n if (!formatter) {\n var itemModel = data.getItemModel(dataIndex); // @ts-ignore\n\n formatter = itemModel.get(status === 'normal' ? ['label', 'formatter'] : [status, 'label', 'formatter']);\n }\n\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n params.dimensionIndex = labelDimIndex;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n var str = formatTpl(formatter, params); // Support 'aaa{@[3]}bbb{@product}ccc'.\n // Do not support '}' in dim name util have to.\n\n return str.replace(DIMENSION_LABEL_REG, function (origin, dimStr) {\n var len = dimStr.length;\n var dimLoose = dimStr;\n\n if (dimLoose.charAt(0) === '[' && dimLoose.charAt(len - 1) === ']') {\n dimLoose = +dimLoose.slice(1, len - 1); // Also support: '[]' => 0\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(dimLoose)) {\n error(\"Invalide label formatter: @\" + dimStr + \", only support @[0], @[1], @[2], ...\");\n }\n }\n }\n\n var val = retrieveRawValue(data, dataIndex, dimLoose);\n\n if (extendParams && zrUtil.isArray(extendParams.interpolatedValue)) {\n var dimIndex = data.getDimensionIndex(dimLoose);\n\n if (dimIndex >= 0) {\n val = extendParams.interpolatedValue[dimIndex];\n }\n }\n\n return val != null ? val + '' : '';\n });\n }\n };\n /**\r\n * Get raw value in option\r\n */\n\n\n DataFormatMixin.prototype.getRawValue = function (idx, dataType) {\n return retrieveRawValue(this.getData(dataType), idx);\n };\n /**\r\n * Should be implemented.\r\n * @param {number} dataIndex\r\n * @param {boolean} [multipleSeries=false]\r\n * @param {string} [dataType]\r\n */\n\n\n DataFormatMixin.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // Empty function\n return;\n };\n\n return DataFormatMixin;\n}();\n\nexport { DataFormatMixin };\n; // PENDING: previously we accept this type when calling `formatTooltip`,\n// but guess little chance has been used outside. Do we need to backward\n// compat it?\n// type TooltipFormatResultLegacyObject = {\n// // `html` means the markup language text, either in 'html' or 'richText'.\n// // The name `html` is not appropriate because in 'richText' it is not a HTML\n// // string. But still support it for backward compatibility.\n// html: string;\n// markers: Dictionary;\n// };\n\n/**\r\n * For backward compat, normalize the return from `formatTooltip`.\r\n */\n\nexport function normalizeTooltipFormatResult(result) {\n var markupText; // let markers: Dictionary;\n\n var markupFragment;\n\n if (zrUtil.isObject(result)) {\n if (result.type) {\n markupFragment = result;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));\n }\n } // else {\n // markupText = (result as TooltipFormatResultLegacyObject).html;\n // markers = (result as TooltipFormatResultLegacyObject).markers;\n // if (markersExisting) {\n // markers = zrUtil.merge(markersExisting, markers);\n // }\n // }\n\n } else {\n markupText = result;\n }\n\n return {\n text: markupText,\n // markers: markers || markersExisting,\n frag: markupFragment\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, isArray } from 'zrender/lib/core/util.js';\n;\n/**\r\n * @param {Object} define\r\n * @return See the return of `createTask`.\r\n */\n\nexport function createTask(define) {\n return new Task(define);\n}\n\nvar Task =\n/** @class */\nfunction () {\n function Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true;\n }\n /**\r\n * @param step Specified step.\r\n * @param skip Skip customer perform call.\r\n * @param modBy Sampling window size.\r\n * @param modDataCount Sampling count.\r\n * @return whether unfinished.\r\n */\n\n\n Task.prototype.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip; // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n\n var planResult;\n\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n } // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n\n\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n\n return val;\n }\n\n var forceFirstProgress;\n\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = this._doReset(skip);\n }\n\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n\n if (upTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(upTask._outputDueEnd != null);\n }\n\n this._dueEnd = upTask._outputDueEnd;\n } // DataTask or overallTask\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._progress || this._count);\n }\n\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n } // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n\n\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n this._doProgress(progress[i], start, end, modBy, modDataCount);\n }\n } else {\n this._doProgress(progress, start, end, modBy, modDataCount);\n }\n }\n\n this._dueIndex = end; // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n\n if (process.env.NODE_ENV !== 'production') {\n // ??? Can not rollback.\n assert(outputDueEnd >= this._outputDueEnd);\n }\n\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n\n return this.unfinished();\n };\n\n Task.prototype.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n };\n\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n this._callingProgress = progress;\n\n this._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, this.context);\n };\n\n Task.prototype._doReset = function (skip) {\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n this._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n\n if (!skip && this._reset) {\n progress = this._reset(this.context);\n\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n } // To simplify no progress checking, array must has item.\n\n\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n\n this._progress = progress;\n this._modBy = this._modDataCount = null;\n var downstream = this._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n };\n\n Task.prototype.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n };\n /**\r\n * @param downTask The downstream task.\r\n * @return The downstream task.\r\n */\n\n\n Task.prototype.pipe = function (downTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(downTask && !downTask._disposed && downTask !== this);\n } // If already downstream, do not dirty downTask.\n\n\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n };\n\n Task.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n };\n\n Task.prototype.getUpstream = function () {\n return this._upstream;\n };\n\n Task.prototype.getDownstream = function () {\n return this._downstream;\n };\n\n Task.prototype.setOutputEnd = function (end) {\n // This only happens in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the set end, in case\n // that the stub of dataZoom perform again and earse the\n // set end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n };\n\n return Task;\n}();\n\nexport { Task };\n\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}(); // -----------------------------------------------------------------------------\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// let props = [];\n// if (task.__pipeline) {\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: '__idxInPipeline/total', value: val});\n// } else {\n// let stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// let args = ['color: blue'];\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: green', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n// const pipeline = task.__pipeline;\n// let currTask = pipeline.head;\n// while (currTask) {\n// window.printTask(currTask, prefix);\n// currTask = currTask._downstream;\n// }\n// };\n// window.showChain = function (chainHeadTask) {\n// var chain = [];\n// var task = chainHeadTask;\n// while (task) {\n// chain.push({\n// task: task,\n// up: task._upstream,\n// down: task._downstream,\n// idxInPipeline: task.__idxInPipeline\n// });\n// task = task._downstream;\n// }\n// return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n// let chain = window.showChain(chainHeadTask);\n// let result = [];\n// for (let i = 0; i < chain.length; i++) {\n// let chainItem = chain[i];\n// if (chainItem.task === task) {\n// result.push(i);\n// }\n// }\n// return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n// let chainA = window.showChain(chainHeadTaskA);\n// for (let i = 0; i < chainA.length; i++) {\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { map, isString, isFunction, eqNaN, isRegExp } from 'zrender/lib/core/util.js';\nvar ECHARTS_PREFIX = '[ECharts] ';\nvar storedLogs = {};\nvar hasConsole = typeof console !== 'undefined' // eslint-disable-next-line\n&& console.warn && console.log;\n\nfunction outputLog(type, str, onlyOnce) {\n if (hasConsole) {\n if (onlyOnce) {\n if (storedLogs[str]) {\n return;\n }\n\n storedLogs[str] = true;\n } // eslint-disable-next-line\n\n\n console[type](ECHARTS_PREFIX + str);\n }\n}\n\nexport function log(str, onlyOnce) {\n outputLog('log', str, onlyOnce);\n}\nexport function warn(str, onlyOnce) {\n outputLog('warn', str, onlyOnce);\n}\nexport function error(str, onlyOnce) {\n outputLog('error', str, onlyOnce);\n}\nexport function deprecateLog(str) {\n if (process.env.NODE_ENV !== 'production') {\n // Not display duplicate message.\n outputLog('warn', 'DEPRECATED: ' + str, true);\n }\n}\nexport function deprecateReplaceLog(oldOpt, newOpt, scope) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog((scope ? \"[\" + scope + \"]\" : '') + (oldOpt + \" is deprecated, use \" + newOpt + \" instead.\"));\n }\n}\n/**\r\n * If in __DEV__ environment, get console printable message for users hint.\r\n * Parameters are separated by ' '.\r\n * @usage\r\n * makePrintable('This is an error on', someVar, someObj);\r\n *\r\n * @param hintInfo anything about the current execution context to hint users.\r\n * @throws Error\r\n */\n\nexport function makePrintable() {\n var hintInfo = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n hintInfo[_i] = arguments[_i];\n }\n\n var msg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Fuzzy stringify for print.\n // This code only exist in dev environment.\n var makePrintableStringIfPossible_1 = function (val) {\n return val === void 0 ? 'undefined' : val === Infinity ? 'Infinity' : val === -Infinity ? '-Infinity' : eqNaN(val) ? 'NaN' : val instanceof Date ? 'Date(' + val.toISOString() + ')' : isFunction(val) ? 'function () { ... }' : isRegExp(val) ? val + '' : null;\n };\n\n msg = map(hintInfo, function (arg) {\n if (isString(arg)) {\n // Print without quotation mark for some statement.\n return arg;\n } else {\n var printableStr = makePrintableStringIfPossible_1(arg);\n\n if (printableStr != null) {\n return printableStr;\n } else if (typeof JSON !== 'undefined' && JSON.stringify) {\n try {\n return JSON.stringify(arg, function (n, val) {\n var printableStr = makePrintableStringIfPossible_1(val);\n return printableStr == null ? val : printableStr;\n }); // In most cases the info object is small, so do not line break.\n } catch (err) {\n return '?';\n }\n } else {\n return '?';\n }\n }\n }).join(' ');\n }\n\n return msg;\n}\n/**\r\n * @throws Error\r\n */\n\nexport function throwError(msg) {\n throw new Error(msg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseDate, numericToNumber } from '../../util/number.js';\nimport { createHashMap, trim, hasOwn, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError } from '../../util/log.js';\n/**\r\n * Convert raw the value in to inner value in List.\r\n *\r\n * [Performance sensitive]\r\n *\r\n * [Caution]: this is the key logic of user value parser.\r\n * For backward compatibility, do not modify it until you have to!\r\n */\n\nexport function parseDataValue(value, // For high performance, do not omit the second param.\nopt) {\n // Performance sensitive.\n var dimType = opt && opt.type;\n\n if (dimType === 'ordinal') {\n // If given value is a category string\n return value;\n }\n\n if (dimType === 'time' // spead up when using timestamp\n && !isNumber(value) && value != null && value !== '-') {\n value = +parseDate(value);\n } // dimType defaults 'number'.\n // If dimType is not ordinal and value is null or undefined or NaN or '-',\n // parse to NaN.\n // number-like string (like ' 123 ') can be converted to a number.\n // where null/undefined or other string will be converted to NaN.\n\n\n return value == null || value === '' ? NaN // If string (like '-'), using '+' parse to NaN\n // If object, also parse to NaN\n : +value;\n}\n;\nvar valueParserMap = createHashMap({\n 'number': function (val) {\n // Do not use `numericToNumber` here. We have `numericToNumber` by default.\n // Here the number parser can have loose rule:\n // enable to cut suffix: \"120px\" => 120, \"14%\" => 14.\n return parseFloat(val);\n },\n 'time': function (val) {\n // return timestamp.\n return +parseDate(val);\n },\n 'trim': function (val) {\n return isString(val) ? trim(val) : val;\n }\n});\nexport function getRawValueParser(type) {\n return valueParserMap.get(type);\n}\nvar ORDER_COMPARISON_OP_MAP = {\n lt: function (lval, rval) {\n return lval < rval;\n },\n lte: function (lval, rval) {\n return lval <= rval;\n },\n gt: function (lval, rval) {\n return lval > rval;\n },\n gte: function (lval, rval) {\n return lval >= rval;\n }\n};\n\nvar FilterOrderComparator =\n/** @class */\nfunction () {\n function FilterOrderComparator(op, rval) {\n if (!isNumber(rval)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'rvalue of \"<\", \">\", \"<=\", \">=\" can only be number in filter.';\n }\n\n throwError(errMsg);\n }\n\n this._opFn = ORDER_COMPARISON_OP_MAP[op];\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterOrderComparator.prototype.evaluate = function (lval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n return isNumber(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);\n };\n\n return FilterOrderComparator;\n}();\n\nvar SortOrderComparator =\n/** @class */\nfunction () {\n /**\r\n * @param order by default: 'asc'\r\n * @param incomparable by default: Always on the tail.\r\n * That is, if 'asc' => 'max', if 'desc' => 'min'\r\n * See the definition of \"incomparable\" in [SORT_COMPARISON_RULE].\r\n */\n function SortOrderComparator(order, incomparable) {\n var isDesc = order === 'desc';\n this._resultLT = isDesc ? 1 : -1;\n\n if (incomparable == null) {\n incomparable = isDesc ? 'min' : 'max';\n }\n\n this._incomparable = incomparable === 'min' ? -Infinity : Infinity;\n } // See [SORT_COMPARISON_RULE].\n // Performance sensitive.\n\n\n SortOrderComparator.prototype.evaluate = function (lval, rval) {\n // Most cases is 'number', and typeof maybe 10 times faseter than parseFloat.\n var lvalFloat = isNumber(lval) ? lval : numericToNumber(lval);\n var rvalFloat = isNumber(rval) ? rval : numericToNumber(rval);\n var lvalNotNumeric = isNaN(lvalFloat);\n var rvalNotNumeric = isNaN(rvalFloat);\n\n if (lvalNotNumeric) {\n lvalFloat = this._incomparable;\n }\n\n if (rvalNotNumeric) {\n rvalFloat = this._incomparable;\n }\n\n if (lvalNotNumeric && rvalNotNumeric) {\n var lvalIsStr = isString(lval);\n var rvalIsStr = isString(rval);\n\n if (lvalIsStr) {\n lvalFloat = rvalIsStr ? lval : 0;\n }\n\n if (rvalIsStr) {\n rvalFloat = lvalIsStr ? rval : 0;\n }\n }\n\n return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;\n };\n\n return SortOrderComparator;\n}();\n\nexport { SortOrderComparator };\n\nvar FilterEqualityComparator =\n/** @class */\nfunction () {\n function FilterEqualityComparator(isEq, rval) {\n this._rval = rval;\n this._isEQ = isEq;\n this._rvalTypeof = typeof rval;\n this._rvalFloat = numericToNumber(rval);\n } // Performance sensitive.\n\n\n FilterEqualityComparator.prototype.evaluate = function (lval) {\n var eqResult = lval === this._rval;\n\n if (!eqResult) {\n var lvalTypeof = typeof lval;\n\n if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {\n eqResult = numericToNumber(lval) === this._rvalFloat;\n }\n }\n\n return this._isEQ ? eqResult : !eqResult;\n };\n\n return FilterEqualityComparator;\n}();\n/**\r\n * [FILTER_COMPARISON_RULE]\r\n * `lt`|`lte`|`gt`|`gte`:\r\n * + rval must be a number. And lval will be converted to number (`numericToNumber`) to compare.\r\n * `eq`:\r\n * + If same type, compare with `===`.\r\n * + If there is one number, convert to number (`numericToNumber`) to compare.\r\n * + Else return `false`.\r\n * `ne`:\r\n * + Not `eq`.\r\n *\r\n *\r\n * [SORT_COMPARISON_RULE]\r\n * All the values are grouped into three categories:\r\n * + \"numeric\" (number and numeric string)\r\n * + \"non-numeric-string\" (string that excluding numeric string)\r\n * + \"others\"\r\n * \"numeric\" vs \"numeric\": values are ordered by number order.\r\n * \"non-numeric-string\" vs \"non-numeric-string\": values are ordered by ES spec (#sec-abstract-relational-comparison).\r\n * \"others\" vs \"others\": do not change order (always return 0).\r\n * \"numeric\" vs \"non-numeric-string\": \"non-numeric-string\" is treated as \"incomparable\".\r\n * \"number\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"non-numeric-string\" vs \"others\": \"others\" is treated as \"incomparable\".\r\n * \"incomparable\" will be seen as -Infinity or Infinity (depends on the settings).\r\n * MEMO:\r\n * Non-numeric string sort makes sense when we need to put the items with the same tag together.\r\n * But if we support string sort, we still need to avoid the misleading like `'2' > '12'`,\r\n * So we treat \"numeric-string\" sorted by number order rather than string comparison.\r\n *\r\n *\r\n * [CHECK_LIST_OF_THE_RULE_DESIGN]\r\n * + Do not support string comparison until required. And also need to\r\n * avoid the misleading of \"2\" > \"12\".\r\n * + Should avoid the misleading case:\r\n * `\" 22 \" gte \"22\"` is `true` but `\" 22 \" eq \"22\"` is `false`.\r\n * + JS bad case should be avoided: null <= 0, [] <= 0, ' ' <= 0, ...\r\n * + Only \"numeric\" can be converted to comparable number, otherwise converted to NaN.\r\n * See `util/number.ts#numericToNumber`.\r\n *\r\n * @return If `op` is not `RelationalOperator`, return null;\r\n */\n\n\nexport function createFilterComparator(op, rval) {\n return op === 'eq' || op === 'ne' ? new FilterEqualityComparator(op === 'eq', rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_OBJECT_ROWS, SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createHashMap, bind, each, hasOwn, map, clone, isObject, extend, isNumber } from 'zrender/lib/core/util.js';\nimport { getRawSourceItemGetter, getRawSourceDataCounter, getRawSourceValueGetter } from './dataProvider.js';\nimport { parseDataValue } from './dataValueHelper.js';\nimport { log, makePrintable, throwError } from '../../util/log.js';\nimport { createSource, detectSourceFormat } from '../Source.js';\n/**\r\n * TODO: disable writable.\r\n * This structure will be exposed to users.\r\n */\n\nvar ExternalSource =\n/** @class */\nfunction () {\n function ExternalSource() {}\n\n ExternalSource.prototype.getRawData = function () {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.getRawDataItem = function (dataIndex) {\n // Only built-in transform available.\n throw new Error('not supported');\n };\n\n ExternalSource.prototype.cloneRawData = function () {\n return;\n };\n /**\r\n * @return If dimension not found, return null/undefined.\r\n */\n\n\n ExternalSource.prototype.getDimensionInfo = function (dim) {\n return;\n };\n /**\r\n * dimensions defined if and only if either:\r\n * (a) dataset.dimensions are declared.\r\n * (b) dataset data include dimensions definitions in data (detected or via specified `sourceHeader`).\r\n * If dimensions are defined, `dimensionInfoAll` is corresponding to\r\n * the defined dimensions.\r\n * Otherwise, `dimensionInfoAll` is determined by data columns.\r\n * @return Always return an array (even empty array).\r\n */\n\n\n ExternalSource.prototype.cloneAllDimensionInfo = function () {\n return;\n };\n\n ExternalSource.prototype.count = function () {\n return;\n };\n /**\r\n * Only support by dimension index.\r\n * No need to support by dimension name in transform function,\r\n * because transform function is not case-specific, no need to use name literally.\r\n */\n\n\n ExternalSource.prototype.retrieveValue = function (dataIndex, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.retrieveValueFromItem = function (dataItem, dimIndex) {\n return;\n };\n\n ExternalSource.prototype.convertValue = function (rawVal, dimInfo) {\n return parseDataValue(rawVal, dimInfo);\n };\n\n return ExternalSource;\n}();\n\nexport { ExternalSource };\n\nfunction createExternalSource(internalSource, externalTransform) {\n var extSource = new ExternalSource();\n var data = internalSource.data;\n var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;\n var sourceHeaderCount = internalSource.startIndex;\n var errMsg = '';\n\n if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {\n // For the logic simplicity in transformer, only 'culumn' is\n // supported in data transform. Otherwise, the `dimensionsDefine`\n // might be detected by 'row', which probably confuses users.\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`seriesLayoutBy` of upstream dataset can only be \"column\" in data transform.';\n }\n\n throwError(errMsg);\n } // [MEMO]\n // Create a new dimensions structure for exposing.\n // Do not expose all dimension info to users directly.\n // Because the dimension is probably auto detected from data and not might reliable.\n // Should not lead the transformers to think that is reliable and return it.\n // See [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\n\n\n var dimensions = [];\n var dimsByName = {};\n var dimsDef = internalSource.dimensionsDefine;\n\n if (dimsDef) {\n each(dimsDef, function (dimDef, idx) {\n var name = dimDef.name;\n var dimDefExt = {\n index: idx,\n name: name,\n displayName: dimDef.displayName\n };\n dimensions.push(dimDefExt); // Users probably do not specify dimension name. For simplicity, data transform\n // does not generate dimension name.\n\n if (name != null) {\n // Dimension name should not be duplicated.\n // For simplicity, data transform forbids name duplication, do not generate\n // new name like module `completeDimensions.ts` did, but just tell users.\n var errMsg_1 = '';\n\n if (hasOwn(dimsByName, name)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'dimension name \"' + name + '\" duplicated.';\n }\n\n throwError(errMsg_1);\n }\n\n dimsByName[name] = dimDefExt;\n }\n });\n } // If dimension definitions are not defined and can not be detected.\n // e.g., pure data `[[11, 22], ...]`.\n else {\n for (var i = 0; i < internalSource.dimensionsDetectedCount || 0; i++) {\n // Do not generete name or anything others. The consequence process in\n // `transform` or `series` probably have there own name generation strategry.\n dimensions.push({\n index: i\n });\n }\n } // Implement public methods:\n\n\n var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n\n if (externalTransform.__isBuiltIn) {\n extSource.getRawDataItem = function (dataIndex) {\n return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n };\n\n extSource.getRawData = bind(getRawData, null, internalSource);\n }\n\n extSource.cloneRawData = bind(cloneRawData, null, internalSource);\n var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);\n extSource.count = bind(rawCounter, null, data, sourceHeaderCount, dimensions);\n var rawValueGetter = getRawSourceValueGetter(sourceFormat);\n\n extSource.retrieveValue = function (dataIndex, dimIndex) {\n var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);\n return retrieveValueFromItem(rawItem, dimIndex);\n };\n\n var retrieveValueFromItem = extSource.retrieveValueFromItem = function (dataItem, dimIndex) {\n if (dataItem == null) {\n return;\n }\n\n var dimDef = dimensions[dimIndex]; // When `dimIndex` is `null`, `rawValueGetter` return the whole item.\n\n if (dimDef) {\n return rawValueGetter(dataItem, dimIndex, dimDef.name);\n }\n };\n\n extSource.getDimensionInfo = bind(getDimensionInfo, null, dimensions, dimsByName);\n extSource.cloneAllDimensionInfo = bind(cloneAllDimensionInfo, null, dimensions);\n return extSource;\n}\n\nfunction getRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`getRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n return upstream.data;\n}\n\nfunction cloneRawData(upstream) {\n var sourceFormat = upstream.sourceFormat;\n var data = upstream.data;\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '`cloneRawData` is not supported in source format ' + sourceFormat;\n }\n\n throwError(errMsg);\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(data[i].slice());\n }\n\n return result;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n var result = [];\n\n for (var i = 0, len = data.length; i < len; i++) {\n // Not strictly clone for performance\n result.push(extend({}, data[i]));\n }\n\n return result;\n }\n}\n\nfunction getDimensionInfo(dimensions, dimsByName, dim) {\n if (dim == null) {\n return;\n } // Keep the same logic as `List::getDimension` did.\n\n\n if (isNumber(dim) // If being a number-like string but not being defined a dimension name.\n || !isNaN(dim) && !hasOwn(dimsByName, dim)) {\n return dimensions[dim];\n } else if (hasOwn(dimsByName, dim)) {\n return dimsByName[dim];\n }\n}\n\nfunction cloneAllDimensionInfo(dimensions) {\n return clone(dimensions);\n}\n\nvar externalTransformMap = createHashMap();\nexport function registerExternalTransform(externalTransform) {\n externalTransform = clone(externalTransform);\n var type = externalTransform.type;\n var errMsg = '';\n\n if (!type) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have a `type` when `registerTransform`.';\n }\n\n throwError(errMsg);\n }\n\n var typeParsed = type.split(':');\n\n if (typeParsed.length !== 2) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Name must include namespace like \"ns:regression\".';\n }\n\n throwError(errMsg);\n } // Namespace 'echarts:xxx' is official namespace, where the transforms should\n // be called directly via 'xxx' rather than 'echarts:xxx'.\n\n\n var isBuiltIn = false;\n\n if (typeParsed[0] === 'echarts') {\n type = typeParsed[1];\n isBuiltIn = true;\n }\n\n externalTransform.__isBuiltIn = isBuiltIn;\n externalTransformMap.set(type, externalTransform);\n}\nexport function applyDataTransform(rawTransOption, sourceList, infoForPrint) {\n var pipedTransOption = normalizeToArray(rawTransOption);\n var pipeLen = pipedTransOption.length;\n var errMsg = '';\n\n if (!pipeLen) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'If `transform` declared, it should at least contain one transform.';\n }\n\n throwError(errMsg);\n }\n\n for (var i = 0, len = pipeLen; i < len; i++) {\n var transOption = pipedTransOption[i];\n sourceList = applySingleDataTransform(transOption, sourceList, infoForPrint, pipeLen === 1 ? null : i); // piped transform only support single input, except the fist one.\n // piped transform only support single output, except the last one.\n\n if (i !== len - 1) {\n sourceList.length = Math.max(sourceList.length, 1);\n }\n }\n\n return sourceList;\n}\n\nfunction applySingleDataTransform(transOption, upSourceList, infoForPrint, // If `pipeIndex` is null/undefined, no piped transform.\npipeIndex) {\n var errMsg = '';\n\n if (!upSourceList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Must have at least one upstream dataset.';\n }\n\n throwError(errMsg);\n }\n\n if (!isObject(transOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'transform declaration must be an object rather than ' + typeof transOption + '.';\n }\n\n throwError(errMsg);\n }\n\n var transType = transOption.type;\n var externalTransform = externalTransformMap.get(transType);\n\n if (!externalTransform) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not find transform on type \"' + transType + '\".';\n }\n\n throwError(errMsg);\n } // Prepare source\n\n\n var extUpSourceList = map(upSourceList, function (upSource) {\n return createExternalSource(upSource, externalTransform);\n });\n var resultList = normalizeToArray(externalTransform.transform({\n upstream: extUpSourceList[0],\n upstreamList: extUpSourceList,\n config: clone(transOption.config)\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n if (transOption.print) {\n var printStrArr = map(resultList, function (extSource) {\n var pipeIndexStr = pipeIndex != null ? ' === pipe index: ' + pipeIndex : '';\n return ['=== dataset index: ' + infoForPrint.datasetIndex + pipeIndexStr + ' ===', '- transform result data:', makePrintable(extSource.data), '- transform result dimensions:', makePrintable(extSource.dimensions)].join('\\n');\n }).join('\\n');\n log(printStrArr);\n }\n }\n\n return map(resultList, function (result, resultIndex) {\n var errMsg = '';\n\n if (!isObject(result)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'A transform should not return some empty results.';\n }\n\n throwError(errMsg);\n }\n\n if (!result.data) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be not be null or undefined';\n }\n\n throwError(errMsg);\n }\n\n var sourceFormat = detectSourceFormat(result.data);\n\n if (!isSupportedSourceFormat(sourceFormat)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Transform result data should be array rows or object rows.';\n }\n\n throwError(errMsg);\n }\n\n var resultMetaRawOption;\n var firstUpSource = upSourceList[0];\n /**\r\n * Intuitively, the end users known the content of the original `dataset.source`,\r\n * calucating the transform result in mind.\r\n * Suppose the original `dataset.source` is:\r\n * ```js\r\n * [\r\n * ['product', '2012', '2013', '2014', '2015'],\r\n * ['AAA', 41.1, 30.4, 65.1, 53.3],\r\n * ['BBB', 86.5, 92.1, 85.7, 83.1],\r\n * ['CCC', 24.1, 67.2, 79.5, 86.4]\r\n * ]\r\n * ```\r\n * The dimension info have to be detected from the source data.\r\n * Some of the transformers (like filter, sort) will follow the dimension info\r\n * of upstream, while others use new dimensions (like aggregate).\r\n * Transformer can output a field `dimensions` to define the its own output dimensions.\r\n * We also allow transformers to ignore the output `dimensions` field, and\r\n * inherit the upstream dimensions definition. It can reduce the burden of handling\r\n * dimensions in transformers.\r\n *\r\n * See also [DIMENSION_INHERIT_RULE] in `sourceManager.ts`.\r\n */\n\n if (firstUpSource && resultIndex === 0 // If transformer returns `dimensions`, it means that the transformer has different\n // dimensions definitions. We do not inherit anything from upstream.\n && !result.dimensions) {\n var startIndex = firstUpSource.startIndex; // We copy the header of upstream to the result, because:\n // (1) The returned data always does not contain header line and can not be used\n // as dimension-detection. In this case we can not use \"detected dimensions\" of\n // upstream directly, because it might be detected based on different `seriesLayoutBy`.\n // (2) We should support that the series read the upstream source in `seriesLayoutBy: 'row'`.\n // So the original detected header should be add to the result, otherwise they can not be read.\n\n if (startIndex) {\n result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);\n }\n\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: startIndex,\n dimensions: firstUpSource.metaRawOption.dimensions\n };\n } else {\n resultMetaRawOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n sourceHeader: 0,\n dimensions: result.dimensions\n };\n }\n\n return createSource(result.data, resultMetaRawOption, null);\n });\n}\n\nfunction isSupportedSourceFormat(sourceFormat) {\n return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from './helper/dataValueHelper.js';\nimport { shouldRetrieveDataByName } from './Source.js';\nvar UNDEFINED = 'undefined';\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nexport var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nexport var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nexport var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nexport var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\n/**\r\n * Multi dimensional data store\r\n */\n\nvar dataCtors = {\n 'float': CtorFloat64Array,\n 'int': CtorInt32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': CtorFloat64Array\n};\nvar defaultDimValueGetters;\n\nfunction getIndicesCtor(rawCount) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n\n;\n\nfunction getInitialExtent() {\n return [Infinity, -Infinity];\n}\n\n;\n\nfunction cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\n\nfunction prepareStore(store, dimIdx, dimType, end, append) {\n var DataCtor = dataCtors[dimType || 'float'];\n\n if (append) {\n var oldStore = store[dimIdx];\n var oldLen = oldStore && oldStore.length;\n\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n\n store[dimIdx] = newStore;\n }\n } else {\n store[dimIdx] = new DataCtor(end);\n }\n}\n\n;\n/**\r\n * Basically, DataStore API keep immutable.\r\n */\n\nvar DataStore =\n/** @class */\nfunction () {\n function DataStore() {\n this._chunks = []; // It will not be calculated until needed.\n\n this._rawExtent = [];\n this._extent = [];\n this._count = 0;\n this._rawCount = 0;\n this._calcDimNameToIdx = createHashMap();\n }\n /**\r\n * Initialize from data\r\n */\n\n\n DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isFunction(provider.getItem) && isFunction(provider.count), 'Invalid data provider.');\n }\n\n this._provider = provider; // Clear\n\n this._chunks = [];\n this._indices = null;\n this.getRawIndex = this._getRawIdxIdentity;\n var source = provider.getSource();\n var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter || defaultGetter; // Reset raw extent.\n\n this._rawExtent = [];\n var willRetrieveDataByName = shouldRetrieveDataByName(source);\n this._dimensions = map(inputDimensions, function (dim) {\n if (process.env.NODE_ENV !== 'production') {\n if (willRetrieveDataByName) {\n assert(dim.property != null);\n }\n }\n\n return {\n // Only pick these two props. Not leak other properties like orderMeta.\n type: dim.type,\n property: dim.property\n };\n });\n\n this._initDataFromProvider(0, provider.count());\n };\n\n DataStore.prototype.getProvider = function () {\n return this._provider;\n };\n /**\r\n * Caution: even when a `source` instance owned by a series, the created data store\r\n * may still be shared by different sereis (the source hash does not use all `source`\r\n * props, see `sourceManager`). In this case, the `source` props that are not used in\r\n * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\r\n * thus should not be fetch here.\r\n */\n\n\n DataStore.prototype.getSource = function () {\n return this._provider.getSource();\n };\n /**\r\n * @caution Only used in dataStack.\r\n */\n\n\n DataStore.prototype.ensureCalculationDimension = function (dimName, type) {\n var calcDimNameToIdx = this._calcDimNameToIdx;\n var dimensions = this._dimensions;\n var calcDimIdx = calcDimNameToIdx.get(dimName);\n\n if (calcDimIdx != null) {\n if (dimensions[calcDimIdx].type === type) {\n return calcDimIdx;\n }\n } else {\n calcDimIdx = dimensions.length;\n }\n\n dimensions[calcDimIdx] = {\n type: type\n };\n calcDimNameToIdx.set(dimName, calcDimIdx);\n this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\n this._rawExtent[calcDimIdx] = getInitialExtent();\n return calcDimIdx;\n };\n\n DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) {\n var chunk = this._chunks[dimIdx];\n var dim = this._dimensions[dimIdx];\n var rawExtents = this._rawExtent;\n var offset = dim.ordinalOffset || 0;\n var len = chunk.length;\n\n if (offset === 0) {\n // We need to reset the rawExtent if collect is from start.\n // Because this dimension may be guessed as number and calcuating a wrong extent.\n rawExtents[dimIdx] = getInitialExtent();\n }\n\n var dimRawExtent = rawExtents[dimIdx]; // Parse from previous data offset. len may be changed after appendData\n\n for (var i = offset; i < len; i++) {\n var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]);\n\n if (!isNaN(val)) {\n dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\n dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\n }\n }\n\n dim.ordinalMeta = ordinalMeta;\n dim.ordinalOffset = len;\n dim.type = 'ordinal'; // Force to be ordinal\n };\n\n DataStore.prototype.getOrdinalMeta = function (dimIdx) {\n var dimInfo = this._dimensions[dimIdx];\n var ordinalMeta = dimInfo.ordinalMeta;\n return ordinalMeta;\n };\n\n DataStore.prototype.getDimensionProperty = function (dimIndex) {\n var item = this._dimensions[dimIndex];\n return item && item.property;\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\n\n\n DataStore.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._indices, 'appendData can only be called on raw data.');\n }\n\n var provider = this._provider;\n var start = this.count();\n provider.appendData(data);\n var end = provider.count();\n\n if (!provider.persistent) {\n end += start;\n }\n\n if (start < end) {\n this._initDataFromProvider(start, end, true);\n }\n\n return [start, end];\n };\n\n DataStore.prototype.appendValues = function (values, minFillLen) {\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, minFillLen || 0);\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n prepareStore(chunks, i, dim.type, end, true);\n }\n\n var emptyDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start; // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);\n chunks[dimIdx][idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n\n this._rawCount = this._count = end;\n return {\n start: start,\n end: end\n };\n };\n\n DataStore.prototype._initDataFromProvider = function (start, end, append) {\n var provider = this._provider;\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var dimNames = map(dimensions, function (dim) {\n return dim.property;\n });\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[i]) {\n rawExtent[i] = getInitialExtent();\n }\n\n prepareStore(chunks, i, dim.type, end, append);\n }\n\n if (provider.fillStorage) {\n provider.fillStorage(start, end, chunks, rawExtent);\n } else {\n var dataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = provider.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dimStorage = chunks[dimIdx]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);\n\n dimStorage[idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n }\n\n if (!provider.persistent && provider.clean) {\n // Clean unused data if data source is typed array.\n provider.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = [];\n };\n\n DataStore.prototype.count = function () {\n return this._count;\n };\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n */\n\n\n DataStore.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n\n DataStore.prototype.getValues = function (dimensions, idx) {\n var values = [];\n var dimArr = [];\n\n if (idx == null) {\n idx = dimensions; // TODO get all from store?\n\n dimensions = []; // All dimensions\n\n for (var i = 0; i < this._dimensions.length; i++) {\n dimArr.push(i);\n }\n } else {\n dimArr = dimensions;\n }\n\n for (var i = 0, len = dimArr.length; i < len; i++) {\n values.push(this.get(dimArr[i], idx));\n }\n\n return values;\n };\n /**\r\n * @param dim concrete dim\r\n */\n\n\n DataStore.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n /**\r\n * Get sum of data in one dimension\r\n */\n\n\n DataStore.prototype.getSum = function (dim) {\n var dimData = this._chunks[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n };\n /**\r\n * Get median of data in one dimension\r\n */\n\n\n DataStore.prototype.getMedian = function (dim) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each([dim], function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n };\n /**\r\n * Retrieve the index with given raw data index.\r\n */\n\n\n DataStore.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n };\n /**\r\n * Retrieve the index of nearest value.\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices have\r\n * the same value, they are put to the result.\r\n */\n\n\n DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var chunks = this._chunks;\n var dimData = chunks[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/SeriesData.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we choose the one that `diff >= 0` in this case.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n\n DataStore.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this._rawCount);\n newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n };\n /**\r\n * Data filter.\r\n */\n\n\n DataStore.prototype.filter = function (dims, cb) {\n if (!this._count) {\n return this;\n }\n\n var newStore = this.clone();\n var count = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dims.length;\n var offset = 0;\n var dim0 = dims[0];\n var chunks = newStore._chunks;\n\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = newStore.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb(i);\n } else if (dimSize === 1) {\n var val = chunks[dim0][rawIdx];\n keep = cb(val, i);\n } else {\n var k = 0;\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n }\n\n value[k] = i;\n keep = cb.apply(null, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n };\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\n\n\n DataStore.prototype.selectRange = function (range) {\n var newStore = this.clone();\n var len = newStore._count;\n\n if (!len) {\n return this;\n }\n\n var dims = keys(range);\n var dimSize = dims.length;\n\n if (!dimSize) {\n return this;\n }\n\n var originalCount = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dims[0];\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storeArr = newStore._chunks;\n var quickFinished = false;\n\n if (!newStore._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = storeArr[dims[0]];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storeArr[dims[0]];\n var dimStorage2 = storeArr[dims[1]];\n var min2 = range[dims[1]][0];\n var max2 = range[dims[1]][1];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = newStore.getRawIndex(i);\n var val = storeArr[dims[0]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = newStore.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dims[k];\n var val = storeArr[dimk][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = newStore.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n }; // /**\n // * Data mapping to a plain array\n // */\n // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\n // const result: any[] = [];\n // this.each(dims, function () {\n // result.push(cb && (cb as MapArrayCb).apply(null, arguments));\n // });\n // return result;\n // }\n\n /**\r\n * Data mapping to a new List with given dimensions\r\n */\n\n\n DataStore.prototype.map = function (dims, cb) {\n // TODO only clone picked chunks.\n var target = this.clone(dims);\n\n this._updateDims(target, dims, cb);\n\n return target;\n };\n /**\r\n * @caution Danger!! Only used in dataStack.\r\n */\n\n\n DataStore.prototype.modify = function (dims, cb) {\n this._updateDims(this, dims, cb);\n };\n\n DataStore.prototype._updateDims = function (target, dims, cb) {\n var targetChunks = target._chunks;\n var tmpRetValue = [];\n var dimSize = dims.length;\n var dataCount = target.count();\n var values = [];\n var rawExtent = target._rawExtent;\n\n for (var i = 0; i < dims.length; i++) {\n rawExtent[dims[i]] = getInitialExtent();\n }\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n var rawIndex = target.getRawIndex(dataIndex);\n\n for (var k = 0; k < dimSize; k++) {\n values[k] = targetChunks[dims[k]][rawIndex];\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(null, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dims[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = targetChunks[dim];\n\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n };\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\n\n\n DataStore.prototype.lttbDownSample = function (valueDimension, rate) {\n var target = this.clone([valueDimension], true);\n var targetStorage = target._chunks;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var sampledIndex = 0;\n var frameSize = Math.floor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex;\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len / frameSize) + 2) * 2, len)); // First frame use the first data.\n\n newIndices[sampledIndex++] = currentRawIndex;\n\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n }\n\n avgY += y;\n }\n\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart;\n var firstNaNIndex = -1;\n var countNaN = 0; // Find a point from current frame that construct a triangle with largest area with previous selected point\n // And the average of next frame.\n\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n countNaN++;\n\n if (firstNaNIndex < 0) {\n firstNaNIndex = rawIndex;\n }\n\n continue;\n } // Calculate triangle area over three buckets\n\n\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n if (countNaN > 0 && countNaN < frameEnd - frameStart) {\n // Append first NaN point in every bucket.\n // It is necessary to ensure the correct order of indices.\n newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);\n nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);\n }\n\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n } // First frame use the last data.\n\n\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n target._count = sampledIndex;\n target._indices = newIndices;\n target.getRawIndex = this._getRawIdx;\n return target;\n };\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\n\n\n DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var target = this.clone([dimension], true);\n var targetStorage = target._chunks;\n var frameValues = [];\n var frameSize = Math.floor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data\n\n dimStore[sampleFrameIdx] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n target._count = offset;\n target._indices = newIndices;\n\n target._updateGetRawIdx();\n\n return target;\n };\n /**\r\n * Data iteration\r\n * @param ctx default this\r\n * @example\r\n * list.each('x', function (x, idx) {});\r\n * list.each(['x', 'y'], function (x, y, idx) {});\r\n * list.each(function (idx) {})\r\n */\n\n\n DataStore.prototype.each = function (dims, cb) {\n if (!this._count) {\n return;\n }\n\n var dimSize = dims.length;\n var chunks = this._chunks;\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n switch (dimSize) {\n case 0:\n cb(i);\n break;\n\n case 1:\n cb(chunks[dims[0]][rawIdx], i);\n break;\n\n case 2:\n cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n } // Index\n\n\n value[k] = i;\n cb.apply(null, value);\n }\n }\n };\n /**\r\n * Get extent of data in one dimension\r\n */\n\n\n DataStore.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n var dimData = this._chunks[dim];\n var initialExtent = getInitialExtent();\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices;\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\r\n * Get raw data item\r\n */\n\n\n DataStore.prototype.getRawDataItem = function (idx) {\n var rawIdx = this.getRawIndex(idx);\n\n if (!this._provider.persistent) {\n var val = [];\n var chunks = this._chunks;\n\n for (var i = 0; i < chunks.length; i++) {\n val.push(chunks[i][rawIdx]);\n }\n\n return val;\n } else {\n return this._provider.getItem(rawIdx);\n }\n };\n /**\r\n * Clone shallow.\r\n *\r\n * @param clonedDims Determine which dims to clone. Will share the data if not specified.\r\n */\n\n\n DataStore.prototype.clone = function (clonedDims, ignoreIndices) {\n var target = new DataStore();\n var chunks = this._chunks;\n var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) {\n obj[dimIdx] = true;\n return obj;\n }, {});\n\n if (clonedDimsMap) {\n for (var i = 0; i < chunks.length; i++) {\n // Not clone if dim is not picked.\n target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\n }\n } else {\n target._chunks = chunks;\n }\n\n this._copyCommonProps(target);\n\n if (!ignoreIndices) {\n target._indices = this._cloneIndices();\n }\n\n target._updateGetRawIdx();\n\n return target;\n };\n\n DataStore.prototype._copyCommonProps = function (target) {\n target._count = this._count;\n target._rawCount = this._rawCount;\n target._provider = this._provider;\n target._dimensions = this._dimensions;\n target._extent = clone(this._extent);\n target._rawExtent = clone(this._rawExtent);\n };\n\n DataStore.prototype._cloneIndices = function () {\n if (this._indices) {\n var Ctor = this._indices.constructor;\n var indices = void 0;\n\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n indices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n indices[i] = this._indices[i];\n }\n } else {\n indices = new Ctor(this._indices);\n }\n\n return indices;\n }\n\n return null;\n };\n\n DataStore.prototype._getRawIdxIdentity = function (idx) {\n return idx;\n };\n\n DataStore.prototype._getRawIdx = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n };\n\n DataStore.prototype._updateGetRawIdx = function () {\n this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\n };\n\n DataStore.internalField = function () {\n function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\n }\n\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, property, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\n return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensions[dimIndex]);\n },\n typedArray: function (dataItem, property, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n }();\n\n return DataStore;\n}();\n\nexport default DataStore;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { setAsPrimitive, map, isTypedArray, assert, each, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createSource, cloneSourceShallow } from '../Source.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\nimport { querySeriesUpstreamDatasetModel, queryDatasetUpstreamDatasetModels } from './sourceHelper.js';\nimport { applyDataTransform } from './transform.js';\nimport DataStore from '../DataStore.js';\nimport { DefaultDataProvider } from './dataProvider.js';\n/**\r\n * [REQUIREMENT_MEMO]:\r\n * (0) `metaRawOption` means `dimensions`/`sourceHeader`/`seriesLayoutBy` in raw option.\r\n * (1) Keep support the feature: `metaRawOption` can be specified both on `series` and\r\n * `root-dataset`. Them on `series` has higher priority.\r\n * (2) Do not support to set `metaRawOption` on a `non-root-dataset`, because it might\r\n * confuse users: whether those props indicate how to visit the upstream source or visit\r\n * the transform result source, and some transforms has nothing to do with these props,\r\n * and some transforms might have multiple upstream.\r\n * (3) Transforms should specify `metaRawOption` in each output, just like they can be\r\n * declared in `root-dataset`.\r\n * (4) At present only support visit source in `SERIES_LAYOUT_BY_COLUMN` in transforms.\r\n * That is for reducing complexity in transforms.\r\n * PENDING: Whether to provide transposition transform?\r\n *\r\n * [IMPLEMENTAION_MEMO]:\r\n * \"sourceVisitConfig\" are calculated from `metaRawOption` and `data`.\r\n * They will not be calculated until `source` is about to be visited (to prevent from\r\n * duplicate calcuation). `source` is visited only in series and input to transforms.\r\n *\r\n * [DIMENSION_INHERIT_RULE]:\r\n * By default the dimensions are inherited from ancestors, unless a transform return\r\n * a new dimensions definition.\r\n * Consider the case:\r\n * ```js\r\n * dataset: [{\r\n * source: [ ['Product', 'Sales', 'Prise'], ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * dataset: [{\r\n * dimension: ['Product', 'Sales', 'Prise'],\r\n * source: [ ['Cookies', 321, 44.21], ...]\r\n * }, {\r\n * transform: { type: 'filter', ... }\r\n * }]\r\n * ```\r\n * The two types of option should have the same behavior after transform.\r\n *\r\n *\r\n * [SCENARIO]:\r\n * (1) Provide source data directly:\r\n * ```js\r\n * series: {\r\n * encode: {...},\r\n * dimensions: [...]\r\n * seriesLayoutBy: 'row',\r\n * data: [[...]]\r\n * }\r\n * ```\r\n * (2) Series refer to dataset.\r\n * ```js\r\n * series: [{\r\n * encode: {...}\r\n * // Ignore datasetIndex means `datasetIndex: 0`\r\n * // and the dimensions defination in dataset is used\r\n * }, {\r\n * encode: {...},\r\n * seriesLayoutBy: 'column',\r\n * datasetIndex: 1\r\n * }]\r\n * ```\r\n * (3) dataset transform\r\n * ```js\r\n * dataset: [{\r\n * source: [...]\r\n * }, {\r\n * source: [...]\r\n * }, {\r\n * // By default from 0.\r\n * transform: { type: 'filter', config: {...} }\r\n * }, {\r\n * // Piped.\r\n * transform: [\r\n * { type: 'filter', config: {...} },\r\n * { type: 'sort', config: {...} }\r\n * ]\r\n * }, {\r\n * id: 'regressionData',\r\n * fromDatasetIndex: 1,\r\n * // Third-party transform\r\n * transform: { type: 'ecStat:regression', config: {...} }\r\n * }, {\r\n * // retrieve the extra result.\r\n * id: 'regressionFormula',\r\n * fromDatasetId: 'regressionData',\r\n * fromTransformResult: 1\r\n * }]\r\n * ```\r\n */\n\nvar SourceManager =\n/** @class */\nfunction () {\n function SourceManager(sourceHost) {\n // Cached source. Do not repeat calculating if not dirty.\n this._sourceList = [];\n this._storeList = []; // version sign of each upstream source manager.\n\n this._upstreamSignList = [];\n this._versionSignBase = 0;\n this._dirty = true;\n this._sourceHost = sourceHost;\n }\n /**\r\n * Mark dirty.\r\n */\n\n\n SourceManager.prototype.dirty = function () {\n this._setLocalSource([], []);\n\n this._storeList = [];\n this._dirty = true;\n };\n\n SourceManager.prototype._setLocalSource = function (sourceList, upstreamSignList) {\n this._sourceList = sourceList;\n this._upstreamSignList = upstreamSignList;\n this._versionSignBase++;\n\n if (this._versionSignBase > 9e10) {\n this._versionSignBase = 0;\n }\n };\n /**\r\n * For detecting whether the upstream source is dirty, so that\r\n * the local cached source (in `_sourceList`) should be discarded.\r\n */\n\n\n SourceManager.prototype._getVersionSign = function () {\n return this._sourceHost.uid + '_' + this._versionSignBase;\n };\n /**\r\n * Always return a source instance. Otherwise throw error.\r\n */\n\n\n SourceManager.prototype.prepareSource = function () {\n // For the case that call `setOption` multiple time but no data changed,\n // cache the result source to prevent from repeating transform.\n if (this._isDirty()) {\n this._createSource();\n\n this._dirty = false;\n }\n };\n\n SourceManager.prototype._createSource = function () {\n this._setLocalSource([], []);\n\n var sourceHost = this._sourceHost;\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n var hasUpstream = !!upSourceMgrList.length;\n var resultSourceList;\n var upstreamSignList;\n\n if (isSeries(sourceHost)) {\n var seriesModel = sourceHost;\n var data = void 0;\n var sourceFormat = void 0;\n var upSource = void 0; // Has upstream dataset\n\n if (hasUpstream) {\n var upSourceMgr = upSourceMgrList[0];\n upSourceMgr.prepareSource();\n upSource = upSourceMgr.getSource();\n data = upSource.data;\n sourceFormat = upSource.sourceFormat;\n upstreamSignList = [upSourceMgr._getVersionSign()];\n } // Series data is from own.\n else {\n data = seriesModel.get('data', true);\n sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n upstreamSignList = [];\n } // See [REQUIREMENT_MEMO], merge settings on series and parent dataset if it is root.\n\n\n var newMetaRawOption = this._getSourceMetaRawOption() || {};\n var upMetaRawOption = upSource && upSource.metaRawOption || {};\n var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;\n var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader); // Note here we should not use `upSource.dimensionsDefine`. Consider the case:\n // `upSource.dimensionsDefine` is detected by `seriesLayoutBy: 'column'`,\n // but series need `seriesLayoutBy: 'row'`.\n\n var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions); // We share source with dataset as much as possible\n // to avoid extra memory cost of high dimensional data.\n\n var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;\n resultSourceList = needsCreateSource ? [createSource(data, {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n }, sourceFormat)] : [];\n } else {\n var datasetModel = sourceHost; // Has upstream dataset.\n\n if (hasUpstream) {\n var result = this._applyTransform(upSourceMgrList);\n\n resultSourceList = result.sourceList;\n upstreamSignList = result.upstreamSignList;\n } // Is root dataset.\n else {\n var sourceData = datasetModel.get('source', true);\n resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];\n upstreamSignList = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n assert(resultSourceList && upstreamSignList);\n }\n\n this._setLocalSource(resultSourceList, upstreamSignList);\n };\n\n SourceManager.prototype._applyTransform = function (upMgrList) {\n var datasetModel = this._sourceHost;\n var transformOption = datasetModel.get('transform', true);\n var fromTransformResult = datasetModel.get('fromTransformResult', true);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(fromTransformResult != null || transformOption != null);\n }\n\n if (fromTransformResult != null) {\n var errMsg = '';\n\n if (upMgrList.length !== 1) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'When using `fromTransformResult`, there should be only one upstream dataset';\n }\n\n doThrow(errMsg);\n }\n }\n\n var sourceList;\n var upSourceList = [];\n var upstreamSignList = [];\n each(upMgrList, function (upMgr) {\n upMgr.prepareSource();\n var upSource = upMgr.getSource(fromTransformResult || 0);\n var errMsg = '';\n\n if (fromTransformResult != null && !upSource) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Can not retrieve result by `fromTransformResult`: ' + fromTransformResult;\n }\n\n doThrow(errMsg);\n }\n\n upSourceList.push(upSource);\n upstreamSignList.push(upMgr._getVersionSign());\n });\n\n if (transformOption) {\n sourceList = applyDataTransform(transformOption, upSourceList, {\n datasetIndex: datasetModel.componentIndex\n });\n } else if (fromTransformResult != null) {\n sourceList = [cloneSourceShallow(upSourceList[0])];\n }\n\n return {\n sourceList: sourceList,\n upstreamSignList: upstreamSignList\n };\n };\n\n SourceManager.prototype._isDirty = function () {\n if (this._dirty) {\n return true;\n } // All sourceList is from the some upstream.\n\n\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n for (var i = 0; i < upSourceMgrList.length; i++) {\n var upSrcMgr = upSourceMgrList[i];\n\n if ( // Consider the case that there is ancestor diry, call it recursively.\n // The performance is probably not an issue because usually the chain is not long.\n upSrcMgr._isDirty() || this._upstreamSignList[i] !== upSrcMgr._getVersionSign()) {\n return true;\n }\n }\n };\n /**\r\n * @param sourceIndex By default 0, means \"main source\".\r\n * In most cases there is only one source.\r\n */\n\n\n SourceManager.prototype.getSource = function (sourceIndex) {\n sourceIndex = sourceIndex || 0;\n var source = this._sourceList[sourceIndex];\n\n if (!source) {\n // Series may share source instance with dataset.\n var upSourceMgrList = this._getUpstreamSourceManagers();\n\n return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);\n }\n\n return source;\n };\n /**\r\n *\r\n * Get a data store which can be shared across series.\r\n * Only available for series.\r\n *\r\n * @param seriesDimRequest Dimensions that are generated in series.\r\n * Should have been sorted by `storeDimIndex` asc.\r\n */\n\n\n SourceManager.prototype.getSharedDataStore = function (seriesDimRequest) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isSeries(this._sourceHost), 'Can only call getDataStore on series source manager.');\n }\n\n var schema = seriesDimRequest.makeStoreSchema();\n return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);\n };\n\n SourceManager.prototype._innerGetDataStore = function (storeDims, seriesSource, sourceReadKey) {\n // TODO Can use other sourceIndex?\n var sourceIndex = 0;\n var storeList = this._storeList;\n var cachedStoreMap = storeList[sourceIndex];\n\n if (!cachedStoreMap) {\n cachedStoreMap = storeList[sourceIndex] = {};\n }\n\n var cachedStore = cachedStoreMap[sourceReadKey];\n\n if (!cachedStore) {\n var upSourceMgr = this._getUpstreamSourceManagers()[0];\n\n if (isSeries(this._sourceHost) && upSourceMgr) {\n cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);\n } else {\n cachedStore = new DataStore(); // Always create store from source of series.\n\n cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);\n }\n\n cachedStoreMap[sourceReadKey] = cachedStore;\n }\n\n return cachedStore;\n };\n /**\r\n * PENDING: Is it fast enough?\r\n * If no upstream, return empty array.\r\n */\n\n\n SourceManager.prototype._getUpstreamSourceManagers = function () {\n // Always get the relationship from the raw option.\n // Do not cache the link of the dependency graph, so that\n // there is no need to update them when change happens.\n var sourceHost = this._sourceHost;\n\n if (isSeries(sourceHost)) {\n var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);\n return !datasetModel ? [] : [datasetModel.getSourceManager()];\n } else {\n return map(queryDatasetUpstreamDatasetModels(sourceHost), function (datasetModel) {\n return datasetModel.getSourceManager();\n });\n }\n };\n\n SourceManager.prototype._getSourceMetaRawOption = function () {\n var sourceHost = this._sourceHost;\n var seriesLayoutBy;\n var sourceHeader;\n var dimensions;\n\n if (isSeries(sourceHost)) {\n seriesLayoutBy = sourceHost.get('seriesLayoutBy', true);\n sourceHeader = sourceHost.get('sourceHeader', true);\n dimensions = sourceHost.get('dimensions', true);\n } // See [REQUIREMENT_MEMO], `non-root-dataset` do not support them.\n else if (!this._getUpstreamSourceManagers().length) {\n var model = sourceHost;\n seriesLayoutBy = model.get('seriesLayoutBy', true);\n sourceHeader = model.get('sourceHeader', true);\n dimensions = model.get('dimensions', true);\n }\n\n return {\n seriesLayoutBy: seriesLayoutBy,\n sourceHeader: sourceHeader,\n dimensions: dimensions\n };\n };\n\n return SourceManager;\n}();\n\nexport { SourceManager }; // Call this method after `super.init` and `super.mergeOption` to\n// disable the transform merge, but do not disable transform clone from rawOption.\n\nexport function disableTransformOptionMerge(datasetModel) {\n var transformOption = datasetModel.option.transform;\n transformOption && setAsPrimitive(datasetModel.option.transform);\n}\n\nfunction isSeries(sourceHost) {\n // Avoid circular dependency with Series.ts\n return sourceHost.mainType === 'series';\n}\n\nfunction doThrow(errMsg) {\n throw new Error(errMsg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getTooltipMarker, encodeHTML, makeValueReadable, convertToColorString } from '../../util/format.js';\nimport { isString, each, hasOwn, isArray, map, assert, extend } from 'zrender/lib/core/util.js';\nimport { SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nimport { getRandomIdBase } from '../../util/number.js';\nvar TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1'; // TODO: more textStyle option\n\nfunction getTooltipTextStyle(textStyle, renderMode) {\n var nameFontColor = textStyle.color || '#6e7079';\n var nameFontSize = textStyle.fontSize || 12;\n var nameFontWeight = textStyle.fontWeight || '400';\n var valueFontColor = textStyle.color || '#464646';\n var valueFontSize = textStyle.fontSize || 14;\n var valueFontWeight = textStyle.fontWeight || '900';\n\n if (renderMode === 'html') {\n // `textStyle` is probably from user input, should be encoded to reduce security risk.\n return {\n // eslint-disable-next-line max-len\n nameStyle: \"font-size:\" + encodeHTML(nameFontSize + '') + \"px;color:\" + encodeHTML(nameFontColor) + \";font-weight:\" + encodeHTML(nameFontWeight + ''),\n // eslint-disable-next-line max-len\n valueStyle: \"font-size:\" + encodeHTML(valueFontSize + '') + \"px;color:\" + encodeHTML(valueFontColor) + \";font-weight:\" + encodeHTML(valueFontWeight + '')\n };\n } else {\n return {\n nameStyle: {\n fontSize: nameFontSize,\n fill: nameFontColor,\n fontWeight: nameFontWeight\n },\n valueStyle: {\n fontSize: valueFontSize,\n fill: valueFontColor,\n fontWeight: valueFontWeight\n }\n };\n }\n} // See `TooltipMarkupLayoutIntent['innerGapLevel']`.\n// (value from UI design)\n\n\nvar HTML_GAPS = [0, 10, 20, 30];\nvar RICH_TEXT_GAPS = ['', '\\n', '\\n\\n', '\\n\\n\\n']; // eslint-disable-next-line max-len\n\nexport function createTooltipMarkup(type, option) {\n option.type = type;\n return option;\n}\n\nfunction isSectionFragment(frag) {\n return frag.type === 'section';\n}\n\nfunction getBuilder(frag) {\n return isSectionFragment(frag) ? buildSection : buildNameValue;\n}\n\nfunction getBlockGapLevel(frag) {\n if (isSectionFragment(frag)) {\n var gapLevel_1 = 0;\n var subBlockLen = frag.blocks.length;\n var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader;\n each(frag.blocks, function (subBlock) {\n var subGapLevel = getBlockGapLevel(subBlock); // If the some of the sub-blocks have some gaps (like 10px) inside, this block\n // should use a larger gap (like 20px) to distinguish those sub-blocks.\n\n if (subGapLevel >= gapLevel_1) {\n gapLevel_1 = subGapLevel + +(hasInnerGap_1 && ( // 0 always can not be readable gap level.\n !subGapLevel // If no header, always keep the sub gap level. Otherwise\n // look weird in case `multipleSeries`.\n || isSectionFragment(subBlock) && !subBlock.noHeader));\n }\n });\n return gapLevel_1;\n }\n\n return 0;\n}\n\nfunction buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var noHeader = fragment.noHeader;\n var gaps = getGap(getBlockGapLevel(fragment));\n var subMarkupTextList = [];\n var subBlocks = fragment.blocks || [];\n assert(!subBlocks || isArray(subBlocks));\n subBlocks = subBlocks || [];\n var orderMode = ctx.orderMode;\n\n if (fragment.sortBlocks && orderMode) {\n subBlocks = subBlocks.slice();\n var orderMap = {\n valueAsc: 'asc',\n valueDesc: 'desc'\n };\n\n if (hasOwn(orderMap, orderMode)) {\n var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);\n subBlocks.sort(function (a, b) {\n return comparator_1.evaluate(a.sortParam, b.sortParam);\n });\n } // FIXME 'seriesDesc' necessary?\n else if (orderMode === 'seriesDesc') {\n subBlocks.reverse();\n }\n }\n\n each(subBlocks, function (subBlock, idx) {\n var valueFormatter = fragment.valueFormatter;\n var subMarkupText = getBuilder(subBlock)( // Inherit valueFormatter\n valueFormatter ? extend(extend({}, ctx), {\n valueFormatter: valueFormatter\n }) : ctx, subBlock, idx > 0 ? gaps.html : 0, toolTipTextStyle);\n subMarkupText != null && subMarkupTextList.push(subMarkupText);\n });\n var subMarkupText = ctx.renderMode === 'richText' ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(subMarkupTextList.join(''), noHeader ? topMarginForOuterGap : gaps.html);\n\n if (noHeader) {\n return subMarkupText;\n }\n\n var displayableHeader = makeValueReadable(fragment.header, 'ordinal', ctx.useUTC);\n var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;\n\n if (ctx.renderMode === 'richText') {\n return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;\n } else {\n return wrapBlockHTML(\"
\" + encodeHTML(displayableHeader) + '
' + subMarkupText, topMarginForOuterGap);\n }\n}\n\nfunction buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {\n var renderMode = ctx.renderMode;\n var noName = fragment.noName;\n var noValue = fragment.noValue;\n var noMarker = !fragment.markerType;\n var name = fragment.name;\n var useUTC = ctx.useUTC;\n\n var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function (value) {\n value = isArray(value) ? value : [value];\n return map(value, function (val, idx) {\n return makeValueReadable(val, isArray(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);\n });\n };\n\n if (noName && noValue) {\n return;\n }\n\n var markerStr = noMarker ? '' : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || '#333', renderMode);\n var readableName = noName ? '' : makeValueReadable(name, 'ordinal', useUTC);\n var valueTypeOption = fragment.valueType;\n var readableValueList = noValue ? [] : valueFormatter(fragment.value);\n var valueAlignRight = !noMarker || !noName; // It little weird if only value next to marker but far from marker.\n\n var valueCloseToMarker = !noMarker && noName;\n\n var _a = getTooltipTextStyle(toolTipTextStyle, renderMode),\n nameStyle = _a.nameStyle,\n valueStyle = _a.valueStyle;\n\n return renderMode === 'richText' ? (noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameRichText(ctx, readableName, nameStyle)) // Value has commas inside, so use ' ' as delimiter for multiple values.\n + (noValue ? '' : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML((noMarker ? '' : markerStr) + (noName ? '' : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? '' : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);\n}\n/**\r\n * @return markupText. null/undefined means no content.\r\n */\n\n\nexport function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {\n if (!fragment) {\n return;\n }\n\n var builder = getBuilder(fragment);\n var ctx = {\n useUTC: useUTC,\n renderMode: renderMode,\n orderMode: orderMode,\n markupStyleCreator: markupStyleCreator,\n valueFormatter: fragment.valueFormatter\n };\n return builder(ctx, fragment, 0, toolTipTextStyle);\n}\n\nfunction getGap(gapLevel) {\n return {\n html: HTML_GAPS[gapLevel],\n richText: RICH_TEXT_GAPS[gapLevel]\n };\n}\n\nfunction wrapBlockHTML(encodedContent, topGap) {\n var clearfix = '
';\n var marginCSS = \"margin: \" + topGap + \"px 0 0\";\n return \"
\" + encodedContent + clearfix + '
';\n}\n\nfunction wrapInlineNameHTML(name, leftHasMarker, style) {\n var marginCss = leftHasMarker ? 'margin-left:2px' : '';\n return \"\" + encodeHTML(name) + '';\n}\n\nfunction wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {\n // Do not too close to marker, considering there are multiple values separated by spaces.\n var paddingStr = valueCloseToMarker ? '10px' : '20px';\n var alignCSS = alignRight ? \"float:right;margin-left:\" + paddingStr : '';\n valueList = isArray(valueList) ? valueList : [valueList];\n return \"\" // Value has commas inside, so use ' ' as delimiter for multiple values.\n + map(valueList, function (value) {\n return encodeHTML(value);\n }).join('  ') + '';\n}\n\nfunction wrapInlineNameRichText(ctx, name, style) {\n return ctx.markupStyleCreator.wrapRichTextStyle(name, style);\n}\n\nfunction wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) {\n var styles = [style];\n var paddingLeft = valueCloseToMarker ? 10 : 20;\n alignRight && styles.push({\n padding: [0, 0, 0, paddingLeft],\n align: 'right'\n }); // Value has commas inside, so use ' ' as delimiter for multiple values.\n\n return ctx.markupStyleCreator.wrapRichTextStyle(isArray(values) ? values.join(' ') : values, styles);\n}\n\nexport function retrieveVisualColorForTooltipMarker(series, dataIndex) {\n var style = series.getData().getItemVisual(dataIndex, 'style');\n var color = style[series.visualDrawType];\n return convertToColorString(color);\n}\nexport function getPaddingFromTooltipModel(model, renderMode) {\n var padding = model.get('padding');\n return padding != null ? padding // We give slightly different to look pretty.\n : renderMode === 'richText' ? [8, 10] : 10;\n}\n/**\r\n * The major feature is generate styles for `renderMode: 'richText'`.\r\n * But it also serves `renderMode: 'html'` to provide\r\n * \"renderMode-independent\" API.\r\n */\n\nvar TooltipMarkupStyleCreator =\n/** @class */\nfunction () {\n function TooltipMarkupStyleCreator() {\n this.richTextStyles = {}; // Notice that \"generate a style name\" usually happens repeatedly when mouse is moving and\n // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator\n // rather than static shared by all creators (which will cause it increase to fast).\n\n this._nextStyleNameId = getRandomIdBase();\n }\n\n TooltipMarkupStyleCreator.prototype._generateStyleName = function () {\n return '__EC_aUTo_' + this._nextStyleNameId++;\n };\n\n TooltipMarkupStyleCreator.prototype.makeTooltipMarker = function (markerType, colorStr, renderMode) {\n var markerId = renderMode === 'richText' ? this._generateStyleName() : null;\n var marker = getTooltipMarker({\n color: colorStr,\n type: markerType,\n renderMode: renderMode,\n markerId: markerId\n });\n\n if (isString(marker)) {\n return marker;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(markerId);\n }\n\n this.richTextStyles[markerId] = marker.style;\n return marker.content;\n }\n };\n /**\r\n * @usage\r\n * ```ts\r\n * const styledText = markupStyleCreator.wrapRichTextStyle([\r\n * // The styles will be auto merged.\r\n * {\r\n * fontSize: 12,\r\n * color: 'blue'\r\n * },\r\n * {\r\n * padding: 20\r\n * }\r\n * ]);\r\n * ```\r\n */\n\n\n TooltipMarkupStyleCreator.prototype.wrapRichTextStyle = function (text, styles) {\n var finalStl = {};\n\n if (isArray(styles)) {\n each(styles, function (stl) {\n return extend(finalStl, stl);\n });\n } else {\n extend(finalStl, styles);\n }\n\n var styleName = this._generateStyleName();\n\n this.richTextStyles[styleName] = finalStl;\n return \"{\" + styleName + \"|\" + text + \"}\";\n };\n\n return TooltipMarkupStyleCreator;\n}();\n\nexport { TooltipMarkupStyleCreator };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { trim, isArray, each, reduce } from 'zrender/lib/core/util.js';\nimport { retrieveVisualColorForTooltipMarker, createTooltipMarkup } from './tooltipMarkup.js';\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isNameSpecified } from '../../util/model.js';\nexport function defaultSeriesFormatTooltip(opt) {\n var series = opt.series;\n var dataIndex = opt.dataIndex;\n var multipleSeries = opt.multipleSeries;\n var data = series.getData();\n var tooltipDims = data.mapDimensionsAll('defaultedTooltip');\n var tooltipDimLen = tooltipDims.length;\n var value = series.getRawValue(dataIndex);\n var isValueArr = isArray(value);\n var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex); // Complicated rule for pretty tooltip.\n\n var inlineValue;\n var inlineValueType;\n var subBlocks;\n var sortParam;\n\n if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {\n var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);\n inlineValue = formatArrResult.inlineValues;\n inlineValueType = formatArrResult.inlineValueTypes;\n subBlocks = formatArrResult.blocks; // Only support tooltip sort by the first inline value. It's enough in most cases.\n\n sortParam = formatArrResult.inlineValues[0];\n } else if (tooltipDimLen) {\n var dimInfo = data.getDimensionInfo(tooltipDims[0]);\n sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);\n inlineValueType = dimInfo.type;\n } else {\n sortParam = inlineValue = isValueArr ? value[0] : value;\n } // Do not show generated series name. It might not be readable.\n\n\n var seriesNameSpecified = isNameSpecified(series);\n var seriesName = seriesNameSpecified && series.name || '';\n var itemName = data.getName(dataIndex);\n var inlineName = multipleSeries ? seriesName : itemName;\n return createTooltipMarkup('section', {\n header: seriesName,\n // When series name is not specified, do not show a header line with only '-'.\n // This case always happens in tooltip.trigger: 'item'.\n noHeader: multipleSeries || !seriesNameSpecified,\n sortParam: sortParam,\n blocks: [createTooltipMarkup('nameValue', {\n markerType: 'item',\n markerColor: markerColor,\n // Do not mix display seriesName and itemName in one tooltip,\n // which might confuses users.\n name: inlineName,\n // name dimension might be auto assigned, where the name might\n // be not readable. So we check trim here.\n noName: !trim(inlineName),\n value: inlineValue,\n valueType: inlineValueType\n })].concat(subBlocks || [])\n });\n}\n\nfunction formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {\n // check: category-no-encode-has-axis-data in dataset.html\n var data = series.getData();\n var isValueMultipleLine = reduce(value, function (isValueMultipleLine, val, idx) {\n var dimItem = data.getDimensionInfo(idx);\n return isValueMultipleLine = isValueMultipleLine || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;\n }, false);\n var inlineValues = [];\n var inlineValueTypes = [];\n var blocks = [];\n tooltipDims.length ? each(tooltipDims, function (dim) {\n setEachItem(retrieveRawValue(data, dataIndex, dim), dim);\n }) // By default, all dims is used on tooltip.\n : each(value, setEachItem);\n\n function setEachItem(val, dim) {\n var dimInfo = data.getDimensionInfo(dim); // If `dimInfo.tooltip` is not set, show tooltip.\n\n if (!dimInfo || dimInfo.otherDims.tooltip === false) {\n return;\n }\n\n if (isValueMultipleLine) {\n blocks.push(createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: colorStr,\n name: dimInfo.displayName,\n value: val,\n valueType: dimInfo.type\n }));\n } else {\n inlineValues.push(val);\n inlineValueTypes.push(dimInfo.type);\n }\n }\n\n return {\n inlineValues: inlineValues,\n inlineValueTypes: inlineValueTypes,\n blocks: blocks\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport * as modelUtil from '../util/model.js';\nimport ComponentModel from './Component.js';\nimport { PaletteMixin } from './mixin/palette.js';\nimport { DataFormatMixin } from '../model/mixin/dataFormat.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport { createTask } from '../core/task.js';\nimport { mountExtend } from '../util/clazz.js';\nimport { SourceManager } from '../data/helper/sourceManager.js';\nimport { defaultSeriesFormatTooltip } from '../component/tooltip/seriesFormatTooltip.js';\nvar inner = modelUtil.makeInner();\n\nfunction getSelectionKey(data, dataIndex) {\n return data.getName(dataIndex) || data.getId(dataIndex);\n}\n\nexport var SERIES_UNIVERSAL_TRANSITION_PROP = '__universalTransitionEnabled';\n\nvar SeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SeriesModel, _super);\n\n function SeriesModel() {\n // [Caution]: Because this class or desecendants can be used as `XXX.extend(subProto)`,\n // the class members must not be initialized in constructor or declaration place.\n // Otherwise there is bad case:\n // class A {xxx = 1;}\n // enableClassExtend(A);\n // class B extends A {}\n // var C = B.extend({xxx: 5});\n // var c = new C();\n // console.log(c.xxx); // expect 5 but always 1.\n var _this = _super !== null && _super.apply(this, arguments) || this; // ---------------------------------------\n // Props about data selection\n // ---------------------------------------\n\n\n _this._selectedDataIndicesMap = {};\n return _this;\n }\n\n SeriesModel.prototype.init = function (option, parentModel, ecModel) {\n this.seriesIndex = this.componentIndex;\n this.dataTask = createTask({\n count: dataTaskCount,\n reset: dataTaskReset\n });\n this.dataTask.context = {\n model: this\n };\n this.mergeDefaultAndTheme(option, ecModel);\n var sourceManager = inner(this).sourceManager = new SourceManager(this);\n sourceManager.prepareSource();\n var data = this.getInitialData(option, ecModel);\n wrapData(data, this);\n this.dataTask.context.data = data;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(data, 'getInitialData returned invalid data.');\n }\n\n inner(this).dataBeforeProcessed = data; // If we reverse the order (make data firstly, and then make\n // dataBeforeProcessed by cloneShallow), cloneShallow will\n // cause data.graph.data !== data when using\n // module:echarts/data/Graph or module:echarts/data/Tree.\n // See module:echarts/data/helper/linkSeriesData\n // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model\n // init or merge stage, because the data can be restored. So we do not `restoreData`\n // and `setData` here, which forbids calling `seriesModel.getData()` in this stage.\n // Call `seriesModel.getRawData()` instead.\n // this.restoreData();\n\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n /**\r\n * Util for merge default and theme to option\r\n */\n\n\n SeriesModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {}; // Backward compat: using subType on theme.\n // But if name duplicate between series subType\n // (for example: parallel) add component mainType,\n // add suffix 'Series'.\n\n var themeSubType = this.subType;\n\n if (ComponentModel.hasClass(themeSubType)) {\n themeSubType += 'Series';\n }\n\n zrUtil.merge(option, ecModel.getTheme().get(this.subType));\n zrUtil.merge(option, this.getDefaultOption()); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n this.fillDataTextStyle(option.data);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n SeriesModel.prototype.mergeOption = function (newSeriesOption, ecModel) {\n // this.settingTask.dirty();\n newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);\n this.fillDataTextStyle(newSeriesOption.data);\n var layoutMode = fetchLayoutMode(this);\n\n if (layoutMode) {\n mergeLayoutParam(this.option, newSeriesOption, layoutMode);\n }\n\n var sourceManager = inner(this).sourceManager;\n sourceManager.dirty();\n sourceManager.prepareSource();\n var data = this.getInitialData(newSeriesOption, ecModel);\n wrapData(data, this);\n this.dataTask.dirty();\n this.dataTask.context.data = data;\n inner(this).dataBeforeProcessed = data;\n autoSeriesName(this);\n\n this._initSelectedMapFromData(data);\n };\n\n SeriesModel.prototype.fillDataTextStyle = function (data) {\n // Default data label emphasis `show`\n // FIXME Tree structure data ?\n // FIXME Performance ?\n if (data && !zrUtil.isTypedArray(data)) {\n var props = ['show'];\n\n for (var i = 0; i < data.length; i++) {\n if (data[i] && data[i].label) {\n modelUtil.defaultEmphasis(data[i], 'label', props);\n }\n }\n }\n };\n /**\r\n * Init a data structure from data related option in series\r\n * Must be overridden.\r\n */\n\n\n SeriesModel.prototype.getInitialData = function (option, ecModel) {\n return;\n };\n /**\r\n * Append data to list\r\n */\n\n\n SeriesModel.prototype.appendData = function (params) {\n // FIXME ???\n // (1) If data from dataset, forbidden append.\n // (2) support append data of dataset.\n var data = this.getRawData();\n data.appendData(params.data);\n };\n /**\r\n * Consider some method like `filter`, `map` need make new data,\r\n * We should make sure that `seriesModel.getData()` get correct\r\n * data in the stream procedure. So we fetch data from upstream\r\n * each time `task.perform` called.\r\n */\n\n\n SeriesModel.prototype.getData = function (dataType) {\n var task = getCurrentTask(this);\n\n if (task) {\n var data = task.context.data;\n return dataType == null ? data : data.getLinkedData(dataType);\n } else {\n // When series is not alive (that may happen when click toolbox\n // restore or setOption with not merge mode), series data may\n // be still need to judge animation or something when graphic\n // elements want to know whether fade out.\n return inner(this).data;\n }\n };\n\n SeriesModel.prototype.getAllData = function () {\n var mainData = this.getData();\n return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{\n data: mainData\n }];\n };\n\n SeriesModel.prototype.setData = function (data) {\n var task = getCurrentTask(this);\n\n if (task) {\n var context = task.context; // Consider case: filter, data sample.\n // FIXME:TS never used, so comment it\n // if (context.data !== data && task.modifyOutputEnd) {\n // task.setOutputEnd(data.count());\n // }\n\n context.outputData = data; // Caution: setData should update context.data,\n // Because getData may be called multiply in a\n // single stage and expect to get the data just\n // set. (For example, AxisProxy, x y both call\n // getData and setDate sequentially).\n // So the context.data should be fetched from\n // upstream each time when a stage starts to be\n // performed.\n\n if (task !== this.dataTask) {\n context.data = data;\n }\n }\n\n inner(this).data = data;\n };\n\n SeriesModel.prototype.getEncode = function () {\n var encode = this.get('encode', true);\n\n if (encode) {\n return zrUtil.createHashMap(encode);\n }\n };\n\n SeriesModel.prototype.getSourceManager = function () {\n return inner(this).sourceManager;\n };\n\n SeriesModel.prototype.getSource = function () {\n return this.getSourceManager().getSource();\n };\n /**\r\n * Get data before processed\r\n */\n\n\n SeriesModel.prototype.getRawData = function () {\n return inner(this).dataBeforeProcessed;\n };\n\n SeriesModel.prototype.getColorBy = function () {\n var colorBy = this.get('colorBy');\n return colorBy || 'series';\n };\n\n SeriesModel.prototype.isColorBySeries = function () {\n return this.getColorBy() === 'series';\n };\n /**\r\n * Get base axis if has coordinate system and has axis.\r\n * By default use coordSys.getBaseAxis();\r\n * Can be overridden for some chart.\r\n * @return {type} description\r\n */\n\n\n SeriesModel.prototype.getBaseAxis = function () {\n var coordSys = this.coordinateSystem; // @ts-ignore\n\n return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();\n };\n /**\r\n * Default tooltip formatter\r\n *\r\n * @param dataIndex\r\n * @param multipleSeries\r\n * @param dataType\r\n * @param renderMode valid values: 'html'(by default) and 'richText'.\r\n * 'html' is used for rendering tooltip in extra DOM form, and the result\r\n * string is used as DOM HTML content.\r\n * 'richText' is used for rendering tooltip in rich text form, for those where\r\n * DOM operation is not supported.\r\n * @return formatted tooltip with `html` and `markers`\r\n * Notice: The override method can also return string\r\n */\n\n\n SeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n return defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n };\n\n SeriesModel.prototype.isAnimationEnabled = function () {\n var ecModel = this.ecModel; // Disable animation if using echarts in node but not give ssr flag.\n // In ssr mode, renderToString will generate svg with css animation.\n\n if (env.node && !(ecModel && ecModel.ssr)) {\n return false;\n }\n\n var animationEnabled = this.getShallow('animation');\n\n if (animationEnabled) {\n if (this.getData().count() > this.getShallow('animationThreshold')) {\n animationEnabled = false;\n }\n }\n\n return !!animationEnabled;\n };\n\n SeriesModel.prototype.restoreData = function () {\n this.dataTask.dirty();\n };\n\n SeriesModel.prototype.getColorFromPalette = function (name, scope, requestColorNum) {\n var ecModel = this.ecModel; // PENDING\n\n var color = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);\n\n if (!color) {\n color = ecModel.getColorFromPalette(name, scope, requestColorNum);\n }\n\n return color;\n };\n /**\r\n * Use `data.mapDimensionsAll(coordDim)` instead.\r\n * @deprecated\r\n */\n\n\n SeriesModel.prototype.coordDimToDataDim = function (coordDim) {\n return this.getRawData().mapDimensionsAll(coordDim);\n };\n /**\r\n * Get progressive rendering count each step\r\n */\n\n\n SeriesModel.prototype.getProgressive = function () {\n return this.get('progressive');\n };\n /**\r\n * Get progressive rendering count each step\r\n */\n\n\n SeriesModel.prototype.getProgressiveThreshold = function () {\n return this.get('progressiveThreshold');\n }; // PENGING If selectedMode is null ?\n\n\n SeriesModel.prototype.select = function (innerDataIndices, dataType) {\n this._innerSelect(this.getData(dataType), innerDataIndices);\n };\n\n SeriesModel.prototype.unselect = function (innerDataIndices, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return;\n }\n\n var selectedMode = this.option.selectedMode;\n var data = this.getData(dataType);\n\n if (selectedMode === 'series' || selectedMap === 'all') {\n this.option.selectedMap = {};\n this._selectedDataIndicesMap = {};\n return;\n }\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n var dataIndex = innerDataIndices[i];\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = false;\n this._selectedDataIndicesMap[nameOrId] = -1;\n }\n };\n\n SeriesModel.prototype.toggleSelect = function (innerDataIndices, dataType) {\n var tmpArr = [];\n\n for (var i = 0; i < innerDataIndices.length; i++) {\n tmpArr[0] = innerDataIndices[i];\n this.isSelected(innerDataIndices[i], dataType) ? this.unselect(tmpArr, dataType) : this.select(tmpArr, dataType);\n }\n };\n\n SeriesModel.prototype.getSelectedDataIndices = function () {\n if (this.option.selectedMap === 'all') {\n return [].slice.call(this.getData().getIndices());\n }\n\n var selectedDataIndicesMap = this._selectedDataIndicesMap;\n var nameOrIds = zrUtil.keys(selectedDataIndicesMap);\n var dataIndices = [];\n\n for (var i = 0; i < nameOrIds.length; i++) {\n var dataIndex = selectedDataIndicesMap[nameOrIds[i]];\n\n if (dataIndex >= 0) {\n dataIndices.push(dataIndex);\n }\n }\n\n return dataIndices;\n };\n\n SeriesModel.prototype.isSelected = function (dataIndex, dataType) {\n var selectedMap = this.option.selectedMap;\n\n if (!selectedMap) {\n return false;\n }\n\n var data = this.getData(dataType);\n return (selectedMap === 'all' || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(['select', 'disabled']);\n };\n\n SeriesModel.prototype.isUniversalTransitionEnabled = function () {\n if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n return true;\n }\n\n var universalTransitionOpt = this.option.universalTransition; // Quick reject\n\n if (!universalTransitionOpt) {\n return false;\n }\n\n if (universalTransitionOpt === true) {\n return true;\n } // Can be simply 'universalTransition: true'\n\n\n return universalTransitionOpt && universalTransitionOpt.enabled;\n };\n\n SeriesModel.prototype._innerSelect = function (data, innerDataIndices) {\n var _a, _b;\n\n var option = this.option;\n var selectedMode = option.selectedMode;\n var len = innerDataIndices.length;\n\n if (!selectedMode || !len) {\n return;\n }\n\n if (selectedMode === 'series') {\n option.selectedMap = 'all';\n } else if (selectedMode === 'multiple') {\n if (!zrUtil.isObject(option.selectedMap)) {\n option.selectedMap = {};\n }\n\n var selectedMap = option.selectedMap;\n\n for (var i = 0; i < len; i++) {\n var dataIndex = innerDataIndices[i]; // TODO different types of data share same object.\n\n var nameOrId = getSelectionKey(data, dataIndex);\n selectedMap[nameOrId] = true;\n this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);\n }\n } else if (selectedMode === 'single' || selectedMode === true) {\n var lastDataIndex = innerDataIndices[len - 1];\n var nameOrId = getSelectionKey(data, lastDataIndex);\n option.selectedMap = (_a = {}, _a[nameOrId] = true, _a);\n this._selectedDataIndicesMap = (_b = {}, _b[nameOrId] = data.getRawIndex(lastDataIndex), _b);\n }\n };\n\n SeriesModel.prototype._initSelectedMapFromData = function (data) {\n // Ignore select info in data if selectedMap exists.\n // NOTE It's only for legacy usage. edge data is not supported.\n if (this.option.selectedMap) {\n return;\n }\n\n var dataIndices = [];\n\n if (data.hasItemOption) {\n data.each(function (idx) {\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem.selected) {\n dataIndices.push(idx);\n }\n });\n }\n\n if (dataIndices.length > 0) {\n this._innerSelect(data, dataIndices);\n }\n }; // /**\n // * @see {module:echarts/stream/Scheduler}\n // */\n // abstract pipeTask: null\n\n\n SeriesModel.registerClass = function (clz) {\n return ComponentModel.registerClass(clz);\n };\n\n SeriesModel.protoInitialize = function () {\n var proto = SeriesModel.prototype;\n proto.type = 'series.__base__';\n proto.seriesIndex = 0;\n proto.ignoreStyleOnData = false;\n proto.hasSymbolVisual = false;\n proto.defaultSymbol = 'circle'; // Make sure the values can be accessed!\n\n proto.visualStyleAccessPath = 'itemStyle';\n proto.visualDrawType = 'fill';\n }();\n\n return SeriesModel;\n}(ComponentModel);\n\nzrUtil.mixin(SeriesModel, DataFormatMixin);\nzrUtil.mixin(SeriesModel, PaletteMixin);\nmountExtend(SeriesModel, ComponentModel);\n/**\r\n * MUST be called after `prepareSource` called\r\n * Here we need to make auto series, especially for auto legend. But we\r\n * do not modify series.name in option to avoid side effects.\r\n */\n\nfunction autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}\n\nfunction getSeriesAutoName(seriesModel) {\n var data = seriesModel.getRawData();\n var dataDims = data.mapDimensionsAll('seriesName');\n var nameArr = [];\n zrUtil.each(dataDims, function (dataDim) {\n var dimInfo = data.getDimensionInfo(dataDim);\n dimInfo.displayName && nameArr.push(dimInfo.displayName);\n });\n return nameArr.join(' ');\n}\n\nfunction dataTaskCount(context) {\n return context.model.getRawData().count();\n}\n\nfunction dataTaskReset(context) {\n var seriesModel = context.model;\n seriesModel.setData(seriesModel.getRawData().cloneShallow());\n return dataTaskProgress;\n}\n\nfunction dataTaskProgress(param, context) {\n // Avoid repeat cloneShallow when data just created in reset.\n if (context.outputData && param.end > context.outputData.count()) {\n context.model.getRawData().cloneShallow(context.outputData);\n }\n} // TODO refactor\n\n\nfunction wrapData(data, seriesModel) {\n zrUtil.each(zrUtil.concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(onDataChange, seriesModel));\n });\n}\n\nfunction onDataChange(seriesModel, newList) {\n var task = getCurrentTask(seriesModel);\n\n if (task) {\n // Consider case: filter, selectRange\n task.setOutputEnd((newList || this).count());\n }\n\n return newList;\n}\n\nfunction getCurrentTask(seriesModel) {\n var scheduler = (seriesModel.ecModel || {}).scheduler;\n var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);\n\n if (pipeline) {\n // When pipline finished, the currrentTask keep the last\n // task (renderTask).\n var task = pipeline.currentTask;\n\n if (task) {\n var agentStubMap = task.agentStubMap;\n\n if (agentStubMap) {\n task = agentStubMap.get(seriesModel.uid);\n }\n }\n\n return task;\n }\n}\n\nexport default SeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\n\nvar ComponentView =\n/** @class */\nfunction () {\n function ComponentView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewComponent');\n }\n\n ComponentView.prototype.init = function (ecModel, api) {};\n\n ComponentView.prototype.render = function (model, ecModel, api, payload) {};\n\n ComponentView.prototype.dispose = function (ecModel, api) {};\n\n ComponentView.prototype.updateView = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateLayout = function (model, ecModel, api, payload) {// Do nothing;\n };\n\n ComponentView.prototype.updateVisual = function (model, ecModel, api, payload) {// Do nothing;\n };\n /**\r\n * Hook for toggle blur target series.\r\n * Can be used in marker for blur or leave blur the markers\r\n */\n\n\n ComponentView.prototype.toggleBlurSeries = function (seriesModels, isBlur, ecModel) {// Do nothing;\n };\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\n\n\n ComponentView.prototype.eachRendered = function (cb) {\n var group = this.group;\n\n if (group) {\n group.traverse(cb);\n }\n };\n\n return ComponentView;\n}();\n\n;\nclazzUtil.enableClassExtend(ComponentView);\nclazzUtil.enableClassManagement(ComponentView);\nexport default ComponentView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\n/**\r\n * @return {string} If large mode changed, return string 'reset';\r\n */\n\nexport default function createRenderPlanner() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = !!fields.large;\n var originalProgressive = !!fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = !!(pipelineContext && pipelineContext.large);\n var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);\n return !!(originalLarge !== large || originalProgressive !== progressive) && 'reset';\n };\n}","import PathProxy from '../core/PathProxy.js';\nimport { applyTransform as v2ApplyTransform } from '../core/vector.js';\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\nexport default function transformPath(path, m) {\n if (!m) {\n return;\n }\n var data = path.data;\n var len = path.len();\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 for (i = 0, j = 0; i < len;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n case L:\n nPoint = 1;\n break;\n case C:\n nPoint = 3;\n break;\n case Q:\n nPoint = 2;\n break;\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);\n data[i] *= sx;\n data[i++] += x;\n data[i] *= sy;\n data[i++] += y;\n data[i++] *= sx;\n data[i++] *= sy;\n data[i++] += angle;\n data[i++] += angle;\n i += 2;\n j = i;\n break;\n case R:\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 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 for (k = 0; k < nPoint; k++) {\n var p_1 = points[k];\n p_1[0] = data[i++];\n p_1[1] = data[i++];\n v2ApplyTransform(p_1, p_1, m);\n data[j++] = p_1[0];\n data[j++] = p_1[1];\n }\n }\n path.increaseVersion();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../graphic/Path.js';\nimport PathProxy from '../core/PathProxy.js';\nimport transformPath from './transformPath.js';\nimport { extend } from '../core/util.js';\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n;\nfunction vRatio(u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n}\n;\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)\n * 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\n + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0\n + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n var f = (fa === fs ? -1 : 1)\n * mathSqrt((((rx * rx) * (ry * ry))\n - ((rx * rx) * (yp * yp))\n - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)\n + (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\n + mathCos(psi) * cxp\n - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0\n + mathSin(psi) * cxp\n + 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 if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (dTheta < 0) {\n var n = Math.round(dTheta / PI * 1e6) / 1e6;\n dTheta = PI * 2 + (n % 2) * PI;\n }\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction createPathProxyFromString(data) {\n var path = new PathProxy();\n if (!data) {\n return path;\n }\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var CMD = PathProxy.CMD;\n var cmdList = data.match(commandReg);\n if (!cmdList) {\n return path;\n }\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd = void 0;\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n var off = 0;\n while (off < pLen) {\n var ctlPtx = void 0;\n var ctlPty = void 0;\n var rx = void 0;\n var ry = void 0;\n var psi = void 0;\n var fa = void 0;\n var fs = void 0;\n var x1 = cpx;\n var y1 = cpy;\n var len = void 0;\n var pathData = void 0;\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 case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\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 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 case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\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 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 case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\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 case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\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 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 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 case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n len = path.len();\n pathData = path.data;\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\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 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 if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd);\n cpx = subpathX;\n cpy = subpathY;\n }\n prevCmd = cmd;\n }\n path.toStatic();\n return path;\n}\nvar SVGPath = (function (_super) {\n __extends(SVGPath, _super);\n function SVGPath() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SVGPath.prototype.applyTransform = function (m) { };\n return SVGPath;\n}(Path));\nfunction isPathProxy(path) {\n return path.setData != null;\n}\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n var innerOpts = extend({}, opts);\n innerOpts.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.setData(pathProxy.data);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n else {\n var ctx = path;\n pathProxy.rebuildPath(ctx, 1);\n }\n };\n innerOpts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirtyShape();\n };\n return innerOpts;\n}\nexport function createFromString(str, opts) {\n return new SVGPath(createPathOptions(str, opts));\n}\nexport function extendFromString(str, defaultOpts) {\n var innerOpts = createPathOptions(str, defaultOpts);\n var Sub = (function (_super) {\n __extends(Sub, _super);\n function Sub(opts) {\n var _this = _super.call(this, opts) || this;\n _this.applyTransform = innerOpts.applyTransform;\n _this.buildPath = innerOpts.buildPath;\n return _this;\n }\n return Sub;\n }(SVGPath));\n return Sub;\n}\nexport function mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n pathList.push(pathEl.getUpdatedPathProxy(true));\n }\n var pathBundle = new Path(opts);\n pathBundle.createPathProxy();\n pathBundle.buildPath = function (path) {\n if (isPathProxy(path)) {\n path.appendPath(pathList);\n var ctx = path.getContext();\n if (ctx) {\n path.rebuildPath(ctx, 1);\n }\n }\n };\n return pathBundle;\n}\nexport function clonePath(sourcePath, opts) {\n opts = opts || {};\n var path = new Path();\n if (sourcePath.shape) {\n path.setShape(sourcePath.shape);\n }\n path.setStyle(sourcePath.style);\n if (opts.bakeTransform) {\n transformPath(path.path, sourcePath.getComputedTransform());\n }\n else {\n if (opts.toLocal) {\n path.setLocalTransform(sourcePath.getComputedTransform());\n }\n else {\n path.copyTransform(sourcePath);\n }\n }\n path.buildPath = sourcePath.buildPath;\n path.applyTransform = path.applyTransform;\n path.z = sourcePath.z;\n path.z2 = sourcePath.z2;\n path.zlevel = sourcePath.zlevel;\n return path;\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar CircleShape = (function () {\n function CircleShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n }\n return CircleShape;\n}());\nexport { CircleShape };\nvar Circle = (function (_super) {\n __extends(Circle, _super);\n function Circle(opts) {\n return _super.call(this, opts) || this;\n }\n Circle.prototype.getDefaultShape = function () {\n return new CircleShape();\n };\n Circle.prototype.buildPath = function (ctx, shape) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);\n };\n return Circle;\n}(Path));\n;\nCircle.prototype.type = 'circle';\nexport default Circle;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar EllipseShape = (function () {\n function EllipseShape() {\n this.cx = 0;\n this.cy = 0;\n this.rx = 0;\n this.ry = 0;\n }\n return EllipseShape;\n}());\nexport { EllipseShape };\nvar Ellipse = (function (_super) {\n __extends(Ellipse, _super);\n function Ellipse(opts) {\n return _super.call(this, opts) || this;\n }\n Ellipse.prototype.getDefaultShape = function () {\n return new EllipseShape();\n };\n Ellipse.prototype.buildPath = function (ctx, shape) {\n var k = 0.5522848;\n var x = shape.cx;\n var y = shape.cy;\n var a = shape.rx;\n var b = shape.ry;\n var ox = a * k;\n var oy = b * k;\n ctx.moveTo(x - a, y);\n ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);\n ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);\n ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);\n ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);\n ctx.closePath();\n };\n return Ellipse;\n}(Path));\nEllipse.prototype.type = 'ellipse';\nexport default Ellipse;\n","import { isArray } from '../../core/util.js';\nvar PI = Math.PI;\nvar PI2 = PI * 2;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar mathACos = Math.acos;\nvar mathATan2 = Math.atan2;\nvar mathAbs = Math.abs;\nvar mathSqrt = Math.sqrt;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar e = 1e-4;\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var dx10 = x1 - x0;\n var dy10 = y1 - y0;\n var dx32 = x3 - x2;\n var dy32 = y3 - y2;\n var t = dy32 * dx10 - dx32 * dy10;\n if (t * t < e) {\n return;\n }\n t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;\n return [x0 + t * dx10, y0 + t * dy10];\n}\nfunction computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {\n var x01 = x0 - x1;\n var y01 = y0 - y1;\n var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);\n var ox = lo * y01;\n var oy = -lo * x01;\n var x11 = x0 + ox;\n var y11 = y0 + oy;\n var x10 = x1 + ox;\n var y10 = y1 + oy;\n var x00 = (x11 + x10) / 2;\n var y00 = (y11 + y10) / 2;\n var dx = x10 - x11;\n var dy = y10 - y11;\n var d2 = dx * dx + dy * dy;\n var r = radius - cr;\n var s = x11 * y10 - x10 * y11;\n var d = (dy < 0 ? -1 : 1) * mathSqrt(mathMax(0, r * r * d2 - s * s));\n var cx0 = (s * dy - dx * d) / d2;\n var cy0 = (-s * dx - dy * d) / d2;\n var cx1 = (s * dy + dx * d) / d2;\n var cy1 = (-s * dx + dy * d) / d2;\n var dx0 = cx0 - x00;\n var dy0 = cy0 - y00;\n var dx1 = cx1 - x00;\n var dy1 = cy1 - y00;\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1;\n cy0 = cy1;\n }\n return {\n cx: cx0,\n cy: cy0,\n x0: -ox,\n y0: -oy,\n x1: cx0 * (radius / r - 1),\n y1: cy0 * (radius / r - 1)\n };\n}\nfunction normalizeCornerRadius(cr) {\n var arr;\n if (isArray(cr)) {\n var len = cr.length;\n if (!len) {\n return cr;\n }\n if (len === 1) {\n arr = [cr[0], cr[0], 0, 0];\n }\n else if (len === 2) {\n arr = [cr[0], cr[0], cr[1], cr[1]];\n }\n else if (len === 3) {\n arr = cr.concat(cr[2]);\n }\n else {\n arr = cr;\n }\n }\n else {\n arr = [cr, cr, cr, cr];\n }\n return arr;\n}\nexport function buildPath(ctx, shape) {\n var _a;\n var radius = mathMax(shape.r, 0);\n var innerRadius = mathMax(shape.r0 || 0, 0);\n var hasRadius = radius > 0;\n var hasInnerRadius = innerRadius > 0;\n if (!hasRadius && !hasInnerRadius) {\n return;\n }\n if (!hasRadius) {\n radius = innerRadius;\n innerRadius = 0;\n }\n if (innerRadius > radius) {\n var tmp = radius;\n radius = innerRadius;\n innerRadius = tmp;\n }\n var startAngle = shape.startAngle, endAngle = shape.endAngle;\n if (isNaN(startAngle) || isNaN(endAngle)) {\n return;\n }\n var cx = shape.cx, cy = shape.cy;\n var clockwise = !!shape.clockwise;\n var arc = mathAbs(endAngle - startAngle);\n var mod = arc > PI2 && arc % PI2;\n mod > e && (arc = mod);\n if (!(radius > e)) {\n ctx.moveTo(cx, cy);\n }\n else if (arc > PI2 - e) {\n ctx.moveTo(cx + radius * mathCos(startAngle), cy + radius * mathSin(startAngle));\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n if (innerRadius > e) {\n ctx.moveTo(cx + innerRadius * mathCos(endAngle), cy + innerRadius * mathSin(endAngle));\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n else {\n var icrStart = void 0;\n var icrEnd = void 0;\n var ocrStart = void 0;\n var ocrEnd = void 0;\n var ocrs = void 0;\n var ocre = void 0;\n var icrs = void 0;\n var icre = void 0;\n var ocrMax = void 0;\n var icrMax = void 0;\n var limitedOcrMax = void 0;\n var limitedIcrMax = void 0;\n var xre = void 0;\n var yre = void 0;\n var xirs = void 0;\n var yirs = void 0;\n var xrs = radius * mathCos(startAngle);\n var yrs = radius * mathSin(startAngle);\n var xire = innerRadius * mathCos(endAngle);\n var yire = innerRadius * mathSin(endAngle);\n var hasArc = arc > e;\n if (hasArc) {\n var cornerRadius = shape.cornerRadius;\n if (cornerRadius) {\n _a = normalizeCornerRadius(cornerRadius), icrStart = _a[0], icrEnd = _a[1], ocrStart = _a[2], ocrEnd = _a[3];\n }\n var halfRd = mathAbs(radius - innerRadius) / 2;\n ocrs = mathMin(halfRd, ocrStart);\n ocre = mathMin(halfRd, ocrEnd);\n icrs = mathMin(halfRd, icrStart);\n icre = mathMin(halfRd, icrEnd);\n limitedOcrMax = ocrMax = mathMax(ocrs, ocre);\n limitedIcrMax = icrMax = mathMax(icrs, icre);\n if (ocrMax > e || icrMax > e) {\n xre = radius * mathCos(endAngle);\n yre = radius * mathSin(endAngle);\n xirs = innerRadius * mathCos(startAngle);\n yirs = innerRadius * mathSin(startAngle);\n if (arc < PI) {\n var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);\n if (it_1) {\n var x0 = xrs - it_1[0];\n var y0 = yrs - it_1[1];\n var x1 = xre - it_1[0];\n var y1 = yre - it_1[1];\n var a = 1 / mathSin(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);\n var b = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);\n limitedOcrMax = mathMin(ocrMax, (radius - b) / (a + 1));\n limitedIcrMax = mathMin(icrMax, (innerRadius - b) / (a - 1));\n }\n }\n }\n }\n if (!hasArc) {\n ctx.moveTo(cx + xrs, cy + yrs);\n }\n else if (limitedOcrMax > e) {\n var crStart = mathMin(ocrStart, limitedOcrMax);\n var crEnd = mathMin(ocrEnd, limitedOcrMax);\n var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);\n var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);\n ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedOcrMax < ocrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);\n crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.moveTo(cx + xrs, cy + yrs);\n ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);\n }\n if (!(innerRadius > e) || !hasArc) {\n ctx.lineTo(cx + xire, cy + yire);\n }\n else if (limitedIcrMax > e) {\n var crStart = mathMin(icrStart, limitedIcrMax);\n var crEnd = mathMin(icrEnd, limitedIcrMax);\n var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);\n var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);\n ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);\n if (limitedIcrMax < icrMax && crStart === crEnd) {\n ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n else {\n crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);\n ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);\n crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);\n }\n }\n else {\n ctx.lineTo(cx + xire, cy + yire);\n ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);\n }\n }\n ctx.closePath();\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as roundSectorHelper from '../helper/roundSector.js';\nvar SectorShape = (function () {\n function SectorShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n this.cornerRadius = 0;\n }\n return SectorShape;\n}());\nexport { SectorShape };\nvar Sector = (function (_super) {\n __extends(Sector, _super);\n function Sector(opts) {\n return _super.call(this, opts) || this;\n }\n Sector.prototype.getDefaultShape = function () {\n return new SectorShape();\n };\n Sector.prototype.buildPath = function (ctx, shape) {\n roundSectorHelper.buildPath(ctx, shape);\n };\n Sector.prototype.isZeroArea = function () {\n return this.shape.startAngle === this.shape.endAngle\n || this.shape.r === this.shape.r0;\n };\n return Sector;\n}(Path));\nSector.prototype.type = 'sector';\nexport default Sector;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar RingShape = (function () {\n function RingShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.r0 = 0;\n }\n return RingShape;\n}());\nexport { RingShape };\nvar Ring = (function (_super) {\n __extends(Ring, _super);\n function Ring(opts) {\n return _super.call(this, opts) || this;\n }\n Ring.prototype.getDefaultShape = function () {\n return new RingShape();\n };\n Ring.prototype.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 return Ring;\n}(Path));\nRing.prototype.type = 'ring';\nexport default Ring;\n","import { min as v2Min, max as v2Max, scale as v2Scale, distance as v2Distance, add as v2Add, clone as v2Clone, sub as v2Sub } from '../../core/vector.js';\nexport default function smoothBezier(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 if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\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 v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n }\n else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n }\n else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n v2Sub(v, nextPoint, prevPoint);\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\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 cps.push(cp0);\n cps.push(cp1);\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n","import smoothBezier from './smoothBezier.js';\nexport function buildPath(ctx, shape, closePath) {\n var smooth = shape.smooth;\n var points = shape.points;\n if (points && points.length >= 2) {\n if (smooth) {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\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 }\n else {\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n closePath && ctx.closePath();\n }\n}\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolygonShape = (function () {\n function PolygonShape() {\n this.points = null;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolygonShape;\n}());\nexport { PolygonShape };\nvar Polygon = (function (_super) {\n __extends(Polygon, _super);\n function Polygon(opts) {\n return _super.call(this, opts) || this;\n }\n Polygon.prototype.getDefaultShape = function () {\n return new PolygonShape();\n };\n Polygon.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n };\n return Polygon;\n}(Path));\n;\nPolygon.prototype.type = 'polygon';\nexport default Polygon;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as polyHelper from '../helper/poly.js';\nvar PolylineShape = (function () {\n function PolylineShape() {\n this.points = null;\n this.percent = 1;\n this.smooth = 0;\n this.smoothConstraint = null;\n }\n return PolylineShape;\n}());\nexport { PolylineShape };\nvar Polyline = (function (_super) {\n __extends(Polyline, _super);\n function Polyline(opts) {\n return _super.call(this, opts) || this;\n }\n Polyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Polyline.prototype.getDefaultShape = function () {\n return new PolylineShape();\n };\n Polyline.prototype.buildPath = function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n };\n return Polyline;\n}(Path));\nPolyline.prototype.type = 'polyline';\nexport default Polyline;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport { subPixelOptimizeLine } from '../helper/subPixelOptimize.js';\nvar subPixelOptimizeOutputShape = {};\nvar LineShape = (function () {\n function LineShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n return LineShape;\n}());\nexport { LineShape };\nvar Line = (function (_super) {\n __extends(Line, _super);\n function Line(opts) {\n return _super.call(this, opts) || this;\n }\n Line.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Line.prototype.getDefaultShape = function () {\n return new LineShape();\n };\n Line.prototype.buildPath = function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n if (this.subPixelOptimize) {\n var optimizedShape = subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = optimizedShape.x1;\n y1 = optimizedShape.y1;\n x2 = optimizedShape.x2;\n y2 = optimizedShape.y2;\n }\n else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n var percent = shape.percent;\n if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n ctx.lineTo(x2, y2);\n };\n Line.prototype.pointAt = function (p) {\n var shape = this.shape;\n return [\n shape.x1 * (1 - p) + shape.x2 * p,\n shape.y1 * (1 - p) + shape.y2 * p\n ];\n };\n return Line;\n}(Path));\nLine.prototype.type = 'line';\nexport default Line;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nimport * as vec2 from '../../core/vector.js';\nimport { quadraticSubdivide, cubicSubdivide, quadraticAt, cubicAt, quadraticDerivativeAt, cubicDerivativeAt } from '../../core/curve.js';\nvar out = [];\nvar BezierCurveShape = (function () {\n function BezierCurveShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.percent = 1;\n }\n return BezierCurveShape;\n}());\nexport { BezierCurveShape };\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n if (cpx2 != null || cpy2 != null) {\n return [\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),\n (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)\n ];\n }\n else {\n return [\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t),\n (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)\n ];\n }\n}\nvar BezierCurve = (function (_super) {\n __extends(BezierCurve, _super);\n function BezierCurve(opts) {\n return _super.call(this, opts) || this;\n }\n BezierCurve.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n BezierCurve.prototype.getDefaultShape = function () {\n return new BezierCurveShape();\n };\n BezierCurve.prototype.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 if (percent === 0) {\n return;\n }\n ctx.moveTo(x1, y1);\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 ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n }\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 ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n };\n BezierCurve.prototype.pointAt = function (t) {\n return someVectorAt(this.shape, t, false);\n };\n BezierCurve.prototype.tangentAt = function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n };\n return BezierCurve;\n}(Path));\n;\nBezierCurve.prototype.type = 'bezier-curve';\nexport default BezierCurve;\n","import { __extends } from \"tslib\";\nimport Path from '../Path.js';\nvar ArcShape = (function () {\n function ArcShape() {\n this.cx = 0;\n this.cy = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n return ArcShape;\n}());\nexport { ArcShape };\nvar Arc = (function (_super) {\n __extends(Arc, _super);\n function Arc(opts) {\n return _super.call(this, opts) || this;\n }\n Arc.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n Arc.prototype.getDefaultShape = function () {\n return new ArcShape();\n };\n Arc.prototype.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 return Arc;\n}(Path));\nArc.prototype.type = 'arc';\nexport default Arc;\n","import { __extends } from \"tslib\";\nimport Path from './Path.js';\nvar CompoundPath = (function (_super) {\n __extends(CompoundPath, _super);\n function CompoundPath() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'compound';\n return _this;\n }\n CompoundPath.prototype._updatePathDirty = function () {\n var paths = this.shape.paths;\n var dirtyPath = this.shapeChanged();\n for (var i = 0; i < paths.length; i++) {\n dirtyPath = dirtyPath || paths[i].shapeChanged();\n }\n if (dirtyPath) {\n this.dirtyShape();\n }\n };\n CompoundPath.prototype.beforeBrush = function () {\n this._updatePathDirty();\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale();\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n paths[i].path.setScale(scale[0], scale[1], paths[i].segmentIgnoreThreshold);\n }\n };\n CompoundPath.prototype.buildPath = function (ctx, shape) {\n var paths = shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n };\n CompoundPath.prototype.afterBrush = function () {\n var paths = this.shape.paths || [];\n for (var i = 0; i < paths.length; i++) {\n paths[i].pathUpdated();\n }\n };\n CompoundPath.prototype.getBoundingRect = function () {\n this._updatePathDirty.call(this);\n return Path.prototype.getBoundingRect.call(this);\n };\n return CompoundPath;\n}(Path));\nexport default CompoundPath;\n","var Gradient = (function () {\n function Gradient(colorStops) {\n this.colorStops = colorStops || [];\n }\n Gradient.prototype.addColorStop = function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n };\n return Gradient;\n}());\nexport default Gradient;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar LinearGradient = (function (_super) {\n __extends(LinearGradient, _super);\n function LinearGradient(x, y, x2, y2, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\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;\n _this.type = 'linear';\n _this.global = globalCoord || false;\n return _this;\n }\n return LinearGradient;\n}(Gradient));\nexport default LinearGradient;\n;\n","import { __extends } from \"tslib\";\nimport Gradient from './Gradient.js';\nvar RadialGradient = (function (_super) {\n __extends(RadialGradient, _super);\n function RadialGradient(x, y, r, colorStops, globalCoord) {\n var _this = _super.call(this, colorStops) || this;\n _this.x = x == null ? 0.5 : x;\n _this.y = y == null ? 0.5 : y;\n _this.r = r == null ? 0.5 : r;\n _this.type = 'radial';\n _this.global = globalCoord || false;\n return _this;\n }\n return RadialGradient;\n}(Gradient));\nexport default RadialGradient;\n","import Point from './Point.js';\nvar extent = [0, 0];\nvar extent2 = [0, 0];\nvar minTv = new Point();\nvar maxTv = new Point();\nvar OrientedBoundingRect = (function () {\n function OrientedBoundingRect(rect, transform) {\n this._corners = [];\n this._axes = [];\n this._origin = [0, 0];\n for (var i = 0; i < 4; i++) {\n this._corners[i] = new Point();\n }\n for (var i = 0; i < 2; i++) {\n this._axes[i] = new Point();\n }\n if (rect) {\n this.fromBoundingRect(rect, transform);\n }\n }\n OrientedBoundingRect.prototype.fromBoundingRect = function (rect, transform) {\n var corners = this._corners;\n var axes = this._axes;\n var x = rect.x;\n var y = rect.y;\n var x2 = x + rect.width;\n var y2 = y + rect.height;\n corners[0].set(x, y);\n corners[1].set(x2, y);\n corners[2].set(x2, y2);\n corners[3].set(x, y2);\n if (transform) {\n for (var i = 0; i < 4; i++) {\n corners[i].transform(transform);\n }\n }\n Point.sub(axes[0], corners[1], corners[0]);\n Point.sub(axes[1], corners[3], corners[0]);\n axes[0].normalize();\n axes[1].normalize();\n for (var i = 0; i < 2; i++) {\n this._origin[i] = axes[i].dot(corners[0]);\n }\n };\n OrientedBoundingRect.prototype.intersect = function (other, mtv) {\n var overlapped = true;\n var noMtv = !mtv;\n minTv.set(Infinity, Infinity);\n maxTv.set(0, 0);\n if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n }\n if (!noMtv) {\n Point.copy(mtv, overlapped ? minTv : maxTv);\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._intersectCheckOneSide = function (self, other, minTv, maxTv, noMtv, inverse) {\n var overlapped = true;\n for (var i = 0; i < 2; i++) {\n var axis = this._axes[i];\n this._getProjMinMaxOnAxis(i, self._corners, extent);\n this._getProjMinMaxOnAxis(i, other._corners, extent2);\n if (extent[1] < extent2[0] || extent[0] > extent2[1]) {\n overlapped = false;\n if (noMtv) {\n return overlapped;\n }\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) > maxTv.len()) {\n if (dist0 < dist1) {\n Point.scale(maxTv, axis, -dist0 * inverse);\n }\n else {\n Point.scale(maxTv, axis, dist1 * inverse);\n }\n }\n }\n else if (minTv) {\n var dist0 = Math.abs(extent2[0] - extent[1]);\n var dist1 = Math.abs(extent[0] - extent2[1]);\n if (Math.min(dist0, dist1) < minTv.len()) {\n if (dist0 < dist1) {\n Point.scale(minTv, axis, dist0 * inverse);\n }\n else {\n Point.scale(minTv, axis, -dist1 * inverse);\n }\n }\n }\n }\n return overlapped;\n };\n OrientedBoundingRect.prototype._getProjMinMaxOnAxis = function (dim, corners, out) {\n var axis = this._axes[dim];\n var origin = this._origin;\n var proj = corners[0].dot(axis) + origin[dim];\n var min = proj;\n var max = proj;\n for (var i = 1; i < corners.length; i++) {\n var proj_1 = corners[i].dot(axis) + origin[dim];\n min = Math.min(proj_1, min);\n max = Math.max(proj_1, max);\n }\n out[0] = min;\n out[1] = max;\n };\n return OrientedBoundingRect;\n}());\nexport default OrientedBoundingRect;\n","import { __extends } from \"tslib\";\nimport Displayble from './Displayable.js';\nimport BoundingRect from '../core/BoundingRect.js';\nvar m = [];\nvar IncrementalDisplayable = (function (_super) {\n __extends(IncrementalDisplayable, _super);\n function IncrementalDisplayable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.notClear = true;\n _this.incremental = true;\n _this._displayables = [];\n _this._temporaryDisplayables = [];\n _this._cursor = 0;\n return _this;\n }\n IncrementalDisplayable.prototype.traverse = function (cb, context) {\n cb.call(context, this);\n };\n IncrementalDisplayable.prototype.useStyle = function () {\n this.style = {};\n };\n IncrementalDisplayable.prototype.getCursor = function () {\n return this._cursor;\n };\n IncrementalDisplayable.prototype.innerAfterBrush = function () {\n this._cursor = this._displayables.length;\n };\n IncrementalDisplayable.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.markRedraw();\n this.notClear = false;\n };\n IncrementalDisplayable.prototype.clearTemporalDisplayables = function () {\n this._temporaryDisplayables = [];\n };\n IncrementalDisplayable.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n }\n else {\n this._displayables.push(displayable);\n }\n this.markRedraw();\n };\n IncrementalDisplayable.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n };\n IncrementalDisplayable.prototype.getDisplayables = function () {\n return this._displayables;\n };\n IncrementalDisplayable.prototype.getTemporalDisplayables = function () {\n return this._temporaryDisplayables;\n };\n IncrementalDisplayable.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n };\n IncrementalDisplayable.prototype.update = function () {\n this.updateTransform();\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n };\n IncrementalDisplayable.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n rect.union(childRect);\n }\n this._rect = rect;\n }\n return this._rect;\n };\n IncrementalDisplayable.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\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 if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n return false;\n };\n return IncrementalDisplayable;\n}(Displayble));\nexport default 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*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as pathTool from 'zrender/lib/tool/path.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport Circle from 'zrender/lib/graphic/shape/Circle.js';\nimport Ellipse from 'zrender/lib/graphic/shape/Ellipse.js';\nimport Sector from 'zrender/lib/graphic/shape/Sector.js';\nimport Ring from 'zrender/lib/graphic/shape/Ring.js';\nimport Polygon from 'zrender/lib/graphic/shape/Polygon.js';\nimport Polyline from 'zrender/lib/graphic/shape/Polyline.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport Line from 'zrender/lib/graphic/shape/Line.js';\nimport BezierCurve from 'zrender/lib/graphic/shape/BezierCurve.js';\nimport Arc from 'zrender/lib/graphic/shape/Arc.js';\nimport CompoundPath from 'zrender/lib/graphic/CompoundPath.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport RadialGradient from 'zrender/lib/graphic/RadialGradient.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport OrientedBoundingRect from 'zrender/lib/core/OrientedBoundingRect.js';\nimport Point from 'zrender/lib/core/Point.js';\nimport IncrementalDisplayable from 'zrender/lib/graphic/IncrementalDisplayable.js';\nimport * as subPixelOptimizeUtil from 'zrender/lib/graphic/helper/subPixelOptimize.js';\nimport { extend, isArrayLike, map, defaults, isString, keys, each, hasOwn, isArray } from 'zrender/lib/core/util.js';\nimport { getECData } from './innerStore.js';\nimport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved } from '../animation/basicTransition.js';\n/**\r\n * @deprecated export for compatitable reason\r\n */\n\nexport { updateProps, initProps, removeElement, removeElementWithFadeOut, isElementRemoved };\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar _customShapeMap = {};\n/**\r\n * Extend shape with parameters\r\n */\n\nexport function extendShape(opts) {\n return Path.extend(opts);\n}\nvar extendPathFromString = pathTool.extendFromString;\n/**\r\n * Extend path\r\n */\n\nexport function extendPath(pathData, opts) {\n return extendPathFromString(pathData, opts);\n}\n/**\r\n * Register a user defined shape.\r\n * The shape class can be fetched by `getShapeClass`\r\n * This method will overwrite the registered shapes, including\r\n * the registered built-in shapes, if using the same `name`.\r\n * The shape can be used in `custom series` and\r\n * `graphic component` by declaring `{type: name}`.\r\n *\r\n * @param name\r\n * @param ShapeClass Can be generated by `extendShape`.\r\n */\n\nexport function registerShape(name, ShapeClass) {\n _customShapeMap[name] = ShapeClass;\n}\n/**\r\n * Find shape class registered by `registerShape`. Usually used in\r\n * fetching user defined shape.\r\n *\r\n * [Caution]:\r\n * (1) This method **MUST NOT be used inside echarts !!!**, unless it is prepared\r\n * to use user registered shapes.\r\n * Because the built-in shape (see `getBuiltInShape`) will be registered by\r\n * `registerShape` by default. That enables users to get both built-in\r\n * shapes as well as the shapes belonging to themsleves. But users can overwrite\r\n * the built-in shapes by using names like 'circle', 'rect' via calling\r\n * `registerShape`. So the echarts inner featrues should not fetch shapes from here\r\n * in case that it is overwritten by users, except that some features, like\r\n * `custom series`, `graphic component`, do it deliberately.\r\n *\r\n * (2) In the features like `custom series`, `graphic component`, the user input\r\n * `{tpye: 'xxx'}` does not only specify shapes but also specify other graphic\r\n * elements like `'group'`, `'text'`, `'image'` or event `'path'`. Those names\r\n * are reserved names, that is, if some user registers a shape named `'image'`,\r\n * the shape will not be used. If we intending to add some more reserved names\r\n * in feature, that might bring break changes (disable some existing user shape\r\n * names). But that case probably rarely happens. So we don't make more mechanism\r\n * to resolve this issue here.\r\n *\r\n * @param name\r\n * @return The shape class. If not found, return nothing.\r\n */\n\nexport function getShapeClass(name) {\n if (_customShapeMap.hasOwnProperty(name)) {\n return _customShapeMap[name];\n }\n}\n/**\r\n * Create a path element from path data string\r\n * @param pathData\r\n * @param opts\r\n * @param rect\r\n * @param layout 'center' or 'cover' default to be cover\r\n */\n\nexport function 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/**\r\n * Create a image element from image url\r\n * @param imageUrl image url\r\n * @param opts options\r\n * @param rect constrain rect\r\n * @param layout 'center' or 'cover'. Default to be 'cover'\r\n */\n\nexport function makeImage(imageUrl, rect, layout) {\n var zrImg = new ZRImage({\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 zrImg.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return zrImg;\n}\n/**\r\n * Get position of centered element in bounding box.\r\n *\r\n * @param rect element local bounding box\r\n * @param boundingRect constraint bounding box\r\n * @return element position containing x, y, width, and height\r\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\nexport var mergePath = pathTool.mergePath;\n/**\r\n * Resize a path to fit the rect\r\n * @param path\r\n * @param rect\r\n */\n\nexport function 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/**\r\n * Sub pixel optimize line for canvas\r\n */\n\nexport function subPixelOptimizeLine(shape, lineWidth) {\n subPixelOptimizeUtil.subPixelOptimizeLine(shape, shape, {\n lineWidth: lineWidth\n });\n return shape;\n}\n/**\r\n * Sub pixel optimize rect for canvas\r\n */\n\nexport function subPixelOptimizeRect(param) {\n subPixelOptimizeUtil.subPixelOptimizeRect(param.shape, param.shape, param.style);\n return param;\n}\n/**\r\n * Sub pixel optimize for canvas\r\n *\r\n * @param position Coordinate, such as x, y\r\n * @param lineWidth Should be nonnegative integer.\r\n * @param positiveOrNegative Default false (negative).\r\n * @return Optimized position.\r\n */\n\nexport var subPixelOptimize = subPixelOptimizeUtil.subPixelOptimize;\n/**\r\n * Get transform matrix of target (param target),\r\n * in coordinate of its ancestor (param ancestor)\r\n *\r\n * @param target\r\n * @param [ancestor]\r\n */\n\nexport function 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/**\r\n * Apply transform to an vertex.\r\n * @param target [x, y]\r\n * @param transform Can be:\r\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\r\n * @param invert Whether use invert matrix.\r\n * @return [x, y]\r\n */\n\nexport function applyTransform(target, transform, invert) {\n if (transform && !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/**\r\n * @param direction 'left' 'right' 'top' 'bottom'\r\n * @param transform Transform matrix: like [1, 0, 0, 1, 0, 0]\r\n * @param invert Whether use invert matrix.\r\n * @return Transformed direction. 'left' 'right' 'top' 'bottom'\r\n */\n\nexport function 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\nfunction isNotGroup(el) {\n return !el.isGroup;\n}\n\nfunction isPath(el) {\n return el.shape != null;\n}\n/**\r\n * Apply group transition animation from g1 to g2.\r\n * If no animatableModel, no animation.\r\n */\n\n\nexport function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n\n if (isPath(el)) {\n obj.shape = extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && 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, getECData(el).dataIndex);\n }\n }\n });\n}\nexport function clipPointsByRect(points, rect) {\n // FIXME: This way might be incorrect when graphic clipped by a corner\n // and when element has a border.\n return 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/**\r\n * Return a new clipped rect. If rect size are negative, return undefined.\r\n */\n\nexport function 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}\nexport function createIcon(iconStr, // Support 'image://' or 'path://' or direct svg path.\nopt, rect) {\n var innerOpts = extend({\n rectHover: true\n }, opt);\n var style = innerOpts.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), defaults(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace('path://', ''), innerOpts, rect, 'center');\n }\n}\n/**\r\n * Return `true` if the given line (line `a`) and the given polygon\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\n\nexport function linePolygonIntersect(a1x, a1y, a2x, a2y, points) {\n for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) {\n var p = points[i];\n\n if (lineLineIntersect(a1x, a1y, a2x, a2y, p[0], p[1], p2[0], p2[1])) {\n return true;\n }\n\n p2 = p;\n }\n}\n/**\r\n * Return `true` if the given two lines (line `a` and line `b`)\r\n * are intersect.\r\n * Note that we do not count colinear as intersect here because no\r\n * requirement for that. We could do that if required in future.\r\n */\n\nexport function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n // let `vec_m` to be `vec_a2 - vec_a1` and `vec_n` to be `vec_b2 - vec_b1`.\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y; // `vec_m` and `vec_n` are parallel iff\n // existing `k` such that `vec_m = k · vec_n`, equivalent to `vec_m X vec_n = 0`.\n\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n\n if (nearZero(nmCrossProduct)) {\n return false;\n } // `vec_m` and `vec_n` are intersect iff\n // existing `p` and `q` in [0, 1] such that `vec_a1 + p * vec_m = vec_b1 + q * vec_n`,\n // such that `q = ((vec_a1 - vec_b1) X vec_m) / (vec_n X vec_m)`\n // and `p = ((vec_a1 - vec_b1) X vec_n) / (vec_n X vec_m)`.\n\n\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var q = crossProduct2d(b1a1x, b1a1y, mx, my) / nmCrossProduct;\n\n if (q < 0 || q > 1) {\n return false;\n }\n\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n\n if (p < 0 || p > 1) {\n return false;\n }\n\n return true;\n}\n/**\r\n * Cross product of 2-dimension vector.\r\n */\n\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\n\nfunction nearZero(val) {\n return val <= 1e-6 && val >= -1e-6;\n}\n\nexport function setTooltipConfig(opt) {\n var itemTooltipOption = opt.itemTooltipOption;\n var componentModel = opt.componentModel;\n var itemName = opt.itemName;\n var itemTooltipOptionObj = isString(itemTooltipOption) ? {\n formatter: itemTooltipOption\n } : itemTooltipOption;\n var mainType = componentModel.mainType;\n var componentIndex = componentModel.componentIndex;\n var formatterParams = {\n componentType: mainType,\n name: itemName,\n $vars: ['name']\n };\n formatterParams[mainType + 'Index'] = componentIndex;\n var formatterParamsExtra = opt.formatterParamsExtra;\n\n if (formatterParamsExtra) {\n each(keys(formatterParamsExtra), function (key) {\n if (!hasOwn(formatterParams, key)) {\n formatterParams[key] = formatterParamsExtra[key];\n formatterParams.$vars.push(key);\n }\n });\n }\n\n var ecData = getECData(opt.el);\n ecData.componentMainType = mainType;\n ecData.componentIndex = componentIndex;\n ecData.tooltipConfig = {\n name: itemName,\n option: defaults({\n content: itemName,\n formatterParams: formatterParams\n }, itemTooltipOptionObj)\n };\n}\n\nfunction traverseElement(el, cb) {\n var stopped; // TODO\n // Polyfill for fixing zrender group traverse don't visit it's root issue.\n\n if (el.isGroup) {\n stopped = cb(el);\n }\n\n if (!stopped) {\n el.traverse(cb);\n }\n}\n\nexport function traverseElements(els, cb) {\n if (els) {\n if (isArray(els)) {\n for (var i = 0; i < els.length; i++) {\n traverseElement(els[i], cb);\n }\n } else {\n traverseElement(els, cb);\n }\n }\n} // Register built-in shapes. These shapes might be overwritten\n// by users, although we do not recommend that.\n\nregisterShape('circle', Circle);\nregisterShape('ellipse', Ellipse);\nregisterShape('sector', Sector);\nregisterShape('ring', Ring);\nregisterShape('polygon', Polygon);\nregisterShape('polyline', Polyline);\nregisterShape('rect', Rect);\nregisterShape('line', Line);\nregisterShape('bezierCurve', BezierCurve);\nregisterShape('arc', Arc);\nexport { Group, ZRImage as Image, ZRText as Text, Circle, Ellipse, Sector, Ring, Polygon, Polyline, Rect, Line, BezierCurve, Arc, IncrementalDisplayable, CompoundPath, LinearGradient, RadialGradient, BoundingRect, OrientedBoundingRect, Point, Path };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport * as componentUtil from '../util/component.js';\nimport * as clazzUtil from '../util/clazz.js';\nimport * as modelUtil from '../util/model.js';\nimport { enterEmphasis, leaveEmphasis, getHighlightDigit, isHighDownDispatcher } from '../util/states.js';\nimport { createTask } from '../core/task.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { traverseElements } from '../util/graphic.js';\nimport { error } from '../util/log.js';\nvar inner = modelUtil.makeInner();\nvar renderPlanner = createRenderPlanner();\n\nvar ChartView =\n/** @class */\nfunction () {\n function ChartView() {\n this.group = new Group();\n this.uid = componentUtil.getUID('viewChart');\n this.renderTask = createTask({\n plan: renderTaskPlan,\n reset: renderTaskReset\n });\n this.renderTask.context = {\n view: this\n };\n }\n\n ChartView.prototype.init = function (ecModel, api) {};\n\n ChartView.prototype.render = function (seriesModel, ecModel, api, payload) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('render method must been implemented');\n }\n };\n /**\r\n * Highlight series or specified data item.\r\n */\n\n\n ChartView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n toggleHighlight(data, payload, 'emphasis');\n };\n /**\r\n * Downplay series or specified data item.\r\n */\n\n\n ChartView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData(payload && payload.dataType);\n\n if (!data) {\n if (process.env.NODE_ENV !== 'production') {\n error(\"Unknown dataType \" + payload.dataType);\n }\n\n return;\n }\n\n toggleHighlight(data, payload, 'normal');\n };\n /**\r\n * Remove self.\r\n */\n\n\n ChartView.prototype.remove = function (ecModel, api) {\n this.group.removeAll();\n };\n /**\r\n * Dispose self.\r\n */\n\n\n ChartView.prototype.dispose = function (ecModel, api) {};\n\n ChartView.prototype.updateView = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateLayout = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n }; // FIXME never used?\n\n\n ChartView.prototype.updateVisual = function (seriesModel, ecModel, api, payload) {\n this.render(seriesModel, ecModel, api, payload);\n };\n /**\r\n * Traverse the new rendered elements.\r\n *\r\n * It will traverse the new added element in progressive rendering.\r\n * And traverse all in normal rendering.\r\n */\n\n\n ChartView.prototype.eachRendered = function (cb) {\n traverseElements(this.group, cb);\n };\n\n ChartView.markUpdateMethod = function (payload, methodName) {\n inner(payload).updateMethod = methodName;\n };\n\n ChartView.protoInitialize = function () {\n var proto = ChartView.prototype;\n proto.type = 'chart';\n }();\n\n return ChartView;\n}();\n\n;\n/**\r\n * Set state of single element\r\n */\n\nfunction elSetState(el, state, highlightDigit) {\n if (el && isHighDownDispatcher(el)) {\n (state === 'emphasis' ? enterEmphasis : leaveEmphasis)(el, highlightDigit);\n }\n}\n\nfunction toggleHighlight(data, payload, state) {\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;\n\n if (dataIndex != null) {\n each(modelUtil.normalizeToArray(dataIndex), function (dataIdx) {\n elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);\n });\n } else {\n data.eachItemGraphicEl(function (el) {\n elSetState(el, state, highlightDigit);\n });\n }\n}\n\nclazzUtil.enableClassExtend(ChartView, ['dispose']);\nclazzUtil.enableClassManagement(ChartView);\n\nfunction renderTaskPlan(context) {\n return renderPlanner(context.model);\n}\n\nfunction renderTaskReset(context) {\n var seriesModel = context.model;\n var ecModel = context.ecModel;\n var api = context.api;\n var payload = context.payload; // FIXME: remove updateView updateVisual\n\n var progressiveRender = seriesModel.pipelineContext.progressiveRender;\n var view = context.view;\n var updateMethod = payload && inner(payload).updateMethod;\n var methodName = progressiveRender ? 'incrementalPrepareRender' : updateMethod && view[updateMethod] ? updateMethod // `appendData` is also supported when data amount\n // is less than progressive threshold.\n : 'render';\n\n if (methodName !== 'render') {\n view[methodName](seriesModel, ecModel, api, payload);\n }\n\n return progressMethodMap[methodName];\n}\n\nvar progressMethodMap = {\n incrementalPrepareRender: {\n progress: function (params, context) {\n context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);\n }\n },\n render: {\n // Put view.render in `progress` to support appendData. But in this case\n // view.render should not be called in reset, otherwise it will be called\n // twise. Use `forceFirstProgress` to make sure that view.render is called\n // in any cases.\n forceFirstProgress: true,\n progress: function (params, context) {\n context.view.render(context.model, context.ecModel, context.api, context.payload);\n }\n }\n};\nexport default ChartView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar ORIGIN_METHOD = '\\0__throttleOriginMethod';\nvar RATE = '\\0__throttleRate';\nvar THROTTLE_TYPE = '\\0__throttleType';\n;\n/**\r\n * @public\r\n * @param {(Function)} fn\r\n * @param {number} [delay=0] Unit: ms.\r\n * @param {boolean} [debounce=false]\r\n * true: If call interval less than `delay`, only the last call works.\r\n * false: If call interval less than `delay, call works on fixed rate.\r\n * @return {(Function)} throttled fn.\r\n */\n\nexport function throttle(fn, delay, debounce) {\n var currCall;\n var lastCall = 0;\n var lastExec = 0;\n var timer = null;\n var diff;\n var scope;\n var args;\n var debounceNextCall;\n delay = delay || 0;\n\n function exec() {\n lastExec = new Date().getTime();\n timer = null;\n fn.apply(scope, args || []);\n }\n\n var cb = function () {\n var cbArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n cbArgs[_i] = arguments[_i];\n }\n\n currCall = new Date().getTime();\n scope = this;\n args = cbArgs;\n var thisDelay = debounceNextCall || delay;\n var thisDebounce = debounceNextCall || debounce;\n debounceNextCall = null;\n diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;\n clearTimeout(timer); // Here we should make sure that: the `exec` SHOULD NOT be called later\n // than a new call of `cb`, that is, preserving the command order. Consider\n // calculating \"scale rate\" when roaming as an example. When a call of `cb`\n // happens, either the `exec` is called dierectly, or the call is delayed.\n // But the delayed call should never be later than next call of `cb`. Under\n // this assurance, we can simply update view state each time `dispatchAction`\n // triggered by user roaming, but not need to add extra code to avoid the\n // state being \"rolled-back\".\n\n if (thisDebounce) {\n timer = setTimeout(exec, thisDelay);\n } else {\n if (diff >= 0) {\n exec();\n } else {\n timer = setTimeout(exec, -diff);\n }\n }\n\n lastCall = currCall;\n };\n /**\r\n * Clear throttle.\r\n * @public\r\n */\n\n\n cb.clear = function () {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n };\n /**\r\n * Enable debounce once.\r\n */\n\n\n cb.debounceNextCall = function (debounceDelay) {\n debounceNextCall = debounceDelay;\n };\n\n return cb;\n}\n/**\r\n * Create throttle method or update throttle rate.\r\n *\r\n * @example\r\n * ComponentView.prototype.render = function () {\r\n * ...\r\n * throttle.createOrUpdate(\r\n * this,\r\n * '_dispatchAction',\r\n * this.model.get('throttle'),\r\n * 'fixRate'\r\n * );\r\n * };\r\n * ComponentView.prototype.remove = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n * ComponentView.prototype.dispose = function () {\r\n * throttle.clear(this, '_dispatchAction');\r\n * };\r\n *\r\n */\n\nexport function createOrUpdate(obj, fnAttr, rate, throttleType) {\n var fn = obj[fnAttr];\n\n if (!fn) {\n return;\n }\n\n var originFn = fn[ORIGIN_METHOD] || fn;\n var lastThrottleType = fn[THROTTLE_TYPE];\n var lastRate = fn[RATE];\n\n if (lastRate !== rate || lastThrottleType !== throttleType) {\n if (rate == null || !throttleType) {\n return obj[fnAttr] = originFn;\n }\n\n fn = obj[fnAttr] = throttle(originFn, rate, throttleType === 'debounce');\n fn[ORIGIN_METHOD] = originFn;\n fn[THROTTLE_TYPE] = throttleType;\n fn[RATE] = rate;\n }\n\n return fn;\n}\n/**\r\n * Clear throttle. Example see throttle.createOrUpdate.\r\n */\n\nexport function clear(obj, fnAttr) {\n var fn = obj[fnAttr];\n\n if (fn && fn[ORIGIN_METHOD]) {\n // Clear throttle\n fn.clear && fn.clear();\n obj[fnAttr] = fn[ORIGIN_METHOD];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, extend, createHashMap } from 'zrender/lib/core/util.js';\nimport makeStyleMapper from '../model/mixin/makeStyleMapper.js';\nimport { ITEM_STYLE_KEY_MAP } from '../model/mixin/itemStyle.js';\nimport { LINE_STYLE_KEY_MAP } from '../model/mixin/lineStyle.js';\nimport Model from '../model/Model.js';\nimport { makeInner } from '../util/model.js';\nvar inner = makeInner();\nvar defaultStyleMappers = {\n itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),\n lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)\n};\nvar defaultColorKey = {\n lineStyle: 'stroke',\n itemStyle: 'fill'\n};\n\nfunction getStyleMapper(seriesModel, stylePath) {\n var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];\n\n if (!styleMapper) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return defaultStyleMappers.itemStyle;\n }\n\n return styleMapper;\n}\n\nfunction getDefaultColorKey(seriesModel, stylePath) {\n // return defaultColorKey[stylePath] ||\n var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];\n\n if (!colorKey) {\n console.warn(\"Unknown style type '\" + stylePath + \"'.\");\n return 'fill';\n }\n\n return colorKey;\n}\n\nvar seriesStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var styleModel = seriesModel.getModel(stylePath);\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var globalStyle = getStyle(styleModel);\n var decalOption = styleModel.getShallow('decal');\n\n if (decalOption) {\n data.setVisual('decal', decalOption);\n decalOption.dirty = true;\n } // TODO\n\n\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n var color = globalStyle[colorKey]; // TODO style callback\n\n var colorCallback = isFunction(color) ? color : null;\n var hasAutoColor = globalStyle.fill === 'auto' || globalStyle.stroke === 'auto'; // Get from color palette by default.\n\n if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {\n // Note: If some series has color specified (e.g., by itemStyle.color), we DO NOT\n // make it effect palette. Because some scenarios users need to make some series\n // transparent or as background, which should better not effect the palette.\n var colorPalette = seriesModel.getColorFromPalette( // TODO series count changed.\n seriesModel.name, null, ecModel.getSeriesCount());\n\n if (!globalStyle[colorKey]) {\n globalStyle[colorKey] = colorPalette;\n data.setVisual('colorFromPalette', true);\n }\n\n globalStyle.fill = globalStyle.fill === 'auto' || isFunction(globalStyle.fill) ? colorPalette : globalStyle.fill;\n globalStyle.stroke = globalStyle.stroke === 'auto' || isFunction(globalStyle.stroke) ? colorPalette : globalStyle.stroke;\n }\n\n data.setVisual('style', globalStyle);\n data.setVisual('drawType', colorKey); // Only visible series has each data be visual encoded\n\n if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {\n data.setVisual('colorFromPalette', false);\n return {\n dataEach: function (data, idx) {\n var dataParams = seriesModel.getDataParams(idx);\n var itemStyle = extend({}, globalStyle);\n itemStyle[colorKey] = colorCallback(dataParams);\n data.setItemVisual(idx, 'style', itemStyle);\n }\n };\n }\n }\n};\nvar sharedModel = new Model();\nvar dataStyleTask = {\n createOnAllSeries: true,\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle'; // Set in itemStyle\n\n var getStyle = getStyleMapper(seriesModel, stylePath);\n var colorKey = data.getVisual('drawType');\n return {\n dataEach: data.hasItemOption ? function (data, idx) {\n // Not use getItemModel for performance considuration\n var rawItem = data.getRawDataItem(idx);\n\n if (rawItem && rawItem[stylePath]) {\n sharedModel.option = rawItem[stylePath];\n var style = getStyle(sharedModel);\n var existsStyle = data.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n if (sharedModel.option.decal) {\n data.setItemVisual(idx, 'decal', sharedModel.option.decal);\n sharedModel.option.decal.dirty = true;\n }\n\n if (colorKey in style) {\n data.setItemVisual(idx, 'colorFromPalette', false);\n }\n }\n } : null\n };\n }\n}; // Pick color from palette for the data which has not been set with color yet.\n// Note: do not support stream rendering. No such cases yet.\n\nvar dataColorPaletteTask = {\n performRawSeries: true,\n overallReset: function (ecModel) {\n // Each type of series uses one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var colorBy = seriesModel.getColorBy();\n\n if (seriesModel.isColorBySeries()) {\n return;\n }\n\n var key = seriesModel.type + '-' + colorBy;\n var colorScope = paletteScopeGroupByType.get(key);\n\n if (!colorScope) {\n colorScope = {};\n paletteScopeGroupByType.set(key, colorScope);\n }\n\n inner(seriesModel).scope = colorScope;\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n var colorScope = inner(seriesModel).scope;\n var stylePath = seriesModel.visualStyleAccessPath || 'itemStyle';\n var colorKey = getDefaultColorKey(seriesModel, stylePath);\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n }); // Iterate on data before filtered. To make sure color from palette can be\n // Consistent when toggling legend.\n\n dataAll.each(function (rawIdx) {\n var idx = idxMap[rawIdx];\n var fromPalette = data.getItemVisual(idx, 'colorFromPalette'); // Get color from palette for each data only when the color is inherited from series color, which is\n // also picked from color palette. So following situation is not in the case:\n // 1. series.itemStyle.color is set\n // 2. color is encoded by visualMap\n\n if (fromPalette) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n var name_1 = dataAll.getName(rawIdx) || rawIdx + '';\n var dataCount = dataAll.count();\n itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);\n }\n });\n });\n }\n};\nexport { seriesStyleTask, dataStyleTask, dataColorPaletteTask };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../util/graphic.js';\nvar PI = Math.PI;\n/**\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Object} [opts]\r\n * @param {string} [opts.text]\r\n * @param {string} [opts.color]\r\n * @param {string} [opts.textColor]\r\n * @return {module:zrender/Element}\r\n */\n\nexport default function defaultLoading(api, opts) {\n opts = opts || {};\n zrUtil.defaults(opts, {\n text: 'loading',\n textColor: '#000',\n fontSize: 12,\n fontWeight: 'normal',\n fontStyle: 'normal',\n fontFamily: 'sans-serif',\n maskColor: 'rgba(255, 255, 255, 0.8)',\n showSpinner: true,\n color: '#5470c6',\n spinnerRadius: 10,\n lineWidth: 5,\n zlevel: 0\n });\n var group = new graphic.Group();\n var mask = new graphic.Rect({\n style: {\n fill: opts.maskColor\n },\n zlevel: opts.zlevel,\n z: 10000\n });\n group.add(mask);\n var textContent = new graphic.Text({\n style: {\n text: opts.text,\n fill: opts.textColor,\n fontSize: opts.fontSize,\n fontWeight: opts.fontWeight,\n fontStyle: opts.fontStyle,\n fontFamily: opts.fontFamily\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n var labelRect = new graphic.Rect({\n style: {\n fill: 'none'\n },\n textContent: textContent,\n textConfig: {\n position: 'right',\n distance: 10\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n group.add(labelRect);\n var arc;\n\n if (opts.showSpinner) {\n arc = new graphic.Arc({\n shape: {\n startAngle: -PI / 2,\n endAngle: -PI / 2 + 0.1,\n r: opts.spinnerRadius\n },\n style: {\n stroke: opts.color,\n lineCap: 'round',\n lineWidth: opts.lineWidth\n },\n zlevel: opts.zlevel,\n z: 10001\n });\n arc.animateShape(true).when(1000, {\n endAngle: PI * 3 / 2\n }).start('circularInOut');\n arc.animateShape(true).when(1000, {\n startAngle: PI * 3 / 2\n }).delay(300).start('circularInOut');\n group.add(arc);\n } // Inject resize\n\n\n group.resize = function () {\n var textWidth = textContent.getBoundingRect().width;\n var r = opts.showSpinner ? opts.spinnerRadius : 0; // cx = (containerWidth - arcDiameter - textDistance - textWidth) / 2\n // textDistance needs to be calculated when both animation and text exist\n\n var cx = (api.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) // only show the text\n + (opts.showSpinner ? 0 : textWidth / 2) // only show the spinner\n + (textWidth ? 0 : r);\n var cy = api.getHeight() / 2;\n opts.showSpinner && arc.setShape({\n cx: cx,\n cy: cy\n });\n labelRect.setShape({\n x: cx - r,\n y: cy - r,\n width: r * 2,\n height: r * 2\n });\n mask.setShape({\n x: 0,\n y: 0,\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n group.resize();\n return group;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util.js';\nimport { createTask } from './task.js';\nimport { getUID } from '../util/component.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport { normalizeToArray } from '../util/model.js';\n;\n\nvar Scheduler =\n/** @class */\nfunction () {\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n // key: handlerUID\n this._stageTaskMap = createHashMap();\n this.ecInstance = ecInstance;\n this.api = api; // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n }\n\n Scheduler.prototype.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n }; // If seriesModel provided, incremental threshold is check by series data.\n\n\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n };\n\n Scheduler.prototype.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n };\n /**\r\n * Current, progressive rendering starts from visual and layout.\r\n * Always detect render mode in the same stage, avoiding that incorrect\r\n * detection caused by data filtering.\r\n * Caution:\r\n * `updateStreamModes` use `seriesModel.getData()`.\r\n */\n\n\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n\n var data = seriesModel.getData();\n var dataLen = data.count(); // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n };\n\n Scheduler.prototype.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n\n scheduler._pipe(seriesModel, seriesModel.dataTask);\n });\n };\n\n Scheduler.prototype.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.api.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Currently do not need to support to sepecify them both.\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n }\n\n assert(!(handler.reset && handler.overallReset), errMsg);\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n }, this);\n };\n\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n\n this._pipe(model, renderTask);\n };\n\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n };\n\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n };\n\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished = false;\n var scheduler = this;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n\n if (overallTask) {\n var overallNeedDirty_1;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty_1 = true;\n }\n });\n overallNeedDirty_1 && overallTask.dirty();\n scheduler.updatePayload(overallTask, payload);\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n\n agentStubMap.each(function (stub) {\n stub.perform(performArgs_1);\n });\n\n if (overallTask.perform(performArgs_1)) {\n unfinished = true;\n }\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n\n var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME\n // if intending to declare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because if a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operations\n // and stream-independent operations should better not be mixed.\n\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n scheduler.updatePayload(task, payload);\n\n if (task.perform(performArgs)) {\n unfinished = true;\n }\n });\n }\n });\n\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished = seriesModel.dataTask.perform() || unfinished;\n });\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n\n task = task.getUpstream();\n } while (task);\n });\n };\n\n Scheduler.prototype.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n };\n\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n\n function create(seriesModel) {\n var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n // PENDING: `useClearVisual` not used?\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n\n scheduler._pipe(seriesModel, task);\n }\n };\n\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n };\n var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '\"createOnAllSeries\" is not supported for \"overallReset\", ' + 'because it will block all streams.';\n }\n\n assert(!stageHandler.createOnAllSeries, errMsg);\n\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n } // Otherwise, (usually it is legacy case), the overall task will only be\n // executed when upstream is dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upstream.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n shouldOverallTaskDirty = true, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })));\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress // FIXME:TS never used, so comment it\n // modifyOutputEnd: modifyOutputEnd\n\n };\n stub.agent = overallTask;\n stub.__block = overallProgress;\n\n scheduler._pipe(seriesModel, stub);\n }\n\n if (shouldOverallTaskDirty) {\n overallTask.dirty();\n }\n };\n\n Scheduler.prototype._pipe = function (seriesModel, task) {\n var pipelineId = seriesModel.uid;\n\n var pipeline = this._pipelineMap.get(pipelineId);\n\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n };\n\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n };\n\n ;\n return Scheduler;\n}();\n\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\n\nfunction stubReset(context) {\n return context.overallProgress && stubProgress;\n}\n\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\n\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\n\nfunction seriesTaskPlan(context) {\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\n\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\n\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\n\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\n\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n/**\r\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\r\n * To ensure that they can work normally, they should work in block mode, that is,\r\n * they should not be started util the previous tasks finished. So they cause the\r\n * progressive rendering disabled. We try to detect the series type, to narrow down\r\n * the block range to only the series type they concern, but not all series.\r\n */\n\n\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return seriesType;\n}\n\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\n\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\n\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\n\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name_1 in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name_1] = noop;\n }\n /* eslint-enable */\n\n}\n\nexport default Scheduler;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF'];\nexport default {\n color: colorAll,\n colorLayer: [['#37A2DA', '#ffd85c', '#fd7b5f'], ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], colorAll]\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar contrastColor = '#B9B8CE';\nvar backgroundColor = '#100C2A';\n\nvar axisCommon = function () {\n return {\n axisLine: {\n lineStyle: {\n color: contrastColor\n }\n },\n splitLine: {\n lineStyle: {\n color: '#484753'\n }\n },\n splitArea: {\n areaStyle: {\n color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)']\n }\n },\n minorSplitLine: {\n lineStyle: {\n color: '#20203B'\n }\n }\n };\n};\n\nvar colorPalette = ['#4992ff', '#7cffb2', '#fddd60', '#ff6e76', '#58d9f9', '#05c091', '#ff8a45', '#8d48e3', '#dd79ff'];\nvar theme = {\n darkMode: true,\n color: colorPalette,\n backgroundColor: backgroundColor,\n axisPointer: {\n lineStyle: {\n color: '#817f91'\n },\n crossStyle: {\n color: '#817f91'\n },\n label: {\n // TODO Contrast of label backgorundColor\n color: '#fff'\n }\n },\n legend: {\n textStyle: {\n color: contrastColor\n }\n },\n textStyle: {\n color: contrastColor\n },\n title: {\n textStyle: {\n color: '#EEF1FA'\n },\n subtextStyle: {\n color: '#B9B8CE'\n }\n },\n toolbox: {\n iconStyle: {\n borderColor: contrastColor\n }\n },\n dataZoom: {\n borderColor: '#71708A',\n textStyle: {\n color: contrastColor\n },\n brushStyle: {\n color: 'rgba(135,163,206,0.3)'\n },\n handleStyle: {\n color: '#353450',\n borderColor: '#C5CBE3'\n },\n moveHandleStyle: {\n color: '#B0B6C3',\n opacity: 0.3\n },\n fillerColor: 'rgba(135,163,206,0.2)',\n emphasis: {\n handleStyle: {\n borderColor: '#91B7F2',\n color: '#4D587D'\n },\n moveHandleStyle: {\n color: '#636D9A',\n opacity: 0.7\n }\n },\n dataBackground: {\n lineStyle: {\n color: '#71708A',\n width: 1\n },\n areaStyle: {\n color: '#71708A'\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#87A3CE'\n },\n areaStyle: {\n color: '#87A3CE'\n }\n }\n },\n visualMap: {\n textStyle: {\n color: contrastColor\n }\n },\n timeline: {\n lineStyle: {\n color: contrastColor\n },\n label: {\n color: contrastColor\n },\n controlStyle: {\n color: contrastColor,\n borderColor: contrastColor\n }\n },\n calendar: {\n itemStyle: {\n color: backgroundColor\n },\n dayLabel: {\n color: contrastColor\n },\n monthLabel: {\n color: contrastColor\n },\n yearLabel: {\n color: contrastColor\n }\n },\n timeAxis: axisCommon(),\n logAxis: axisCommon(),\n valueAxis: axisCommon(),\n categoryAxis: axisCommon(),\n line: {\n symbol: 'circle'\n },\n graph: {\n color: colorPalette\n },\n gauge: {\n title: {\n color: contrastColor\n },\n axisLine: {\n lineStyle: {\n color: [[1, 'rgba(207,212,219,0.2)']]\n }\n },\n axisLabel: {\n color: contrastColor\n },\n detail: {\n color: '#EEF1FA'\n }\n },\n candlestick: {\n itemStyle: {\n color: '#f64e56',\n color0: '#54ea92',\n borderColor: '#f64e56',\n borderColor0: '#54ea92' // borderColor: '#ca2824',\n // borderColor0: '#09a443'\n\n }\n }\n};\ntheme.categoryAxis.splitLine.show = false;\nexport default theme;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parseClassType } from './clazz.js';\n/**\r\n * Usage of query:\r\n * `chart.on('click', query, handler);`\r\n * The `query` can be:\r\n * + The component type query string, only `mainType` or `mainType.subType`,\r\n * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'.\r\n * + The component query object, like:\r\n * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`,\r\n * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`.\r\n * + The data query object, like:\r\n * `{dataIndex: 123}`, `{dataType: 'link'}`, `{name: 'some'}`.\r\n * + The other query object (cmponent customized query), like:\r\n * `{element: 'some'}` (only available in custom series).\r\n *\r\n * Caveat: If a prop in the `query` object is `null/undefined`, it is the\r\n * same as there is no such prop in the `query` object.\r\n */\n\nvar ECEventProcessor =\n/** @class */\nfunction () {\n function ECEventProcessor() {}\n\n ECEventProcessor.prototype.normalizeQuery = function (query) {\n var cptQuery = {};\n var dataQuery = {};\n var otherQuery = {}; // `query` is `mainType` or `mainType.subType` of component.\n\n if (zrUtil.isString(query)) {\n var condCptType = parseClassType(query); // `.main` and `.sub` may be ''.\n\n cptQuery.mainType = condCptType.main || null;\n cptQuery.subType = condCptType.sub || null;\n } // `query` is an object, convert to {mainType, index, name, id}.\n else {\n // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved,\n // can not be used in `compomentModel.filterForExposedEvent`.\n var suffixes_1 = ['Index', 'Name', 'Id'];\n var dataKeys_1 = {\n name: 1,\n dataIndex: 1,\n dataType: 1\n };\n zrUtil.each(query, function (val, key) {\n var reserved = false;\n\n for (var i = 0; i < suffixes_1.length; i++) {\n var propSuffix = suffixes_1[i];\n var suffixPos = key.lastIndexOf(propSuffix);\n\n if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {\n var mainType = key.slice(0, suffixPos); // Consider `dataIndex`.\n\n if (mainType !== 'data') {\n cptQuery.mainType = mainType;\n cptQuery[propSuffix.toLowerCase()] = val;\n reserved = true;\n }\n }\n }\n\n if (dataKeys_1.hasOwnProperty(key)) {\n dataQuery[key] = val;\n reserved = true;\n }\n\n if (!reserved) {\n otherQuery[key] = val;\n }\n });\n }\n\n return {\n cptQuery: cptQuery,\n dataQuery: dataQuery,\n otherQuery: otherQuery\n };\n };\n\n ECEventProcessor.prototype.filter = function (eventType, query) {\n // They should be assigned before each trigger call.\n var eventInfo = this.eventInfo;\n\n if (!eventInfo) {\n return true;\n }\n\n var targetEl = eventInfo.targetEl;\n var packedEvent = eventInfo.packedEvent;\n var model = eventInfo.model;\n var view = eventInfo.view; // For event like 'globalout'.\n\n if (!model || !view) {\n return true;\n }\n\n var cptQuery = query.cptQuery;\n var dataQuery = query.dataQuery;\n 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));\n\n function check(query, host, prop, propOnHost) {\n return query[prop] == null || host[propOnHost || prop] === query[prop];\n }\n };\n\n ECEventProcessor.prototype.afterTrigger = function () {\n // Make sure the eventInfo won't be used in next trigger.\n this.eventInfo = null;\n };\n\n return ECEventProcessor;\n}();\n\nexport { ECEventProcessor };\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, isFunction, keys } from 'zrender/lib/core/util.js';\nvar SYMBOL_PROPS_WITH_CB = ['symbol', 'symbolSize', 'symbolRotate', 'symbolOffset'];\nvar SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(['symbolKeepAspect']); // Encoding visual for all series include which is filtered for legend drawing\n\nvar seriesSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n\n if (seriesModel.legendIcon) {\n data.setVisual('legendIcon', seriesModel.legendIcon);\n }\n\n if (!seriesModel.hasSymbolVisual) {\n return;\n }\n\n var symbolOptions = {};\n var symbolOptionsCb = {};\n var hasCallback = false;\n\n for (var i = 0; i < SYMBOL_PROPS_WITH_CB.length; i++) {\n var symbolPropName = SYMBOL_PROPS_WITH_CB[i];\n var val = seriesModel.get(symbolPropName);\n\n if (isFunction(val)) {\n hasCallback = true;\n symbolOptionsCb[symbolPropName] = val;\n } else {\n symbolOptions[symbolPropName] = val;\n }\n }\n\n symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;\n data.setVisual(extend({\n legendIcon: seriesModel.legendIcon || symbolOptions.symbol,\n symbolKeepAspect: seriesModel.get('symbolKeepAspect')\n }, symbolOptions)); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var symbolPropsCb = keys(symbolOptionsCb);\n\n function dataEach(data, idx) {\n var rawValue = seriesModel.getRawValue(idx);\n var params = seriesModel.getDataParams(idx);\n\n for (var i = 0; i < symbolPropsCb.length; i++) {\n var symbolPropName = symbolPropsCb[i];\n data.setItemVisual(idx, symbolPropName, symbolOptionsCb[symbolPropName](rawValue, params));\n }\n }\n\n return {\n dataEach: hasCallback ? dataEach : null\n };\n }\n};\nvar dataSymbolTask = {\n createOnAllSeries: true,\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n if (!seriesModel.hasSymbolVisual) {\n return;\n } // Only visible series has each data be visual encoded\n\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n\n for (var i = 0; i < SYMBOL_PROPS.length; i++) {\n var symbolPropName = SYMBOL_PROPS[i];\n var val = itemModel.getShallow(symbolPropName, true);\n\n if (val != null) {\n data.setItemVisual(idx, symbolPropName, val);\n }\n }\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport { seriesSymbolTask, dataSymbolTask };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function getItemVisualFromData(data, dataIndex, key) {\n switch (key) {\n case 'color':\n var style = data.getItemVisual(dataIndex, 'style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getItemVisual(dataIndex, 'style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getItemVisual(dataIndex, key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function getVisualFromData(data, key) {\n switch (key) {\n case 'color':\n var style = data.getVisual('style');\n return style[data.getVisual('drawType')];\n\n case 'opacity':\n return data.getVisual('style').opacity;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n return data.getVisual(key);\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\n }\n}\nexport function setItemVisualFromData(data, dataIndex, key, value) {\n switch (key) {\n case 'color':\n // Make sure not sharing style object.\n var style = data.ensureUniqueItemVisual(dataIndex, 'style');\n style[data.getVisual('drawType')] = value; // Mark the color has been changed, not from palette anymore\n\n data.setItemVisual(dataIndex, 'colorFromPalette', false);\n break;\n\n case 'opacity':\n data.ensureUniqueItemVisual(dataIndex, 'style').opacity = value;\n break;\n\n case 'symbol':\n case 'symbolSize':\n case 'liftZ':\n data.setItemVisual(dataIndex, key, value);\n break;\n\n default:\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Unknown visual type \" + key);\n }\n\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, each, isArray, isString } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog, deprecateLog } from '../util/log.js';\nimport { queryDataIndex } from '../util/model.js'; // Legacy data selection action.\n// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect\n\nexport function createLegacyDataSelectAction(seriesType, ecRegisterAction) {\n function getSeriesIndices(ecModel, payload) {\n var seriesIndices = [];\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n seriesIndices.push(seriesModel.seriesIndex);\n });\n return seriesIndices;\n }\n\n each([[seriesType + 'ToggleSelect', 'toggleSelect'], [seriesType + 'Select', 'select'], [seriesType + 'UnSelect', 'unselect']], function (eventsMap) {\n ecRegisterAction(eventsMap[0], function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog(payload.type, eventsMap[1]);\n }\n\n api.dispatchAction(extend(payload, {\n type: eventsMap[1],\n seriesIndex: getSeriesIndices(ecModel, payload)\n }));\n });\n });\n}\n\nfunction handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {\n var legacyEventName = type + eventPostfix;\n\n if (!ecIns.isSilent(legacyEventName)) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog(\"event \" + legacyEventName + \" is deprecated.\");\n }\n\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'pie'\n }, function (seriesModel) {\n var seriesIndex = seriesModel.seriesIndex;\n var selectedMap = seriesModel.option.selectedMap;\n var selected = payload.selected;\n\n for (var i = 0; i < selected.length; i++) {\n if (selected[i].seriesIndex === seriesIndex) {\n var data = seriesModel.getData();\n var dataIndex = queryDataIndex(data, payload.fromActionPayload);\n ecIns.trigger(legacyEventName, {\n type: legacyEventName,\n seriesId: seriesModel.id,\n name: isArray(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),\n selected: isString(selectedMap) ? selectedMap : extend({}, selectedMap)\n });\n }\n }\n });\n }\n}\n\nexport function handleLegacySelectEvents(messageCenter, ecIns, api) {\n messageCenter.on('selectchanged', function (params) {\n var ecModel = api.getModel();\n\n if (params.isFromClick) {\n handleSeriesLegacySelectEvents('map', 'selectchanged', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selectchanged', ecIns, ecModel, params);\n } else if (params.fromAction === 'select') {\n handleSeriesLegacySelectEvents('map', 'selected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'selected', ecIns, ecModel, params);\n } else if (params.fromAction === 'unselect') {\n handleSeriesLegacySelectEvents('map', 'unselected', ecIns, ecModel, params);\n handleSeriesLegacySelectEvents('pie', 'unselected', ecIns, ecModel, params);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function findEventDispatcher(target, det, returnFirstMatch) {\n var found;\n\n while (target) {\n if (det(target)) {\n found = target;\n\n if (returnFirstMatch) {\n break;\n }\n }\n\n target = target.__hostTarget || target.parent;\n }\n\n return found;\n}","var wmUniqueIndex = Math.round(Math.random() * 9);\nvar supportDefineProperty = typeof Object.defineProperty === 'function';\nvar WeakMap = (function () {\n function WeakMap() {\n this._id = '__ec_inner_' + wmUniqueIndex++;\n }\n WeakMap.prototype.get = function (key) {\n return this._guard(key)[this._id];\n };\n WeakMap.prototype.set = function (key, value) {\n var target = this._guard(key);\n if (supportDefineProperty) {\n Object.defineProperty(target, this._id, {\n value: value,\n enumerable: false,\n configurable: true\n });\n }\n else {\n target[this._id] = value;\n }\n return this;\n };\n WeakMap.prototype[\"delete\"] = function (key) {\n if (this.has(key)) {\n delete this._guard(key)[this._id];\n return true;\n }\n return false;\n };\n WeakMap.prototype.has = function (key) {\n return !!this._guard(key)[this._id];\n };\n WeakMap.prototype._guard = function (key) {\n if (key !== Object(key)) {\n throw TypeError('Value of WeakMap is not a non-null object.');\n }\n return key;\n };\n return WeakMap;\n}());\nexport default WeakMap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Symbol factory\nimport { each, isArray, retrieve2 } from 'zrender/lib/core/util.js';\nimport * as graphic from './graphic.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { parsePercent } from './number.js';\n/**\r\n * Triangle shape\r\n * @inner\r\n */\n\nvar Triangle = graphic.Path.extend({\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/**\r\n * Diamond shape\r\n * @inner\r\n */\n\nvar Diamond = graphic.Path.extend({\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/**\r\n * Pin shape\r\n * @inner\r\n */\n\nvar Pin = graphic.Path.extend({\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/**\r\n * Arrow shape\r\n * @inner\r\n */\n\nvar Arrow = graphic.Path.extend({\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/**\r\n * Map of path constructors\r\n */\n// TODO Use function to build symbol path.\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 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};\nexport var symbolBuildProxies = {};\neach(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.Path.extend({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n calculateTextPosition: function (out, config, rect) {\n var res = calculateTextPosition(out, config, rect);\n var shape = this.shape;\n\n if (shape && shape.symbolType === 'pin' && config.position === 'inside') {\n res.y = rect.y + rect.height * 0.4;\n }\n\n return res;\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n\n if (symbolType !== 'none') {\n var proxySymbol = symbolBuildProxies[symbolType];\n\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\n if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff'; // TODO Same width with lineStyle in LineView\n\n symbolStyle.lineWidth = 2;\n } else if (this.shape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else {\n symbolStyle.fill = color;\n }\n\n this.markRedraw();\n }\n}\n/**\r\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\r\n */\n\n\nexport function createSymbol(symbolType, x, y, w, h, color, // whether to keep the ratio of w/h,\nkeepAspect) {\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; // TODO Should deprecate setColor\n\n symbolPath.setColor = symbolPathSetColor;\n\n if (color) {\n symbolPath.setColor(color);\n }\n\n return symbolPath;\n}\nexport function normalizeSymbolSize(symbolSize) {\n if (!isArray(symbolSize)) {\n symbolSize = [+symbolSize, +symbolSize];\n }\n\n return [symbolSize[0] || 0, symbolSize[1] || 0];\n}\nexport function normalizeSymbolOffset(symbolOffset, symbolSize) {\n if (symbolOffset == null) {\n return;\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n }\n\n return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];\n}","function isSafeNum(num) {\n return isFinite(num);\n}\nexport function 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 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 }\n x = isSafeNum(x) ? x : 0;\n x2 = isSafeNum(x2) ? x2 : 1;\n y = isSafeNum(y) ? y : 0;\n y2 = isSafeNum(y2) ? y2 : 0;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\nexport function 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 if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n x = isSafeNum(x) ? x : 0.5;\n y = isSafeNum(y) ? y : 0.5;\n r = r >= 0 && isSafeNum(r) ? r : 0.5;\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\nexport function getCanvasGradient(ctx, obj, rect) {\n var canvasGradient = obj.type === 'radial'\n ? createRadialGradient(ctx, obj, rect)\n : createLinearGradient(ctx, obj, rect);\n var colorStops = obj.colorStops;\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n return canvasGradient;\n}\nexport function isClipPathChanged(clipPaths, prevClipPaths) {\n if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {\n return false;\n }\n if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {\n return true;\n }\n for (var i = 0; i < clipPaths.length; i++) {\n if (clipPaths[i] !== prevClipPaths[i]) {\n return true;\n }\n }\n return false;\n}\nfunction parseInt10(val) {\n return parseInt(val, 10);\n}\nexport function getSize(root, whIdx, opts) {\n var wh = ['width', 'height'][whIdx];\n var cwh = ['clientWidth', 'clientHeight'][whIdx];\n var plt = ['paddingLeft', 'paddingTop'][whIdx];\n var prb = ['paddingRight', 'paddingBottom'][whIdx];\n if (opts[wh] != null && opts[wh] !== 'auto') {\n return parseFloat(opts[wh]);\n }\n var stl = document.defaultView.getComputedStyle(root);\n return ((root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh]))\n - (parseInt10(stl[plt]) || 0)\n - (parseInt10(stl[prb]) || 0)) | 0;\n}\n","import { isArray, isNumber, map } from '../core/util.js';\nexport function normalizeLineDash(lineType, lineWidth) {\n if (!lineType || lineType === 'solid' || !(lineWidth > 0)) {\n return null;\n }\n return lineType === 'dashed'\n ? [4 * lineWidth, 2 * lineWidth]\n : lineType === 'dotted'\n ? [lineWidth]\n : isNumber(lineType)\n ? [lineType] : isArray(lineType) ? lineType : null;\n}\nexport function getLineDash(el) {\n var style = el.style;\n var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);\n var lineDashOffset = style.lineDashOffset;\n if (lineDash) {\n var lineScale_1 = (style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1;\n if (lineScale_1 && lineScale_1 !== 1) {\n lineDash = map(lineDash, function (rawVal) {\n return rawVal / lineScale_1;\n });\n lineDashOffset /= lineScale_1;\n }\n }\n return [lineDash, lineDashOffset];\n}\n","import { DEFAULT_COMMON_STYLE } from '../graphic/Displayable.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { createOrUpdateImage, isImageReady } from '../graphic/helper/image.js';\nimport { getCanvasGradient, isClipPathChanged } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { RADIAN_TO_DEGREE } from '../core/util.js';\nimport { getLineDash } from './dashStyle.js';\nimport { REDRAW_BIT, SHAPE_CHANGED_BIT } from '../graphic/constants.js';\nimport { DEFAULT_FONT } from '../core/platform.js';\nvar pathProxyForDraw = new PathProxy(true);\nfunction styleHasStroke(style) {\n var stroke = style.stroke;\n return !(stroke == null || stroke === 'none' || !(style.lineWidth > 0));\n}\nfunction isValidStrokeFillStyle(strokeOrFill) {\n return typeof strokeOrFill === 'string' && strokeOrFill !== 'none';\n}\nfunction styleHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== 'none';\n}\nfunction doFillPath(ctx, style) {\n if (style.fillOpacity != null && style.fillOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.fill();\n }\n}\nfunction doStrokePath(ctx, style) {\n if (style.strokeOpacity != null && style.strokeOpacity !== 1) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n }\n else {\n ctx.stroke();\n }\n}\nexport function createCanvasPattern(ctx, pattern, el) {\n var image = createOrUpdateImage(pattern.image, pattern.__image, el);\n if (isImageReady(image)) {\n var canvasPattern = ctx.createPattern(image, pattern.repeat || 'repeat');\n if (typeof DOMMatrix === 'function'\n && canvasPattern\n && canvasPattern.setTransform) {\n var matrix = new DOMMatrix();\n matrix.translateSelf((pattern.x || 0), (pattern.y || 0));\n matrix.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);\n matrix.scaleSelf((pattern.scaleX || 1), (pattern.scaleY || 1));\n canvasPattern.setTransform(matrix);\n }\n return canvasPattern;\n }\n}\nfunction brushPath(ctx, el, style, inBatch) {\n var _a;\n var hasStroke = styleHasStroke(style);\n var hasFill = styleHasFill(style);\n var strokePercent = style.strokePercent;\n var strokePart = strokePercent < 1;\n var firstDraw = !el.path;\n if ((!el.silent || strokePart) && firstDraw) {\n el.createPathProxy();\n }\n var path = el.path || pathProxyForDraw;\n var dirtyFlag = el.__dirty;\n if (!inBatch) {\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 var fillGradient = void 0;\n var strokeGradient = void 0;\n var fillPattern = void 0;\n var strokePattern = void 0;\n var rect = void 0;\n if (hasFillGradient || hasStrokeGradient) {\n rect = el.getBoundingRect();\n }\n if (hasFillGradient) {\n fillGradient = dirtyFlag\n ? getCanvasGradient(ctx, fill, rect)\n : el.__canvasFillGradient;\n el.__canvasFillGradient = fillGradient;\n }\n if (hasStrokeGradient) {\n strokeGradient = dirtyFlag\n ? getCanvasGradient(ctx, stroke, rect)\n : el.__canvasStrokeGradient;\n el.__canvasStrokeGradient = strokeGradient;\n }\n if (hasFillPattern) {\n fillPattern = (dirtyFlag || !el.__canvasFillPattern)\n ? createCanvasPattern(ctx, fill, el)\n : el.__canvasFillPattern;\n el.__canvasFillPattern = fillPattern;\n }\n if (hasStrokePattern) {\n strokePattern = (dirtyFlag || !el.__canvasStrokePattern)\n ? createCanvasPattern(ctx, stroke, el)\n : el.__canvasStrokePattern;\n el.__canvasStrokePattern = fillPattern;\n }\n if (hasFillGradient) {\n ctx.fillStyle = fillGradient;\n }\n else if (hasFillPattern) {\n if (fillPattern) {\n ctx.fillStyle = fillPattern;\n }\n else {\n hasFill = false;\n }\n }\n if (hasStrokeGradient) {\n ctx.strokeStyle = strokeGradient;\n }\n else if (hasStrokePattern) {\n if (strokePattern) {\n ctx.strokeStyle = strokePattern;\n }\n else {\n hasStroke = false;\n }\n }\n }\n var scale = el.getGlobalScale();\n path.setScale(scale[0], scale[1], el.segmentIgnoreThreshold);\n var lineDash;\n var lineDashOffset;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n var needsRebuild = true;\n if (firstDraw || (dirtyFlag & SHAPE_CHANGED_BIT)) {\n path.setDPR(ctx.dpr);\n if (strokePart) {\n path.setContext(null);\n }\n else {\n path.setContext(ctx);\n needsRebuild = false;\n }\n path.reset();\n el.buildPath(path, el.shape, inBatch);\n path.toStatic();\n el.pathUpdated();\n }\n if (needsRebuild) {\n path.rebuildPath(ctx, strokePart ? strokePercent : 1);\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (!inBatch) {\n if (style.strokeFirst) {\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n if (hasFill) {\n doFillPath(ctx, style);\n }\n }\n else {\n if (hasFill) {\n doFillPath(ctx, style);\n }\n if (hasStroke) {\n doStrokePath(ctx, style);\n }\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n}\nfunction brushImage(ctx, el, style) {\n var image = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);\n if (!image || !isImageReady(image)) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var width = el.getWidth();\n var height = el.getHeight();\n var aspect = image.width / image.height;\n if (width == null && height != null) {\n width = height * aspect;\n }\n else if (height == null && width != null) {\n height = width / aspect;\n }\n else if (width == null && height == null) {\n width = image.width;\n height = image.height;\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 }\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 }\n else {\n ctx.drawImage(image, x, y, width, height);\n }\n}\nfunction brushText(ctx, el, style) {\n var _a;\n var text = style.text;\n text != null && (text += '');\n if (text) {\n ctx.font = style.font || DEFAULT_FONT;\n ctx.textAlign = style.textAlign;\n ctx.textBaseline = style.textBaseline;\n var lineDash = void 0;\n var lineDashOffset = void 0;\n if (ctx.setLineDash && style.lineDash) {\n _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n }\n if (lineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n if (style.strokeFirst) {\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n }\n else {\n if (styleHasFill(style)) {\n ctx.fillText(text, style.x, style.y);\n }\n if (styleHasStroke(style)) {\n ctx.strokeText(text, style.x, style.y);\n }\n }\n if (lineDash) {\n ctx.setLineDash([]);\n }\n }\n}\nvar SHADOW_NUMBER_PROPS = ['shadowBlur', 'shadowOffsetX', 'shadowOffsetY'];\nvar STROKE_PROPS = [\n ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]\n];\nfunction bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {\n var styleChanged = false;\n if (!forceSetAll) {\n prevStyle = prevStyle || {};\n if (style === prevStyle) {\n return false;\n }\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n var opacity = Math.max(Math.min(style.opacity, 1), 0);\n ctx.globalAlpha = isNaN(opacity) ? DEFAULT_COMMON_STYLE.opacity : opacity;\n }\n if (forceSetAll || style.blend !== prevStyle.blend) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;\n }\n for (var i = 0; i < SHADOW_NUMBER_PROPS.length; i++) {\n var propName = SHADOW_NUMBER_PROPS[i];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = ctx.dpr * (style[propName] || 0);\n }\n }\n if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;\n }\n return styleChanged;\n}\nfunction bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {\n var style = getStyle(el, scope.inHover);\n var prevStyle = forceSetAll\n ? null\n : (prevEl && getStyle(prevEl, scope.inHover) || {});\n if (style === prevStyle) {\n return false;\n }\n var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);\n if (forceSetAll || style.fill !== prevStyle.fill) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);\n }\n if (forceSetAll || style.stroke !== prevStyle.stroke) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);\n }\n if (forceSetAll || style.opacity !== prevStyle.opacity) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n if (el.hasStroke()) {\n var lineWidth = style.lineWidth;\n var newLineWidth = lineWidth / ((style.strokeNoScale && el.getLineScale) ? el.getLineScale() : 1);\n if (ctx.lineWidth !== newLineWidth) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx.lineWidth = newLineWidth;\n }\n }\n for (var i = 0; i < STROKE_PROPS.length; i++) {\n var prop = STROKE_PROPS[i];\n var propName = prop[0];\n if (forceSetAll || style[propName] !== prevStyle[propName]) {\n if (!styleChanged) {\n flushPathDrawn(ctx, scope);\n styleChanged = true;\n }\n ctx[propName] = style[propName] || prop[1];\n }\n }\n return styleChanged;\n}\nfunction bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {\n return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);\n}\nfunction setContextTransform(ctx, el) {\n var m = el.transform;\n var dpr = ctx.dpr || 1;\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 }\n else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n}\nfunction updateClipStatus(clipPaths, ctx, scope) {\n var allClipped = false;\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n allClipped = allClipped || clipPath.isZeroArea();\n setContextTransform(ctx, clipPath);\n ctx.beginPath();\n clipPath.buildPath(ctx, clipPath.shape);\n ctx.clip();\n }\n scope.allClipped = allClipped;\n}\nfunction isTransformChanged(m0, m1) {\n if (m0 && m1) {\n return m0[0] !== m1[0]\n || m0[1] !== m1[1]\n || m0[2] !== m1[2]\n || m0[3] !== m1[3]\n || m0[4] !== m1[4]\n || m0[5] !== m1[5];\n }\n else if (!m0 && !m1) {\n return false;\n }\n return true;\n}\nvar DRAW_TYPE_PATH = 1;\nvar DRAW_TYPE_IMAGE = 2;\nvar DRAW_TYPE_TEXT = 3;\nvar DRAW_TYPE_INCREMENTAL = 4;\nfunction canPathBatch(style) {\n var hasFill = styleHasFill(style);\n var hasStroke = styleHasStroke(style);\n return !(style.lineDash\n || !(+hasFill ^ +hasStroke)\n || (hasFill && typeof style.fill !== 'string')\n || (hasStroke && typeof style.stroke !== 'string')\n || style.strokePercent < 1\n || style.strokeOpacity < 1\n || style.fillOpacity < 1);\n}\nfunction flushPathDrawn(ctx, scope) {\n scope.batchFill && ctx.fill();\n scope.batchStroke && ctx.stroke();\n scope.batchFill = '';\n scope.batchStroke = '';\n}\nfunction getStyle(el, inHover) {\n return inHover ? (el.__hoverStyle || el.style) : el.style;\n}\nexport function brushSingle(ctx, el) {\n brush(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);\n}\nexport function brush(ctx, el, scope, isLast) {\n var m = el.transform;\n if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {\n el.__dirty &= ~REDRAW_BIT;\n el.__isRendered = false;\n return;\n }\n var clipPaths = el.__clipPaths;\n var prevElClipPaths = scope.prevElClipPaths;\n var forceSetTransform = false;\n var forceSetStyle = false;\n if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {\n if (prevElClipPaths && prevElClipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.restore();\n forceSetStyle = forceSetTransform = true;\n scope.prevElClipPaths = null;\n scope.allClipped = false;\n scope.prevEl = null;\n }\n if (clipPaths && clipPaths.length) {\n flushPathDrawn(ctx, scope);\n ctx.save();\n updateClipStatus(clipPaths, ctx, scope);\n forceSetTransform = true;\n }\n scope.prevElClipPaths = clipPaths;\n }\n if (scope.allClipped) {\n el.__isRendered = false;\n return;\n }\n el.beforeBrush && el.beforeBrush();\n el.innerBeforeBrush();\n var prevEl = scope.prevEl;\n if (!prevEl) {\n forceSetStyle = forceSetTransform = true;\n }\n var canBatchPath = el instanceof Path\n && el.autoBatch\n && canPathBatch(el.style);\n if (forceSetTransform || isTransformChanged(m, prevEl.transform)) {\n flushPathDrawn(ctx, scope);\n setContextTransform(ctx, el);\n }\n else if (!canBatchPath) {\n flushPathDrawn(ctx, scope);\n }\n var style = getStyle(el, scope.inHover);\n if (el instanceof Path) {\n if (scope.lastDrawType !== DRAW_TYPE_PATH) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_PATH;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n if (!canBatchPath || (!scope.batchFill && !scope.batchStroke)) {\n ctx.beginPath();\n }\n brushPath(ctx, el, style, canBatchPath);\n if (canBatchPath) {\n scope.batchFill = style.fill || '';\n scope.batchStroke = style.stroke || '';\n }\n }\n else {\n if (el instanceof TSpan) {\n if (scope.lastDrawType !== DRAW_TYPE_TEXT) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_TEXT;\n }\n bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushText(ctx, el, style);\n }\n else if (el instanceof ZRImage) {\n if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_IMAGE;\n }\n bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);\n brushImage(ctx, el, style);\n }\n else if (el.getTemporalDisplayables) {\n if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {\n forceSetStyle = true;\n scope.lastDrawType = DRAW_TYPE_INCREMENTAL;\n }\n brushIncremental(ctx, el, scope);\n }\n }\n if (canBatchPath && isLast) {\n flushPathDrawn(ctx, scope);\n }\n el.innerAfterBrush();\n el.afterBrush && el.afterBrush();\n scope.prevEl = el;\n el.__dirty = 0;\n el.__isRendered = true;\n}\nfunction brushIncremental(ctx, el, scope) {\n var displayables = el.getDisplayables();\n var temporalDisplayables = el.getTemporalDisplayables();\n ctx.save();\n var innerScope = {\n prevElClipPaths: null,\n prevEl: null,\n allClipped: false,\n viewWidth: scope.viewWidth,\n viewHeight: scope.viewHeight,\n inHover: scope.inHover\n };\n var i;\n var len;\n for (i = el.getCursor(), len = displayables.length; i < len; i++) {\n var displayable = displayables[i];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i === len - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {\n var displayable = temporalDisplayables[i_1];\n displayable.beforeBrush && displayable.beforeBrush();\n displayable.innerBeforeBrush();\n brush(ctx, displayable, innerScope, i_1 === len_1 - 1);\n displayable.innerAfterBrush();\n displayable.afterBrush && displayable.afterBrush();\n innerScope.prevEl = displayable;\n }\n el.clearTemporalDisplayables();\n el.notClear = true;\n ctx.restore();\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport WeakMap from 'zrender/lib/core/WeakMap.js';\nimport LRU from 'zrender/lib/core/LRU.js';\nimport { defaults, map, isArray, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { getLeastCommonMultiple } from './number.js';\nimport { createSymbol } from './symbol.js';\nimport { brushSingle } from 'zrender/lib/canvas/graphic.js';\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar decalMap = new WeakMap();\nvar decalCache = new LRU(100);\nvar decalKeys = ['symbol', 'symbolSize', 'symbolKeepAspect', 'color', 'backgroundColor', 'dashArrayX', 'dashArrayY', 'maxTileWidth', 'maxTileHeight'];\n/**\r\n * Create or update pattern image from decal options\r\n *\r\n * @param {InnerDecalObject | 'none'} decalObject decal options, 'none' if no decal\r\n * @return {Pattern} pattern with generated image, null if no decal\r\n */\n\nexport function createOrUpdatePatternFromDecal(decalObject, api) {\n if (decalObject === 'none') {\n return null;\n }\n\n var dpr = api.getDevicePixelRatio();\n var zr = api.getZr();\n var isSVG = zr.painter.type === 'svg';\n\n if (decalObject.dirty) {\n decalMap[\"delete\"](decalObject);\n }\n\n var oldPattern = decalMap.get(decalObject);\n\n if (oldPattern) {\n return oldPattern;\n }\n\n var decalOpt = defaults(decalObject, {\n symbol: 'rect',\n symbolSize: 1,\n symbolKeepAspect: true,\n color: 'rgba(0, 0, 0, 0.2)',\n backgroundColor: null,\n dashArrayX: 5,\n dashArrayY: 5,\n rotation: 0,\n maxTileWidth: 512,\n maxTileHeight: 512\n });\n\n if (decalOpt.backgroundColor === 'none') {\n decalOpt.backgroundColor = null;\n }\n\n var pattern = {\n repeat: 'repeat'\n };\n setPatternnSource(pattern);\n pattern.rotation = decalOpt.rotation;\n pattern.scaleX = pattern.scaleY = isSVG ? 1 : 1 / dpr;\n decalMap.set(decalObject, pattern);\n decalObject.dirty = false;\n return pattern;\n\n function setPatternnSource(pattern) {\n var keys = [dpr];\n var isValidKey = true;\n\n for (var i = 0; i < decalKeys.length; ++i) {\n var value = decalOpt[decalKeys[i]];\n\n if (value != null && !isArray(value) && !isString(value) && !isNumber(value) && typeof value !== 'boolean') {\n isValidKey = false;\n break;\n }\n\n keys.push(value);\n }\n\n var cacheKey;\n\n if (isValidKey) {\n cacheKey = keys.join(',') + (isSVG ? '-svg' : '');\n var cache = decalCache.get(cacheKey);\n\n if (cache) {\n isSVG ? pattern.svgElement = cache : pattern.image = cache;\n }\n }\n\n var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);\n var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);\n var symbolArray = normalizeSymbolArray(decalOpt.symbol);\n var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);\n var lineBlockLengthY = getLineBlockLengthY(dashArrayY);\n var canvas = !isSVG && platformApi.createCanvas();\n var svgRoot = isSVG && {\n tag: 'g',\n attrs: {},\n key: 'dcl',\n children: []\n };\n var pSize = getPatternSize();\n var ctx;\n\n if (canvas) {\n canvas.width = pSize.width * dpr;\n canvas.height = pSize.height * dpr;\n ctx = canvas.getContext('2d');\n }\n\n brushDecal();\n\n if (isValidKey) {\n decalCache.put(cacheKey, canvas || svgRoot);\n }\n\n pattern.image = canvas;\n pattern.svgElement = svgRoot;\n pattern.svgWidth = pSize.width;\n pattern.svgHeight = pSize.height;\n /**\r\n * Get minimum length that can make a repeatable pattern.\r\n *\r\n * @return {Object} pattern width and height\r\n */\n\n function getPatternSize() {\n /**\r\n * For example, if dash is [[3, 2], [2, 1]] for X, it looks like\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * |--- --- --- --- --- ...\r\n * |-- -- -- -- -- -- -- -- ...\r\n * So the minimum length of X is 15,\r\n * which is the least common multiple of `3 + 2` and `2 + 1`\r\n * |--- --- --- |--- --- ...\r\n * |-- -- -- -- -- |-- -- -- ...\r\n */\n var width = 1;\n\n for (var i = 0, xlen = lineBlockLengthsX.length; i < xlen; ++i) {\n width = getLeastCommonMultiple(width, lineBlockLengthsX[i]);\n }\n\n var symbolRepeats = 1;\n\n for (var i = 0, xlen = symbolArray.length; i < xlen; ++i) {\n symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i].length);\n }\n\n width *= symbolRepeats;\n var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;\n\n if (process.env.NODE_ENV !== 'production') {\n var warn = function (attrName) {\n /* eslint-disable-next-line */\n console.warn(\"Calculated decal size is greater than \" + attrName + \" due to decal option settings so \" + attrName + \" is used for the decal size. Please consider changing the decal option to make a smaller decal or set \" + attrName + \" to be larger to avoid incontinuity.\");\n };\n\n if (width > decalOpt.maxTileWidth) {\n warn('maxTileWidth');\n }\n\n if (height > decalOpt.maxTileHeight) {\n warn('maxTileHeight');\n }\n }\n\n return {\n width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),\n height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))\n };\n }\n\n function brushDecal() {\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (decalOpt.backgroundColor) {\n ctx.fillStyle = decalOpt.backgroundColor;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n }\n\n var ySum = 0;\n\n for (var i = 0; i < dashArrayY.length; ++i) {\n ySum += dashArrayY[i];\n }\n\n if (ySum <= 0) {\n // dashArrayY is 0, draw nothing\n return;\n }\n\n var y = -lineBlockLengthY;\n var yId = 0;\n var yIdTotal = 0;\n var xId0 = 0;\n\n while (y < pSize.height) {\n if (yId % 2 === 0) {\n var symbolYId = yIdTotal / 2 % symbolArray.length;\n var x = 0;\n var xId1 = 0;\n var xId1Total = 0;\n\n while (x < pSize.width * 2) {\n var xSum = 0;\n\n for (var i = 0; i < dashArrayX[xId0].length; ++i) {\n xSum += dashArrayX[xId0][i];\n }\n\n if (xSum <= 0) {\n // Skip empty line\n break;\n } // E.g., [15, 5, 20, 5] draws only for 15 and 20\n\n\n if (xId1 % 2 === 0) {\n var size = (1 - decalOpt.symbolSize) * 0.5;\n var left = x + dashArrayX[xId0][xId1] * size;\n var top_1 = y + dashArrayY[yId] * size;\n var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;\n var height = dashArrayY[yId] * decalOpt.symbolSize;\n var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;\n brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);\n }\n\n x += dashArrayX[xId0][xId1];\n ++xId1Total;\n ++xId1;\n\n if (xId1 === dashArrayX[xId0].length) {\n xId1 = 0;\n }\n }\n\n ++xId0;\n\n if (xId0 === dashArrayX.length) {\n xId0 = 0;\n }\n }\n\n y += dashArrayY[yId];\n ++yIdTotal;\n ++yId;\n\n if (yId === dashArrayY.length) {\n yId = 0;\n }\n }\n\n function brushSymbol(x, y, width, height, symbolType) {\n var scale = isSVG ? 1 : dpr;\n var symbol = createSymbol(symbolType, x * scale, y * scale, width * scale, height * scale, decalOpt.color, decalOpt.symbolKeepAspect);\n\n if (isSVG) {\n var symbolVNode = zr.painter.renderOneToVNode(symbol);\n\n if (symbolVNode) {\n svgRoot.children.push(symbolVNode);\n }\n } else {\n // Paint to canvas for all other renderers.\n brushSingle(ctx, symbol);\n }\n }\n }\n }\n}\n/**\r\n * Convert symbol array into normalized array\r\n *\r\n * @param {string | (string | string[])[]} symbol symbol input\r\n * @return {string[][]} normolized symbol array\r\n */\n\nfunction normalizeSymbolArray(symbol) {\n if (!symbol || symbol.length === 0) {\n return [['rect']];\n }\n\n if (isString(symbol)) {\n return [[symbol]];\n }\n\n var isAllString = true;\n\n for (var i = 0; i < symbol.length; ++i) {\n if (!isString(symbol[i])) {\n isAllString = false;\n break;\n }\n }\n\n if (isAllString) {\n return normalizeSymbolArray([symbol]);\n }\n\n var result = [];\n\n for (var i = 0; i < symbol.length; ++i) {\n if (isString(symbol[i])) {\n result.push([symbol[i]]);\n } else {\n result.push(symbol[i]);\n }\n }\n\n return result;\n}\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayX} dash dash input\r\n * @return {number[][]} normolized dash array\r\n */\n\n\nfunction normalizeDashArrayX(dash) {\n if (!dash || dash.length === 0) {\n return [[0, 0]];\n }\n\n if (isNumber(dash)) {\n var dashValue = Math.ceil(dash);\n return [[dashValue, dashValue]];\n }\n /**\r\n * [20, 5] should be normalized into [[20, 5]],\r\n * while [20, [5, 10]] should be normalized into [[20, 20], [5, 10]]\r\n */\n\n\n var isAllNumber = true;\n\n for (var i = 0; i < dash.length; ++i) {\n if (!isNumber(dash[i])) {\n isAllNumber = false;\n break;\n }\n }\n\n if (isAllNumber) {\n return normalizeDashArrayX([dash]);\n }\n\n var result = [];\n\n for (var i = 0; i < dash.length; ++i) {\n if (isNumber(dash[i])) {\n var dashValue = Math.ceil(dash[i]);\n result.push([dashValue, dashValue]);\n } else {\n var dashValue = map(dash[i], function (n) {\n return Math.ceil(n);\n });\n\n if (dashValue.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // so normalize it to be [4, 2, 1, 4, 2, 1]\n result.push(dashValue.concat(dashValue));\n } else {\n result.push(dashValue);\n }\n }\n }\n\n return result;\n}\n/**\r\n * Convert dash input into dashArray\r\n *\r\n * @param {DecalDashArrayY} dash dash input\r\n * @return {number[]} normolized dash array\r\n */\n\n\nfunction normalizeDashArrayY(dash) {\n if (!dash || typeof dash === 'object' && dash.length === 0) {\n return [0, 0];\n }\n\n if (isNumber(dash)) {\n var dashValue_1 = Math.ceil(dash);\n return [dashValue_1, dashValue_1];\n }\n\n var dashValue = map(dash, function (n) {\n return Math.ceil(n);\n });\n return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;\n}\n/**\r\n * Get block length of each line. A block is the length of dash line and space.\r\n * For example, a line with [4, 1] has a dash line of 4 and a space of 1 after\r\n * that, so the block length of this line is 5.\r\n *\r\n * @param {number[][]} dash dash array of X or Y\r\n * @return {number[]} block length of each line\r\n */\n\n\nfunction getLineBlockLengthX(dash) {\n return map(dash, function (line) {\n return getLineBlockLengthY(line);\n });\n}\n\nfunction getLineBlockLengthY(dash) {\n var blockLength = 0;\n\n for (var i = 0; i < dash.length; ++i) {\n blockLength += dash[i];\n }\n\n if (dash.length % 2 === 1) {\n // [4, 2, 1] means |---- - -- |---- - -- |\n // So total length is (4 + 2 + 1) * 2\n return blockLength * 2;\n }\n\n return blockLength;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createOrUpdatePatternFromDecal } from '../util/decal.js';\nexport default function decalVisual(ecModel, api) {\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n\n if (data.hasItemVisual()) {\n data.each(function (idx) {\n var decal = data.getItemVisual(idx, 'decal');\n\n if (decal) {\n var itemStyle = data.ensureUniqueItemVisual(idx, 'style');\n itemStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n });\n }\n\n var decal = data.getVisual('decal');\n\n if (decal) {\n var style = data.getVisual('style');\n style.decal = createOrUpdatePatternFromDecal(decal, api);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Eventful from 'zrender/lib/core/Eventful.js';\n;\nvar lifecycle = new Eventful();\nexport default lifecycle;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { error } from '../util/log.js'; // Implementation of exported APIs. For example registerMap, getMap.\n// The implementations will be registered when installing the component.\n// Avoid these code being bundled to the core module.\n\nvar implsStore = {}; // TODO Type\n\nexport function registerImpl(name, impl) {\n if (process.env.NODE_ENV !== 'production') {\n if (implsStore[name]) {\n error(\"Already has an implementation of \" + name + \".\");\n }\n }\n\n implsStore[name] = impl;\n}\nexport function getImpl(name) {\n if (process.env.NODE_ENV !== 'production') {\n if (!implsStore[name]) {\n error(\"Implementation of \" + name + \" doesn't exists.\");\n }\n }\n\n return implsStore[name];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\nimport * as zrender from 'zrender/lib/zrender.js';\nimport { assert, each, isFunction, isObject, indexOf, bind, clone, setAsPrimitive, extend, createHashMap, map, defaults, isDom, isArray, noop, isString, retrieve2 } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport timsort from 'zrender/lib/core/timsort.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport GlobalModel from '../model/Global.js';\nimport ExtensionAPI from './ExtensionAPI.js';\nimport CoordinateSystemManager from './CoordinateSystem.js';\nimport OptionManager from '../model/OptionManager.js';\nimport backwardCompat from '../preprocessor/backwardCompat.js';\nimport dataStack from '../processor/dataStack.js';\nimport SeriesModel from '../model/Series.js';\nimport ComponentView from '../view/Component.js';\nimport ChartView from '../view/Chart.js';\nimport * as graphic from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlobalMouseOutForHighDown } from '../util/states.js';\nimport * as modelUtil from '../util/model.js';\nimport { throttle } from '../util/throttle.js';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style.js';\nimport loadingDefault from '../loading/default.js';\nimport Scheduler from './Scheduler.js';\nimport lightTheme from '../theme/light.js';\nimport darkTheme from '../theme/dark.js';\nimport { parseClassType } from '../util/clazz.js';\nimport { ECEventProcessor } from '../util/ECEventProcessor.js';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol.js';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper.js';\nimport { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log.js';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction.js';\nimport { registerExternalTransform } from '../data/helper/transform.js';\nimport { createLocaleObject, SYSTEM_LANG } from './locale.js';\nimport { findEventDispatcher } from '../util/event.js';\nimport decal from '../visual/decal.js';\nimport lifecycle from './lifecycle.js';\nimport { platformApi, setPlatformAPI } from 'zrender/lib/core/platform.js';\nimport { getImpl } from './impl.js';\nexport var version = '5.4.3';\nexport var dependencies = {\n zrender: '5.4.4'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800; // Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\n\nvar PRIORITY_PROCESSOR_DATASTACK = 900; // \"Data filter\" will block the stream, so it should be\n// put at the beginning of data processing.\n\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000; // Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\n\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; // Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\n\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH,\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n ARIA: PRIORITY_VISUAL_ARIA,\n DECAL: PRIORITY_VISUAL_DECAL\n }\n}; // Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\n\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\nvar PENDING_UPDATE = '__pendingUpdate';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\n\nfunction createRegisterEventWithLowercaseECharts(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.isDisposed()) {\n disposedWarning(this.id);\n return;\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n // `args[0]` is event name. Event name is all lowercase.\n args[0] = args[0] && args[0].toLowerCase();\n return Eventful.prototype[method].apply(host, args);\n}\n\nvar MessageCenter =\n/** @class */\nfunction (_super) {\n __extends(MessageCenter, _super);\n\n function MessageCenter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return MessageCenter;\n}(Eventful);\n\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off'); // ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\n\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar createExtensionAPI;\nvar enableConnect;\nvar markStatusToUpdate;\nvar applyChangedStates;\n\nvar ECharts =\n/** @class */\nfunction (_super) {\n __extends(ECharts, _super);\n\n function ECharts(dom, // Theme name or themeOption.\n theme, opts) {\n var _this = _super.call(this, new ECEventProcessor()) || this;\n\n _this._chartsViews = [];\n _this._chartsMap = {};\n _this._componentsViews = [];\n _this._componentsMap = {}; // Can't dispatch action during rendering procedure\n\n _this._pendingActions = [];\n opts = opts || {}; // Get theme by name\n\n if (isString(theme)) {\n theme = themeStorage[theme];\n }\n\n _this._dom = dom;\n var defaultRenderer = 'canvas';\n var defaultCoarsePointer = 'auto';\n var defaultUseDirtyRect = false;\n\n if (process.env.NODE_ENV !== 'production') {\n var root =\n /* eslint-disable-next-line */\n env.hasGlobalWindow ? window : global;\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\n defaultCoarsePointer = retrieve2(root.__ECHARTS__DEFAULT__COARSE_POINTER, defaultCoarsePointer);\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\n defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect;\n }\n\n var zr = _this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height,\n ssr: opts.ssr,\n useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),\n useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),\n pointerSize: opts.pointerSize\n });\n _this._ssr = opts.ssr; // Expect 60 fps.\n\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\n theme = clone(theme);\n theme && backwardCompat(theme, true);\n _this._theme = theme;\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n _this._coordSysMgr = new CoordinateSystemManager();\n var api = _this._api = createExtensionAPI(_this); // Sort on demand\n\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n _this._messageCenter = new MessageCenter(); // Init mouse events\n\n _this._initEvents(); // In case some people write `window.onresize = chart.resize`\n\n\n _this.resize = bind(_this.resize, _this);\n zr.animation.on('frame', _this._onframe, _this);\n bindRenderedEvent(zr, _this);\n bindMouseEvent(zr, _this); // ECharts instance can be used as value.\n\n setAsPrimitive(_this);\n return _this;\n }\n\n ECharts.prototype._onframe = function () {\n if (this._disposed) {\n return;\n }\n\n applyChangedStates(this);\n var scheduler = this._scheduler; // Lazy update\n\n if (this[PENDING_UPDATE]) {\n var silent = this[PENDING_UPDATE].silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n\n try {\n prepare(this);\n updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n throw e;\n } // At present, in each frame, zrender performs:\n // (1) animation step forward.\n // (2) trigger('frame') (where this `_onframe` is called)\n // (3) zrender flush (render).\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n // will render the final state of the elements before the real animation started.\n\n\n this._zr.flush();\n\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n } // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold.\n\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determined in the first frame (the\n // frame is executed immediately after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain', {});\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event.\n\n\n if (!scheduler.unfinished) {\n this._zr.flush();\n } // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n\n }\n };\n\n ECharts.prototype.getDom = function () {\n return this._dom;\n };\n\n ECharts.prototype.getId = function () {\n return this.id;\n };\n\n ECharts.prototype.getZr = function () {\n return this._zr;\n };\n\n ECharts.prototype.isSSR = function () {\n return this._ssr;\n };\n /* eslint-disable-next-line */\n\n\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`setOption` should not be called during main process.');\n }\n\n return;\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var silent;\n var replaceMerge;\n var transitionOpt;\n\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n replaceMerge = notMerge.replaceMerge;\n transitionOpt = notMerge.transition;\n notMerge = notMerge.notMerge;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.ssr = this._ssr;\n ecModel.init(null, null, null, theme, this._locale, optionManager);\n }\n\n this._model.setOption(option, {\n replaceMerge: replaceMerge\n }, optionPreprocessorFuncs);\n\n var updateParams = {\n seriesTransition: transitionOpt,\n optionChanged: true\n };\n\n if (lazyUpdate) {\n this[PENDING_UPDATE] = {\n silent: silent,\n updateParams: updateParams\n };\n this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n // It should wake it up to make sure zrender start to render at the next frame.\n\n this.getZr().wakeUp();\n } else {\n try {\n prepare(this);\n updateMethods.update.call(this, null, updateParams);\n } catch (e) {\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n } // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n\n\n if (!this._ssr) {\n // not use flush when using ssr mode.\n this._zr.flush();\n }\n\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n };\n /**\r\n * @deprecated\r\n */\n\n\n ECharts.prototype.setTheme = function () {\n deprecateLog('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n }; // We don't want developers to use getModel directly.\n\n\n ECharts.prototype.getModel = function () {\n return this._model;\n };\n\n ECharts.prototype.getOption = function () {\n return this._model && this._model.getOption();\n };\n\n ECharts.prototype.getWidth = function () {\n return this._zr.getWidth();\n };\n\n ECharts.prototype.getHeight = function () {\n return this._zr.getHeight();\n };\n\n ECharts.prototype.getDevicePixelRatio = function () {\n return this._zr.painter.dpr\n /* eslint-disable-next-line */\n || env.hasGlobalWindow && window.devicePixelRatio || 1;\n };\n /**\r\n * Get canvas which has all thing rendered\r\n * @deprecated Use renderToCanvas instead.\r\n */\n\n\n ECharts.prototype.getRenderedCanvas = function (opts) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('getRenderedCanvas', 'renderToCanvas');\n }\n\n return this.renderToCanvas(opts);\n };\n\n ECharts.prototype.renderToCanvas = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'canvas') {\n throw new Error('renderToCanvas can only be used in the canvas renderer.');\n }\n }\n\n return painter.getRenderedCanvas({\n backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'),\n pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\n });\n };\n\n ECharts.prototype.renderToSVGString = function (opts) {\n opts = opts || {};\n var painter = this._zr.painter;\n\n if (process.env.NODE_ENV !== 'production') {\n if (painter.type !== 'svg') {\n throw new Error('renderToSVGString can only be used in the svg renderer.');\n }\n }\n\n return painter.renderToString({\n useViewBox: opts.useViewBox\n });\n };\n /**\r\n * Get svg data url\r\n */\n\n\n ECharts.prototype.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n\n var zr = this._zr;\n var list = zr.storage.getDisplayList(); // Stop animations\n\n each(list, function (el) {\n el.stopAnimation(null, true);\n });\n return zr.painter.toDataURL();\n };\n\n ECharts.prototype.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n };\n\n ECharts.prototype.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n\n if (connectedGroups[groupId]) {\n var left_1 = MAX_NUMBER;\n var top_1 = MAX_NUMBER;\n var right_1 = -MAX_NUMBER;\n var bottom_1 = -MAX_NUMBER;\n var canvasList_1 = [];\n var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left_1 = mathMin(boundingRect.left, left_1);\n top_1 = mathMin(boundingRect.top, top_1);\n right_1 = mathMax(boundingRect.right, right_1);\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n canvasList_1.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left_1 *= dpr_1;\n top_1 *= dpr_1;\n right_1 *= dpr_1;\n bottom_1 *= dpr_1;\n var width = right_1 - left_1;\n var height = bottom_1 - top_1;\n var targetCanvas = platformApi.createCanvas();\n var zr_1 = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr_1.resize({\n width: width,\n height: height\n });\n\n if (isSvg) {\n var content_1 = '';\n each(canvasList_1, function (item) {\n var x = item.left - left_1;\n var y = item.top - top_1;\n content_1 += '' + item.dom + '';\n });\n zr_1.painter.getSvgRoot().innerHTML = content_1;\n\n if (opts.connectedBackgroundColor) {\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n\n zr_1.refreshImmediately();\n return zr_1.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr_1.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n\n each(canvasList_1, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr_1 - left_1,\n y: item.top * dpr_1 - top_1,\n image: item.dom\n }\n });\n zr_1.add(img);\n });\n zr_1.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n };\n\n ECharts.prototype.convertToPixel = function (finder, value) {\n return doConvertPixel(this, 'convertToPixel', finder, value);\n };\n\n ECharts.prototype.convertFromPixel = function (finder, value) {\n return doConvertPixel(this, 'convertFromPixel', finder, value);\n };\n /**\r\n * Is the specified coordinate systems or components contain the given pixel point.\r\n * @param {Array|number} value\r\n * @return {boolean} result\r\n */\n\n\n ECharts.prototype.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n var result;\n var findResult = modelUtil.parseFinder(ecModel, finder);\n each(findResult, function (models, key) {\n key.indexOf('Models') >= 0 && each(models, function (model) {\n var coordSys = model.coordinateSystem;\n\n if (coordSys && coordSys.containPoint) {\n result = result || !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n\n if (view && view.containPoint) {\n result = result || view.containPoint(value, model);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n }\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n warn(key + ': containPoint is not supported');\n }\n }\n }, this);\n }, this);\n return !!result;\n };\n /**\r\n * Get visual from series or data.\r\n * @param finder\r\n * If string, e.g., 'series', means {seriesIndex: 0}.\r\n * If Object, could contain some of these properties below:\r\n * {\r\n * seriesIndex / seriesId / seriesName,\r\n * dataIndex / dataIndexInside\r\n * }\r\n * If dataIndex is not specified, series visual will be fetched,\r\n * but not data item visual.\r\n * If all of seriesIndex, seriesId, seriesName are not specified,\r\n * visual will be fetched from first series.\r\n * @param visualType 'color', 'symbol', 'symbolSize'\r\n */\n\n\n ECharts.prototype.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = parsedFinder.seriesModel;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!seriesModel) {\n warn('There is no specified series model');\n }\n }\n\n var data = seriesModel.getData();\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n };\n /**\r\n * Get view of corresponding component model\r\n */\n\n\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n };\n /**\r\n * Get view of corresponding series model\r\n */\n\n\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n };\n\n ECharts.prototype._initEvents = function () {\n var _this = this;\n\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = _this.getModel();\n\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'.\n\n if (isGlobalOut) {\n params = {};\n } else {\n el && findEventDispatcher(el, function (parent) {\n var ecData = getECData(parent);\n\n if (ecData && ecData.dataIndex != null) {\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {};\n return true;\n } // If element has custom eventData of components\n else if (ecData.eventData) {\n params = extend({}, ecData.eventData);\n return true;\n }\n }, true);\n } // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n\n\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n\n if (process.env.NODE_ENV !== 'production') {\n // `event.componentType` and `event[componentTpype + 'Index']` must not\n // be missed, otherwise there is no way to distinguish source component.\n // See `dataFormat.getDataParams`.\n if (!isGlobalOut && !(model && view)) {\n warn('model or view can not be found by params');\n }\n }\n\n params.event = e;\n params.type = eveName;\n _this._$eventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n\n _this.trigger(eveName, params);\n }\n }; // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n\n\n handler.zrEventfulCallAtLast = true;\n\n _this._zr.on(eveName, handler, _this);\n });\n each(eventActionMap, function (actionType, eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n }); // Extra events\n // TODO register?\n\n each(['selectchanged'], function (eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n handleLegacySelectEvents(this._messageCenter, this, this._api);\n };\n\n ECharts.prototype.isDisposed = function () {\n return this._disposed;\n };\n\n ECharts.prototype.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this.setOption({\n series: []\n }, true);\n };\n\n ECharts.prototype.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._disposed = true;\n var dom = this.getDom();\n\n if (dom) {\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n }\n\n var chart = this;\n var api = chart._api;\n var ecModel = chart._model;\n each(chart._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(chart._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n }); // Dispose after all views disposed\n\n chart._zr.dispose(); // Set properties to null.\n // To reduce the memory cost in case the top code still holds this instance unexpectedly.\n\n\n chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;\n delete instances[chart.id];\n };\n /**\r\n * Resize the chart\r\n */\n\n\n ECharts.prototype.resize = function (opts) {\n if (this[IN_MAIN_PROCESS_KEY]) {\n if (process.env.NODE_ENV !== 'production') {\n error('`resize` should not be called during main process.');\n }\n\n return;\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._zr.resize(opts);\n\n var ecModel = this._model; // Resize loading effect\n\n this._loadingFX && this._loadingFX.resize();\n\n if (!ecModel) {\n return;\n }\n\n var needPrepare = ecModel.resetOption('media');\n var silent = opts && opts.silent; // There is some real cases that:\n // chart.setOption(option, { lazyUpdate: true });\n // chart.resize();\n\n if (this[PENDING_UPDATE]) {\n if (silent == null) {\n silent = this[PENDING_UPDATE].silent;\n }\n\n needPrepare = true;\n this[PENDING_UPDATE] = null;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n try {\n needPrepare && prepare(this);\n updateMethods.update.call(this, {\n type: 'resize',\n animation: extend({\n // Disable animation\n duration: 0\n }, opts && opts.animation)\n });\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n\n name = name || 'default';\n this.hideLoading();\n\n if (!loadingEffects[name]) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Loading effects ' + name + ' not exists.');\n }\n\n return;\n }\n\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n };\n /**\r\n * Hide loading effect\r\n */\n\n\n ECharts.prototype.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n };\n\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\n var payload = extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n };\n /**\r\n * @param opt If pass boolean, means opt.silent\r\n * @param opt.silent Default `false`. Whether trigger events.\r\n * @param opt.flush Default `undefined`.\r\n * true: Flush immediately, and then pixel in canvas can be fetched\r\n * immediately. Caution: it might affect performance.\r\n * false: Not flush.\r\n * undefined: Auto decide whether perform flush.\r\n */\n\n\n ECharts.prototype.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n\n if (!actions[payload.type]) {\n return;\n } // Avoid dispatch action before setOption. Especially in `connect`.\n\n\n if (!this._model) {\n return;\n } // May dispatchAction in rendering procedure\n\n\n if (this[IN_MAIN_PROCESS_KEY]) {\n this._pendingActions.push(payload);\n\n return;\n }\n\n var silent = opt.silent;\n doDispatchAction.call(this, payload, silent);\n var flush = opt.flush;\n\n if (flush) {\n this._zr.flush();\n } else if (flush !== false && env.browser.weChat) {\n // In WeChat embedded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh until user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.updateLabelLayout = function () {\n lifecycle.trigger('series:layoutlabels', this._model, this._api, {\n // Not adding series labels.\n // TODO\n updatedSeries: []\n });\n };\n\n ECharts.prototype.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(params.data && seriesModel);\n }\n\n seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n\n this._scheduler.unfinished = true;\n this.getZr().wakeUp();\n }; // A work around for no `internal` modifier in ts yet but\n // need to strictly hide private methods to JS users.\n\n\n ECharts.internalField = function () {\n prepare = function (ecIns) {\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecIns._model);\n scheduler.prepareStageTasks();\n prepareView(ecIns, true);\n prepareView(ecIns, false);\n scheduler.plan();\n };\n /**\r\n * Prepare view instances of charts and components\r\n */\n\n\n prepareView = function (ecIns, isComponent) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n\n function doPrepare(model) {\n // By default view will be reused if possible for the case that `setOption` with \"notMerge\"\n // mode and need to enable transition animation. (Usually, when they have the same id, or\n // especially no id but have the same type & name & index. See the `model.id` generation\n // rule in `makeIdAndName` and `viewId` generation rule here).\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n // the new model has nothing to do with the old model.\n var requireNewView = model.__requireNewView; // This command should not work twice.\n\n model.__requireNewView = false; // Consider: id same and type changed.\n\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = !requireNewView && viewMap[viewId];\n\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n // For backward compat, still support a chart type declared as only subType\n // like \"liquidfill\", but recommend \"series.liquidfill\"\n // But need a base class to make a type series.\n ChartView.getClass(classType.sub);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(Clazz, classType.sub + ' does not exist.');\n }\n\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n\n if (viewMap[view.__id] === view) {\n delete viewMap[view.__id];\n }\n\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n };\n\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model;\n ecModel.setUpdatePayload(payload); // broadcast\n\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n return;\n }\n\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n\n var excludeSeriesId = payload.excludeSeriesId;\n var excludeSeriesIdMap;\n\n if (excludeSeriesId != null) {\n excludeSeriesIdMap = createHashMap();\n each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n var modelId = modelUtil.convertOptionIdName(id, null);\n\n if (modelId != null) {\n excludeSeriesIdMap.set(modelId, true);\n }\n });\n } // If dispatchAction before setOption, do nothing.\n\n\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n\n if (isHighDownPayload(payload)) {\n if (model instanceof SeriesModel) {\n if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(['emphasis', 'disabled'])) {\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n }\n } else {\n var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n focusSelf = _a.focusSelf,\n dispatchers = _a.dispatchers;\n\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\n } // PENDING:\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\n // which will be the same as `ChartView` but might be not necessary\n // and will be far from this logic.\n\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n });\n }\n }\n } else if (isSelectChangePayload(payload)) {\n // TODO geo\n if (model instanceof SeriesModel) {\n toggleSelectionFromPayload(model, payload, ecIns._api);\n updateSeriesElementSelection(model);\n markStatusToUpdate(ecIns);\n }\n }\n }, ecIns);\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }, ecIns);\n\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n };\n\n updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload, {\n // Needs to mark option changed if newOption is given.\n // It's from MagicType.\n // TODO If use a separate flag optionChanged in payload?\n optionChanged: payload.newOption != null\n });\n },\n update: function (payload, updateParams) {\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel); // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the original point.\n\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // determine whether to use progressive rendering.\n\n updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not required in stream mode updater currently.\n\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload, updateParams); // Set background\n\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n var darkMode = ecModel.get('darkMode');\n zr.setBackgroundColor(backgroundColor); // Force set dark mode.\n\n if (darkMode != null && darkMode !== 'auto') {\n zr.setDarkMode(darkMode);\n }\n\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateTransform: function (payload) {\n var _this = this;\n\n var ecModel = this._model;\n var api = this._api; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform');\n\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n }); // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n\n\n renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateView: function (payload) {\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n\n render(this, ecModel, this._api, payload, {});\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateVisual: function (payload) {\n // updateMethods.update.call(this, payload);\n var _this = this;\n\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // clear all visual\n\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.getData().clearAllVisual();\n }); // Perform visual\n\n ChartView.markUpdateMethod(payload, 'updateVisual');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n visualType: 'visual',\n setDirty: true\n });\n\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType !== 'series') {\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n });\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload);\n }\n };\n\n doConvertPixel = function (ecIns, methodName, finder, value) {\n if (ecIns._disposed) {\n disposedWarning(ecIns.id);\n return;\n }\n\n var ecModel = ecIns._model;\n\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n\n var result;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\n return result;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n }\n };\n\n updateStreamModes = function (ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n };\n\n doDispatchAction = function (payload, silent) {\n var _this = this;\n\n var ecModel = this.getModel();\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\n var updateMethod = cptTypeTmp.pop();\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n this[IN_MAIN_PROCESS_KEY] = true;\n var payloads = [payload];\n var batched = false; // Batch action\n\n if (payload.batch) {\n batched = true;\n payloads = map(payload.batch, function (item) {\n item = defaults(extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n\n var eventObjBatch = [];\n var eventObj;\n var isSelectChange = isSelectChangePayload(payload);\n var isHighDown = isHighDownPayload(payload); // Only leave blur once if there are multiple batches.\n\n if (isHighDown) {\n allLeaveBlur(this._api);\n }\n\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside\n\n eventObj = eventObj || extend({}, batchItem); // Convert type to eventType\n\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.\n\n if (isHighDown) {\n var _a = modelUtil.preParseFinder(payload),\n queryOptionMap = _a.queryOptionMap,\n mainTypeSpecified = _a.mainTypeSpecified;\n\n var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n updateDirectly(_this, updateMethod, batchItem, componentMainType);\n markStatusToUpdate(_this);\n } else if (isSelectChange) {\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n // geo still use 'geoselect'.\n updateDirectly(_this, updateMethod, batchItem, 'series');\n markStatusToUpdate(_this);\n } else if (cptType) {\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n });\n\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n try {\n // Still dirty\n if (this[PENDING_UPDATE]) {\n prepare(this);\n updateMethods.update.call(this, payload);\n this[PENDING_UPDATE] = null;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } catch (e) {\n this[IN_MAIN_PROCESS_KEY] = false;\n throw e;\n }\n } // Follow the rule of action batch\n\n\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n\n if (!silent) {\n var messageCenter = this._messageCenter;\n messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event\n\n if (isSelectChange) {\n var newObj = {\n type: 'selectchanged',\n escapeConnect: escapeConnect,\n selected: getAllSelectedIndices(ecModel),\n isFromClick: payload.isFromClick || false,\n fromAction: payload.type,\n fromActionPayload: payload\n };\n messageCenter.trigger(newObj.type, newObj);\n }\n }\n };\n\n flushPendingActions = function (silent) {\n var pendingActions = this._pendingActions;\n\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n };\n\n triggerUpdatedEvent = function (silent) {\n !silent && this.trigger('updated');\n };\n /**\r\n * Event `rendered` is triggered when zr\r\n * rendered. It is useful for realtime\r\n * snapshot (reflect animation).\r\n *\r\n * Event `finished` is triggered when:\r\n * (1) zrender rendering finished.\r\n * (2) initial animation finished.\r\n * (3) progressive rendering finished.\r\n * (4) no pending action.\r\n * (5) no delayed setOption needs to be processed.\r\n */\n\n\n bindRenderedEvent = function (zr, ecIns) {\n zr.on('rendered', function (params) {\n ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatedly,\n // so it should only be triggered when rendering indeed happens\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n };\n\n bindMouseEvent = function (zr, ecIns) {\n zr.on('mouseover', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('mouseout', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOutForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('click', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, function (target) {\n return getECData(target).dataIndex != null;\n }, true);\n\n if (dispatcher) {\n var actionType = dispatcher.selected ? 'unselect' : 'select';\n var ecData = getECData(dispatcher);\n\n ecIns._api.dispatchAction({\n type: actionType,\n dataType: ecData.dataType,\n dataIndexInside: ecData.dataIndex,\n seriesIndex: ecData.seriesIndex,\n isFromClick: true\n });\n }\n });\n };\n\n function clearColorPalette(ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n }\n\n ; // Allocate zlevels for series and components\n\n function allocateZlevels(ecModel) {\n ;\n var componentZLevels = [];\n var seriesZLevels = [];\n var hasSeperateZLevel = false;\n ecModel.eachComponent(function (componentType, componentModel) {\n var zlevel = componentModel.get('zlevel') || 0;\n var z = componentModel.get('z') || 0;\n var zlevelKey = componentModel.getZLevelKey();\n hasSeperateZLevel = hasSeperateZLevel || !!zlevelKey;\n (componentType === 'series' ? seriesZLevels : componentZLevels).push({\n zlevel: zlevel,\n z: z,\n idx: componentModel.componentIndex,\n type: componentType,\n key: zlevelKey\n });\n });\n\n if (hasSeperateZLevel) {\n // Series after component\n var zLevels = componentZLevels.concat(seriesZLevels);\n var lastSeriesZLevel_1;\n var lastSeriesKey_1;\n timsort(zLevels, function (a, b) {\n if (a.zlevel === b.zlevel) {\n return a.z - b.z;\n }\n\n return a.zlevel - b.zlevel;\n });\n each(zLevels, function (item) {\n var componentModel = ecModel.getComponent(item.type, item.idx);\n var zlevel = item.zlevel;\n var key = item.key;\n\n if (lastSeriesZLevel_1 != null) {\n zlevel = Math.max(lastSeriesZLevel_1, zlevel);\n }\n\n if (key) {\n if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) {\n zlevel++;\n }\n\n lastSeriesKey_1 = key;\n } else if (lastSeriesKey_1) {\n if (zlevel === lastSeriesZLevel_1) {\n zlevel++;\n }\n\n lastSeriesKey_1 = '';\n }\n\n lastSeriesZLevel_1 = zlevel;\n componentModel.setZLevel(zlevel);\n });\n }\n }\n\n render = function (ecIns, ecModel, api, payload, updateParams) {\n allocateZlevels(ecModel);\n renderComponents(ecIns, ecModel, api, payload, updateParams);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload, updateParams); // Remove groups of unrendered charts\n\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n };\n\n renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n clearStates(componentModel, componentView);\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n updateStates(componentModel, componentView);\n });\n };\n /**\r\n * Render each chart and component\r\n */\n\n\n renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n updateParams = extend(updateParams || {}, {\n updatedSeries: ecModel.getSeries()\n }); // TODO progressive?\n\n lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\n var unfinished = false;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload); // TODO states on marker.\n\n clearStates(seriesModel, chartView);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n unfinished = true;\n }\n\n chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender\n // incremental render (always render from the __startIndex each frame)\n // chartView.group.markRedraw();\n\n updateBlend(seriesModel, chartView);\n updateSeriesElementSelection(seriesModel);\n });\n scheduler.unfinished = unfinished || scheduler.unfinished;\n lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); // transition after label is layouted.\n\n lifecycle.trigger('series:transition', ecModel, api, updateParams);\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states.\n\n updateZ(seriesModel, chartView); // NOTE: Update states after label is updated.\n // label should be in normal status when layouting.\n\n updateStates(seriesModel, chartView);\n }); // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel);\n lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\n };\n\n markStatusToUpdate = function (ecIns) {\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame.\n\n ecIns.getZr().wakeUp();\n };\n\n applyChangedStates = function (ecIns) {\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n return;\n }\n\n ecIns.getZr().storage.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n applyElementStates(el);\n });\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n };\n\n function applyElementStates(el) {\n var newStates = [];\n var oldStates = el.currentStates; // Keep other states.\n\n for (var i = 0; i < oldStates.length; i++) {\n var stateName = oldStates[i];\n\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n newStates.push(stateName);\n }\n } // Only use states when it's exists.\n\n\n if (el.selected && el.states.select) {\n newStates.push('select');\n }\n\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n newStates.push('emphasis');\n } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n newStates.push('blur');\n }\n\n el.useStates(newStates);\n }\n\n function updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n if (!el.isGroup) {\n elCount++;\n }\n });\n\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.__alive) {\n chartView.eachRendered(function (el) {\n if (el.states.emphasis) {\n el.states.emphasis.hoverLayer = true;\n }\n });\n }\n });\n }\n }\n\n ;\n /**\r\n * Update chart and blend.\r\n */\n\n function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n chartView.eachRendered(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DON'T mark the element dirty. In case element is incremental and don't want to rerender.\n el.style.blend = blendMode;\n }\n });\n }\n\n ;\n\n function updateZ(model, view) {\n if (model.preventAutoZ) {\n return;\n }\n\n var z = model.get('z') || 0;\n var zlevel = model.get('zlevel') || 0; // Set z and zlevel\n\n view.eachRendered(function (el) {\n doUpdateZ(el, z, zlevel, -Infinity); // Don't traverse the children because it has been traversed in _updateZ.\n\n return true;\n });\n }\n\n ;\n\n function doUpdateZ(el, z, zlevel, maxZ2) {\n // Group may also have textContent\n var label = el.getTextContent();\n var labelLine = el.getTextGuideLine();\n var isGroup = el.isGroup;\n\n if (isGroup) {\n // set z & zlevel of children elements of Group\n var children = el.childrenRef();\n\n for (var i = 0; i < children.length; i++) {\n maxZ2 = Math.max(doUpdateZ(children[i], z, zlevel, maxZ2), maxZ2);\n }\n } else {\n // not Group\n el.z = z;\n el.zlevel = zlevel;\n maxZ2 = Math.max(el.z2, maxZ2);\n } // always set z and zlevel if label/labelLine exists\n\n\n if (label) {\n label.z = z;\n label.zlevel = zlevel; // lift z2 of text content\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\n\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n }\n\n if (labelLine) {\n var textGuideLineConfig = el.textGuideLineConfig;\n labelLine.z = z;\n labelLine.zlevel = zlevel;\n isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n }\n\n return maxZ2;\n } // Clear states without animation.\n // TODO States on component.\n\n\n function clearStates(model, view) {\n view.eachRendered(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n } // TODO If el is incremental.\n\n\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }\n\n function updateStates(model, view) {\n var stateAnimationModel = model.getModel('stateAnimation');\n var enableAnimation = model.isAnimationEnabled();\n var duration = stateAnimationModel.get('duration');\n var stateTransition = duration > 0 ? {\n duration: duration,\n delay: stateAnimationModel.get('delay'),\n easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive')\n\n } : null;\n view.eachRendered(function (el) {\n if (el.states && el.states.emphasis) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n if (el instanceof graphic.Path) {\n savePathStates(el);\n } // Only updated on changed element. In case element is incremental and don't want to rerender.\n // TODO, a more proper way?\n\n\n if (el.__dirty) {\n var prevStates = el.prevStates; // Restore states without animation\n\n if (prevStates) {\n el.useStates(prevStates);\n }\n } // Update state transition and enable animation again.\n\n\n if (enableAnimation) {\n el.stateTransition = stateTransition;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label?\n\n if (textContent) {\n textContent.stateTransition = stateTransition;\n }\n\n if (textGuide) {\n textGuide.stateTransition = stateTransition;\n }\n } // Use highlighted and selected flag to toggle states.\n\n\n if (el.__dirty) {\n applyElementStates(el);\n }\n }\n });\n }\n\n ;\n\n createExtensionAPI = function (ecIns) {\n return new (\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n class_1.prototype.getCoordinateSystems = function () {\n return ecIns._coordSysMgr.getCoordinateSystems();\n };\n\n class_1.prototype.getComponentByElement = function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n\n if (modelInfo != null) {\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n\n el = el.parent;\n }\n };\n\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n enterEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n leaveEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterBlur = function (el) {\n enterBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveBlur = function (el) {\n leaveBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterSelect = function (el) {\n enterSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveSelect = function (el) {\n leaveSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.getModel = function () {\n return ecIns.getModel();\n };\n\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\n return ecIns.getViewOfComponentModel(componentModel);\n };\n\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n return ecIns.getViewOfSeriesModel(seriesModel);\n };\n\n return class_1;\n }(ExtensionAPI))(ecIns);\n };\n\n enableConnect = function (chart) {\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[CONNECT_STATUS_KEY] = status;\n }\n }\n\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n\n var action_1 = chart.makeActionFromEvent(event);\n var otherCharts_1 = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts_1.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n each(otherCharts_1, function (otherChart) {\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n otherChart.dispatchAction(action_1);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n }\n });\n });\n };\n }();\n\n return ECharts;\n}(Eventful);\n\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\r\n * @deprecated\r\n */\n// @ts-ignore\n\nechartsProto.one = function (eventName, cb, ctx) {\n var self = this;\n deprecateLog('ECharts#one is deprecated.');\n\n function wrapped() {\n var args2 = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args2[_i] = arguments[_i];\n }\n\n cb && cb.apply && cb.apply(this, args2); // @ts-ignore\n\n self.off(eventName, wrapped);\n }\n\n ; // @ts-ignore\n\n this.on.call(this, eventName, wrapped, ctx);\n};\n\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\n\nfunction disposedWarning(id) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Instance ' + id + ' has been disposed');\n }\n}\n\nvar actions = {};\n/**\r\n * Map eventType to actionType\r\n */\n\nvar eventActionMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\r\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\r\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\r\n * @param opts.width Use clientWidth of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.height Use clientHeight of the input `dom` by default.\r\n * Can be 'auto' (the same as null/undefined)\r\n * @param opts.locale Specify the locale.\r\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\r\n */\n\nexport function init(dom, theme, opts) {\n var isClient = !(opts && opts.ssr);\n\n if (isClient) {\n if (process.env.NODE_ENV !== 'production') {\n if (!dom) {\n throw new Error('Initialize failed: invalid dom.');\n }\n }\n\n var existInstance = getInstanceByDom(dom);\n\n if (existInstance) {\n if (process.env.NODE_ENV !== 'production') {\n warn('There is a chart instance already initialized on the dom.');\n }\n\n return existInstance;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n }\n }\n }\n\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n isClient && modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n lifecycle.trigger('afterinit', chart);\n return chart;\n}\n/**\r\n * @usage\r\n * (A)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * chart1.group = 'xxx';\r\n * chart2.group = 'xxx';\r\n * echarts.connect('xxx');\r\n * ```\r\n * (B)\r\n * ```js\r\n * let chart1 = echarts.init(dom1);\r\n * let chart2 = echarts.init(dom2);\r\n * echarts.connect('xxx', [chart1, chart2]);\r\n * ```\r\n */\n\nexport function connect(groupId) {\n // Is array of charts\n if (isArray(groupId)) {\n var charts = groupId;\n groupId = null; // If any chart has group\n\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n\n connectedGroups[groupId] = true;\n return groupId;\n}\nexport function disconnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\r\n * Alias and backward compatibility\r\n * @deprecated\r\n */\n\nexport var disConnect = disconnect;\n/**\r\n * Dispose a chart instance\r\n */\n\nexport function dispose(chart) {\n if (isString(chart)) {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\nexport function getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n return instances[key];\n}\n/**\r\n * Register theme\r\n */\n\nexport function registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\r\n * Register option preprocessor\r\n */\n\nexport function registerPreprocessor(preprocessorFunc) {\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n }\n}\nexport function registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\r\n * Register postIniter\r\n * @param {Function} postInitFunc\r\n */\n\nexport function registerPostInit(postInitFunc) {\n registerUpdateLifecycle('afterinit', postInitFunc);\n}\n/**\r\n * Register postUpdater\r\n * @param {Function} postUpdateFunc\r\n */\n\nexport function registerPostUpdate(postUpdateFunc) {\n registerUpdateLifecycle('afterupdate', postUpdateFunc);\n}\nexport function registerUpdateLifecycle(name, cb) {\n lifecycle.on(name, cb);\n}\nexport function registerAction(actionInfo, eventName, action) {\n if (isFunction(eventName)) {\n action = eventName;\n eventName = '';\n }\n\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0]; // Event name is all lowercase\n\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event;\n\n if (eventActionMap[eventName]) {\n // Already registered.\n return;\n } // Validate action type and event name.\n\n\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n\n eventActionMap[eventName] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\r\n * Get dimensions of specified coordinate system.\r\n * @param {string} type\r\n * @return {Array.}\r\n */\n\nexport function getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\nexport { registerLocale } from './locale.js';\n\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\n\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\n\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\n\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(priority) || priority == null) {\n throw new Error('Illegal priority');\n } // Check duplicate\n\n\n each(targetList, function (wrap) {\n assert(wrap.__raw !== fn);\n });\n } // Already registered\n\n\n if (indexOf(registeredTasks, fn) >= 0) {\n return;\n }\n\n registeredTasks.push(fn);\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n}\n\nexport function registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\r\n * ZRender need a canvas context to do measureText.\r\n * But in node environment canvas may be created by node-canvas.\r\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\r\n *\r\n *\r\n * @deprecated use setPlatformAPI({ createCanvas }) instead.\r\n *\r\n * @example\r\n * let Canvas = require('canvas');\r\n * let echarts = require('echarts');\r\n * echarts.setCanvasCreator(function () {\r\n * // Small size is enough.\r\n * return new Canvas(32, 32);\r\n * });\r\n */\n\nexport function setCanvasCreator(creator) {\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead.');\n }\n\n setPlatformAPI({\n createCanvas: creator\n });\n}\n/**\r\n * The parameters and usage: see `geoSourceManager.registerMap`.\r\n * Compatible with previous `echarts.registerMap`.\r\n */\n\nexport function registerMap(mapName, geoJson, specialAreas) {\n var registerMap = getImpl('registerMap');\n registerMap && registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n var getMap = getImpl('getMap');\n return getMap && getMap(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\r\n * Globa dispatchAction to a specified chart instance.\r\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) {\n// if (!payload || !payload.chartId) {\n// // Must have chartId to find chart\n// return;\n// }\n// const chart = instances[payload.chartId];\n// if (chart) {\n// chart.dispatchAction(payload, opt);\n// }\n// }\n// Builtin global visual\n\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault); // Default actions\n\nregisterAction({\n type: HIGHLIGHT_ACTION_TYPE,\n event: HIGHLIGHT_ACTION_TYPE,\n update: HIGHLIGHT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: DOWNPLAY_ACTION_TYPE,\n event: DOWNPLAY_ACTION_TYPE,\n update: DOWNPLAY_ACTION_TYPE\n}, noop);\nregisterAction({\n type: SELECT_ACTION_TYPE,\n event: SELECT_ACTION_TYPE,\n update: SELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: UNSELECT_ACTION_TYPE,\n event: UNSELECT_ACTION_TYPE,\n update: UNSELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: TOGGLE_SELECT_ACTION_TYPE,\n event: TOGGLE_SELECT_ACTION_TYPE,\n update: TOGGLE_SELECT_ACTION_TYPE\n}, noop); // Default theme\n\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\n\nexport var dataTool = {};","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { registerPreprocessor, registerProcessor, registerPostInit, registerPostUpdate, registerAction, registerCoordinateSystem, registerLayout, registerVisual, registerTransform, registerLoading, registerMap, registerUpdateLifecycle, PRIORITY } from './core/echarts.js';\nimport ComponentView from './view/Component.js';\nimport ChartView from './view/Chart.js';\nimport ComponentModel from './model/Component.js';\nimport SeriesModel from './model/Series.js';\nimport { isFunction, indexOf, isArray, each } from 'zrender/lib/core/util.js';\nimport { registerImpl } from './core/impl.js';\nimport { registerPainter } from 'zrender/lib/zrender.js';\nvar extensions = [];\nvar extensionRegisters = {\n registerPreprocessor: registerPreprocessor,\n registerProcessor: registerProcessor,\n registerPostInit: registerPostInit,\n registerPostUpdate: registerPostUpdate,\n registerUpdateLifecycle: registerUpdateLifecycle,\n registerAction: registerAction,\n registerCoordinateSystem: registerCoordinateSystem,\n registerLayout: registerLayout,\n registerVisual: registerVisual,\n registerTransform: registerTransform,\n registerLoading: registerLoading,\n registerMap: registerMap,\n registerImpl: registerImpl,\n PRIORITY: PRIORITY,\n ComponentModel: ComponentModel,\n ComponentView: ComponentView,\n SeriesModel: SeriesModel,\n ChartView: ChartView,\n // TODO Use ComponentModel and SeriesModel instead of Constructor\n registerComponentModel: function (ComponentModelClass) {\n ComponentModel.registerClass(ComponentModelClass);\n },\n registerComponentView: function (ComponentViewClass) {\n ComponentView.registerClass(ComponentViewClass);\n },\n registerSeriesModel: function (SeriesModelClass) {\n SeriesModel.registerClass(SeriesModelClass);\n },\n registerChartView: function (ChartViewClass) {\n ChartView.registerClass(ChartViewClass);\n },\n registerSubTypeDefaulter: function (componentType, defaulter) {\n ComponentModel.registerSubTypeDefaulter(componentType, defaulter);\n },\n registerPainter: function (painterType, PainterCtor) {\n registerPainter(painterType, PainterCtor);\n }\n};\nexport function use(ext) {\n if (isArray(ext)) {\n // use([ChartLine, ChartBar]);\n each(ext, function (singleExt) {\n use(singleExt);\n });\n return;\n }\n\n if (indexOf(extensions, ext) >= 0) {\n return;\n }\n\n extensions.push(ext);\n\n if (isFunction(ext)) {\n ext = {\n install: ext\n };\n }\n\n ext.install(extensionRegisters);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { Point, Path, Polyline } from '../util/graphic.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nimport { cubicProjectPoint, quadraticProjectPoint } from 'zrender/lib/core/curve.js';\nimport { defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport { DISPLAY_STATES, SPECIAL_STATES } from '../util/states.js';\nvar PI2 = Math.PI * 2;\nvar CMD = PathProxy.CMD;\nvar DEFAULT_SEARCH_SPACE = ['top', 'right', 'bottom', 'left'];\n\nfunction getCandidateAnchor(pos, distance, rect, outPt, outDir) {\n var width = rect.width;\n var height = rect.height;\n\n switch (pos) {\n case 'top':\n outPt.set(rect.x + width / 2, rect.y - distance);\n outDir.set(0, -1);\n break;\n\n case 'bottom':\n outPt.set(rect.x + width / 2, rect.y + height + distance);\n outDir.set(0, 1);\n break;\n\n case 'left':\n outPt.set(rect.x - distance, rect.y + height / 2);\n outDir.set(-1, 0);\n break;\n\n case 'right':\n outPt.set(rect.x + width + distance, rect.y + height / 2);\n outDir.set(1, 0);\n break;\n }\n}\n\nfunction projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y, out) {\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n x /= d;\n y /= d; // Intersect point.\n\n var ox = x * r + cx;\n var oy = y * r + cy;\n\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n out[0] = ox;\n out[1] = oy;\n return d - r;\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 if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n // Project point is on the arc.\n out[0] = ox;\n out[1] = oy;\n return d - r;\n }\n\n var x1 = r * Math.cos(startAngle) + cx;\n var y1 = r * Math.sin(startAngle) + cy;\n var x2 = r * Math.cos(endAngle) + cx;\n var y2 = r * Math.sin(endAngle) + cy;\n var d1 = (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);\n var d2 = (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\n\n if (d1 < d2) {\n out[0] = x1;\n out[1] = y1;\n return Math.sqrt(d1);\n } else {\n out[0] = x2;\n out[1] = y2;\n return Math.sqrt(d2);\n }\n}\n\nfunction projectPointToLine(x1, y1, x2, y2, x, y, out, limitToEnds) {\n var dx = x - x1;\n var dy = y - y1;\n var dx1 = x2 - x1;\n var dy1 = y2 - y1;\n var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n dx1 /= lineLen;\n dy1 /= lineLen; // dot product\n\n var projectedLen = dx * dx1 + dy * dy1;\n var t = projectedLen / lineLen;\n\n if (limitToEnds) {\n t = Math.min(Math.max(t, 0), 1);\n }\n\n t *= lineLen;\n var ox = out[0] = x1 + t * dx1;\n var oy = out[1] = y1 + t * dy1;\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nfunction projectPointToRect(x1, y1, width, height, x, y, out) {\n if (width < 0) {\n x1 = x1 + width;\n width = -width;\n }\n\n if (height < 0) {\n y1 = y1 + height;\n height = -height;\n }\n\n var x2 = x1 + width;\n var y2 = y1 + height;\n var ox = out[0] = Math.min(Math.max(x, x1), x2);\n var oy = out[1] = Math.min(Math.max(y, y1), y2);\n return Math.sqrt((ox - x) * (ox - x) + (oy - y) * (oy - y));\n}\n\nvar tmpPt = [];\n\nfunction nearestPointOnRect(pt, rect, out) {\n var dist = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt.x, pt.y, tmpPt);\n out.set(tmpPt[0], tmpPt[1]);\n return dist;\n}\n/**\r\n * Calculate min distance corresponding point.\r\n * This method won't evaluate if point is in the path.\r\n */\n\n\nfunction nearestPointOnPath(pt, path, out) {\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n var x1;\n var y1;\n var minDist = Infinity;\n var data = path.data;\n var x = pt.x;\n var y = pt.y;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n\n if (i === 1) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n var d = minDist;\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 d = projectPointToLine(xi, yi, data[i], data[i + 1], x, y, tmpPt, true);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n d = cubicProjectPoint(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n d = quadraticProjectPoint(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y, tmpPt);\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 x1 = Math.cos(theta) * rx + cx;\n y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令\n\n if (i <= 1) {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n\n\n var _x = (x - cx) * ry / rx + cx;\n\n d = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);\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 d = projectPointToRect(x0, y0, width, height, x, y, tmpPt);\n break;\n\n case CMD.Z:\n d = projectPointToLine(xi, yi, x0, y0, x, y, tmpPt, true);\n xi = x0;\n yi = y0;\n break;\n }\n\n if (d < minDist) {\n minDist = d;\n out.set(tmpPt[0], tmpPt[1]);\n }\n }\n\n return minDist;\n} // Temporal variable for intermediate usage.\n\n\nvar pt0 = new Point();\nvar pt1 = new Point();\nvar pt2 = new Point();\nvar dir = new Point();\nvar dir2 = new Point();\n/**\r\n * Calculate a proper guide line based on the label position and graphic element definition\r\n * @param label\r\n * @param labelRect\r\n * @param target\r\n * @param targetRect\r\n */\n\nexport function updateLabelLinePoints(target, labelLineModel) {\n if (!target) {\n return;\n }\n\n var labelLine = target.getTextGuideLine();\n var label = target.getTextContent(); // Needs to create text guide in each charts.\n\n if (!(label && labelLine)) {\n return;\n }\n\n var labelGuideConfig = target.textGuideLineConfig || {};\n var points = [[0, 0], [0, 0], [0, 0]];\n var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;\n var labelRect = label.getBoundingRect().clone();\n labelRect.applyTransform(label.getComputedTransform());\n var minDist = Infinity;\n var anchorPoint = labelGuideConfig.anchor;\n var targetTransform = target.getComputedTransform();\n var targetInversedTransform = targetTransform && invert([], targetTransform);\n var len = labelLineModel.get('length2') || 0;\n\n if (anchorPoint) {\n pt2.copy(anchorPoint);\n }\n\n for (var i = 0; i < searchSpace.length; i++) {\n var candidate = searchSpace[i];\n getCandidateAnchor(candidate, 0, labelRect, pt0, dir);\n Point.scaleAndAdd(pt1, pt0, dir, len); // Transform to target coord space.\n\n pt1.transform(targetInversedTransform); // Note: getBoundingRect will ensure the `path` being created.\n\n var boundingRect = target.getBoundingRect();\n var dist = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2); // TODO pt2 is in the path\n\n if (dist < minDist) {\n minDist = dist; // Transform back to global space.\n\n pt1.transform(targetTransform);\n pt2.transform(targetTransform);\n pt2.toArray(points[0]);\n pt1.toArray(points[1]);\n pt0.toArray(points[2]);\n }\n }\n\n limitTurnAngle(points, labelLineModel.get('minTurnAngle'));\n labelLine.setShape({\n points: points\n });\n} // Temporal variable for the limitTurnAngle function\n\nvar tmpArr = [];\nvar tmpProjPoint = new Point();\n/**\r\n * Reduce the line segment attached to the label to limit the turn angle between two segments.\r\n * @param linePoints\r\n * @param minTurnAngle Radian of minimum turn angle. 0 - 180\r\n */\n\nexport function limitTurnAngle(linePoints, minTurnAngle) {\n if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {\n return;\n }\n\n minTurnAngle = minTurnAngle / 180 * Math.PI; // The line points can be\n // /pt1----pt2 (label)\n // /\n // pt0/\n\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt0, pt1);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(dir2);\n var minTurnAngleCos = Math.cos(minTurnAngle);\n\n if (minTurnAngleCos < angleCos) {\n // Smaller than minTurnAngle\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr); // Calculate new projected length with limited minTurnAngle and get the new connect point\n\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI - minTurnAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n/**\r\n * Limit the angle of line and the surface\r\n * @param maxSurfaceAngle Radian of minimum turn angle. 0 - 180. 0 is same direction to normal. 180 is opposite\r\n */\n\nexport function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {\n if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {\n return;\n }\n\n maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;\n pt0.fromArray(linePoints[0]);\n pt1.fromArray(linePoints[1]);\n pt2.fromArray(linePoints[2]);\n Point.sub(dir, pt1, pt0);\n Point.sub(dir2, pt2, pt1);\n var len1 = dir.len();\n var len2 = dir2.len();\n\n if (len1 < 1e-3 || len2 < 1e-3) {\n return;\n }\n\n dir.scale(1 / len1);\n dir2.scale(1 / len2);\n var angleCos = dir.dot(surfaceNormal);\n var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);\n\n if (angleCos < maxSurfaceAngleCos) {\n // Calculate project point of pt0 on pt1-pt2\n var d = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);\n tmpProjPoint.fromArray(tmpArr);\n var HALF_PI = Math.PI / 2;\n var angle2 = Math.acos(dir2.dot(surfaceNormal));\n var newAngle = HALF_PI + angle2 - maxSurfaceAngle;\n\n if (newAngle >= HALF_PI) {\n // parallel\n Point.copy(tmpProjPoint, pt2);\n } else {\n // Calculate new projected length with limited minTurnAngle and get the new connect point\n tmpProjPoint.scaleAndAdd(dir2, d / Math.tan(Math.PI / 2 - newAngle)); // Limit the new calculated connect point between pt1 and pt2.\n\n var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);\n\n if (isNaN(t)) {\n return;\n }\n\n if (t < 0) {\n Point.copy(tmpProjPoint, pt1);\n } else if (t > 1) {\n Point.copy(tmpProjPoint, pt2);\n }\n }\n\n tmpProjPoint.toArray(linePoints[1]);\n }\n}\n\nfunction setLabelLineState(labelLine, ignore, stateName, stateModel) {\n var isNormal = stateName === 'normal';\n var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName); // Make sure display.\n\n stateObj.ignore = ignore; // Set smooth\n\n var smooth = stateModel.get('smooth');\n\n if (smooth && smooth === true) {\n smooth = 0.3;\n }\n\n stateObj.shape = stateObj.shape || {};\n\n if (smooth > 0) {\n stateObj.shape.smooth = smooth;\n }\n\n var styleObj = stateModel.getModel('lineStyle').getLineStyle();\n isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;\n}\n\nfunction buildLabelLinePath(path, shape) {\n var smooth = shape.smooth;\n var points = shape.points;\n\n if (!points) {\n return;\n }\n\n path.moveTo(points[0][0], points[0][1]);\n\n if (smooth > 0 && points.length >= 3) {\n var len1 = vector.dist(points[0], points[1]);\n var len2 = vector.dist(points[1], points[2]);\n\n if (!len1 || !len2) {\n path.lineTo(points[1][0], points[1][1]);\n path.lineTo(points[2][0], points[2][1]);\n return;\n }\n\n var moveLen = Math.min(len1, len2) * smooth;\n var midPoint0 = vector.lerp([], points[1], points[0], moveLen / len1);\n var midPoint2 = vector.lerp([], points[1], points[2], moveLen / len2);\n var midPoint1 = vector.lerp([], midPoint0, midPoint2, 0.5);\n path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);\n path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points[2][0], points[2][1]);\n } else {\n for (var i = 1; i < points.length; i++) {\n path.lineTo(points[i][0], points[i][1]);\n }\n }\n}\n/**\r\n * Create a label line if necessary and set it's style.\r\n */\n\n\nexport function setLabelLineStyle(targetEl, statesModels, defaultStyle) {\n var labelLine = targetEl.getTextGuideLine();\n var label = targetEl.getTextContent();\n\n if (!label) {\n // Not show label line if there is no label.\n if (labelLine) {\n targetEl.removeTextGuideLine();\n }\n\n return;\n }\n\n var normalModel = statesModels.normal;\n var showNormal = normalModel.get('show');\n var labelIgnoreNormal = label.ignore;\n\n for (var i = 0; i < DISPLAY_STATES.length; i++) {\n var stateName = DISPLAY_STATES[i];\n var stateModel = statesModels[stateName];\n var isNormal = stateName === 'normal';\n\n if (stateModel) {\n var stateShow = stateModel.get('show');\n var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);\n\n if (isLabelIgnored // Not show when label is not shown in this state.\n || !retrieve2(stateShow, showNormal) // Use normal state by default if not set.\n ) {\n var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName];\n\n if (stateObj) {\n stateObj.ignore = true;\n }\n\n continue;\n } // Create labelLine if not exists\n\n\n if (!labelLine) {\n labelLine = new Polyline();\n targetEl.setTextGuideLine(labelLine); // Reset state of normal because it's new created.\n // NOTE: NORMAL should always been the first!\n\n if (!isNormal && (labelIgnoreNormal || !showNormal)) {\n setLabelLineState(labelLine, true, 'normal', statesModels.normal);\n } // Use same state proxy.\n\n\n if (targetEl.stateProxy) {\n labelLine.stateProxy = targetEl.stateProxy;\n }\n }\n\n setLabelLineState(labelLine, false, stateName, stateModel);\n }\n }\n\n if (labelLine) {\n defaults(labelLine.style, defaultStyle); // Not fill.\n\n labelLine.style.fill = null;\n var showAbove = normalModel.get('showAbove');\n var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};\n labelLineConfig.showAbove = showAbove || false; // Custom the buildPath.\n\n labelLine.buildPath = buildLabelLinePath;\n }\n}\nexport function getLabelLineStatesModels(itemModel, labelLineName) {\n labelLineName = labelLineName || 'labelLine';\n var statesModels = {\n normal: itemModel.getModel(labelLineName)\n };\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);\n }\n\n return statesModels;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { BoundingRect, OrientedBoundingRect } from '../util/graphic.js';\nexport function prepareLayoutList(input) {\n var list = [];\n\n for (var i = 0; i < input.length; i++) {\n var rawItem = input[i];\n\n if (rawItem.defaultAttr.ignore) {\n continue;\n }\n\n var label = rawItem.label;\n var transform = label.getComputedTransform(); // NOTE: Get bounding rect after getComputedTransform, or label may not been updated by the host el.\n\n var localRect = label.getBoundingRect();\n var isAxisAligned = !transform || transform[1] < 1e-5 && transform[2] < 1e-5;\n var minMargin = label.style.margin || 0;\n var globalRect = localRect.clone();\n globalRect.applyTransform(transform);\n globalRect.x -= minMargin / 2;\n globalRect.y -= minMargin / 2;\n globalRect.width += minMargin;\n globalRect.height += minMargin;\n var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform) : null;\n list.push({\n label: label,\n labelLine: rawItem.labelLine,\n rect: globalRect,\n localRect: localRect,\n obb: obb,\n priority: rawItem.priority,\n defaultAttr: rawItem.defaultAttr,\n layoutOption: rawItem.computedLayoutOption,\n axisAligned: isAxisAligned,\n transform: transform\n });\n }\n\n return list;\n}\n\nfunction shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {\n var len = list.length;\n\n if (len < 2) {\n return;\n }\n\n list.sort(function (a, b) {\n return a.rect[xyDim] - b.rect[xyDim];\n });\n var lastPos = 0;\n var delta;\n var adjusted = false;\n var shifts = [];\n var totalShifts = 0;\n\n for (var i = 0; i < len; i++) {\n var item = list[i];\n var rect = item.rect;\n delta = rect[xyDim] - lastPos;\n\n if (delta < 0) {\n // shiftForward(i, len, -delta);\n rect[xyDim] -= delta;\n item.label[xyDim] -= delta;\n adjusted = true;\n }\n\n var shift = Math.max(-delta, 0);\n shifts.push(shift);\n totalShifts += shift;\n lastPos = rect[xyDim] + rect[sizeDim];\n }\n\n if (totalShifts > 0 && balanceShift) {\n // Shift back to make the distribution more equally.\n shiftList(-totalShifts / len, 0, len);\n } // TODO bleedMargin?\n\n\n var first = list[0];\n var last = list[len - 1];\n var minGap;\n var maxGap;\n updateMinMaxGap(); // If ends exceed two bounds, squeeze at most 80%, then take the gap of two bounds.\n\n minGap < 0 && squeezeGaps(-minGap, 0.8);\n maxGap < 0 && squeezeGaps(maxGap, 0.8);\n updateMinMaxGap();\n takeBoundsGap(minGap, maxGap, 1);\n takeBoundsGap(maxGap, minGap, -1); // Handle bailout when there is not enough space.\n\n updateMinMaxGap();\n\n if (minGap < 0) {\n squeezeWhenBailout(-minGap);\n }\n\n if (maxGap < 0) {\n squeezeWhenBailout(maxGap);\n }\n\n function updateMinMaxGap() {\n minGap = first.rect[xyDim] - minBound;\n maxGap = maxBound - last.rect[xyDim] - last.rect[sizeDim];\n }\n\n function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {\n if (gapThisBound < 0) {\n // Move from other gap if can.\n var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);\n\n if (moveFromMaxGap > 0) {\n shiftList(moveFromMaxGap * moveDir, 0, len);\n var remained = moveFromMaxGap + gapThisBound;\n\n if (remained < 0) {\n squeezeGaps(-remained * moveDir, 1);\n }\n } else {\n squeezeGaps(-gapThisBound * moveDir, 1);\n }\n }\n }\n\n function shiftList(delta, start, end) {\n if (delta !== 0) {\n adjusted = true;\n }\n\n for (var i = start; i < end; i++) {\n var item = list[i];\n var rect = item.rect;\n rect[xyDim] += delta;\n item.label[xyDim] += delta;\n }\n } // Squeeze gaps if the labels exceed margin.\n\n\n function squeezeGaps(delta, maxSqeezePercent) {\n var gaps = [];\n var totalGaps = 0;\n\n for (var i = 1; i < len; i++) {\n var prevItemRect = list[i - 1].rect;\n var gap = Math.max(list[i].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);\n gaps.push(gap);\n totalGaps += gap;\n }\n\n if (!totalGaps) {\n return;\n }\n\n var squeezePercent = Math.min(Math.abs(delta) / totalGaps, maxSqeezePercent);\n\n if (delta > 0) {\n for (var i = 0; i < len - 1; i++) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i] * squeezePercent; // Forward\n\n shiftList(movement, 0, i + 1);\n }\n } else {\n // Backward\n for (var i = len - 1; i > 0; i--) {\n // Distribute the shift delta to all gaps.\n var movement = gaps[i - 1] * squeezePercent;\n shiftList(-movement, i, len);\n }\n }\n }\n /**\r\n * Squeeze to allow overlap if there is no more space available.\r\n * Let other overlapping strategy like hideOverlap do the job instead of keep exceeding the bounds.\r\n */\n\n\n function squeezeWhenBailout(delta) {\n var dir = delta < 0 ? -1 : 1;\n delta = Math.abs(delta);\n var moveForEachLabel = Math.ceil(delta / (len - 1));\n\n for (var i = 0; i < len - 1; i++) {\n if (dir > 0) {\n // Forward\n shiftList(moveForEachLabel, 0, i + 1);\n } else {\n // Backward\n shiftList(-moveForEachLabel, len - i - 1, len);\n }\n\n delta -= moveForEachLabel;\n\n if (delta <= 0) {\n return;\n }\n }\n }\n\n return adjusted;\n}\n/**\r\n * Adjust labels on x direction to avoid overlap.\r\n */\n\n\nexport function shiftLayoutOnX(list, leftBound, rightBound, // If average the shifts on all labels and add them to 0\n// TODO: Not sure if should enable it.\n// Pros: The angle of lines will distribute more equally\n// Cons: In some layout. It may not what user wanted. like in pie. the label of last sector is usually changed unexpectedly.\nbalanceShift) {\n return shiftLayout(list, 'x', 'width', leftBound, rightBound, balanceShift);\n}\n/**\r\n * Adjust labels on y direction to avoid overlap.\r\n */\n\nexport function shiftLayoutOnY(list, topBound, bottomBound, // If average the shifts on all labels and add them to 0\nbalanceShift) {\n return shiftLayout(list, 'y', 'height', topBound, bottomBound, balanceShift);\n}\nexport function hideOverlap(labelList) {\n var displayedLabels = []; // TODO, render overflow visible first, put in the displayedLabels.\n\n labelList.sort(function (a, b) {\n return b.priority - a.priority;\n });\n var globalRect = new BoundingRect(0, 0, 0, 0);\n\n function hideEl(el) {\n if (!el.ignore) {\n // Show on emphasis.\n var emphasisState = el.ensureState('emphasis');\n\n if (emphasisState.ignore == null) {\n emphasisState.ignore = false;\n }\n }\n\n el.ignore = true;\n }\n\n for (var i = 0; i < labelList.length; i++) {\n var labelItem = labelList[i];\n var isAxisAligned = labelItem.axisAligned;\n var localRect = labelItem.localRect;\n var transform = labelItem.transform;\n var label = labelItem.label;\n var labelLine = labelItem.labelLine;\n globalRect.copy(labelItem.rect); // Add a threshold because layout may be aligned precisely.\n\n globalRect.width -= 0.1;\n globalRect.height -= 0.1;\n globalRect.x += 0.05;\n globalRect.y += 0.05;\n var obb = labelItem.obb;\n var overlapped = false;\n\n for (var j = 0; j < displayedLabels.length; j++) {\n var existsTextCfg = displayedLabels[j]; // Fast rejection.\n\n if (!globalRect.intersect(existsTextCfg.rect)) {\n continue;\n }\n\n if (isAxisAligned && existsTextCfg.axisAligned) {\n // Is overlapped\n overlapped = true;\n break;\n }\n\n if (!existsTextCfg.obb) {\n // If self is not axis aligned. But other is.\n existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);\n }\n\n if (!obb) {\n // If self is axis aligned. But other is not.\n obb = new OrientedBoundingRect(localRect, transform);\n }\n\n if (obb.intersect(existsTextCfg.obb)) {\n overlapped = true;\n break;\n }\n } // TODO Callback to determine if this overlap should be handled?\n\n\n if (overlapped) {\n hideEl(label);\n labelLine && hideEl(labelLine);\n } else {\n label.attr('ignore', labelItem.defaultAttr.ignore);\n labelLine && labelLine.attr('ignore', labelItem.defaultAttr.labelGuideIgnore);\n displayedLabels.push(labelItem);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO: move labels out of viewport.\nimport { BoundingRect, updateProps, initProps, isElementRemoved } from '../util/graphic.js';\nimport { getECData } from '../util/innerStore.js';\nimport { parsePercent } from '../util/number.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { updateLabelLinePoints, setLabelLineStyle, getLabelLineStatesModels } from './labelGuideHelper.js';\nimport { makeInner } from '../util/model.js';\nimport { retrieve2, each, keys, isFunction, filter, indexOf } from 'zrender/lib/core/util.js';\nimport { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper.js';\nimport { labelInner, animateLabelValue } from './labelStyle.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\n\nfunction cloneArr(points) {\n if (points) {\n var newPoints = [];\n\n for (var i = 0; i < points.length; i++) {\n newPoints.push(points[i].slice());\n }\n\n return newPoints;\n }\n}\n\nfunction prepareLayoutCallbackParams(labelItem, hostEl) {\n var label = labelItem.label;\n var labelLine = hostEl && hostEl.getTextGuideLine();\n return {\n dataIndex: labelItem.dataIndex,\n dataType: labelItem.dataType,\n seriesIndex: labelItem.seriesModel.seriesIndex,\n text: labelItem.label.style.text,\n rect: labelItem.hostRect,\n labelRect: labelItem.rect,\n // x: labelAttr.x,\n // y: labelAttr.y,\n align: label.style.align,\n verticalAlign: label.style.verticalAlign,\n labelLinePoints: cloneArr(labelLine && labelLine.shape.points)\n };\n}\n\nvar LABEL_OPTION_TO_STYLE_KEYS = ['align', 'verticalAlign', 'width', 'height', 'fontSize'];\nvar dummyTransformable = new Transformable();\nvar labelLayoutInnerStore = makeInner();\nvar labelLineAnimationStore = makeInner();\n\nfunction extendWithKeys(target, source, keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (source[key] != null) {\n target[key] = source[key];\n }\n }\n}\n\nvar LABEL_LAYOUT_PROPS = ['x', 'y', 'rotation'];\n\nvar LabelManager =\n/** @class */\nfunction () {\n function LabelManager() {\n this._labelList = [];\n this._chartViewList = [];\n }\n\n LabelManager.prototype.clearLabels = function () {\n this._labelList = [];\n this._chartViewList = [];\n };\n /**\r\n * Add label to manager\r\n */\n\n\n LabelManager.prototype._addLabel = function (dataIndex, dataType, seriesModel, label, layoutOption) {\n var labelStyle = label.style;\n var hostEl = label.__hostTarget;\n var textConfig = hostEl.textConfig || {}; // TODO: If label is in other state.\n\n var labelTransform = label.getComputedTransform();\n var labelRect = label.getBoundingRect().plain();\n BoundingRect.applyTransform(labelRect, labelRect, labelTransform);\n\n if (labelTransform) {\n dummyTransformable.setLocalTransform(labelTransform);\n } else {\n // Identity transform.\n dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;\n dummyTransformable.scaleX = dummyTransformable.scaleY = 1;\n }\n\n dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);\n var host = label.__hostTarget;\n var hostRect;\n\n if (host) {\n hostRect = host.getBoundingRect().plain();\n var transform = host.getComputedTransform();\n BoundingRect.applyTransform(hostRect, hostRect, transform);\n }\n\n var labelGuide = hostRect && host.getTextGuideLine();\n\n this._labelList.push({\n label: label,\n labelLine: labelGuide,\n seriesModel: seriesModel,\n dataIndex: dataIndex,\n dataType: dataType,\n layoutOption: layoutOption,\n computedLayoutOption: null,\n rect: labelRect,\n hostRect: hostRect,\n // Label with lower priority will be hidden when overlapped\n // Use rect size as default priority\n priority: hostRect ? hostRect.width * hostRect.height : 0,\n // Save default label attributes.\n // For restore if developers want get back to default value in callback.\n defaultAttr: {\n ignore: label.ignore,\n labelGuideIgnore: labelGuide && labelGuide.ignore,\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY,\n rotation: dummyTransformable.rotation,\n style: {\n x: labelStyle.x,\n y: labelStyle.y,\n align: labelStyle.align,\n verticalAlign: labelStyle.verticalAlign,\n width: labelStyle.width,\n height: labelStyle.height,\n fontSize: labelStyle.fontSize\n },\n cursor: label.cursor,\n attachedPos: textConfig.position,\n attachedRot: textConfig.rotation\n }\n });\n };\n\n LabelManager.prototype.addLabelsOfSeries = function (chartView) {\n var _this = this;\n\n this._chartViewList.push(chartView);\n\n var seriesModel = chartView.__model;\n var layoutOption = seriesModel.get('labelLayout');\n /**\r\n * Ignore layouting if it's not specified anything.\r\n */\n\n if (!(isFunction(layoutOption) || keys(layoutOption).length)) {\n return;\n }\n\n chartView.group.traverse(function (child) {\n if (child.ignore) {\n return true; // Stop traverse descendants.\n } // Only support label being hosted on graphic elements.\n\n\n var textEl = child.getTextContent();\n var ecData = getECData(child); // Can only attach the text on the element with dataIndex\n\n if (textEl && !textEl.disableLabelLayout) {\n _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);\n }\n });\n };\n\n LabelManager.prototype.updateLayoutConfig = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n\n function createDragHandler(el, labelLineModel) {\n return function () {\n updateLabelLinePoints(el, labelLineModel);\n };\n }\n\n for (var i = 0; i < this._labelList.length; i++) {\n var labelItem = this._labelList[i];\n var label = labelItem.label;\n var hostEl = label.__hostTarget;\n var defaultLabelAttr = labelItem.defaultAttr;\n var layoutOption = void 0; // TODO A global layout option?\n\n if (isFunction(labelItem.layoutOption)) {\n layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));\n } else {\n layoutOption = labelItem.layoutOption;\n }\n\n layoutOption = layoutOption || {};\n labelItem.computedLayoutOption = layoutOption;\n var degreeToRadian = Math.PI / 180; // TODO hostEl should always exists.\n // Or label should not have parent because the x, y is all in global space.\n\n if (hostEl) {\n hostEl.setTextConfig({\n // Force to set local false.\n local: false,\n // Ignore position and rotation config on the host el if x or y is changed.\n position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,\n // Ignore rotation config on the host el if rotation is changed.\n rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,\n offset: [layoutOption.dx || 0, layoutOption.dy || 0]\n });\n }\n\n var needsUpdateLabelLine = false;\n\n if (layoutOption.x != null) {\n // TODO width of chart view.\n label.x = parsePercent(layoutOption.x, width);\n label.setStyle('x', 0); // Ignore movement in style. TODO: origin.\n\n needsUpdateLabelLine = true;\n } else {\n label.x = defaultLabelAttr.x;\n label.setStyle('x', defaultLabelAttr.style.x);\n }\n\n if (layoutOption.y != null) {\n // TODO height of chart view.\n label.y = parsePercent(layoutOption.y, height);\n label.setStyle('y', 0); // Ignore movement in style.\n\n needsUpdateLabelLine = true;\n } else {\n label.y = defaultLabelAttr.y;\n label.setStyle('y', defaultLabelAttr.style.y);\n }\n\n if (layoutOption.labelLinePoints) {\n var guideLine = hostEl.getTextGuideLine();\n\n if (guideLine) {\n guideLine.setShape({\n points: layoutOption.labelLinePoints\n }); // Not update\n\n needsUpdateLabelLine = false;\n }\n }\n\n var labelLayoutStore = labelLayoutInnerStore(label);\n labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;\n label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;\n label.scaleX = defaultLabelAttr.scaleX;\n label.scaleY = defaultLabelAttr.scaleY;\n\n for (var k = 0; k < LABEL_OPTION_TO_STYLE_KEYS.length; k++) {\n var key = LABEL_OPTION_TO_STYLE_KEYS[k];\n label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);\n }\n\n if (layoutOption.draggable) {\n label.draggable = true;\n label.cursor = 'move';\n\n if (hostEl) {\n var hostModel = labelItem.seriesModel;\n\n if (labelItem.dataIndex != null) {\n var data = labelItem.seriesModel.getData(labelItem.dataType);\n hostModel = data.getItemModel(labelItem.dataIndex);\n }\n\n label.on('drag', createDragHandler(hostEl, hostModel.getModel('labelLine')));\n }\n } else {\n // TODO Other drag functions?\n label.off('drag');\n label.cursor = defaultLabelAttr.cursor;\n }\n }\n };\n\n LabelManager.prototype.layout = function (api) {\n var width = api.getWidth();\n var height = api.getHeight();\n var labelList = prepareLayoutList(this._labelList);\n var labelsNeedsAdjustOnX = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftX';\n });\n var labelsNeedsAdjustOnY = filter(labelList, function (item) {\n return item.layoutOption.moveOverlap === 'shiftY';\n });\n shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);\n shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);\n var labelsNeedsHideOverlap = filter(labelList, function (item) {\n return item.layoutOption.hideOverlap;\n });\n hideOverlap(labelsNeedsHideOverlap);\n };\n /**\r\n * Process all labels. Not only labels with layoutOption.\r\n */\n\n\n LabelManager.prototype.processLabelsOverall = function () {\n var _this = this;\n\n each(this._chartViewList, function (chartView) {\n var seriesModel = chartView.__model;\n var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;\n var animationEnabled = seriesModel.isAnimationEnabled();\n chartView.group.traverse(function (child) {\n if (child.ignore && !child.forceLabelAnimation) {\n return true; // Stop traverse descendants.\n }\n\n var needsUpdateLabelLine = !ignoreLabelLineUpdate;\n var label = child.getTextContent();\n\n if (!needsUpdateLabelLine && label) {\n needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;\n }\n\n if (needsUpdateLabelLine) {\n _this._updateLabelLine(child, seriesModel);\n }\n\n if (animationEnabled) {\n _this._animateLabels(child, seriesModel);\n }\n });\n });\n };\n\n LabelManager.prototype._updateLabelLine = function (el, seriesModel) {\n // Only support label being hosted on graphic elements.\n var textEl = el.getTextContent(); // Update label line style.\n\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex; // Only support labelLine on the labels represent data.\n\n if (textEl && dataIndex != null) {\n var data = seriesModel.getData(ecData.dataType);\n var itemModel = data.getItemModel(dataIndex);\n var defaultStyle = {};\n var visualStyle = data.getItemVisual(dataIndex, 'style');\n\n if (visualStyle) {\n var visualType = data.getVisual('drawType'); // Default to be same with main color\n\n defaultStyle.stroke = visualStyle[visualType];\n }\n\n var labelLineModel = itemModel.getModel('labelLine');\n setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);\n updateLabelLinePoints(el, labelLineModel);\n }\n };\n\n LabelManager.prototype._animateLabels = function (el, seriesModel) {\n var textEl = el.getTextContent();\n var guideLine = el.getTextGuideLine(); // Animate\n\n if (textEl // `forceLabelAnimation` has the highest priority\n && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) {\n var layoutStore = labelLayoutInnerStore(textEl);\n var oldLayout = layoutStore.oldLayout;\n var ecData = getECData(el);\n var dataIndex = ecData.dataIndex;\n var newProps = {\n x: textEl.x,\n y: textEl.y,\n rotation: textEl.rotation\n };\n var data = seriesModel.getData(ecData.dataType);\n\n if (!oldLayout) {\n textEl.attr(newProps); // Disable fade in animation if value animation is enabled.\n\n if (!labelInner(textEl).valueAnimation) {\n var oldOpacity = retrieve2(textEl.style.opacity, 1); // Fade in animation\n\n textEl.style.opacity = 0;\n initProps(textEl, {\n style: {\n opacity: oldOpacity\n }\n }, seriesModel, dataIndex);\n }\n } else {\n textEl.attr(oldLayout); // Make sure the animation from is in the right status.\n\n var prevStates = el.prevStates;\n\n if (prevStates) {\n if (indexOf(prevStates, 'select') >= 0) {\n textEl.attr(layoutStore.oldLayoutSelect);\n }\n\n if (indexOf(prevStates, 'emphasis') >= 0) {\n textEl.attr(layoutStore.oldLayoutEmphasis);\n }\n }\n\n updateProps(textEl, newProps, seriesModel, dataIndex);\n }\n\n layoutStore.oldLayout = newProps;\n\n if (textEl.states.select) {\n var layoutSelect = layoutStore.oldLayoutSelect = {};\n extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);\n }\n\n if (textEl.states.emphasis) {\n var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};\n extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);\n extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);\n }\n\n animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);\n }\n\n if (guideLine && !guideLine.ignore && !guideLine.invisible) {\n var layoutStore = labelLineAnimationStore(guideLine);\n var oldLayout = layoutStore.oldLayout;\n var newLayout = {\n points: guideLine.shape.points\n };\n\n if (!oldLayout) {\n guideLine.setShape(newLayout);\n guideLine.style.strokePercent = 0;\n initProps(guideLine, {\n style: {\n strokePercent: 1\n }\n }, seriesModel);\n } else {\n guideLine.attr({\n shape: oldLayout\n });\n updateProps(guideLine, {\n shape: newLayout\n }, seriesModel);\n }\n\n layoutStore.oldLayout = newLayout;\n }\n };\n\n return LabelManager;\n}();\n\nexport default LabelManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../util/model.js';\nimport LabelManager from './LabelManager.js';\nvar getLabelManager = makeInner();\nexport function installLabelLayout(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var labelManager = getLabelManager(api).labelManager;\n\n if (!labelManager) {\n labelManager = getLabelManager(api).labelManager = new LabelManager();\n }\n\n labelManager.clearLabels();\n });\n registers.registerUpdateLifecycle('series:layoutlabels', function (ecModel, api, params) {\n var labelManager = getLabelManager(api).labelManager;\n params.updatedSeries.forEach(function (series) {\n labelManager.addLabelsOfSeries(api.getViewOfSeriesModel(series));\n });\n labelManager.updateLayoutConfig(api);\n labelManager.layout(api);\n labelManager.processLabelsOverall();\n });\n}","import { __extends } from \"tslib\";\nimport * as util from '../core/util.js';\nimport { devicePixelRatio } from '../config.js';\nimport Eventful from '../core/Eventful.js';\nimport { getCanvasGradient } from './helper.js';\nimport { createCanvasPattern } from './graphic.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { platformApi } from '../core/platform.js';\nfunction createDom(id, painter, dpr) {\n var newDom = platformApi.createCanvas();\n var width = painter.getWidth();\n var height = painter.getHeight();\n var newDomStyle = newDom.style;\n if (newDomStyle) {\n newDomStyle.position = 'absolute';\n newDomStyle.left = '0';\n newDomStyle.top = '0';\n newDomStyle.width = width + 'px';\n newDomStyle.height = height + 'px';\n newDom.setAttribute('data-zr-dom-id', id);\n }\n newDom.width = width * dpr;\n newDom.height = height * dpr;\n return newDom;\n}\n;\nvar Layer = (function (_super) {\n __extends(Layer, _super);\n function Layer(id, painter, dpr) {\n var _this = _super.call(this) || this;\n _this.motionBlur = false;\n _this.lastFrameAlpha = 0.7;\n _this.dpr = 1;\n _this.virtual = false;\n _this.config = {};\n _this.incremental = false;\n _this.zlevel = 0;\n _this.maxRepaintRectCount = 5;\n _this.__dirty = true;\n _this.__firstTimePaint = true;\n _this.__used = false;\n _this.__drawIndex = 0;\n _this.__startIndex = 0;\n _this.__endIndex = 0;\n _this.__prevStartIndex = null;\n _this.__prevEndIndex = null;\n var dom;\n dpr = dpr || devicePixelRatio;\n if (typeof id === 'string') {\n dom = createDom(id, painter, dpr);\n }\n else if (util.isObject(id)) {\n dom = id;\n id = dom.id;\n }\n _this.id = id;\n _this.dom = dom;\n var domStyle = dom.style;\n if (domStyle) {\n util.disableUserSelect(dom);\n dom.onselectstart = function () { return false; };\n domStyle.padding = '0';\n domStyle.margin = '0';\n domStyle.borderWidth = '0';\n }\n _this.painter = painter;\n _this.dpr = dpr;\n return _this;\n }\n Layer.prototype.getElementCount = function () {\n return this.__endIndex - this.__startIndex;\n };\n Layer.prototype.afterBrush = function () {\n this.__prevStartIndex = this.__startIndex;\n this.__prevEndIndex = this.__endIndex;\n };\n Layer.prototype.initContext = function () {\n this.ctx = this.dom.getContext('2d');\n this.ctx.dpr = this.dpr;\n };\n Layer.prototype.setUnpainted = function () {\n this.__firstTimePaint = true;\n };\n Layer.prototype.createBackBuffer = function () {\n var dpr = this.dpr;\n this.domBack = createDom('back-' + this.id, this.painter, dpr);\n this.ctxBack = this.domBack.getContext('2d');\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n };\n Layer.prototype.createRepaintRects = function (displayList, prevList, viewWidth, viewHeight) {\n if (this.__firstTimePaint) {\n this.__firstTimePaint = false;\n return null;\n }\n var mergedRepaintRects = [];\n var maxRepaintRectCount = this.maxRepaintRectCount;\n var full = false;\n var pendingRect = new BoundingRect(0, 0, 0, 0);\n function addRectToMergePool(rect) {\n if (!rect.isFinite() || rect.isZero()) {\n return;\n }\n if (mergedRepaintRects.length === 0) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n else {\n var isMerged = false;\n var minDeltaArea = Infinity;\n var bestRectToMergeIdx = 0;\n for (var i = 0; i < mergedRepaintRects.length; ++i) {\n var mergedRect = mergedRepaintRects[i];\n if (mergedRect.intersect(rect)) {\n var pendingRect_1 = new BoundingRect(0, 0, 0, 0);\n pendingRect_1.copy(mergedRect);\n pendingRect_1.union(rect);\n mergedRepaintRects[i] = pendingRect_1;\n isMerged = true;\n break;\n }\n else if (full) {\n pendingRect.copy(rect);\n pendingRect.union(mergedRect);\n var aArea = rect.width * rect.height;\n var bArea = mergedRect.width * mergedRect.height;\n var pendingArea = pendingRect.width * pendingRect.height;\n var deltaArea = pendingArea - aArea - bArea;\n if (deltaArea < minDeltaArea) {\n minDeltaArea = deltaArea;\n bestRectToMergeIdx = i;\n }\n }\n }\n if (full) {\n mergedRepaintRects[bestRectToMergeIdx].union(rect);\n isMerged = true;\n }\n if (!isMerged) {\n var boundingRect = new BoundingRect(0, 0, 0, 0);\n boundingRect.copy(rect);\n mergedRepaintRects.push(boundingRect);\n }\n if (!full) {\n full = mergedRepaintRects.length >= maxRepaintRectCount;\n }\n }\n }\n for (var i = this.__startIndex; i < this.__endIndex; ++i) {\n var el = displayList[i];\n if (el) {\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n var prevRect = el.__isRendered && ((el.__dirty & REDRAW_BIT) || !shouldPaint)\n ? el.getPrevPaintRect()\n : null;\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n var curRect = shouldPaint && ((el.__dirty & REDRAW_BIT) || !el.__isRendered)\n ? el.getPaintRect()\n : null;\n if (curRect) {\n addRectToMergePool(curRect);\n }\n }\n }\n for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {\n var el = prevList[i];\n var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);\n if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {\n var prevRect = el.getPrevPaintRect();\n if (prevRect) {\n addRectToMergePool(prevRect);\n }\n }\n }\n var hasIntersections;\n do {\n hasIntersections = false;\n for (var i = 0; i < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].isZero()) {\n mergedRepaintRects.splice(i, 1);\n continue;\n }\n for (var j = i + 1; j < mergedRepaintRects.length;) {\n if (mergedRepaintRects[i].intersect(mergedRepaintRects[j])) {\n hasIntersections = true;\n mergedRepaintRects[i].union(mergedRepaintRects[j]);\n mergedRepaintRects.splice(j, 1);\n }\n else {\n j++;\n }\n }\n i++;\n }\n } while (hasIntersections);\n this._paintRects = mergedRepaintRects;\n return mergedRepaintRects;\n };\n Layer.prototype.debugGetPaintRects = function () {\n return (this._paintRects || []).slice();\n };\n Layer.prototype.resize = function (width, height) {\n var dpr = this.dpr;\n var dom = this.dom;\n var domStyle = dom.style;\n var domBack = this.domBack;\n if (domStyle) {\n domStyle.width = width + 'px';\n domStyle.height = height + 'px';\n }\n dom.width = width * dpr;\n dom.height = height * dpr;\n if (domBack) {\n domBack.width = width * dpr;\n domBack.height = height * dpr;\n if (dpr !== 1) {\n this.ctxBack.scale(dpr, dpr);\n }\n }\n };\n Layer.prototype.clear = function (clearAll, clearColor, repaintRects) {\n var dom = this.dom;\n var ctx = this.ctx;\n var width = dom.width;\n var height = dom.height;\n clearColor = clearColor || this.clearColor;\n var haveMotionBLur = this.motionBlur && !clearAll;\n var lastFrameAlpha = this.lastFrameAlpha;\n var dpr = this.dpr;\n var self = this;\n if (haveMotionBLur) {\n if (!this.domBack) {\n this.createBackBuffer();\n }\n this.ctxBack.globalCompositeOperation = 'copy';\n this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr);\n }\n var domBack = this.domBack;\n function doClear(x, y, width, height) {\n ctx.clearRect(x, y, width, height);\n if (clearColor && clearColor !== 'transparent') {\n var clearColorGradientOrPattern = void 0;\n if (util.isGradientObject(clearColor)) {\n var shouldCache = clearColor.global || (clearColor.__width === width\n && clearColor.__height === height);\n clearColorGradientOrPattern = shouldCache\n && clearColor.__canvasGradient\n || getCanvasGradient(ctx, clearColor, {\n x: 0,\n y: 0,\n width: width,\n height: height\n });\n clearColor.__canvasGradient = clearColorGradientOrPattern;\n clearColor.__width = width;\n clearColor.__height = height;\n }\n else if (util.isImagePatternObject(clearColor)) {\n clearColor.scaleX = clearColor.scaleX || dpr;\n clearColor.scaleY = clearColor.scaleY || dpr;\n clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {\n dirty: function () {\n self.setUnpainted();\n self.__painter.refresh();\n }\n });\n }\n ctx.save();\n ctx.fillStyle = clearColorGradientOrPattern || clearColor;\n ctx.fillRect(x, y, width, height);\n ctx.restore();\n }\n if (haveMotionBLur) {\n ctx.save();\n ctx.globalAlpha = lastFrameAlpha;\n ctx.drawImage(domBack, x, y, width, height);\n ctx.restore();\n }\n }\n ;\n if (!repaintRects || haveMotionBLur) {\n doClear(0, 0, width, height);\n }\n else if (repaintRects.length) {\n util.each(repaintRects, function (rect) {\n doClear(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n });\n }\n };\n return Layer;\n}(Eventful));\nexport default Layer;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Core API from echarts/src/echarts\nexport * from '../core/echarts.js';\nexport * from './api.js';\nimport { use } from '../extension.js'; // Import label layout by default.\n// TODO will be treeshaked.\n\nimport { installLabelLayout } from '../label/installLabelLayout.js';\nuse(installLabelLayout);","import { devicePixelRatio } from '../config.js';\nimport * as util from '../core/util.js';\nimport Layer from './Layer.js';\nimport requestAnimationFrame from '../animation/requestAnimationFrame.js';\nimport env from '../core/env.js';\nimport { brush, brushSingle } from './graphic.js';\nimport { REDRAW_BIT } from '../graphic/constants.js';\nimport { getSize } from './helper.js';\nvar HOVER_LAYER_ZLEVEL = 1e5;\nvar CANVAS_ZLEVEL = 314159;\nvar EL_AFTER_INCREMENTAL_INC = 0.01;\nvar INCREMENTAL_INC = 0.001;\nfunction isLayerValid(layer) {\n if (!layer) {\n return false;\n }\n if (layer.__builtin__) {\n return true;\n }\n if (typeof (layer.resize) !== 'function'\n || typeof (layer.refresh) !== 'function') {\n return false;\n }\n return true;\n}\nfunction createRoot(width, height) {\n var domRoot = document.createElement('div');\n domRoot.style.cssText = [\n 'position:relative',\n 'width:' + width + 'px',\n 'height:' + height + 'px',\n 'padding:0',\n 'margin:0',\n 'border-width:0'\n ].join(';') + ';';\n return domRoot;\n}\nvar CanvasPainter = (function () {\n function CanvasPainter(root, storage, opts, id) {\n this.type = 'canvas';\n this._zlevelList = [];\n this._prevDisplayList = [];\n this._layers = {};\n this._layerConfig = {};\n this._needsManuallyCompositing = false;\n this.type = 'canvas';\n var singleCanvas = !root.nodeName\n || root.nodeName.toUpperCase() === 'CANVAS';\n this._opts = opts = util.extend({}, opts || {});\n this.dpr = opts.devicePixelRatio || devicePixelRatio;\n this._singleCanvas = singleCanvas;\n this.root = root;\n var rootStyle = root.style;\n if (rootStyle) {\n util.disableUserSelect(root);\n root.innerHTML = '';\n }\n this.storage = storage;\n var zlevelList = this._zlevelList;\n this._prevDisplayList = [];\n var layers = this._layers;\n if (!singleCanvas) {\n this._width = getSize(root, 0, opts);\n this._height = getSize(root, 1, opts);\n var domRoot = this._domRoot = createRoot(this._width, this._height);\n root.appendChild(domRoot);\n }\n else {\n var rootCanvas = root;\n var width = rootCanvas.width;\n var height = rootCanvas.height;\n if (opts.width != null) {\n width = opts.width;\n }\n if (opts.height != null) {\n height = opts.height;\n }\n this.dpr = opts.devicePixelRatio || 1;\n rootCanvas.width = width * this.dpr;\n rootCanvas.height = height * this.dpr;\n this._width = width;\n this._height = height;\n var mainLayer = new Layer(rootCanvas, this, this.dpr);\n mainLayer.__builtin__ = true;\n mainLayer.initContext();\n layers[CANVAS_ZLEVEL] = mainLayer;\n mainLayer.zlevel = CANVAS_ZLEVEL;\n zlevelList.push(CANVAS_ZLEVEL);\n this._domRoot = root;\n }\n }\n CanvasPainter.prototype.getType = function () {\n return 'canvas';\n };\n CanvasPainter.prototype.isSingleCanvas = function () {\n return this._singleCanvas;\n };\n CanvasPainter.prototype.getViewportRoot = function () {\n return this._domRoot;\n };\n CanvasPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n CanvasPainter.prototype.refresh = function (paintAll) {\n var list = this.storage.getDisplayList(true);\n var prevList = this._prevDisplayList;\n var zlevelList = this._zlevelList;\n this._redrawId = Math.random();\n this._paintList(list, prevList, paintAll, this._redrawId);\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__ && layer.refresh) {\n var clearColor = i === 0 ? this._backgroundColor : null;\n layer.refresh(clearColor);\n }\n }\n if (this._opts.useDirtyRect) {\n this._prevDisplayList = list.slice();\n }\n return this;\n };\n CanvasPainter.prototype.refreshHover = function () {\n this._paintHoverList(this.storage.getDisplayList(false));\n };\n CanvasPainter.prototype._paintHoverList = function (list) {\n var len = list.length;\n var hoverLayer = this._hoverlayer;\n hoverLayer && hoverLayer.clear();\n if (!len) {\n return;\n }\n var scope = {\n inHover: true,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var ctx;\n for (var i = 0; i < len; i++) {\n var el = list[i];\n if (el.__inHover) {\n if (!hoverLayer) {\n hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);\n }\n if (!ctx) {\n ctx = hoverLayer.ctx;\n ctx.save();\n }\n brush(ctx, el, scope, i === len - 1);\n }\n }\n if (ctx) {\n ctx.restore();\n }\n };\n CanvasPainter.prototype.getHoverLayer = function () {\n return this.getLayer(HOVER_LAYER_ZLEVEL);\n };\n CanvasPainter.prototype.paintOne = function (ctx, el) {\n brushSingle(ctx, el);\n };\n CanvasPainter.prototype._paintList = function (list, prevList, paintAll, redrawId) {\n if (this._redrawId !== redrawId) {\n return;\n }\n paintAll = paintAll || false;\n this._updateLayerStatus(list);\n var _a = this._doPaintList(list, prevList, paintAll), finished = _a.finished, needsRefreshHover = _a.needsRefreshHover;\n if (this._needsManuallyCompositing) {\n this._compositeManually();\n }\n if (needsRefreshHover) {\n this._paintHoverList(list);\n }\n if (!finished) {\n var self_1 = this;\n requestAnimationFrame(function () {\n self_1._paintList(list, prevList, paintAll, redrawId);\n });\n }\n else {\n this.eachLayer(function (layer) {\n layer.afterBrush && layer.afterBrush();\n });\n }\n };\n CanvasPainter.prototype._compositeManually = function () {\n var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;\n var width = this._domRoot.width;\n var height = this._domRoot.height;\n ctx.clearRect(0, 0, width, height);\n this.eachBuiltinLayer(function (layer) {\n if (layer.virtual) {\n ctx.drawImage(layer.dom, 0, 0, width, height);\n }\n });\n };\n CanvasPainter.prototype._doPaintList = function (list, prevList, paintAll) {\n var _this = this;\n var layerList = [];\n var useDirtyRect = this._opts.useDirtyRect;\n for (var zi = 0; zi < this._zlevelList.length; zi++) {\n var zlevel = this._zlevelList[zi];\n var layer = this._layers[zlevel];\n if (layer.__builtin__\n && layer !== this._hoverlayer\n && (layer.__dirty || paintAll)) {\n layerList.push(layer);\n }\n }\n var finished = true;\n var needsRefreshHover = false;\n var _loop_1 = function (k) {\n var layer = layerList[k];\n var ctx = layer.ctx;\n var repaintRects = useDirtyRect\n && layer.createRepaintRects(list, prevList, this_1._width, this_1._height);\n var start = paintAll ? layer.__startIndex : layer.__drawIndex;\n var useTimer = !paintAll && layer.incremental && Date.now;\n var startTime = useTimer && Date.now();\n var clearColor = layer.zlevel === this_1._zlevelList[0]\n ? this_1._backgroundColor : null;\n if (layer.__startIndex === layer.__endIndex) {\n layer.clear(false, clearColor, repaintRects);\n }\n else if (start === layer.__startIndex) {\n var firstEl = list[start];\n if (!firstEl.incremental || !firstEl.notClear || paintAll) {\n layer.clear(false, clearColor, repaintRects);\n }\n }\n if (start === -1) {\n console.error('For some unknown reason. drawIndex is -1');\n start = layer.__startIndex;\n }\n var i;\n var repaint = function (repaintRect) {\n var scope = {\n inHover: false,\n allClipped: false,\n prevEl: null,\n viewWidth: _this._width,\n viewHeight: _this._height\n };\n for (i = start; i < layer.__endIndex; i++) {\n var el = list[i];\n if (el.__inHover) {\n needsRefreshHover = true;\n }\n _this._doPaintEl(el, layer, useDirtyRect, repaintRect, scope, i === layer.__endIndex - 1);\n if (useTimer) {\n var dTime = Date.now() - startTime;\n if (dTime > 15) {\n break;\n }\n }\n }\n if (scope.prevElClipPaths) {\n ctx.restore();\n }\n };\n if (repaintRects) {\n if (repaintRects.length === 0) {\n i = layer.__endIndex;\n }\n else {\n var dpr = this_1.dpr;\n for (var r = 0; r < repaintRects.length; ++r) {\n var rect = repaintRects[r];\n ctx.save();\n ctx.beginPath();\n ctx.rect(rect.x * dpr, rect.y * dpr, rect.width * dpr, rect.height * dpr);\n ctx.clip();\n repaint(rect);\n ctx.restore();\n }\n }\n }\n else {\n ctx.save();\n repaint();\n ctx.restore();\n }\n layer.__drawIndex = i;\n if (layer.__drawIndex < layer.__endIndex) {\n finished = false;\n }\n };\n var this_1 = this;\n for (var k = 0; k < layerList.length; k++) {\n _loop_1(k);\n }\n if (env.wxa) {\n util.each(this._layers, function (layer) {\n if (layer && layer.ctx && layer.ctx.draw) {\n layer.ctx.draw();\n }\n });\n }\n return {\n finished: finished,\n needsRefreshHover: needsRefreshHover\n };\n };\n CanvasPainter.prototype._doPaintEl = function (el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {\n var ctx = currentLayer.ctx;\n if (useDirtyRect) {\n var paintRect = el.getPaintRect();\n if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {\n brush(ctx, el, scope, isLast);\n el.setPrevPaintRect(paintRect);\n }\n }\n else {\n brush(ctx, el, scope, isLast);\n }\n };\n CanvasPainter.prototype.getLayer = function (zlevel, virtual) {\n if (this._singleCanvas && !this._needsManuallyCompositing) {\n zlevel = CANVAS_ZLEVEL;\n }\n var layer = this._layers[zlevel];\n if (!layer) {\n layer = new Layer('zr_' + zlevel, this, this.dpr);\n layer.zlevel = zlevel;\n layer.__builtin__ = true;\n if (this._layerConfig[zlevel]) {\n util.merge(layer, this._layerConfig[zlevel], true);\n }\n else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {\n util.merge(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);\n }\n if (virtual) {\n layer.virtual = virtual;\n }\n this.insertLayer(zlevel, layer);\n layer.initContext();\n }\n return layer;\n };\n CanvasPainter.prototype.insertLayer = function (zlevel, layer) {\n var layersMap = this._layers;\n var zlevelList = this._zlevelList;\n var len = zlevelList.length;\n var domRoot = this._domRoot;\n var prevLayer = null;\n var i = -1;\n if (layersMap[zlevel]) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('ZLevel ' + zlevel + ' has been used already');\n }\n return;\n }\n if (!isLayerValid(layer)) {\n if (process.env.NODE_ENV !== 'production') {\n util.logError('Layer of zlevel ' + zlevel + ' is not valid');\n }\n return;\n }\n if (len > 0 && zlevel > zlevelList[0]) {\n for (i = 0; i < len - 1; i++) {\n if (zlevelList[i] < zlevel\n && zlevelList[i + 1] > zlevel) {\n break;\n }\n }\n prevLayer = layersMap[zlevelList[i]];\n }\n zlevelList.splice(i + 1, 0, zlevel);\n layersMap[zlevel] = layer;\n if (!layer.virtual) {\n if (prevLayer) {\n var prevDom = prevLayer.dom;\n if (prevDom.nextSibling) {\n domRoot.insertBefore(layer.dom, prevDom.nextSibling);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n else {\n if (domRoot.firstChild) {\n domRoot.insertBefore(layer.dom, domRoot.firstChild);\n }\n else {\n domRoot.appendChild(layer.dom);\n }\n }\n }\n layer.__painter = this;\n };\n CanvasPainter.prototype.eachLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n cb.call(context, this._layers[z], z);\n }\n };\n CanvasPainter.prototype.eachBuiltinLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.eachOtherLayer = function (cb, context) {\n var zlevelList = this._zlevelList;\n for (var i = 0; i < zlevelList.length; i++) {\n var z = zlevelList[i];\n var layer = this._layers[z];\n if (!layer.__builtin__) {\n cb.call(context, layer, z);\n }\n }\n };\n CanvasPainter.prototype.getLayers = function () {\n return this._layers;\n };\n CanvasPainter.prototype._updateLayerStatus = function (list) {\n this.eachBuiltinLayer(function (layer, z) {\n layer.__dirty = layer.__used = false;\n });\n function updatePrevLayer(idx) {\n if (prevLayer) {\n if (prevLayer.__endIndex !== idx) {\n prevLayer.__dirty = true;\n }\n prevLayer.__endIndex = idx;\n }\n }\n if (this._singleCanvas) {\n for (var i_1 = 1; i_1 < list.length; i_1++) {\n var el = list[i_1];\n if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {\n this._needsManuallyCompositing = true;\n break;\n }\n }\n }\n var prevLayer = null;\n var incrementalLayerCount = 0;\n var prevZlevel;\n var i;\n for (i = 0; i < list.length; i++) {\n var el = list[i];\n var zlevel = el.zlevel;\n var layer = void 0;\n if (prevZlevel !== zlevel) {\n prevZlevel = zlevel;\n incrementalLayerCount = 0;\n }\n if (el.incremental) {\n layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);\n layer.incremental = true;\n incrementalLayerCount = 1;\n }\n else {\n layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);\n }\n if (!layer.__builtin__) {\n util.logError('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id);\n }\n if (layer !== prevLayer) {\n layer.__used = true;\n if (layer.__startIndex !== i) {\n layer.__dirty = true;\n }\n layer.__startIndex = i;\n if (!layer.incremental) {\n layer.__drawIndex = i;\n }\n else {\n layer.__drawIndex = -1;\n }\n updatePrevLayer(i);\n prevLayer = layer;\n }\n if ((el.__dirty & REDRAW_BIT) && !el.__inHover) {\n layer.__dirty = true;\n if (layer.incremental && layer.__drawIndex < 0) {\n layer.__drawIndex = i;\n }\n }\n }\n updatePrevLayer(i);\n this.eachBuiltinLayer(function (layer, z) {\n if (!layer.__used && layer.getElementCount() > 0) {\n layer.__dirty = true;\n layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0;\n }\n if (layer.__dirty && layer.__drawIndex < 0) {\n layer.__drawIndex = layer.__startIndex;\n }\n });\n };\n CanvasPainter.prototype.clear = function () {\n this.eachBuiltinLayer(this._clearLayer);\n return this;\n };\n CanvasPainter.prototype._clearLayer = function (layer) {\n layer.clear();\n };\n CanvasPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n util.each(this._layers, function (layer) {\n layer.setUnpainted();\n });\n };\n CanvasPainter.prototype.configLayer = function (zlevel, config) {\n if (config) {\n var layerConfig = this._layerConfig;\n if (!layerConfig[zlevel]) {\n layerConfig[zlevel] = config;\n }\n else {\n util.merge(layerConfig[zlevel], config, true);\n }\n for (var i = 0; i < this._zlevelList.length; i++) {\n var _zlevel = this._zlevelList[i];\n if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {\n var layer = this._layers[_zlevel];\n util.merge(layer, layerConfig[zlevel], true);\n }\n }\n }\n };\n CanvasPainter.prototype.delLayer = function (zlevel) {\n var layers = this._layers;\n var zlevelList = this._zlevelList;\n var layer = layers[zlevel];\n if (!layer) {\n return;\n }\n layer.dom.parentNode.removeChild(layer.dom);\n delete layers[zlevel];\n zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);\n };\n CanvasPainter.prototype.resize = function (width, height) {\n if (!this._domRoot.style) {\n if (width == null || height == null) {\n return;\n }\n this._width = width;\n this._height = height;\n this.getLayer(CANVAS_ZLEVEL).resize(width, height);\n }\n else {\n var domRoot = this._domRoot;\n domRoot.style.display = 'none';\n var opts = this._opts;\n var root = this.root;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n domRoot.style.display = '';\n if (this._width !== width || height !== this._height) {\n domRoot.style.width = width + 'px';\n domRoot.style.height = height + 'px';\n for (var id in this._layers) {\n if (this._layers.hasOwnProperty(id)) {\n this._layers[id].resize(width, height);\n }\n }\n this.refresh(true);\n }\n this._width = width;\n this._height = height;\n }\n return this;\n };\n CanvasPainter.prototype.clearLayer = function (zlevel) {\n var layer = this._layers[zlevel];\n if (layer) {\n layer.clear();\n }\n };\n CanvasPainter.prototype.dispose = function () {\n this.root.innerHTML = '';\n this.root =\n this.storage =\n this._domRoot =\n this._layers = null;\n };\n CanvasPainter.prototype.getRenderedCanvas = function (opts) {\n opts = opts || {};\n if (this._singleCanvas && !this._compositeManually) {\n return this._layers[CANVAS_ZLEVEL].dom;\n }\n var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);\n imageLayer.initContext();\n imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);\n var ctx = imageLayer.ctx;\n if (opts.pixelRatio <= this.dpr) {\n this.refresh();\n var width_1 = imageLayer.dom.width;\n var height_1 = imageLayer.dom.height;\n this.eachLayer(function (layer) {\n if (layer.__builtin__) {\n ctx.drawImage(layer.dom, 0, 0, width_1, height_1);\n }\n else if (layer.renderToCanvas) {\n ctx.save();\n layer.renderToCanvas(ctx);\n ctx.restore();\n }\n });\n }\n else {\n var scope = {\n inHover: false,\n viewWidth: this._width,\n viewHeight: this._height\n };\n var displayList = this.storage.getDisplayList(true);\n for (var i = 0, len = displayList.length; i < len; i++) {\n var el = displayList[i];\n brush(ctx, el, scope, i === len - 1);\n }\n }\n return imageLayer.dom;\n };\n CanvasPainter.prototype.getWidth = function () {\n return this._width;\n };\n CanvasPainter.prototype.getHeight = function () {\n return this._height;\n };\n return CanvasPainter;\n}());\nexport default CanvasPainter;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CanvasPainter from 'zrender/lib/canvas/Painter.js';\nexport function install(registers) {\n registers.registerPainter('canvas', CanvasPainter);\n}","import { isAroundZero } from './helper.js';\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\nvar PI2 = Math.PI * 2;\nvar degree = 180 / PI;\nvar SVGPathRebuilder = (function () {\n function SVGPathRebuilder() {\n }\n SVGPathRebuilder.prototype.reset = function (precision) {\n this._start = true;\n this._d = [];\n this._str = '';\n this._p = Math.pow(10, precision || 4);\n };\n SVGPathRebuilder.prototype.moveTo = function (x, y) {\n this._add('M', x, y);\n };\n SVGPathRebuilder.prototype.lineTo = function (x, y) {\n this._add('L', x, y);\n };\n SVGPathRebuilder.prototype.bezierCurveTo = function (x, y, x2, y2, x3, y3) {\n this._add('C', x, y, x2, y2, x3, y3);\n };\n SVGPathRebuilder.prototype.quadraticCurveTo = function (x, y, x2, y2) {\n this._add('Q', x, y, x2, y2);\n };\n SVGPathRebuilder.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);\n };\n SVGPathRebuilder.prototype.ellipse = function (cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {\n var dTheta = endAngle - startAngle;\n var clockwise = !anticlockwise;\n var dThetaPositive = Math.abs(dTheta);\n var isCircle = isAroundZero(dThetaPositive - PI2)\n || (clockwise ? dTheta >= PI2 : -dTheta >= PI2);\n var unifiedTheta = dTheta > 0 ? dTheta % PI2 : (dTheta % PI2 + PI2);\n var large = false;\n if (isCircle) {\n large = true;\n }\n else if (isAroundZero(dThetaPositive)) {\n large = false;\n }\n else {\n large = (unifiedTheta >= PI) === !!clockwise;\n }\n var x0 = cx + rx * mathCos(startAngle);\n var y0 = cy + ry * mathSin(startAngle);\n if (this._start) {\n this._add('M', x0, y0);\n }\n var xRot = Math.round(psi * degree);\n if (isCircle) {\n var p = 1 / this._p;\n var dTheta_1 = (clockwise ? 1 : -1) * (PI2 - p);\n this._add('A', rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));\n if (p > 1e-2) {\n this._add('A', rx, ry, xRot, 0, +clockwise, x0, y0);\n }\n }\n else {\n var x = cx + rx * mathCos(endAngle);\n var y = cy + ry * mathSin(endAngle);\n this._add('A', rx, ry, xRot, +large, +clockwise, x, y);\n }\n };\n SVGPathRebuilder.prototype.rect = function (x, y, w, h) {\n this._add('M', x, y);\n this._add('l', w, 0);\n this._add('l', 0, h);\n this._add('l', -w, 0);\n this._add('Z');\n };\n SVGPathRebuilder.prototype.closePath = function () {\n if (this._d.length > 0) {\n this._add('Z');\n }\n };\n SVGPathRebuilder.prototype._add = function (cmd, a, b, c, d, e, f, g, h) {\n var vals = [];\n var p = this._p;\n for (var i = 1; i < arguments.length; i++) {\n var val = arguments[i];\n if (isNaN(val)) {\n this._invalid = true;\n return;\n }\n vals.push(Math.round(val * p) / p);\n }\n this._d.push(cmd + vals.join(' '));\n this._start = cmd === 'Z';\n };\n SVGPathRebuilder.prototype.generateStr = function () {\n this._str = this._invalid ? '' : this._d.join('');\n this._d = [];\n };\n SVGPathRebuilder.prototype.getStr = function () {\n return this._str;\n };\n return SVGPathRebuilder;\n}());\nexport default SVGPathRebuilder;\n","import { DEFAULT_PATH_STYLE } from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineDash } from '../canvas/dashStyle.js';\nimport { map } from '../core/util.js';\nimport { normalizeColor } from './helper.js';\nvar NONE = 'none';\nvar mathRound = Math.round;\nfunction pathHasFill(style) {\n var fill = style.fill;\n return fill != null && fill !== NONE;\n}\nfunction pathHasStroke(style) {\n var stroke = style.stroke;\n return stroke != null && stroke !== NONE;\n}\nvar strokeProps = ['lineCap', 'miterLimit', 'lineJoin'];\nvar svgStrokeProps = map(strokeProps, function (prop) { return \"stroke-\" + prop.toLowerCase(); });\nexport default function mapStyleToAttrs(updateAttr, style, el, forceUpdate) {\n var opacity = style.opacity == null ? 1 : style.opacity;\n if (el instanceof ZRImage) {\n updateAttr('opacity', opacity);\n return;\n }\n if (pathHasFill(style)) {\n var fill = normalizeColor(style.fill);\n updateAttr('fill', fill.color);\n var fillOpacity = style.fillOpacity != null\n ? style.fillOpacity * fill.opacity * opacity\n : fill.opacity * opacity;\n if (forceUpdate || fillOpacity < 1) {\n updateAttr('fill-opacity', fillOpacity);\n }\n }\n else {\n updateAttr('fill', NONE);\n }\n if (pathHasStroke(style)) {\n var stroke = normalizeColor(style.stroke);\n updateAttr('stroke', stroke.color);\n var strokeScale = style.strokeNoScale\n ? el.getLineScale()\n : 1;\n var strokeWidth = (strokeScale ? (style.lineWidth || 0) / strokeScale : 0);\n var strokeOpacity = style.strokeOpacity != null\n ? style.strokeOpacity * stroke.opacity * opacity\n : stroke.opacity * opacity;\n var strokeFirst = style.strokeFirst;\n if (forceUpdate || strokeWidth !== 1) {\n updateAttr('stroke-width', strokeWidth);\n }\n if (forceUpdate || strokeFirst) {\n updateAttr('paint-order', strokeFirst ? 'stroke' : 'fill');\n }\n if (forceUpdate || strokeOpacity < 1) {\n updateAttr('stroke-opacity', strokeOpacity);\n }\n if (style.lineDash) {\n var _a = getLineDash(el), lineDash = _a[0], lineDashOffset = _a[1];\n if (lineDash) {\n lineDashOffset = mathRound(lineDashOffset || 0);\n updateAttr('stroke-dasharray', lineDash.join(','));\n if (lineDashOffset || forceUpdate) {\n updateAttr('stroke-dashoffset', lineDashOffset);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke-dasharray', NONE);\n }\n for (var i = 0; i < strokeProps.length; i++) {\n var propName = strokeProps[i];\n if (forceUpdate || style[propName] !== DEFAULT_PATH_STYLE[propName]) {\n var val = style[propName] || DEFAULT_PATH_STYLE[propName];\n val && updateAttr(svgStrokeProps[i], val);\n }\n }\n }\n else if (forceUpdate) {\n updateAttr('stroke', NONE);\n }\n}\n","import { keys, map } from '../core/util.js';\nimport { encodeHTML } from '../core/dom.js';\nexport var SVGNS = 'http://www.w3.org/2000/svg';\nexport var XLINKNS = 'http://www.w3.org/1999/xlink';\nexport var XMLNS = 'http://www.w3.org/2000/xmlns/';\nexport var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';\nexport function createElement(name) {\n return document.createElementNS(SVGNS, name);\n}\n;\nexport function createVNode(tag, key, attrs, children, text) {\n return {\n tag: tag,\n attrs: attrs || {},\n children: children,\n text: text,\n key: key\n };\n}\nfunction createElementOpen(name, attrs) {\n var attrsStr = [];\n if (attrs) {\n for (var key in attrs) {\n var val = attrs[key];\n var part = key;\n if (val === false) {\n continue;\n }\n else if (val !== true && val != null) {\n part += \"=\\\"\" + val + \"\\\"\";\n }\n attrsStr.push(part);\n }\n }\n return \"<\" + name + \" \" + attrsStr.join(' ') + \">\";\n}\nfunction createElementClose(name) {\n return \"\";\n}\nexport function vNodeToString(el, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n function convertElToString(el) {\n var children = el.children, tag = el.tag, attrs = el.attrs, text = el.text;\n return createElementOpen(tag, attrs)\n + (tag !== 'style' ? encodeHTML(text) : text || '')\n + (children ? \"\" + S + map(children, function (child) { return convertElToString(child); }).join(S) + S : '')\n + createElementClose(tag);\n }\n return convertElToString(el);\n}\nexport function getCssString(selectorNodes, animationNodes, opts) {\n opts = opts || {};\n var S = opts.newline ? '\\n' : '';\n var bracketBegin = \" {\" + S;\n var bracketEnd = S + \"}\";\n var selectors = map(keys(selectorNodes), function (className) {\n return className + bracketBegin + map(keys(selectorNodes[className]), function (attrName) {\n return attrName + \":\" + selectorNodes[className][attrName] + \";\";\n }).join(S) + bracketEnd;\n }).join(S);\n var animations = map(keys(animationNodes), function (animationName) {\n return \"@keyframes \" + animationName + bracketBegin + map(keys(animationNodes[animationName]), function (percent) {\n return percent + bracketBegin + map(keys(animationNodes[animationName][percent]), function (attrName) {\n var val = animationNodes[animationName][percent][attrName];\n if (attrName === 'd') {\n val = \"path(\\\"\" + val + \"\\\")\";\n }\n return attrName + \":\" + val + \";\";\n }).join(S) + bracketEnd;\n }).join(S) + bracketEnd;\n }).join(S);\n if (!selectors && !animations) {\n return '';\n }\n return [''].join(S);\n}\nexport function createBrushScope(zrId) {\n return {\n zrId: zrId,\n shadowCache: {},\n patternCache: {},\n gradientCache: {},\n clipPathCache: {},\n defs: {},\n cssNodes: {},\n cssAnims: {},\n cssClassIdx: 0,\n cssAnimIdx: 0,\n shadowIdx: 0,\n gradientIdx: 0,\n patternIdx: 0,\n clipPathIdx: 0\n };\n}\nexport function createSVGVNode(width, height, children, useViewBox) {\n return createVNode('svg', 'root', {\n 'width': width,\n 'height': height,\n 'xmlns': SVGNS,\n 'xmlns:xlink': XLINKNS,\n 'version': '1.1',\n 'baseProfile': 'full',\n 'viewBox': useViewBox ? \"0 0 \" + width + \" \" + height : false\n }, children);\n}\n","import { copyTransform } from '../core/Transformable.js';\nimport { createBrushScope } from './core.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport PathProxy from '../core/PathProxy.js';\nimport { getPathPrecision, getSRTTransformString } from './helper.js';\nimport { each, extend, filter, isNumber, isString, keys } from '../core/util.js';\nimport CompoundPath from '../graphic/CompoundPath.js';\nimport { createCubicEasingFunc } from '../animation/cubicEasing.js';\nexport var EASING_MAP = {\n cubicIn: '0.32,0,0.67,0',\n cubicOut: '0.33,1,0.68,1',\n cubicInOut: '0.65,0,0.35,1',\n quadraticIn: '0.11,0,0.5,0',\n quadraticOut: '0.5,1,0.89,1',\n quadraticInOut: '0.45,0,0.55,1',\n quarticIn: '0.5,0,0.75,0',\n quarticOut: '0.25,1,0.5,1',\n quarticInOut: '0.76,0,0.24,1',\n quinticIn: '0.64,0,0.78,0',\n quinticOut: '0.22,1,0.36,1',\n quinticInOut: '0.83,0,0.17,1',\n sinusoidalIn: '0.12,0,0.39,0',\n sinusoidalOut: '0.61,1,0.88,1',\n sinusoidalInOut: '0.37,0,0.63,1',\n exponentialIn: '0.7,0,0.84,0',\n exponentialOut: '0.16,1,0.3,1',\n exponentialInOut: '0.87,0,0.13,1',\n circularIn: '0.55,0,1,0.45',\n circularOut: '0,0.55,0.45,1',\n circularInOut: '0.85,0,0.15,1'\n};\nvar transformOriginKey = 'transform-origin';\nfunction buildPathString(el, kfShape, path) {\n var shape = extend({}, el.shape);\n extend(shape, kfShape);\n el.buildPath(path, shape);\n var svgPathBuilder = new SVGPathRebuilder();\n svgPathBuilder.reset(getPathPrecision(el));\n path.rebuildPath(svgPathBuilder, 1);\n svgPathBuilder.generateStr();\n return svgPathBuilder.getStr();\n}\nfunction setTransformOrigin(target, transform) {\n var originX = transform.originX, originY = transform.originY;\n if (originX || originY) {\n target[transformOriginKey] = originX + \"px \" + originY + \"px\";\n }\n}\nexport var ANIMATE_STYLE_MAP = {\n fill: 'fill',\n opacity: 'opacity',\n lineWidth: 'stroke-width',\n lineDashOffset: 'stroke-dashoffset'\n};\nfunction addAnimation(cssAnim, scope) {\n var animationName = scope.zrId + '-ani-' + scope.cssAnimIdx++;\n scope.cssAnims[animationName] = cssAnim;\n return animationName;\n}\nfunction createCompoundPathCSSAnimation(el, attrs, scope) {\n var paths = el.shape.paths;\n var composedAnim = {};\n var cssAnimationCfg;\n var cssAnimationName;\n each(paths, function (path) {\n var subScope = createBrushScope(scope.zrId);\n subScope.animation = true;\n createCSSAnimation(path, {}, subScope, true);\n var cssAnims = subScope.cssAnims;\n var cssNodes = subScope.cssNodes;\n var animNames = keys(cssAnims);\n var len = animNames.length;\n if (!len) {\n return;\n }\n cssAnimationName = animNames[len - 1];\n var lastAnim = cssAnims[cssAnimationName];\n for (var percent in lastAnim) {\n var kf = lastAnim[percent];\n composedAnim[percent] = composedAnim[percent] || { d: '' };\n composedAnim[percent].d += kf.d || '';\n }\n for (var className in cssNodes) {\n var val = cssNodes[className].animation;\n if (val.indexOf(cssAnimationName) >= 0) {\n cssAnimationCfg = val;\n }\n }\n });\n if (!cssAnimationCfg) {\n return;\n }\n attrs.d = false;\n var animationName = addAnimation(composedAnim, scope);\n return cssAnimationCfg.replace(cssAnimationName, animationName);\n}\nfunction getEasingFunc(easing) {\n return isString(easing)\n ? EASING_MAP[easing]\n ? \"cubic-bezier(\" + EASING_MAP[easing] + \")\"\n : createCubicEasingFunc(easing) ? easing : ''\n : '';\n}\nexport function createCSSAnimation(el, attrs, scope, onlyShape) {\n var animators = el.animators;\n var len = animators.length;\n var cssAnimations = [];\n if (el instanceof CompoundPath) {\n var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n else if (!len) {\n return;\n }\n }\n else if (!len) {\n return;\n }\n var groupAnimators = {};\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var cfgArr = [animator.getMaxTime() / 1000 + 's'];\n var easing = getEasingFunc(animator.getClip().easing);\n var delay = animator.getDelay();\n if (easing) {\n cfgArr.push(easing);\n }\n else {\n cfgArr.push('linear');\n }\n if (delay) {\n cfgArr.push(delay / 1000 + 's');\n }\n if (animator.getLoop()) {\n cfgArr.push('infinite');\n }\n var cfg = cfgArr.join(' ');\n groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []];\n groupAnimators[cfg][1].push(animator);\n }\n function createSingleCSSAnimation(groupAnimator) {\n var animators = groupAnimator[1];\n var len = animators.length;\n var transformKfs = {};\n var shapeKfs = {};\n var finalKfs = {};\n var animationTimingFunctionAttrName = 'animation-timing-function';\n function saveAnimatorTrackToCssKfs(animator, cssKfs, toCssAttrName) {\n var tracks = animator.getTracks();\n var maxTime = animator.getMaxTime();\n for (var k = 0; k < tracks.length; k++) {\n var track = tracks[k];\n if (track.needsAnimate()) {\n var kfs = track.keyframes;\n var attrName = track.propName;\n toCssAttrName && (attrName = toCssAttrName(attrName));\n if (attrName) {\n for (var i = 0; i < kfs.length; i++) {\n var kf = kfs[i];\n var percent = Math.round(kf.time / maxTime * 100) + '%';\n var kfEasing = getEasingFunc(kf.easing);\n var rawValue = kf.rawValue;\n if (isString(rawValue) || isNumber(rawValue)) {\n cssKfs[percent] = cssKfs[percent] || {};\n cssKfs[percent][attrName] = kf.rawValue;\n if (kfEasing) {\n cssKfs[percent][animationTimingFunctionAttrName] = kfEasing;\n }\n }\n }\n }\n }\n }\n }\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (!targetProp) {\n !onlyShape && saveAnimatorTrackToCssKfs(animator, transformKfs);\n }\n else if (targetProp === 'shape') {\n saveAnimatorTrackToCssKfs(animator, shapeKfs);\n }\n }\n for (var percent in transformKfs) {\n var transform = {};\n copyTransform(transform, el);\n extend(transform, transformKfs[percent]);\n var str = getSRTTransformString(transform);\n var timingFunction = transformKfs[percent][animationTimingFunctionAttrName];\n finalKfs[percent] = str ? {\n transform: str\n } : {};\n setTransformOrigin(finalKfs[percent], transform);\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n var path;\n var canAnimateShape = true;\n for (var percent in shapeKfs) {\n finalKfs[percent] = finalKfs[percent] || {};\n var isFirst = !path;\n var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];\n if (isFirst) {\n path = new PathProxy();\n }\n var len_1 = path.len();\n path.reset();\n finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path);\n var newLen = path.len();\n if (!isFirst && len_1 !== newLen) {\n canAnimateShape = false;\n break;\n }\n if (timingFunction) {\n finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;\n }\n }\n ;\n if (!canAnimateShape) {\n for (var percent in finalKfs) {\n delete finalKfs[percent].d;\n }\n }\n if (!onlyShape) {\n for (var i = 0; i < len; i++) {\n var animator = animators[i];\n var targetProp = animator.targetName;\n if (targetProp === 'style') {\n saveAnimatorTrackToCssKfs(animator, finalKfs, function (propName) { return ANIMATE_STYLE_MAP[propName]; });\n }\n }\n }\n var percents = keys(finalKfs);\n var allTransformOriginSame = true;\n var transformOrigin;\n for (var i = 1; i < percents.length; i++) {\n var p0 = percents[i - 1];\n var p1 = percents[i];\n if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {\n allTransformOriginSame = false;\n break;\n }\n transformOrigin = finalKfs[p0][transformOriginKey];\n }\n if (allTransformOriginSame && transformOrigin) {\n for (var percent in finalKfs) {\n if (finalKfs[percent][transformOriginKey]) {\n delete finalKfs[percent][transformOriginKey];\n }\n }\n attrs[transformOriginKey] = transformOrigin;\n }\n if (filter(percents, function (percent) { return keys(finalKfs[percent]).length > 0; }).length) {\n var animationName = addAnimation(finalKfs, scope);\n return animationName + \" \" + groupAnimator[0] + \" both\";\n }\n }\n for (var key in groupAnimators) {\n var animationCfg = createSingleCSSAnimation(groupAnimators[key]);\n if (animationCfg) {\n cssAnimations.push(animationCfg);\n }\n }\n if (cssAnimations.length) {\n var className = scope.zrId + '-cls-' + scope.cssClassIdx++;\n scope.cssNodes['.' + className] = {\n animation: cssAnimations.join(',')\n };\n attrs[\"class\"] = className;\n }\n}\n","import { adjustTextY, getIdURL, getMatrixStr, getPathPrecision, getShadowKey, getSRTTransformString, hasShadow, isAroundZero, isGradient, isImagePattern, isLinearGradient, isPattern, isRadialGradient, normalizeColor, round4, TEXT_ALIGN_TO_ANCHOR } from './helper.js';\nimport Path from '../graphic/Path.js';\nimport ZRImage from '../graphic/Image.js';\nimport { getLineHeight } from '../contain/text.js';\nimport TSpan from '../graphic/TSpan.js';\nimport SVGPathRebuilder from './SVGPathRebuilder.js';\nimport mapStyleToAttrs from './mapStyleToAttrs.js';\nimport { createVNode, vNodeToString } from './core.js';\nimport { assert, clone, isFunction, isString, logError, map, retrieve2 } from '../core/util.js';\nimport { createOrUpdateImage } from '../graphic/helper/image.js';\nimport { createCSSAnimation } from './cssAnimation.js';\nimport { hasSeparateFont, parseFontSize } from '../graphic/Text.js';\nimport { DEFAULT_FONT, DEFAULT_FONT_FAMILY } from '../core/platform.js';\nvar round = Math.round;\nfunction isImageLike(val) {\n return val && isString(val.src);\n}\nfunction isCanvasLike(val) {\n return val && isFunction(val.toDataURL);\n}\nfunction setStyleAttrs(attrs, style, el, scope) {\n mapStyleToAttrs(function (key, val) {\n var isFillStroke = key === 'fill' || key === 'stroke';\n if (isFillStroke && isGradient(val)) {\n setGradient(style, attrs, key, scope);\n }\n else if (isFillStroke && isPattern(val)) {\n setPattern(el, attrs, key, scope);\n }\n else {\n attrs[key] = val;\n }\n }, style, el, false);\n setShadow(el, attrs, scope);\n}\nfunction noRotateScale(m) {\n return isAroundZero(m[0] - 1)\n && isAroundZero(m[1])\n && isAroundZero(m[2])\n && isAroundZero(m[3] - 1);\n}\nfunction noTranslate(m) {\n return isAroundZero(m[4]) && isAroundZero(m[5]);\n}\nfunction setTransform(attrs, m, compress) {\n if (m && !(noTranslate(m) && noRotateScale(m))) {\n var mul = compress ? 10 : 1e4;\n attrs.transform = noRotateScale(m)\n ? \"translate(\" + round(m[4] * mul) / mul + \" \" + round(m[5] * mul) / mul + \")\" : getMatrixStr(m);\n }\n}\nfunction convertPolyShape(shape, attrs, mul) {\n var points = shape.points;\n var strArr = [];\n for (var i = 0; i < points.length; i++) {\n strArr.push(round(points[i][0] * mul) / mul);\n strArr.push(round(points[i][1] * mul) / mul);\n }\n attrs.points = strArr.join(' ');\n}\nfunction validatePolyShape(shape) {\n return !shape.smooth;\n}\nfunction createAttrsConvert(desc) {\n var normalizedDesc = map(desc, function (item) {\n return (typeof item === 'string' ? [item, item] : item);\n });\n return function (shape, attrs, mul) {\n for (var i = 0; i < normalizedDesc.length; i++) {\n var item = normalizedDesc[i];\n var val = shape[item[0]];\n if (val != null) {\n attrs[item[1]] = round(val * mul) / mul;\n }\n }\n };\n}\nvar builtinShapesDef = {\n circle: [createAttrsConvert(['cx', 'cy', 'r'])],\n polyline: [convertPolyShape, validatePolyShape],\n polygon: [convertPolyShape, validatePolyShape]\n};\nfunction hasShapeAnimation(el) {\n var animators = el.animators;\n for (var i = 0; i < animators.length; i++) {\n if (animators[i].targetName === 'shape') {\n return true;\n }\n }\n return false;\n}\nexport function brushSVGPath(el, scope) {\n var style = el.style;\n var shape = el.shape;\n var builtinShpDef = builtinShapesDef[el.type];\n var attrs = {};\n var needsAnimate = scope.animation;\n var svgElType = 'path';\n var strokePercent = el.style.strokePercent;\n var precision = (scope.compress && getPathPrecision(el)) || 4;\n if (builtinShpDef\n && !scope.willUpdate\n && !(builtinShpDef[1] && !builtinShpDef[1](shape))\n && !(needsAnimate && hasShapeAnimation(el))\n && !(strokePercent < 1)) {\n svgElType = el.type;\n var mul = Math.pow(10, precision);\n builtinShpDef[0](shape, attrs, mul);\n }\n else {\n var needBuildPath = !el.path || el.shapeChanged();\n if (!el.path) {\n el.createPathProxy();\n }\n var path = el.path;\n if (needBuildPath) {\n path.beginPath();\n el.buildPath(path, el.shape);\n el.pathUpdated();\n }\n var pathVersion = path.getVersion();\n var elExt = el;\n var svgPathBuilder = elExt.__svgPathBuilder;\n if (elExt.__svgPathVersion !== pathVersion\n || !svgPathBuilder\n || strokePercent !== elExt.__svgPathStrokePercent) {\n if (!svgPathBuilder) {\n svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();\n }\n svgPathBuilder.reset(precision);\n path.rebuildPath(svgPathBuilder, strokePercent);\n svgPathBuilder.generateStr();\n elExt.__svgPathVersion = pathVersion;\n elExt.__svgPathStrokePercent = strokePercent;\n }\n attrs.d = svgPathBuilder.getStr();\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode(svgElType, el.id + '', attrs);\n}\nexport function brushSVGImage(el, scope) {\n var style = el.style;\n var image = style.image;\n if (image && !isString(image)) {\n if (isImageLike(image)) {\n image = image.src;\n }\n else if (isCanvasLike(image)) {\n image = image.toDataURL();\n }\n }\n if (!image) {\n return;\n }\n var x = style.x || 0;\n var y = style.y || 0;\n var dw = style.width;\n var dh = style.height;\n var attrs = {\n href: image,\n width: dw,\n height: dh\n };\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('image', el.id + '', attrs);\n}\n;\nexport function brushSVGTSpan(el, scope) {\n var style = el.style;\n var text = style.text;\n text != null && (text += '');\n if (!text || isNaN(style.x) || isNaN(style.y)) {\n return;\n }\n var font = style.font || DEFAULT_FONT;\n var x = style.x || 0;\n var y = adjustTextY(style.y || 0, getLineHeight(font), style.textBaseline);\n var textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign]\n || style.textAlign;\n var attrs = {\n 'dominant-baseline': 'central',\n 'text-anchor': textAlign\n };\n if (hasSeparateFont(style)) {\n var separatedFontStr = '';\n var fontStyle = style.fontStyle;\n var fontSize = parseFontSize(style.fontSize);\n if (!parseFloat(fontSize)) {\n return;\n }\n var fontFamily = style.fontFamily || DEFAULT_FONT_FAMILY;\n var fontWeight = style.fontWeight;\n separatedFontStr += \"font-size:\" + fontSize + \";font-family:\" + fontFamily + \";\";\n if (fontStyle && fontStyle !== 'normal') {\n separatedFontStr += \"font-style:\" + fontStyle + \";\";\n }\n if (fontWeight && fontWeight !== 'normal') {\n separatedFontStr += \"font-weight:\" + fontWeight + \";\";\n }\n attrs.style = separatedFontStr;\n }\n else {\n attrs.style = \"font: \" + font;\n }\n if (text.match(/\\s/)) {\n attrs['xml:space'] = 'preserve';\n }\n if (x) {\n attrs.x = x;\n }\n if (y) {\n attrs.y = y;\n }\n setTransform(attrs, el.transform);\n setStyleAttrs(attrs, style, el, scope);\n scope.animation && createCSSAnimation(el, attrs, scope);\n return createVNode('text', el.id + '', attrs, undefined, text);\n}\nexport function brush(el, scope) {\n if (el instanceof Path) {\n return brushSVGPath(el, scope);\n }\n else if (el instanceof ZRImage) {\n return brushSVGImage(el, scope);\n }\n else if (el instanceof TSpan) {\n return brushSVGTSpan(el, scope);\n }\n}\nfunction setShadow(el, attrs, scope) {\n var style = el.style;\n if (hasShadow(style)) {\n var shadowKey = getShadowKey(el);\n var shadowCache = scope.shadowCache;\n var shadowId = shadowCache[shadowKey];\n if (!shadowId) {\n var globalScale = el.getGlobalScale();\n var scaleX = globalScale[0];\n var scaleY = globalScale[1];\n if (!scaleX || !scaleY) {\n return;\n }\n var offsetX = style.shadowOffsetX || 0;\n var offsetY = style.shadowOffsetY || 0;\n var blur_1 = style.shadowBlur;\n var _a = normalizeColor(style.shadowColor), opacity = _a.opacity, color = _a.color;\n var stdDx = blur_1 / 2 / scaleX;\n var stdDy = blur_1 / 2 / scaleY;\n var stdDeviation = stdDx + ' ' + stdDy;\n shadowId = scope.zrId + '-s' + scope.shadowIdx++;\n scope.defs[shadowId] = createVNode('filter', shadowId, {\n 'id': shadowId,\n 'x': '-100%',\n 'y': '-100%',\n 'width': '300%',\n 'height': '300%'\n }, [\n createVNode('feDropShadow', '', {\n 'dx': offsetX / scaleX,\n 'dy': offsetY / scaleY,\n 'stdDeviation': stdDeviation,\n 'flood-color': color,\n 'flood-opacity': opacity\n })\n ]);\n shadowCache[shadowKey] = shadowId;\n }\n attrs.filter = getIdURL(shadowId);\n }\n}\nexport function setGradient(style, attrs, target, scope) {\n var val = style[target];\n var gradientTag;\n var gradientAttrs = {\n 'gradientUnits': val.global\n ? 'userSpaceOnUse'\n : 'objectBoundingBox'\n };\n if (isLinearGradient(val)) {\n gradientTag = 'linearGradient';\n gradientAttrs.x1 = val.x;\n gradientAttrs.y1 = val.y;\n gradientAttrs.x2 = val.x2;\n gradientAttrs.y2 = val.y2;\n }\n else if (isRadialGradient(val)) {\n gradientTag = 'radialGradient';\n gradientAttrs.cx = retrieve2(val.x, 0.5);\n gradientAttrs.cy = retrieve2(val.y, 0.5);\n gradientAttrs.r = retrieve2(val.r, 0.5);\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logError('Illegal gradient type.');\n }\n return;\n }\n var colors = val.colorStops;\n var colorStops = [];\n for (var i = 0, len = colors.length; i < len; ++i) {\n var offset = round4(colors[i].offset) * 100 + '%';\n var stopColor = colors[i].color;\n var _a = normalizeColor(stopColor), color = _a.color, opacity = _a.opacity;\n var stopsAttrs = {\n 'offset': offset\n };\n stopsAttrs['stop-color'] = color;\n if (opacity < 1) {\n stopsAttrs['stop-opacity'] = opacity;\n }\n colorStops.push(createVNode('stop', i + '', stopsAttrs));\n }\n var gradientVNode = createVNode(gradientTag, '', gradientAttrs, colorStops);\n var gradientKey = vNodeToString(gradientVNode);\n var gradientCache = scope.gradientCache;\n var gradientId = gradientCache[gradientKey];\n if (!gradientId) {\n gradientId = scope.zrId + '-g' + scope.gradientIdx++;\n gradientCache[gradientKey] = gradientId;\n gradientAttrs.id = gradientId;\n scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops);\n }\n attrs[target] = getIdURL(gradientId);\n}\nexport function setPattern(el, attrs, target, scope) {\n var val = el.style[target];\n var boundingRect = el.getBoundingRect();\n var patternAttrs = {};\n var repeat = val.repeat;\n var noRepeat = repeat === 'no-repeat';\n var repeatX = repeat === 'repeat-x';\n var repeatY = repeat === 'repeat-y';\n var child;\n if (isImagePattern(val)) {\n var imageWidth_1 = val.imageWidth;\n var imageHeight_1 = val.imageHeight;\n var imageSrc = void 0;\n var patternImage = val.image;\n if (isString(patternImage)) {\n imageSrc = patternImage;\n }\n else if (isImageLike(patternImage)) {\n imageSrc = patternImage.src;\n }\n else if (isCanvasLike(patternImage)) {\n imageSrc = patternImage.toDataURL();\n }\n if (typeof Image === 'undefined') {\n var errMsg = 'Image width/height must been given explictly in svg-ssr renderer.';\n assert(imageWidth_1, errMsg);\n assert(imageHeight_1, errMsg);\n }\n else if (imageWidth_1 == null || imageHeight_1 == null) {\n var setSizeToVNode_1 = function (vNode, img) {\n if (vNode) {\n var svgEl = vNode.elm;\n var width = imageWidth_1 || img.width;\n var height = imageHeight_1 || img.height;\n if (vNode.tag === 'pattern') {\n if (repeatX) {\n height = 1;\n width /= boundingRect.width;\n }\n else if (repeatY) {\n width = 1;\n height /= boundingRect.height;\n }\n }\n vNode.attrs.width = width;\n vNode.attrs.height = height;\n if (svgEl) {\n svgEl.setAttribute('width', width);\n svgEl.setAttribute('height', height);\n }\n }\n };\n var createdImage = createOrUpdateImage(imageSrc, null, el, function (img) {\n noRepeat || setSizeToVNode_1(patternVNode, img);\n setSizeToVNode_1(child, img);\n });\n if (createdImage && createdImage.width && createdImage.height) {\n imageWidth_1 = imageWidth_1 || createdImage.width;\n imageHeight_1 = imageHeight_1 || createdImage.height;\n }\n }\n child = createVNode('image', 'img', {\n href: imageSrc,\n width: imageWidth_1,\n height: imageHeight_1\n });\n patternAttrs.width = imageWidth_1;\n patternAttrs.height = imageHeight_1;\n }\n else if (val.svgElement) {\n child = clone(val.svgElement);\n patternAttrs.width = val.svgWidth;\n patternAttrs.height = val.svgHeight;\n }\n if (!child) {\n return;\n }\n var patternWidth;\n var patternHeight;\n if (noRepeat) {\n patternWidth = patternHeight = 1;\n }\n else if (repeatX) {\n patternHeight = 1;\n patternWidth = patternAttrs.width / boundingRect.width;\n }\n else if (repeatY) {\n patternWidth = 1;\n patternHeight = patternAttrs.height / boundingRect.height;\n }\n else {\n patternAttrs.patternUnits = 'userSpaceOnUse';\n }\n if (patternWidth != null && !isNaN(patternWidth)) {\n patternAttrs.width = patternWidth;\n }\n if (patternHeight != null && !isNaN(patternHeight)) {\n patternAttrs.height = patternHeight;\n }\n var patternTransform = getSRTTransformString(val);\n patternTransform && (patternAttrs.patternTransform = patternTransform);\n var patternVNode = createVNode('pattern', '', patternAttrs, [child]);\n var patternKey = vNodeToString(patternVNode);\n var patternCache = scope.patternCache;\n var patternId = patternCache[patternKey];\n if (!patternId) {\n patternId = scope.zrId + '-p' + scope.patternIdx++;\n patternCache[patternKey] = patternId;\n patternAttrs.id = patternId;\n patternVNode = scope.defs[patternId] = createVNode('pattern', patternId, patternAttrs, [child]);\n }\n attrs[target] = getIdURL(patternId);\n}\nexport function setClipPath(clipPath, attrs, scope) {\n var clipPathCache = scope.clipPathCache, defs = scope.defs;\n var clipPathId = clipPathCache[clipPath.id];\n if (!clipPathId) {\n clipPathId = scope.zrId + '-c' + scope.clipPathIdx++;\n var clipPathAttrs = {\n id: clipPathId\n };\n clipPathCache[clipPath.id] = clipPathId;\n defs[clipPathId] = createVNode('clipPath', clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]);\n }\n attrs['clip-path'] = getIdURL(clipPathId);\n}\n","export function createTextNode(text) {\n return document.createTextNode(text);\n}\nexport function createComment(text) {\n return document.createComment(text);\n}\nexport function insertBefore(parentNode, newNode, referenceNode) {\n parentNode.insertBefore(newNode, referenceNode);\n}\nexport function removeChild(node, child) {\n node.removeChild(child);\n}\nexport function appendChild(node, child) {\n node.appendChild(child);\n}\nexport function parentNode(node) {\n return node.parentNode;\n}\nexport function nextSibling(node) {\n return node.nextSibling;\n}\nexport function tagName(elm) {\n return elm.tagName;\n}\nexport function setTextContent(node, text) {\n node.textContent = text;\n}\nexport function getTextContent(node) {\n return node.textContent;\n}\nexport function isElement(node) {\n return node.nodeType === 1;\n}\nexport function isText(node) {\n return node.nodeType === 3;\n}\nexport function isComment(node) {\n return node.nodeType === 8;\n}\n","import { isArray, isObject } from '../core/util.js';\nimport { createElement, createVNode, XMLNS, XML_NAMESPACE, XLINKNS } from './core.js';\nimport * as api from './domapi.js';\nvar colonChar = 58;\nvar xChar = 120;\nvar emptyNode = createVNode('', '');\nfunction isUndef(s) {\n return s === undefined;\n}\nfunction isDef(s) {\n return s !== undefined;\n}\nfunction createKeyToOldIdx(children, beginIdx, endIdx) {\n var map = {};\n for (var i = beginIdx; i <= endIdx; ++i) {\n var key = children[i].key;\n if (key !== undefined) {\n if (process.env.NODE_ENV !== 'production') {\n if (map[key] != null) {\n console.error(\"Duplicate key \" + key);\n }\n }\n map[key] = i;\n }\n }\n return map;\n}\nfunction sameVnode(vnode1, vnode2) {\n var isSameKey = vnode1.key === vnode2.key;\n var isSameTag = vnode1.tag === vnode2.tag;\n return isSameTag && isSameKey;\n}\nfunction createElm(vnode) {\n var i;\n var children = vnode.children;\n var tag = vnode.tag;\n if (isDef(tag)) {\n var elm = (vnode.elm = createElement(tag));\n updateAttrs(emptyNode, vnode);\n if (isArray(children)) {\n for (i = 0; i < children.length; ++i) {\n var ch = children[i];\n if (ch != null) {\n api.appendChild(elm, createElm(ch));\n }\n }\n }\n else if (isDef(vnode.text) && !isObject(vnode.text)) {\n api.appendChild(elm, api.createTextNode(vnode.text));\n }\n }\n else {\n vnode.elm = api.createTextNode(vnode.text);\n }\n return vnode.elm;\n}\nfunction addVnodes(parentElm, before, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n api.insertBefore(parentElm, createElm(ch), before);\n }\n }\n}\nfunction removeVnodes(parentElm, vnodes, startIdx, endIdx) {\n for (; startIdx <= endIdx; ++startIdx) {\n var ch = vnodes[startIdx];\n if (ch != null) {\n if (isDef(ch.tag)) {\n var parent_1 = api.parentNode(ch.elm);\n api.removeChild(parent_1, ch.elm);\n }\n else {\n api.removeChild(parentElm, ch.elm);\n }\n }\n }\n}\nexport function updateAttrs(oldVnode, vnode) {\n var key;\n var elm = vnode.elm;\n var oldAttrs = oldVnode && oldVnode.attrs || {};\n var attrs = vnode.attrs || {};\n if (oldAttrs === attrs) {\n return;\n }\n for (key in attrs) {\n var cur = attrs[key];\n var old = oldAttrs[key];\n if (old !== cur) {\n if (cur === true) {\n elm.setAttribute(key, '');\n }\n else if (cur === false) {\n elm.removeAttribute(key);\n }\n else {\n if (key.charCodeAt(0) !== xChar) {\n elm.setAttribute(key, cur);\n }\n else if (key === 'xmlns:xlink' || key === 'xmlns') {\n elm.setAttributeNS(XMLNS, key, cur);\n }\n else if (key.charCodeAt(3) === colonChar) {\n elm.setAttributeNS(XML_NAMESPACE, key, cur);\n }\n else if (key.charCodeAt(5) === colonChar) {\n elm.setAttributeNS(XLINKNS, key, cur);\n }\n else {\n elm.setAttribute(key, cur);\n }\n }\n }\n }\n for (key in oldAttrs) {\n if (!(key in attrs)) {\n elm.removeAttribute(key);\n }\n }\n}\nfunction updateChildren(parentElm, oldCh, newCh) {\n var oldStartIdx = 0;\n var newStartIdx = 0;\n var oldEndIdx = oldCh.length - 1;\n var oldStartVnode = oldCh[0];\n var oldEndVnode = oldCh[oldEndIdx];\n var newEndIdx = newCh.length - 1;\n var newStartVnode = newCh[0];\n var newEndVnode = newCh[newEndIdx];\n var oldKeyToIdx;\n var idxInOld;\n var elmToMove;\n var before;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n oldStartVnode = oldCh[++oldStartIdx];\n }\n else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n }\n else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n }\n else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newStartVnode)) {\n patchVnode(oldStartVnode, newStartVnode);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else if (sameVnode(oldEndVnode, newEndVnode)) {\n patchVnode(oldEndVnode, newEndVnode);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldStartVnode, newEndVnode)) {\n patchVnode(oldStartVnode, newEndVnode);\n api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));\n oldStartVnode = oldCh[++oldStartIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (sameVnode(oldEndVnode, newStartVnode)) {\n patchVnode(oldEndVnode, newStartVnode);\n api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);\n oldEndVnode = oldCh[--oldEndIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else {\n if (isUndef(oldKeyToIdx)) {\n oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);\n }\n idxInOld = oldKeyToIdx[newStartVnode.key];\n if (isUndef(idxInOld)) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n elmToMove = oldCh[idxInOld];\n if (elmToMove.tag !== newStartVnode.tag) {\n api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);\n }\n else {\n patchVnode(elmToMove, newStartVnode);\n oldCh[idxInOld] = undefined;\n api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);\n }\n }\n newStartVnode = newCh[++newStartIdx];\n }\n }\n if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {\n if (oldStartIdx > oldEndIdx) {\n before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;\n addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);\n }\n else {\n removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);\n }\n }\n}\nfunction patchVnode(oldVnode, vnode) {\n var elm = (vnode.elm = oldVnode.elm);\n var oldCh = oldVnode.children;\n var ch = vnode.children;\n if (oldVnode === vnode) {\n return;\n }\n updateAttrs(oldVnode, vnode);\n if (isUndef(vnode.text)) {\n if (isDef(oldCh) && isDef(ch)) {\n if (oldCh !== ch) {\n updateChildren(elm, oldCh, ch);\n }\n }\n else if (isDef(ch)) {\n if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n addVnodes(elm, null, ch, 0, ch.length - 1);\n }\n else if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n else if (isDef(oldVnode.text)) {\n api.setTextContent(elm, '');\n }\n }\n else if (oldVnode.text !== vnode.text) {\n if (isDef(oldCh)) {\n removeVnodes(elm, oldCh, 0, oldCh.length - 1);\n }\n api.setTextContent(elm, vnode.text);\n }\n}\nexport default function patch(oldVnode, vnode) {\n if (sameVnode(oldVnode, vnode)) {\n patchVnode(oldVnode, vnode);\n }\n else {\n var elm = oldVnode.elm;\n var parent_2 = api.parentNode(elm);\n createElm(vnode);\n if (parent_2 !== null) {\n api.insertBefore(parent_2, vnode.elm, api.nextSibling(elm));\n removeVnodes(parent_2, [oldVnode], 0, 0);\n }\n }\n return vnode;\n}\n","import { brush, setClipPath, setGradient, setPattern } from './graphic.js';\nimport { createElement, createVNode, vNodeToString, getCssString, createBrushScope, createSVGVNode } from './core.js';\nimport { normalizeColor, encodeBase64, isGradient, isPattern } from './helper.js';\nimport { extend, keys, logError, map, noop, retrieve2 } from '../core/util.js';\nimport patch, { updateAttrs } from './patch.js';\nimport { getSize } from '../canvas/helper.js';\nvar svgId = 0;\nvar SVGPainter = (function () {\n function SVGPainter(root, storage, opts) {\n this.type = 'svg';\n this.refreshHover = createMethodNotSupport('refreshHover');\n this.configLayer = createMethodNotSupport('configLayer');\n this.storage = storage;\n this._opts = opts = extend({}, opts);\n this.root = root;\n this._id = 'zr' + svgId++;\n this._oldVNode = createSVGVNode(opts.width, opts.height);\n if (root && !opts.ssr) {\n var viewport = this._viewport = document.createElement('div');\n viewport.style.cssText = 'position:relative;overflow:hidden';\n var svgDom = this._svgDom = this._oldVNode.elm = createElement('svg');\n updateAttrs(null, this._oldVNode);\n viewport.appendChild(svgDom);\n root.appendChild(viewport);\n }\n this.resize(opts.width, opts.height);\n }\n SVGPainter.prototype.getType = function () {\n return this.type;\n };\n SVGPainter.prototype.getViewportRoot = function () {\n return this._viewport;\n };\n SVGPainter.prototype.getViewportRootOffset = function () {\n var viewportRoot = this.getViewportRoot();\n if (viewportRoot) {\n return {\n offsetLeft: viewportRoot.offsetLeft || 0,\n offsetTop: viewportRoot.offsetTop || 0\n };\n }\n };\n SVGPainter.prototype.getSvgDom = function () {\n return this._svgDom;\n };\n SVGPainter.prototype.refresh = function () {\n if (this.root) {\n var vnode = this.renderToVNode({\n willUpdate: true\n });\n vnode.attrs.style = 'position:absolute;left:0;top:0;user-select:none';\n patch(this._oldVNode, vnode);\n this._oldVNode = vnode;\n }\n };\n SVGPainter.prototype.renderOneToVNode = function (el) {\n return brush(el, createBrushScope(this._id));\n };\n SVGPainter.prototype.renderToVNode = function (opts) {\n opts = opts || {};\n var list = this.storage.getDisplayList(true);\n var width = this._width;\n var height = this._height;\n var scope = createBrushScope(this._id);\n scope.animation = opts.animation;\n scope.willUpdate = opts.willUpdate;\n scope.compress = opts.compress;\n var children = [];\n var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);\n bgVNode && children.push(bgVNode);\n var mainVNode = !opts.compress\n ? (this._mainVNode = createVNode('g', 'main', {}, [])) : null;\n this._paintList(list, scope, mainVNode ? mainVNode.children : children);\n mainVNode && children.push(mainVNode);\n var defs = map(keys(scope.defs), function (id) { return scope.defs[id]; });\n if (defs.length) {\n children.push(createVNode('defs', 'defs', {}, defs));\n }\n if (opts.animation) {\n var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });\n if (animationCssStr) {\n var styleNode = createVNode('style', 'stl', {}, [], animationCssStr);\n children.push(styleNode);\n }\n }\n return createSVGVNode(width, height, children, opts.useViewBox);\n };\n SVGPainter.prototype.renderToString = function (opts) {\n opts = opts || {};\n return vNodeToString(this.renderToVNode({\n animation: retrieve2(opts.cssAnimation, true),\n willUpdate: false,\n compress: true,\n useViewBox: retrieve2(opts.useViewBox, true)\n }), { newline: true });\n };\n SVGPainter.prototype.setBackgroundColor = function (backgroundColor) {\n this._backgroundColor = backgroundColor;\n };\n SVGPainter.prototype.getSvgRoot = function () {\n return this._mainVNode && this._mainVNode.elm;\n };\n SVGPainter.prototype._paintList = function (list, scope, out) {\n var listLen = list.length;\n var clipPathsGroupsStack = [];\n var clipPathsGroupsStackDepth = 0;\n var currentClipPathGroup;\n var prevClipPaths;\n var clipGroupNodeIdx = 0;\n for (var i = 0; i < listLen; i++) {\n var displayable = list[i];\n if (!displayable.invisible) {\n var clipPaths = displayable.__clipPaths;\n var len = clipPaths && clipPaths.length || 0;\n var prevLen = prevClipPaths && prevClipPaths.length || 0;\n var lca = void 0;\n for (lca = Math.max(len - 1, prevLen - 1); lca >= 0; lca--) {\n if (clipPaths && prevClipPaths\n && clipPaths[lca] === prevClipPaths[lca]) {\n break;\n }\n }\n for (var i_1 = prevLen - 1; i_1 > lca; i_1--) {\n clipPathsGroupsStackDepth--;\n currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];\n }\n for (var i_2 = lca + 1; i_2 < len; i_2++) {\n var groupAttrs = {};\n setClipPath(clipPaths[i_2], groupAttrs, scope);\n var g = createVNode('g', 'clip-g-' + clipGroupNodeIdx++, groupAttrs, []);\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(g);\n clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;\n currentClipPathGroup = g;\n }\n prevClipPaths = clipPaths;\n var ret = brush(displayable, scope);\n if (ret) {\n (currentClipPathGroup ? currentClipPathGroup.children : out).push(ret);\n }\n }\n }\n };\n SVGPainter.prototype.resize = function (width, height) {\n var opts = this._opts;\n var root = this.root;\n var viewport = this._viewport;\n width != null && (opts.width = width);\n height != null && (opts.height = height);\n if (root && viewport) {\n viewport.style.display = 'none';\n width = getSize(root, 0, opts);\n height = getSize(root, 1, opts);\n viewport.style.display = '';\n }\n if (this._width !== width || this._height !== height) {\n this._width = width;\n this._height = height;\n if (viewport) {\n var viewportStyle = viewport.style;\n viewportStyle.width = width + 'px';\n viewportStyle.height = height + 'px';\n }\n if (!isPattern(this._backgroundColor)) {\n var svgDom = this._svgDom;\n if (svgDom) {\n svgDom.setAttribute('width', width);\n svgDom.setAttribute('height', height);\n }\n var bgEl = this._bgVNode && this._bgVNode.elm;\n if (bgEl) {\n bgEl.setAttribute('width', width);\n bgEl.setAttribute('height', height);\n }\n }\n else {\n this.refresh();\n }\n }\n };\n SVGPainter.prototype.getWidth = function () {\n return this._width;\n };\n SVGPainter.prototype.getHeight = function () {\n return this._height;\n };\n SVGPainter.prototype.dispose = function () {\n if (this.root) {\n this.root.innerHTML = '';\n }\n this._svgDom =\n this._viewport =\n this.storage =\n this._oldVNode =\n this._bgVNode =\n this._mainVNode = null;\n };\n SVGPainter.prototype.clear = function () {\n if (this._svgDom) {\n this._svgDom.innerHTML = null;\n }\n this._oldVNode = null;\n };\n SVGPainter.prototype.toDataURL = function (base64) {\n var str = this.renderToString();\n var prefix = 'data:image/svg+xml;';\n if (base64) {\n str = encodeBase64(str);\n return str && prefix + 'base64,' + str;\n }\n return prefix + 'charset=UTF-8,' + encodeURIComponent(str);\n };\n return SVGPainter;\n}());\nfunction createMethodNotSupport(method) {\n return function () {\n if (process.env.NODE_ENV !== 'production') {\n logError('In SVG mode painter not support method \"' + method + '\"');\n }\n };\n}\nfunction createBackgroundVNode(width, height, backgroundColor, scope) {\n var bgVNode;\n if (backgroundColor && backgroundColor !== 'none') {\n bgVNode = createVNode('rect', 'bg', {\n width: width,\n height: height,\n x: '0',\n y: '0',\n id: '0'\n });\n if (isGradient(backgroundColor)) {\n setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope);\n }\n else if (isPattern(backgroundColor)) {\n setPattern({\n style: {\n fill: backgroundColor\n },\n dirty: noop,\n getBoundingRect: function () { return ({ width: width, height: height }); }\n }, bgVNode.attrs, 'fill', scope);\n }\n else {\n var _a = normalizeColor(backgroundColor), color = _a.color, opacity = _a.opacity;\n bgVNode.attrs.fill = color;\n opacity < 1 && (bgVNode.attrs['fill-opacity'] = opacity);\n }\n }\n return bgVNode;\n}\nexport default SVGPainter;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SVGPainter from 'zrender/lib/svg/Painter.js';\nexport function install(registers) {\n registers.registerPainter('svg', SVGPainter);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\n\nfunction defaultKeyGetter(item) {\n return item;\n}\n\nvar DataDiffer =\n/** @class */\nfunction () {\n /**\r\n * @param context Can be visited by this.context in callback.\r\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`;\n\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\r\n * Callback function when add a data\r\n */\n\n\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\r\n * Callback function when update a data\r\n */\n\n\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\r\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\r\n */\n\n\n DataDiffer.prototype.updateManyToMany = function (func) {\n this._updateManyToMany = func;\n return this;\n };\n /**\r\n * Callback function when remove a data\r\n */\n\n\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below.\n\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\r\n * For example, consider the case:\r\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\r\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\r\n * Where:\r\n * o0, o1, n0 has key 'a' (many to one)\r\n * o5, n4, n5, n6 has key 'b' (one to many)\r\n * o2, n1 has key 'c' (one to one)\r\n * n2, n3 has key 'd' (add)\r\n * o3, o4 has key 'e' (remove)\r\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\r\n * Then:\r\n * (The order of the following directives are not ensured.)\r\n * this._updateManyToOne(n0, [o0, o1]);\r\n * this._updateOneToMany([n4, n5, n6], o5);\r\n * this._update(n1, o2);\r\n * this._remove(o3);\r\n * this._remove(o4);\r\n * this._remove(o6);\r\n * this._remove(o7);\r\n * this._add(n2);\r\n * this._add(n3);\r\n * this._add(n7);\r\n * this._add(n8);\r\n */\n\n\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n } // Support both `newDataKeyArr` are duplication removed or not removed.\n\n\n newDataIndexMap[newKey] = null;\n }\n };\n\n DataDiffer.prototype._initIndexMap = function (arr, // Can be null.\n map, // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n\n if (!map) {\n continue;\n }\n\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n\n return DataDiffer;\n}();\n\nexport default DataDiffer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, createHashMap, assert, map } from 'zrender/lib/core/util.js';\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\n\nvar DimensionUserOuput =\n/** @class */\nfunction () {\n function DimensionUserOuput(encode, dimRequest) {\n this._encode = encode;\n this._schema = dimRequest;\n }\n\n DimensionUserOuput.prototype.get = function () {\n return {\n // Do not generate full dimension name until fist used.\n fullDimensions: this._getFullDimensionNames(),\n encode: this._encode\n };\n };\n /**\r\n * Get all data store dimension names.\r\n * Theoretically a series data store is defined both by series and used dataset (if any).\r\n * If some dimensions are omitted for performance reason in `this.dimensions`,\r\n * the dimension name may not be auto-generated if user does not specify a dimension name.\r\n * In this case, the dimension name is `null`/`undefined`.\r\n */\n\n\n DimensionUserOuput.prototype._getFullDimensionNames = function () {\n if (!this._cachedDimNames) {\n this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : [];\n }\n\n return this._cachedDimNames;\n };\n\n return DimensionUserOuput;\n}();\n\n;\nexport function summarizeDimensions(data, schema) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = [];\n var userOutputEncode = {};\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(VISUAL_DIMENSIONS.get(coordDim) == null);\n }\n\n var coordDimIndex = dimItem.coordDimIndex;\n getOrCreateEncodeArr(encode, coordDim)[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 } // User output encode do not contain generated coords.\n // And it only has index. User can use index to retrieve value from the raw item array.\n\n\n getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name);\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n VISUAL_DIMENSIONS.each(function (v, otherDim) {\n var encodeArr = getOrCreateEncodeArr(encode, otherDim);\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n encodeArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim];\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.dataDimIndicesOnCoord = map(dataDimsOnCoord, function (dimName) {\n return data.getDimensionInfo(dimName).storeDimIndex;\n });\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommended, because formatter cannot be set\n // in this way. Use label.formatter instead. Maybe 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 summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);\n return summary;\n}\n\nfunction getOrCreateEncodeArr(encode, dim) {\n if (!encode.hasOwnProperty(dim)) {\n encode[dim] = [];\n }\n\n return encode[dim];\n} // FIXME:TS should be type `AxisType`\n\n\nexport function 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// let dimensions = data.dimensions.slice();\n// let valueType;\n// let 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* 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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nvar SeriesDimensionDefine =\n/** @class */\nfunction () {\n /**\r\n * @param opt All of the fields will be shallow copied.\r\n */\n function SeriesDimensionDefine(opt) {\n /**\r\n * The format of `otherDims` is:\r\n * ```js\r\n * {\r\n * tooltip?: number\r\n * label?: number\r\n * itemName?: number\r\n * seriesName?: number\r\n * }\r\n * ```\r\n *\r\n * A `series.encode` can specified these fields:\r\n * ```js\r\n * encode: {\r\n * // \"3, 1, 5\" is the index of data dimension.\r\n * tooltip: [3, 1, 5],\r\n * label: [0, 3],\r\n * ...\r\n * }\r\n * ```\r\n * `otherDims` is the parse result of the `series.encode` above, like:\r\n * ```js\r\n * // Suppose the index of this data dimension is `3`.\r\n * this.otherDims = {\r\n * // `3` is at the index `0` of the `encode.tooltip`\r\n * tooltip: 0,\r\n * // `3` is at the index `1` of the `encode.label`\r\n * label: 1\r\n * };\r\n * ```\r\n *\r\n * This prop should never be `null`/`undefined` after initialized.\r\n */\n this.otherDims = {};\n\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n\n return SeriesDimensionDefine;\n}();\n\n;\nexport default SeriesDimensionDefine;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, isObject, retrieve2 } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { shouldRetrieveDataByName } from '../Source.js';\nvar inner = makeInner();\nvar dimTypeShort = {\n float: 'f',\n int: 'i',\n ordinal: 'o',\n number: 'n',\n time: 't'\n};\n/**\r\n * Represents the dimension requirement of a series.\r\n *\r\n * NOTICE:\r\n * When there are too many dimensions in dataset and many series, only the used dimensions\r\n * (i.e., used by coord sys and declared in `series.encode`) are add to `dimensionDefineList`.\r\n * But users may query data by other unused dimension names.\r\n * In this case, users can only query data if and only if they have defined dimension names\r\n * via ec option, so we provide `getDimensionIndexFromSource`, which only query them from\r\n * `source` dimensions.\r\n */\n\nvar SeriesDataSchema =\n/** @class */\nfunction () {\n function SeriesDataSchema(opt) {\n this.dimensions = opt.dimensions;\n this._dimOmitted = opt.dimensionOmitted;\n this.source = opt.source;\n this._fullDimCount = opt.fullDimensionCount;\n\n this._updateDimOmitted(opt.dimensionOmitted);\n }\n\n SeriesDataSchema.prototype.isDimensionOmitted = function () {\n return this._dimOmitted;\n };\n\n SeriesDataSchema.prototype._updateDimOmitted = function (dimensionOmitted) {\n this._dimOmitted = dimensionOmitted;\n\n if (!dimensionOmitted) {\n return;\n }\n\n if (!this._dimNameMap) {\n this._dimNameMap = ensureSourceDimNameMap(this.source);\n }\n };\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Get index by user defined dimension name (i.e., not internal generate name).\r\n * That is, get index from `dimensionsDefine`.\r\n * If no `dimensionsDefine`, or no name get, return -1.\r\n */\n\n\n SeriesDataSchema.prototype.getSourceDimensionIndex = function (dimName) {\n return retrieve2(this._dimNameMap.get(dimName), -1);\n };\n /**\r\n * @caution Can only be used when `dimensionOmitted: true`.\r\n *\r\n * Notice: may return `null`/`undefined` if user not specify dimension names.\r\n */\n\n\n SeriesDataSchema.prototype.getSourceDimension = function (dimIndex) {\n var dimensionsDefine = this.source.dimensionsDefine;\n\n if (dimensionsDefine) {\n return dimensionsDefine[dimIndex];\n }\n };\n\n SeriesDataSchema.prototype.makeStoreSchema = function () {\n var dimCount = this._fullDimCount;\n var willRetrieveDataByName = shouldRetrieveDataByName(this.source);\n var makeHashStrict = !shouldOmitUnusedDimensions(dimCount); // If source don't have dimensions or series don't omit unsed dimensions.\n // Generate from seriesDimList directly\n\n var dimHash = '';\n var dims = [];\n\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {\n var property = void 0;\n var type = void 0;\n var ordinalMeta = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc.\n\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n property = willRetrieveDataByName ? seriesDimDef.name : null;\n type = seriesDimDef.type;\n ordinalMeta = seriesDimDef.ordinalMeta;\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n\n if (sourceDimDef) {\n property = willRetrieveDataByName ? sourceDimDef.name : null;\n type = sourceDimDef.type;\n }\n }\n\n dims.push({\n property: property,\n type: type,\n ordinalMeta: ordinalMeta\n }); // If retrieving data by index,\n // use to determine whether data can be shared.\n // (Because in this case there might be no dimension name defined in dataset, but indices always exists).\n // (Indices are always 0, 1, 2, ..., so we can ignore them to shorten the hash).\n // Otherwise if retrieving data by property name (like `data: [{aa: 123, bb: 765}, ...]`),\n // use in hash.\n\n if (willRetrieveDataByName && property != null // For data stack, we have make sure each series has its own dim on this store.\n // So we do not add property to hash to make sure they can share this store.\n && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) {\n dimHash += makeHashStrict // Use escape character '`' in case that property name contains '$'.\n ? property.replace(/\\`/g, '`1').replace(/\\$/g, '`2') // For better performance, when there are large dimensions, tolerant this defects that hardly meet.\n : property;\n }\n\n dimHash += '$';\n dimHash += dimTypeShort[type] || 'f';\n\n if (ordinalMeta) {\n dimHash += ordinalMeta.uid;\n }\n\n dimHash += '$';\n } // Source from endpoint(usually series) will be read differently\n // when seriesLayoutBy or startIndex(which is affected by sourceHeader) are different.\n // So we use this three props as key.\n\n\n var source = this.source;\n var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join('$$');\n return {\n dimensions: dims,\n hash: hash\n };\n };\n\n SeriesDataSchema.prototype.makeOutputDimensionNames = function () {\n var result = [];\n\n for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {\n var name_1 = void 0;\n var seriesDimDef = this.dimensions[seriesDimIdx]; // The list has been sorted by `storeDimIndex` asc.\n\n if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {\n if (!seriesDimDef.isCalculationCoord) {\n name_1 = seriesDimDef.name;\n }\n\n seriesDimIdx++;\n } else {\n var sourceDimDef = this.getSourceDimension(fullDimIdx);\n\n if (sourceDimDef) {\n name_1 = sourceDimDef.name;\n }\n }\n\n result.push(name_1);\n }\n\n return result;\n };\n\n SeriesDataSchema.prototype.appendCalculationDimension = function (dimDef) {\n this.dimensions.push(dimDef);\n dimDef.isCalculationCoord = true;\n this._fullDimCount++; // If append dimension on a data store, consider the store\n // might be shared by different series, series dimensions not\n // really map to store dimensions.\n\n this._updateDimOmitted(true);\n };\n\n return SeriesDataSchema;\n}();\n\nexport { SeriesDataSchema };\nexport function isSeriesDataSchema(schema) {\n return schema instanceof SeriesDataSchema;\n}\nexport function createDimNameMap(dimsDef) {\n var dataDimNameMap = createHashMap();\n\n for (var i = 0; i < (dimsDef || []).length; i++) {\n var dimDefItemRaw = dimsDef[i];\n var userDimName = isObject(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n dataDimNameMap.set(userDimName, i);\n }\n }\n\n return dataDimNameMap;\n}\nexport function ensureSourceDimNameMap(source) {\n var innerSource = inner(source);\n return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine));\n}\nexport function shouldOmitUnusedDimensions(dimCount) {\n return dimCount > 30;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../model/Model.js';\nimport DataDiffer from './DataDiffer.js';\nimport { DefaultDataProvider } from './helper/dataProvider.js';\nimport { summarizeDimensions } from './helper/dimensionHelper.js';\nimport SeriesDimensionDefine from './SeriesDimensionDefine.js';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types.js';\nimport { convertOptionIdName, isDataItemOption } from '../util/model.js';\nimport { setCommonECData } from '../util/innerStore.js';\nimport { isSourceInstance } from './Source.js';\nimport DataStore from './DataStore.js';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema.js';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird update animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1; // type SeriesDimensionIndex = DimensionIndex;\n\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\n\nvar SeriesData =\n/** @class */\nfunction () {\n /**\r\n * @param dimensionsInput.dimensions\r\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\r\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\r\n */\n function SeriesData(dimensionsInput, hostModel) {\n this.type = 'list';\n this._dimOmitted = false;\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Global layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elements\n\n this._graphicEls = []; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = false; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n var dimensions;\n var assignStoreDimIdx = false;\n\n if (isSeriesDataSchema(dimensionsInput)) {\n dimensions = dimensionsInput.dimensions;\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\n this._schema = dimensionsInput;\n } else {\n assignStoreDimIdx = true;\n dimensions = dimensionsInput;\n }\n\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n var needsHasOwn = false;\n var emptyObj = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n\n if (emptyObj[dimensionName] != null) {\n needsHasOwn = true;\n }\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n }\n\n if (assignStoreDimIdx) {\n dimensionInfo.storeDimIndex = i;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimInfos = dimensionInfos;\n\n this._initGetDimensionInfo(needsHasOwn);\n\n this.hostModel = hostModel;\n this._invertedIndicesMap = invertedIndicesMap;\n\n if (this._dimOmitted) {\n var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n zrUtil.each(dimensionNames, function (dimName) {\n dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n });\n }\n }\n /**\r\n *\r\n * Get concrete dimension name by dimension name or dimension index.\r\n * If input a dimension name, do not validate whether the dimension name exits.\r\n *\r\n * @caution\r\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\r\n * Because only those dimensions will have auto-generated dimension names if not\r\n * have a user-specified name, and other dimensions will get a return of null/undefined.\r\n *\r\n * @notice Because of this reason, should better use `getDimensionIndex` instead, for examples:\r\n * ```js\r\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\r\n * ```\r\n *\r\n * @return Concrete dim name.\r\n */\n\n\n SeriesData.prototype.getDimension = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx == null) {\n return dim;\n }\n\n dimIdx = dim;\n\n if (!this._dimOmitted) {\n return this.dimensions[dimIdx];\n } // Retrieve from series dimension definition because it probably contains\n // generated dimension name (like 'x', 'y').\n\n\n var dimName = this._dimIdxToName.get(dimIdx);\n\n if (dimName != null) {\n return dimName;\n }\n\n var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n\n if (sourceDimDef) {\n return sourceDimDef.name;\n }\n };\n /**\r\n * Get dimension index in data store. Return -1 if not found.\r\n * Can be used to index value from getRawValue.\r\n */\n\n\n SeriesData.prototype.getDimensionIndex = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx != null) {\n return dimIdx;\n }\n\n if (dim == null) {\n return -1;\n }\n\n var dimInfo = this._getDimInfo(dim);\n\n return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n };\n /**\r\n * The meanings of the input parameter `dim`:\r\n *\r\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\r\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\r\n * + If dim is a number-like string (e.g., `\"1\"`):\r\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\r\n * it means that concrete name.\r\n * + If not, it will be converted to a number, which means the index of the dimension.\r\n * (why? because of the backward compatibility. We have been tolerating number-like string in\r\n * dimension setting, although now it seems that it is not a good idea.)\r\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\r\n * if no dimension name is defined as `\"1\"`.\r\n * + If dim is a not-number-like string, it means the concrete dim name.\r\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\r\n * or customized in `dimensions` property of option like `\"age\"`.\r\n *\r\n * @return recognized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\r\n */\n\n\n SeriesData.prototype._recognizeDimIndex = function (dim) {\n if (zrUtil.isNumber(dim) // If being a number-like string but not being defined as a dimension name.\n || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n return +dim;\n }\n };\n\n SeriesData.prototype._getStoreDimIndex = function (dim) {\n var dimIdx = this.getDimensionIndex(dim);\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimIdx == null) {\n throw new Error('Unknown dimension ' + dim);\n }\n }\n\n return dimIdx;\n };\n /**\r\n * Get type and calculation info of particular dimension\r\n * @param dim\r\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\r\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\r\n */\n\n\n SeriesData.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._getDimInfo(this.getDimension(dim));\n };\n\n SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n var dimensionInfos = this._dimInfos;\n this._getDimInfo = needsHasOwn ? function (dimName) {\n return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n } : function (dimName) {\n return dimensionInfos[dimName];\n };\n };\n /**\r\n * concrete dimension name list on coord.\r\n */\n\n\n SeriesData.prototype.getDimensionsOnCoord = function () {\n return this._dimSummary.dataDimsOnCoord.slice();\n };\n\n SeriesData.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n\n SeriesData.prototype.getStore = function () {\n return this._store;\n };\n /**\r\n * Initialize from data\r\n * @param data source or data or data store.\r\n * @param nameList The name of a datum is used on data diff and\r\n * default label/tooltip.\r\n * A name can be specified in encode.itemName,\r\n * or dataItem.name (only for series option data),\r\n * or provided in nameList from outside.\r\n */\n\n\n SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n var _this = this;\n\n var store;\n\n if (data instanceof DataStore) {\n store = data;\n }\n\n if (!store) {\n var dimensions = this.dimensions;\n var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n store = new DataStore();\n var dimensionInfos = map(dimensions, function (dimName) {\n return {\n type: _this._dimInfos[dimName].type,\n property: dimName\n };\n });\n store.initData(provider, dimensionInfos, dimValueGetter);\n }\n\n this._store = store; // Reset\n\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n this._doInit(0, store.count()); // Cache summary info for fast visit. See \"dimensionHelper\".\n // Needs to be initialized after store is prepared.\n\n\n this._dimSummary = summarizeDimensions(this, this._schema);\n this.userOutput = this._dimSummary.userOutput;\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n */\n\n\n SeriesData.prototype.appendData = function (data) {\n var range = this._store.appendData(data);\n\n this._doInit(range[0], range[1]);\n };\n /**\r\n * Caution: Can be only called on raw data (before `this._indices` created).\r\n * This method does not modify `rawData` (`dataProvider`), but only\r\n * add values to store.\r\n *\r\n * The final count will be increased by `Math.max(values.length, names.length)`.\r\n *\r\n * @param values That is the SourceType: 'arrayRows', like\r\n * [\r\n * [12, 33, 44],\r\n * [NaN, 43, 1],\r\n * ['-', 'asdf', 0]\r\n * ]\r\n * Each item is exactly corresponding to a dimension.\r\n */\n\n\n SeriesData.prototype.appendValues = function (values, names) {\n var _a = this._store.appendValues(values, names.length),\n start = _a.start,\n end = _a.end;\n\n var shouldMakeIdFromName = this._shouldMakeIdFromName();\n\n this._updateOrdinalMeta();\n\n if (names) {\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n this._nameList[idx] = names[sourceIdx];\n\n if (shouldMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n };\n\n SeriesData.prototype._updateOrdinalMeta = function () {\n var store = this._store;\n var dimensions = this.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = this._dimInfos[dimensions[i]];\n\n if (dimInfo.ordinalMeta) {\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n }\n }\n };\n\n SeriesData.prototype._shouldMakeIdFromName = function () {\n var provider = this._store.getProvider();\n\n return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n };\n\n SeriesData.prototype._doInit = function (start, end) {\n if (start >= end) {\n return;\n }\n\n var store = this._store;\n var provider = store.getProvider();\n\n this._updateOrdinalMeta();\n\n var nameList = this._nameList;\n var idList = this._idList;\n var sourceFormat = provider.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n if (isFormatOriginal && !provider.pure) {\n var sharedDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n var dataItem = provider.getItem(idx, sharedDataItem);\n\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n if (dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n }\n }\n\n if (this._shouldMakeIdFromName()) {\n for (var idx = start; idx < end; idx++) {\n makeIdFromName(this, idx);\n }\n }\n\n prepareInvertedIndex(this);\n };\n /**\r\n * PENDING: In fact currently this function is only used to short-circuit\r\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\r\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\r\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\r\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\r\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\r\n * be still needed.\r\n *\r\n * Optimize for the scenario that data is filtered by a given extent.\r\n * Consider that if data amount is more than hundreds of thousand,\r\n * extent calculation will cost more than 10ms and the cache will\r\n * be erased because of the filtering.\r\n */\n\n\n SeriesData.prototype.getApproximateExtent = function (dim) {\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n /**\r\n * Calculate extent on a filtered data might be time consuming.\r\n * Approximate extent is only used for: calculate extent of filtered data outside.\r\n */\n\n\n SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n SeriesData.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n SeriesData.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\r\n * @return Never be null/undefined. `number` will be converted to string. Because:\r\n * In most cases, name is used in display, where returning a string is more convenient.\r\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\r\n * rule that name `2` equals to name `'2'`.\r\n */\n\n\n SeriesData.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n\n SeriesData.prototype._getCategory = function (dimIdx, idx) {\n var ordinal = this._store.get(dimIdx, idx);\n\n var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n\n if (ordinalMeta) {\n return ordinalMeta.categories[ordinal];\n }\n\n return ordinal;\n };\n /**\r\n * @return Never null/undefined. `number` will be converted to string. Because:\r\n * In all cases having encountered at present, id is used in making diff comparison, which\r\n * are usually based on hash map. We can keep the rule that the internal id are always string\r\n * (treat `2` is the same as `'2'`) to make the related logic simple.\r\n */\n\n\n SeriesData.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n SeriesData.prototype.count = function () {\n return this._store.count();\n };\n /**\r\n * Get value. Return NaN if idx is out of range.\r\n *\r\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.get = function (dim, idx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.get(dimInfo.storeDimIndex, idx);\n }\n };\n /**\r\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\r\n */\n\n\n SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n }\n };\n\n SeriesData.prototype.getIndices = function () {\n return this._store.getIndices();\n };\n\n SeriesData.prototype.getDataExtent = function (dim) {\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getSum = function (dim) {\n return this._store.getSum(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getMedian = function (dim) {\n return this._store.getMedian(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getValues = function (dimensions, idx) {\n var _this = this;\n\n var store = this._store;\n return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n return _this._getStoreDimIndex(dim);\n }), idx) : store.getValues(dimensions);\n };\n /**\r\n * If value is NaN. Including '-'\r\n * Only check the coord dimensions.\r\n */\n\n\n SeriesData.prototype.hasValue = function (idx) {\n var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n\n for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\r\n * Retrieve the index with given name\r\n */\n\n\n SeriesData.prototype.indexOfName = function (name) {\n for (var i = 0, len = this._store.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n\n SeriesData.prototype.getRawIndex = function (idx) {\n return this._store.getRawIndex(idx);\n };\n\n SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n return this._store.indexOfRawIndex(rawIndex);\n };\n /**\r\n * Only support the dimension which inverted index created.\r\n * Do not support other cases until required.\r\n * @param dim concrete dim\r\n * @param value ordinal index\r\n * @return rawIndex\r\n */\n\n\n SeriesData.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\r\n * Retrieve the index of nearest value\r\n * @param dim\r\n * @param value\r\n * @param [maxDistance=Infinity]\r\n * @return If and only if multiple indices has\r\n * the same value, they are put to the result.\r\n */\n\n\n SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);\n };\n\n SeriesData.prototype.each = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n\n this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n\n SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return this;\n };\n /**\r\n * Select data in range. (For optimization of filter)\r\n * (Manually inline code, support 5 million data filtering in data zoom.)\r\n */\n\n\n SeriesData.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var innerRange = {};\n var dims = zrUtil.keys(range);\n var dimIndices = [];\n zrUtil.each(dims, function (dim) {\n var dimIdx = _this._getStoreDimIndex(dim);\n\n innerRange[dimIdx] = range[dim];\n dimIndices.push(dimIdx);\n });\n this._store = this._store.selectRange(innerRange);\n return this;\n };\n /* eslint-enable max-len */\n\n\n SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n 'use strict';\n\n if (zrUtil.isFunction(dims)) {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n var list = cloneListForMapAndSample(this);\n list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return list;\n };\n\n SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n var _this = this; // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(normalizeDimensions(dims), function (dim) {\n var dimInfo = _this.getDimensionInfo(dim);\n\n if (!dimInfo.isCalculationCoord) {\n console.error('Danger: only stack dimension can be modified');\n }\n });\n }\n\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series,\n // it still cost lots of memory, because `_store.dimensions` are not shared.\n // We should consider there probably be shallow clone happen in each series\n // in consequent filter/map.\n\n this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n /**\r\n * Large data down sampling on given dimension\r\n * @param sampleIndex Sample index for name and id\r\n */\n\n\n SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n return list;\n };\n /**\r\n * Large data down sampling using largest-triangle-three-buckets\r\n * @param {string} valueDimension\r\n * @param {number} targetCount\r\n */\n\n\n SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n return list;\n };\n\n SeriesData.prototype.getRawDataItem = function (idx) {\n return this._store.getRawDataItem(idx);\n };\n /**\r\n * Get model of one data item.\r\n */\n // TODO: Type of data item\n\n\n SeriesData.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\r\n * Create a data differ\r\n */\n\n\n SeriesData.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\r\n * Get visual property.\r\n */\n\n\n SeriesData.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n SeriesData.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\r\n * Get visual property of single data item\r\n */\n // eslint-disable-next-line\n\n\n SeriesData.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\r\n * If exists visual property of single data item\r\n */\n\n\n SeriesData.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\r\n * Make sure itemVisual property is unique\r\n */\n // TODO: use key to save visual to reduce memory.\n\n\n SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n SeriesData.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\r\n * Clear itemVisuals and list visual.\r\n */\n\n\n SeriesData.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n SeriesData.prototype.setLayout = function (key, val) {\n isObject(key) ? zrUtil.extend(this._layout, key) : this._layout[key] = val;\n };\n /**\r\n * Get layout property.\r\n */\n\n\n SeriesData.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\r\n * Get layout of single data item\r\n */\n\n\n SeriesData.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\r\n * Set layout of single data item\r\n */\n\n\n SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\r\n * Clear all layout of single data item\r\n */\n\n\n SeriesData.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\r\n * Set graphic element relative to data. It can be set as null\r\n */\n\n\n SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n setCommonECData(seriesIndex, this.dataType, idx, el);\n this._graphicEls[idx] = el;\n };\n\n SeriesData.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\r\n * Shallow clone a new list except visual and layout properties, and graph elements.\r\n * New list only change the indices.\r\n */\n\n\n SeriesData.prototype.cloneShallow = function (list) {\n if (!list) {\n list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n }\n\n transferProperties(list, this);\n list._store = this._store;\n return list;\n };\n /**\r\n * Wrap some method to add more feature\r\n */\n\n\n SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (!zrUtil.isFunction(originalMethod)) {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n SeriesData.internalField = function () {\n prepareInvertedIndex = function (data) {\n var invertedIndicesMap = data._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n var store = data._store;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < store.count(); i++) {\n // Only support the case that all values are distinct.\n invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (data, dimIdx, idx) {\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n };\n /**\r\n * @see the comment of `List['getId']`.\r\n */\n\n\n getId = function (data, rawIndex) {\n var id = data._idList[rawIndex];\n\n if (id == null && data._idDimIdx != null) {\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n /**\r\n * Data in excludeDimensions is copied, otherwise transferred.\r\n */\n\n\n cloneListForMapAndSample = function (original) {\n var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n return list;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (data, idx) {\n var nameList = data._nameList;\n var idList = data._idList;\n var nameDimIdx = data._nameDimIdx;\n var idDimIdx = data._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = data._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return SeriesData;\n}();\n\nexport default SeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { VISUAL_DIMENSIONS } from '../../util/types.js';\nimport SeriesDimensionDefine from '../SeriesDimensionDefine.js';\nimport { createHashMap, defaults, each, extend, isObject, isString } from 'zrender/lib/core/util.js';\nimport { createSourceFromSeriesDataOption, isSourceInstance } from '../Source.js';\nimport { CtorInt32Array } from '../DataStore.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { BE_ORDINAL, guessOrdinal } from './sourceHelper.js';\nimport { createDimNameMap, ensureSourceDimNameMap, SeriesDataSchema, shouldOmitUnusedDimensions } from './SeriesDataSchema.js';\n/**\r\n * For outside usage compat (like echarts-gl are using it).\r\n */\n\nexport function createDimensions(source, opt) {\n return prepareSeriesDataSchema(source, opt).dimensions;\n}\n/**\r\n * This method builds the relationship between:\r\n * + \"what the coord sys or series requires (see `coordDimensions`)\",\r\n * + \"what the user defines (in `encode` and `dimensions`, see `opt.dimensionsDefine` and `opt.encodeDefine`)\"\r\n * + \"what the data source provids (see `source`)\".\r\n *\r\n * Some guess strategy will be adapted if user does not define something.\r\n * If no 'value' dimension specified, the first no-named dimension will be\r\n * named as 'value'.\r\n *\r\n * @return The results are always sorted by `storeDimIndex` asc.\r\n */\n\nexport default function prepareSeriesDataSchema( // TODO: TYPE completeDimensions type\nsource, opt) {\n if (!isSourceInstance(source)) {\n source = createSourceFromSeriesDataOption(source);\n }\n\n opt = opt || {};\n var sysDims = opt.coordDimensions || [];\n var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];\n var coordDimNameMap = createHashMap();\n var resultList = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount); // Try to ignore unused dimensions if sharing a high dimension datastore\n // 30 is an experience value.\n\n var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);\n var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;\n var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);\n var encodeDef = opt.encodeDefine;\n\n if (!encodeDef && opt.encodeDefaulter) {\n encodeDef = opt.encodeDefaulter(source, dimCount);\n }\n\n var encodeDefMap = createHashMap(encodeDef);\n var indicesMap = new CtorInt32Array(dimCount);\n\n for (var i = 0; i < indicesMap.length; i++) {\n indicesMap[i] = -1;\n }\n\n function getResultItem(dimIdx) {\n var idx = indicesMap[dimIdx];\n\n if (idx < 0) {\n var dimDefItemRaw = dimsDef[dimIdx];\n var dimDefItem = isObject(dimDefItemRaw) ? dimDefItemRaw : {\n name: dimDefItemRaw\n };\n var resultItem = new SeriesDimensionDefine();\n var userDimName = dimDefItem.name;\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 displayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n var newIdx = resultList.length;\n indicesMap[dimIdx] = newIdx;\n resultItem.storeDimIndex = dimIdx;\n resultList.push(resultItem);\n return resultItem;\n }\n\n return resultList[idx];\n }\n\n if (!omitUnusedDimensions) {\n for (var i = 0; i < dimCount; i++) {\n getResultItem(i);\n }\n } // Set `coordDim` and `coordDimIndex` by `encodeDefMap` and normalize `encodeDefMap`.\n\n\n encodeDefMap.each(function (dataDimsRaw, coordDim) {\n var dataDims = normalizeToArray(dataDimsRaw).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 && !isString(dataDims[0]) && dataDims[0] < 0) {\n encodeDefMap.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDefMap.set(coordDim, []);\n each(dataDims, function (resultDimIdxOrName, idx) {\n // The input resultDimIdx can be dim name or index.\n var resultDimIdx = isString(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(getResultItem(resultDimIdx), coordDim, idx);\n }\n });\n }); // Apply templates and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItemRaw) {\n var coordDim;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n var sysDimItem;\n\n if (isString(sysDimItemRaw)) {\n coordDim = sysDimItemRaw;\n sysDimItem = {};\n } else {\n sysDimItem = sysDimItemRaw;\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = extend({}, 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 = encodeDefMap.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n 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 < dimCount && getResultItem(availDimIdx).coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < dimCount && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = getResultItem(resultDimIdx); // Coordinate system has a higher priority on dim type than source.\n\n if (isUsingSourceDimensionsDef && sysDimItem.type != null) {\n resultItem.type = sysDimItem.type;\n }\n\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 (VISUAL_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';\n\n function ifNoNameFillWithCoordName(resultItem) {\n if (resultItem.name == null) {\n // Duplication will be removed in the next step.\n resultItem.name = resultItem.coordDim;\n }\n } // Set dim `name` and other `coordDim` and other props.\n\n\n if (!omitUnusedDimensions) {\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = getResultItem(resultDimIdx);\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n // TODO no need to generate coordDim for isExtraCoord?\n resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0; // Series specified generateCoord is using out.\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n ifNoNameFillWithCoordName(resultItem);\n\n if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must // Consider the case:\n // {\n // dataset: {source: [\n // ['2001', 123],\n // ['2002', 456],\n // ...\n // ['The others', 987],\n // ]},\n // series: {type: 'pie'}\n // }\n // The first column should better be treated as a \"ordinal\" although it\n // might not be detected as an \"ordinal\" by `guessOrdinal`.\n || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {\n resultItem.type = 'ordinal';\n }\n }\n } else {\n each(resultList, function (resultItem) {\n // PENDING: guessOrdinal or let user specify type: 'ordinal' manually?\n ifNoNameFillWithCoordName(resultItem);\n }); // Sort dimensions: there are some rule that use the last dim as label,\n // and for some latter travel process easier.\n\n resultList.sort(function (item0, item1) {\n return item0.storeDimIndex - item1.storeDimIndex;\n });\n }\n\n removeDuplication(resultList);\n return new SeriesDataSchema({\n source: source,\n dimensions: resultList,\n fullDimensionCount: dimCount,\n dimensionOmitted: omitUnusedDimensions\n });\n}\n\nfunction removeDuplication(result) {\n var duplicationMap = createHashMap();\n\n for (var i = 0; i < result.length; i++) {\n var dim = result[i];\n var dimOriginalName = dim.name;\n var count = duplicationMap.get(dimOriginalName) || 0;\n\n if (count > 0) {\n // Starts from 0.\n dim.name = dimOriginalName + (count - 1);\n }\n\n count++;\n duplicationMap.set(dimOriginalName, count);\n }\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 calculate 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 data store?\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.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef;\n\n if (isObject(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {\n dimCount = Math.max(dimCount, sysDimItemDimsDef.length);\n }\n });\n return dimCount;\n}\n\nfunction genCoordDimName(name, map, fromZero) {\n if (fromZero || map.hasKey(name)) {\n var i = 0;\n\n while (map.hasKey(name + i)) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Helper for model references.\r\n * There are many manners to refer axis/coordSys.\r\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\nimport { createHashMap, retrieve, each } from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../util/model.js';\n/**\r\n * @class\r\n * For example:\r\n * {\r\n * coordSysName: 'cartesian2d',\r\n * coordSysDims: ['x', 'y', ...],\r\n * axisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: yAxisModel\r\n * }),\r\n * categoryAxisMap: HashMap({\r\n * x: xAxisModel,\r\n * y: undefined\r\n * }),\r\n * // The index of the first category axis in `coordSysDims`.\r\n * // `null/undefined` means no category axis exists.\r\n * firstCategoryDimIndex: 1,\r\n * // To replace user specified encode.\r\n * }\r\n */\n\nvar CoordSysInfo =\n/** @class */\nfunction () {\n function CoordSysInfo(coordSysName) {\n this.coordSysDims = [];\n this.axisMap = createHashMap();\n this.categoryAxisMap = createHashMap();\n this.coordSysName = coordSysName;\n }\n\n return CoordSysInfo;\n}();\n\nexport function getCoordSysInfoBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = new CoordSysInfo(coordSysName);\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!xAxisModel) {\n throw new Error('xAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('xAxisId'), 0) + '\" not found');\n }\n\n if (!yAxisModel) {\n throw new Error('yAxis \"' + retrieve(seriesModel.get('xAxisIndex'), seriesModel.get('yAxisId'), 0) + '\" not found');\n }\n }\n\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 == null && (result.firstCategoryDimIndex = 1);\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!singleAxisModel) {\n throw new Error('singleAxis should be specified.');\n }\n }\n\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', SINGLE_REFERRING).models[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!angleAxisModel) {\n throw new Error('angleAxis option not found');\n }\n\n if (!radiusAxisModel) {\n throw new Error('radiusAxis option not found');\n }\n }\n\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 == null && (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)) {\n categoryAxisMap.set(axisDim, axisModel);\n\n if (result.firstCategoryDimIndex == null) {\n result.firstCategoryDimIndex = index;\n }\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isString } from 'zrender/lib/core/util.js';\nimport { isSeriesDataSchema } from './SeriesDataSchema.js';\n/**\r\n * Note that it is too complicated to support 3d stack by value\r\n * (have to create two-dimension inverted index), so in 3d case\r\n * we just support that stacked by index.\r\n *\r\n * @param seriesModel\r\n * @param dimensionsInput The same as the input of .\r\n * The input will be modified.\r\n * @param opt\r\n * @param opt.stackedCoordDimension Specify a coord dimension if needed.\r\n * @param opt.byIndex=false\r\n * @return calculationInfo\r\n * {\r\n * stackedDimension: string\r\n * stackedByDimension: string\r\n * isStackedByIndex: boolean\r\n * stackedOverDimension: string\r\n * stackResultDimension: string\r\n * }\r\n */\n\nexport function enableDataStack(seriesModel, dimensionsInput, opt) {\n opt = opt || {};\n var byIndex = opt.byIndex;\n var stackedCoordDimension = opt.stackedCoordDimension;\n var dimensionDefineList;\n var schema;\n var store;\n\n if (isLegacyDimensionsInput(dimensionsInput)) {\n dimensionDefineList = dimensionsInput;\n } else {\n schema = dimensionsInput.schema;\n dimensionDefineList = schema.dimensions;\n store = dimensionsInput.store;\n } // Compatibal: when `stack` is set as '', do not stack.\n\n\n var mayStack = !!(seriesModel && seriesModel.get('stack'));\n var stackedByDimInfo;\n var stackedDimInfo;\n var stackResultDimension;\n var stackedOverDimension;\n each(dimensionDefineList, function (dimensionInfo, index) {\n if (isString(dimensionInfo)) {\n dimensionDefineList[index] = dimensionInfo = {\n name: dimensionInfo\n };\n }\n\n if (mayStack && !dimensionInfo.isExtraCoord) {\n // Find the first ordinal dimension as the stackedByDimInfo.\n if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {\n stackedByDimInfo = dimensionInfo;\n } // Find the first stackable dimension as the stackedDimInfo.\n\n\n if (!stackedDimInfo && dimensionInfo.type !== 'ordinal' && dimensionInfo.type !== 'time' && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {\n stackedDimInfo = dimensionInfo;\n }\n }\n });\n\n if (stackedDimInfo && !byIndex && !stackedByDimInfo) {\n // Compatible with previous design, value axis (time axis) only stack by index.\n // It may make sense if the user provides elaborately constructed data.\n byIndex = true;\n } // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`.\n // That put stack logic in List is for using conveniently in echarts extensions, but it\n // might not be a good way.\n\n\n if (stackedDimInfo) {\n // Use a weird name that not duplicated with other names.\n // Also need to use seriesModel.id as postfix because different\n // series may share same data store. The stack dimension needs to be distinguished.\n stackResultDimension = '__\\0ecstackresult_' + seriesModel.id;\n stackedOverDimension = '__\\0ecstackedover_' + seriesModel.id; // Create inverted index to fast query index by value.\n\n if (stackedByDimInfo) {\n stackedByDimInfo.createInvertedIndices = true;\n }\n\n var stackedDimCoordDim_1 = stackedDimInfo.coordDim;\n var stackedDimType = stackedDimInfo.type;\n var stackedDimCoordIndex_1 = 0;\n each(dimensionDefineList, function (dimensionInfo) {\n if (dimensionInfo.coordDim === stackedDimCoordDim_1) {\n stackedDimCoordIndex_1++;\n }\n });\n var stackedOverDimensionDefine = {\n name: stackResultDimension,\n coordDim: stackedDimCoordDim_1,\n coordDimIndex: stackedDimCoordIndex_1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length\n };\n var stackResultDimensionDefine = {\n name: stackedOverDimension,\n // This dimension contains stack base (generally, 0), so do not set it as\n // `stackedDimCoordDim` to avoid extent calculation, consider log scale.\n coordDim: stackedOverDimension,\n coordDimIndex: stackedDimCoordIndex_1 + 1,\n type: stackedDimType,\n isExtraCoord: true,\n isCalculationCoord: true,\n storeDimIndex: dimensionDefineList.length + 1\n };\n\n if (schema) {\n if (store) {\n stackedOverDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackedOverDimension, stackedDimType);\n stackResultDimensionDefine.storeDimIndex = store.ensureCalculationDimension(stackResultDimension, stackedDimType);\n }\n\n schema.appendCalculationDimension(stackedOverDimensionDefine);\n schema.appendCalculationDimension(stackResultDimensionDefine);\n } else {\n dimensionDefineList.push(stackedOverDimensionDefine);\n dimensionDefineList.push(stackResultDimensionDefine);\n }\n }\n\n return {\n stackedDimension: stackedDimInfo && stackedDimInfo.name,\n stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,\n isStackedByIndex: byIndex,\n stackedOverDimension: stackedOverDimension,\n stackResultDimension: stackResultDimension\n };\n}\n\nfunction isLegacyDimensionsInput(dimensionsInput) {\n return !isSeriesDataSchema(dimensionsInput.schema);\n}\n\nexport function isDimensionStacked(data, stackedDim) {\n // Each single series only maps to one pair of axis. So we do not need to\n // check stackByDim, whatever stacked by a dimension or stacked by index.\n return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');\n}\nexport function getStackedDimension(data, targetDim) {\n return isDimensionStacked(data, targetDim) ? data.getCalculationInfo('stackResultDimension') : targetDim;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { getDataItemValue } from '../../util/model.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { getCoordSysInfoBySeries } from '../../model/referHelper.js';\nimport { createSourceFromSeriesDataOption } from '../../data/Source.js';\nimport { enableDataStack } from '../../data/helper/dataStackHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\nimport { SOURCE_FORMAT_ORIGINAL } from '../../util/types.js';\n\nfunction getCoordSysDimDefs(seriesModel, coordSysInfo) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysDimDefs;\n\n if (coordSysInfo && coordSysInfo.coordSysDims) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n return coordSysDimDefs;\n}\n\nfunction injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n\n if (createInvertedIndices) {\n dimInfo.createInvertedIndices = true;\n }\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n return firstCategoryDimIndex;\n}\n/**\r\n * Caution: there are side effects to `sourceManager` in this method.\r\n * Should better only be called in `Series['getInitialData']`.\r\n */\n\n\nfunction createSeriesData(sourceRaw, seriesModel, opt) {\n opt = opt || {};\n var sourceManager = seriesModel.getSourceManager();\n var source;\n var isOriginalSource = false;\n\n if (sourceRaw) {\n isOriginalSource = true;\n source = createSourceFromSeriesDataOption(sourceRaw);\n } else {\n source = sourceManager.getSource(); // Is series.data. not dataset.\n\n isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;\n }\n\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);\n var useEncodeDefaulter = opt.useEncodeDefaulter;\n var encodeDefaulter = zrUtil.isFunction(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;\n var createDimensionOptions = {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefine: seriesModel.getEncode(),\n encodeDefaulter: encodeDefaulter,\n canOmitUnusedDimensions: !isOriginalSource\n };\n var schema = prepareSeriesDataSchema(source, createDimensionOptions);\n var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);\n var store = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;\n var stackCalculationInfo = enableDataStack(seriesModel, {\n schema: schema,\n store: store\n });\n var data = new SeriesData(schema, seriesModel);\n data.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n data.hasItemOption = false;\n data.initData( // Try to reuse the data store in sourceManager if using dataset.\n isOriginalSource ? source : store, null, dimValueGetter);\n return data;\n}\n\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\n\nfunction firstDataNotNull(arr) {\n var i = 0;\n\n while (i < arr.length && arr[i] == null) {\n i++;\n }\n\n return arr[i];\n}\n\nexport default createSeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\n\nvar LineSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LineSeriesModel, _super);\n\n function LineSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LineSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n LineSeriesModel.prototype.getInitialData = function (option) {\n if (process.env.NODE_ENV !== 'production') {\n var coordSys = option.coordinateSystem;\n\n if (coordSys !== 'polar' && coordSys !== 'cartesian2d') {\n throw new Error('Line not support coordinateSystem besides cartesian and polar');\n }\n }\n\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n LineSeriesModel.prototype.getLegendIcon = function (opt) {\n var group = new Group();\n var line = createSymbol('line', 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);\n group.add(line);\n line.setStyle(opt.lineStyle);\n var visualType = this.getData().getVisual('symbol');\n var visualRotate = this.getData().getVisual('symbolRotate');\n var symbolType = visualType === 'none' ? 'circle' : visualType; // Symbol size is 80% when there is a line\n\n var size = opt.itemHeight * 0.8;\n var symbol = createSymbol(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill);\n group.add(symbol);\n symbol.setStyle(opt.itemStyle);\n var symbolRotate = opt.iconRotate === 'inherit' ? visualRotate : opt.iconRotate || 0;\n symbol.rotation = symbolRotate * Math.PI / 180;\n symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n\n if (symbolType.indexOf('empty') > -1) {\n symbol.style.stroke = symbol.style.fill;\n symbol.style.fill = '#fff';\n symbol.style.lineWidth = 2;\n }\n\n return group;\n };\n\n LineSeriesModel.type = 'series.line';\n LineSeriesModel.dependencies = ['grid', 'polar'];\n LineSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 3,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n clip: true,\n label: {\n position: 'top'\n },\n // itemStyle: {\n // },\n endLabel: {\n show: false,\n valueAnimation: true,\n distance: 8\n },\n lineStyle: {\n width: 2,\n type: 'solid'\n },\n emphasis: {\n scale: true\n },\n // areaStyle: {\n // origin of areaStyle. Valid values:\n // `'auto'/null/undefined`: from axisLine to data\n // `'start'`: from min to data\n // `'end'`: from data to max\n // origin: 'auto'\n // },\n // false, 'start', 'end', 'middle'\n step: false,\n // Disabled if step is true\n smooth: false,\n smoothMonotone: null,\n symbol: 'emptyCircle',\n symbolSize: 4,\n symbolRotate: null,\n showSymbol: true,\n // `false`: follow the label interval strategy.\n // `true`: show all symbols.\n // `'auto'`: If possible, show all symbols, otherwise\n // follow the label interval strategy.\n showAllSymbol: 'auto',\n // Whether to connect break point.\n connectNulls: false,\n // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.\n sampling: 'none',\n animationEasing: 'linear',\n // Disable progressive\n progressive: 0,\n hoverLayerThreshold: Infinity,\n universalTransition: {\n divideShape: 'clone'\n },\n triggerLineEvent: false\n };\n return LineSeriesModel;\n}(SeriesModel);\n\nexport default LineSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { retrieveRawValue } from '../../data/helper/dataProvider.js';\nimport { isArray } from 'zrender/lib/core/util.js';\n/**\r\n * @return label string. Not null/undefined\r\n */\n\nexport function getDefaultLabel(data, dataIndex) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n var len = labelDims.length; // Simple optimization (in lots of cases, label dims length is 1)\n\n if (len === 1) {\n var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);\n return rawVal != null ? rawVal + '' : null;\n } else if (len) {\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n vals.push(retrieveRawValue(data, dataIndex, labelDims[i]));\n }\n\n return vals.join(' ');\n }\n}\nexport function getDefaultInterpolatedLabel(data, interpolatedValue) {\n var labelDims = data.mapDimensionsAll('defaultedLabel');\n\n if (!isArray(interpolatedValue)) {\n return interpolatedValue + '';\n }\n\n var vals = [];\n\n for (var i = 0; i < labelDims.length; i++) {\n var dimIndex = data.getDimensionIndex(labelDims[i]);\n\n if (dimIndex >= 0) {\n vals.push(interpolatedValue[dimIndex]);\n }\n }\n\n return vals.join(' ');\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport { getDefaultLabel } from './labelHelper.js';\nimport { extend } from 'zrender/lib/core/util.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar Symbol =\n/** @class */\nfunction (_super) {\n __extends(Symbol, _super);\n\n function Symbol(data, idx, seriesScope, opts) {\n var _this = _super.call(this) || this;\n\n _this.updateData(data, idx, seriesScope, opts);\n\n return _this;\n }\n\n Symbol.prototype._createSymbol = function (symbolType, data, idx, symbolSize, keepAspect) {\n // Remove paths created before\n this.removeAll(); // let symbolPath = createSymbol(\n // symbolType, -0.5, -0.5, 1, 1, color\n // );\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4150.\n\n var symbolPath = createSymbol(symbolType, -1, -1, 2, 2, null, keepAspect);\n symbolPath.attr({\n z2: 100,\n culling: true,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n }); // Rewrite drift method\n\n symbolPath.drift = driftSymbol;\n this._symbolType = symbolType;\n this.add(symbolPath);\n };\n /**\r\n * Stop animation\r\n * @param {boolean} toLastFrame\r\n */\n\n\n Symbol.prototype.stopSymbolAnimation = function (toLastFrame) {\n this.childAt(0).stopAnimation(null, toLastFrame);\n };\n\n Symbol.prototype.getSymbolType = function () {\n return this._symbolType;\n };\n /**\r\n * FIXME:\r\n * Caution: This method breaks the encapsulation of this module,\r\n * but it indeed brings convenience. So do not use the method\r\n * unless you detailedly know all the implements of `Symbol`,\r\n * especially animation.\r\n *\r\n * Get symbol path element.\r\n */\n\n\n Symbol.prototype.getSymbolPath = function () {\n return this.childAt(0);\n };\n /**\r\n * Highlight symbol\r\n */\n\n\n Symbol.prototype.highlight = function () {\n enterEmphasis(this.childAt(0));\n };\n /**\r\n * Downplay symbol\r\n */\n\n\n Symbol.prototype.downplay = function () {\n leaveEmphasis(this.childAt(0));\n };\n /**\r\n * @param {number} zlevel\r\n * @param {number} z\r\n */\n\n\n Symbol.prototype.setZ = function (zlevel, z) {\n var symbolPath = this.childAt(0);\n symbolPath.zlevel = zlevel;\n symbolPath.z = z;\n };\n\n Symbol.prototype.setDraggable = function (draggable, hasCursorOption) {\n var symbolPath = this.childAt(0);\n symbolPath.draggable = draggable;\n symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor;\n };\n /**\r\n * Update symbol properties\r\n */\n\n\n Symbol.prototype.updateData = function (data, idx, seriesScope, opts) {\n this.silent = false;\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n var seriesModel = data.hostModel;\n var symbolSize = Symbol.getSymbolSize(data, idx);\n var isInit = symbolType !== this._symbolType;\n var disableAnimation = opts && opts.disableAnimation;\n\n if (isInit) {\n var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect');\n\n this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);\n } else {\n var symbolPath = this.childAt(0);\n symbolPath.silent = false;\n var target = {\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2\n };\n disableAnimation ? symbolPath.attr(target) : graphic.updateProps(symbolPath, target, seriesModel, idx);\n saveOldStyle(symbolPath);\n }\n\n this._updateCommon(data, idx, symbolSize, seriesScope, opts);\n\n if (isInit) {\n var symbolPath = this.childAt(0);\n\n if (!disableAnimation) {\n var target = {\n scaleX: this._sizeX,\n scaleY: this._sizeY,\n style: {\n // Always fadeIn. Because it has fadeOut animation when symbol is removed..\n opacity: symbolPath.style.opacity\n }\n };\n symbolPath.scaleX = symbolPath.scaleY = 0;\n symbolPath.style.opacity = 0;\n graphic.initProps(symbolPath, target, seriesModel, idx);\n }\n }\n\n if (disableAnimation) {\n // Must stop leave transition manually if don't call initProps or updateProps.\n this.childAt(0).stopAnimation('leave');\n }\n };\n\n Symbol.prototype._updateCommon = function (data, idx, symbolSize, seriesScope, opts) {\n var symbolPath = this.childAt(0);\n var seriesModel = data.hostModel;\n var emphasisItemStyle;\n var blurItemStyle;\n var selectItemStyle;\n var focus;\n var blurScope;\n var emphasisDisabled;\n var labelStatesModels;\n var hoverScale;\n var cursorStyle;\n\n if (seriesScope) {\n emphasisItemStyle = seriesScope.emphasisItemStyle;\n blurItemStyle = seriesScope.blurItemStyle;\n selectItemStyle = seriesScope.selectItemStyle;\n focus = seriesScope.focus;\n blurScope = seriesScope.blurScope;\n labelStatesModels = seriesScope.labelStatesModels;\n hoverScale = seriesScope.hoverScale;\n cursorStyle = seriesScope.cursorStyle;\n emphasisDisabled = seriesScope.emphasisDisabled;\n }\n\n if (!seriesScope || data.hasItemOption) {\n var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n selectItemStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n blurItemStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n emphasisDisabled = emphasisModel.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n hoverScale = emphasisModel.getShallow('scale');\n cursorStyle = itemModel.getShallow('cursor');\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0);\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n symbolPath.x = symbolOffset[0];\n symbolPath.y = symbolOffset[1];\n }\n\n cursorStyle && symbolPath.attr('cursor', cursorStyle);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n if (symbolPath.__isEmptyBrush) {\n // fill and stroke will be swapped if it's empty.\n // So we cloned a new style to avoid it affecting the original style in visual storage.\n // TODO Better implementation. No empty logic!\n symbolPath.useStyle(extend({}, symbolStyle));\n } else {\n symbolPath.useStyle(symbolStyle);\n } // Disable decal because symbol scale will been applied on the decal.\n\n\n symbolPath.style.decal = null;\n symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);\n symbolPath.style.strokeNoScale = true;\n }\n\n var liftZ = data.getItemVisual(idx, 'liftZ');\n var z2Origin = this._z2;\n\n if (liftZ != null) {\n if (z2Origin == null) {\n this._z2 = symbolPath.z2;\n symbolPath.z2 += liftZ;\n }\n } else if (z2Origin != null) {\n symbolPath.z2 = z2Origin;\n this._z2 = null;\n }\n\n var useNameLabel = opts && opts.useNameLabel;\n setLabelStyle(symbolPath, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultText: getLabelDefaultText,\n inheritColor: visualColor,\n defaultOpacity: symbolStyle.opacity\n }); // Do not execute util needed.\n\n function getLabelDefaultText(idx) {\n return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx);\n }\n\n this._sizeX = symbolSize[0] / 2;\n this._sizeY = symbolSize[1] / 2;\n var emphasisState = symbolPath.ensureState('emphasis');\n emphasisState.style = emphasisItemStyle;\n symbolPath.ensureState('select').style = selectItemStyle;\n symbolPath.ensureState('blur').style = blurItemStyle; // null / undefined / true means to use default strategy.\n // 0 / false / negative number / NaN / Infinity means no scale.\n\n var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY) // PENDING: restrict hoverScale > 1? It seems unreasonable to scale down\n : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1; // always set scale to allow resetting\n\n emphasisState.scaleX = this._sizeX * scaleRatio;\n emphasisState.scaleY = this._sizeY * scaleRatio;\n this.setSymbolScale(1);\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n Symbol.prototype.setSymbolScale = function (scale) {\n this.scaleX = this.scaleY = scale;\n };\n\n Symbol.prototype.fadeOut = function (cb, seriesModel, opt) {\n var symbolPath = this.childAt(0);\n var dataIndex = getECData(this).dataIndex;\n var animationOpt = opt && opt.animation; // Avoid mistaken hover when fading out\n\n this.silent = symbolPath.silent = true; // Not show text when animating\n\n if (opt && opt.fadeLabel) {\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n graphic.removeElement(textContent, {\n style: {\n opacity: 0\n }\n }, seriesModel, {\n dataIndex: dataIndex,\n removeOpt: animationOpt,\n cb: function () {\n symbolPath.removeTextContent();\n }\n });\n }\n } else {\n symbolPath.removeTextContent();\n }\n\n graphic.removeElement(symbolPath, {\n style: {\n opacity: 0\n },\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: dataIndex,\n cb: cb,\n removeOpt: animationOpt\n });\n };\n\n Symbol.getSymbolSize = function (data, idx) {\n return normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n };\n\n return Symbol;\n}(graphic.Group);\n\nfunction driftSymbol(dx, dy) {\n this.parent.drift(dx, dy);\n}\n\nexport default Symbol;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport SymbolClz from './Symbol.js';\nimport { isObject } from 'zrender/lib/core/util.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\n\nfunction symbolNeedsDraw(data, point, idx, opt) {\n 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\n // the symbol element shape. We use the same clip shape here as\n // the line clip.\n && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, 'symbol') !== 'none';\n}\n\nfunction normalizeUpdateOpt(opt) {\n if (opt != null && !isObject(opt)) {\n opt = {\n isIgnore: opt\n };\n }\n\n return opt || {};\n}\n\nfunction makeSeriesScope(data) {\n var seriesModel = data.hostModel;\n var emphasisModel = seriesModel.getModel('emphasis');\n return {\n emphasisItemStyle: emphasisModel.getModel('itemStyle').getItemStyle(),\n blurItemStyle: seriesModel.getModel(['blur', 'itemStyle']).getItemStyle(),\n selectItemStyle: seriesModel.getModel(['select', 'itemStyle']).getItemStyle(),\n focus: emphasisModel.get('focus'),\n blurScope: emphasisModel.get('blurScope'),\n emphasisDisabled: emphasisModel.get('disabled'),\n hoverScale: emphasisModel.get('scale'),\n labelStatesModels: getLabelStatesModels(seriesModel),\n cursorStyle: seriesModel.get('cursor')\n };\n}\n\nvar SymbolDraw =\n/** @class */\nfunction () {\n function SymbolDraw(SymbolCtor) {\n this.group = new graphic.Group();\n this._SymbolCtor = SymbolCtor || SymbolClz;\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n SymbolDraw.prototype.updateData = function (data, opt) {\n // Remove progressive els.\n this._progressiveEls = null;\n opt = normalizeUpdateOpt(opt);\n var group = this.group;\n var seriesModel = data.hostModel;\n var oldData = this._data;\n var SymbolCtor = this._SymbolCtor;\n var disableAnimation = opt.disableAnimation;\n var seriesScope = makeSeriesScope(data);\n var symbolUpdateOpt = {\n disableAnimation: disableAnimation\n };\n\n var getSymbolPoint = opt.getSymbolPoint || function (idx) {\n return data.getItemLayout(idx);\n }; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n\n if (!oldData) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n var point = getSymbolPoint(newIdx);\n\n if (symbolNeedsDraw(data, point, newIdx, opt)) {\n var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n var point = getSymbolPoint(newIdx);\n\n if (!symbolNeedsDraw(data, point, newIdx, opt)) {\n group.remove(symbolEl);\n return;\n }\n\n var newSymbolType = data.getItemVisual(newIdx, 'symbol') || 'circle';\n var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();\n\n if (!symbolEl // Create a new if symbol type changed.\n || oldSymbolType && oldSymbolType !== newSymbolType) {\n group.remove(symbolEl);\n symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);\n symbolEl.setPosition(point);\n } else {\n symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);\n var target = {\n x: point[0],\n y: point[1]\n };\n disableAnimation ? symbolEl.attr(target) : graphic.updateProps(symbolEl, target, seriesModel);\n } // Add back\n\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && el.fadeOut(function () {\n group.remove(el);\n }, seriesModel);\n }).execute();\n this._getSymbolPoint = getSymbolPoint;\n this._data = data;\n };\n\n ;\n\n SymbolDraw.prototype.updateLayout = function () {\n var _this = this;\n\n var data = this._data;\n\n if (data) {\n // Not use animation\n data.eachItemGraphicEl(function (el, idx) {\n var point = _this._getSymbolPoint(idx);\n\n el.setPosition(point);\n el.markRedraw();\n });\n }\n };\n\n ;\n\n SymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._seriesScope = makeSeriesScope(data);\n this._data = null;\n this.group.removeAll();\n };\n\n ;\n /**\r\n * Update symbols draw by new data\r\n */\n\n SymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n // Clear\n this._progressiveEls = [];\n opt = normalizeUpdateOpt(opt);\n\n function updateIncrementalAndHover(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var point = data.getItemLayout(idx);\n\n if (symbolNeedsDraw(data, point, idx, opt)) {\n var el = new this._SymbolCtor(data, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n el.setPosition(point);\n this.group.add(el);\n data.setItemGraphicEl(idx, el);\n\n this._progressiveEls.push(el);\n }\n }\n };\n\n ;\n\n SymbolDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n SymbolDraw.prototype.remove = function (enableAnimation) {\n var group = this.group;\n var data = this._data; // Incremental model do not have this._data.\n\n if (data && enableAnimation) {\n data.eachItemGraphicEl(function (el) {\n el.fadeOut(function () {\n group.remove(el);\n }, data.hostModel);\n });\n } else {\n group.removeAll();\n }\n };\n\n ;\n return SymbolDraw;\n}();\n\nexport default SymbolDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { isNumber, map } from 'zrender/lib/core/util.js';\nexport function prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked = false;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0]\n /* , dims[1] */\n )) {\n // jshint ignore:line\n stacked = true;\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1]\n /* , dims[0] */\n )) {\n // jshint ignore:line\n stacked = true;\n dims[1] = stackResultDim;\n }\n\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\n\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n } // If origin is specified as a number, use it as\n // valueStart directly\n else if (isNumber(valueOrigin) && !isNaN(valueOrigin)) {\n valueStart = valueOrigin;\n } // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n } // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n } // If is one positive, and one negative, onZero shall be true\n\n }\n\n return valueStart;\n}\n\nexport function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\n/* global Float32Array */\n\nvar supportFloat32Array = typeof Float32Array !== 'undefined';\nvar Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;\nexport function createFloat32Array(arg) {\n if (isArray(arg)) {\n // Return self directly if don't support TypedArray.\n return supportFloat32Array ? new Float32Array(arg) : arg;\n } // Else is number\n\n\n return new Float32ArrayCtor(arg);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createFloat32Array } from '../../util/vendor.js';\n\nfunction diffData(oldData, newData) {\n var diffResult = [];\n newData.diff(oldData).add(function (idx) {\n diffResult.push({\n cmd: '+',\n idx: idx\n });\n }).update(function (newIdx, oldIdx) {\n diffResult.push({\n cmd: '=',\n idx: oldIdx,\n idx1: newIdx\n });\n }).remove(function (idx) {\n diffResult.push({\n cmd: '-',\n idx: idx\n });\n }).execute();\n return diffResult;\n}\n\nexport default function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {\n var diff = diffData(oldData, newData); // let newIdList = newData.mapArray(newData.getId);\n // let oldIdList = oldData.mapArray(oldData.getId);\n // convertToIntId(newIdList, oldIdList);\n // // FIXME One data ?\n // diff = arrayDiff(oldIdList, newIdList);\n\n var currPoints = [];\n var nextPoints = []; // Points for stacking base line\n\n var currStackedPoints = [];\n var nextStackedPoints = [];\n var status = [];\n var sortedIndices = [];\n var rawIndices = [];\n var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); // const oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin);\n\n var oldPoints = oldData.getLayout('points') || [];\n var newPoints = newData.getLayout('points') || [];\n\n for (var i = 0; i < diff.length; i++) {\n var diffItem = diff[i];\n var pointAdded = true;\n var oldIdx2 = void 0;\n var newIdx2 = void 0; // FIXME, animation is not so perfect when dataZoom window moves fast\n // Which is in case remvoing or add more than one data in the tail or head\n\n switch (diffItem.cmd) {\n case '=':\n oldIdx2 = diffItem.idx * 2;\n newIdx2 = diffItem.idx1 * 2;\n var currentX = oldPoints[oldIdx2];\n var currentY = oldPoints[oldIdx2 + 1];\n var nextX = newPoints[newIdx2];\n var nextY = newPoints[newIdx2 + 1]; // If previous data is NaN, use next point directly\n\n if (isNaN(currentX) || isNaN(currentY)) {\n currentX = nextX;\n currentY = nextY;\n }\n\n currPoints.push(currentX, currentY);\n nextPoints.push(nextX, nextY);\n currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(diffItem.idx1));\n break;\n\n case '+':\n var newIdx = diffItem.idx;\n var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;\n var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);\n newIdx2 = newIdx * 2;\n currPoints.push(oldPt[0], oldPt[1]);\n nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);\n var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);\n currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);\n nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);\n rawIndices.push(newData.getRawIndex(newIdx));\n break;\n\n case '-':\n pointAdded = false;\n } // Original indices\n\n\n if (pointAdded) {\n status.push(diffItem);\n sortedIndices.push(sortedIndices.length);\n }\n } // Diff result may be crossed if all items are changed\n // Sort by data index\n\n\n sortedIndices.sort(function (a, b) {\n return rawIndices[a] - rawIndices[b];\n });\n var len = currPoints.length;\n var sortedCurrPoints = createFloat32Array(len);\n var sortedNextPoints = createFloat32Array(len);\n var sortedCurrStackedPoints = createFloat32Array(len);\n var sortedNextStackedPoints = createFloat32Array(len);\n var sortedStatus = [];\n\n for (var i = 0; i < sortedIndices.length; i++) {\n var idx = sortedIndices[i];\n var i2 = i * 2;\n var idx2 = idx * 2;\n sortedCurrPoints[i2] = currPoints[idx2];\n sortedCurrPoints[i2 + 1] = currPoints[idx2 + 1];\n sortedNextPoints[i2] = nextPoints[idx2];\n sortedNextPoints[i2 + 1] = nextPoints[idx2 + 1];\n sortedCurrStackedPoints[i2] = currStackedPoints[idx2];\n sortedCurrStackedPoints[i2 + 1] = currStackedPoints[idx2 + 1];\n sortedNextStackedPoints[i2] = nextStackedPoints[idx2];\n sortedNextStackedPoints[i2 + 1] = nextStackedPoints[idx2 + 1];\n sortedStatus[i] = status[idx];\n }\n\n return {\n current: sortedCurrPoints,\n next: sortedNextPoints,\n stackedOnCurrent: sortedCurrStackedPoints,\n stackedOnNext: sortedNextStackedPoints,\n status: sortedStatus\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // Poly path support NaN point\n\nimport Path from 'zrender/lib/graphic/Path.js';\nimport PathProxy from 'zrender/lib/core/PathProxy.js';\nimport { cubicRootAt, cubicAt } from 'zrender/lib/core/curve.js';\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n/**\r\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\r\n * situations. This should be used when points are non-monotone neither in x or\r\n * y dimension.\r\n */\n\n\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1]; // Ignore duplicate point\n\n while (nextX === x && nextY === y && k < segLen) {\n k++;\n nextIdx += dir;\n idx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n x = points[idx * 2];\n y = points[idx * 2 + 1];\n dx = x - prevX;\n dy = y - prevY;\n }\n\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n var dir_1 = vx > 0 ? 1 : -1;\n cpx1 = x - dir_1 * lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + dir_1 * lenNextSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n var dir_2 = vy > 0 ? 1 : -1;\n cpx1 = x;\n cpy1 = y - dir_2 * lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + dir_2 * lenNextSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n}\n\nvar ECPolylineShape =\n/** @class */\nfunction () {\n function ECPolylineShape() {\n this.smooth = 0;\n this.smoothConstraint = true;\n }\n\n return ECPolylineShape;\n}();\n\nvar ECPolyline =\n/** @class */\nfunction (_super) {\n __extends(ECPolyline, _super);\n\n function ECPolyline(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polyline';\n return _this;\n }\n\n ECPolyline.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECPolyline.prototype.getDefaultShape = function () {\n return new ECPolylineShape();\n };\n\n ECPolyline.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length / 2; // const result = getBoundingBox(points, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n };\n\n ECPolyline.prototype.getPointOn = function (xOrY, dim) {\n if (!this.path) {\n this.createPathProxy();\n this.buildPath(this.path, this.shape);\n }\n\n var path = this.path;\n var data = path.data;\n var CMD = PathProxy.CMD;\n var x0;\n var y0;\n var isDimX = dim === 'x';\n var roots = [];\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n var x = void 0;\n var y = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var x3 = void 0;\n var y3 = void 0;\n var t = void 0;\n\n switch (cmd) {\n case CMD.M:\n x0 = data[i++];\n y0 = data[i++];\n break;\n\n case CMD.L:\n x = data[i++];\n y = data[i++];\n t = isDimX ? (xOrY - x0) / (x - x0) : (xOrY - y0) / (y - y0);\n\n if (t <= 1 && t >= 0) {\n var val = isDimX ? (y - y0) * t + y0 : (x - x0) * t + x0;\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n\n x0 = x;\n y0 = y;\n break;\n\n case CMD.C:\n x = data[i++];\n y = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n x3 = data[i++];\n y3 = data[i++];\n var nRoot = isDimX ? cubicRootAt(x0, x, x2, x3, xOrY, roots) : cubicRootAt(y0, y, y2, y3, xOrY, roots);\n\n if (nRoot > 0) {\n for (var i_1 = 0; i_1 < nRoot; i_1++) {\n var t_1 = roots[i_1];\n\n if (t_1 <= 1 && t_1 >= 0) {\n var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x, x2, x3, t_1);\n return isDimX ? [xOrY, val] : [val, xOrY];\n }\n }\n }\n\n x0 = x3;\n y0 = y3;\n break;\n }\n }\n };\n\n return ECPolyline;\n}(Path);\n\nexport { ECPolyline };\n\nvar ECPolygonShape =\n/** @class */\nfunction (_super) {\n __extends(ECPolygonShape, _super);\n\n function ECPolygonShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return ECPolygonShape;\n}(ECPolylineShape);\n\nvar ECPolygon =\n/** @class */\nfunction (_super) {\n __extends(ECPolygon, _super);\n\n function ECPolygon(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-polygon';\n return _this;\n }\n\n ECPolygon.prototype.getDefaultShape = function () {\n return new ECPolygonShape();\n };\n\n ECPolygon.prototype.buildPath = function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length / 2;\n var smoothMonotone = shape.smoothMonotone;\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i * 2], points[i * 2 + 1])) {\n break;\n }\n }\n }\n\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n };\n\n return ECPolygon;\n}(Path);\n\nexport { ECPolygon };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { round } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {\n var rect = cartesian.getArea();\n var x = rect.x;\n var y = rect.y;\n var width = rect.width;\n var height = rect.height;\n var lineWidth = seriesModel.get(['lineStyle', 'width']) || 2; // Expand the clip path a bit to avoid the border is clipped and looks thinner\n\n x -= lineWidth / 2;\n y -= lineWidth / 2;\n width += lineWidth;\n height += lineWidth; // fix: https://github.com/apache/incubator-echarts/issues/11369\n\n x = Math.floor(x);\n width = Math.round(width);\n var clipPath = new graphic.Rect({\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n }\n });\n\n if (hasAnimation) {\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isAxisInversed = baseAxis.inverse;\n\n if (isHorizontal) {\n if (isAxisInversed) {\n clipPath.shape.x += width;\n }\n\n clipPath.shape.width = 0;\n } else {\n if (!isAxisInversed) {\n clipPath.shape.y += height;\n }\n\n clipPath.shape.height = 0;\n }\n\n var duringCb = isFunction(during) ? function (percent) {\n during(percent, clipPath);\n } : null;\n graphic.initProps(clipPath, {\n shape: {\n width: width,\n height: height,\n x: x,\n y: y\n }\n }, seriesModel, null, done, duringCb);\n }\n\n return clipPath;\n}\n\nfunction createPolarClipPath(polar, hasAnimation, seriesModel) {\n var sectorArea = polar.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n\n var r0 = round(sectorArea.r0, 1);\n var r = round(sectorArea.r, 1);\n var clipPath = new graphic.Sector({\n shape: {\n cx: round(polar.cx, 1),\n cy: round(polar.cy, 1),\n r0: r0,\n r: r,\n startAngle: sectorArea.startAngle,\n endAngle: sectorArea.endAngle,\n clockwise: sectorArea.clockwise\n }\n });\n\n if (hasAnimation) {\n var isRadial = polar.getBaseAxis().dim === 'angle';\n\n if (isRadial) {\n clipPath.shape.endAngle = sectorArea.startAngle;\n } else {\n clipPath.shape.r = r0;\n }\n\n graphic.initProps(clipPath, {\n shape: {\n endAngle: sectorArea.endAngle,\n r: r\n }\n }, seriesModel);\n }\n\n return clipPath;\n}\n\nfunction createClipPath(coordSys, hasAnimation, seriesModel, done, during) {\n if (!coordSys) {\n return null;\n } else if (coordSys.type === 'polar') {\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n } else if (coordSys.type === 'cartesian2d') {\n return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);\n }\n\n return null;\n}\n\nexport { createGridClipPath, createPolarClipPath, createClipPath };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n return coordSys.type === type;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // FIXME step not support polar\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport lineAnimationDiff from './lineAnimationDiff.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as modelUtil from '../../util/model.js';\nimport { ECPolyline, ECPolygon } from './poly.js';\nimport ChartView from '../../view/Chart.js';\nimport { prepareDataCoordInfo, getStackedOnPoint } from './helper.js';\nimport { createGridClipPath, createPolarClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setStatesStylesFromModel, setStatesFlag, toggleHoverEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, labelInner } from '../../label/labelStyle.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nimport { convertToColorString } from '../../util/format.js';\nimport { lerp } from 'zrender/lib/tool/color.js';\n\nfunction isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n if (points1[i] !== points2[i]) {\n return;\n }\n }\n\n return true;\n}\n\nfunction bboxFromPoints(points) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (!isNaN(x)) {\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n }\n\n if (!isNaN(y)) {\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n }\n\n return [[minX, minY], [maxX, maxY]];\n}\n\nfunction getBoundingDiff(points1, points2) {\n var _a = bboxFromPoints(points1),\n min1 = _a[0],\n max1 = _a[1];\n\n var _b = bboxFromPoints(points2),\n min2 = _b[0],\n max2 = _b[1]; // Get a max value from each corner of two boundings.\n\n\n return Math.max(Math.abs(min1[0] - min2[0]), Math.abs(min1[1] - min2[1]), Math.abs(max1[0] - max2[0]), Math.abs(max1[1] - max2[1]));\n}\n\nfunction getSmooth(smooth) {\n return zrUtil.isNumber(smooth) ? smooth : smooth ? 0.5 : 0;\n}\n\nfunction getStackedOnPoints(coordSys, data, dataCoordInfo) {\n if (!dataCoordInfo.valueDim) {\n return [];\n }\n\n var len = data.count();\n var points = createFloat32Array(len * 2);\n\n for (var idx = 0; idx < len; idx++) {\n var pt = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);\n points[idx * 2] = pt[0];\n points[idx * 2 + 1] = pt[1];\n }\n\n return points;\n}\n\nfunction turnPointsIntoStep(points, coordSys, stepTurnAt, connectNulls) {\n var baseAxis = coordSys.getBaseAxis();\n var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1;\n var stepPoints = [];\n var i = 0;\n var stepPt = [];\n var pt = [];\n var nextPt = [];\n var filteredPoints = [];\n\n if (connectNulls) {\n for (i = 0; i < points.length; i += 2) {\n if (!isNaN(points[i]) && !isNaN(points[i + 1])) {\n filteredPoints.push(points[i], points[i + 1]);\n }\n }\n\n points = filteredPoints;\n }\n\n for (i = 0; i < points.length - 2; i += 2) {\n nextPt[0] = points[i + 2];\n nextPt[1] = points[i + 3];\n pt[0] = points[i];\n pt[1] = points[i + 1];\n stepPoints.push(pt[0], pt[1]);\n\n switch (stepTurnAt) {\n case 'end':\n stepPt[baseIndex] = nextPt[baseIndex];\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n break;\n\n case 'middle':\n var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2;\n var stepPt2 = [];\n stepPt[baseIndex] = stepPt2[baseIndex] = middle;\n stepPt[1 - baseIndex] = pt[1 - baseIndex];\n stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n stepPoints.push(stepPt2[0], stepPt2[1]);\n break;\n\n default:\n // default is start\n stepPt[baseIndex] = pt[baseIndex];\n stepPt[1 - baseIndex] = nextPt[1 - baseIndex];\n stepPoints.push(stepPt[0], stepPt[1]);\n }\n } // Last points\n\n\n stepPoints.push(points[i++], points[i++]);\n return stepPoints;\n}\n/**\r\n * Clip color stops to edge. Avoid creating too large gradients.\r\n * Which may lead to blurry when GPU acceleration is enabled. See #15680\r\n *\r\n * The stops has been sorted from small to large.\r\n */\n\n\nfunction clipColorStops(colorStops, maxSize) {\n var newColorStops = [];\n var len = colorStops.length; // coord will always < 0 in prevOutOfRangeColorStop.\n\n var prevOutOfRangeColorStop;\n var prevInRangeColorStop;\n\n function lerpStop(stop0, stop1, clippedCoord) {\n var coord0 = stop0.coord;\n var p = (clippedCoord - coord0) / (stop1.coord - coord0);\n var color = lerp(p, [stop0.color, stop1.color]);\n return {\n coord: clippedCoord,\n color: color\n };\n }\n\n for (var i = 0; i < len; i++) {\n var stop_1 = colorStops[i];\n var coord = stop_1.coord;\n\n if (coord < 0) {\n prevOutOfRangeColorStop = stop_1;\n } else if (coord > maxSize) {\n if (prevInRangeColorStop) {\n newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize));\n } else if (prevOutOfRangeColorStop) {\n // If there are two stops and coord range is between these two stops\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize));\n } // All following stop will be out of range. So just ignore them.\n\n\n break;\n } else {\n if (prevOutOfRangeColorStop) {\n newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0)); // Reset\n\n prevOutOfRangeColorStop = null;\n }\n\n newColorStops.push(stop_1);\n prevInRangeColorStop = stop_1;\n }\n }\n\n return newColorStops;\n}\n\nfunction getVisualGradient(data, coordSys, api) {\n var visualMetaList = data.getVisual('visualMeta');\n\n if (!visualMetaList || !visualMetaList.length || !data.count()) {\n // When data.count() is 0, gradient range can not be calculated.\n return;\n }\n\n if (coordSys.type !== 'cartesian2d') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style is only supported on cartesian2d.');\n }\n\n return;\n }\n\n var coordDim;\n var visualMeta;\n\n for (var i = visualMetaList.length - 1; i >= 0; i--) {\n var dimInfo = data.getDimensionInfo(visualMetaList[i].dimension);\n coordDim = dimInfo && dimInfo.coordDim; // Can only be x or y\n\n if (coordDim === 'x' || coordDim === 'y') {\n visualMeta = visualMetaList[i];\n break;\n }\n }\n\n if (!visualMeta) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Visual map on line style only support x or y dimension.');\n }\n\n return;\n } // If the area to be rendered is bigger than area defined by LinearGradient,\n // the canvas spec prescribes that the color of the first stop and the last\n // stop should be used. But if two stops are added at offset 0, in effect\n // browsers use the color of the second stop to render area outside\n // LinearGradient. So we can only infinitesimally extend area defined in\n // LinearGradient to render `outerColors`.\n\n\n var axis = coordSys.getAxis(coordDim); // dataToCoord mapping may not be linear, but must be monotonic.\n\n var colorStops = zrUtil.map(visualMeta.stops, function (stop) {\n // offset will be calculated later.\n return {\n coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)),\n color: stop.color\n };\n });\n var stopLen = colorStops.length;\n var outerColors = visualMeta.outerColors.slice();\n\n if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {\n colorStops.reverse();\n outerColors.reverse();\n }\n\n var colorStopsInRange = clipColorStops(colorStops, coordDim === 'x' ? api.getWidth() : api.getHeight());\n var inRangeStopLen = colorStopsInRange.length;\n\n if (!inRangeStopLen && stopLen) {\n // All stops are out of range. All will be the same color.\n return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color;\n }\n\n var tinyExtent = 10; // Arbitrary value: 10px\n\n var minCoord = colorStopsInRange[0].coord - tinyExtent;\n var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;\n var coordSpan = maxCoord - minCoord;\n\n if (coordSpan < 1e-3) {\n return 'transparent';\n }\n\n zrUtil.each(colorStopsInRange, function (stop) {\n stop.offset = (stop.coord - minCoord) / coordSpan;\n });\n colorStopsInRange.push({\n // NOTE: inRangeStopLen may still be 0 if stoplen is zero.\n offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,\n color: outerColors[1] || 'transparent'\n });\n colorStopsInRange.unshift({\n offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,\n color: outerColors[0] || 'transparent'\n });\n var gradient = new graphic.LinearGradient(0, 0, 0, 0, colorStopsInRange, true);\n gradient[coordDim] = minCoord;\n gradient[coordDim + '2'] = maxCoord;\n return gradient;\n}\n\nfunction getIsIgnoreFunc(seriesModel, data, coordSys) {\n var showAllSymbol = seriesModel.get('showAllSymbol');\n var isAuto = showAllSymbol === 'auto';\n\n if (showAllSymbol && !isAuto) {\n return;\n }\n\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (!categoryAxis) {\n return;\n } // Note that category label interval strategy might bring some weird effect\n // in some scenario: users may wonder why some of the symbols are not\n // displayed. So we show all symbols as possible as we can.\n\n\n if (isAuto // Simplify the logic, do not determine label overlap here.\n && canShowAllSymbolForCategory(categoryAxis, data)) {\n return;\n } // Otherwise follow the label interval strategy on category axis.\n\n\n var categoryDataDim = data.mapDimension(categoryAxis.dim);\n var labelMap = {};\n zrUtil.each(categoryAxis.getViewLabels(), function (labelItem) {\n var ordinalNumber = categoryAxis.scale.getRawOrdinalNumber(labelItem.tickValue);\n labelMap[ordinalNumber] = 1;\n });\n return function (dataIndex) {\n return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));\n };\n}\n\nfunction canShowAllSymbolForCategory(categoryAxis, data) {\n // In most cases, line is monotonous on category axis, and the label size\n // is close with each other. So we check the symbol size and some of the\n // label size alone with the category axis to estimate whether all symbol\n // can be shown without overlap.\n var axisExtent = categoryAxis.getExtent();\n var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count();\n isNaN(availSize) && (availSize = 0); // 0/0 is NaN.\n // Sampling some points, max 5.\n\n var dataLen = data.count();\n var step = Math.max(1, Math.round(dataLen / 5));\n\n for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {\n if (SymbolClz.getSymbolSize(data, dataIndex // Only for cartesian, where `isHorizontal` exists.\n )[categoryAxis.isHorizontal() ? 1 : 0] // Empirical number\n * 1.5 > availSize) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isPointNull(x, y) {\n return isNaN(x) || isNaN(y);\n}\n\nfunction getLastIndexNotNull(points) {\n var len = points.length / 2;\n\n for (; len > 0; len--) {\n if (!isPointNull(points[len * 2 - 2], points[len * 2 - 1])) {\n break;\n }\n }\n\n return len - 1;\n}\n\nfunction getPointAtIndex(points, idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n}\n\nfunction getIndexRange(points, xOrY, dim) {\n var len = points.length / 2;\n var dimIdx = dim === 'x' ? 0 : 1;\n var a;\n var b;\n var prevIndex = 0;\n var nextIndex = -1;\n\n for (var i = 0; i < len; i++) {\n b = points[i * 2 + dimIdx];\n\n if (isNaN(b) || isNaN(points[i * 2 + 1 - dimIdx])) {\n continue;\n }\n\n if (i === 0) {\n a = b;\n continue;\n }\n\n if (a <= xOrY && b >= xOrY || a >= xOrY && b <= xOrY) {\n nextIndex = i;\n break;\n }\n\n prevIndex = i;\n a = b;\n }\n\n return {\n range: [prevIndex, nextIndex],\n t: (xOrY - a) / (b - a)\n };\n}\n\nfunction anyStateShowEndLabel(seriesModel) {\n if (seriesModel.get(['endLabel', 'show'])) {\n return true;\n }\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n if (seriesModel.get([SPECIAL_STATES[i], 'endLabel', 'show'])) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n var endLabelModel_1 = seriesModel.getModel('endLabel');\n var valueAnimation_1 = endLabelModel_1.get('valueAnimation');\n var data_1 = seriesModel.getData();\n var labelAnimationRecord_1 = {\n lastFrameIndex: 0\n };\n var during = anyStateShowEndLabel(seriesModel) ? function (percent, clipRect) {\n lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);\n } : null;\n var isHorizontal = coordSys.getBaseAxis().isHorizontal();\n var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function () {\n var endLabel = lineView._endLabel;\n\n if (endLabel && hasAnimation) {\n if (labelAnimationRecord_1.originalX != null) {\n endLabel.attr({\n x: labelAnimationRecord_1.originalX,\n y: labelAnimationRecord_1.originalY\n });\n }\n }\n }, during); // Expand clip shape to avoid clipping when line value exceeds axis\n\n if (!seriesModel.get('clip', true)) {\n var rectShape = clipPath.shape;\n var expandSize = Math.max(rectShape.width, rectShape.height);\n\n if (isHorizontal) {\n rectShape.y -= expandSize;\n rectShape.height += expandSize * 2;\n } else {\n rectShape.x -= expandSize;\n rectShape.width += expandSize * 2;\n }\n } // Set to the final frame. To make sure label layout is right.\n\n\n if (during) {\n during(1, clipPath);\n }\n\n return clipPath;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (seriesModel.get(['endLabel', 'show'])) {\n console.warn('endLabel is not supported for lines in polar systems.');\n }\n }\n\n return createPolarClipPath(coordSys, hasAnimation, seriesModel);\n }\n}\n\nfunction getEndLabelStateSpecified(endLabelModel, coordSys) {\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var align = isHorizontal ? isBaseInversed ? 'right' : 'left' : 'center';\n var verticalAlign = isHorizontal ? 'middle' : isBaseInversed ? 'top' : 'bottom';\n return {\n normal: {\n align: endLabelModel.get('align') || align,\n verticalAlign: endLabelModel.get('verticalAlign') || verticalAlign\n }\n };\n}\n\nvar LineView =\n/** @class */\nfunction (_super) {\n __extends(LineView, _super);\n\n function LineView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n LineView.prototype.init = function () {\n var lineGroup = new graphic.Group();\n var symbolDraw = new SymbolDraw();\n this.group.add(symbolDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineGroup = lineGroup;\n };\n\n LineView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var lineStyleModel = seriesModel.getModel('lineStyle');\n var areaStyleModel = seriesModel.getModel('areaStyle');\n var points = data.getLayout('points') || [];\n var isCoordSysPolar = coordSys.type === 'polar';\n var prevCoordSys = this._coordSys;\n var symbolDraw = this._symbolDraw;\n var polyline = this._polyline;\n var polygon = this._polygon;\n var lineGroup = this._lineGroup;\n var hasAnimation = !ecModel.ssr && seriesModel.isAnimationEnabled();\n var isAreaChart = !areaStyleModel.isEmpty();\n var valueOrigin = areaStyleModel.get('origin');\n var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);\n var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);\n var showSymbol = seriesModel.get('showSymbol');\n var connectNulls = seriesModel.get('connectNulls');\n var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys); // Remove temporary symbols\n\n var oldData = this._data;\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n }); // Remove previous created symbols if showSymbol changed to false\n\n if (!showSymbol) {\n symbolDraw.remove();\n }\n\n group.add(lineGroup); // FIXME step not support polar\n\n var step = !isCoordSysPolar ? seriesModel.get('step') : false;\n var clipShapeForSymbol;\n\n if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {\n clipShapeForSymbol = coordSys.getArea(); // Avoid float number rounding error for symbol on the edge of axis extent.\n // See #7913 and `test/dataZoom-clip.html`.\n\n if (clipShapeForSymbol.width != null) {\n clipShapeForSymbol.x -= 0.1;\n clipShapeForSymbol.y -= 0.1;\n clipShapeForSymbol.width += 0.2;\n clipShapeForSymbol.height += 0.2;\n } else if (clipShapeForSymbol.r0) {\n clipShapeForSymbol.r0 -= 0.5;\n clipShapeForSymbol.r += 0.5;\n }\n }\n\n this._clipShapeForSymbol = clipShapeForSymbol;\n var visualColor = getVisualGradient(data, coordSys, api) || data.getVisual('style')[data.getVisual('drawType')]; // Initialization animation or coordinate system changed\n\n if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n });\n hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);\n\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n\n polyline = this._newPolyline(points);\n\n if (isAreaChart) {\n polygon = this._newPolygon(points, stackedOnPoints);\n } // If areaStyle is removed\n else if (polygon) {\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n }\n\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } else {\n if (isAreaChart && !polygon) {\n // If areaStyle is added\n polygon = this._newPolygon(points, stackedOnPoints);\n } else if (polygon && !isAreaChart) {\n // If areaStyle is removed\n lineGroup.remove(polygon);\n polygon = this._polygon = null;\n } // NOTE: Must update _endLabel before setClipPath.\n\n\n if (!isCoordSysPolar) {\n this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));\n } // Update clipPath\n\n\n var oldClipPath = lineGroup.getClipPath();\n\n if (oldClipPath) {\n var newClipPath = createLineClipPath(this, coordSys, false, seriesModel);\n graphic.initProps(oldClipPath, {\n shape: newClipPath.shape\n }, seriesModel);\n } else {\n lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));\n } // Always update, or it is wrong in the case turning on legend\n // because points are not changed.\n\n\n showSymbol && symbolDraw.updateData(data, {\n isIgnore: isIgnoreFunc,\n clipShape: clipShapeForSymbol,\n disableAnimation: true,\n getSymbolPoint: function (idx) {\n return [points[idx * 2], points[idx * 2 + 1]];\n }\n }); // In the case data zoom triggered refreshing frequently\n // Data may not change if line has a category axis. So it should animate nothing.\n\n if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points)) {\n if (hasAnimation) {\n this._doUpdateAnimation(data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls);\n } else {\n // Not do it in update with animation\n if (step) {\n // TODO If stacked series is not step\n points = turnPointsIntoStep(points, coordSys, step, connectNulls);\n\n if (stackedOnPoints) {\n stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step, connectNulls);\n }\n }\n\n polyline.setShape({\n points: points\n });\n polygon && polygon.setShape({\n points: points,\n stackedOnPoints: stackedOnPoints\n });\n }\n }\n }\n\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n polyline.useStyle(zrUtil.defaults( // Use color in lineStyle first\n lineStyleModel.getLineStyle(), {\n fill: 'none',\n stroke: visualColor,\n lineJoin: 'bevel'\n }));\n setStatesStylesFromModel(polyline, seriesModel, 'lineStyle');\n\n if (polyline.style.lineWidth > 0 && seriesModel.get(['emphasis', 'lineStyle', 'width']) === 'bolder') {\n var emphasisLineStyle = polyline.getState('emphasis').style;\n emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;\n } // Needs seriesIndex for focus\n\n\n getECData(polyline).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);\n var smooth = getSmooth(seriesModel.get('smooth'));\n var smoothMonotone = seriesModel.get('smoothMonotone');\n polyline.setShape({\n smooth: smooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n\n if (polygon) {\n var stackedOnSeries = data.getCalculationInfo('stackedOnSeries');\n var stackedOnSmooth = 0;\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: visualColor,\n opacity: 0.7,\n lineJoin: 'bevel',\n decal: data.getVisual('style').decal\n }));\n\n if (stackedOnSeries) {\n stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));\n }\n\n polygon.setShape({\n smooth: smooth,\n stackedOnSmooth: stackedOnSmooth,\n smoothMonotone: smoothMonotone,\n connectNulls: connectNulls\n });\n setStatesStylesFromModel(polygon, seriesModel, 'areaStyle'); // Needs seriesIndex for focus\n\n getECData(polygon).seriesIndex = seriesModel.seriesIndex;\n toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);\n }\n\n var changePolyState = function (toState) {\n _this._changePolyState(toState);\n };\n\n data.eachItemGraphicEl(function (el) {\n // Switch polyline / polygon state if element changed its state.\n el && (el.onHoverStateChange = changePolyState);\n });\n this._polyline.onHoverStateChange = changePolyState;\n this._data = data; // Save the coordinate system for transition animation when data changed\n\n this._coordSys = coordSys;\n this._stackedOnPoints = stackedOnPoints;\n this._points = points;\n this._step = step;\n this._valueOrigin = valueOrigin;\n\n if (seriesModel.get('triggerLineEvent')) {\n this.packEventData(seriesModel, polyline);\n polygon && this.packEventData(seriesModel, polygon);\n }\n };\n\n LineView.prototype.packEventData = function (seriesModel, el) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'line',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'line'\n };\n };\n\n LineView.prototype.highlight = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('emphasis');\n\n if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {\n var points = data.getLayout('points');\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (!symbol) {\n // Create a temporary symbol if it is not exists\n var x = points[dataIndex * 2];\n var y = points[dataIndex * 2 + 1];\n\n if (isNaN(x) || isNaN(y)) {\n // Null data\n return;\n } // fix #11360: shouldn't draw symbol outside clipShapeForSymbol\n\n\n if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x, y)) {\n return;\n }\n\n var zlevel = seriesModel.get('zlevel') || 0;\n var z = seriesModel.get('z') || 0;\n symbol = new SymbolClz(data, dataIndex);\n symbol.x = x;\n symbol.y = y;\n symbol.setZ(zlevel, z); // ensure label text of the temporary symbol is in front of line and area polygon\n\n var symbolLabel = symbol.getSymbolPath().getTextContent();\n\n if (symbolLabel) {\n symbolLabel.zlevel = zlevel;\n symbolLabel.z = z;\n symbolLabel.z2 = this._polyline.z2 + 1;\n }\n\n symbol.__temp = true;\n data.setItemGraphicEl(dataIndex, symbol); // Stop scale animation\n\n symbol.stopSymbolAnimation(true);\n this.group.add(symbol);\n }\n\n symbol.highlight();\n } else {\n // Highlight whole series\n ChartView.prototype.highlight.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype.downplay = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, payload);\n\n this._changePolyState('normal');\n\n if (dataIndex != null && dataIndex >= 0) {\n var symbol = data.getItemGraphicEl(dataIndex);\n\n if (symbol) {\n if (symbol.__temp) {\n data.setItemGraphicEl(dataIndex, null);\n this.group.remove(symbol);\n } else {\n symbol.downplay();\n }\n }\n } else {\n // FIXME\n // can not downplay completely.\n // Downplay whole series\n ChartView.prototype.downplay.call(this, seriesModel, ecModel, api, payload);\n }\n };\n\n LineView.prototype._changePolyState = function (toState) {\n var polygon = this._polygon;\n setStatesFlag(this._polyline, toState);\n polygon && setStatesFlag(polygon, toState);\n };\n\n LineView.prototype._newPolyline = function (points) {\n var polyline = this._polyline; // Remove previous created polyline\n\n if (polyline) {\n this._lineGroup.remove(polyline);\n }\n\n polyline = new ECPolyline({\n shape: {\n points: points\n },\n segmentIgnoreThreshold: 2,\n z2: 10\n });\n\n this._lineGroup.add(polyline);\n\n this._polyline = polyline;\n return polyline;\n };\n\n LineView.prototype._newPolygon = function (points, stackedOnPoints) {\n var polygon = this._polygon; // Remove previous created polygon\n\n if (polygon) {\n this._lineGroup.remove(polygon);\n }\n\n polygon = new ECPolygon({\n shape: {\n points: points,\n stackedOnPoints: stackedOnPoints\n },\n segmentIgnoreThreshold: 2\n });\n\n this._lineGroup.add(polygon);\n\n this._polygon = polygon;\n return polygon;\n };\n\n LineView.prototype._initSymbolLabelAnimation = function (data, coordSys, clipShape) {\n var isHorizontalOrRadial;\n var isCoordSysPolar;\n var baseAxis = coordSys.getBaseAxis();\n var isAxisInverse = baseAxis.inverse;\n\n if (coordSys.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n isCoordSysPolar = false;\n } else if (coordSys.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n isCoordSysPolar = true;\n }\n\n var seriesModel = data.hostModel;\n var seriesDuration = seriesModel.get('animationDuration');\n\n if (zrUtil.isFunction(seriesDuration)) {\n seriesDuration = seriesDuration(null);\n }\n\n var seriesDelay = seriesModel.get('animationDelay') || 0;\n var seriesDelayValue = zrUtil.isFunction(seriesDelay) ? seriesDelay(null) : seriesDelay;\n data.eachItemGraphicEl(function (symbol, idx) {\n var el = symbol;\n\n if (el) {\n var point = [symbol.x, symbol.y];\n var start = void 0;\n var end = void 0;\n var current = void 0;\n\n if (clipShape) {\n if (isCoordSysPolar) {\n var polarClip = clipShape;\n var coord = coordSys.pointToCoord(point);\n\n if (isHorizontalOrRadial) {\n start = polarClip.startAngle;\n end = polarClip.endAngle;\n current = -coord[1] / 180 * Math.PI;\n } else {\n start = polarClip.r0;\n end = polarClip.r;\n current = coord[0];\n }\n } else {\n var gridClip = clipShape;\n\n if (isHorizontalOrRadial) {\n start = gridClip.x;\n end = gridClip.x + gridClip.width;\n current = symbol.x;\n } else {\n start = gridClip.y + gridClip.height;\n end = gridClip.y;\n current = symbol.y;\n }\n }\n }\n\n var ratio = end === start ? 0 : (current - start) / (end - start);\n\n if (isAxisInverse) {\n ratio = 1 - ratio;\n }\n\n var delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue;\n var symbolPath = el.getSymbolPath();\n var text = symbolPath.getTextContent();\n el.attr({\n scaleX: 0,\n scaleY: 0\n });\n el.animateTo({\n scaleX: 1,\n scaleY: 1\n }, {\n duration: 200,\n setToFinal: true,\n delay: delay\n });\n\n if (text) {\n text.animateFrom({\n style: {\n opacity: 0\n }\n }, {\n duration: 300,\n delay: delay\n });\n }\n\n symbolPath.disableLabelAnimation = true;\n }\n });\n };\n\n LineView.prototype._initOrUpdateEndLabel = function (seriesModel, coordSys, inheritColor) {\n var endLabelModel = seriesModel.getModel('endLabel');\n\n if (anyStateShowEndLabel(seriesModel)) {\n var data_2 = seriesModel.getData();\n var polyline = this._polyline; // series may be filtered.\n\n var points = data_2.getLayout('points');\n\n if (!points) {\n polyline.removeTextContent();\n this._endLabel = null;\n return;\n }\n\n var endLabel = this._endLabel;\n\n if (!endLabel) {\n endLabel = this._endLabel = new graphic.Text({\n z2: 200 // should be higher than item symbol\n\n });\n endLabel.ignoreClip = true;\n polyline.setTextContent(this._endLabel);\n polyline.disableLabelAnimation = true;\n } // Find last non-NaN data to display data\n\n\n var dataIndex = getLastIndexNotNull(points);\n\n if (dataIndex >= 0) {\n setLabelStyle(polyline, getLabelStatesModels(seriesModel, 'endLabel'), {\n inheritColor: inheritColor,\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: function (dataIndex, opt, interpolatedValue) {\n return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex);\n },\n enableTextSetter: true\n }, getEndLabelStateSpecified(endLabelModel, coordSys));\n polyline.textConfig.position = null;\n }\n } else if (this._endLabel) {\n this._polyline.removeTextContent();\n\n this._endLabel = null;\n }\n };\n\n LineView.prototype._endLabelOnDuring = function (percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {\n var endLabel = this._endLabel;\n var polyline = this._polyline;\n\n if (endLabel) {\n // NOTE: Don't remove percent < 1. percent === 1 means the first frame during render.\n // The label is not prepared at this time.\n if (percent < 1 && animationRecord.originalX == null) {\n animationRecord.originalX = endLabel.x;\n animationRecord.originalY = endLabel.y;\n }\n\n var points = data.getLayout('points');\n var seriesModel = data.hostModel;\n var connectNulls = seriesModel.get('connectNulls');\n var precision = endLabelModel.get('precision');\n var distance = endLabelModel.get('distance') || 0;\n var baseAxis = coordSys.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var isBaseInversed = baseAxis.inverse;\n var clipShape = clipRect.shape;\n var xOrY = isBaseInversed ? isHorizontal ? clipShape.x : clipShape.y + clipShape.height : isHorizontal ? clipShape.x + clipShape.width : clipShape.y;\n var distanceX = (isHorizontal ? distance : 0) * (isBaseInversed ? -1 : 1);\n var distanceY = (isHorizontal ? 0 : -distance) * (isBaseInversed ? -1 : 1);\n var dim = isHorizontal ? 'x' : 'y';\n var dataIndexRange = getIndexRange(points, xOrY, dim);\n var indices = dataIndexRange.range;\n var diff = indices[1] - indices[0];\n var value = void 0;\n\n if (diff >= 1) {\n // diff > 1 && connectNulls, which is on the null data.\n if (diff > 1 && !connectNulls) {\n var pt = getPointAtIndex(points, indices[0]);\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n valueAnimation && (value = seriesModel.getRawValue(indices[0]));\n } else {\n var pt = polyline.getPointOn(xOrY, dim);\n pt && endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n var startValue = seriesModel.getRawValue(indices[0]);\n var endValue = seriesModel.getRawValue(indices[1]);\n valueAnimation && (value = modelUtil.interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));\n }\n\n animationRecord.lastFrameIndex = indices[0];\n } else {\n // If diff <= 0, which is the range is not found(Include NaN)\n // Choose the first point or last point.\n var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;\n var pt = getPointAtIndex(points, idx);\n valueAnimation && (value = seriesModel.getRawValue(idx));\n endLabel.attr({\n x: pt[0] + distanceX,\n y: pt[1] + distanceY\n });\n }\n\n if (valueAnimation) {\n var inner = labelInner(endLabel);\n\n if (typeof inner.setLabelText === 'function') {\n inner.setLabelText(value);\n }\n }\n }\n };\n /**\r\n * @private\r\n */\n // FIXME Two value axis\n\n\n LineView.prototype._doUpdateAnimation = function (data, stackedOnPoints, coordSys, api, step, valueOrigin, connectNulls) {\n var polyline = this._polyline;\n var polygon = this._polygon;\n var seriesModel = data.hostModel;\n var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin, valueOrigin);\n var current = diff.current;\n var stackedOnCurrent = diff.stackedOnCurrent;\n var next = diff.next;\n var stackedOnNext = diff.stackedOnNext;\n\n if (step) {\n // TODO If stacked series is not step\n current = turnPointsIntoStep(diff.current, coordSys, step, connectNulls);\n stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step, connectNulls);\n next = turnPointsIntoStep(diff.next, coordSys, step, connectNulls);\n stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step, connectNulls);\n } // Don't apply animation if diff is large.\n // For better result and avoid memory explosion problems like\n // https://github.com/apache/incubator-echarts/issues/12229\n\n\n if (getBoundingDiff(current, next) > 3000 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3000) {\n polyline.stopAnimation();\n polyline.setShape({\n points: next\n });\n\n if (polygon) {\n polygon.stopAnimation();\n polygon.setShape({\n points: next,\n stackedOnPoints: stackedOnNext\n });\n }\n\n return;\n }\n\n polyline.shape.__points = diff.current;\n polyline.shape.points = current;\n var target = {\n shape: {\n points: next\n }\n }; // Also animate the original points.\n // If points reference is changed when turning into step line.\n\n if (diff.current !== current) {\n target.shape.__points = diff.next;\n } // Stop previous animation.\n\n\n polyline.stopAnimation();\n graphic.updateProps(polyline, target, seriesModel);\n\n if (polygon) {\n polygon.setShape({\n // Reuse the points with polyline.\n points: current,\n stackedOnPoints: stackedOnCurrent\n });\n polygon.stopAnimation();\n graphic.updateProps(polygon, {\n shape: {\n stackedOnPoints: stackedOnNext\n }\n }, seriesModel); // If use attr directly in updateProps.\n\n if (polyline.shape.points !== polygon.shape.points) {\n polygon.shape.points = polyline.shape.points;\n }\n }\n\n var updatedDataInfo = [];\n var diffStatus = diff.status;\n\n for (var i = 0; i < diffStatus.length; i++) {\n var cmd = diffStatus[i].cmd;\n\n if (cmd === '=') {\n var el = data.getItemGraphicEl(diffStatus[i].idx1);\n\n if (el) {\n updatedDataInfo.push({\n el: el,\n ptIdx: i // Index of points\n\n });\n }\n }\n }\n\n if (polyline.animators && polyline.animators.length) {\n polyline.animators[0].during(function () {\n polygon && polygon.dirtyShape();\n var points = polyline.shape.__points;\n\n for (var i = 0; i < updatedDataInfo.length; i++) {\n var el = updatedDataInfo[i].el;\n var offset = updatedDataInfo[i].ptIdx * 2;\n el.x = points[offset];\n el.y = points[offset + 1];\n el.markRedraw();\n }\n });\n }\n };\n\n LineView.prototype.remove = function (ecModel) {\n var group = this.group;\n var oldData = this._data;\n\n this._lineGroup.removeAll();\n\n this._symbolDraw.remove(true); // Remove temporary created elements when highlighting\n\n\n oldData && oldData.eachItemGraphicEl(function (el, idx) {\n if (el.__temp) {\n group.remove(el);\n oldData.setItemGraphicEl(idx, null);\n }\n });\n this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;\n };\n\n LineView.type = 'line';\n return LineView;\n}(ChartView);\n\nexport default LineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { map } from 'zrender/lib/core/util.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport { createFloat32Array } from '../util/vendor.js';\nexport default function pointsLayout(seriesType, forceStoreInTypedArray) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var pipelineContext = seriesModel.pipelineContext;\n var useTypedArray = forceStoreInTypedArray || pipelineContext.large;\n\n if (!coordSys) {\n return;\n }\n\n var dims = map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }).slice(0, 2);\n var dimLen = dims.length;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (isDimensionStacked(data, dims[0])) {\n dims[0] = stackResultDim;\n }\n\n if (isDimensionStacked(data, dims[1])) {\n dims[1] = stackResultDim;\n }\n\n var store = data.getStore();\n var dimIdx0 = data.getDimensionIndex(dims[0]);\n var dimIdx1 = data.getDimensionIndex(dims[1]);\n return dimLen && {\n progress: function (params, data) {\n var segCount = params.end - params.start;\n var points = useTypedArray && createFloat32Array(segCount * dimLen);\n var tmpIn = [];\n var tmpOut = [];\n\n for (var i = params.start, offset = 0; i < params.end; i++) {\n var point = void 0;\n\n if (dimLen === 1) {\n var x = store.get(dimIdx0, i); // NOTE: Make sure the second parameter is null to use default strategy.\n\n point = coordSys.dataToPoint(x, null, tmpOut);\n } else {\n tmpIn[0] = store.get(dimIdx0, i);\n tmpIn[1] = store.get(dimIdx1, i); // Let coordinate system to handle the NaN data.\n\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n }\n\n if (useTypedArray) {\n points[offset++] = point[0];\n points[offset++] = point[1];\n } else {\n data.setItemLayout(i, point.slice());\n }\n }\n\n useTypedArray && data.setLayout('points', points);\n }\n };\n }\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\nvar samplers = {\n average: function (frame) {\n var sum = 0;\n var count = 0;\n\n for (var i = 0; i < frame.length; i++) {\n if (!isNaN(frame[i])) {\n sum += frame[i];\n count++;\n }\n } // Return NaN if count is 0\n\n\n return count === 0 ? NaN : sum / count;\n },\n sum: function (frame) {\n var sum = 0;\n\n for (var i = 0; i < frame.length; i++) {\n // Ignore NaN\n sum += frame[i] || 0;\n }\n\n return sum;\n },\n max: function (frame) {\n var max = -Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] > max && (max = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(max) ? max : NaN;\n },\n min: function (frame) {\n var min = Infinity;\n\n for (var i = 0; i < frame.length; i++) {\n frame[i] < min && (min = frame[i]);\n } // NaN will cause illegal axis extent.\n\n\n return isFinite(min) ? min : NaN;\n },\n // TODO\n // Median\n nearest: function (frame) {\n return frame[0];\n }\n};\n\nvar indexSampler = function (frame) {\n return Math.round(frame.length / 2);\n};\n\nexport default function dataSample(seriesType) {\n return {\n seriesType: seriesType,\n // FIXME:TS never used, so comment it\n // modifyOutputEnd: true,\n reset: function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var sampling = seriesModel.get('sampling');\n var coordSys = seriesModel.coordinateSystem;\n var count = data.count(); // Only cartesian2d support down sampling. Disable it when there is few data.\n\n if (count > 10 && coordSys.type === 'cartesian2d' && sampling) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var extent = baseAxis.getExtent();\n var dpr = api.getDevicePixelRatio(); // Coordinste system has been resized\n\n var size = Math.abs(extent[1] - extent[0]) * (dpr || 1);\n var rate = Math.round(count / size);\n\n if (isFinite(rate) && rate > 1) {\n if (sampling === 'lttb') {\n seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis.dim), 1 / rate));\n }\n\n var sampler = void 0;\n\n if (isString(sampling)) {\n sampler = samplers[sampling];\n } else if (isFunction(sampling)) {\n sampler = sampling;\n }\n\n if (sampler) {\n // Only support sample the first dim mapped from value axis.\n seriesModel.setData(data.downSample(data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler));\n }\n }\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LineSeries from './LineSeries.js';\nimport LineView from './LineView.js'; // In case developer forget to include grid component\n\nimport layoutPoints from '../../layout/points.js';\nimport dataSample from '../../processor/dataSample.js';\nexport function install(registers) {\n registers.registerChartView(LineView);\n registers.registerSeriesModel(LineSeries);\n registers.registerLayout(layoutPoints('line', true));\n registers.registerVisual({\n seriesType: 'line',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // Visual coding for legend\n\n var lineStyle = seriesModel.getModel('lineStyle').getLineStyle();\n\n if (lineStyle && !lineStyle.stroke) {\n // Fill in visual should be palette color if\n // has color callback\n lineStyle.stroke = data.getVisual('style').fill;\n }\n\n data.setVisual('legendLineStyle', lineStyle);\n }\n }); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('line'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, defaults, keys } from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\nimport createRenderPlanner from '../chart/helper/createRenderPlanner.js';\nimport { createFloat32Array } from '../util/vendor.js';\nvar STACK_PREFIX = '__ec_stack_';\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(axis) {\n return axis.dim + axis.index;\n}\n/**\r\n * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined.\r\n */\n\n\nexport function getLayoutOnAxis(opt) {\n var params = [];\n var baseAxis = opt.axis;\n var axisKey = 'axis0';\n\n if (baseAxis.type !== 'category') {\n return;\n }\n\n var bandWidth = baseAxis.getBandWidth();\n\n for (var i = 0; i < opt.count || 0; i++) {\n params.push(defaults({\n bandWidth: bandWidth,\n axisKey: axisKey,\n stackId: STACK_PREFIX + i\n }, opt));\n }\n\n var widthAndOffsets = doCalBarWidthAndOffset(params);\n var result = [];\n\n for (var i = 0; i < opt.count; i++) {\n var item = widthAndOffsets[axisKey][STACK_PREFIX + i];\n item.offsetCenter = item.offset + item.width / 2;\n result.push(item);\n }\n\n return result;\n}\nexport function prepareLayoutBarSeries(seriesType, ecModel) {\n var seriesModels = [];\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for cartesian2d only\n if (isOnCartesian(seriesModel)) {\n seriesModels.push(seriesModel);\n }\n });\n return seriesModels;\n}\n/**\r\n * Map from (baseAxis.dim + '_' + baseAxis.index) to min gap of two adjacent\r\n * values.\r\n * This works for time axes, value axes, and log axes.\r\n * For a single time axis, return value is in the form like\r\n * {'x_0': [1000000]}.\r\n * The value of 1000000 is in milliseconds.\r\n */\n\nfunction getValueAxesMinGaps(barSeries) {\n /**\r\n * Map from axis.index to values.\r\n * For a single time axis, axisValues is in the form like\r\n * {'x_0': [1495555200000, 1495641600000, 1495728000000]}.\r\n * Items in axisValues[x], e.g. 1495555200000, are time values of all\r\n * series.\r\n */\n var axisValues = {};\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n\n if (baseAxis.type !== 'time' && baseAxis.type !== 'value') {\n return;\n }\n\n var data = seriesModel.getData();\n var key = baseAxis.dim + '_' + baseAxis.index;\n var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var store = data.getStore();\n\n for (var i = 0, cnt = store.count(); i < cnt; ++i) {\n var value = store.get(dimIdx, i);\n\n if (!axisValues[key]) {\n // No previous data for the axis\n axisValues[key] = [value];\n } else {\n // No value in previous series\n axisValues[key].push(value);\n } // Ignore duplicated time values in the same axis\n\n }\n });\n var axisMinGaps = {};\n\n for (var key in axisValues) {\n if (axisValues.hasOwnProperty(key)) {\n var valuesInAxis = axisValues[key];\n\n if (valuesInAxis) {\n // Sort axis values into ascending order to calculate gaps\n valuesInAxis.sort(function (a, b) {\n return a - b;\n });\n var min = null;\n\n for (var j = 1; j < valuesInAxis.length; ++j) {\n var delta = valuesInAxis[j] - valuesInAxis[j - 1];\n\n if (delta > 0) {\n // Ignore 0 delta because they are of the same axis value\n min = min === null ? delta : Math.min(min, delta);\n }\n } // Set to null if only have one data\n\n\n axisMinGaps[key] = min;\n }\n }\n }\n\n return axisMinGaps;\n}\n\nexport function makeColumnLayout(barSeries) {\n var axisMinGaps = getValueAxesMinGaps(barSeries);\n var seriesInfoList = [];\n each(barSeries, function (seriesModel) {\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var axisExtent = baseAxis.getExtent();\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else if (baseAxis.type === 'value' || baseAxis.type === 'time') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n var minGap = axisMinGaps[key];\n var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);\n var scale = baseAxis.scale.getExtent();\n var scaleSpan = Math.abs(scale[1] - scale[0]);\n bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan; // When there is only one data value\n } else {\n var data = seriesModel.getData();\n bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n }\n\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barMinWidth = parsePercent( // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,\n // the auto-calculated bar width might be less than 0.5 / 1.\n seriesModel.get('barMinWidth') || (isInLargeMode(seriesModel) ? 0.5 : 1), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n seriesInfoList.push({\n bandWidth: bandWidth,\n barWidth: barWidth,\n barMaxWidth: barMaxWidth,\n barMinWidth: barMinWidth,\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n axisKey: getAxisKey(baseAxis),\n stackId: getSeriesStackId(seriesModel)\n });\n });\n return doCalBarWidthAndOffset(seriesInfoList);\n}\n\nfunction doCalBarWidthAndOffset(seriesInfoList) {\n // Columns info on each category axis. Key is cartesian name\n var columnsMap = {};\n each(seriesInfoList, function (seriesInfo, idx) {\n var axisKey = seriesInfo.axisKey;\n var bandWidth = seriesInfo.bandWidth;\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: null,\n gap: '20%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = seriesInfo.stackId;\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n }; // Caution: In a single coordinate system, these barGrid attributes\n // will be shared by series. Consider that they have default values,\n // only the attributes set on the last series will work.\n // Do not change this fact unless there will be a break change.\n\n var barWidth = seriesInfo.barWidth;\n\n if (barWidth && !stacks[stackId].width) {\n // See #6312, do not restrict width.\n stacks[stackId].width = barWidth;\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n var barMaxWidth = seriesInfo.barMaxWidth;\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n var barMinWidth = seriesInfo.barMinWidth;\n barMinWidth && (stacks[stackId].minWidth = barMinWidth);\n var barGap = seriesInfo.barGap;\n barGap != null && (columnsOnAxis.gap = barGap);\n var barCategoryGap = seriesInfo.barCategoryGap;\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGapPercent = columnsOnAxis.categoryGap;\n\n if (categoryGapPercent == null) {\n var columnCount = keys(stacks).length; // More columns in one group\n // the spaces between group is smaller. Or the column will be too thin.\n\n categoryGapPercent = Math.max(35 - columnCount * 4, 15) + '%';\n }\n\n var categoryGap = parsePercent(categoryGapPercent, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n each(stacks, function (column) {\n var maxWidth = column.maxWidth;\n var minWidth = column.minWidth;\n\n if (!column.width) {\n var finalWidth = autoWidth;\n\n if (maxWidth && maxWidth < finalWidth) {\n finalWidth = Math.min(maxWidth, remainedWidth);\n } // `minWidth` has higher priority. `minWidth` decide that whether the\n // bar is able to be visible. So `minWidth` should not be restricted\n // by `maxWidth` or `remainedWidth` (which is from `bandWidth`). In\n // the extreme cases for `value` axis, bars are allowed to overlap\n // with each other if `minWidth` specified.\n\n\n if (minWidth && minWidth > finalWidth) {\n finalWidth = minWidth;\n }\n\n if (finalWidth !== autoWidth) {\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n } else {\n // `barMinWidth/barMaxWidth` has higher priority than `barWidth`, as\n // CSS does. Because barWidth can be a percent value, where\n // `barMaxWidth` can be used to restrict the final width.\n var finalWidth = column.width;\n\n if (maxWidth) {\n finalWidth = Math.min(finalWidth, maxWidth);\n } // `minWidth` has higher priority, as described above\n\n\n if (minWidth) {\n finalWidth = Math.max(finalWidth, minWidth);\n }\n\n column.width = finalWidth;\n remainedWidth -= finalWidth + barGapPercent * finalWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n bandWidth: bandWidth,\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nfunction retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {\n if (barWidthAndOffset && axis) {\n var result = barWidthAndOffset[getAxisKey(axis)];\n\n if (result != null && seriesModel != null) {\n return result[getSeriesStackId(seriesModel)];\n }\n\n return result;\n }\n}\n\nexport { retrieveColumnLayout };\nexport function layout(seriesType, ecModel) {\n var seriesModels = prepareLayoutBarSeries(seriesType, ecModel);\n var barWidthAndOffset = makeColumnLayout(seriesModels);\n each(seriesModels, function (seriesModel) {\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n data.setLayout({\n bandWidth: columnLayoutInfo.bandWidth,\n offset: columnOffset,\n size: columnWidth\n });\n });\n} // TODO: Do not support stack in large mode yet.\n\nexport function createProgressiveLayout(seriesType) {\n return {\n seriesType: seriesType,\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n if (!isOnCartesian(seriesModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var valueAxis = cartesian.getOtherAxis(baseAxis);\n var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis.dim));\n var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));\n var drawBackground = seriesModel.get('showBackground', true);\n var valueDim = data.mapDimension(valueAxis.dim);\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo('stackedOnSeries');\n var isValueAxisH = valueAxis.isHorizontal();\n var valueAxisStart = getValueAxisStart(baseAxis, valueAxis);\n var isLarge = isInLargeMode(seriesModel);\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim); // Layout info.\n\n var columnWidth = data.getLayout('size');\n var columnOffset = data.getLayout('offset');\n return {\n progress: function (params, data) {\n var count = params.count;\n var largePoints = isLarge && createFloat32Array(count * 3);\n var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count * 3);\n var largeDataIndices = isLarge && createFloat32Array(count);\n var coordLayout = cartesian.master.getRect();\n var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;\n var dataIndex;\n var store = data.getStore();\n var idxOffset = 0;\n\n while ((dataIndex = params.next()) != null) {\n var value = store.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);\n var baseValue = store.get(baseDimIdx, dataIndex);\n var baseCoord = valueAxisStart;\n var startValue = void 0; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n\n if (stacked) {\n startValue = +value - store.get(valueDimIdx, dataIndex);\n }\n\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (isValueAxisH) {\n var coord = cartesian.dataToPoint([value, baseValue]);\n\n if (stacked) {\n var startCoord = cartesian.dataToPoint([startValue, baseValue]);\n baseCoord = startCoord[0];\n }\n\n x = baseCoord;\n y = coord[1] + columnOffset;\n width = coord[0] - baseCoord;\n height = columnWidth;\n\n if (Math.abs(width) < barMinHeight) {\n width = (width < 0 ? -1 : 1) * barMinHeight;\n }\n } else {\n var coord = cartesian.dataToPoint([baseValue, value]);\n\n if (stacked) {\n var startCoord = cartesian.dataToPoint([baseValue, startValue]);\n baseCoord = startCoord[1];\n }\n\n x = coord[0] + columnOffset;\n y = baseCoord;\n width = columnWidth;\n height = coord[1] - baseCoord;\n\n if (Math.abs(height) < barMinHeight) {\n // Include zero to has a positive bar\n height = (height <= 0 ? -1 : 1) * barMinHeight;\n }\n }\n\n if (!isLarge) {\n data.setItemLayout(dataIndex, {\n x: x,\n y: y,\n width: width,\n height: height\n });\n } else {\n largePoints[idxOffset] = x;\n largePoints[idxOffset + 1] = y;\n largePoints[idxOffset + 2] = isValueAxisH ? width : height;\n\n if (largeBackgroundPoints) {\n largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x;\n largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;\n largeBackgroundPoints[idxOffset + 2] = bgSize;\n }\n\n largeDataIndices[dataIndex] = dataIndex;\n }\n\n idxOffset += 3;\n }\n\n if (isLarge) {\n data.setLayout({\n largePoints: largePoints,\n largeDataIndices: largeDataIndices,\n largeBackgroundPoints: largeBackgroundPoints,\n valueAxisHorizontal: isValueAxisH\n });\n }\n }\n };\n }\n };\n}\n\nfunction isOnCartesian(seriesModel) {\n return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d';\n}\n\nfunction isInLargeMode(seriesModel) {\n return seriesModel.pipelineContext && seriesModel.pipelineContext.large;\n} // See cases in `test/bar-start.html` and `#7412`, `#8747`.\n\n\nfunction getValueAxisStart(baseAxis, valueAxis) {\n return valueAxis.toGlobalCoord(valueAxis.dataToCoord(valueAxis.type === 'log' ? 1 : 0));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { each } from 'zrender/lib/core/util.js';\n\nvar BaseBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BaseBarSeriesModel, _super);\n\n function BaseBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BaseBarSeriesModel.type;\n return _this;\n }\n\n BaseBarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n BaseBarSeriesModel.prototype.getMarkerPosition = function (value, dims, startingAtTick) {\n var coordSys = this.coordinateSystem;\n\n if (coordSys && coordSys.clampData) {\n // PENDING if clamp ?\n var clampData_1 = coordSys.clampData(value);\n var pt_1 = coordSys.dataToPoint(clampData_1);\n\n if (startingAtTick) {\n each(coordSys.getAxes(), function (axis, idx) {\n // If axis type is category, use tick coords instead\n if (axis.type === 'category' && dims != null) {\n var tickCoords = axis.getTicksCoords();\n var targetTickId = clampData_1[idx]; // The index of rightmost tick of markArea is 1 larger than x1/y1 index\n\n var isEnd = dims[idx] === 'x1' || dims[idx] === 'y1';\n\n if (isEnd) {\n targetTickId += 1;\n } // The only contains one tick, tickCoords is\n // like [{coord: 0, tickValue: 0}, {coord: 0}]\n // to the length should always be larger than 1\n\n\n if (tickCoords.length < 2) {\n return;\n } else if (tickCoords.length === 2) {\n // The left value and right value of the axis are\n // the same. coord is 0 in both items. Use the max\n // value of the axis as the coord\n pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]);\n return;\n }\n\n var leftCoord = void 0;\n var coord = void 0;\n var stepTickValue = 1;\n\n for (var i = 0; i < tickCoords.length; i++) {\n var tickCoord = tickCoords[i].coord; // The last item of tickCoords doesn't contain\n // tickValue\n\n var tickValue = i === tickCoords.length - 1 ? tickCoords[i - 1].tickValue + stepTickValue : tickCoords[i].tickValue;\n\n if (tickValue === targetTickId) {\n coord = tickCoord;\n break;\n } else if (tickValue < targetTickId) {\n leftCoord = tickCoord;\n } else if (leftCoord != null && tickValue > targetTickId) {\n coord = (tickCoord + leftCoord) / 2;\n break;\n }\n\n if (i === 1) {\n // Here we assume the step of category axes is\n // the same\n stepTickValue = tickValue - tickCoords[0].tickValue;\n }\n }\n\n if (coord == null) {\n if (!leftCoord) {\n // targetTickId is smaller than all tick ids in the\n // visible area, use the leftmost tick coord\n coord = tickCoords[0].coord;\n } else if (leftCoord) {\n // targetTickId is larger than all tick ids in the\n // visible area, use the rightmost tick coord\n coord = tickCoords[tickCoords.length - 1].coord;\n }\n }\n\n pt_1[idx] = axis.toGlobalCoord(coord);\n }\n });\n } else {\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt_1[offsetIndex] += offset + size / 2;\n }\n\n return pt_1;\n }\n\n return [NaN, NaN];\n };\n\n BaseBarSeriesModel.type = 'series.__base_bar__';\n BaseBarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n barMinHeight: 0,\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod'\n };\n return BaseBarSeriesModel;\n}(SeriesModel);\n\nSeriesModel.registerClass(BaseBarSeriesModel);\nexport default BaseBarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar BarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BarSeriesModel, _super);\n\n function BarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BarSeriesModel.type;\n return _this;\n }\n\n BarSeriesModel.prototype.getInitialData = function () {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true,\n createInvertedIndices: !!this.get('realtimeSort', true) || null\n });\n };\n /**\r\n * @override\r\n */\n\n\n BarSeriesModel.prototype.getProgressive = function () {\n // Do not support progressive in normal mode.\n return this.get('large') ? this.get('progressive') : false;\n };\n /**\r\n * @override\r\n */\n\n\n BarSeriesModel.prototype.getProgressiveThreshold = function () {\n // Do not support progressive in normal mode.\n var progressiveThreshold = this.get('progressiveThreshold');\n var largeThreshold = this.get('largeThreshold');\n\n if (largeThreshold > progressiveThreshold) {\n progressiveThreshold = largeThreshold;\n }\n\n return progressiveThreshold;\n };\n\n BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.rect(data.getItemLayout(dataIndex));\n };\n\n BarSeriesModel.type = 'series.bar';\n BarSeriesModel.dependencies = ['grid', 'polar'];\n BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n // If clipped\n // Only available on cartesian2d\n clip: true,\n roundCap: false,\n showBackground: false,\n backgroundStyle: {\n color: 'rgba(180, 180, 180, 0.2)',\n borderColor: null,\n borderWidth: 0,\n borderType: 'solid',\n borderRadius: 0,\n shadowBlur: 0,\n shadowColor: null,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n realtimeSort: false\n });\n return BarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default BarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { Path } from '../graphic.js';\n/**\r\n * Sausage: similar to sector, but have half circle on both sides\r\n */\n\nvar SausageShape =\n/** @class */\nfunction () {\n function SausageShape() {\n this.cx = 0;\n this.cy = 0;\n this.r0 = 0;\n this.r = 0;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clockwise = true;\n }\n\n return SausageShape;\n}();\n\nvar SausagePath =\n/** @class */\nfunction (_super) {\n __extends(SausagePath, _super);\n\n function SausagePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'sausage';\n return _this;\n }\n\n SausagePath.prototype.getDefaultShape = function () {\n return new SausageShape();\n };\n\n SausagePath.prototype.buildPath = function (ctx, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var dr = (r - r0) * 0.5;\n var rCenter = r0 + dr;\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var PI2 = Math.PI * 2;\n var lessThanCircle = clockwise ? endAngle - startAngle < PI2 : startAngle - endAngle < PI2;\n\n if (!lessThanCircle) {\n // Normalize angles\n startAngle = endAngle - (clockwise ? PI2 : -PI2);\n }\n\n var unitStartX = Math.cos(startAngle);\n var unitStartY = Math.sin(startAngle);\n var unitEndX = Math.cos(endAngle);\n var unitEndY = Math.sin(endAngle);\n\n if (lessThanCircle) {\n ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);\n ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);\n } else {\n ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);\n }\n\n ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);\n ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);\n\n if (r0 !== 0) {\n ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);\n } // ctx.closePath();\n\n };\n\n return SausagePath;\n}(Path);\n\nexport default SausagePath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { calculateTextPosition } from 'zrender/lib/contain/text.js';\nimport { isArray, isNumber } from 'zrender/lib/core/util.js';\nexport function createSectorCalculateTextPosition(positionMapping, opts) {\n opts = opts || {};\n var isRoundCap = opts.isRoundCap;\n return function (out, opts, boundingRect) {\n var textPosition = opts.position;\n\n if (!textPosition || textPosition instanceof Array) {\n return calculateTextPosition(out, opts, boundingRect);\n }\n\n var mappedSectorPosition = positionMapping(textPosition);\n var distance = opts.distance != null ? opts.distance : 5;\n var sector = this.shape;\n var cx = sector.cx;\n var cy = sector.cy;\n var r = sector.r;\n var r0 = sector.r0;\n var middleR = (r + r0) / 2;\n var startAngle = sector.startAngle;\n var endAngle = sector.endAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;\n var mathCos = Math.cos;\n var mathSin = Math.sin; // base position: top-left\n\n var x = cx + r * mathCos(startAngle);\n var y = cy + r * mathSin(startAngle);\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n\n switch (mappedSectorPosition) {\n case 'startArc':\n x = cx + (r0 - distance) * mathCos(middleAngle);\n y = cy + (r0 - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n\n case 'insideStartArc':\n x = cx + (r0 + distance) * mathCos(middleAngle);\n y = cy + (r0 + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'startAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, distance + extraDist, false);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideStartAngle':\n x = cx + middleR * mathCos(startAngle) + adjustAngleDistanceX(startAngle, -distance + extraDist, false);\n y = cy + middleR * mathSin(startAngle) + adjustAngleDistanceY(startAngle, -distance + extraDist, false);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n\n case 'middle':\n x = cx + middleR * mathCos(middleAngle);\n y = cy + middleR * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n\n case 'endArc':\n x = cx + (r + distance) * mathCos(middleAngle);\n y = cy + (r + distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideEndArc':\n x = cx + (r - distance) * mathCos(middleAngle);\n y = cy + (r - distance) * mathSin(middleAngle);\n textAlign = 'center';\n textVerticalAlign = 'top';\n break;\n\n case 'endAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, distance + extraDist, true);\n textAlign = 'left';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideEndAngle':\n x = cx + middleR * mathCos(endAngle) + adjustAngleDistanceX(endAngle, -distance + extraDist, true);\n y = cy + middleR * mathSin(endAngle) + adjustAngleDistanceY(endAngle, -distance + extraDist, true);\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n default:\n return calculateTextPosition(out, opts, boundingRect);\n }\n\n out = out || {};\n out.x = x;\n out.y = y;\n out.align = textAlign;\n out.verticalAlign = textVerticalAlign;\n return out;\n };\n}\nexport function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) {\n if (isNumber(rotateType)) {\n // user-set rotation\n sector.setTextConfig({\n rotation: rotateType\n });\n return;\n } else if (isArray(textPosition)) {\n // user-set position, use 0 as auto rotation\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n\n var shape = sector.shape;\n var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;\n var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;\n var middleAngle = (startAngle + endAngle) / 2;\n var anchorAngle;\n var mappedSectorPosition = positionMapping(textPosition);\n\n switch (mappedSectorPosition) {\n case 'startArc':\n case 'insideStartArc':\n case 'middle':\n case 'insideEndArc':\n case 'endArc':\n anchorAngle = middleAngle;\n break;\n\n case 'startAngle':\n case 'insideStartAngle':\n anchorAngle = startAngle;\n break;\n\n case 'endAngle':\n case 'insideEndAngle':\n anchorAngle = endAngle;\n break;\n\n default:\n sector.setTextConfig({\n rotation: 0\n });\n return;\n }\n\n var rotate = Math.PI * 1.5 - anchorAngle;\n /**\r\n * TODO: labels with rotate > Math.PI / 2 should be rotate another\r\n * half round flipped to increase readability. However, only middle\r\n * position supports this for now, because in other positions, the\r\n * anchor point is not at the center of the text, so the positions\r\n * after rotating is not as expected.\r\n */\n\n if (mappedSectorPosition === 'middle' && rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n rotate -= Math.PI;\n }\n\n sector.setTextConfig({\n rotation: rotate\n });\n}\n\nfunction adjustAngleDistanceX(angle, distance, isEnd) {\n return distance * Math.sin(angle) * (isEnd ? -1 : 1);\n}\n\nfunction adjustAngleDistanceY(angle, distance, isEnd) {\n return distance * Math.cos(angle) * (isEnd ? 1 : -1);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray, map } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nexport function getSectorCornerRadius(model, shape, zeroIfNull) {\n var cornerRadius = model.get('borderRadius');\n\n if (cornerRadius == null) {\n return zeroIfNull ? {\n cornerRadius: 0\n } : null;\n }\n\n if (!isArray(cornerRadius)) {\n cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];\n }\n\n var dr = Math.abs(shape.r || 0 - shape.r0 || 0);\n return {\n cornerRadius: map(cornerRadius, function (cr) {\n return parsePercent(cr, dr);\n })\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport { extend, each, map } from 'zrender/lib/core/util.js';\nimport { Rect, Sector, updateProps, initProps, removeElementWithFadeOut, traverseElements } from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels, setLabelValueAnimation, labelInner } from '../../label/labelStyle.js';\nimport { throttle } from '../../util/throttle.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getDefaultLabel, getDefaultInterpolatedLabel } from '../helper/labelHelper.js';\nimport { warn } from '../../util/log.js';\nimport { createSectorCalculateTextPosition, setSectorTextRotation } from '../../label/sectorLabel.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\n\nfunction getClipArea(coord, data) {\n var coordSysClipArea = coord.getArea && coord.getArea();\n\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var baseAxis = coord.getBaseAxis(); // When boundaryGap is false or using time axis. bar may exceed the grid.\n // We should not clip this part.\n // See test/bar2.html\n\n if (baseAxis.type !== 'category' || !baseAxis.onBand) {\n var expandWidth = data.getLayout('bandWidth');\n\n if (baseAxis.isHorizontal()) {\n coordSysClipArea.x -= expandWidth;\n coordSysClipArea.width += expandWidth * 2;\n } else {\n coordSysClipArea.y -= expandWidth;\n coordSysClipArea.height += expandWidth * 2;\n }\n }\n }\n\n return coordSysClipArea;\n}\n\nvar BarView =\n/** @class */\nfunction (_super) {\n __extends(BarView, _super);\n\n function BarView() {\n var _this = _super.call(this) || this;\n\n _this.type = BarView.type;\n _this._isFirstFrame = true;\n return _this;\n }\n\n BarView.prototype.render = function (seriesModel, ecModel, api, payload) {\n this._model = seriesModel;\n\n this._removeOnRenderedListener(api);\n\n this._updateDrawMode(seriesModel);\n\n var coordinateSystemType = seriesModel.get('coordinateSystem');\n\n if (coordinateSystemType === 'cartesian2d' || coordinateSystemType === 'polar') {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api) : this._renderNormal(seriesModel, ecModel, api, payload);\n } else if (process.env.NODE_ENV !== 'production') {\n warn('Only cartesian2d and polar supported for bar.');\n }\n };\n\n BarView.prototype.incrementalPrepareRender = function (seriesModel) {\n this._clear();\n\n this._updateDrawMode(seriesModel); // incremental also need to clip, otherwise might be overlow.\n // But must not set clip in each frame, otherwise all of the children will be marked redraw.\n\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype.incrementalRender = function (params, seriesModel) {\n // Reset\n this._progressiveEls = []; // Do not support progressive in normal mode.\n\n this._incrementalRenderLarge(params, seriesModel);\n };\n\n BarView.prototype.eachRendered = function (cb) {\n traverseElements(this._progressiveEls || this.group, cb);\n };\n\n BarView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n BarView.prototype._renderNormal = function (seriesModel, ecModel, api, payload) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coord = seriesModel.coordinateSystem;\n var baseAxis = coord.getBaseAxis();\n var isHorizontalOrRadial;\n\n if (coord.type === 'cartesian2d') {\n isHorizontalOrRadial = baseAxis.isHorizontal();\n } else if (coord.type === 'polar') {\n isHorizontalOrRadial = baseAxis.dim === 'angle';\n }\n\n var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;\n var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);\n\n if (realtimeSortCfg) {\n this._enableRealtimeSort(realtimeSortCfg, data, api);\n }\n\n var needsClip = seriesModel.get('clip', true) || realtimeSortCfg;\n var coordSysClipArea = getClipArea(coord, data); // If there is clipPath created in large mode. Remove it.\n\n group.removeClipPath(); // We don't use clipPath in normal mode because we needs a perfect animation\n // And don't want the label are clipped.\n\n var roundCap = seriesModel.get('roundCap', true);\n var drawBackground = seriesModel.get('showBackground', true);\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var barBorderRadius = backgroundModel.get('borderRadius') || 0;\n var bgEls = [];\n var oldBgEls = this._backgroundEls;\n var isInitSort = payload && payload.isInitSort;\n var isChangeOrder = payload && payload.type === 'changeAxisOrder';\n\n function createBackground(dataIndex) {\n var bgLayout = getLayout[coord.type](data, dataIndex);\n var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n\n bgEls[dataIndex] = bgEl;\n return bgEl;\n }\n\n ;\n data.diff(oldData).add(function (dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n var layout = getLayout[coord.type](data, dataIndex, itemModel);\n\n if (drawBackground) {\n createBackground(dataIndex);\n } // If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in \"axisProxy\".\n\n\n if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout)) {\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n // Clip will modify the layout params.\n // And return a boolean to determine if the shape are fully clipped.\n isClipped = clip[coord.type](coordSysClipArea, layout);\n }\n\n var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);\n\n if (realtimeSortCfg) {\n /**\r\n * Force label animation because even if the element is\r\n * ignored because it's clipped, it may not be clipped after\r\n * changing order. Then, if not using forceLabelAnimation,\r\n * the label animation was never started, in which case,\r\n * the label will be the final value and doesn't have label\r\n * animation.\r\n */\n el.forceLabelAnimation = true;\n }\n\n updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, dataIndex, isHorizontalOrRadial, false, false);\n } else {\n initProps(el, {\n shape: layout\n }, seriesModel, dataIndex);\n }\n\n data.setItemGraphicEl(dataIndex, el);\n group.add(el);\n el.ignore = isClipped;\n }).update(function (newIndex, oldIndex) {\n var itemModel = data.getItemModel(newIndex);\n var layout = getLayout[coord.type](data, newIndex, itemModel);\n\n if (drawBackground) {\n var bgEl = void 0;\n\n if (oldBgEls.length === 0) {\n bgEl = createBackground(oldIndex);\n } else {\n bgEl = oldBgEls[oldIndex];\n bgEl.useStyle(backgroundModel.getItemStyle()); // Only cartesian2d support borderRadius.\n\n if (coord.type === 'cartesian2d') {\n bgEl.setShape('r', barBorderRadius);\n } else {\n bgEl.setShape('cornerRadius', barBorderRadius);\n }\n\n bgEls[newIndex] = bgEl;\n }\n\n var bgLayout = getLayout[coord.type](data, newIndex);\n var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);\n updateProps(bgEl, {\n shape: shape\n }, animationModel, newIndex);\n }\n\n var el = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout)) {\n group.remove(el);\n return;\n }\n\n var isClipped = false;\n\n if (needsClip) {\n isClipped = clip[coord.type](coordSysClipArea, layout);\n\n if (isClipped) {\n group.remove(el);\n }\n }\n\n if (!el) {\n el = elementCreator[coord.type](seriesModel, data, newIndex, layout, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);\n } else {\n saveOldStyle(el);\n }\n\n if (realtimeSortCfg) {\n el.forceLabelAnimation = true;\n }\n\n if (isChangeOrder) {\n var textEl = el.getTextContent();\n\n if (textEl) {\n var labelInnerStore = labelInner(textEl);\n\n if (labelInnerStore.prevValue != null) {\n /**\r\n * Set preValue to be value so that no new label\r\n * should be started, otherwise, it will take a full\r\n * `animationDurationUpdate` time to finish the\r\n * animation, which is not expected.\r\n */\n labelInnerStore.prevValue = labelInnerStore.value;\n }\n }\n } // Not change anything if only order changed.\n // Especially not change label.\n else {\n updateStyle(el, data, newIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, coord.type === 'polar');\n }\n\n if (isInitSort) {\n el.attr({\n shape: layout\n });\n } else if (realtimeSortCfg) {\n updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout, newIndex, isHorizontalOrRadial, true, isChangeOrder);\n } else {\n updateProps(el, {\n shape: layout\n }, seriesModel, newIndex, null);\n }\n\n data.setItemGraphicEl(newIndex, el);\n el.ignore = isClipped;\n group.add(el);\n }).remove(function (dataIndex) {\n var el = oldData.getItemGraphicEl(dataIndex);\n el && removeElementWithFadeOut(el, seriesModel, dataIndex);\n }).execute();\n var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group());\n bgGroup.removeAll();\n\n for (var i = 0; i < bgEls.length; ++i) {\n bgGroup.add(bgEls[i]);\n }\n\n group.add(bgGroup);\n this._backgroundEls = bgEls;\n this._data = data;\n };\n\n BarView.prototype._renderLarge = function (seriesModel, ecModel, api) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n\n this._updateLargeClip(seriesModel);\n };\n\n BarView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n this._removeBackground();\n\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n\n BarView.prototype._updateLargeClip = function (seriesModel) {\n // Use clipPath in large mode.\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n var group = this.group;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n };\n\n BarView.prototype._enableRealtimeSort = function (realtimeSortCfg, data, api) {\n var _this = this; // If no data in the first frame, wait for data to initSort\n\n\n if (!data.count()) {\n return;\n }\n\n var baseAxis = realtimeSortCfg.baseAxis;\n\n if (this._isFirstFrame) {\n this._dispatchInitSort(data, realtimeSortCfg, api);\n\n this._isFirstFrame = false;\n } else {\n var orderMapping_1 = function (idx) {\n var el = data.getItemGraphicEl(idx);\n var shape = el && el.shape;\n return shape && // The result should be consistent with the initial sort by data value.\n // Do not support the case that both positive and negative exist.\n Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) // If data is NaN, shape.xxx may be NaN, so use || 0 here in case\n || 0;\n };\n\n this._onRendered = function () {\n _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api);\n };\n\n api.getZr().on('rendered', this._onRendered);\n }\n };\n\n BarView.prototype._dataSort = function (data, baseAxis, orderMapping) {\n var info = [];\n data.each(data.mapDimension(baseAxis.dim), function (ordinalNumber, dataIdx) {\n var mappedValue = orderMapping(dataIdx);\n mappedValue = mappedValue == null ? NaN : mappedValue;\n info.push({\n dataIndex: dataIdx,\n mappedValue: mappedValue,\n ordinalNumber: ordinalNumber\n });\n });\n info.sort(function (a, b) {\n // If NaN, it will be treated as min val.\n return b.mappedValue - a.mappedValue;\n });\n return {\n ordinalNumbers: map(info, function (item) {\n return item.ordinalNumber;\n })\n };\n };\n\n BarView.prototype._isOrderChangedWithinSameData = function (data, orderMapping, baseAxis) {\n var scale = baseAxis.scale;\n var ordinalDataDim = data.mapDimension(baseAxis.dim);\n var lastValue = Number.MAX_VALUE;\n\n for (var tickNum = 0, len = scale.getOrdinalMeta().categories.length; tickNum < len; ++tickNum) {\n var rawIdx = data.rawIndexOf(ordinalDataDim, scale.getRawOrdinalNumber(tickNum));\n var value = rawIdx < 0 // If some tick have no bar, the tick will be treated as min.\n ? Number.MIN_VALUE // PENDING: if dataZoom on baseAxis exits, is it a performance issue?\n : orderMapping(data.indexOfRawIndex(rawIdx));\n\n if (value > lastValue) {\n return true;\n }\n\n lastValue = value;\n }\n\n return false;\n };\n /*\r\n * Consider the case when A and B changed order, whose representing\r\n * bars are both out of sight, we don't wish to trigger reorder action\r\n * as long as the order in the view doesn't change.\r\n */\n\n\n BarView.prototype._isOrderDifferentInView = function (orderInfo, baseAxis) {\n var scale = baseAxis.scale;\n var extent = scale.getExtent();\n var tickNum = Math.max(0, extent[0]);\n var tickMax = Math.min(extent[1], scale.getOrdinalMeta().categories.length - 1);\n\n for (; tickNum <= tickMax; ++tickNum) {\n if (orderInfo.ordinalNumbers[tickNum] !== scale.getRawOrdinalNumber(tickNum)) {\n return true;\n }\n }\n };\n\n BarView.prototype._updateSortWithinSameData = function (data, orderMapping, baseAxis, api) {\n if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {\n return;\n }\n\n var sortInfo = this._dataSort(data, baseAxis, orderMapping);\n\n if (this._isOrderDifferentInView(sortInfo, baseAxis)) {\n this._removeOnRenderedListener(api);\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n axisId: baseAxis.index,\n sortInfo: sortInfo\n });\n }\n };\n\n BarView.prototype._dispatchInitSort = function (data, realtimeSortCfg, api) {\n var baseAxis = realtimeSortCfg.baseAxis;\n\n var sortResult = this._dataSort(data, baseAxis, function (dataIdx) {\n return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);\n });\n\n api.dispatchAction({\n type: 'changeAxisOrder',\n componentType: baseAxis.dim + 'Axis',\n isInitSort: true,\n axisId: baseAxis.index,\n sortInfo: sortResult\n });\n };\n\n BarView.prototype.remove = function (ecModel, api) {\n this._clear(this._model);\n\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype.dispose = function (ecModel, api) {\n this._removeOnRenderedListener(api);\n };\n\n BarView.prototype._removeOnRenderedListener = function (api) {\n if (this._onRendered) {\n api.getZr().off('rendered', this._onRendered);\n this._onRendered = null;\n }\n };\n\n BarView.prototype._clear = function (model) {\n var group = this.group;\n var data = this._data;\n\n if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {\n this._removeBackground();\n\n this._backgroundEls = [];\n data.eachItemGraphicEl(function (el) {\n removeElementWithFadeOut(el, model, getECData(el).dataIndex);\n });\n } else {\n group.removeAll();\n }\n\n this._data = null;\n this._isFirstFrame = true;\n };\n\n BarView.prototype._removeBackground = function () {\n this.group.remove(this._backgroundGroup);\n this._backgroundGroup = null;\n };\n\n BarView.type = 'bar';\n return BarView;\n}(ChartView);\n\nvar clip = {\n cartesian2d: function (coordSysBoundingRect, layout) {\n var signWidth = layout.width < 0 ? -1 : 1;\n var signHeight = layout.height < 0 ? -1 : 1; // Needs positive width and height\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;\n var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;\n var x = mathMax(layout.x, coordSysBoundingRect.x);\n var x2 = mathMin(layout.x + layout.width, coordSysX2);\n var y = mathMax(layout.y, coordSysBoundingRect.y);\n var y2 = mathMin(layout.y + layout.height, coordSysY2);\n var xClipped = x2 < x;\n var yClipped = y2 < y; // When xClipped or yClipped, the element will be marked as `ignore`.\n // But we should also place the element at the edge of the coord sys bounding rect.\n // Because if data changed and the bar shows again, its transition animation\n // will begin at this place.\n\n layout.x = xClipped && x > coordSysX2 ? x2 : x;\n layout.y = yClipped && y > coordSysY2 ? y2 : y;\n layout.width = xClipped ? 0 : x2 - x;\n layout.height = yClipped ? 0 : y2 - y; // Reverse back\n\n if (signWidth < 0) {\n layout.x += layout.width;\n layout.width = -layout.width;\n }\n\n if (signHeight < 0) {\n layout.y += layout.height;\n layout.height = -layout.height;\n }\n\n return xClipped || yClipped;\n },\n polar: function (coordSysClipArea, layout) {\n var signR = layout.r0 <= layout.r ? 1 : -1; // Make sure r is larger than r0\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n var r = mathMin(layout.r, coordSysClipArea.r);\n var r0 = mathMax(layout.r0, coordSysClipArea.r0);\n layout.r = r;\n layout.r0 = r0;\n var clipped = r - r0 < 0; // Reverse back\n\n if (signR < 0) {\n var tmp = layout.r;\n layout.r = layout.r0;\n layout.r0 = tmp;\n }\n\n return clipped;\n }\n};\nvar elementCreator = {\n cartesian2d: function (seriesModel, data, newIndex, layout, isHorizontal, animationModel, axisModel, isUpdate, roundCap) {\n var rect = new Rect({\n shape: extend({}, layout),\n z2: 1\n });\n rect.__dataIndex = newIndex;\n rect.name = 'item';\n\n if (animationModel) {\n var rectShape = rect.shape;\n var animateProperty = isHorizontal ? 'height' : 'width';\n rectShape[animateProperty] = 0;\n }\n\n return rect;\n },\n polar: function (seriesModel, data, newIndex, layout, isRadial, animationModel, axisModel, isUpdate, roundCap) {\n var ShapeClass = !isRadial && roundCap ? Sausage : Sector;\n var sector = new ShapeClass({\n shape: layout,\n z2: 1\n });\n sector.name = 'item';\n var positionMap = createPolarPositionMapping(isRadial);\n sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap, {\n isRoundCap: ShapeClass === Sausage\n }); // Animation\n\n if (animationModel) {\n var sectorShape = sector.shape;\n var animateProperty = isRadial ? 'r' : 'endAngle';\n var animateTarget = {};\n sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle;\n animateTarget[animateProperty] = layout[animateProperty];\n (isUpdate ? updateProps : initProps)(sector, {\n shape: animateTarget // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue\n\n }, animationModel);\n }\n\n return sector;\n }\n};\n\nfunction shouldRealtimeSort(seriesModel, coordSys) {\n var realtimeSortOption = seriesModel.get('realtimeSort', true);\n var baseAxis = coordSys.getBaseAxis();\n\n if (process.env.NODE_ENV !== 'production') {\n if (realtimeSortOption) {\n if (baseAxis.type !== 'category') {\n warn('`realtimeSort` will not work because this bar series is not based on a category axis.');\n }\n\n if (coordSys.type !== 'cartesian2d') {\n warn('`realtimeSort` will not work because this bar series is not on cartesian2d.');\n }\n }\n }\n\n if (realtimeSortOption && baseAxis.type === 'category' && coordSys.type === 'cartesian2d') {\n return {\n baseAxis: baseAxis,\n otherAxis: coordSys.getOtherAxis(baseAxis)\n };\n }\n}\n\nfunction updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout, newIndex, isHorizontal, isUpdate, isChangeOrder) {\n var seriesTarget;\n var axisTarget;\n\n if (isHorizontal) {\n axisTarget = {\n x: layout.x,\n width: layout.width\n };\n seriesTarget = {\n y: layout.y,\n height: layout.height\n };\n } else {\n axisTarget = {\n y: layout.y,\n height: layout.height\n };\n seriesTarget = {\n x: layout.x,\n width: layout.width\n };\n }\n\n if (!isChangeOrder) {\n // Keep the original growth animation if only axis order changed.\n // Not start a new animation.\n (isUpdate ? updateProps : initProps)(el, {\n shape: seriesTarget\n }, seriesAnimationModel, newIndex, null);\n }\n\n var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;\n (isUpdate ? updateProps : initProps)(el, {\n shape: axisTarget\n }, axisAnimationModel, newIndex);\n}\n\nfunction checkPropertiesNotValid(obj, props) {\n for (var i = 0; i < props.length; i++) {\n if (!isFinite(obj[props[i]])) {\n return true;\n }\n }\n\n return false;\n}\n\nvar rectPropties = ['x', 'y', 'width', 'height'];\nvar polarPropties = ['cx', 'cy', 'r', 'startAngle', 'endAngle'];\nvar isValidLayout = {\n cartesian2d: function (layout) {\n return !checkPropertiesNotValid(layout, rectPropties);\n },\n polar: function (layout) {\n return !checkPropertiesNotValid(layout, polarPropties);\n }\n};\nvar getLayout = {\n // itemModel is only used to get borderWidth, which is not needed\n // when calculating bar background layout.\n cartesian2d: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0; // fix layout with lineWidth\n\n var signX = layout.width > 0 ? 1 : -1;\n var signY = layout.height > 0 ? 1 : -1;\n return {\n x: layout.x + signX * fixedLineWidth / 2,\n y: layout.y + signY * fixedLineWidth / 2,\n width: layout.width - signX * fixedLineWidth,\n height: layout.height - signY * fixedLineWidth\n };\n },\n polar: function (data, dataIndex, itemModel) {\n var layout = data.getItemLayout(dataIndex);\n return {\n cx: layout.cx,\n cy: layout.cy,\n r0: layout.r0,\n r: layout.r,\n startAngle: layout.startAngle,\n endAngle: layout.endAngle,\n clockwise: layout.clockwise\n };\n }\n};\n\nfunction isZeroOnPolar(layout) {\n return layout.startAngle != null && layout.endAngle != null && layout.startAngle === layout.endAngle;\n}\n\nfunction createPolarPositionMapping(isRadial) {\n return function (isRadial) {\n var arcOrAngle = isRadial ? 'Arc' : 'Angle';\n return function (position) {\n switch (position) {\n case 'start':\n case 'insideStart':\n case 'end':\n case 'insideEnd':\n return position + arcOrAngle;\n\n default:\n return position;\n }\n };\n }(isRadial);\n}\n\nfunction updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontalOrRadial, isPolar) {\n var style = data.getItemVisual(dataIndex, 'style');\n\n if (!isPolar) {\n var borderRadius = itemModel.get(['itemStyle', 'borderRadius']) || 0;\n el.setShape('r', borderRadius);\n } else if (!seriesModel.get('roundCap')) {\n var sectorShape = el.shape;\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n extend(sectorShape, cornerRadius);\n el.setShape(sectorShape);\n }\n\n el.useStyle(style);\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && el.attr('cursor', cursorStyle);\n var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout.r >= layout.r0 ? 'endArc' : 'startArc' : layout.endAngle >= layout.startAngle ? 'endAngle' : 'startAngle' : isHorizontalOrRadial ? layout.height >= 0 ? 'bottom' : 'top' : layout.width >= 0 ? 'right' : 'left';\n var labelStatesModels = getLabelStatesModels(itemModel);\n setLabelStyle(el, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n inheritColor: style.fill,\n defaultOpacity: style.opacity,\n defaultOutsidePosition: labelPositionOutside\n });\n var label = el.getTextContent();\n\n if (isPolar && label) {\n var position = itemModel.get(['label', 'position']);\n el.textConfig.inside = position === 'middle' ? true : null;\n setSectorTextRotation(el, position === 'outside' ? labelPositionOutside : position, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(['label', 'rotate']));\n }\n\n setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function (value) {\n return getDefaultInterpolatedLabel(data, value);\n });\n var emphasisModel = itemModel.getModel(['emphasis']);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n setStatesStylesFromModel(el, itemModel);\n\n if (isZeroOnPolar(layout)) {\n el.style.fill = 'none';\n el.style.stroke = 'none';\n each(el.states, function (state) {\n if (state.style) {\n state.style.fill = state.style.stroke = 'none';\n }\n });\n }\n} // In case width or height are too small.\n\n\nfunction getLineWidth(itemModel, rawLayout) {\n // Has no border.\n var borderColor = itemModel.get(['itemStyle', 'borderColor']);\n\n if (!borderColor || borderColor === 'none') {\n return 0;\n }\n\n var lineWidth = itemModel.get(['itemStyle', 'borderWidth']) || 0; // width or height may be NaN for empty data\n\n var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);\n var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);\n return Math.min(lineWidth, width, height);\n}\n\nvar LagePathShape =\n/** @class */\nfunction () {\n function LagePathShape() {}\n\n return LagePathShape;\n}();\n\nvar LargePath =\n/** @class */\nfunction (_super) {\n __extends(LargePath, _super);\n\n function LargePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeBar';\n return _this;\n }\n\n LargePath.prototype.getDefaultShape = function () {\n return new LagePathShape();\n };\n\n LargePath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n var baseDimIdx = this.baseDimIdx;\n var valueDimIdx = 1 - this.baseDimIdx;\n var startPoint = [];\n var size = [];\n var barWidth = this.barWidth;\n\n for (var i = 0; i < points.length; i += 3) {\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[i + 2];\n startPoint[baseDimIdx] = points[i + baseDimIdx];\n startPoint[valueDimIdx] = points[i + valueDimIdx];\n ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);\n }\n };\n\n return LargePath;\n}(Path);\n\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n // TODO support polar\n var data = seriesModel.getData();\n var baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0;\n var largeDataIndices = data.getLayout('largeDataIndices');\n var barWidth = data.getLayout('size');\n var backgroundModel = seriesModel.getModel('backgroundStyle');\n var bgPoints = data.getLayout('largeBackgroundPoints');\n\n if (bgPoints) {\n var bgEl = new LargePath({\n shape: {\n points: bgPoints\n },\n incremental: !!incremental,\n silent: true,\n z2: 0\n });\n bgEl.baseDimIdx = baseDimIdx;\n bgEl.largeDataIndices = largeDataIndices;\n bgEl.barWidth = barWidth;\n bgEl.useStyle(backgroundModel.getItemStyle());\n group.add(bgEl);\n progressiveEls && progressiveEls.push(bgEl);\n }\n\n var el = new LargePath({\n shape: {\n points: data.getLayout('largePoints')\n },\n incremental: !!incremental,\n ignoreCoarsePointer: true,\n z2: 1\n });\n el.baseDimIdx = baseDimIdx;\n el.largeDataIndices = largeDataIndices;\n el.barWidth = barWidth;\n group.add(el);\n el.useStyle(data.getVisual('style')); // Enable tooltip and user mouse/touch event handlers.\n\n getECData(el).seriesIndex = seriesModel.seriesIndex;\n\n if (!seriesModel.get('silent')) {\n el.on('mousedown', largePathUpdateDataIndex);\n el.on('mousemove', largePathUpdateDataIndex);\n }\n\n progressiveEls && progressiveEls.push(el);\n} // Use throttle to avoid frequently traverse to find dataIndex.\n\n\nvar largePathUpdateDataIndex = throttle(function (event) {\n var largePath = this;\n var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);\n getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;\n}, 30, false);\n\nfunction largePathFindDataIndex(largePath, x, y) {\n var baseDimIdx = largePath.baseDimIdx;\n var valueDimIdx = 1 - baseDimIdx;\n var points = largePath.shape.points;\n var largeDataIndices = largePath.largeDataIndices;\n var startPoint = [];\n var size = [];\n var barWidth = largePath.barWidth;\n\n for (var i = 0, len = points.length / 3; i < len; i++) {\n var ii = i * 3;\n size[baseDimIdx] = barWidth;\n size[valueDimIdx] = points[ii + 2];\n startPoint[baseDimIdx] = points[ii + baseDimIdx];\n startPoint[valueDimIdx] = points[ii + valueDimIdx];\n\n if (size[valueDimIdx] < 0) {\n startPoint[valueDimIdx] += size[valueDimIdx];\n size[valueDimIdx] = -size[valueDimIdx];\n }\n\n if (x >= startPoint[0] && x <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) {\n return largeDataIndices[i];\n }\n }\n\n return -1;\n}\n\nfunction createBackgroundShape(isHorizontalOrRadial, layout, coord) {\n if (isCoordinateSystemType(coord, 'cartesian2d')) {\n var rectShape = layout;\n var coordLayout = coord.getArea();\n return {\n x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,\n y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,\n width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,\n height: isHorizontalOrRadial ? coordLayout.height : rectShape.height\n };\n } else {\n var coordLayout = coord.getArea();\n var sectorShape = layout;\n return {\n cx: coordLayout.cx,\n cy: coordLayout.cy,\n r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,\n r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,\n startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,\n endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2\n };\n }\n}\n\nfunction createBackgroundEl(coord, isHorizontalOrRadial, layout) {\n var ElementClz = coord.type === 'polar' ? Sector : Rect;\n return new ElementClz({\n shape: createBackgroundShape(isHorizontalOrRadial, layout, coord),\n silent: true,\n z2: 0\n });\n}\n\nexport default BarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { layout, createProgressiveLayout } from '../../layout/barGrid.js';\nimport dataSample from '../../processor/dataSample.js';\nimport BarSeries from './BarSeries.js';\nimport BarView from './BarView.js';\nexport function install(registers) {\n registers.registerChartView(BarView);\n registers.registerSeriesModel(BarSeries);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar')); // Do layout after other overall layout, which can prepare some information.\n\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('bar')); // Down sample after filter\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample('bar'));\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\n\n registers.registerAction({\n type: 'changeAxisOrder',\n event: 'changeAxisOrder',\n update: 'update'\n }, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n if (payload.sortInfo) {\n componentModel.axis.setCategorySortInfo(payload.sortInfo);\n }\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar PI2 = Math.PI * 2;\nvar RADIAN = Math.PI / 180;\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport function getBasicPieLayout(seriesModel, api) {\n var viewRect = getViewRect(seriesModel, api); // center can be string or number when coordinateSystem is specified\n\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n var width = parsePercent(viewRect.width, api.getWidth());\n var height = parsePercent(viewRect.height, api.getHeight());\n var size = Math.min(width, height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var cx;\n var cy;\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n // percentage is not allowed when coordinate system is specified\n var point = coordSys.dataToPoint(center);\n cx = point[0] || 0;\n cy = point[1] || 0;\n } else {\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n cx = parsePercent(center[0], width) + viewRect.x;\n cy = parsePercent(center[1], height) + viewRect.y;\n }\n\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r\n };\n}\nexport default function pieLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var viewRect = getViewRect(seriesModel, api);\n\n var _a = getBasicPieLayout(seriesModel, api),\n cx = _a.cx,\n cy = _a.cy,\n r = _a.r,\n r0 = _a.r0;\n\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var validDataCount = 0;\n data.each(valueDim, function (value) {\n !isNaN(value) && validDataCount++;\n });\n var sum = data.getSum(valueDim); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var clockwise = seriesModel.get('clockwise');\n var roseType = seriesModel.get('roseType');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // [0...max]\n\n var extent = data.getDataExtent(valueDim);\n extent[0] = 0; // In the case some sector angle is smaller than minAngle\n\n var restAngle = PI2;\n var valueSumLargerThanMinAngle = 0;\n var currentAngle = startAngle;\n var dir = clockwise ? 1 : -1;\n data.setLayout({\n viewRect: viewRect,\n r: r\n });\n data.each(valueDim, function (value, idx) {\n var angle;\n\n if (isNaN(value)) {\n data.setItemLayout(idx, {\n angle: NaN,\n startAngle: NaN,\n endAngle: NaN,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? NaN : r\n });\n return;\n } // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?\n\n\n if (roseType !== 'area') {\n angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n } else {\n angle = PI2 / validDataCount;\n }\n\n if (angle < minAngle) {\n angle = minAngle;\n restAngle -= minAngle;\n } else {\n valueSumLargerThanMinAngle += value;\n }\n\n var endAngle = currentAngle + dir * angle;\n data.setItemLayout(idx, {\n angle: angle,\n startAngle: currentAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: r0,\n r: roseType ? linearMap(value, extent, [r0, r]) : r\n });\n currentAngle = endAngle;\n }); // Some sector is constrained by minAngle\n // Rest sectors needs recalculate angle\n\n if (restAngle < PI2 && validDataCount) {\n // Average the angle if rest angle is not enough after all angles is\n // Constrained by minAngle\n if (restAngle <= 1e-3) {\n var angle_1 = PI2 / validDataCount;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_1 = data.getItemLayout(idx);\n layout_1.angle = angle_1;\n layout_1.startAngle = startAngle + dir * idx * angle_1;\n layout_1.endAngle = startAngle + dir * (idx + 1) * angle_1;\n }\n });\n } else {\n unitRadian = restAngle / valueSumLargerThanMinAngle;\n currentAngle = startAngle;\n data.each(valueDim, function (value, idx) {\n if (!isNaN(value)) {\n var layout_2 = data.getItemLayout(idx);\n var angle = layout_2.angle === minAngle ? minAngle : value * unitRadian;\n layout_2.startAngle = currentAngle;\n layout_2.endAngle = currentAngle + dir * angle;\n currentAngle += dir * angle;\n }\n });\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function dataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n var name = data.getName(idx); // If in any legend component the status is not selected.\n\n for (var i = 0; i < legendModels.length; i++) {\n // @ts-ignore FIXME: LegendModel\n if (!legendModels[i].isSelected(name)) {\n return false;\n }\n }\n\n return true;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// FIXME emphasis label position is not same with normal label position\nimport { parsePercent } from '../../util/number.js';\nimport { Point } from '../../util/graphic.js';\nimport { each, isNumber } from 'zrender/lib/core/util.js';\nimport { limitTurnAngle, limitSurfaceAngle } from '../../label/labelGuideHelper.js';\nimport { shiftLayoutOnY } from '../../label/labelLayoutHelper.js';\nvar RADIAN = Math.PI / 180;\n\nfunction adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {\n if (list.length < 2) {\n return;\n }\n\n ;\n\n function recalculateXOnSemiToAlignOnEllipseCurve(semi) {\n var rB = semi.rB;\n var rB2 = rB * rB;\n\n for (var i = 0; i < semi.list.length; i++) {\n var item = semi.list[i];\n var dy = Math.abs(item.label.y - cy); // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len;\n var rA2 = rA * rA; // Use ellipse implicit function to calculate x\n\n var dx = Math.sqrt((1 - Math.abs(dy * dy / rB2)) * rA2);\n var newX = cx + (dx + item.len2) * dir;\n var deltaX = newX - item.label.x;\n var newTargetWidth = item.targetTextWidth - deltaX * dir; // text x is changed, so need to recalculate width.\n\n constrainTextWidth(item, newTargetWidth, true);\n item.label.x = newX;\n }\n } // Adjust X based on the shifted y. Make tight labels aligned on an ellipse curve.\n\n\n function recalculateX(items) {\n // Extremes of\n var topSemi = {\n list: [],\n maxY: 0\n };\n var bottomSemi = {\n list: [],\n maxY: 0\n };\n\n for (var i = 0; i < items.length; i++) {\n if (items[i].labelAlignTo !== 'none') {\n continue;\n }\n\n var item = items[i];\n var semi = item.label.y > cy ? bottomSemi : topSemi;\n var dy = Math.abs(item.label.y - cy);\n\n if (dy >= semi.maxY) {\n var dx = item.label.x - cx - item.len2 * dir; // horizontal r is always same with original r because x is not changed.\n\n var rA = r + item.len; // Canculate rB based on the topest / bottemest label.\n\n var rB = Math.abs(dx) < rA ? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA)) : rA;\n semi.rB = rB;\n semi.maxY = dy;\n }\n\n semi.list.push(item);\n }\n\n recalculateXOnSemiToAlignOnEllipseCurve(topSemi);\n recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);\n }\n\n var len = list.length;\n\n for (var i = 0; i < len; i++) {\n if (list[i].position === 'outer' && list[i].labelAlignTo === 'labelLine') {\n var dx = list[i].label.x - farthestX;\n list[i].linePoints[1][0] += dx;\n list[i].label.x = farthestX;\n }\n }\n\n if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {\n recalculateX(list);\n }\n}\n\nfunction avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {\n var leftList = [];\n var rightList = [];\n var leftmostX = Number.MAX_VALUE;\n var rightmostX = -Number.MAX_VALUE;\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var label = labelLayoutList[i].label;\n\n if (isPositionCenter(labelLayoutList[i])) {\n continue;\n }\n\n if (label.x < cx) {\n leftmostX = Math.min(leftmostX, label.x);\n leftList.push(labelLayoutList[i]);\n } else {\n rightmostX = Math.max(rightmostX, label.x);\n rightList.push(labelLayoutList[i]);\n }\n }\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n\n if (!isPositionCenter(layout) && layout.linePoints) {\n if (layout.labelStyleWidth != null) {\n continue;\n }\n\n var label = layout.label;\n var linePoints = layout.linePoints;\n var targetTextWidth = void 0;\n\n if (layout.labelAlignTo === 'edge') {\n if (label.x < cx) {\n targetTextWidth = linePoints[2][0] - layout.labelDistance - viewLeft - layout.edgeDistance;\n } else {\n targetTextWidth = viewLeft + viewWidth - layout.edgeDistance - linePoints[2][0] - layout.labelDistance;\n }\n } else if (layout.labelAlignTo === 'labelLine') {\n if (label.x < cx) {\n targetTextWidth = leftmostX - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - rightmostX - layout.bleedMargin;\n }\n } else {\n if (label.x < cx) {\n targetTextWidth = label.x - viewLeft - layout.bleedMargin;\n } else {\n targetTextWidth = viewLeft + viewWidth - label.x - layout.bleedMargin;\n }\n }\n\n layout.targetTextWidth = targetTextWidth;\n constrainTextWidth(layout, targetTextWidth);\n }\n }\n\n adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);\n adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n\n if (!isPositionCenter(layout) && layout.linePoints) {\n var label = layout.label;\n var linePoints = layout.linePoints;\n var isAlignToEdge = layout.labelAlignTo === 'edge';\n var padding = label.style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0; // textRect.width already contains paddingH if bgColor is set\n\n var extraPaddingH = label.style.backgroundColor ? 0 : paddingH;\n var realTextWidth = layout.rect.width + extraPaddingH;\n var dist = linePoints[1][0] - linePoints[2][0];\n\n if (isAlignToEdge) {\n if (label.x < cx) {\n linePoints[2][0] = viewLeft + layout.edgeDistance + realTextWidth + layout.labelDistance;\n } else {\n linePoints[2][0] = viewLeft + viewWidth - layout.edgeDistance - realTextWidth - layout.labelDistance;\n }\n } else {\n if (label.x < cx) {\n linePoints[2][0] = label.x + layout.labelDistance;\n } else {\n linePoints[2][0] = label.x - layout.labelDistance;\n }\n\n linePoints[1][0] = linePoints[2][0] + dist;\n }\n\n linePoints[1][1] = linePoints[2][1] = label.y;\n }\n }\n}\n/**\r\n * Set max width of each label, and then wrap each label to the max width.\r\n *\r\n * @param layout label layout\r\n * @param availableWidth max width for the label to display\r\n * @param forceRecalculate recaculate the text layout even if the current width\r\n * is smaller than `availableWidth`. This is useful when the text was previously\r\n * wrapped by calling `constrainTextWidth` but now `availableWidth` changed, in\r\n * which case, previous wrapping should be redo.\r\n */\n\n\nfunction constrainTextWidth(layout, availableWidth, forceRecalculate) {\n if (forceRecalculate === void 0) {\n forceRecalculate = false;\n }\n\n if (layout.labelStyleWidth != null) {\n // User-defined style.width has the highest priority.\n return;\n }\n\n var label = layout.label;\n var style = label.style;\n var textRect = layout.rect;\n var bgColor = style.backgroundColor;\n var padding = style.padding;\n var paddingH = padding ? padding[1] + padding[3] : 0;\n var overflow = style.overflow; // textRect.width already contains paddingH if bgColor is set\n\n var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);\n\n if (availableWidth < oldOuterWidth || forceRecalculate) {\n var oldHeight = textRect.height;\n\n if (overflow && overflow.match('break')) {\n // Temporarily set background to be null to calculate\n // the bounding box without background.\n label.setStyle('backgroundColor', null); // Set constraining width\n\n label.setStyle('width', availableWidth - paddingH); // This is the real bounding box of the text without padding.\n\n var innerRect = label.getBoundingRect();\n label.setStyle('width', Math.ceil(innerRect.width));\n label.setStyle('backgroundColor', bgColor);\n } else {\n var availableInnerWidth = availableWidth - paddingH;\n var newWidth = availableWidth < oldOuterWidth // Current text is too wide, use `availableWidth` as max width.\n ? availableInnerWidth : // Current available width is enough, but the text may have\n // already been wrapped with a smaller available width.\n forceRecalculate ? availableInnerWidth > layout.unconstrainedWidth // Current available is larger than text width,\n // so don't constrain width (otherwise it may have\n // empty space in the background).\n ? null // Current available is smaller than text width, so\n // use the current available width as constraining\n // width.\n : availableInnerWidth : // Current available width is enough, so no need to\n // constrain.\n null;\n label.setStyle('width', newWidth);\n }\n\n var newRect = label.getBoundingRect();\n textRect.width = newRect.width;\n var margin = (label.style.margin || 0) + 2.1;\n textRect.height = newRect.height + margin;\n textRect.y -= (textRect.height - oldHeight) / 2;\n }\n}\n\nfunction isPositionCenter(sectorShape) {\n // Not change x for center label\n return sectorShape.position === 'center';\n}\n\nexport default function pieLabelLayout(seriesModel) {\n var data = seriesModel.getData();\n var labelLayoutList = [];\n var cx;\n var cy;\n var hasLabelRotate = false;\n var minShowLabelRadian = (seriesModel.get('minShowLabelAngle') || 0) * RADIAN;\n var viewRect = data.getLayout('viewRect');\n var r = data.getLayout('r');\n var viewWidth = viewRect.width;\n var viewLeft = viewRect.x;\n var viewTop = viewRect.y;\n var viewHeight = viewRect.height;\n\n function setNotShow(el) {\n el.ignore = true;\n }\n\n function isLabelShown(label) {\n if (!label.ignore) {\n return true;\n }\n\n for (var key in label.states) {\n if (label.states[key].ignore === false) {\n return true;\n }\n }\n\n return false;\n }\n\n data.each(function (idx) {\n var sector = data.getItemGraphicEl(idx);\n var sectorShape = sector.shape;\n var label = sector.getTextContent();\n var labelLine = sector.getTextGuideLine();\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label'); // Use position in normal or emphasis\n\n var labelPosition = labelModel.get('position') || itemModel.get(['emphasis', 'label', 'position']);\n var labelDistance = labelModel.get('distanceToLabelLine');\n var labelAlignTo = labelModel.get('alignTo');\n var edgeDistance = parsePercent(labelModel.get('edgeDistance'), viewWidth);\n var bleedMargin = labelModel.get('bleedMargin');\n var labelLineModel = itemModel.getModel('labelLine');\n var labelLineLen = labelLineModel.get('length');\n labelLineLen = parsePercent(labelLineLen, viewWidth);\n var labelLineLen2 = labelLineModel.get('length2');\n labelLineLen2 = parsePercent(labelLineLen2, viewWidth);\n\n if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {\n each(label.states, setNotShow);\n label.ignore = true;\n\n if (labelLine) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n }\n\n return;\n }\n\n if (!isLabelShown(label)) {\n return;\n }\n\n var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;\n var nx = Math.cos(midAngle);\n var ny = Math.sin(midAngle);\n var textX;\n var textY;\n var linePoints;\n var textAlign;\n cx = sectorShape.cx;\n cy = sectorShape.cy;\n var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';\n\n if (labelPosition === 'center') {\n textX = sectorShape.cx;\n textY = sectorShape.cy;\n textAlign = 'center';\n } else {\n var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;\n var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;\n textX = x1 + nx * 3;\n textY = y1 + ny * 3;\n\n if (!isLabelInside) {\n // For roseType\n var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);\n var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);\n var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;\n var y3 = y2;\n\n if (labelAlignTo === 'edge') {\n // Adjust textX because text align of edge is opposite\n textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;\n } else {\n textX = x3 + (nx < 0 ? -labelDistance : labelDistance);\n }\n\n textY = y3;\n linePoints = [[x1, y1], [x2, y2], [x3, y3]];\n }\n\n textAlign = isLabelInside ? 'center' : labelAlignTo === 'edge' ? nx > 0 ? 'right' : 'left' : nx > 0 ? 'left' : 'right';\n }\n\n var PI = Math.PI;\n var labelRotate = 0;\n var rotate = labelModel.get('rotate');\n\n if (isNumber(rotate)) {\n labelRotate = rotate * (PI / 180);\n } else if (labelPosition === 'center') {\n labelRotate = 0;\n } else if (rotate === 'radial' || rotate === true) {\n var radialAngle = nx < 0 ? -midAngle + PI : -midAngle;\n labelRotate = radialAngle;\n } else if (rotate === 'tangential' && labelPosition !== 'outside' && labelPosition !== 'outer') {\n var rad = Math.atan2(nx, ny);\n\n if (rad < 0) {\n rad = PI * 2 + rad;\n }\n\n var isDown = ny > 0;\n\n if (isDown) {\n rad = PI + rad;\n }\n\n labelRotate = rad - PI;\n }\n\n hasLabelRotate = !!labelRotate;\n label.x = textX;\n label.y = textY;\n label.rotation = labelRotate;\n label.setStyle({\n verticalAlign: 'middle'\n }); // Not sectorShape the inside label\n\n if (!isLabelInside) {\n var textRect = label.getBoundingRect().clone();\n textRect.applyTransform(label.getComputedTransform()); // Text has a default 1px stroke. Exclude this.\n\n var margin = (label.style.margin || 0) + 2.1;\n textRect.y -= margin / 2;\n textRect.height += margin;\n labelLayoutList.push({\n label: label,\n labelLine: labelLine,\n position: labelPosition,\n len: labelLineLen,\n len2: labelLineLen2,\n minTurnAngle: labelLineModel.get('minTurnAngle'),\n maxSurfaceAngle: labelLineModel.get('maxSurfaceAngle'),\n surfaceNormal: new Point(nx, ny),\n linePoints: linePoints,\n textAlign: textAlign,\n labelDistance: labelDistance,\n labelAlignTo: labelAlignTo,\n edgeDistance: edgeDistance,\n bleedMargin: bleedMargin,\n rect: textRect,\n unconstrainedWidth: textRect.width,\n labelStyleWidth: label.style.width\n });\n } else {\n label.setStyle({\n align: textAlign\n });\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n sector.setTextConfig({\n inside: isLabelInside\n });\n });\n\n if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {\n avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);\n }\n\n for (var i = 0; i < labelLayoutList.length; i++) {\n var layout = labelLayoutList[i];\n var label = layout.label;\n var labelLine = layout.labelLine;\n var notShowLabel = isNaN(label.x) || isNaN(label.y);\n\n if (label) {\n label.setStyle({\n align: layout.textAlign\n });\n\n if (notShowLabel) {\n each(label.states, setNotShow);\n label.ignore = true;\n }\n\n var selectState = label.states.select;\n\n if (selectState) {\n selectState.x += label.x;\n selectState.y += label.y;\n }\n }\n\n if (labelLine) {\n var linePoints = layout.linePoints;\n\n if (notShowLabel || !linePoints) {\n each(labelLine.states, setNotShow);\n labelLine.ignore = true;\n } else {\n limitTurnAngle(linePoints, layout.minTurnAngle);\n limitSurfaceAngle(linePoints, layout.surfaceNormal, layout.maxSurfaceAngle);\n labelLine.setShape({\n points: linePoints\n }); // Set the anchor to the midpoint of sector\n\n label.__hostTarget.textGuideLineConfig = {\n anchor: new Point(linePoints[0][0], linePoints[0][1])\n };\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { extend, retrieve3 } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport labelLayout from './labelLayout.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { getBasicPieLayout } from './pieLayout.js';\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\n\nvar PiePiece =\n/** @class */\nfunction (_super) {\n __extends(PiePiece, _super);\n\n function PiePiece(data, idx, startAngle) {\n var _this = _super.call(this) || this;\n\n _this.z2 = 2;\n var text = new graphic.Text();\n\n _this.setTextContent(text);\n\n _this.updateData(data, idx, startAngle, true);\n\n return _this;\n }\n\n PiePiece.prototype.updateData = function (data, idx, startAngle, firstCreate) {\n var sector = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = data.getItemLayout(idx); // cornerRadius & innerCornerRadius doesn't exist in the item layout. Use `0` if null value is specified.\n // see `setItemLayout` in `pieLayout.ts`.\n\n var sectorShape = extend(getSectorCornerRadius(itemModel.getModel('itemStyle'), layout, true), layout); // Ignore NaN data.\n\n if (isNaN(sectorShape.startAngle)) {\n // Use NaN shape to avoid drawing shape.\n sector.setShape(sectorShape);\n return;\n }\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n var animationType = seriesModel.getShallow('animationType');\n\n if (seriesModel.ecModel.ssr) {\n // Use scale animation in SSR mode(opacity?)\n // Because CSS SVG animation doesn't support very customized shape animation.\n graphic.initProps(sector, {\n scaleX: 0,\n scaleY: 0\n }, seriesModel, {\n dataIndex: idx,\n isFrom: true\n });\n sector.originX = sectorShape.cx;\n sector.originY = sectorShape.cy;\n } else if (animationType === 'scale') {\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, idx);\n } // Expansion\n else {\n if (startAngle != null) {\n sector.setShape({\n startAngle: startAngle,\n endAngle: startAngle\n });\n graphic.initProps(sector, {\n shape: {\n startAngle: layout.startAngle,\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n } else {\n sector.shape.endAngle = layout.startAngle;\n graphic.updateProps(sector, {\n shape: {\n endAngle: layout.endAngle\n }\n }, seriesModel, idx);\n }\n }\n } else {\n saveOldStyle(sector); // Transition animation from the old shape\n\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel, idx);\n }\n\n sector.useStyle(data.getItemVisual(idx, 'style'));\n setStatesStylesFromModel(sector, itemModel);\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var offset = seriesModel.get('selectedOffset');\n var dx = Math.cos(midAngle) * offset;\n var dy = Math.sin(midAngle) * offset;\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n\n this._updateLabel(seriesModel, data, idx);\n\n sector.ensureState('emphasis').shape = extend({\n r: layout.r + (emphasisModel.get('scale') ? emphasisModel.get('scaleSize') || 0 : 0)\n }, getSectorCornerRadius(emphasisModel.getModel('itemStyle'), layout));\n extend(sector.ensureState('select'), {\n x: dx,\n y: dy,\n shape: getSectorCornerRadius(itemModel.getModel(['select', 'itemStyle']), layout)\n });\n extend(sector.ensureState('blur'), {\n shape: getSectorCornerRadius(itemModel.getModel(['blur', 'itemStyle']), layout)\n });\n var labelLine = sector.getTextGuideLine();\n var labelText = sector.getTextContent();\n labelLine && extend(labelLine.ensureState('select'), {\n x: dx,\n y: dy\n }); // TODO: needs dx, dy in zrender?\n\n extend(labelText.ensureState('select'), {\n x: dx,\n y: dy\n });\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n PiePiece.prototype._updateLabel = function (seriesModel, data, idx) {\n var sector = this;\n var itemModel = data.getItemModel(idx);\n var labelLineModel = itemModel.getModel('labelLine');\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style && style.fill;\n var visualOpacity = style && style.opacity;\n setLabelStyle(sector, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n defaultText: seriesModel.getFormattedLabel(idx, 'normal') || data.getName(idx)\n });\n var labelText = sector.getTextContent(); // Set textConfig on sector.\n\n sector.setTextConfig({\n // reset position, rotation\n position: null,\n rotation: null\n }); // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n labelText.attr({\n z2: 10\n });\n var labelPosition = seriesModel.get(['label', 'position']);\n\n if (labelPosition !== 'outside' && labelPosition !== 'outer') {\n sector.removeTextGuideLine();\n } else {\n var polyline = this.getTextGuideLine();\n\n if (!polyline) {\n polyline = new graphic.Polyline();\n this.setTextGuideLine(polyline);\n } // Default use item visual color\n\n\n setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {\n stroke: visualColor,\n opacity: retrieve3(labelLineModel.get(['lineStyle', 'opacity']), visualOpacity, 1)\n });\n }\n };\n\n return PiePiece;\n}(graphic.Sector); // Pie view\n\n\nvar PieView =\n/** @class */\nfunction (_super) {\n __extends(PieView, _super);\n\n function PieView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n PieView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var startAngle; // First render\n\n if (!oldData && data.count() > 0) {\n var shape = data.getItemLayout(0);\n\n for (var s = 1; isNaN(shape && shape.startAngle) && s < data.count(); ++s) {\n shape = data.getItemLayout(s);\n }\n\n if (shape) {\n startAngle = shape.startAngle;\n }\n } // remove empty-circle if it exists\n\n\n if (this._emptyCircleSector) {\n group.remove(this._emptyCircleSector);\n } // when all data are filtered, show lightgray empty circle\n\n\n if (data.count() === 0 && seriesModel.get('showEmptyCircle')) {\n var sector = new graphic.Sector({\n shape: getBasicPieLayout(seriesModel, api)\n });\n sector.useStyle(seriesModel.getModel('emptyCircleStyle').getItemStyle());\n this._emptyCircleSector = sector;\n group.add(sector);\n }\n\n data.diff(oldData).add(function (idx) {\n var piePiece = new PiePiece(data, idx, startAngle);\n data.setItemGraphicEl(idx, piePiece);\n group.add(piePiece);\n }).update(function (newIdx, oldIdx) {\n var piePiece = oldData.getItemGraphicEl(oldIdx);\n piePiece.updateData(data, newIdx, startAngle);\n piePiece.off('click');\n group.add(piePiece);\n data.setItemGraphicEl(newIdx, piePiece);\n }).remove(function (idx) {\n var piePiece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piePiece, seriesModel, idx);\n }).execute();\n labelLayout(seriesModel); // Always use initial animation.\n\n if (seriesModel.get('animationTypeUpdate') !== 'expansion') {\n this._data = data;\n }\n };\n\n PieView.prototype.dispose = function () {};\n\n PieView.prototype.containPoint = function (point, seriesModel) {\n var data = seriesModel.getData();\n var itemLayout = data.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n PieView.type = 'pie';\n return PieView;\n}(ChartView);\n\nexport default PieView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { extend, isArray } from 'zrender/lib/core/util.js';\n/**\r\n * [Usage]:\r\n * (1)\r\n * createListSimply(seriesModel, ['value']);\r\n * (2)\r\n * createListSimply(seriesModel, {\r\n * coordDimensions: ['value'],\r\n * dimensionsCount: 5\r\n * });\r\n */\n\nexport default function createSeriesDataSimply(seriesModel, opt, nameList) {\n opt = isArray(opt) && {\n coordDimensions: opt\n } || extend({\n encodeDefine: seriesModel.getEncode()\n }, opt);\n var source = seriesModel.getSource();\n var dimensions = prepareSeriesDataSchema(source, opt).dimensions;\n var list = new SeriesData(dimensions, seriesModel);\n list.initData(source, nameList);\n return list;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * LegendVisualProvider is an bridge that pick encoded color from data and\r\n * provide to the legend component.\r\n */\nvar LegendVisualProvider =\n/** @class */\nfunction () {\n function LegendVisualProvider( // Function to get data after filtered. It stores all the encoding info\n getDataWithEncodedVisual, // Function to get raw data before filtered.\n getRawData) {\n this._getDataWithEncodedVisual = getDataWithEncodedVisual;\n this._getRawData = getRawData;\n }\n\n LegendVisualProvider.prototype.getAllNames = function () {\n var rawData = this._getRawData(); // We find the name from the raw data. In case it's filtered by the legend component.\n // Normally, the name can be found in rawData, but can't be found in filtered data will display as gray.\n\n\n return rawData.mapArray(rawData.getName);\n };\n\n LegendVisualProvider.prototype.containName = function (name) {\n var rawData = this._getRawData();\n\n return rawData.indexOfName(name) >= 0;\n };\n\n LegendVisualProvider.prototype.indexOfName = function (name) {\n // Only get data when necessary.\n // Because LegendVisualProvider constructor may be new in the stage that data is not prepared yet.\n // Invoking Series#getData immediately will throw an error.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.indexOfName(name);\n };\n\n LegendVisualProvider.prototype.getItemVisual = function (dataIndex, key) {\n // Get encoded visual properties from final filtered data.\n var dataWithEncodedVisual = this._getDataWithEncodedVisual();\n\n return dataWithEncodedVisual.getItemVisual(dataIndex, key);\n };\n\n return LegendVisualProvider;\n}();\n\nexport default LegendVisualProvider;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport { getPercentSeats } from '../../util/number.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nvar innerData = modelUtil.makeInner();\n\nvar PieSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PieSeriesModel, _super);\n\n function PieSeriesModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n\n this._defaultLabelLine(option);\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.mergeOption = function () {\n _super.prototype.mergeOption.apply(this, arguments);\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.getInitialData = function () {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n /**\r\n * @overwrite\r\n */\n\n\n PieSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData(); // update seats when data is changed\n\n var dataInner = innerData(data);\n var seats = dataInner.seats;\n\n if (!seats) {\n var valueList_1 = [];\n data.each(data.mapDimension('value'), function (value) {\n valueList_1.push(value);\n });\n seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get('percentPrecision'));\n }\n\n var params = _super.prototype.getDataParams.call(this, dataIndex); // seats may be empty when sum is 0\n\n\n params.percent = seats[dataIndex] || 0;\n params.$vars.push('percent');\n return params;\n };\n\n PieSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n modelUtil.defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n };\n\n PieSeriesModel.type = 'series.pie';\n PieSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If the angle of a sector less than `minShowLabelAngle`,\n // the label will not be displayed.\n minShowLabelAngle: 0,\n // 选中时扇区偏移量\n selectedOffset: 10,\n // 选择模式,默认关闭,可选single,multiple\n // selectedMode: false,\n // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)\n // roseType: null,\n percentPrecision: 2,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // cursor: null,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: null,\n height: null,\n label: {\n // color: 'inherit',\n // If rotate around circle\n rotate: 0,\n show: true,\n overflow: 'truncate',\n // 'outer', 'inside', 'center'\n position: 'outer',\n // 'none', 'labelLine', 'edge'. Works only when position is 'outer'\n alignTo: 'none',\n // Closest distance between label and chart edge.\n // Works only position is 'outer' and alignTo is 'edge'.\n edgeDistance: '25%',\n // Works only position is 'outer' and alignTo is not 'edge'.\n bleedMargin: 10,\n // Distance between text and label line.\n distanceToLabelLine: 5 // formatter: 标签文本格式器,同 tooltip.formatter,不支持异步回调\n // 默认使用全局文本样式,详见 textStyle\n // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数\n\n },\n // Enabled when label.normal.position is 'outer'\n labelLine: {\n show: true,\n // 引导线两段中的第一段长度\n length: 15,\n // 引导线两段中的第二段长度\n length2: 15,\n smooth: false,\n minTurnAngle: 90,\n maxSurfaceAngle: 90,\n lineStyle: {\n // color: 各异,\n width: 1,\n type: 'solid'\n }\n },\n itemStyle: {\n borderWidth: 1,\n borderJoin: 'round'\n },\n showEmptyCircle: true,\n emptyCircleStyle: {\n color: 'lightgray',\n opacity: 1\n },\n labelLayout: {\n // Hide the overlapped label.\n hideOverlap: true\n },\n emphasis: {\n scale: true,\n scaleSize: 5\n },\n // If use strategy to avoid label overlapping\n avoidLabelOverlap: true,\n // Animation type. Valid values: expansion, scale\n animationType: 'expansion',\n animationDuration: 1000,\n // Animation type when update. Valid values: transition, expansion\n animationTypeUpdate: 'transition',\n animationEasingUpdate: 'cubicInOut',\n animationDurationUpdate: 500,\n animationEasing: 'cubicInOut'\n };\n return PieSeriesModel;\n}(SeriesModel);\n\nexport default PieSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function negativeDataFilter(seriesType) {\n return {\n seriesType: seriesType,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n data.filterSelf(function (idx) {\n // handle negative value condition\n var valueDim = data.mapDimension('value');\n var curValue = data.get(valueDim, idx);\n\n if (isNumber(curValue) && !isNaN(curValue) && curValue < 0) {\n return false;\n }\n\n return true;\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport pieLayout from '../pie/pieLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport PieView from './PieView.js';\nimport PieSeriesModel from './PieSeries.js';\nimport negativeDataFilter from '../../processor/negativeDataFilter.js';\nexport function install(registers) {\n registers.registerChartView(PieView);\n registers.registerSeriesModel(PieSeriesModel);\n createLegacyDataSelectAction('pie', registers.registerAction);\n registers.registerLayout(curry(pieLayout, 'pie'));\n registers.registerProcessor(dataFilter('pie'));\n registers.registerProcessor(negativeDataFilter('pie'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar ScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ScatterSeriesModel, _super);\n\n function ScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n ScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n ScatterSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n // PENDING\n return this.option.large ? 5e3 : this.get('progressive');\n }\n\n return progressive;\n };\n\n ScatterSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n // PENDING\n return this.option.large ? 1e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n ScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n ScatterSeriesModel.prototype.getZLevelKey = function () {\n // Each progressive series has individual key.\n return this.getData().count() > this.getProgressiveThreshold() ? this.id : '';\n };\n\n ScatterSeriesModel.type = 'series.scatter';\n ScatterSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n ScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n symbolSize: 10,\n // symbolRotate: null, // 图形旋转控制\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n // cursor: null,\n itemStyle: {\n opacity: 0.8 // color: 各异\n\n },\n emphasis: {\n scale: true\n },\n // If clip the overflow graphics\n // Works on cartesian / polar series\n clip: true,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n universalTransition: {\n divideShape: 'clone'\n } // progressive: null\n\n };\n return ScatterSeriesModel;\n}(SeriesModel);\n\nexport default ScatterSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Float32Array */\n// TODO Batch by color\n\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BOOST_SIZE_THRESHOLD = 4;\n\nvar LargeSymbolPathShape =\n/** @class */\nfunction () {\n function LargeSymbolPathShape() {}\n\n return LargeSymbolPathShape;\n}();\n\nvar LargeSymbolPath =\n/** @class */\nfunction (_super) {\n __extends(LargeSymbolPath, _super);\n\n function LargeSymbolPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n\n LargeSymbolPath.prototype.getDefaultShape = function () {\n return new LargeSymbolPathShape();\n };\n\n LargeSymbolPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n\n LargeSymbolPath.prototype.buildPath = function (path, shape) {\n var points = shape.points;\n var size = shape.size;\n var symbolProxy = this.symbolProxy;\n var symbolProxyShape = symbolProxy.shape;\n var ctx = path.getContext ? path.getContext() : path;\n var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;\n var softClipShape = this.softClipShape;\n var i; // Do draw in afterBrush.\n\n if (canBoost) {\n this._ctx = ctx;\n return;\n }\n\n this._ctx = null;\n\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n }\n\n symbolProxyShape.x = x - size[0] / 2;\n symbolProxyShape.y = y - size[1] / 2;\n symbolProxyShape.width = size[0];\n symbolProxyShape.height = size[1];\n symbolProxy.buildPath(path, symbolProxyShape, true);\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeSymbolPath.prototype.afterBrush = function () {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var ctx = this._ctx;\n var softClipShape = this.softClipShape;\n var i;\n\n if (!ctx) {\n return;\n } // PENDING If style or other canvas status changed?\n\n\n for (i = this._off; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n\n if (isNaN(x) || isNaN(y)) {\n continue;\n }\n\n if (softClipShape && !softClipShape.contain(x, y)) {\n continue;\n } // fillRect is faster than building a rect path and draw.\n // And it support light globalCompositeOperation.\n\n\n ctx.fillRect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeSymbolPath.prototype.findDataIndex = function (x, y) {\n // TODO ???\n // Consider transform\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = Math.max(size[0], 4);\n var h = Math.max(size[1], 4); // Not consider transform\n // Treat each element as a rect\n // top down traverse\n\n for (var idx = points.length / 2 - 1; idx >= 0; idx--) {\n var i = idx * 2;\n var x0 = points[i] - w / 2;\n var y0 = points[i + 1] - h / 2;\n\n if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) {\n return idx;\n }\n }\n\n return -1;\n };\n\n LargeSymbolPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n\n this.hoverDataIdx = -1;\n return false;\n };\n\n LargeSymbolPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n\n if (!rect) {\n var shape = this.shape;\n var points = shape.points;\n var size = shape.size;\n var w = size[0];\n var h = size[1];\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n\n rect = this._rect = new graphic.BoundingRect(minX - w / 2, minY - h / 2, maxX - minX + w, maxY - minY + h);\n }\n\n return rect;\n };\n\n return LargeSymbolPath;\n}(graphic.Path);\n\nvar LargeSymbolDraw =\n/** @class */\nfunction () {\n function LargeSymbolDraw() {\n this.group = new graphic.Group();\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n LargeSymbolDraw.prototype.updateData = function (data, opt) {\n this._clear();\n\n var symbolEl = this._create();\n\n symbolEl.setShape({\n points: data.getLayout('points')\n });\n\n this._setCommon(symbolEl, data, opt);\n };\n\n LargeSymbolDraw.prototype.updateLayout = function (data) {\n var points = data.getLayout('points');\n this.group.eachChild(function (child) {\n if (child.startIndex != null) {\n var len = (child.endIndex - child.startIndex) * 2;\n var byteOffset = child.startIndex * 4 * 2;\n points = new Float32Array(points.buffer, byteOffset, len);\n }\n\n child.setShape('points', points); // Reset draw cursor.\n\n child.reset();\n });\n };\n\n LargeSymbolDraw.prototype.incrementalPrepareUpdate = function (data) {\n this._clear();\n };\n\n LargeSymbolDraw.prototype.incrementalUpdate = function (taskParams, data, opt) {\n var lastAdded = this._newAdded[0];\n var points = data.getLayout('points');\n var oldPoints = lastAdded && lastAdded.shape.points; // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n\n if (oldPoints && oldPoints.length < 2e4) {\n var oldLen = oldPoints.length;\n var newPoints = new Float32Array(oldLen + points.length); // Concat two array\n\n newPoints.set(oldPoints);\n newPoints.set(points, oldLen); // Update endIndex\n\n lastAdded.endIndex = taskParams.end;\n lastAdded.setShape({\n points: newPoints\n });\n } else {\n // Clear\n this._newAdded = [];\n\n var symbolEl = this._create();\n\n symbolEl.startIndex = taskParams.start;\n symbolEl.endIndex = taskParams.end;\n symbolEl.incremental = true;\n symbolEl.setShape({\n points: points\n });\n\n this._setCommon(symbolEl, data, opt);\n }\n };\n\n LargeSymbolDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n\n LargeSymbolDraw.prototype._create = function () {\n var symbolEl = new LargeSymbolPath({\n cursor: 'default'\n });\n symbolEl.ignoreCoarsePointer = true;\n this.group.add(symbolEl);\n\n this._newAdded.push(symbolEl);\n\n return symbolEl;\n };\n\n LargeSymbolDraw.prototype._setCommon = function (symbolEl, data, opt) {\n var hostModel = data.hostModel;\n opt = opt || {};\n var size = data.getVisual('symbolSize');\n symbolEl.setShape('size', size instanceof Array ? size : [size, size]);\n symbolEl.softClipShape = opt.clipShape || null; // Create symbolProxy to build path for each data\n\n symbolEl.symbolProxy = createSymbol(data.getVisual('symbol'), 0, 0, 0, 0); // Use symbolProxy setColor method\n\n symbolEl.setColor = symbolEl.symbolProxy.setColor;\n var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;\n symbolEl.useStyle( // Draw shadow when doing fillRect is extremely slow.\n hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']));\n var globalStyle = data.getVisual('style');\n var visualColor = globalStyle && globalStyle.fill;\n\n if (visualColor) {\n symbolEl.setColor(visualColor);\n }\n\n var ecData = getECData(symbolEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData.seriesIndex = hostModel.seriesIndex;\n symbolEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = symbolEl.hoverDataIdx;\n\n if (dataIndex >= 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);\n }\n });\n };\n\n LargeSymbolDraw.prototype.remove = function () {\n this._clear();\n };\n\n LargeSymbolDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n\n return LargeSymbolDraw;\n}();\n\nexport default LargeSymbolDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LargeSymbolDraw from '../helper/LargeSymbolDraw.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\n\nvar ScatterView =\n/** @class */\nfunction (_super) {\n __extends(ScatterView, _super);\n\n function ScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScatterView.type;\n return _this;\n }\n\n ScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.updateData(data, {\n // TODO\n // If this parameter should be a shape or a bounding volume\n // shape will be more general.\n // But bounding volume like bounding rect will be much faster in the contain calculation\n clipShape: this._getClipShape(seriesModel)\n });\n this._finished = true;\n };\n\n ScatterView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var symbolDraw = this._updateSymbolDraw(data, seriesModel);\n\n symbolDraw.incrementalPrepareUpdate(data);\n this._finished = false;\n };\n\n ScatterView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {\n clipShape: this._getClipShape(seriesModel)\n });\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n ScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData(); // Must mark group dirty and make sure the incremental layer will be cleared\n // PENDING\n\n this.group.dirty();\n\n if (!this._finished || data.count() > 1e4) {\n return {\n update: true\n };\n } else {\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout(data);\n }\n };\n\n ScatterView.prototype.eachRendered = function (cb) {\n this._symbolDraw && this._symbolDraw.eachRendered(cb);\n };\n\n ScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n ScatterView.prototype._updateSymbolDraw = function (data, seriesModel) {\n var symbolDraw = this._symbolDraw;\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {\n symbolDraw && symbolDraw.remove();\n symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();\n this._isLargeDraw = isLargeDraw;\n this.group.removeAll();\n }\n\n this.group.add(symbolDraw.group);\n return symbolDraw;\n };\n\n ScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n this._symbolDraw = null;\n };\n\n ScatterView.prototype.dispose = function () {};\n\n ScatterView.type = 'scatter';\n return ScatterView;\n}(ChartView);\n\nexport default ScatterView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar GridModel =\n/** @class */\nfunction (_super) {\n __extends(GridModel, _super);\n\n function GridModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GridModel.type = 'grid';\n GridModel.dependencies = ['xAxis', 'yAxis'];\n GridModel.layoutMode = 'box';\n GridModel.defaultOption = {\n show: false,\n // zlevel: 0,\n z: 0,\n left: '10%',\n top: 60,\n right: '10%',\n bottom: 70,\n // If grid size contain label\n containLabel: false,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 1,\n borderColor: '#ccc'\n };\n return GridModel;\n}(ComponentModel);\n\nexport default GridModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar AxisModelCommonMixin =\n/** @class */\nfunction () {\n function AxisModelCommonMixin() {}\n\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n var option = this.option;\n return !option.scale;\n };\n /**\r\n * Should be implemented by each axis model if necessary.\r\n * @return coordinate system model\r\n */\n\n\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n return;\n };\n\n return AxisModelCommonMixin;\n}();\n\nexport { AxisModelCommonMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nvar CartesianAxisModel =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisModel, _super);\n\n function CartesianAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n CartesianAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n };\n\n CartesianAxisModel.type = 'cartesian2dAxis';\n return CartesianAxisModel;\n}(ComponentModel);\n\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar defaultOption = {\n show: true,\n // zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By default auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#6E7079',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#E0E6F1'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\n }\n }\n};\nvar categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n boundaryGap: [0, 0],\n axisLine: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n axisTick: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n splitNumber: 5,\n minorTick: {\n // Minor tick, not available for cateogry axis.\n show: false,\n // Split number of minor ticks. The value should be in range of (0, 100)\n splitNumber: 5,\n // Length of minor tick\n length: 3,\n // Line style\n lineStyle: {// Default to be same with axisTick\n }\n },\n minorSplitLine: {\n show: false,\n lineStyle: {\n color: '#F4F7FD',\n width: 1\n }\n }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n splitNumber: 6,\n axisLabel: {\n // To eliminate labels that are not nice\n showMinLabel: false,\n showMaxLabel: false,\n rich: {\n primary: {\n fontWeight: 'bold'\n }\n }\n },\n splitLine: {\n show: false\n }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n logBase: 10\n}, valueAxis);\nexport default {\n category: categoryAxis,\n value: valueAxis,\n time: timeAxis,\n log: logAxis\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, isObject, map, isString } from 'zrender/lib/core/util.js';\nvar uidBase = 0;\n\nvar OrdinalMeta =\n/** @class */\nfunction () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n this.uid = ++uidBase;\n }\n\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n\n ;\n\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\r\n * @return The ordinal. If not found, return NaN.\r\n */\n\n\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (!isString(category) && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = this._getOrCreateMap(); // @ts-ignore\n\n\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category; // @ts-ignore\n\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n }; // Consider big data, do not create map until needed.\n\n\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n\n return OrdinalMeta;\n}();\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nexport default OrdinalMeta;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport var AXIS_TYPES = {\n value: 1,\n category: 1,\n time: 1,\n log: 1\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault.js';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport { AXIS_TYPES } from './axisCommonTypes.js';\nimport { each, merge } from 'zrender/lib/core/util.js';\n/**\r\n * Generate sub axis model class\r\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\r\n */\n\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n each(AXIS_TYPES, function (v, axisType) {\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n __extends(AxisModel, _super);\n\n function AxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n merge(option, themeModel.get(axisType + 'Axis'));\n merge(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\r\n * Should not be called before all of 'getInitailData' finished.\r\n * Because categories are collected during initializing data.\r\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\n\nfunction getAxisType(option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as clazzUtil from '../util/clazz.js';\n\nvar Scale =\n/** @class */\nfunction () {\n function Scale(setting) {\n this._setting = setting || {};\n this._extent = [Infinity, -Infinity];\n }\n\n Scale.prototype.getSetting = function (name) {\n return this._setting[name];\n };\n /**\r\n * Set extent from data\r\n */\n\n\n Scale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // not setExtent because in log axis it may transformed to power\n // this.setExtent(extent[0], extent[1]);\n };\n /**\r\n * Set extent from data\r\n */\n\n\n Scale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * Get extent\r\n *\r\n * Extent is always in increase order.\r\n */\n\n\n Scale.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\r\n * Set extent\r\n */\n\n\n Scale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent;\n\n if (!isNaN(start)) {\n thisExtent[0] = start;\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = end;\n }\n };\n /**\r\n * If value is in extent range\r\n */\n\n\n Scale.prototype.isInExtentRange = function (value) {\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\n\n\n Scale.prototype.isBlank = function () {\n return this._isBlank;\n };\n /**\r\n * When axis extent depends on data and no data exists,\r\n * axis ticks should not be drawn, which is named 'blank'.\r\n */\n\n\n Scale.prototype.setBlank = function (isBlank) {\n this._isBlank = isBlank;\n };\n\n return Scale;\n}();\n\nclazzUtil.enableClassManagement(Scale);\nexport default Scale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getPrecision, round, nice, quantityExponent } from '../util/number.js';\nexport function isValueNice(val) {\n var exp10 = Math.pow(10, quantityExponent(Math.abs(val)));\n var f = Math.abs(val / exp10);\n return f === 0 || f === 1 || f === 2 || f === 3 || f === 5;\n}\nexport function isIntervalOrLogScale(scale) {\n return scale.type === 'interval' || scale.type === 'log';\n}\n/**\r\n * @param extent Both extent[0] and extent[1] should be valid number.\r\n * Should be extent[0] < extent[1].\r\n * @param splitNumber splitNumber should be >= 1.\r\n */\n\nexport function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\nexport function increaseInterval(interval) {\n var exp10 = Math.pow(10, quantityExponent(interval)); // Increase interval\n\n var f = interval / exp10;\n\n if (!f) {\n f = 1;\n } else if (f === 2) {\n f = 3;\n } else if (f === 3) {\n f = 5;\n } else {\n // f is 1 or 5\n f *= 2;\n }\n\n return round(f * exp10);\n}\n/**\r\n * @return interval precision\r\n */\n\nexport function getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return getPrecision(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nexport function fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\nexport function contain(val, extent) {\n return val >= extent[0] && val <= extent[1];\n}\nexport function normalize(val, extent) {\n if (extent[1] === extent[0]) {\n return 0.5;\n }\n\n return (val - extent[0]) / (extent[1] - extent[0]);\n}\nexport function scale(val, extent) {\n return val * (extent[1] - extent[0]) + extent[0];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Linear continuous scale\r\n * http://en.wikipedia.org/wiki/Level_of_measurement\r\n */\n// FIXME only one data\n\nimport Scale from './Scale.js';\nimport OrdinalMeta from '../data/OrdinalMeta.js';\nimport * as scaleHelper from './helper.js';\nimport { isArray, map, isObject, isString } from 'zrender/lib/core/util.js';\n\nvar OrdinalScale =\n/** @class */\nfunction (_super) {\n __extends(OrdinalScale, _super);\n\n function OrdinalScale(setting) {\n var _this = _super.call(this, setting) || this;\n\n _this.type = 'ordinal';\n\n var ordinalMeta = _this.getSetting('ordinalMeta'); // Caution: Should not use instanceof, consider ec-extensions using\n // import approach to get OrdinalMeta class.\n\n\n if (!ordinalMeta) {\n ordinalMeta = new OrdinalMeta({});\n }\n\n if (isArray(ordinalMeta)) {\n ordinalMeta = new OrdinalMeta({\n categories: map(ordinalMeta, function (item) {\n return isObject(item) ? item.value : item;\n })\n });\n }\n\n _this._ordinalMeta = ordinalMeta;\n _this._extent = _this.getSetting('extent') || [0, ordinalMeta.categories.length - 1];\n return _this;\n }\n\n OrdinalScale.prototype.parse = function (val) {\n // Caution: Math.round(null) will return `0` rather than `NaN`\n if (val == null) {\n return NaN;\n }\n\n return isString(val) ? this._ordinalMeta.getOrdinal(val) // val might be float.\n : Math.round(val);\n };\n\n OrdinalScale.prototype.contain = function (rank) {\n rank = this.parse(rank);\n return scaleHelper.contain(rank, this._extent) && this._ordinalMeta.categories[rank] != null;\n };\n /**\r\n * Normalize given rank or name to linear [0, 1]\r\n * @param val raw ordinal number.\r\n * @return normalized value in [0, 1].\r\n */\n\n\n OrdinalScale.prototype.normalize = function (val) {\n val = this._getTickNumber(this.parse(val));\n return scaleHelper.normalize(val, this._extent);\n };\n /**\r\n * @param val normalized value in [0, 1].\r\n * @return raw ordinal number.\r\n */\n\n\n OrdinalScale.prototype.scale = function (val) {\n val = Math.round(scaleHelper.scale(val, this._extent));\n return this.getRawOrdinalNumber(val);\n };\n\n OrdinalScale.prototype.getTicks = function () {\n var ticks = [];\n var extent = this._extent;\n var rank = extent[0];\n\n while (rank <= extent[1]) {\n ticks.push({\n value: rank\n });\n rank++;\n }\n\n return ticks;\n };\n\n OrdinalScale.prototype.getMinorTicks = function (splitNumber) {\n // Not support.\n return;\n };\n /**\r\n * @see `Ordinal['_ordinalNumbersByTick']`\r\n */\n\n\n OrdinalScale.prototype.setSortInfo = function (info) {\n if (info == null) {\n this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;\n return;\n }\n\n var infoOrdinalNumbers = info.ordinalNumbers;\n var ordinalsByTick = this._ordinalNumbersByTick = [];\n var ticksByOrdinal = this._ticksByOrdinalNumber = []; // Unnecessary support negative tick in `realtimeSort`.\n\n var tickNum = 0;\n var allCategoryLen = this._ordinalMeta.categories.length;\n\n for (var len = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len; ++tickNum) {\n var ordinalNumber = infoOrdinalNumbers[tickNum];\n ordinalsByTick[tickNum] = ordinalNumber;\n ticksByOrdinal[ordinalNumber] = tickNum;\n } // Handle that `series.data` only covers part of the `axis.category.data`.\n\n\n var unusedOrdinal = 0;\n\n for (; tickNum < allCategoryLen; ++tickNum) {\n while (ticksByOrdinal[unusedOrdinal] != null) {\n unusedOrdinal++;\n }\n\n ;\n ordinalsByTick.push(unusedOrdinal);\n ticksByOrdinal[unusedOrdinal] = tickNum;\n }\n };\n\n OrdinalScale.prototype._getTickNumber = function (ordinal) {\n var ticksByOrdinalNumber = this._ticksByOrdinalNumber; // also support ordinal out of range of `ordinalMeta.categories.length`,\n // where ordinal numbers are used as tick value directly.\n\n return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;\n };\n /**\r\n * @usage\r\n * ```js\r\n * const ordinalNumber = ordinalScale.getRawOrdinalNumber(tickVal);\r\n *\r\n * // case0\r\n * const rawOrdinalValue = axisModel.getCategories()[ordinalNumber];\r\n * // case1\r\n * const rawOrdinalValue = this._ordinalMeta.categories[ordinalNumber];\r\n * // case2\r\n * const coord = axis.dataToCoord(ordinalNumber);\r\n * ```\r\n *\r\n * @param {OrdinalNumber} tickNumber index of display\r\n */\n\n\n OrdinalScale.prototype.getRawOrdinalNumber = function (tickNumber) {\n var ordinalNumbersByTick = this._ordinalNumbersByTick; // tickNumber may be out of range, e.g., when axis max is larger than `ordinalMeta.categories.length`.,\n // where ordinal numbers are used as tick value directly.\n\n return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;\n };\n /**\r\n * Get item on tick\r\n */\n\n\n OrdinalScale.prototype.getLabel = function (tick) {\n if (!this.isBlank()) {\n var ordinalNumber = this.getRawOrdinalNumber(tick.value);\n var cateogry = this._ordinalMeta.categories[ordinalNumber]; // Note that if no data, ordinalMeta.categories is an empty array.\n // Return empty if it's not exist.\n\n return cateogry == null ? '' : cateogry + '';\n }\n };\n\n OrdinalScale.prototype.count = function () {\n return this._extent[1] - this._extent[0] + 1;\n };\n\n OrdinalScale.prototype.unionExtentFromData = function (data, dim) {\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * @override\r\n * If value is in extent range\r\n */\n\n\n OrdinalScale.prototype.isInExtentRange = function (value) {\n value = this._getTickNumber(value);\n return this._extent[0] <= value && this._extent[1] >= value;\n };\n\n OrdinalScale.prototype.getOrdinalMeta = function () {\n return this._ordinalMeta;\n };\n\n OrdinalScale.prototype.calcNiceTicks = function () {};\n\n OrdinalScale.prototype.calcNiceExtent = function () {};\n\n OrdinalScale.type = 'ordinal';\n return OrdinalScale;\n}(Scale);\n\nScale.registerClass(OrdinalScale);\nexport default OrdinalScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as numberUtil from '../util/number.js';\nimport * as formatUtil from '../util/format.js';\nimport Scale from './Scale.js';\nimport * as helper from './helper.js';\nvar roundNumber = numberUtil.round;\n\nvar IntervalScale =\n/** @class */\nfunction (_super) {\n __extends(IntervalScale, _super);\n\n function IntervalScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'interval'; // Step is calculated in adjustExtent.\n\n _this._interval = 0;\n _this._intervalPrecision = 2;\n return _this;\n }\n\n IntervalScale.prototype.parse = function (val) {\n return val;\n };\n\n IntervalScale.prototype.contain = function (val) {\n return helper.contain(val, this._extent);\n };\n\n IntervalScale.prototype.normalize = function (val) {\n return helper.normalize(val, this._extent);\n };\n\n IntervalScale.prototype.scale = function (val) {\n return helper.scale(val, this._extent);\n };\n\n IntervalScale.prototype.setExtent = function (start, end) {\n var thisExtent = this._extent; // start,end may be a Number like '25',so...\n\n if (!isNaN(start)) {\n thisExtent[0] = parseFloat(start);\n }\n\n if (!isNaN(end)) {\n thisExtent[1] = parseFloat(end);\n }\n };\n\n IntervalScale.prototype.unionExtent = function (other) {\n var extent = this._extent;\n other[0] < extent[0] && (extent[0] = other[0]);\n other[1] > extent[1] && (extent[1] = other[1]); // unionExtent may called by it's sub classes\n\n this.setExtent(extent[0], extent[1]);\n };\n\n IntervalScale.prototype.getInterval = function () {\n return this._interval;\n };\n\n IntervalScale.prototype.setInterval = function (interval) {\n this._interval = interval; // Dropped auto calculated niceExtent and use user-set extent.\n // We assume user wants to set both interval, min, max to get a better result.\n\n this._niceExtent = this._extent.slice();\n this._intervalPrecision = helper.getIntervalPrecision(interval);\n };\n /**\r\n * @param expandToNicedExtent Whether expand the ticks to niced extent.\r\n */\n\n\n IntervalScale.prototype.getTicks = function (expandToNicedExtent) {\n var interval = this._interval;\n var extent = this._extent;\n var niceTickExtent = this._niceExtent;\n var intervalPrecision = this._intervalPrecision;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[0]\n });\n }\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push({\n value: tick\n }); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1].value) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];\n\n if (extent[1] > lastNiceTick) {\n if (expandToNicedExtent) {\n ticks.push({\n value: roundNumber(lastNiceTick + interval, intervalPrecision)\n });\n } else {\n ticks.push({\n value: extent[1]\n });\n }\n }\n\n return ticks;\n };\n\n IntervalScale.prototype.getMinorTicks = function (splitNumber) {\n var ticks = this.getTicks(true);\n var minorTicks = [];\n var extent = this.getExtent();\n\n for (var i = 1; i < ticks.length; i++) {\n var nextTick = ticks[i];\n var prevTick = ticks[i - 1];\n var count = 0;\n var minorTicksGroup = [];\n var interval = nextTick.value - prevTick.value;\n var minorInterval = interval / splitNumber;\n\n while (count < splitNumber - 1) {\n var minorTick = roundNumber(prevTick.value + (count + 1) * minorInterval); // For the first and last interval. The count may be less than splitNumber.\n\n if (minorTick > extent[0] && minorTick < extent[1]) {\n minorTicksGroup.push(minorTick);\n }\n\n count++;\n }\n\n minorTicks.push(minorTicksGroup);\n }\n\n return minorTicks;\n };\n /**\r\n * @param opt.precision If 'auto', use nice presision.\r\n * @param opt.pad returns 1.50 but not 1.5 if precision is 2.\r\n */\n\n\n IntervalScale.prototype.getLabel = function (data, opt) {\n if (data == null) {\n return '';\n }\n\n var precision = opt && opt.precision;\n\n if (precision == null) {\n precision = numberUtil.getPrecision(data.value) || 0;\n } else if (precision === 'auto') {\n // Should be more precise then tick.\n precision = this._intervalPrecision;\n } // (1) If `precision` is set, 12.005 should be display as '12.00500'.\n // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'.\n\n\n var dataNum = roundNumber(data.value, precision, true);\n return formatUtil.addCommas(dataNum);\n };\n /**\r\n * @param splitNumber By default `5`.\r\n */\n\n\n IntervalScale.prototype.calcNiceTicks = function (splitNumber, minInterval, maxInterval) {\n splitNumber = splitNumber || 5;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (!isFinite(span)) {\n return;\n } // User may set axis min 0 and data are all negative\n // FIXME If it needs to reverse ?\n\n\n if (span < 0) {\n span = -span;\n extent.reverse();\n }\n\n var result = helper.intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval);\n this._intervalPrecision = result.intervalPrecision;\n this._interval = result.interval;\n this._niceExtent = result.niceTickExtent;\n };\n\n IntervalScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n if (extent[0] !== 0) {\n // Expand extent\n // Note that extents can be both negative. See #13154\n var expandSize = Math.abs(extent[0]); // In the fowllowing case\n // Axis has been fixed max 100\n // Plus data are all 100 and axis extent are [100, 100].\n // Extend to the both side will cause expanded max is larger than fixed max.\n // So only expand to the smaller side.\n\n if (!opt.fixMax) {\n extent[1] += expandSize / 2;\n extent[0] -= expandSize / 2;\n } else {\n extent[0] -= expandSize / 2;\n }\n } else {\n extent[1] = 1;\n }\n }\n\n var span = extent[1] - extent[0]; // If there are no data and extent are [Infinity, -Infinity]\n\n if (!isFinite(span)) {\n extent[0] = 0;\n extent[1] = 1;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval); // let extent = this._extent;\n\n var interval = this._interval;\n\n if (!opt.fixMin) {\n extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval);\n }\n\n if (!opt.fixMax) {\n extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval);\n }\n };\n\n IntervalScale.prototype.setNiceExtent = function (min, max) {\n this._niceExtent = [min, max];\n };\n\n IntervalScale.type = 'interval';\n return IntervalScale;\n}(Scale);\n\nScale.registerClass(IntervalScale);\nexport default IntervalScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The \"scaleLevels\" was originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment on the definition of \"scaleLevels\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\n// [About UTC and local time zone]:\n// In most cases, `number.parseDate` will treat input data string as local time\n// (except time zone is specified in time string). And `format.formateTime` returns\n// local time by default. option.useUTC is false by default. This design has\n// considered these common cases:\n// (1) Time that is persistent in server is in UTC, but it is needed to be displayed\n// in local time by default.\n// (2) By default, the input data string (e.g., '2011-01-02') should be displayed\n// as its original time, without any time difference.\n\nimport * as numberUtil from '../util/number.js';\nimport { ONE_SECOND, ONE_MINUTE, ONE_HOUR, ONE_DAY, ONE_YEAR, format, leveledFormat, getUnitValue, timeUnits, fullLeveledFormatter, getPrimaryTimeUnit, isPrimaryTimeUnit, getDefaultFormatPrecisionOfInterval, fullYearGetterName, monthSetterName, fullYearSetterName, dateSetterName, hoursGetterName, hoursSetterName, minutesSetterName, secondsSetterName, millisecondsSetterName, monthGetterName, dateGetterName, minutesGetterName, secondsGetterName, millisecondsGetterName } from '../util/time.js';\nimport * as scaleHelper from './helper.js';\nimport IntervalScale from './Interval.js';\nimport Scale from './Scale.js';\nimport { warn } from '../util/log.js';\nimport { filter, isNumber, map } from 'zrender/lib/core/util.js'; // FIXME 公用?\n\nvar bisect = function (a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n\n if (a[mid][1] < x) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n return lo;\n};\n\nvar TimeScale =\n/** @class */\nfunction (_super) {\n __extends(TimeScale, _super);\n\n function TimeScale(settings) {\n var _this = _super.call(this, settings) || this;\n\n _this.type = 'time';\n return _this;\n }\n /**\r\n * Get label is mainly for other components like dataZoom, tooltip.\r\n */\n\n\n TimeScale.prototype.getLabel = function (tick) {\n var useUTC = this.getSetting('useUTC');\n return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting('locale'));\n };\n\n TimeScale.prototype.getFormattedLabel = function (tick, idx, labelFormatter) {\n var isUTC = this.getSetting('useUTC');\n var lang = this.getSetting('locale');\n return leveledFormat(tick, idx, labelFormatter, lang, isUTC);\n };\n /**\r\n * @override\r\n */\n\n\n TimeScale.prototype.getTicks = function () {\n var interval = this._interval;\n var extent = this._extent;\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n }\n\n ticks.push({\n value: extent[0],\n level: 0\n });\n var useUTC = this.getSetting('useUTC');\n var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent);\n ticks = ticks.concat(innerTicks);\n ticks.push({\n value: extent[1],\n level: 0\n });\n return ticks;\n };\n\n TimeScale.prototype.calcNiceExtent = function (opt) {\n var extent = this._extent; // If extent start and end are same, expand them\n\n if (extent[0] === extent[1]) {\n // Expand extent\n extent[0] -= ONE_DAY;\n extent[1] += ONE_DAY;\n } // If there are no data and extent are [Infinity, -Infinity]\n\n\n if (extent[1] === -Infinity && extent[0] === Infinity) {\n var d = new Date();\n extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());\n extent[0] = extent[1] - ONE_DAY;\n }\n\n this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);\n };\n\n TimeScale.prototype.calcNiceTicks = function (approxTickNum, minInterval, maxInterval) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n this._approxInterval = span / approxTickNum;\n\n if (minInterval != null && this._approxInterval < minInterval) {\n this._approxInterval = minInterval;\n }\n\n if (maxInterval != null && this._approxInterval > maxInterval) {\n this._approxInterval = maxInterval;\n }\n\n var scaleIntervalsLen = scaleIntervals.length;\n var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1); // Interval that can be used to calculate ticks\n\n this._interval = scaleIntervals[idx][1]; // Min level used when picking ticks from top down.\n // We check one more level to avoid the ticks are to sparse in some case.\n\n this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];\n };\n\n TimeScale.prototype.parse = function (val) {\n // val might be float.\n return isNumber(val) ? val : +numberUtil.parseDate(val);\n };\n\n TimeScale.prototype.contain = function (val) {\n return scaleHelper.contain(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.normalize = function (val) {\n return scaleHelper.normalize(this.parse(val), this._extent);\n };\n\n TimeScale.prototype.scale = function (val) {\n return scaleHelper.scale(val, this._extent);\n };\n\n TimeScale.type = 'time';\n return TimeScale;\n}(IntervalScale);\n/**\r\n * This implementation was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\n\nvar scaleIntervals = [// Format interval\n['second', ONE_SECOND], ['minute', ONE_MINUTE], ['hour', ONE_HOUR], ['quarter-day', ONE_HOUR * 6], ['half-day', ONE_HOUR * 12], ['day', ONE_DAY * 1.2], ['half-week', ONE_DAY * 3.5], ['week', ONE_DAY * 7], ['month', ONE_DAY * 31], ['quarter', ONE_DAY * 95], ['half-year', ONE_YEAR / 2], ['year', ONE_YEAR] // 1Y\n];\n\nfunction isUnitValueSame(unit, valueA, valueB, isUTC) {\n var dateA = numberUtil.parseDate(valueA);\n var dateB = numberUtil.parseDate(valueB);\n\n var isSame = function (unit) {\n return getUnitValue(dateA, unit, isUTC) === getUnitValue(dateB, unit, isUTC);\n };\n\n var isSameYear = function () {\n return isSame('year');\n }; // const isSameHalfYear = () => isSameYear() && isSame('half-year');\n // const isSameQuater = () => isSameYear() && isSame('quarter');\n\n\n var isSameMonth = function () {\n return isSameYear() && isSame('month');\n };\n\n var isSameDay = function () {\n return isSameMonth() && isSame('day');\n }; // const isSameHalfDay = () => isSameDay() && isSame('half-day');\n\n\n var isSameHour = function () {\n return isSameDay() && isSame('hour');\n };\n\n var isSameMinute = function () {\n return isSameHour() && isSame('minute');\n };\n\n var isSameSecond = function () {\n return isSameMinute() && isSame('second');\n };\n\n var isSameMilliSecond = function () {\n return isSameSecond() && isSame('millisecond');\n };\n\n switch (unit) {\n case 'year':\n return isSameYear();\n\n case 'month':\n return isSameMonth();\n\n case 'day':\n return isSameDay();\n\n case 'hour':\n return isSameHour();\n\n case 'minute':\n return isSameMinute();\n\n case 'second':\n return isSameSecond();\n\n case 'millisecond':\n return isSameMilliSecond();\n }\n} // const primaryUnitGetters = {\n// year: fullYearGetterName(),\n// month: monthGetterName(),\n// day: dateGetterName(),\n// hour: hoursGetterName(),\n// minute: minutesGetterName(),\n// second: secondsGetterName(),\n// millisecond: millisecondsGetterName()\n// };\n// const primaryUnitUTCGetters = {\n// year: fullYearGetterName(true),\n// month: monthGetterName(true),\n// day: dateGetterName(true),\n// hour: hoursGetterName(true),\n// minute: minutesGetterName(true),\n// second: secondsGetterName(true),\n// millisecond: millisecondsGetterName(true)\n// };\n// function moveTick(date: Date, unitName: TimeUnit, step: number, isUTC: boolean) {\n// step = step || 1;\n// switch (getPrimaryTimeUnit(unitName)) {\n// case 'year':\n// date[fullYearSetterName(isUTC)](date[fullYearGetterName(isUTC)]() + step);\n// break;\n// case 'month':\n// date[monthSetterName(isUTC)](date[monthGetterName(isUTC)]() + step);\n// break;\n// case 'day':\n// date[dateSetterName(isUTC)](date[dateGetterName(isUTC)]() + step);\n// break;\n// case 'hour':\n// date[hoursSetterName(isUTC)](date[hoursGetterName(isUTC)]() + step);\n// break;\n// case 'minute':\n// date[minutesSetterName(isUTC)](date[minutesGetterName(isUTC)]() + step);\n// break;\n// case 'second':\n// date[secondsSetterName(isUTC)](date[secondsGetterName(isUTC)]() + step);\n// break;\n// case 'millisecond':\n// date[millisecondsSetterName(isUTC)](date[millisecondsGetterName(isUTC)]() + step);\n// break;\n// }\n// return date.getTime();\n// }\n// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];\n// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];\n// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [15, 15], [10, 10], [5, 5], [2, 2]];\n\n\nfunction getDateInterval(approxInterval, daysInMonth) {\n approxInterval /= ONE_DAY;\n return approxInterval > 16 ? 16 // Math.floor(daysInMonth / 2) + 1 // In this case we only want one tick between two months.\n : approxInterval > 7.5 ? 7 // TODO week 7 or day 8?\n : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;\n}\n\nfunction getMonthInterval(approxInterval) {\n var APPROX_ONE_MONTH = 30 * ONE_DAY;\n approxInterval /= APPROX_ONE_MONTH;\n return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getHourInterval(approxInterval) {\n approxInterval /= ONE_HOUR;\n return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMinutesAndSecondsInterval(approxInterval, isMinutes) {\n approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;\n return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;\n}\n\nfunction getMillisecondsInterval(approxInterval) {\n return numberUtil.nice(approxInterval, true);\n}\n\nfunction getFirstTimestampOfUnit(date, unitName, isUTC) {\n var outDate = new Date(date);\n\n switch (getPrimaryTimeUnit(unitName)) {\n case 'year':\n case 'month':\n outDate[monthSetterName(isUTC)](0);\n\n case 'day':\n outDate[dateSetterName(isUTC)](1);\n\n case 'hour':\n outDate[hoursSetterName(isUTC)](0);\n\n case 'minute':\n outDate[minutesSetterName(isUTC)](0);\n\n case 'second':\n outDate[secondsSetterName(isUTC)](0);\n outDate[millisecondsSetterName(isUTC)](0);\n }\n\n return outDate.getTime();\n}\n\nfunction getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent) {\n var safeLimit = 10000;\n var unitNames = timeUnits;\n var iter = 0;\n\n function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate, out) {\n var date = new Date(minTimestamp);\n var dateTime = minTimestamp;\n var d = date[getMethodName](); // if (isDate) {\n // d -= 1; // Starts with 0; PENDING\n // }\n\n while (dateTime < maxTimestamp && dateTime <= extent[1]) {\n out.push({\n value: dateTime\n });\n d += interval;\n date[setMethodName](d);\n dateTime = date.getTime();\n } // This extra tick is for calcuating ticks of next level. Will not been added to the final result\n\n\n out.push({\n value: dateTime,\n notAdd: true\n });\n }\n\n function addLevelTicks(unitName, lastLevelTicks, levelTicks) {\n var newAddedTicks = [];\n var isFirstLevel = !lastLevelTicks.length;\n\n if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent[0], extent[1], isUTC)) {\n return;\n }\n\n if (isFirstLevel) {\n lastLevelTicks = [{\n // TODO Optimize. Not include so may ticks.\n value: getFirstTimestampOfUnit(new Date(extent[0]), unitName, isUTC)\n }, {\n value: extent[1]\n }];\n }\n\n for (var i = 0; i < lastLevelTicks.length - 1; i++) {\n var startTick = lastLevelTicks[i].value;\n var endTick = lastLevelTicks[i + 1].value;\n\n if (startTick === endTick) {\n continue;\n }\n\n var interval = void 0;\n var getterName = void 0;\n var setterName = void 0;\n var isDate = false;\n\n switch (unitName) {\n case 'year':\n interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));\n getterName = fullYearGetterName(isUTC);\n setterName = fullYearSetterName(isUTC);\n break;\n\n case 'half-year':\n case 'quarter':\n case 'month':\n interval = getMonthInterval(approxInterval);\n getterName = monthGetterName(isUTC);\n setterName = monthSetterName(isUTC);\n break;\n\n case 'week': // PENDING If week is added. Ignore day.\n\n case 'half-week':\n case 'day':\n interval = getDateInterval(approxInterval, 31); // Use 32 days and let interval been 16\n\n getterName = dateGetterName(isUTC);\n setterName = dateSetterName(isUTC);\n isDate = true;\n break;\n\n case 'half-day':\n case 'quarter-day':\n case 'hour':\n interval = getHourInterval(approxInterval);\n getterName = hoursGetterName(isUTC);\n setterName = hoursSetterName(isUTC);\n break;\n\n case 'minute':\n interval = getMinutesAndSecondsInterval(approxInterval, true);\n getterName = minutesGetterName(isUTC);\n setterName = minutesSetterName(isUTC);\n break;\n\n case 'second':\n interval = getMinutesAndSecondsInterval(approxInterval, false);\n getterName = secondsGetterName(isUTC);\n setterName = secondsSetterName(isUTC);\n break;\n\n case 'millisecond':\n interval = getMillisecondsInterval(approxInterval);\n getterName = millisecondsGetterName(isUTC);\n setterName = millisecondsSetterName(isUTC);\n break;\n }\n\n addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate, newAddedTicks);\n\n if (unitName === 'year' && levelTicks.length > 1 && i === 0) {\n // Add nearest years to the left extent.\n levelTicks.unshift({\n value: levelTicks[0].value - interval\n });\n }\n }\n\n for (var i = 0; i < newAddedTicks.length; i++) {\n levelTicks.push(newAddedTicks[i]);\n } // newAddedTicks.length && console.log(unitName, newAddedTicks);\n\n\n return newAddedTicks;\n }\n\n var levelsTicks = [];\n var currentLevelTicks = [];\n var tickCount = 0;\n var lastLevelTickCount = 0;\n\n for (var i = 0; i < unitNames.length && iter++ < safeLimit; ++i) {\n var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i]);\n\n if (!isPrimaryTimeUnit(unitNames[i])) {\n // TODO\n continue;\n }\n\n addLevelTicks(unitNames[i], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);\n var nextPrimaryTimeUnit = unitNames[i + 1] ? getPrimaryTimeUnit(unitNames[i + 1]) : null;\n\n if (primaryTimeUnit !== nextPrimaryTimeUnit) {\n if (currentLevelTicks.length) {\n lastLevelTickCount = tickCount; // Remove the duplicate so the tick count can be precisely.\n\n currentLevelTicks.sort(function (a, b) {\n return a.value - b.value;\n });\n var levelTicksRemoveDuplicated = [];\n\n for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {\n var tickValue = currentLevelTicks[i_1].value;\n\n if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {\n levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);\n\n if (tickValue >= extent[0] && tickValue <= extent[1]) {\n tickCount++;\n }\n }\n }\n\n var targetTickNum = (extent[1] - extent[0]) / approxInterval; // Added too much in this level and not too less in last level\n\n if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {\n break;\n } // Only treat primary time unit as one level.\n\n\n levelsTicks.push(levelTicksRemoveDuplicated);\n\n if (tickCount > targetTickNum || bottomUnitName === unitNames[i]) {\n break;\n }\n } // Reset if next unitName is primary\n\n\n currentLevelTicks = [];\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (iter >= safeLimit) {\n warn('Exceed safe limit.');\n }\n }\n\n var levelsTicksInExtent = filter(map(levelsTicks, function (levelTicks) {\n return filter(levelTicks, function (tick) {\n return tick.value >= extent[0] && tick.value <= extent[1] && !tick.notAdd;\n });\n }), function (levelTicks) {\n return levelTicks.length > 0;\n });\n var ticks = [];\n var maxLevel = levelsTicksInExtent.length - 1;\n\n for (var i = 0; i < levelsTicksInExtent.length; ++i) {\n var levelTicks = levelsTicksInExtent[i];\n\n for (var k = 0; k < levelTicks.length; ++k) {\n ticks.push({\n value: levelTicks[k].value,\n level: maxLevel - i\n });\n }\n }\n\n ticks.sort(function (a, b) {\n return a.value - b.value;\n }); // Remove duplicates\n\n var result = [];\n\n for (var i = 0; i < ticks.length; ++i) {\n if (i === 0 || ticks[i].value !== ticks[i - 1].value) {\n result.push(ticks[i]);\n }\n }\n\n return result;\n}\n\nScale.registerClass(TimeScale);\nexport default TimeScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Scale from './Scale.js';\nimport * as numberUtil from '../util/number.js';\nimport * as scaleHelper from './helper.js'; // Use some method of IntervalScale\n\nimport IntervalScale from './Interval.js';\nvar scaleProto = Scale.prototype; // FIXME:TS refactor: not good to call it directly with `this`?\n\nvar intervalScaleProto = IntervalScale.prototype;\nvar roundingErrorFix = numberUtil.round;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar mathPow = Math.pow;\nvar mathLog = Math.log;\n\nvar LogScale =\n/** @class */\nfunction (_super) {\n __extends(LogScale, _super);\n\n function LogScale() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'log';\n _this.base = 10;\n _this._originalScale = new IntervalScale(); // FIXME:TS actually used by `IntervalScale`\n\n _this._interval = 0;\n return _this;\n }\n /**\r\n * @param Whether expand the ticks to niced extent.\r\n */\n\n\n LogScale.prototype.getTicks = function (expandToNicedExtent) {\n var originalScale = this._originalScale;\n var extent = this._extent;\n var originalExtent = originalScale.getExtent();\n var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);\n return zrUtil.map(ticks, function (tick) {\n var val = tick.value;\n var powVal = numberUtil.round(mathPow(this.base, val)); // Fix #4158\n\n powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;\n powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;\n return {\n value: powVal\n };\n }, this);\n };\n\n LogScale.prototype.setExtent = function (start, end) {\n var base = mathLog(this.base); // log(-Infinity) is NaN, so safe guard here\n\n start = mathLog(Math.max(0, start)) / base;\n end = mathLog(Math.max(0, end)) / base;\n intervalScaleProto.setExtent.call(this, start, end);\n };\n /**\r\n * @return {number} end\r\n */\n\n\n LogScale.prototype.getExtent = function () {\n var base = this.base;\n var extent = scaleProto.getExtent.call(this);\n extent[0] = mathPow(base, extent[0]);\n extent[1] = mathPow(base, extent[1]); // Fix #4158\n\n var originalScale = this._originalScale;\n var originalExtent = originalScale.getExtent();\n this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0]));\n this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1]));\n return extent;\n };\n\n LogScale.prototype.unionExtent = function (extent) {\n this._originalScale.unionExtent(extent);\n\n var base = this.base;\n extent[0] = mathLog(extent[0]) / mathLog(base);\n extent[1] = mathLog(extent[1]) / mathLog(base);\n scaleProto.unionExtent.call(this, extent);\n };\n\n LogScale.prototype.unionExtentFromData = function (data, dim) {\n // TODO\n // filter value that <= 0\n this.unionExtent(data.getApproximateExtent(dim));\n };\n /**\r\n * Update interval and extent of intervals for nice ticks\r\n * @param approxTickNum default 10 Given approx tick number\r\n */\n\n\n LogScale.prototype.calcNiceTicks = function (approxTickNum) {\n approxTickNum = approxTickNum || 10;\n var extent = this._extent;\n var span = extent[1] - extent[0];\n\n if (span === Infinity || span <= 0) {\n return;\n }\n\n var interval = numberUtil.quantity(span);\n var err = approxTickNum / span * interval; // Filter ticks to get closer to the desired count.\n\n if (err <= 0.5) {\n interval *= 10;\n } // Interval should be integer\n\n\n while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {\n interval *= 10;\n }\n\n var niceExtent = [numberUtil.round(mathCeil(extent[0] / interval) * interval), numberUtil.round(mathFloor(extent[1] / interval) * interval)];\n this._interval = interval;\n this._niceExtent = niceExtent;\n };\n\n LogScale.prototype.calcNiceExtent = function (opt) {\n intervalScaleProto.calcNiceExtent.call(this, opt);\n this._fixMin = opt.fixMin;\n this._fixMax = opt.fixMax;\n };\n\n LogScale.prototype.parse = function (val) {\n return val;\n };\n\n LogScale.prototype.contain = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.contain(val, this._extent);\n };\n\n LogScale.prototype.normalize = function (val) {\n val = mathLog(val) / mathLog(this.base);\n return scaleHelper.normalize(val, this._extent);\n };\n\n LogScale.prototype.scale = function (val) {\n val = scaleHelper.scale(val, this._extent);\n return mathPow(this.base, val);\n };\n\n LogScale.type = 'log';\n return LogScale;\n}(Scale);\n\nvar proto = LogScale.prototype;\nproto.getMinorTicks = intervalScaleProto.getMinorTicks;\nproto.getLabel = intervalScaleProto.getLabel;\n\nfunction fixRoundingError(val, originalVal) {\n return roundingErrorFix(val, numberUtil.getPrecision(originalVal));\n}\n\nScale.registerClass(LogScale);\nexport default LogScale;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\n\nvar ScaleRawExtentInfo =\n/** @class */\nfunction () {\n function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\n originalExtent) {\n this._prepareParams(scale, model, originalExtent);\n }\n /**\r\n * Parameters depending on outside (like model, user callback)\r\n * are prepared and fixed here.\r\n */\n\n\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis.\n dataExtent) {\n if (dataExtent[1] < dataExtent[0]) {\n dataExtent = [NaN, NaN];\n }\n\n this._dataMin = dataExtent[0];\n this._dataMax = dataExtent[1];\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\n\n if (isFunction(modelMinRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMinRaw !== 'dataMin') {\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n }\n\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n\n if (isFunction(modelMaxRaw)) {\n // This callback always provides users the full data extent (before data is filtered).\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMaxRaw !== 'dataMax') {\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n }\n\n if (isOrdinal) {\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n // and progressive rendering is using, here the category result might just only contain\n // the processed chunk rather than the entire result.\n this._axisDataLen = model.getCategories().length;\n } else {\n var boundaryGap = model.get('boundaryGap');\n var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n if (process.env.NODE_ENV !== 'production') {\n 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.');\n }\n\n this._boundaryGapInner = [0, 0];\n } else {\n this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n }\n }\n };\n /**\r\n * Calculate extent by prepared parameters.\r\n * This method has no external dependency and can be called duplicatedly,\r\n * getting the same result.\r\n * If parameters changed, should call this method to recalcuate.\r\n */\n\n\n ScaleRawExtentInfo.prototype.calculate = function () {\n // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n var isOrdinal = this._isOrdinal;\n var dataMin = this._dataMin;\n var dataMax = this._dataMax;\n var axisDataLen = this._axisDataLen;\n var boundaryGapInner = this._boundaryGapInner;\n var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n\n var minFixed = min != null;\n var maxFixed = max != null;\n\n if (min == null) {\n min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n }\n\n if (max == null) {\n max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero.\n\n if (this._needCrossZero) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !minFixed) {\n min = 0; // minFixed = true;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !maxFixed) {\n max = 0; // maxFixed = true;\n } // PENDING:\n // When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n // If so, here `minFixed`/`maxFixed` need to be set.\n\n }\n\n var determinedMin = this._determinedMin;\n var determinedMax = this._determinedMax;\n\n if (determinedMin != null) {\n min = determinedMin;\n minFixed = true;\n }\n\n if (determinedMax != null) {\n max = determinedMax;\n maxFixed = true;\n } // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n // `NaN` means min/max axis is blank.\n\n\n return {\n min: min,\n max: max,\n minFixed: minFixed,\n maxFixed: maxFixed,\n isBlank: isBlank\n };\n };\n\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen);\n }\n\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n };\n\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen // Earse them usually means logic flaw.\n && this[attr] == null);\n }\n\n this[attr] = val;\n };\n\n ScaleRawExtentInfo.prototype.freeze = function () {\n // @ts-ignore\n this.frozen = true;\n };\n\n return ScaleRawExtentInfo;\n}();\n\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n min: '_determinedMin',\n max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n min: '_dataMin',\n max: '_dataMax'\n};\n/**\r\n * Get scale min max and related info only depends on model settings.\r\n * This method can be called after coordinate system created.\r\n * For example, in data processing stage.\r\n *\r\n * Scale extent info probably be required multiple times during a workflow.\r\n * For example:\r\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\r\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\r\n * (3) `coordSys.update` use it to finally decide the scale extent.\r\n * But the callback of `min`/`max` should not be called multiple times.\r\n * The code below should not be implemented repeatedly either.\r\n * So we cache the result in the scale instance, which will be recreated at the beginning\r\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\r\n */\n\nexport function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../scale/Ordinal.js';\nimport IntervalScale from '../scale/Interval.js';\nimport Scale from '../scale/Scale.js';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport TimeScale from '../scale/Time.js';\nimport LogScale from '../scale/Log.js';\nimport { getStackedDimension } from '../data/helper/dataStackHelper.js';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo.js';\n/**\r\n * Get axis scale extent before niced.\r\n * Item of returned array can only be number (including Infinity and NaN).\r\n *\r\n * Caution:\r\n * Precondition of calling this method:\r\n * The scale extent has been initialized using series data extent via\r\n * `scale.setExtent` or `scale.unionExtentFromData`;\r\n */\n\nexport function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /* || scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, // Only support cartesian coord yet.\nbarWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow\n\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow\n\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n} // Precondition of calling this method:\n// The scale extent has been initialized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\n\n\nexport function niceScaleExtent(scale, inModel) {\n var model = inModel;\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale instanceof LogScale) {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n var interval = model.get('interval');\n var isIntervalOrTime = scaleType === 'interval' || scaleType === 'time';\n scale.setExtent(extent[0], extent[1]);\n scale.calcNiceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: isIntervalOrTime ? model.get('minInterval') : null,\n maxInterval: isIntervalOrTime ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\r\n * @param axisType Default retrieve from model.type\r\n */\n\nexport function createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // case 'value'/'interval', 'log', or others.\n return new (Scale.getClass(axisType) || IntervalScale)();\n }\n }\n}\n/**\r\n * Check if the axis cross 0\r\n */\n\nexport function ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\r\n * @param axis\r\n * @return Label formatter function.\r\n * param: {number} tickValue,\r\n * param: {number} idx, the index in all ticks.\r\n * If category axis, this param is not required.\r\n * return: {string} label string.\r\n */\n\nexport function makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (axis.scale.type === 'time') {\n return function (tpl) {\n return function (tick, idx) {\n return axis.scale.getFormattedLabel(tick, idx, tpl);\n };\n }(labelFormatter);\n } else if (zrUtil.isString(labelFormatter)) {\n return function (tpl) {\n return function (tick) {\n // For category axis, get raw value; for numeric axis,\n // get formatted label like '1,333,444'.\n var label = axis.scale.getLabel(tick);\n var text = tpl.replace('{value}', label != null ? label : '');\n return text;\n };\n }(labelFormatter);\n } else if (zrUtil.isFunction(labelFormatter)) {\n return function (cb) {\n return function (tick, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tick.value - categoryTickStart;\n }\n\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\n level: tick.level\n } : null);\n };\n }(labelFormatter);\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\nexport function getAxisRawValue(axis, tick) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\r\n * @param axis\r\n * @return Be null/undefined if no labels.\r\n */\n\nexport function estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n return;\n }\n\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (scale instanceof OrdinalScale) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1; // Simple optimization for large amount of labels\n\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n\n for (var i = 0; i < tickCount; i += step) {\n var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n value: categoryScaleExtent[0] + i\n };\n var label = labelFormatter(tick, i);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n\n return rect;\n}\n\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var beforeWidth = textRect.width;\n var beforeHeight = textRect.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\r\n * @param model axisLabelModel or axisTickModel\r\n * @return {number|String} Can be null|'auto'|number|function\r\n */\n\n\nexport function getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\r\n * Set `categoryInterval` as 0 implicitly indicates that\r\n * show all labels regardless of overlap.\r\n * @param {Object} axis axisModel.axis\r\n */\n\nexport function shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\n var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n // there has been stacked result dim?\n\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n // For example, the extent of the original dimension\n // is [0.1, 0.5], the extent of the `stackResultDimension`\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\n // because there is no graphic corresponding to [0.1, 0.5].\n // See the case in `test/area-stack.html` `main1`, where area line\n // stack needs `yAxis` not start from 0.\n dataDimMap[getStackedDimension(data, dataDim)] = true;\n });\n return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n if (data) {\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n var seriesExtent = data.getApproximateExtent(dim);\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nvar Cartesian =\n/** @class */\nfunction () {\n function Cartesian(name) {\n this.type = 'cartesian';\n this._dimList = [];\n this._axes = {};\n this.name = name || '';\n }\n\n Cartesian.prototype.getAxis = function (dim) {\n return this._axes[dim];\n };\n\n Cartesian.prototype.getAxes = function () {\n return zrUtil.map(this._dimList, function (dim) {\n return this._axes[dim];\n }, this);\n };\n\n Cartesian.prototype.getAxesByScale = function (scaleType) {\n scaleType = scaleType.toLowerCase();\n return zrUtil.filter(this.getAxes(), function (axis) {\n return axis.scale.type === scaleType;\n });\n };\n\n Cartesian.prototype.addAxis = function (axis) {\n var dim = axis.dim;\n this._axes[dim] = axis;\n\n this._dimList.push(dim);\n };\n\n return Cartesian;\n}();\n\n;\nexport default Cartesian;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Cartesian from './Cartesian.js';\nimport { invert } from 'zrender/lib/core/matrix.js';\nimport { applyTransform } from 'zrender/lib/core/vector.js';\nexport var cartesian2DDimensions = ['x', 'y'];\n\nfunction canCalculateAffineTransform(scale) {\n return scale.type === 'interval' || scale.type === 'time';\n}\n\nvar Cartesian2D =\n/** @class */\nfunction (_super) {\n __extends(Cartesian2D, _super);\n\n function Cartesian2D() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'cartesian2d';\n _this.dimensions = cartesian2DDimensions;\n return _this;\n }\n /**\r\n * Calculate an affine transform matrix if two axes are time or value.\r\n * It's mainly for accelartion on the large time series data.\r\n */\n\n\n Cartesian2D.prototype.calcAffineTransform = function () {\n this._transform = this._invTransform = null;\n var xAxisScale = this.getAxis('x').scale;\n var yAxisScale = this.getAxis('y').scale;\n\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n return;\n }\n\n var xScaleExtent = xAxisScale.getExtent();\n var yScaleExtent = yAxisScale.getExtent();\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n\n if (!xScaleSpan || !yScaleSpan) {\n return;\n } // Accelerate data to point calculation on the special large time series data.\n\n\n var scaleX = (end[0] - start[0]) / xScaleSpan;\n var scaleY = (end[1] - start[1]) / yScaleSpan;\n var translateX = start[0] - xScaleExtent[0] * scaleX;\n var translateY = start[1] - yScaleExtent[0] * scaleY;\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n this._invTransform = invert([], m);\n };\n /**\r\n * Base axis will be used on stacking.\r\n */\n\n\n Cartesian2D.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n };\n\n Cartesian2D.prototype.containPoint = function (point) {\n var axisX = this.getAxis('x');\n var axisY = this.getAxis('y');\n return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n };\n\n Cartesian2D.prototype.containData = function (data) {\n return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n };\n\n Cartesian2D.prototype.containZone = function (data1, data2) {\n var zoneDiag1 = this.dataToPoint(data1);\n var zoneDiag2 = this.dataToPoint(data2);\n var area = this.getArea();\n var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);\n return area.intersect(zone);\n };\n\n Cartesian2D.prototype.dataToPoint = function (data, clamp, out) {\n out = out || [];\n var xVal = data[0];\n var yVal = data[1]; // Fast path\n\n if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n return applyTransform(out, data, this._transform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\n return out;\n };\n\n Cartesian2D.prototype.clampData = function (data, out) {\n var xScale = this.getAxis('x').scale;\n var yScale = this.getAxis('y').scale;\n var xAxisExtent = xScale.getExtent();\n var yAxisExtent = yScale.getExtent();\n var x = xScale.parse(data[0]);\n var y = yScale.parse(data[1]);\n out = out || [];\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n return out;\n };\n\n Cartesian2D.prototype.pointToData = function (point, clamp) {\n var out = [];\n\n if (this._invTransform) {\n return applyTransform(out, point, this._invTransform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\n return out;\n };\n\n Cartesian2D.prototype.getOtherAxis = function (axis) {\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n };\n /**\r\n * Get rect area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\n\n\n Cartesian2D.prototype.getArea = function () {\n var xExtent = this.getAxis('x').getGlobalExtent();\n var yExtent = this.getAxis('y').getGlobalExtent();\n var x = Math.min(xExtent[0], xExtent[1]);\n var y = Math.min(yExtent[0], yExtent[1]);\n var width = Math.max(xExtent[0], xExtent[1]) - x;\n var height = Math.max(yExtent[0], yExtent[1]) - y;\n return new BoundingRect(x, y, width, height);\n };\n\n return Cartesian2D;\n}(Cartesian);\n\n;\nexport default Cartesian2D;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../util/model.js';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper.js';\nvar inner = makeInner();\nexport function createAxisLabels(axis) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\r\n * @param {module:echats/coord/Axis} axis\r\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\r\n * @return {Object} {\r\n * ticks: Array.\r\n * tickCategoryInterval: number\r\n * }\r\n */\n\nexport function createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: zrUtil.map(axis.scale.getTicks(), function (tick) {\n return tick.value;\n })\n };\n}\n\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\n\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n\n if (result) {\n return result;\n }\n\n var labels;\n var numericLabelInterval;\n\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n } // Cache to avoid calling interval function repeatedly.\n\n\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\n\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n\n if (result) {\n return result;\n }\n\n var ticks;\n var tickCategoryInterval; // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n } // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n } // Cache to avoid calling interval function repeatedly.\n\n\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\n\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tick, idx) {\n return {\n level: tick.level,\n formattedLabel: labelFormatter(tick, idx),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: tick.value\n };\n })\n };\n}\n\nfunction getListCache(axis, prop) {\n // Because key can be a function, and cache size always is small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\n\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\n\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\n\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\r\n * Calculate interval for category axis ticks and labels.\r\n * To get precise result, at least one of `getRotate` and `isHorizontal`\r\n * should be implemented in axis.\r\n */\n\n\nexport function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hidden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}\n\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\n\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n } // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n\n\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n } // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n\n\n var tickValue = startTick;\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n\n function addItem(tickValue) {\n var tickObj = {\n value: tickValue\n };\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickObj),\n rawLabel: ordinalScale.getLabel(tickObj),\n tickValue: tickValue\n });\n }\n\n return result;\n}\n\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\n var rawLabel = ordinalScale.getLabel(tick);\n var tickValue = tick.value;\n\n if (categoryInterval(tick.value, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tick),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, map } from 'zrender/lib/core/util.js';\nimport { linearMap, getPixelPrecision, round } from '../util/number.js';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval } from './axisTickLabelBuilder.js';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\r\n * Base class of Axis.\r\n */\n\nvar Axis =\n/** @class */\nfunction () {\n function Axis(dim, scale, extent) {\n this.onBand = false;\n this.inverse = false;\n this.dim = dim;\n this.scale = scale;\n this._extent = extent || [0, 0];\n }\n /**\r\n * If axis extent contain given coord\r\n */\n\n\n Axis.prototype.contain = function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n };\n /**\r\n * If axis extent contain given data\r\n */\n\n\n Axis.prototype.containData = function (data) {\n return this.scale.contain(data);\n };\n /**\r\n * Get coord extent.\r\n */\n\n\n Axis.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\r\n * Get precision used for formatting\r\n */\n\n\n Axis.prototype.getPixelPrecision = function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n };\n /**\r\n * Set coord extent\r\n */\n\n\n Axis.prototype.setExtent = function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n };\n /**\r\n * Convert data to coord. Data is the rank if it has an ordinal scale\r\n */\n\n\n Axis.prototype.dataToCoord = function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n };\n /**\r\n * Convert coord to data. Data is the rank if it has an ordinal scale\r\n */\n\n\n Axis.prototype.coordToData = function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n };\n /**\r\n * Convert pixel point to data in axis\r\n */\n\n\n Axis.prototype.pointToData = function (point, clamp) {\n // Should be implemented in derived class if necessary.\n return;\n };\n /**\r\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\r\n * `axis.getTicksCoords` considers `onBand`, which is used by\r\n * `boundaryGap:true` of category axis and splitLine and splitArea.\r\n * @param opt.tickModel default: axis.model.getModel('axisTick')\r\n * @param opt.clamp If `true`, the first and the last\r\n * tick must be at the axis end points. Otherwise, clip ticks\r\n * that outside the axis extent.\r\n */\n\n\n Axis.prototype.getTicksCoords = function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickVal) {\n return {\n coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n tickValue: tickVal\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n };\n\n Axis.prototype.getMinorTicksCoords = function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber'); // Protection.\n\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n };\n\n Axis.prototype.getViewLabels = function () {\n return createAxisLabels(this).labels;\n };\n\n Axis.prototype.getLabelModel = function () {\n return this.model.getModel('axisLabel');\n };\n /**\r\n * Notice here we only get the default tick model. For splitLine\r\n * or splitArea, we should pass the splitLineModel or splitAreaModel\r\n * manually when calling `getTicksCoords`.\r\n * In GL, this method may be overridden to:\r\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\r\n */\n\n\n Axis.prototype.getTickModel = function () {\n return this.model.getModel('axisTick');\n };\n /**\r\n * Get width of band\r\n */\n\n\n Axis.prototype.getBandWidth = function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data.\n\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n };\n /**\r\n * Only be called in category axis.\r\n * Can be overridden, consider other axes like in 3D.\r\n * @return Auto interval for cateogry axis tick and label\r\n */\n\n\n Axis.prototype.calculateCategoryInterval = function () {\n return calculateCategoryInterval(this);\n };\n\n return Axis;\n}();\n\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n} // If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\n\n\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[1]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unnecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\n\nexport default Axis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar Axis2D =\n/** @class */\nfunction (_super) {\n __extends(Axis2D, _super);\n\n function Axis2D(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n /**\r\n * Index of axis, can be used as key\r\n * Injected outside.\r\n */\n\n\n _this.index = 0;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n\n Axis2D.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n /**\r\n * Each item cooresponds to this.getExtent(), which\r\n * means globalExtent[0] may greater than globalExtent[1],\r\n * unless `asc` is input.\r\n *\r\n * @param {boolean} [asc]\r\n * @return {Array.}\r\n */\n\n\n Axis2D.prototype.getGlobalExtent = function (asc) {\n var ret = this.getExtent();\n ret[0] = this.toGlobalCoord(ret[0]);\n ret[1] = this.toGlobalCoord(ret[1]);\n asc && ret[0] > ret[1] && ret.reverse();\n return ret;\n };\n\n Axis2D.prototype.pointToData = function (point, clamp) {\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n };\n /**\r\n * Set ordinalSortInfo\r\n * @param info new OrdinalSortInfo\r\n */\n\n\n Axis2D.prototype.setCategorySortInfo = function (info) {\n if (this.type !== 'category') {\n return false;\n }\n\n this.model.option.categorySortInfo = info;\n this.scale.setSortInfo(info);\n };\n\n return Axis2D;\n}(Axis);\n\nexport default Axis2D;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Can only be called after coordinate system creation stage.\r\n * (Can be called before coordinate system update stage).\r\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getPrecisionSafe, round } from '../util/number.js';\nimport IntervalScale from '../scale/Interval.js';\nimport { getScaleExtent } from './axisHelper.js';\nimport { warn } from '../util/log.js';\nimport { increaseInterval, isValueNice } from '../scale/helper.js';\nvar mathLog = Math.log;\nexport function alignScaleTicks(scale, axisModel, alignToScale) {\n var intervalScaleProto = IntervalScale.prototype; // NOTE: There is a precondition for log scale here:\n // In log scale we store _interval and _extent of exponent value.\n // So if we use the method of InternalScale to set/get these data.\n // It process the exponent value, which is linear and what we want here.\n\n var alignToTicks = intervalScaleProto.getTicks.call(alignToScale);\n var alignToNicedTicks = intervalScaleProto.getTicks.call(alignToScale, true);\n var alignToSplitNumber = alignToTicks.length - 1;\n var alignToInterval = intervalScaleProto.getInterval.call(alignToScale);\n var scaleExtent = getScaleExtent(scale, axisModel);\n var rawExtent = scaleExtent.extent;\n var isMinFixed = scaleExtent.fixMin;\n var isMaxFixed = scaleExtent.fixMax;\n\n if (scale.type === 'log') {\n var logBase = mathLog(scale.base);\n rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];\n }\n\n scale.setExtent(rawExtent[0], rawExtent[1]);\n scale.calcNiceExtent({\n splitNumber: alignToSplitNumber,\n fixMin: isMinFixed,\n fixMax: isMaxFixed\n });\n var extent = intervalScaleProto.getExtent.call(scale); // Need to update the rawExtent.\n // Because value in rawExtent may be not parsed. e.g. 'dataMin', 'dataMax'\n\n if (isMinFixed) {\n rawExtent[0] = extent[0];\n }\n\n if (isMaxFixed) {\n rawExtent[1] = extent[1];\n }\n\n var interval = intervalScaleProto.getInterval.call(scale);\n var min = rawExtent[0];\n var max = rawExtent[1];\n\n if (isMinFixed && isMaxFixed) {\n // User set min, max, divide to get new interval\n interval = (max - min) / alignToSplitNumber;\n } else if (isMinFixed) {\n max = rawExtent[0] + interval * alignToSplitNumber; // User set min, expand extent on the other side\n\n while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1])) {\n interval = increaseInterval(interval);\n max = rawExtent[0] + interval * alignToSplitNumber;\n }\n } else if (isMaxFixed) {\n // User set max, expand extent on the other side\n min = rawExtent[1] - interval * alignToSplitNumber;\n\n while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0])) {\n interval = increaseInterval(interval);\n min = rawExtent[1] - interval * alignToSplitNumber;\n }\n } else {\n var nicedSplitNumber = scale.getTicks().length - 1;\n\n if (nicedSplitNumber > alignToSplitNumber) {\n interval = increaseInterval(interval);\n }\n\n var range = interval * alignToSplitNumber;\n max = Math.ceil(rawExtent[1] / interval) * interval;\n min = round(max - range); // Not change the result that crossing zero.\n\n if (min < 0 && rawExtent[0] >= 0) {\n min = 0;\n max = round(range);\n } else if (max > 0 && rawExtent[1] <= 0) {\n max = 0;\n min = -round(range);\n }\n } // Adjust min, max based on the extent of alignTo. When min or max is set in alignTo scale\n\n\n var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;\n var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval; // NOTE: Must in setExtent -> setInterval -> setNiceExtent order.\n\n intervalScaleProto.setExtent.call(scale, min + interval * t0, max + interval * t1);\n intervalScaleProto.setInterval.call(scale, interval);\n\n if (t0 || t1) {\n intervalScaleProto.setNiceExtent.call(scale, min + interval, max - interval);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var ticks = intervalScaleProto.getTicks.call(scale);\n\n if (ticks[1] && (!isValueNice(interval) || getPrecisionSafe(ticks[1].value) > getPrecisionSafe(interval))) {\n warn( // eslint-disable-next-line\n \"The ticks may be not readable when set min: \" + axisModel.get('min') + \", max: \" + axisModel.get('max') + \" and alignTicks: true\");\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Grid is a region which contains at most 4 cartesian systems\r\n *\r\n * TODO Default cartesian\r\n */\nimport { isObject, each, indexOf, retrieve3, keys } from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, estimateLabelUnionRect, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D.js';\nimport Axis2D from './Axis2D.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\n\nvar Grid =\n/** @class */\nfunction () {\n function Grid(gridModel, ecModel, api) {\n // FIXME:TS where used (different from registered type 'cartesian2d')?\n this.type = 'grid';\n this._coordsMap = {};\n this._coordsList = [];\n this._axesMap = {};\n this._axesList = [];\n this.axisPointerEnabled = true;\n this.dimensions = cartesian2DDimensions;\n\n this._initCartesian(gridModel, ecModel, api);\n\n this.model = gridModel;\n }\n\n Grid.prototype.getRect = function () {\n return this._rect;\n };\n\n Grid.prototype.update = function (ecModel, api) {\n var axesMap = this._axesMap;\n\n this._updateScale(ecModel, this.model);\n\n function updateAxisTicks(axes) {\n var alignTo; // Axis is added in order of axisIndex.\n\n var axesIndices = keys(axes);\n var len = axesIndices.length;\n\n if (!len) {\n return;\n }\n\n var axisNeedsAlign = []; // Process once and calculate the ticks for those don't use alignTicks.\n\n for (var i = len - 1; i >= 0; i--) {\n var idx = +axesIndices[i]; // Convert to number.\n\n var axis = axes[idx];\n var model = axis.model;\n var scale = axis.scale;\n\n if ( // Only value and log axis without interval support alignTicks.\n isIntervalOrLogScale(scale) && model.get('alignTicks') && model.get('interval') == null) {\n axisNeedsAlign.push(axis);\n } else {\n niceScaleExtent(scale, model);\n\n if (isIntervalOrLogScale(scale)) {\n // Can only align to interval or log axis.\n alignTo = axis;\n }\n }\n }\n\n ; // All axes has set alignTicks. Pick the first one.\n // PENDING. Should we find the axis that both set interval, min, max and align to this one?\n\n if (axisNeedsAlign.length) {\n if (!alignTo) {\n alignTo = axisNeedsAlign.pop();\n niceScaleExtent(alignTo.scale, alignTo.model);\n }\n\n each(axisNeedsAlign, function (axis) {\n alignScaleTicks(axis.scale, axis.model, alignTo.scale);\n });\n }\n }\n\n updateAxisTicks(axesMap.x);\n updateAxisTicks(axesMap.y); // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n\n var onZeroRecords = {};\n each(axesMap.x, function (xAxis) {\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n });\n each(axesMap.y, function (yAxis) {\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n }); // Resize again if containLabel is enabled\n // FIXME It may cause getting wrong grid size in data processing stage\n\n this.resize(this.model, api);\n };\n /**\r\n * Resize the grid\r\n */\n\n\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\n var boxLayoutParams = gridModel.getBoxLayoutParams();\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\n var gridRect = getLayoutRect(boxLayoutParams, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._rect = gridRect;\n var axesList = this._axesList;\n adjustAxes(); // Minus label size\n\n if (isContainLabel) {\n each(axesList, function (axis) {\n if (!axis.model.get(['axisLabel', 'inside'])) {\n var labelUnionRect = estimateLabelUnionRect(axis);\n\n if (labelUnionRect) {\n var dim = axis.isHorizontal() ? 'height' : 'width';\n var margin = axis.model.get(['axisLabel', 'margin']);\n gridRect[dim] -= labelUnionRect[dim] + margin;\n\n if (axis.position === 'top') {\n gridRect.y += labelUnionRect.height + margin;\n } else if (axis.position === 'left') {\n gridRect.x += labelUnionRect.width + margin;\n }\n }\n }\n });\n adjustAxes();\n }\n\n each(this._coordsList, function (coord) {\n // Calculate affine matrix to accelerate the data to point transform.\n // If all the axes scales are time or value.\n coord.calcAffineTransform();\n });\n\n function adjustAxes() {\n each(axesList, function (axis) {\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\n });\n }\n };\n\n Grid.prototype.getAxis = function (dim, axisIndex) {\n var axesMapOnDim = this._axesMap[dim];\n\n if (axesMapOnDim != null) {\n return axesMapOnDim[axisIndex || 0];\n }\n };\n\n Grid.prototype.getAxes = function () {\n return this._axesList.slice();\n };\n\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n if (xAxisIndex != null && yAxisIndex != null) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n return this._coordsMap[key];\n }\n\n if (isObject(xAxisIndex)) {\n yAxisIndex = xAxisIndex.yAxisIndex;\n xAxisIndex = xAxisIndex.xAxisIndex;\n }\n\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n return coordList[i];\n }\n }\n };\n\n Grid.prototype.getCartesians = function () {\n return this._coordsList.slice();\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n };\n\n Grid.prototype._findConvertTarget = function (finder) {\n var seriesModel = finder.seriesModel;\n var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n var gridModel = finder.gridModel;\n var coordsList = this._coordsList;\n var cartesian;\n var axis;\n\n if (seriesModel) {\n cartesian = seriesModel.coordinateSystem;\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n } else if (xAxisModel && yAxisModel) {\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n } else if (xAxisModel) {\n axis = this.getAxis('x', xAxisModel.componentIndex);\n } else if (yAxisModel) {\n axis = this.getAxis('y', yAxisModel.componentIndex);\n } // Lowest priority.\n else if (gridModel) {\n var grid = gridModel.coordinateSystem;\n\n if (grid === this) {\n cartesian = this._coordsList[0];\n }\n }\n\n return {\n cartesian: cartesian,\n axis: axis\n };\n };\n /**\r\n * @implements\r\n */\n\n\n Grid.prototype.containPoint = function (point) {\n var coord = this._coordsList[0];\n\n if (coord) {\n return coord.containPoint(point);\n }\n };\n /**\r\n * Initialize cartesian coordinate systems\r\n */\n\n\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n var _this = this;\n\n var grid = this;\n var axisPositionUsed = {\n left: false,\n right: false,\n top: false,\n bottom: false\n };\n var axesMap = {\n x: {},\n y: {}\n };\n var axesCount = {\n x: 0,\n y: 0\n }; // Create axis\n\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n\n if (!axesCount.x || !axesCount.y) {\n // Roll back when there no either x or y axis\n this._axesMap = {};\n this._axesList = [];\n return;\n }\n\n this._axesMap = axesMap; // Create cartesian2d\n\n each(axesMap.x, function (xAxis, xAxisIndex) {\n each(axesMap.y, function (yAxis, yAxisIndex) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n var cartesian = new Cartesian2D(key);\n cartesian.master = _this;\n cartesian.model = gridModel;\n _this._coordsMap[key] = cartesian;\n\n _this._coordsList.push(cartesian);\n\n cartesian.addAxis(xAxis);\n cartesian.addAxis(yAxis);\n });\n });\n\n function createAxisCreator(dimName) {\n return function (axisModel, idx) {\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n return;\n }\n\n var axisPosition = axisModel.get('position');\n\n if (dimName === 'x') {\n // Fix position\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n // Default bottom of X\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n }\n } else {\n // Fix position\n if (axisPosition !== 'left' && axisPosition !== 'right') {\n // Default left of Y\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\n }\n }\n\n axisPositionUsed[axisPosition] = true;\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel\n\n axisModel.axis = axis; // Inject axisModel into axis\n\n axis.model = axisModel; // Inject grid info axis\n\n axis.grid = grid; // Index of axis, can be used as key\n\n axis.index = idx;\n\n grid._axesList.push(axis);\n\n axesMap[dimName][idx] = axis;\n axesCount[dimName]++;\n };\n }\n };\n /**\r\n * Update cartesian properties from series.\r\n */\n\n\n Grid.prototype._updateScale = function (ecModel, gridModel) {\n // Reset scale\n each(this._axesList, function (axis) {\n axis.scale.setExtent(Infinity, -Infinity);\n\n if (axis.type === 'category') {\n var categorySortInfo = axis.model.get('categorySortInfo');\n axis.scale.setSortInfo(categorySortInfo);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n if (isCartesian2DSeries(seriesModel)) {\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n return;\n }\n\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n var data = seriesModel.getData();\n var xAxis = cartesian.getAxis('x');\n var yAxis = cartesian.getAxis('y');\n unionExtent(data, xAxis);\n unionExtent(data, yAxis);\n }\n }, this);\n\n function unionExtent(data, axis) {\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n axis.scale.unionExtentFromData(data, dim);\n });\n }\n };\n /**\r\n * @param dim 'x' or 'y' or 'auto' or null/undefined\r\n */\n\n\n Grid.prototype.getTooltipAxes = function (dim) {\n var baseAxes = [];\n var otherAxes = [];\n each(this.getCartesians(), function (cartesian) {\n var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n var otherAxis = cartesian.getOtherAxis(baseAxis);\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n });\n return {\n baseAxes: baseAxes,\n otherAxes: otherAxes\n };\n };\n\n Grid.create = function (ecModel, api) {\n var grids = [];\n ecModel.eachComponent('grid', function (gridModel, idx) {\n var grid = new Grid(gridModel, ecModel, api);\n grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize\n // should be performed in create stage.\n\n grid.resize(gridModel, api, true);\n gridModel.coordinateSystem = grid;\n grids.push(grid);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (!isCartesian2DSeries(seriesModel)) {\n return;\n }\n\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n var gridModel = xAxisModel.getCoordSysModel();\n\n if (process.env.NODE_ENV !== 'production') {\n if (!gridModel) {\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n }\n\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n throw new Error('xAxis and yAxis must use the same grid');\n }\n }\n\n var grid = gridModel.coordinateSystem;\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n });\n return grids;\n }; // For deciding which dimensions to use when creating list data\n\n\n Grid.dimensions = cartesian2DDimensions;\n return Grid;\n}();\n/**\r\n * Check if the axis is used in the specified grid.\r\n */\n\n\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}\n\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n axis.getAxesOnZeroOf = function () {\n // TODO: onZero of multiple axes.\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n }; // onZero can not be enabled in these two situations:\n // 1. When any other axis is a category axis.\n // 2. When no axis is cross 0 point.\n\n\n var otherAxes = axesMap[otherAxisDim];\n var otherAxisOnZeroOf;\n var axisModel = axis.model;\n var onZero = axisModel.get(['axisLine', 'onZero']);\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n\n if (!onZero) {\n return;\n } // If target axis is specified.\n\n\n if (onZeroAxisIndex != null) {\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n }\n } else {\n // Find the first available other axis.\n for (var idx in otherAxes) {\n if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis,\n // if both onZero, the two Y axes overlap.\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n otherAxisOnZeroOf = otherAxes[idx];\n break;\n }\n }\n }\n\n if (otherAxisOnZeroOf) {\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n }\n\n function getOnZeroRecordKey(axis) {\n return axis.dim + '_' + axis.index;\n }\n}\n\nfunction canOnZeroToAxis(axis) {\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\n\nfunction updateAxisTransform(axis, coordBase) {\n var axisExtent = axis.getExtent();\n var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform\n\n axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n}\n\nexport default Grid;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { retrieve, defaults, extend, each, isObject, map, isString, isNumber, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport { isRadianAroundZero, remRadian } from '../../util/number.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport * as matrixUtil from 'zrender/lib/core/matrix.js';\nimport { applyTransform as v2ApplyTransform } from 'zrender/lib/core/vector.js';\nimport { shouldShowAllLabels } from '../../coord/axisHelper.js';\nimport { prepareLayoutList, hideOverlap } from '../../label/labelLayoutHelper.js';\nvar PI = Math.PI;\n/**\r\n * A final axis is translated and rotated from a \"standard axis\".\r\n * So opt.position and opt.rotation is required.\r\n *\r\n * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],\r\n * for example: (0, 0) ------------> (0, 50)\r\n *\r\n * nameDirection or tickDirection or labelDirection is 1 means tick\r\n * or label is below the standard axis, whereas is -1 means above\r\n * the standard axis. labelOffset means offset between label and axis,\r\n * which is useful when 'onZero', where axisLabel is in the grid and\r\n * label in outside grid.\r\n *\r\n * Tips: like always,\r\n * positive rotation represents anticlockwise, and negative rotation\r\n * represents clockwise.\r\n * The direction of position coordinate is the same as the direction\r\n * of screen coordinate.\r\n *\r\n * Do not need to consider axis 'inverse', which is auto processed by\r\n * axis extent.\r\n */\n\nvar AxisBuilder =\n/** @class */\nfunction () {\n function AxisBuilder(axisModel, opt) {\n this.group = new graphic.Group();\n this.opt = opt;\n this.axisModel = axisModel; // Default value\n\n defaults(opt, {\n labelOffset: 0,\n nameDirection: 1,\n tickDirection: 1,\n labelDirection: 1,\n silent: true,\n handleAutoShown: function () {\n return true;\n }\n }); // FIXME Not use a separate text group?\n\n var transformGroup = new graphic.Group({\n x: opt.position[0],\n y: opt.position[1],\n rotation: opt.rotation\n }); // this.group.add(transformGroup);\n // this._transformGroup = transformGroup;\n\n transformGroup.updateTransform();\n this._transformGroup = transformGroup;\n }\n\n AxisBuilder.prototype.hasBuilder = function (name) {\n return !!builders[name];\n };\n\n AxisBuilder.prototype.add = function (name) {\n builders[name](this.opt, this.axisModel, this.group, this._transformGroup);\n };\n\n AxisBuilder.prototype.getGroup = function () {\n return this.group;\n };\n\n AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) {\n var rotationDiff = remRadian(textRotation - axisRotation);\n var textAlign;\n var textVerticalAlign;\n\n if (isRadianAroundZero(rotationDiff)) {\n // Label is parallel with axis line.\n textVerticalAlign = direction > 0 ? 'top' : 'bottom';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI)) {\n // Label is inverse parallel with axis line.\n textVerticalAlign = direction > 0 ? 'bottom' : 'top';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff > 0 && rotationDiff < PI) {\n textAlign = direction > 0 ? 'right' : 'left';\n } else {\n textAlign = direction > 0 ? 'left' : 'right';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n };\n\n AxisBuilder.makeAxisEventDataBase = function (axisModel) {\n var eventData = {\n componentType: axisModel.mainType,\n componentIndex: axisModel.componentIndex\n };\n eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex;\n return eventData;\n };\n\n AxisBuilder.isLabelSilent = function (axisModel) {\n var tooltipOpt = axisModel.get('tooltip');\n return axisModel.get('silent') // Consider mouse cursor, add these restrictions.\n || !(axisModel.get('triggerEvent') || tooltipOpt && tooltipOpt.show);\n };\n\n return AxisBuilder;\n}();\n\n;\nvar builders = {\n axisLine: function (opt, axisModel, group, transformGroup) {\n var shown = axisModel.get(['axisLine', 'show']);\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisLine');\n }\n\n if (!shown) {\n return;\n }\n\n var extent = axisModel.axis.getExtent();\n var matrix = transformGroup.transform;\n var pt1 = [extent[0], 0];\n var pt2 = [extent[1], 0];\n var inverse = pt1[0] > pt2[0];\n\n if (matrix) {\n v2ApplyTransform(pt1, pt1, matrix);\n v2ApplyTransform(pt2, pt2, matrix);\n }\n\n var lineStyle = extend({\n lineCap: 'round'\n }, axisModel.getModel(['axisLine', 'lineStyle']).getLineStyle());\n var line = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: lineStyle,\n strokeContainThreshold: opt.strokeContainThreshold || 5,\n silent: true,\n z2: 1\n });\n graphic.subPixelOptimizeLine(line.shape, line.style.lineWidth);\n line.anid = 'line';\n group.add(line);\n var arrows = axisModel.get(['axisLine', 'symbol']);\n\n if (arrows != null) {\n var arrowSize = axisModel.get(['axisLine', 'symbolSize']);\n\n if (isString(arrows)) {\n // Use the same arrow for start and end point\n arrows = [arrows, arrows];\n }\n\n if (isString(arrowSize) || isNumber(arrowSize)) {\n // Use the same size for width and height\n arrowSize = [arrowSize, arrowSize];\n }\n\n var arrowOffset = normalizeSymbolOffset(axisModel.get(['axisLine', 'symbolOffset']) || 0, arrowSize);\n var symbolWidth_1 = arrowSize[0];\n var symbolHeight_1 = arrowSize[1];\n each([{\n rotate: opt.rotation + Math.PI / 2,\n offset: arrowOffset[0],\n r: 0\n }, {\n rotate: opt.rotation - Math.PI / 2,\n offset: arrowOffset[1],\n r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1]))\n }], function (point, index) {\n if (arrows[index] !== 'none' && arrows[index] != null) {\n var symbol = createSymbol(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true); // Calculate arrow position with offset\n\n var r = point.r + point.offset;\n var pt = inverse ? pt2 : pt1;\n symbol.attr({\n rotation: point.rotate,\n x: pt[0] + r * Math.cos(opt.rotation),\n y: pt[1] - r * Math.sin(opt.rotation),\n silent: true,\n z2: 11\n });\n group.add(symbol);\n }\n });\n }\n },\n axisTickLabel: function (opt, axisModel, group, transformGroup) {\n var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);\n var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);\n fixMinMaxLabelShow(axisModel, labelEls, ticksEls);\n buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection); // This bit fixes the label overlap issue for the time chart.\n // See https://github.com/apache/echarts/issues/14266 for more.\n\n if (axisModel.get(['axisLabel', 'hideOverlap'])) {\n var labelList = prepareLayoutList(map(labelEls, function (label) {\n return {\n label: label,\n priority: label.z2,\n defaultAttr: {\n ignore: label.ignore\n }\n };\n }));\n hideOverlap(labelList);\n }\n },\n axisName: function (opt, axisModel, group, transformGroup) {\n var name = retrieve(opt.axisName, axisModel.get('name'));\n\n if (!name) {\n return;\n }\n\n var nameLocation = axisModel.get('nameLocation');\n var nameDirection = opt.nameDirection;\n var textStyleModel = axisModel.getModel('nameTextStyle');\n var gap = axisModel.get('nameGap') || 0;\n var extent = axisModel.axis.getExtent();\n var gapSignal = extent[0] > extent[1] ? -1 : 1;\n var pos = [nameLocation === 'start' ? extent[0] - gapSignal * gap : nameLocation === 'end' ? extent[1] + gapSignal * gap : (extent[0] + extent[1]) / 2, // Reuse labelOffset.\n isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0];\n var labelLayout;\n var nameRotation = axisModel.get('nameRotate');\n\n if (nameRotation != null) {\n nameRotation = nameRotation * PI / 180; // To radian.\n }\n\n var axisNameAvailableWidth;\n\n if (isNameLocationCenter(nameLocation)) {\n labelLayout = AxisBuilder.innerTextLayout(opt.rotation, nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis.\n nameDirection);\n } else {\n labelLayout = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent);\n axisNameAvailableWidth = opt.axisNameAvailableWidth;\n\n if (axisNameAvailableWidth != null) {\n axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout.rotation));\n !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);\n }\n }\n\n var textFont = textStyleModel.getFont();\n var truncateOpt = axisModel.get('nameTruncate', true) || {};\n var ellipsis = truncateOpt.ellipsis;\n var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);\n var textEl = new graphic.Text({\n x: pos[0],\n y: pos[1],\n rotation: labelLayout.rotation,\n silent: AxisBuilder.isLabelSilent(axisModel),\n style: createTextStyle(textStyleModel, {\n text: name,\n font: textFont,\n overflow: 'truncate',\n width: maxWidth,\n ellipsis: ellipsis,\n fill: textStyleModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']),\n align: textStyleModel.get('align') || labelLayout.textAlign,\n verticalAlign: textStyleModel.get('verticalAlign') || labelLayout.textVerticalAlign\n }),\n z2: 1\n });\n graphic.setTooltipConfig({\n el: textEl,\n componentModel: axisModel,\n itemName: name\n });\n textEl.__fullText = name; // Id for animation\n\n textEl.anid = 'name';\n\n if (axisModel.get('triggerEvent')) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisName';\n eventData.name = name;\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n group.add(textEl);\n textEl.decomposeTransform();\n }\n};\n\nfunction endTextLayout(rotation, textPosition, textRotate, extent) {\n var rotationDiff = remRadian(textRotate - rotation);\n var textAlign;\n var textVerticalAlign;\n var inverse = extent[0] > extent[1];\n var onLeft = textPosition === 'start' && !inverse || textPosition !== 'start' && inverse;\n\n if (isRadianAroundZero(rotationDiff - PI / 2)) {\n textVerticalAlign = onLeft ? 'bottom' : 'top';\n textAlign = 'center';\n } else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {\n textVerticalAlign = onLeft ? 'top' : 'bottom';\n textAlign = 'center';\n } else {\n textVerticalAlign = 'middle';\n\n if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {\n textAlign = onLeft ? 'left' : 'right';\n } else {\n textAlign = onLeft ? 'right' : 'left';\n }\n }\n\n return {\n rotation: rotationDiff,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\n\nfunction fixMinMaxLabelShow(axisModel, labelEls, tickEls) {\n if (shouldShowAllLabels(axisModel.axis)) {\n return;\n } // If min or max are user set, we need to check\n // If the tick on min(max) are overlap on their neighbour tick\n // If they are overlapped, we need to hide the min(max) tick label\n\n\n var showMinLabel = axisModel.get(['axisLabel', 'showMinLabel']);\n var showMaxLabel = axisModel.get(['axisLabel', 'showMaxLabel']); // FIXME\n // Have not consider onBand yet, where tick els is more than label els.\n\n labelEls = labelEls || [];\n tickEls = tickEls || [];\n var firstLabel = labelEls[0];\n var nextLabel = labelEls[1];\n var lastLabel = labelEls[labelEls.length - 1];\n var prevLabel = labelEls[labelEls.length - 2];\n var firstTick = tickEls[0];\n var nextTick = tickEls[1];\n var lastTick = tickEls[tickEls.length - 1];\n var prevTick = tickEls[tickEls.length - 2];\n\n if (showMinLabel === false) {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {\n if (showMinLabel) {\n ignoreEl(nextLabel);\n ignoreEl(nextTick);\n } else {\n ignoreEl(firstLabel);\n ignoreEl(firstTick);\n }\n }\n\n if (showMaxLabel === false) {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {\n if (showMaxLabel) {\n ignoreEl(prevLabel);\n ignoreEl(prevTick);\n } else {\n ignoreEl(lastLabel);\n ignoreEl(lastTick);\n }\n }\n}\n\nfunction ignoreEl(el) {\n el && (el.ignore = true);\n}\n\nfunction isTwoLabelOverlapped(current, next) {\n // current and next has the same rotation.\n var firstRect = current && current.getBoundingRect().clone();\n var nextRect = next && next.getBoundingRect().clone();\n\n if (!firstRect || !nextRect) {\n return;\n } // When checking intersect of two rotated labels, we use mRotationBack\n // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`.\n\n\n var mRotationBack = matrixUtil.identity([]);\n matrixUtil.rotate(mRotationBack, mRotationBack, -current.rotation);\n firstRect.applyTransform(matrixUtil.mul([], mRotationBack, current.getLocalTransform()));\n nextRect.applyTransform(matrixUtil.mul([], mRotationBack, next.getLocalTransform()));\n return firstRect.intersect(nextRect);\n}\n\nfunction isNameLocationCenter(nameLocation) {\n return nameLocation === 'middle' || nameLocation === 'center';\n}\n\nfunction createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {\n var tickEls = [];\n var pt1 = [];\n var pt2 = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = ticksCoords[i].coord;\n pt1[0] = tickCoord;\n pt1[1] = 0;\n pt2[0] = tickCoord;\n pt2[1] = tickEndCoord;\n\n if (tickTransform) {\n v2ApplyTransform(pt1, pt1, tickTransform);\n v2ApplyTransform(pt2, pt2, tickTransform);\n } // Tick line, Not use group transform to have better line draw\n\n\n var tickEl = new graphic.Line({\n shape: {\n x1: pt1[0],\n y1: pt1[1],\n x2: pt2[0],\n y2: pt2[1]\n },\n style: tickLineStyle,\n z2: 2,\n autoBatch: true,\n silent: true\n });\n graphic.subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);\n tickEl.anid = anidPrefix + '_' + ticksCoords[i].tickValue;\n tickEls.push(tickEl);\n }\n\n return tickEls;\n}\n\nfunction buildAxisMajorTicks(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var tickModel = axisModel.getModel('axisTick');\n var shown = tickModel.get('show');\n\n if (shown === 'auto' && opt.handleAutoShown) {\n shown = opt.handleAutoShown('axisTick');\n }\n\n if (!shown || axis.scale.isBlank()) {\n return;\n }\n\n var lineStyleModel = tickModel.getModel('lineStyle');\n var tickEndCoord = opt.tickDirection * tickModel.get('length');\n var ticksCoords = axis.getTicksCoords();\n var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults(lineStyleModel.getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }), 'ticks');\n\n for (var i = 0; i < ticksEls.length; i++) {\n group.add(ticksEls[i]);\n }\n\n return ticksEls;\n}\n\nfunction buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {\n var axis = axisModel.axis;\n var minorTickModel = axisModel.getModel('minorTick');\n\n if (!minorTickModel.get('show') || axis.scale.isBlank()) {\n return;\n }\n\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var lineStyleModel = minorTickModel.getModel('lineStyle');\n var tickEndCoord = tickDirection * minorTickModel.get('length');\n var minorTickLineStyle = defaults(lineStyleModel.getLineStyle(), defaults(axisModel.getModel('axisTick').getLineStyle(), {\n stroke: axisModel.get(['axisLine', 'lineStyle', 'color'])\n }));\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n var minorTicksEls = createTicks(minorTicksCoords[i], transformGroup.transform, tickEndCoord, minorTickLineStyle, 'minorticks_' + i);\n\n for (var k = 0; k < minorTicksEls.length; k++) {\n group.add(minorTicksEls[k]);\n }\n }\n}\n\nfunction buildAxisLabel(group, transformGroup, axisModel, opt) {\n var axis = axisModel.axis;\n var show = retrieve(opt.axisLabelShow, axisModel.get(['axisLabel', 'show']));\n\n if (!show || axis.scale.isBlank()) {\n return;\n }\n\n var labelModel = axisModel.getModel('axisLabel');\n var labelMargin = labelModel.get('margin');\n var labels = axis.getViewLabels(); // Special label rotate.\n\n var labelRotation = (retrieve(opt.labelRotate, labelModel.get('rotate')) || 0) * PI / 180;\n var labelLayout = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);\n var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);\n var labelEls = [];\n var silent = AxisBuilder.isLabelSilent(axisModel);\n var triggerEvent = axisModel.get('triggerEvent');\n each(labels, function (labelItem, index) {\n var tickValue = axis.scale.type === 'ordinal' ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n var formattedLabel = labelItem.formattedLabel;\n var rawLabel = labelItem.rawLabel;\n var itemLabelModel = labelModel;\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);\n }\n }\n\n var textColor = itemLabelModel.getTextColor() || axisModel.get(['axisLine', 'lineStyle', 'color']);\n var tickCoord = axis.dataToCoord(tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: opt.labelOffset + opt.labelDirection * labelMargin,\n rotation: labelLayout.rotation,\n silent: silent,\n z2: 10 + (labelItem.level || 0),\n style: createTextStyle(itemLabelModel, {\n text: formattedLabel,\n align: itemLabelModel.getShallow('align', true) || labelLayout.textAlign,\n verticalAlign: itemLabelModel.getShallow('verticalAlign', true) || itemLabelModel.getShallow('baseline', true) || labelLayout.textVerticalAlign,\n fill: isFunction(textColor) ? textColor( // (1) In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n // (2) Compatible with previous version, which always use formatted label as\n // input. But in interval scale the formatted label is like '223,445', which\n // maked user replace ','. So we modify it to return original val but remain\n // it as 'string' to avoid error in replacing.\n axis.type === 'category' ? rawLabel : axis.type === 'value' ? tickValue + '' : tickValue, index) : textColor\n })\n });\n textEl.anid = 'label_' + tickValue; // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = rawLabel;\n eventData.tickIndex = index;\n\n if (axis.type === 'category') {\n eventData.dataIndex = tickValue;\n }\n\n getECData(textEl).eventData = eventData;\n } // FIXME\n\n\n transformGroup.add(textEl);\n textEl.updateTransform();\n labelEls.push(textEl);\n group.add(textEl);\n textEl.decomposeTransform();\n });\n return labelEls;\n}\n\nexport default AxisBuilder;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport Model from '../../model/Model.js';\nimport { each, curry, clone, defaults, isArray, indexOf } from 'zrender/lib/core/util.js'; // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n// allAxesInfo should be updated when setOption performed.\n\nexport function collect(ecModel, api) {\n var result = {\n /**\r\n * key: makeKey(axis.model)\r\n * value: {\r\n * axis,\r\n * coordSys,\r\n * axisPointerModel,\r\n * triggerTooltip,\r\n * triggerEmphasis,\r\n * involveSeries,\r\n * snap,\r\n * seriesModels,\r\n * seriesDataCount\r\n * }\r\n */\n axesInfo: {},\n seriesInvolved: false,\n\n /**\r\n * key: makeKey(coordSys.model)\r\n * value: Object: key makeKey(axis.model), value: axisInfo\r\n */\n coordSysAxesInfo: {},\n coordSysMap: {}\n };\n collectAxesInfo(result, ecModel, api); // Check seriesInvolved for performance, in case too many series in some chart.\n\n result.seriesInvolved && collectSeriesInfo(result, ecModel);\n return result;\n}\n\nfunction collectAxesInfo(result, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var globalAxisPointerModel = ecModel.getComponent('axisPointer'); // links can only be set on global.\n\n var linksOption = globalAxisPointerModel.get('link', true) || [];\n var linkGroups = []; // Collect axes info.\n\n each(api.getCoordinateSystems(), function (coordSys) {\n // Some coordinate system do not support axes, like geo.\n if (!coordSys.axisPointerEnabled) {\n return;\n }\n\n var coordSysKey = makeKey(coordSys.model);\n var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};\n result.coordSysMap[coordSysKey] = coordSys; // Set tooltip (like 'cross') is a convenient way to show axisPointer\n // for user. So we enable setting tooltip on coordSys model.\n\n var coordSysModel = coordSys.model;\n var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel);\n each(coordSys.getAxes(), curry(saveTooltipAxisInfo, false, null)); // If axis tooltip used, choose tooltip axis for each coordSys.\n // Notice this case: coordSys is `grid` but not `cartesian2D` here.\n\n if (coordSys.getTooltipAxes && globalTooltipModel // If tooltip.showContent is set as false, tooltip will not\n // show but axisPointer will show as normal.\n && baseTooltipModel.get('show')) {\n // Compatible with previous logic. But series.tooltip.trigger: 'axis'\n // or series.data[n].tooltip.trigger: 'axis' are not support any more.\n var triggerAxis = baseTooltipModel.get('trigger') === 'axis';\n var cross = baseTooltipModel.get(['axisPointer', 'type']) === 'cross';\n var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(['axisPointer', 'axis']));\n\n if (triggerAxis || cross) {\n each(tooltipAxes.baseAxes, curry(saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis));\n }\n\n if (cross) {\n each(tooltipAxes.otherAxes, curry(saveTooltipAxisInfo, 'cross', false));\n }\n } // fromTooltip: true | false | 'cross'\n // triggerTooltip: true | false | null\n\n\n function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {\n var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel);\n var axisPointerShow = axisPointerModel.get('show');\n\n if (!axisPointerShow || axisPointerShow === 'auto' && !fromTooltip && !isHandleTrigger(axisPointerModel)) {\n return;\n }\n\n if (triggerTooltip == null) {\n triggerTooltip = axisPointerModel.get('triggerTooltip');\n }\n\n axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;\n var snap = axisPointerModel.get('snap');\n var triggerEmphasis = axisPointerModel.get('triggerEmphasis');\n var axisKey = makeKey(axis.model);\n var involveSeries = triggerTooltip || snap || axis.type === 'category'; // If result.axesInfo[key] exist, override it (tooltip has higher priority).\n\n var axisInfo = result.axesInfo[axisKey] = {\n key: axisKey,\n axis: axis,\n coordSys: coordSys,\n axisPointerModel: axisPointerModel,\n triggerTooltip: triggerTooltip,\n triggerEmphasis: triggerEmphasis,\n involveSeries: involveSeries,\n snap: snap,\n useHandle: isHandleTrigger(axisPointerModel),\n seriesModels: [],\n linkGroup: null\n };\n axesInfoInCoordSys[axisKey] = axisInfo;\n result.seriesInvolved = result.seriesInvolved || involveSeries;\n var groupIndex = getLinkGroupIndex(linksOption, axis);\n\n if (groupIndex != null) {\n var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {\n axesInfo: {}\n });\n linkGroup.axesInfo[axisKey] = axisInfo;\n linkGroup.mapper = linksOption[groupIndex].mapper;\n axisInfo.linkGroup = linkGroup;\n }\n }\n });\n}\n\nfunction makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {\n var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer');\n var fields = ['type', 'snap', 'lineStyle', 'shadowStyle', 'label', 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z'];\n var volatileOption = {};\n each(fields, function (field) {\n volatileOption[field] = clone(tooltipAxisPointerModel.get(field));\n }); // category axis do not auto snap, otherwise some tick that do not\n // has value can not be hovered. value/time/log axis default snap if\n // triggered from tooltip and trigger tooltip.\n\n volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; // Compatible with previous behavior, tooltip axis does not show label by default.\n // Only these properties can be overridden from tooltip to axisPointer.\n\n if (tooltipAxisPointerModel.get('type') === 'cross') {\n volatileOption.type = 'line';\n }\n\n var labelOption = volatileOption.label || (volatileOption.label = {}); // Follow the convention, do not show label when triggered by tooltip by default.\n\n labelOption.show == null && (labelOption.show = false);\n\n if (fromTooltip === 'cross') {\n // When 'cross', both axes show labels.\n var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(['label', 'show']);\n labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; // If triggerTooltip, this is a base axis, which should better not use cross style\n // (cross style is dashed by default)\n\n if (!triggerTooltip) {\n var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle');\n crossStyle && defaults(labelOption, crossStyle.textStyle);\n }\n }\n\n return axis.model.getModel('axisPointer', new Model(volatileOption, globalAxisPointerModel, ecModel));\n}\n\nfunction collectSeriesInfo(result, ecModel) {\n // Prepare data for axis trigger\n ecModel.eachSeries(function (seriesModel) {\n // Notice this case: this coordSys is `cartesian2D` but not `grid`.\n var coordSys = seriesModel.coordinateSystem;\n var seriesTooltipTrigger = seriesModel.get(['tooltip', 'trigger'], true);\n var seriesTooltipShow = seriesModel.get(['tooltip', 'show'], true);\n\n if (!coordSys || seriesTooltipTrigger === 'none' || seriesTooltipTrigger === false || seriesTooltipTrigger === 'item' || seriesTooltipShow === false || seriesModel.get(['axisPointer', 'show'], true) === false) {\n return;\n }\n\n each(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) {\n var axis = axisInfo.axis;\n\n if (coordSys.getAxis(axis.dim) === axis) {\n axisInfo.seriesModels.push(seriesModel);\n axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);\n axisInfo.seriesDataCount += seriesModel.getData().count();\n }\n });\n });\n}\n/**\r\n * For example:\r\n * {\r\n * axisPointer: {\r\n * links: [{\r\n * xAxisIndex: [2, 4],\r\n * yAxisIndex: 'all'\r\n * }, {\r\n * xAxisId: ['a5', 'a7'],\r\n * xAxisName: 'xxx'\r\n * }]\r\n * }\r\n * }\r\n */\n\n\nfunction getLinkGroupIndex(linksOption, axis) {\n var axisModel = axis.model;\n var dim = axis.dim;\n\n for (var i = 0; i < linksOption.length; i++) {\n var linkOption = linksOption[i] || {};\n\n if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name)) {\n return i;\n }\n }\n}\n\nfunction checkPropInLink(linkPropValue, axisPropValue) {\n return linkPropValue === 'all' || isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;\n}\n\nexport function fixValue(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n\n if (!axisInfo) {\n return;\n }\n\n var axisPointerModel = axisInfo.axisPointerModel;\n var scale = axisInfo.axis.scale;\n var option = axisPointerModel.option;\n var status = axisPointerModel.get('status');\n var value = axisPointerModel.get('value'); // Parse init value for category and time axis.\n\n if (value != null) {\n value = scale.parse(value);\n }\n\n var useHandle = isHandleTrigger(axisPointerModel); // If `handle` used, `axisPointer` will always be displayed, so value\n // and status should be initialized.\n\n if (status == null) {\n option.status = useHandle ? 'show' : 'hide';\n }\n\n var extent = scale.getExtent().slice();\n extent[0] > extent[1] && extent.reverse();\n\n if ( // Pick a value on axis when initializing.\n value == null // If both `handle` and `dataZoom` are used, value may be out of axis extent,\n // where we should re-pick a value to keep `handle` displaying normally.\n || value > extent[1]) {\n // Make handle displayed on the end of the axis when init, which looks better.\n value = extent[1];\n }\n\n if (value < extent[0]) {\n value = extent[0];\n }\n\n option.value = value;\n\n if (useHandle) {\n option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show';\n }\n}\nexport function getAxisInfo(axisModel) {\n var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo;\n return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];\n}\nexport function getAxisPointerModel(axisModel) {\n var axisInfo = getAxisInfo(axisModel);\n return axisInfo && axisInfo.axisPointerModel;\n}\n\nfunction isHandleTrigger(axisPointerModel) {\n return !!axisPointerModel.get(['handle', 'show']);\n}\n/**\r\n * @param {module:echarts/model/Model} model\r\n * @return {string} unique key\r\n */\n\n\nexport function makeKey(model) {\n return model.type + '||' + model.id;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as axisPointerModelHelper from '../axisPointer/modelHelper.js';\nimport ComponentView from '../../view/Component.js';\nvar axisPointerClazz = {};\n/**\r\n * Base class of AxisView.\r\n */\n\nvar AxisView =\n/** @class */\nfunction (_super) {\n __extends(AxisView, _super);\n\n function AxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisView.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n // FIXME\n // This process should proformed after coordinate systems updated\n // (axis scale updated), and should be performed each time update.\n // So put it here temporarily, although it is not appropriate to\n // put a model-writing procedure in `view`.\n this.axisPointerClass && axisPointerModelHelper.fixValue(axisModel);\n\n _super.prototype.render.apply(this, arguments);\n\n this._doUpdateAxisPointerClass(axisModel, api, true);\n };\n /**\r\n * Action handler.\r\n */\n\n\n AxisView.prototype.updateAxisPointer = function (axisModel, ecModel, api, payload) {\n this._doUpdateAxisPointerClass(axisModel, api, false);\n };\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.remove = function (ecModel, api) {\n var axisPointer = this._axisPointer;\n axisPointer && axisPointer.remove(api);\n };\n /**\r\n * @override\r\n */\n\n\n AxisView.prototype.dispose = function (ecModel, api) {\n this._disposeAxisPointer(api);\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n AxisView.prototype._doUpdateAxisPointerClass = function (axisModel, api, forceRender) {\n var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass);\n\n if (!Clazz) {\n return;\n }\n\n var axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api);\n };\n\n AxisView.prototype._disposeAxisPointer = function (api) {\n this._axisPointer && this._axisPointer.dispose(api);\n this._axisPointer = null;\n };\n\n AxisView.registerAxisPointerClass = function (type, clazz) {\n if (process.env.NODE_ENV !== 'production') {\n if (axisPointerClazz[type]) {\n throw new Error('axisPointer ' + type + ' exists');\n }\n }\n\n axisPointerClazz[type] = clazz;\n };\n\n ;\n\n AxisView.getAxisPointerClass = function (type) {\n return type && axisPointerClazz[type];\n };\n\n ;\n AxisView.type = 'axis';\n return AxisView;\n}(ComponentView);\n\nexport default AxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nexport function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n } // TODO: TYPE\n\n\n var splitAreaModel = axisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var gridRect = gridModel.coordinateSystem.getRect();\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitAreaModel,\n clamp: true\n });\n\n if (!ticksCoords.length) {\n return;\n } // For Making appropriate splitArea animation, the color and anid\n // should be corresponding to previous one if possible.\n\n\n var areaColorsLen = areaColors.length;\n var lastSplitAreaColors = inner(axisView).splitAreaColors;\n var newSplitAreaColors = zrUtil.createHashMap();\n var colorIndex = 0;\n\n if (lastSplitAreaColors) {\n for (var i = 0; i < ticksCoords.length; i++) {\n var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue);\n\n if (cIndex != null) {\n colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen;\n break;\n }\n }\n }\n\n var prev = axis.toGlobalCoord(ticksCoords[0].coord);\n var areaStyle = areaStyleModel.getAreaStyle();\n areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n var x = void 0;\n var y = void 0;\n var width = void 0;\n var height = void 0;\n\n if (axis.isHorizontal()) {\n x = prev;\n y = gridRect.y;\n width = tickCoord - x;\n height = gridRect.height;\n prev = x + width;\n } else {\n x = gridRect.x;\n y = prev;\n width = gridRect.width;\n height = tickCoord - y;\n prev = y + height;\n }\n\n var tickValue = ticksCoords[i - 1].tickValue;\n tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);\n axisGroup.add(new graphic.Rect({\n anid: tickValue != null ? 'area_' + tickValue : null,\n shape: {\n x: x,\n y: y,\n width: width,\n height: height\n },\n style: zrUtil.defaults({\n fill: areaColors[colorIndex]\n }, areaStyle),\n autoBatch: true,\n silent: true\n }));\n colorIndex = (colorIndex + 1) % areaColorsLen;\n }\n\n inner(axisView).splitAreaColors = newSplitAreaColors;\n}\nexport function rectCoordAxisHandleRemove(axisView) {\n inner(axisView).splitAreaColors = null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nimport { isIntervalOrLogScale } from '../../scale/helper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine', 'minorSplitLine'];\n\nvar CartesianAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisView, _super);\n\n function CartesianAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianAxisView.type;\n _this.axisPointerClass = 'CartesianAxisPointer';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var gridModel = axisModel.getCoordSysModel();\n var layout = cartesianAxisHelper.layout(gridModel, axisModel);\n var axisBuilder = new AxisBuilder(axisModel, zrUtil.extend({\n handleAutoShown: function (elementType) {\n var cartesians = gridModel.coordinateSystem.getCartesians();\n\n for (var i = 0; i < cartesians.length; i++) {\n if (isIntervalOrLogScale(cartesians[i].getOtherAxis(axisModel.axis).scale)) {\n // Still show axis tick or axisLine if other axis is value / log\n return true;\n }\n } // Not show axisTick or axisLine if other axis is category / time\n\n\n return false;\n }\n }, layout));\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this._axisGroup, axisModel, gridModel);\n }\n }, this); // THIS is a special case for bar racing chart.\n // Update the axis label from the natural initial layout to\n // sorted layout should has no animation.\n\n var isInitialSortFromBarRacing = payload && payload.type === 'changeAxisOrder' && payload.isInitSort;\n\n if (!isInitialSortFromBarRacing) {\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n CartesianAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n CartesianAxisView.type = 'cartesianAxis';\n return CartesianAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var colorIndex = lineCount++ % lineColors.length;\n var tickValue = ticksCoords[i].tickValue;\n var line = new graphic.Line({\n anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: zrUtil.defaults({\n stroke: lineColors[colorIndex]\n }, lineStyle),\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n },\n minorSplitLine: function (axisView, axisGroup, axisModel, gridModel) {\n var axis = axisModel.axis;\n var minorSplitLineModel = axisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var gridRect = gridModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var minorTicksCoords = axis.getMinorTicksCoords();\n\n if (!minorTicksCoords.length) {\n return;\n }\n\n var p1 = [];\n var p2 = [];\n var lineStyle = lineStyleModel.getLineStyle();\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n var tickCoord = axis.toGlobalCoord(minorTicksCoords[i][k].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var line = new graphic.Line({\n anid: 'minor_line_' + minorTicksCoords[i][k].tickValue,\n autoBatch: true,\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n style: lineStyle,\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineStyle.lineWidth);\n axisGroup.add(line);\n }\n }\n },\n splitArea: function (axisView, axisGroup, axisModel, gridModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);\n }\n};\n\nvar CartesianXAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianXAxisView, _super);\n\n function CartesianXAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianXAxisView.type = 'xAxis';\n return CartesianXAxisView;\n}(CartesianAxisView);\n\nexport { CartesianXAxisView };\n\nvar CartesianYAxisView =\n/** @class */\nfunction (_super) {\n __extends(CartesianYAxisView, _super);\n\n function CartesianYAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CartesianXAxisView.type;\n return _this;\n }\n\n CartesianYAxisView.type = 'yAxis';\n return CartesianYAxisView;\n}(CartesianAxisView);\n\nexport { CartesianYAxisView };\nexport default CartesianAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport GridModel from '../../coord/cartesian/GridModel.js';\nimport { Rect } from '../../util/graphic.js';\nimport { defaults } from 'zrender/lib/core/util.js';\nimport { CartesianAxisModel } from '../../coord/cartesian/AxisModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport Grid from '../../coord/cartesian/Grid.js';\nimport { CartesianXAxisView, CartesianYAxisView } from '../axis/CartesianAxisView.js'; // Grid view\n\nvar GridView =\n/** @class */\nfunction (_super) {\n __extends(GridView, _super);\n\n function GridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'grid';\n return _this;\n }\n\n GridView.prototype.render = function (gridModel, ecModel) {\n this.group.removeAll();\n\n if (gridModel.get('show')) {\n this.group.add(new Rect({\n shape: gridModel.coordinateSystem.getRect(),\n style: defaults({\n fill: gridModel.get('backgroundColor')\n }, gridModel.getItemStyle()),\n silent: true,\n z2: -1\n }));\n }\n };\n\n GridView.type = 'grid';\n return GridView;\n}(ComponentView);\n\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n offset: 0\n};\nexport function install(registers) {\n registers.registerComponentView(GridView);\n registers.registerComponentModel(GridModel);\n registers.registerCoordinateSystem('cartesian2d', Grid);\n axisModelCreator(registers, 'x', CartesianAxisModel, extraOption);\n axisModelCreator(registers, 'y', CartesianAxisModel, extraOption);\n registers.registerComponentView(CartesianXAxisView);\n registers.registerComponentView(CartesianYAxisView);\n registers.registerPreprocessor(function (option) {\n // Only create grid when need\n if (option.xAxis && option.yAxis && !option.grid) {\n option.grid = {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport ScatterSeriesModel from './ScatterSeries.js';\nimport ScatterView from './ScatterView.js';\nimport { install as installGridSimple } from '../../component/grid/installSimple.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n // In case developer forget to include grid component\n use(installGridSimple);\n registers.registerSeriesModel(ScatterSeriesModel);\n registers.registerChartView(ScatterView);\n registers.registerLayout(layoutPoints('scatter'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarLayout(ecModel) {\n ecModel.eachSeriesByType('radar', function (seriesModel) {\n var data = seriesModel.getData();\n var points = [];\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n return;\n }\n\n var axes = coordSys.getIndicatorAxes();\n zrUtil.each(axes, function (axis, axisIndex) {\n data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {\n points[dataIndex] = points[dataIndex] || [];\n var point = coordSys.dataToPoint(val, axisIndex);\n points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);\n });\n }); // Close polygon\n\n data.each(function (idx) {\n // TODO\n // Is it appropriate to connect to the next data when some data is missing?\n // Or, should trade it like `connectNull` in line chart?\n var firstPoint = zrUtil.find(points[idx], function (point) {\n return isValidPoint(point);\n }) || getValueMissingPoint(coordSys); // Copy the first actual point to the end of the array\n\n points[idx].push(firstPoint.slice());\n data.setItemLayout(idx, points[idx]);\n });\n });\n}\n\nfunction isValidPoint(point) {\n return !isNaN(point[0]) && !isNaN(point[1]);\n}\n\nfunction getValueMissingPoint(coordSys) {\n // It is error-prone to input [NaN, NaN] into polygon, polygon.\n // (probably cause problem when refreshing or animating)\n return [coordSys.cx, coordSys.cy];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\n// Backward compat for radar chart in 2\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function radarBackwardCompat(option) {\n var polarOptArr = option.polar;\n\n if (polarOptArr) {\n if (!zrUtil.isArray(polarOptArr)) {\n polarOptArr = [polarOptArr];\n }\n\n var polarNotRadar_1 = [];\n zrUtil.each(polarOptArr, function (polarOpt, idx) {\n if (polarOpt.indicator) {\n if (polarOpt.type && !polarOpt.shape) {\n polarOpt.shape = polarOpt.type;\n }\n\n option.radar = option.radar || [];\n\n if (!zrUtil.isArray(option.radar)) {\n option.radar = [option.radar];\n }\n\n option.radar.push(polarOpt);\n } else {\n polarNotRadar_1.push(polarOpt);\n }\n });\n option.polar = polarNotRadar_1;\n }\n\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) {\n seriesOpt.radarIndex = seriesOpt.polarIndex;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (seriesModel, ecModel, api) {\n var polar = seriesModel.coordinateSystem;\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n\n function createSymbol(data, idx) {\n var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';\n\n if (symbolType === 'none') {\n return;\n }\n\n var symbolSize = symbolUtil.normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolPath = symbolUtil.createSymbol(symbolType, -1, -1, 2, 2);\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0;\n symbolPath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 100,\n scaleX: symbolSize[0] / 2,\n scaleY: symbolSize[1] / 2,\n rotation: symbolRotate * Math.PI / 180 || 0\n });\n return symbolPath;\n }\n\n function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {\n // Simply rerender all\n symbolGroup.removeAll();\n\n for (var i = 0; i < newPoints.length - 1; i++) {\n var symbolPath = createSymbol(data, idx);\n\n if (symbolPath) {\n symbolPath.__dimIdx = i;\n\n if (oldPoints[i]) {\n symbolPath.setPosition(oldPoints[i]);\n graphic[isInit ? 'initProps' : 'updateProps'](symbolPath, {\n x: newPoints[i][0],\n y: newPoints[i][1]\n }, seriesModel, idx);\n } else {\n symbolPath.setPosition(newPoints[i]);\n }\n\n symbolGroup.add(symbolPath);\n }\n }\n }\n\n function getInitialPoints(points) {\n return zrUtil.map(points, function (pt) {\n return [polar.cx, polar.cy];\n });\n }\n\n data.diff(oldData).add(function (idx) {\n var points = data.getItemLayout(idx);\n\n if (!points) {\n return;\n }\n\n var polygon = new graphic.Polygon();\n var polyline = new graphic.Polyline();\n var target = {\n shape: {\n points: points\n }\n };\n polygon.shape.points = getInitialPoints(points);\n polyline.shape.points = getInitialPoints(points);\n graphic.initProps(polygon, target, seriesModel, idx);\n graphic.initProps(polyline, target, seriesModel, idx);\n var itemGroup = new graphic.Group();\n var symbolGroup = new graphic.Group();\n itemGroup.add(polyline);\n itemGroup.add(polygon);\n itemGroup.add(symbolGroup);\n updateSymbols(polyline.shape.points, points, symbolGroup, data, idx, true);\n data.setItemGraphicEl(idx, itemGroup);\n }).update(function (newIdx, oldIdx) {\n var itemGroup = oldData.getItemGraphicEl(oldIdx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2);\n var target = {\n shape: {\n points: data.getItemLayout(newIdx)\n }\n };\n\n if (!target.shape.points) {\n return;\n }\n\n updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);\n saveOldStyle(polygon);\n saveOldStyle(polyline);\n graphic.updateProps(polyline, target, seriesModel);\n graphic.updateProps(polygon, target, seriesModel);\n data.setItemGraphicEl(newIdx, itemGroup);\n }).remove(function (idx) {\n group.remove(oldData.getItemGraphicEl(idx));\n }).execute();\n data.eachItemGraphicEl(function (itemGroup, idx) {\n var itemModel = data.getItemModel(idx);\n var polyline = itemGroup.childAt(0);\n var polygon = itemGroup.childAt(1);\n var symbolGroup = itemGroup.childAt(2); // Radar uses the visual encoded from itemStyle.\n\n var itemStyle = data.getItemVisual(idx, 'style');\n var color = itemStyle.fill;\n group.add(itemGroup);\n polyline.useStyle(zrUtil.defaults(itemModel.getModel('lineStyle').getLineStyle(), {\n fill: 'none',\n stroke: color\n }));\n setStatesStylesFromModel(polyline, itemModel, 'lineStyle');\n setStatesStylesFromModel(polygon, itemModel, 'areaStyle');\n var areaStyleModel = itemModel.getModel('areaStyle');\n var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();\n polygon.ignore = polygonIgnore;\n zrUtil.each(['emphasis', 'select', 'blur'], function (stateName) {\n var stateModel = itemModel.getModel([stateName, 'areaStyle']);\n var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty(); // Won't be ignore if normal state is not ignore.\n\n polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;\n });\n polygon.useStyle(zrUtil.defaults(areaStyleModel.getAreaStyle(), {\n fill: color,\n opacity: 0.7,\n decal: itemStyle.decal\n }));\n var emphasisModel = itemModel.getModel('emphasis');\n var itemHoverStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n symbolGroup.eachChild(function (symbolPath) {\n if (symbolPath instanceof ZRImage) {\n var pathStyle = symbolPath.style;\n symbolPath.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, itemStyle));\n } else {\n symbolPath.useStyle(itemStyle);\n symbolPath.setColor(color);\n symbolPath.style.strokeNoScale = true;\n }\n\n var pathEmphasisState = symbolPath.ensureState('emphasis');\n pathEmphasisState.style = zrUtil.clone(itemHoverStyle);\n var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);\n (defaultText == null || isNaN(defaultText)) && (defaultText = '');\n setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n labelDimIndex: symbolPath.__dimIdx,\n defaultText: defaultText,\n inheritColor: color,\n defaultOpacity: itemStyle.opacity\n });\n });\n toggleHoverEmphasis(itemGroup, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n this._data = data;\n };\n\n RadarView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ChartView);\n\nexport default RadarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup, retrieveVisualColorForTooltipMarker } from '../../component/tooltip/tooltipMarkup.js';\n\nvar RadarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(RadarSeriesModel, _super);\n\n function RadarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n } // Overwrite\n\n\n RadarSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n\n RadarSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n generateCoord: 'indicator_',\n generateCoordCount: Infinity\n });\n };\n\n RadarSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var coordSys = this.coordinateSystem;\n var indicatorAxes = coordSys.getIndicatorAxes();\n var name = this.getData().getName(dataIndex);\n var nameToDisplay = name === '' ? this.name : name;\n var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);\n return createTooltipMarkup('section', {\n header: nameToDisplay,\n sortBlocks: true,\n blocks: zrUtil.map(indicatorAxes, function (axis) {\n var val = data.get(data.mapDimension(axis.dim), dataIndex);\n return createTooltipMarkup('nameValue', {\n markerType: 'subItem',\n markerColor: markerColor,\n name: axis.name,\n value: val,\n sortParam: val\n });\n })\n });\n };\n\n RadarSeriesModel.prototype.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var data_1 = this.getData();\n var coordSys = this.coordinateSystem;\n var values = data_1.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data_1.mapDimension(dim);\n }), dataIndex);\n\n for (var i = 0, len = values.length; i < len; i++) {\n if (!isNaN(values[i])) {\n var indicatorAxes = coordSys.getIndicatorAxes();\n return coordSys.coordToPoint(indicatorAxes[i].dataToCoord(values[i]), i);\n }\n }\n }\n };\n\n RadarSeriesModel.type = 'series.radar';\n RadarSeriesModel.dependencies = ['radar'];\n RadarSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'radar',\n legendHoverLink: true,\n radarIndex: 0,\n lineStyle: {\n width: 2,\n type: 'solid',\n join: 'round'\n },\n label: {\n position: 'top'\n },\n // areaStyle: {\n // },\n // itemStyle: {}\n symbolSize: 8 // symbolRotate: null\n\n };\n return RadarSeriesModel;\n}(SeriesModel);\n\nexport default RadarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport axisDefault from '../axisDefault.js';\nimport Model from '../../model/Model.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport ComponentModel from '../../model/Component.js';\nvar valueAxisDefault = axisDefault.value;\n\nfunction defaultsShow(opt, show) {\n return zrUtil.defaults({\n show: show\n }, opt);\n}\n\nvar RadarModel =\n/** @class */\nfunction (_super) {\n __extends(RadarModel, _super);\n\n function RadarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarModel.type;\n return _this;\n }\n\n RadarModel.prototype.optionUpdated = function () {\n var boundaryGap = this.get('boundaryGap');\n var splitNumber = this.get('splitNumber');\n var scale = this.get('scale');\n var axisLine = this.get('axisLine');\n var axisTick = this.get('axisTick'); // let axisType = this.get('axisType');\n\n var axisLabel = this.get('axisLabel');\n var nameTextStyle = this.get('axisName');\n var showName = this.get(['axisName', 'show']);\n var nameFormatter = this.get(['axisName', 'formatter']);\n var nameGap = this.get('axisNameGap');\n var triggerEvent = this.get('triggerEvent');\n var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n // PENDING\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n indicatorOpt.min = 0;\n } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n indicatorOpt.max = 0;\n }\n\n var iNameTextStyle = nameTextStyle;\n\n if (indicatorOpt.color != null) {\n iNameTextStyle = zrUtil.defaults({\n color: indicatorOpt.color\n }, nameTextStyle);\n } // Use same configuration\n\n\n var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n boundaryGap: boundaryGap,\n splitNumber: splitNumber,\n scale: scale,\n axisLine: axisLine,\n axisTick: axisTick,\n // axisType: axisType,\n axisLabel: axisLabel,\n // Compatible with 2 and use text\n name: indicatorOpt.text,\n showName: showName,\n nameLocation: 'end',\n nameGap: nameGap,\n // min: 0,\n nameTextStyle: iNameTextStyle,\n triggerEvent: triggerEvent\n }, false);\n\n if (zrUtil.isString(nameFormatter)) {\n var indName = innerIndicatorOpt.name;\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n } else if (zrUtil.isFunction(nameFormatter)) {\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n }\n\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\n zrUtil.mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent.\n\n model.mainType = 'radar';\n model.componentIndex = this.componentIndex;\n return model;\n }, this);\n this._indicatorModels = indicatorModels;\n };\n\n RadarModel.prototype.getIndicatorModels = function () {\n return this._indicatorModels;\n };\n\n RadarModel.type = 'radar';\n RadarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '75%',\n startAngle: 90,\n axisName: {\n show: true // formatter: null\n // textStyle: {}\n\n },\n boundaryGap: [0, 0],\n splitNumber: 5,\n axisNameGap: 15,\n scale: false,\n // Polygon or circle\n shape: 'polygon',\n axisLine: zrUtil.merge({\n lineStyle: {\n color: '#bbb'\n }\n }, valueAxisDefault.axisLine),\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n // axisType: 'value',\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n // {text, min, max}\n indicator: []\n };\n return RadarModel;\n}(ComponentModel);\n\nexport default RadarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar RadarView =\n/** @class */\nfunction (_super) {\n __extends(RadarView, _super);\n\n function RadarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarView.type;\n return _this;\n }\n\n RadarView.prototype.render = function (radarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n this._buildAxes(radarModel);\n\n this._buildSplitLineAndArea(radarModel);\n };\n\n RadarView.prototype._buildAxes = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {\n var axisName = indicatorAxis.model.get('showName') ? indicatorAxis.name : ''; // hide name\n\n var axisBuilder = new AxisBuilder(indicatorAxis.model, {\n axisName: axisName,\n position: [radar.cx, radar.cy],\n rotation: indicatorAxis.angle,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1\n });\n return axisBuilder;\n });\n zrUtil.each(axisBuilders, function (axisBuilder) {\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n this.group.add(axisBuilder.getGroup());\n }, this);\n };\n\n RadarView.prototype._buildSplitLineAndArea = function (radarModel) {\n var radar = radarModel.coordinateSystem;\n var indicatorAxes = radar.getIndicatorAxes();\n\n if (!indicatorAxes.length) {\n return;\n }\n\n var shape = radarModel.get('shape');\n var splitLineModel = radarModel.getModel('splitLine');\n var splitAreaModel = radarModel.getModel('splitArea');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var showSplitLine = splitLineModel.get('show');\n var showSplitArea = splitAreaModel.get('show');\n var splitLineColors = lineStyleModel.get('color');\n var splitAreaColors = areaStyleModel.get('color');\n var splitLineColorsArr = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];\n var splitAreaColorsArr = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];\n var splitLines = [];\n var splitAreas = [];\n\n function getColorIndex(areaOrLine, areaOrLineColorList, idx) {\n var colorIndex = idx % areaOrLineColorList.length;\n areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];\n return colorIndex;\n }\n\n if (shape === 'circle') {\n var ticksRadius = indicatorAxes[0].getTicksCoords();\n var cx = radar.cx;\n var cy = radar.cy;\n\n for (var i = 0; i < ticksRadius.length; i++) {\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: cx,\n cy: cy,\n r: ticksRadius[i].coord\n }\n }));\n }\n\n if (showSplitArea && i < ticksRadius.length - 1) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i);\n splitAreas[colorIndex].push(new graphic.Ring({\n shape: {\n cx: cx,\n cy: cy,\n r0: ticksRadius[i].coord,\n r: ticksRadius[i + 1].coord\n }\n }));\n }\n }\n } // Polyyon\n else {\n var realSplitNumber_1;\n var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {\n var ticksCoords = indicatorAxis.getTicksCoords();\n realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);\n return zrUtil.map(ticksCoords, function (tickCoord) {\n return radar.coordToPoint(tickCoord.coord, idx);\n });\n });\n var prevPoints = [];\n\n for (var i = 0; i <= realSplitNumber_1; i++) {\n var points = [];\n\n for (var j = 0; j < indicatorAxes.length; j++) {\n points.push(axesTicksPoints[j][i]);\n } // Close\n\n\n if (points[0]) {\n points.push(points[0].slice());\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Can\\'t draw value axis ' + i);\n }\n }\n\n if (showSplitLine) {\n var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i);\n splitLines[colorIndex].push(new graphic.Polyline({\n shape: {\n points: points\n }\n }));\n }\n\n if (showSplitArea && prevPoints) {\n var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i - 1);\n splitAreas[colorIndex].push(new graphic.Polygon({\n shape: {\n points: points.concat(prevPoints)\n }\n }));\n }\n\n prevPoints = points.slice().reverse();\n }\n }\n\n var lineStyle = lineStyleModel.getLineStyle();\n var areaStyle = areaStyleModel.getAreaStyle(); // Add splitArea before splitLine\n\n zrUtil.each(splitAreas, function (splitAreas, idx) {\n this.group.add(graphic.mergePath(splitAreas, {\n style: zrUtil.defaults({\n stroke: 'none',\n fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]\n }, areaStyle),\n silent: true\n }));\n }, this);\n zrUtil.each(splitLines, function (splitLines, idx) {\n this.group.add(graphic.mergePath(splitLines, {\n style: zrUtil.defaults({\n fill: 'none',\n stroke: splitLineColorsArr[idx % splitLineColorsArr.length]\n }, lineStyle),\n silent: true\n }));\n }, this);\n };\n\n RadarView.type = 'radar';\n return RadarView;\n}(ComponentView);\n\nexport default RadarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar IndicatorAxis =\n/** @class */\nfunction (_super) {\n __extends(IndicatorAxis, _super);\n\n function IndicatorAxis(dim, scale, radiusExtent) {\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\n\n _this.type = 'value';\n _this.angle = 0;\n _this.name = '';\n return _this;\n }\n\n return IndicatorAxis;\n}(Axis);\n\nexport default IndicatorAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport * as numberUtil from '../../util/number.js';\nimport { map, each, isString, isNumber } from 'zrender/lib/core/util.js';\nimport { alignScaleTicks } from '../axisAlignTicks.js';\n\nvar Radar =\n/** @class */\nfunction () {\n function Radar(radarModel, ecModel, api) {\n /**\r\n *\r\n * Radar dimensions\r\n */\n this.dimensions = [];\n this._model = radarModel;\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n var dim = 'indicator_' + idx;\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n );\n indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis\n\n indicatorAxis.model = indicatorModel;\n indicatorModel.axis = indicatorAxis;\n this.dimensions.push(dim);\n return indicatorAxis;\n }, this);\n this.resize(radarModel, api);\n }\n\n Radar.prototype.getIndicatorAxes = function () {\n return this._indicatorAxes;\n };\n\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n }; // TODO: API should be coordToPoint([coord, indicatorIndex])\n\n\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n var angle = indicatorAxis.angle;\n var x = this.cx + coord * Math.cos(angle);\n var y = this.cy - coord * Math.sin(angle);\n return [x, y];\n };\n\n Radar.prototype.pointToData = function (pt) {\n var dx = pt[0] - this.cx;\n var dy = pt[1] - this.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx); // Find the closest angle\n // FIXME index can calculated directly\n\n var minRadianDiff = Infinity;\n var closestAxis;\n var closestAxisIdx = -1;\n\n for (var i = 0; i < this._indicatorAxes.length; i++) {\n var indicatorAxis = this._indicatorAxes[i];\n var diff = Math.abs(radian - indicatorAxis.angle);\n\n if (diff < minRadianDiff) {\n closestAxis = indicatorAxis;\n closestAxisIdx = i;\n minRadianDiff = diff;\n }\n }\n\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n };\n\n Radar.prototype.resize = function (radarModel, api) {\n var center = radarModel.get('center');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n\n var radius = radarModel.get('radius');\n\n if (isString(radius) || isNumber(radius)) {\n radius = [0, radius];\n }\n\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n this.r = numberUtil.parsePercent(radius[1], viewSize);\n each(this._indicatorAxes, function (indicatorAxis, idx) {\n indicatorAxis.setExtent(this.r0, this.r);\n var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI]\n\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n indicatorAxis.angle = angle;\n }, this);\n };\n\n Radar.prototype.update = function (ecModel, api) {\n var indicatorAxes = this._indicatorAxes;\n var radarModel = this._model;\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\n });\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n return;\n }\n\n var data = radarSeries.getData();\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n });\n }, this);\n var splitNumber = radarModel.get('splitNumber');\n var dummyScale = new IntervalScale();\n dummyScale.setExtent(0, splitNumber);\n dummyScale.setInterval(1); // Force all the axis fixing the maxSplitNumber.\n\n each(indicatorAxes, function (indicatorAxis, idx) {\n alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);\n });\n };\n\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n\n Radar.create = function (ecModel, api) {\n var radarList = [];\n ecModel.eachComponent('radar', function (radarModel) {\n var radar = new Radar(radarModel, ecModel, api);\n radarList.push(radar);\n radarModel.coordinateSystem = radar;\n });\n ecModel.eachSeriesByType('radar', function (radarSeries) {\n if (radarSeries.get('coordinateSystem') === 'radar') {\n // Inject coordinate system\n // @ts-ignore\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n }\n });\n return radarList;\n };\n /**\r\n * Radar dimensions is based on the data\r\n */\n\n\n Radar.dimensions = [];\n return Radar;\n}();\n\nexport default Radar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport RadarModel from '../../coord/radar/RadarModel.js';\nimport RadarView from './RadarView.js';\nimport Radar from '../../coord/radar/Radar.js';\nexport function install(registers) {\n registers.registerCoordinateSystem('radar', Radar);\n registers.registerComponentModel(RadarModel);\n registers.registerComponentView(RadarView);\n registers.registerVisual({\n seriesType: 'radar',\n reset: function (seriesModel) {\n var data = seriesModel.getData(); // itemVisual symbol is for selected data\n\n data.each(function (idx) {\n data.setItemVisual(idx, 'legendIcon', 'roundRect');\n }); // visual is for unselected data\n\n data.setVisual('legendIcon', 'roundRect');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport radarLayout from '../radar/radarLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport backwardCompat from '../radar/backwardCompat.js';\nimport RadarView from './RadarView.js';\nimport RadarSeriesModel from './RadarSeries.js';\nimport { install as installRadarComponent } from '../../component/radar/install.js';\nexport function install(registers) {\n use(installRadarComponent);\n registers.registerChartView(RadarView);\n registers.registerSeriesModel(RadarSeriesModel);\n registers.registerLayout(radarLayout);\n registers.registerProcessor(dataFilter('radar'));\n registers.registerPreprocessor(backwardCompat);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as echarts from '../../core/echarts.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar ATTR = '\\0_ec_interaction_mutex';\nexport function take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\nexport function release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\nexport function isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\r\n * payload: {\r\n * type: 'takeGlobalCursor',\r\n * key: 'dataZoomSelect', or 'brush', or ...,\r\n * If no userKey, release global cursor.\r\n * }\r\n */\n// TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, noop);","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport { isString, bind, defaults, clone } from 'zrender/lib/core/util.js';\n;\n\nvar RoamController =\n/** @class */\nfunction (_super) {\n __extends(RoamController, _super);\n\n function RoamController(zr) {\n var _this = _super.call(this) || this;\n\n _this._zr = zr; // Avoid two roamController bind the same handler\n\n var mousedownHandler = bind(_this._mousedownHandler, _this);\n var mousemoveHandler = bind(_this._mousemoveHandler, _this);\n var mouseupHandler = bind(_this._mouseupHandler, _this);\n var mousewheelHandler = bind(_this._mousewheelHandler, _this);\n var pinchHandler = bind(_this._pinchHandler, _this);\n /**\r\n * Notice: only enable needed types. For example, if 'zoom'\r\n * is not needed, 'zoom' should not be enabled, otherwise\r\n * default mousewheel behaviour (scroll page) will be disabled.\r\n */\n\n _this.enable = function (controlType, opt) {\n // Disable previous first\n this.disable();\n this._opt = defaults(clone(opt) || {}, {\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n // By default, wheel do not trigger move.\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n\n if (controlType == null) {\n controlType = true;\n }\n\n if (controlType === true || controlType === 'move' || controlType === 'pan') {\n zr.on('mousedown', mousedownHandler);\n zr.on('mousemove', mousemoveHandler);\n zr.on('mouseup', mouseupHandler);\n }\n\n if (controlType === true || controlType === 'scale' || controlType === 'zoom') {\n zr.on('mousewheel', mousewheelHandler);\n zr.on('pinch', pinchHandler);\n }\n };\n\n _this.disable = function () {\n zr.off('mousedown', mousedownHandler);\n zr.off('mousemove', mousemoveHandler);\n zr.off('mouseup', mouseupHandler);\n zr.off('mousewheel', mousewheelHandler);\n zr.off('pinch', pinchHandler);\n };\n\n return _this;\n }\n\n RoamController.prototype.isDragging = function () {\n return this._dragging;\n };\n\n RoamController.prototype.isPinching = function () {\n return this._pinching;\n };\n\n RoamController.prototype.setPointerChecker = function (pointerChecker) {\n this.pointerChecker = pointerChecker;\n };\n\n RoamController.prototype.dispose = function () {\n this.disable();\n };\n\n RoamController.prototype._mousedownHandler = function (e) {\n if (eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n return;\n }\n\n var el = e.target;\n\n while (el) {\n if (el.draggable) {\n return;\n } // check if host is draggable\n\n\n el = el.__hostTarget || el.parent;\n }\n\n var x = e.offsetX;\n var y = e.offsetY; // Only check on mosedown, but not mousemove.\n // Mouse can be out of target when mouse moving.\n\n if (this.pointerChecker && this.pointerChecker(e, x, y)) {\n this._x = x;\n this._y = y;\n this._dragging = true;\n }\n };\n\n RoamController.prototype._mousemoveHandler = function (e) {\n if (!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || e.gestureEvent === 'pinch' || interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var x = e.offsetX;\n var y = e.offsetY;\n var oldX = this._x;\n var oldY = this._y;\n var dx = x - oldX;\n var dy = y - oldY;\n this._x = x;\n this._y = y;\n this._opt.preventDefaultMouseMove && eventTool.stop(e.event);\n trigger(this, 'pan', 'moveOnMouseMove', e, {\n dx: dx,\n dy: dy,\n oldX: oldX,\n oldY: oldY,\n newX: x,\n newY: y,\n isAvailableBehavior: null\n });\n };\n\n RoamController.prototype._mouseupHandler = function (e) {\n if (!eventTool.isMiddleOrRightButtonOnMouseUpDown(e)) {\n this._dragging = false;\n }\n };\n\n RoamController.prototype._mousewheelHandler = function (e) {\n var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt);\n var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt);\n var wheelDelta = e.wheelDelta;\n var absWheelDeltaDelta = Math.abs(wheelDelta);\n var originX = e.offsetX;\n var originY = e.offsetY; // wheelDelta maybe -0 in chrome mac.\n\n if (wheelDelta === 0 || !shouldZoom && !shouldMove) {\n return;\n } // If both `shouldZoom` and `shouldMove` is true, trigger\n // their event both, and the final behavior is determined\n // by event listener themselves.\n\n\n if (shouldZoom) {\n // Convenience:\n // Mac and VM Windows on Mac: scroll up: zoom out.\n // Windows: scroll up: zoom in.\n // FIXME: Should do more test in different environment.\n // wheelDelta is too complicated in difference nvironment\n // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel),\n // although it has been normallized by zrender.\n // wheelDelta of mouse wheel is bigger than touch pad.\n var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;\n var scale = wheelDelta > 0 ? factor : 1 / factor;\n checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, {\n scale: scale,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n\n if (shouldMove) {\n // FIXME: Should do more test in different environment.\n var absDelta = Math.abs(wheelDelta); // wheelDelta of mouse wheel is bigger than touch pad.\n\n var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);\n checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, {\n scrollDelta: scrollDelta,\n originX: originX,\n originY: originY,\n isAvailableBehavior: null\n });\n }\n };\n\n RoamController.prototype._pinchHandler = function (e) {\n if (interactionMutex.isTaken(this._zr, 'globalPan')) {\n return;\n }\n\n var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;\n checkPointerAndTrigger(this, 'zoom', null, e, {\n scale: scale,\n originX: e.pinchX,\n originY: e.pinchY,\n isAvailableBehavior: null\n });\n };\n\n return RoamController;\n}(Eventful);\n\nfunction checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n if (controller.pointerChecker && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY)) {\n // When mouse is out of roamController rect,\n // default befavoius should not be be disabled, otherwise\n // page sliding is disabled, contrary to expectation.\n eventTool.stop(e.event);\n trigger(controller, eventName, behaviorToCheck, e, contollerEvent);\n }\n}\n\nfunction trigger(controller, eventName, behaviorToCheck, e, contollerEvent) {\n // Also provide behavior checker for event listener, for some case that\n // multiple components share one listener.\n contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); // TODO should not have type issue.\n\n controller.trigger(eventName, contollerEvent);\n} // settings: {\n// zoomOnMouseWheel\n// moveOnMouseMove\n// moveOnMouseWheel\n// }\n// The value can be: true / false / 'shift' / 'ctrl' / 'alt'.\n\n\nfunction isAvailableBehavior(behaviorToCheck, e, settings) {\n var setting = settings[behaviorToCheck];\n return !behaviorToCheck || setting && (!isString(setting) || e.event[setting + 'Key']);\n}\n\nexport default RoamController;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * For geo and graph.\r\n */\nexport function updateViewOnPan(controllerHost, dx, dy) {\n var target = controllerHost.target;\n target.x += dx;\n target.y += dy;\n target.dirty();\n}\n/**\r\n * For geo and graph.\r\n */\n\nexport function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {\n var target = controllerHost.target;\n var zoomLimit = controllerHost.zoomLimit;\n var newZoom = controllerHost.zoom = controllerHost.zoom || 1;\n newZoom *= zoomDelta;\n\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);\n }\n\n var zoomScale = newZoom / controllerHost.zoom;\n controllerHost.zoom = newZoom; // Keep the mouse center when scaling\n\n target.x -= (zoomX - target.x) * (zoomScale - 1);\n target.y -= (zoomY - target.y) * (zoomScale - 1);\n target.scaleX *= zoomScale;\n target.scaleY *= zoomScale;\n target.dirty();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar IRRELEVANT_EXCLUDES = {\n 'axisPointer': 1,\n 'tooltip': 1,\n 'brush': 1\n};\n/**\r\n * Avoid that: mouse click on a elements that is over geo or graph,\r\n * but roam is triggered.\r\n */\n\nexport function onIrrelevantElement(e, api, targetCoordSysModel) {\n var model = api.getComponentByElement(e.topTarget); // If model is axisModel, it works only if it is injected with coordinateSystem.\n\n var coordSys = model && model.coordinateSystem;\n return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;\n}","import Group from '../graphic/Group.js';\nimport ZRImage from '../graphic/Image.js';\nimport Circle from '../graphic/shape/Circle.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Ellipse from '../graphic/shape/Ellipse.js';\nimport Line from '../graphic/shape/Line.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Polyline from '../graphic/shape/Polyline.js';\nimport * as matrix from '../core/matrix.js';\nimport { createFromString } from './path.js';\nimport { defaults, trim, each, map, keys, hasOwn } from '../core/util.js';\nimport LinearGradient from '../graphic/LinearGradient.js';\nimport RadialGradient from '../graphic/RadialGradient.js';\nimport TSpan from '../graphic/TSpan.js';\nimport { parseXML } from './parseXML.js';\n;\nvar nodeParsers;\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-anchor': 'textAlign',\n 'visibility': 'visibility',\n 'display': 'display'\n};\nvar INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys(INHERITABLE_STYLE_ATTRIBUTES_MAP);\nvar SELF_STYLE_ATTRIBUTES_MAP = {\n 'alignment-baseline': 'textBaseline',\n 'stop-color': 'stopColor'\n};\nvar SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys(SELF_STYLE_ATTRIBUTES_MAP);\nvar SVGParser = (function () {\n function SVGParser() {\n this._defs = {};\n this._root = null;\n }\n SVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n if (process.env.NODE_ENV !== 'production') {\n if (!svg) {\n throw new Error('Illegal svg');\n }\n }\n this._defsUsePending = [];\n var root = new Group();\n this._root = root;\n var named = [];\n var viewBox = svg.getAttribute('viewBox') || '';\n var width = parseFloat((svg.getAttribute('width') || opt.width));\n var height = parseFloat((svg.getAttribute('height') || opt.height));\n isNaN(width) && (width = null);\n isNaN(height) && (height = null);\n parseAttributes(svg, root, null, true, false);\n var child = svg.firstChild;\n while (child) {\n this._parseNode(child, root, named, null, false, false);\n child = child.nextSibling;\n }\n applyDefs(this._defs, this._defsUsePending);\n this._defsUsePending = [];\n var viewBoxRect;\n var viewBoxTransform;\n if (viewBox) {\n var viewBoxArr = splitNumberSequence(viewBox);\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat((viewBoxArr[0] || 0)),\n y: parseFloat((viewBoxArr[1] || 0)),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width: width, height: height });\n if (!opt.ignoreViewBox) {\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;\n elRoot.x = viewBoxTransform.x;\n elRoot.y = viewBoxTransform.y;\n }\n }\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: { x: 0, y: 0, width: width, height: height }\n }));\n }\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform,\n named: named\n };\n };\n SVGParser.prototype._parseNode = function (xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {\n var nodeName = xmlNode.nodeName.toLowerCase();\n var el;\n var namedFromForSub = namedFrom;\n if (nodeName === 'defs') {\n isInDefs = true;\n }\n if (nodeName === 'text') {\n isInText = true;\n }\n if (nodeName === 'defs' || nodeName === 'switch') {\n el = parentGroup;\n }\n else {\n if (!isInDefs) {\n var parser_1 = nodeParsers[nodeName];\n if (parser_1 && hasOwn(nodeParsers, nodeName)) {\n el = parser_1.call(this, xmlNode, parentGroup);\n var nameAttr = xmlNode.getAttribute('name');\n if (nameAttr) {\n var newNamed = {\n name: nameAttr,\n namedFrom: null,\n svgNodeTagLower: nodeName,\n el: el\n };\n named.push(newNamed);\n if (nodeName === 'g') {\n namedFromForSub = newNamed;\n }\n }\n else if (namedFrom) {\n named.push({\n name: namedFrom.name,\n namedFrom: namedFrom,\n svgNodeTagLower: nodeName,\n el: el\n });\n }\n parentGroup.add(el);\n }\n }\n var parser = paintServerParsers[nodeName];\n if (parser && hasOwn(paintServerParsers, nodeName)) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n if (id) {\n this._defs[id] = def;\n }\n }\n }\n if (el && el.isGroup) {\n var child = xmlNode.firstChild;\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);\n }\n else if (child.nodeType === 3 && isInText) {\n this._parseText(child, el);\n }\n child = child.nextSibling;\n }\n }\n };\n SVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n var text = new TSpan({\n style: {\n text: xmlNode.textContent\n },\n silent: true,\n x: this._textX || 0,\n y: this._textY || 0\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defsUsePending, false, false);\n applyTextAlignment(text, parentGroup);\n var textStyle = text.style;\n var fontSize = textStyle.fontSize;\n if (fontSize && fontSize < 9) {\n textStyle.fontSize = 9;\n text.scaleX *= fontSize / 9;\n text.scaleY *= fontSize / 9;\n }\n var font = (textStyle.fontSize || textStyle.fontFamily) && [\n textStyle.fontStyle,\n textStyle.fontWeight,\n (textStyle.fontSize || 12) + 'px',\n textStyle.fontFamily || 'sans-serif'\n ].join(' ');\n textStyle.font = font;\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n };\n SVGParser.internalField = (function () {\n nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, false);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defsUsePending, false, false);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || '0'),\n y: parseFloat(xmlNode.getAttribute('y') || '0'),\n width: parseFloat(xmlNode.getAttribute('width') || '0'),\n height: parseFloat(xmlNode.getAttribute('height') || '0')\n });\n rect.silent = true;\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defsUsePending, false, false);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n r: parseFloat(xmlNode.getAttribute('r') || '0')\n });\n circle.silent = true;\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defsUsePending, false, false);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || '0'),\n y1: parseFloat(xmlNode.getAttribute('y1') || '0'),\n x2: parseFloat(xmlNode.getAttribute('x2') || '0'),\n y2: parseFloat(xmlNode.getAttribute('y2') || '0')\n });\n line.silent = true;\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || '0'),\n cy: parseFloat(xmlNode.getAttribute('cy') || '0'),\n rx: parseFloat(xmlNode.getAttribute('rx') || '0'),\n ry: parseFloat(xmlNode.getAttribute('ry') || '0')\n });\n ellipse.silent = true;\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polygon = new Polygon({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var pointsStr = xmlNode.getAttribute('points');\n var pointsArr;\n if (pointsStr) {\n pointsArr = parsePoints(pointsStr);\n }\n var polyline = new Polyline({\n shape: {\n points: pointsArr || []\n },\n silent: true\n });\n inheritStyle(parentGroup, polyline);\n parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZRImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defsUsePending, false, false);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href') || xmlNode.getAttribute('href'),\n x: +xmlNode.getAttribute('x'),\n y: +xmlNode.getAttribute('y'),\n width: +xmlNode.getAttribute('width'),\n height: +xmlNode.getAttribute('height')\n });\n img.silent = true;\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || '0';\n var y = xmlNode.getAttribute('y') || '0';\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n if (x != null) {\n this._textX = parseFloat(x);\n }\n if (y != null) {\n this._textY = parseFloat(y);\n }\n var dx = xmlNode.getAttribute('dx') || '0';\n var dy = xmlNode.getAttribute('dy') || '0';\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defsUsePending, false, true);\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n var d = xmlNode.getAttribute('d') || '';\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defsUsePending, false, false);\n path.silent = true;\n return path;\n }\n };\n })();\n return SVGParser;\n}());\nvar paintServerParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || '0', 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || '0', 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || '10', 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || '0', 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n },\n 'radialgradient': function (xmlNode) {\n var cx = parseInt(xmlNode.getAttribute('cx') || '0', 10);\n var cy = parseInt(xmlNode.getAttribute('cy') || '0', 10);\n var r = parseInt(xmlNode.getAttribute('r') || '0', 10);\n var gradient = new RadialGradient(cx, cy, r);\n parsePaintServerUnit(xmlNode, gradient);\n parseGradientColorStops(xmlNode, gradient);\n return gradient;\n }\n};\nfunction parsePaintServerUnit(xmlNode, gradient) {\n var gradientUnits = xmlNode.getAttribute('gradientUnits');\n if (gradientUnits === 'userSpaceOnUse') {\n gradient.global = true;\n }\n}\nfunction parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n while (stop) {\n if (stop.nodeType === 1\n && stop.nodeName.toLocaleLowerCase() === 'stop') {\n var offsetStr = stop.getAttribute('offset');\n var offset = void 0;\n if (offsetStr && offsetStr.indexOf('%') > 0) {\n offset = parseInt(offsetStr, 10) / 100;\n }\n else if (offsetStr) {\n offset = parseFloat(offsetStr);\n }\n else {\n offset = 0;\n }\n var styleVals = {};\n parseInlineStyle(stop, styleVals, styleVals);\n var stopColor = styleVals.stopColor\n || stop.getAttribute('stop-color')\n || '#000000';\n gradient.colorStops.push({\n offset: offset,\n color: stopColor\n });\n }\n stop = stop.nextSibling;\n }\n}\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\nfunction parsePoints(pointsString) {\n var list = splitNumberSequence(pointsString);\n var points = [];\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n return points;\n}\nfunction parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {\n var disp = el;\n var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};\n var selfStyle = {};\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n parseInlineStyle(xmlNode, inheritedStyle, selfStyle);\n if (!onlyInlineStyle) {\n parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);\n }\n }\n disp.style = disp.style || {};\n if (inheritedStyle.fill != null) {\n disp.style.fill = getFillStrokeStyle(disp, 'fill', inheritedStyle.fill, defsUsePending);\n }\n if (inheritedStyle.stroke != null) {\n disp.style.stroke = getFillStrokeStyle(disp, 'stroke', inheritedStyle.stroke, defsUsePending);\n }\n each([\n 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = parseFloat(inheritedStyle[propName]);\n }\n });\n each([\n 'lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign'\n ], function (propName) {\n if (inheritedStyle[propName] != null) {\n disp.style[propName] = inheritedStyle[propName];\n }\n });\n if (isTextGroup) {\n disp.__selfStyle = selfStyle;\n }\n if (inheritedStyle.lineDash) {\n disp.style.lineDash = map(splitNumberSequence(inheritedStyle.lineDash), function (str) {\n return parseFloat(str);\n });\n }\n if (inheritedStyle.visibility === 'hidden' || inheritedStyle.visibility === 'collapse') {\n disp.invisible = true;\n }\n if (inheritedStyle.display === 'none') {\n disp.ignore = true;\n }\n}\nfunction applyTextAlignment(text, parentGroup) {\n var parentSelfStyle = parentGroup.__selfStyle;\n if (parentSelfStyle) {\n var textBaseline = parentSelfStyle.textBaseline;\n var zrTextBaseline = textBaseline;\n if (!textBaseline || textBaseline === 'auto') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'baseline') {\n zrTextBaseline = 'alphabetic';\n }\n else if (textBaseline === 'before-edge' || textBaseline === 'text-before-edge') {\n zrTextBaseline = 'top';\n }\n else if (textBaseline === 'after-edge' || textBaseline === 'text-after-edge') {\n zrTextBaseline = 'bottom';\n }\n else if (textBaseline === 'central' || textBaseline === 'mathematical') {\n zrTextBaseline = 'middle';\n }\n text.style.textBaseline = zrTextBaseline;\n }\n var parentInheritedStyle = parentGroup.__inheritedStyle;\n if (parentInheritedStyle) {\n var textAlign = parentInheritedStyle.textAlign;\n var zrTextAlign = textAlign;\n if (textAlign) {\n if (textAlign === 'middle') {\n zrTextAlign = 'center';\n }\n text.style.textAlign = zrTextAlign;\n }\n }\n}\nvar urlRegex = /^url\\(\\s*#(.*?)\\)/;\nfunction getFillStrokeStyle(el, method, str, defsUsePending) {\n var urlMatch = str && str.match(urlRegex);\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n defsUsePending.push([el, method, url]);\n return;\n }\n if (str === 'none') {\n str = null;\n }\n return str;\n}\nfunction applyDefs(defs, defsUsePending) {\n for (var i = 0; i < defsUsePending.length; i++) {\n var item = defsUsePending[i];\n item[0].style[item[1]] = defs[item[2]];\n }\n}\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g;\nfunction splitNumberSequence(rawStr) {\n return rawStr.match(numberReg) || [];\n}\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.eE,]*)\\)/g;\nvar DEGREE_TO_ANGLE = Math.PI / 180;\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var transformOps_1 = [];\n var mt = null;\n transform.replace(transformRegex, function (str, type, value) {\n transformOps_1.push(type, value);\n return '';\n });\n for (var i = transformOps_1.length - 1; i > 0; i -= 2) {\n var value = transformOps_1[i];\n var type = transformOps_1[i - 1];\n var valueArr = splitNumberSequence(value);\n mt = mt || matrix.create();\n switch (type) {\n case 'translate':\n matrix.translate(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || '0')]);\n break;\n case 'scale':\n matrix.scale(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);\n break;\n case 'rotate':\n matrix.rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n break;\n case 'skewX':\n var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, 0, sx, 1, 0, 0], mt);\n break;\n case 'skewY':\n var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);\n matrix.mul(mt, [1, sy, 0, 1, 0, 0], mt);\n break;\n case 'matrix':\n mt[0] = parseFloat(valueArr[0]);\n mt[1] = parseFloat(valueArr[1]);\n mt[2] = parseFloat(valueArr[2]);\n mt[3] = parseFloat(valueArr[3]);\n mt[4] = parseFloat(valueArr[4]);\n mt[5] = parseFloat(valueArr[5]);\n break;\n }\n }\n node.setLocalTransform(mt);\n }\n}\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\nfunction parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n var style = xmlNode.getAttribute('style');\n if (!style) {\n return;\n }\n styleRegex.lastIndex = 0;\n var styleRegResult;\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n var svgStlAttr = styleRegResult[1];\n var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrInheritableStlAttr) {\n inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];\n }\n var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr)\n ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr]\n : null;\n if (zrSelfStlAttr) {\n selfStyleResult[zrSelfStlAttr] = styleRegResult[2];\n }\n }\n}\nfunction parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {\n for (var i = 0; i < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n for (var i = 0; i < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i++) {\n var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i];\n var attrValue = xmlNode.getAttribute(svgAttrName);\n if (attrValue != null) {\n selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;\n }\n }\n}\nexport function makeViewBoxTransform(viewBoxRect, boundingRect) {\n var scaleX = boundingRect.width / viewBoxRect.width;\n var scaleY = boundingRect.height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY);\n return {\n scale: scale,\n x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale + (boundingRect.x + boundingRect.width / 2),\n y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale + (boundingRect.y + boundingRect.height / 2)\n };\n}\nexport function parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\nexport { parseXML };\n","import { isString } from '../core/util.js';\nexport function parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n }\n var svgNode = svg;\n if (svgNode.nodeType === 9) {\n svgNode = svgNode.firstChild;\n }\n while (svgNode.nodeName.toLowerCase() !== 'svg' || svgNode.nodeType !== 1) {\n svgNode = svgNode.nextSibling;\n }\n return svgNode;\n}\n","import windingLine from './windingLine.js';\nvar EPSILON = 1e-8;\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\nexport function contain(points, x, y) {\n var w = 0;\n var p = points[0];\n if (!p) {\n return false;\n }\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n }\n var p0 = points[0];\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n return w !== 0;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport { each } from 'zrender/lib/core/util.js';\nvar TMP_TRANSFORM = [];\n\nfunction transformPoints(points, transform) {\n for (var p = 0; p < points.length; p++) {\n vec2.applyTransform(points[p], points[p], transform);\n }\n}\n\nfunction updateBBoxFromPoints(points, min, max, projection) {\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n\n if (projection) {\n // projection may return null point.\n p = projection.project(p);\n }\n\n if (p && isFinite(p[0]) && isFinite(p[1])) {\n vec2.min(min, min, p);\n vec2.max(max, max, p);\n }\n }\n}\n\nfunction centroid(points) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = points.length;\n var x0 = points[len - 1][0];\n var y0 = points[len - 1][1]; // Polygon should been closed.\n\n for (var i = 0; i < len; i++) {\n var x1 = points[i][0];\n var y1 = points[i][1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n x0 = x1;\n y0 = y1;\n }\n\n return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points[0][0] || 0, points[0][1] || 0];\n}\n\nvar Region =\n/** @class */\nfunction () {\n function Region(name) {\n this.name = name;\n }\n\n Region.prototype.setCenter = function (center) {\n this._center = center;\n };\n /**\r\n * Get center point in data unit. That is,\r\n * for GeoJSONRegion, the unit is lat/lng,\r\n * for GeoSVGRegion, the unit is SVG local coord.\r\n */\n\n\n Region.prototype.getCenter = function () {\n var center = this._center;\n\n if (!center) {\n // In most cases there are no need to calculate this center.\n // So calculate only when called.\n center = this._center = this.calcCenter();\n }\n\n return center;\n };\n\n return Region;\n}();\n\nexport { Region };\n\nvar GeoJSONPolygonGeometry =\n/** @class */\nfunction () {\n function GeoJSONPolygonGeometry(exterior, interiors) {\n this.type = 'polygon';\n this.exterior = exterior;\n this.interiors = interiors;\n }\n\n return GeoJSONPolygonGeometry;\n}();\n\nexport { GeoJSONPolygonGeometry };\n\nvar GeoJSONLineStringGeometry =\n/** @class */\nfunction () {\n function GeoJSONLineStringGeometry(points) {\n this.type = 'linestring';\n this.points = points;\n }\n\n return GeoJSONLineStringGeometry;\n}();\n\nexport { GeoJSONLineStringGeometry };\n\nvar GeoJSONRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoJSONRegion, _super);\n\n function GeoJSONRegion(name, geometries, cp) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoJSON';\n _this.geometries = geometries;\n _this._center = cp && [cp[0], cp[1]];\n return _this;\n }\n\n GeoJSONRegion.prototype.calcCenter = function () {\n var geometries = this.geometries;\n var largestGeo;\n var largestGeoSize = 0;\n\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n var exterior = geo.exterior; // Simple trick to use points count instead of polygon area as region size.\n // Ignore linestring\n\n var size = exterior && exterior.length;\n\n if (size > largestGeoSize) {\n largestGeo = geo;\n largestGeoSize = size;\n }\n }\n\n if (largestGeo) {\n return centroid(largestGeo.exterior);\n } // from bounding rect by default.\n\n\n var rect = this.getBoundingRect();\n return [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.getBoundingRect = function (projection) {\n var rect = this._rect; // Always recalculate if using projection.\n\n if (rect && !projection) {\n return rect;\n }\n\n var min = [Infinity, Infinity];\n var max = [-Infinity, -Infinity];\n var geometries = this.geometries;\n each(geometries, function (geo) {\n if (geo.type === 'polygon') {\n // Doesn't consider hole\n updateBBoxFromPoints(geo.exterior, min, max, projection);\n } else {\n each(geo.points, function (points) {\n updateBBoxFromPoints(points, min, max, projection);\n });\n }\n }); // Normalie invalid bounding.\n\n if (!(isFinite(min[0]) && isFinite(min[1]) && isFinite(max[0]) && isFinite(max[1]))) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n\n if (!projection) {\n this._rect = rect;\n }\n\n return rect;\n };\n\n GeoJSONRegion.prototype.contain = function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n var geo = geometries[i]; // Only support polygon.\n\n if (geo.type !== 'polygon') {\n continue;\n }\n\n var exterior = geo.exterior;\n var interiors = geo.interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n };\n /**\r\n * Transform the raw coords to target bounding.\r\n * @param x\r\n * @param y\r\n * @param width\r\n * @param height\r\n */\n\n\n GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n var geo = geometries[i];\n\n if (geo.type === 'polygon') {\n transformPoints(geo.exterior, transform);\n each(geo.interiors, function (interior) {\n transformPoints(interior, transform);\n });\n } else {\n each(geo.points, function (points) {\n transformPoints(points, transform);\n });\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.cloneShallow = function (name) {\n name == null && (name = this.name);\n var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n };\n\n return GeoJSONRegion;\n}(Region);\n\nexport { GeoJSONRegion };\n\nvar GeoSVGRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoSVGRegion, _super);\n\n function GeoSVGRegion(name, elOnlyForCalculate) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoSVG';\n _this._elOnlyForCalculate = elOnlyForCalculate;\n return _this;\n }\n\n GeoSVGRegion.prototype.calcCenter = function () {\n var el = this._elOnlyForCalculate;\n var rect = el.getBoundingRect();\n var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n var mat = matrix.identity(TMP_TRANSFORM);\n var target = el;\n\n while (target && !target.isGeoSVGGraphicRoot) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n matrix.invert(mat, mat);\n vec2.applyTransform(center, center, mat);\n return center;\n };\n\n return GeoSVGRegion;\n}(Region);\n\nexport { GeoSVGRegion };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG.js';\nimport Group from 'zrender/lib/graphic/Group.js';\nimport Rect from 'zrender/lib/graphic/shape/Rect.js';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parseXML } from 'zrender/lib/tool/parseXML.js';\nimport { GeoSVGRegion } from './Region.js';\n/**\r\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\r\n * to make it be a region.\r\n * 1. region styles and its label styles can be defined in echarts opton:\r\n * ```js\r\n * geo: {\r\n * regions: [{\r\n * name: 'xxx',\r\n * itemStyle: { ... },\r\n * label: { ... }\r\n * }, {\r\n * ...\r\n * },\r\n * ...]\r\n * };\r\n * ```\r\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\r\n * a region option. For exampel if there are two representing two lung lobes. They have\r\n * no common parents but both of them need to display label \"lung\" inside.\r\n */\n\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', // are also enabled because some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan', // is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a . Thereby only one label\n// displayed and located based on the bounding rect of the .\n'g']);\n\nvar GeoSVGResource =\n/** @class */\nfunction () {\n function GeoSVGResource(mapName, svg) {\n this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root\n\n this._usedGraphicMap = createHashMap(); // All unused graphics.\n\n this._freedGraphics = [];\n this._mapName = mapName; // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n\n this._parsedXML = parseXML(svg);\n }\n\n GeoSVGResource.prototype.load = function ()\n /* nameMap: NameMap */\n {\n // In the \"load\" stage, graphic need to be built to\n // get boundingRect for geo coordinate system.\n var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created.\n // Because they will be used in geo coordinate system update stage,\n // and `regions` will be mounted at `geo` coordinate system,\n // in which there is no \"view\" info, so that it should better not to\n // make references to graphic elements.\n\n if (!firstGraphic) {\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n\n this._freedGraphics.push(firstGraphic);\n\n this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come.\n // if (nameMap) {\n // named = applyNameMap(named, nameMap);\n // }\n\n var _a = createRegions(firstGraphic.named),\n regions = _a.regions,\n regionsMap = _a.regionsMap;\n\n this._regions = regions;\n this._regionsMap = regionsMap;\n }\n\n return {\n boundingRect: this._boundingRect,\n regions: this._regions,\n regionsMap: this._regionsMap\n };\n };\n\n GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n var result;\n var rootFromParse;\n\n try {\n result = svgXML && parseSVG(svgXML, {\n ignoreViewBox: true,\n ignoreRootClip: true\n }) || {};\n rootFromParse = result.root;\n assert(rootFromParse != null);\n } catch (e) {\n throw new Error('Invalid svg format\\n' + e.message);\n } // Note: we keep the covenant that the root has no transform. So always add an extra root.\n\n\n var root = new Group();\n root.add(rootFromParse);\n root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n //\n // Consider: ``\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n // \"viewport boundingRect\", or `boundingRect` for short.\n // - `viewBox` defines the transform from the real content ot the viewport.\n // `viewBox` has the same unit as the content of SVG.\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n // different from the content of SVG. Otherwise, they are the same.\n //\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n // 1. Make a transform from `viewBox` to `boundingRect`.\n // Note: only support `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n // the aspect ratio.\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n // (`Geo`/`View` will do this job).\n // Note: this transform might not preserve aspect radio, which depending on how users specify\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n //\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n // layout look good.\n //\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n // of the SVG content and use them to make SVG layout look good.\n\n var svgWidth = result.width;\n var svgHeight = result.height;\n var viewBoxRect = result.viewBoxRect;\n var boundingRect = this._boundingRect;\n\n if (!boundingRect) {\n var bRectX = void 0;\n var bRectY = void 0;\n var bRectWidth = void 0;\n var bRectHeight = void 0;\n\n if (svgWidth != null) {\n bRectX = 0;\n bRectWidth = svgWidth;\n } else if (viewBoxRect) {\n bRectX = viewBoxRect.x;\n bRectWidth = viewBoxRect.width;\n }\n\n if (svgHeight != null) {\n bRectY = 0;\n bRectHeight = svgHeight;\n } else if (viewBoxRect) {\n bRectY = viewBoxRect.y;\n bRectHeight = viewBoxRect.height;\n } // If both viewBox and svgWidth/svgHeight not specified,\n // we have to determine how to layout those element to make them look good.\n\n\n if (bRectX == null || bRectY == null) {\n var calculatedBoundingRect = rootFromParse.getBoundingRect();\n\n if (bRectX == null) {\n bRectX = calculatedBoundingRect.x;\n bRectWidth = calculatedBoundingRect.width;\n }\n\n if (bRectY == null) {\n bRectY = calculatedBoundingRect.y;\n bRectHeight = calculatedBoundingRect.height;\n }\n }\n\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n }\n\n if (viewBoxRect) {\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'`\n\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n rootFromParse.x = viewBoxTransform.x;\n rootFromParse.y = viewBoxTransform.y;\n } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n // They do not strictly confine all of the content inside a display rect, but deliberately\n // use a `viewBox` to define a displayable rect.\n // PENDING:\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n\n\n root.setClipPath(new Rect({\n shape: boundingRect.plain()\n }));\n var named = [];\n each(result.named, function (namedItem) {\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n named.push(namedItem);\n setSilent(namedItem.el);\n }\n });\n return {\n root: root,\n boundingRect: boundingRect,\n named: named\n };\n };\n /**\r\n * Consider:\r\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\r\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\r\n * (2) Converting SVG to graphic elements is time consuming.\r\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\r\n * and it is called without view info.\r\n * So we maintain graphic elements in this module, and enables `view` to use/return these\r\n * graphics from/to the pool with it's uid.\r\n */\n\n\n GeoSVGResource.prototype.useGraphic = function (hostKey\n /* , nameMap: NameMap */\n ) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n return svgGraphic;\n }\n\n svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation.\n || this._buildGraphic(this._parsedXML);\n usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come.\n // `nameMap` can only be obtained from echarts option.\n // The original `named` must not be modified.\n // if (nameMap) {\n // svgGraphic = extend({}, svgGraphic);\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n // }\n\n return svgGraphic;\n };\n\n GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n usedRootMap.removeKey(hostKey);\n\n this._freedGraphics.push(svgGraphic);\n }\n };\n\n return GeoSVGResource;\n}();\n\nexport { GeoSVGResource };\n\nfunction setSilent(el) {\n // Only named element has silent: false, other elements should\n // act as background and has no user interaction.\n el.silent = false; // text|tspan will be converted to group.\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.silent = false;\n });\n }\n}\n\nfunction createRegions(named) {\n var regions = [];\n var regionsMap = createHashMap(); // Create resions only for the first graphic.\n\n each(named, function (namedItem) {\n // Region has feature to calculate center for tooltip or other features.\n // If there is a , the center should be the center of the\n // bounding rect of the g.\n if (namedItem.namedFrom != null) {\n return;\n }\n\n var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on\n // `this`, but can only be created each time `load()` called.\n\n regions.push(region); // PENDING: if multiple tag named with the same name, only one will be\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n // by name. We use `region.getCenter()` as the coordinate.\n\n regionsMap.set(namedItem.name, region);\n });\n return {\n regions: regions,\n regionsMap: regionsMap\n };\n} // PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n// * Use the alias in geoNameMap.\n// * The input `named` must not be modified.\n// */\n// function applyNameMap(\n// named: GeoSVGGraphicRecord['named'],\n// nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n// const result = [] as GeoSVGGraphicRecord['named'];\n// for (let i = 0; i < named.length; i++) {\n// let regionGraphic = named[i];\n// const name = regionGraphic.name;\n// if (nameMap && nameMap.hasOwnProperty(name)) {\n// regionGraphic = extend({}, regionGraphic);\n// regionGraphic.name = name;\n// }\n// result.push(regionGraphic);\n// }\n// return result;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parse and decode geo json\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONLineStringGeometry, GeoJSONPolygonGeometry, GeoJSONRegion } from './Region.js';\n\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var jsonCompressed = json;\n var encodeScale = jsonCompressed.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = jsonCompressed.features;\n zrUtil.each(features, function (feature) {\n var geometry = feature.geometry;\n var encodeOffsets = geometry.encodeOffsets;\n var coordinates = geometry.coordinates; // Geometry may be appeded manually in the script after json loaded.\n // In this case this geometry is usually not encoded.\n\n if (!encodeOffsets) {\n return;\n }\n\n switch (geometry.type) {\n case 'LineString':\n geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'Polygon':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'MultiLineString':\n decodeRings(coordinates, encodeOffsets, encodeScale);\n break;\n\n case 'MultiPolygon':\n zrUtil.each(coordinates, function (rings, idx) {\n return decodeRings(rings, encodeOffsets[idx], encodeScale);\n });\n }\n }); // Has been decoded\n\n jsonCompressed.UTF8Encoding = false;\n return jsonCompressed;\n}\n\nfunction decodeRings(rings, encodeOffsets, encodeScale) {\n for (var c = 0; c < rings.length; c++) {\n rings[c] = decodeRing(rings[c], encodeOffsets[c], encodeScale);\n }\n}\n\nfunction decodeRing(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n\nexport default function parseGeoJSON(geoJson, nameProperty) {\n geoJson = decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var geometries = [];\n\n switch (geo.type) {\n case 'Polygon':\n var coordinates = geo.coordinates; // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n\n geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));\n break;\n\n case 'MultiPolygon':\n zrUtil.each(geo.coordinates, function (item) {\n if (item[0]) {\n geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));\n }\n });\n break;\n\n case 'LineString':\n geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));\n break;\n\n case 'MultiLineString':\n geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));\n }\n\n var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { GeoJSONRegion } from '../Region.js';\nvar geoCoord = [126, 25];\nvar nanhaiName = '南海诸岛';\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\n\nfor (var i = 0; i < points.length; i++) {\n for (var k = 0; k < points[i].length; k++) {\n points[i][k][0] /= 10.5;\n points[i][k][1] /= -10.5 / 0.75;\n points[i][k][0] += geoCoord[0];\n points[i][k][1] += geoCoord[1];\n }\n}\n\nexport default function fixNanhai(mapType, regions) {\n if (mapType === 'china') {\n for (var i = 0; i < regions.length; i++) {\n // Already exists.\n if (regions[i].name === nanhaiName) {\n return;\n }\n }\n\n regions.push(new GeoJSONRegion(nanhaiName, zrUtil.map(points, function (exterior) {\n return {\n type: 'polygon',\n exterior: exterior\n };\n }), geoCoord));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar coordsOffsetMap = {\n '南海诸岛': [32, 80],\n // 全国\n '广东': [0, -10],\n '香港': [10, 5],\n '澳门': [-10, 10],\n // '北京': [-10, 0],\n '天津': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n if (mapType === 'china') {\n var coordFix = coordsOffsetMap[region.name];\n\n if (coordFix) {\n var cp = region.getCenter();\n cp[0] += coordFix[0] / 10.5;\n cp[1] += -coordFix[1] / (10.5 / 0.75);\n region.setCenter(cp);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Fix for 钓鱼岛\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n if (mapType === 'china' && region.name === '台湾') {\n region.geometries.push({\n type: 'polygon',\n exterior: points[0]\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, isString, createHashMap, hasOwn } from 'zrender/lib/core/util.js';\nimport parseGeoJson from './parseGeoJson.js'; // Built-in GEO fixer.\n\nimport fixNanhai from './fix/nanhai.js';\nimport fixTextCoord from './fix/textCoord.js';\nimport fixDiaoyuIsland from './fix/diaoyuIsland.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nvar DEFAULT_NAME_PROPERTY = 'name';\n\nvar GeoJSONResource =\n/** @class */\nfunction () {\n function GeoJSONResource(mapName, geoJSON, specialAreas) {\n this.type = 'geoJSON';\n this._parsedMap = createHashMap();\n this._mapName = mapName;\n this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP?\n\n this._geoJSON = parseInput(geoJSON);\n }\n /**\r\n * @param nameMap can be null/undefined\r\n * @param nameProperty can be null/undefined\r\n */\n\n\n GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n\n var parsed = this._parsedMap.get(nameProperty);\n\n if (!parsed) {\n var rawRegions = this._parseToRegions(nameProperty);\n\n parsed = this._parsedMap.set(nameProperty, {\n regions: rawRegions,\n boundingRect: calculateBoundingRect(rawRegions)\n });\n }\n\n var regionsMap = createHashMap();\n var finalRegions = [];\n each(parsed.regions, function (region) {\n var regionName = region.name; // Try use the alias in geoNameMap\n\n if (nameMap && hasOwn(nameMap, regionName)) {\n region = region.cloneShallow(regionName = nameMap[regionName]);\n }\n\n finalRegions.push(region);\n regionsMap.set(regionName, region);\n });\n return {\n regions: finalRegions,\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n regionsMap: regionsMap\n };\n };\n\n GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n var mapName = this._mapName;\n var geoJSON = this._geoJSON;\n var rawRegions; // https://jsperf.com/try-catch-performance-overhead\n\n try {\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n } catch (e) {\n throw new Error('Invalid geoJson format\\n' + e.message);\n }\n\n fixNanhai(mapName, rawRegions);\n each(rawRegions, function (region) {\n var regionName = region.name;\n fixTextCoord(mapName, region);\n fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed\n // to look better\n\n var specialArea = this._specialAreas && this._specialAreas[regionName];\n\n if (specialArea) {\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n }\n }, this);\n return rawRegions;\n };\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\n\n\n GeoJSONResource.prototype.getMapForUser = function () {\n return {\n // For backward compatibility, use geoJson\n // PENDING: it has been returning them without clone.\n // do we need to avoid outsite modification?\n geoJson: this._geoJSON,\n geoJSON: this._geoJSON,\n specialAreas: this._specialAreas\n };\n };\n\n return GeoJSONResource;\n}();\n\nexport { GeoJSONResource };\n\nfunction calculateBoundingRect(regions) {\n var rect;\n\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect();\n rect = rect || regionRect.clone();\n rect.union(regionRect);\n }\n\n return rect;\n}\n\nfunction parseInput(source) {\n return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap } from 'zrender/lib/core/util.js';\nimport { GeoSVGResource } from './GeoSVGResource.js';\nimport { GeoJSONResource } from './GeoJSONResource.js';\nvar storage = createHashMap();\nexport default {\n /**\r\n * Compatible with previous `echarts.registerMap`.\r\n *\r\n * @usage\r\n * ```js\r\n *\r\n * echarts.registerMap('USA', geoJson, specialAreas);\r\n *\r\n * echarts.registerMap('USA', {\r\n * geoJson: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n * echarts.registerMap('USA', {\r\n * geoJSON: geoJson,\r\n * specialAreas: {...}\r\n * });\r\n *\r\n * echarts.registerMap('airport', {\r\n * svg: svg\r\n * }\r\n * ```\r\n *\r\n * Note:\r\n * Do not support that register multiple geoJSON or SVG\r\n * one map name. Because different geoJSON and SVG have\r\n * different unit. It's not easy to make sure how those\r\n * units are mapping/normalize.\r\n * If intending to use multiple geoJSON or SVG, we can\r\n * use multiple geo coordinate system.\r\n */\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\n if (rawDef.svg) {\n var resource = new GeoSVGResource(mapName, rawDef.svg);\n storage.set(mapName, resource);\n } else {\n // Recommend:\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n // Backward compatibility:\n // echarts.registerMap('eu', geoJSON, specialAreas);\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n\n if (geoJSON && !rawDef.features) {\n rawSpecialAreas = rawDef.specialAreas;\n } else {\n geoJSON = rawDef;\n }\n\n var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n storage.set(mapName, resource);\n }\n },\n getGeoResource: function (mapName) {\n return storage.get(mapName);\n },\n\n /**\r\n * Only for exporting to users.\r\n * **MUST NOT** used internally.\r\n */\n getMapForUser: function (mapName) {\n var resource = storage.get(mapName); // Do not support return SVG until some real requirement come.\n\n return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n },\n load: function (mapName, nameMap, nameProperty) {\n var resource = storage.get(mapName);\n\n if (!resource) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n }\n\n return;\n }\n\n return resource.load(nameMap, nameProperty);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport RoamController from './RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enableComponentHighDownFeatures, setDefaultStateProxy } from '../../util/states.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { getUID } from '../../util/component.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner } from '../../util/model.js';\n/**\r\n * Only these tags enable use `itemStyle` if they are named in SVG.\r\n * Other tags like might not suitable for `itemStyle`.\r\n * They will not be considered to be styled until some requirements come.\r\n */\n\nvar OPTION_STYLE_ENABLED_TAGS = ['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path'];\nvar OPTION_STYLE_ENABLED_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS);\nvar STATE_TRIGGER_TAG_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar LABEL_HOST_MAP = zrUtil.createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(['g']));\nvar mapLabelRaw = makeInner();\n\nfunction getFixedItemStyle(model) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n} // Only stroke can be used for line.\n// Using fill in style if stroke not exits.\n// TODO Not sure yet. Perhaps a separate `lineStyle`?\n\n\nfunction fixLineStyle(styleHost) {\n var style = styleHost.style;\n\n if (style) {\n style.stroke = style.stroke || style.fill;\n style.fill = null;\n }\n}\n\nvar MapDraw =\n/** @class */\nfunction () {\n function MapDraw(api) {\n var group = new graphic.Group();\n this.uid = getUID('ec_map_draw');\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n this.group = group;\n group.add(this._regionsGroup = new graphic.Group());\n group.add(this._svgGroup = new graphic.Group());\n }\n\n MapDraw.prototype.draw = function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var transformInfo = geo.getTransformInfo();\n var transformInfoRaw = transformInfo.raw;\n var transformInfoRoam = transformInfo.roam; // No animation when first draw or in action\n\n var isFirstDraw = !regionsGroup.childAt(0) || payload;\n\n if (isFirstDraw) {\n group.x = transformInfoRoam.x;\n group.y = transformInfoRoam.y;\n group.scaleX = transformInfoRoam.scaleX;\n group.scaleY = transformInfoRoam.scaleY;\n group.dirty();\n } else {\n graphic.updateProps(group, transformInfoRoam, mapOrGeoModel);\n }\n\n var isVisualEncodedByVisualMap = data && data.getVisual('visualMeta') && data.getVisual('visualMeta').length > 0;\n var viewBuildCtx = {\n api: api,\n geo: geo,\n mapOrGeoModel: mapOrGeoModel,\n data: data,\n isVisualEncodedByVisualMap: isVisualEncodedByVisualMap,\n isGeo: isGeo,\n transformInfoRaw: transformInfoRaw\n };\n\n if (geo.resourceType === 'geoJSON') {\n this._buildGeoJSON(viewBuildCtx);\n } else if (geo.resourceType === 'geoSVG') {\n this._buildSVG(viewBuildCtx);\n }\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api, fromView);\n };\n\n MapDraw.prototype._buildGeoJSON = function (viewBuildCtx) {\n var regionsGroupByName = this._regionsGroupByName = zrUtil.createHashMap();\n var regionsInfoByName = zrUtil.createHashMap();\n var regionsGroup = this._regionsGroup;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var projection = viewBuildCtx.geo.projection;\n var projectionStream = projection && projection.stream;\n\n function transformPoint(point, project) {\n if (project) {\n // projection may return null point.\n point = project(point);\n }\n\n return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];\n }\n\n ;\n\n function transformPolygonPoints(inPoints) {\n var outPoints = []; // If projectionStream is provided. Use it instead of single point project.\n\n var project = !projectionStream && projection && projection.project;\n\n for (var i = 0; i < inPoints.length; ++i) {\n var newPt = transformPoint(inPoints[i], project);\n newPt && outPoints.push(newPt);\n }\n\n return outPoints;\n }\n\n function getPolyShape(points) {\n return {\n shape: {\n points: transformPolygonPoints(points)\n }\n };\n }\n\n regionsGroup.removeAll(); // Only when the resource is GeoJSON, there is `geo.regions`.\n\n zrUtil.each(viewBuildCtx.geo.regions, function (region) {\n var regionName = region.name; // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n\n var regionGroup = regionsGroupByName.get(regionName);\n\n var _a = regionsInfoByName.get(regionName) || {},\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n\n if (!regionGroup) {\n regionGroup = regionsGroupByName.set(regionName, new graphic.Group());\n regionsGroup.add(regionGroup);\n dataIdx = data ? data.indexOfName(regionName) : null;\n regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;\n regionsInfoByName.set(regionName, {\n dataIdx: dataIdx,\n regionModel: regionModel\n });\n }\n\n var polygonSubpaths = [];\n var polylineSubpaths = [];\n zrUtil.each(region.geometries, function (geometry) {\n // Polygon and MultiPolygon\n if (geometry.type === 'polygon') {\n var polys = [geometry.exterior].concat(geometry.interiors || []);\n\n if (projectionStream) {\n polys = projectPolys(polys, projectionStream);\n }\n\n zrUtil.each(polys, function (poly) {\n polygonSubpaths.push(new graphic.Polygon(getPolyShape(poly)));\n });\n } // LineString and MultiLineString\n else {\n var points = geometry.points;\n\n if (projectionStream) {\n points = projectPolys(points, projectionStream, true);\n }\n\n zrUtil.each(points, function (points) {\n polylineSubpaths.push(new graphic.Polyline(getPolyShape(points)));\n });\n }\n });\n var centerPt = transformPoint(region.getCenter(), projection && projection.project);\n\n function createCompoundPath(subpaths, isLine) {\n if (!subpaths.length) {\n return;\n }\n\n var compoundPath = new graphic.CompoundPath({\n culling: true,\n segmentIgnoreThreshold: 1,\n shape: {\n paths: subpaths\n }\n });\n regionGroup.add(compoundPath);\n applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);\n resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);\n\n if (isLine) {\n fixLineStyle(compoundPath);\n zrUtil.each(compoundPath.states, fixLineStyle);\n }\n }\n\n createCompoundPath(polygonSubpaths);\n createCompoundPath(polylineSubpaths, true);\n }); // Ensure children have been added to `regionGroup` before calling them.\n\n regionsGroupByName.each(function (regionGroup, regionName) {\n var _a = regionsInfoByName.get(regionName),\n dataIdx = _a.dataIdx,\n regionModel = _a.regionModel;\n\n resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);\n }, this);\n };\n\n MapDraw.prototype._buildSVG = function (viewBuildCtx) {\n var mapName = viewBuildCtx.geo.map;\n var transformInfoRaw = viewBuildCtx.transformInfoRaw;\n this._svgGroup.x = transformInfoRaw.x;\n this._svgGroup.y = transformInfoRaw.y;\n this._svgGroup.scaleX = transformInfoRaw.scaleX;\n this._svgGroup.scaleY = transformInfoRaw.scaleY;\n\n if (this._svgResourceChanged(mapName)) {\n this._freeSVG();\n\n this._useSVG(mapName);\n }\n\n var svgDispatcherMap = this._svgDispatcherMap = zrUtil.createHashMap();\n var focusSelf = false;\n zrUtil.each(this._svgGraphicRecord.named, function (namedItem) {\n // Note that we also allow different elements have the same name.\n // For example, a glyph of a city and the label of the city have\n // the same name and their tooltip info can be defined in a single\n // region option.\n var regionName = namedItem.name;\n var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;\n var data = viewBuildCtx.data;\n var svgNodeTagLower = namedItem.svgNodeTagLower;\n var el = namedItem.el;\n var dataIdx = data ? data.indexOfName(regionName) : null;\n var regionModel = mapOrGeoModel.getRegionModel(regionName);\n\n if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {\n applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);\n }\n\n if (el instanceof Displayable) {\n el.culling = true;\n } // We do not know how the SVG like so we'd better not to change z2.\n // Otherwise it might bring some unexpected result. For example,\n // an area hovered that make some inner city can not be clicked.\n\n\n el.z2EmphasisLift = 0; // If self named:\n\n if (!namedItem.namedFrom) {\n // label should batter to be displayed based on the center of \n // if it is named rather than displayed on each child.\n if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {\n resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);\n }\n\n resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);\n resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {\n var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);\n\n if (focus_1 === 'self') {\n focusSelf = true;\n }\n\n var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);\n els.push(el);\n }\n }\n }, this);\n\n this._enableBlurEntireSVG(focusSelf, viewBuildCtx);\n };\n\n MapDraw.prototype._enableBlurEntireSVG = function (focusSelf, viewBuildCtx) {\n // It's a little complicated to support blurring the entire geoSVG in series-map.\n // So do not support it until some requirements come.\n // At present, in series-map, only regions can be blurred.\n if (focusSelf && viewBuildCtx.isGeo) {\n var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(['blur', 'itemStyle']).getItemStyle(); // Only support `opacity` here. Because not sure that other props are suitable for\n // all of the elements generated by SVG (especially for Text/TSpan/Image/... ).\n\n var opacity_1 = blurStyle.opacity;\n\n this._svgGraphicRecord.root.traverse(function (el) {\n if (!el.isGroup) {\n // PENDING: clear those settings to SVG elements when `_freeSVG`.\n // (Currently it happen not to be needed.)\n setDefaultStateProxy(el);\n var style = el.ensureState('blur').style || {}; // Do not overwrite the region style that already set from region option.\n\n if (style.opacity == null && opacity_1 != null) {\n style.opacity = opacity_1;\n } // If `ensureState('blur').style = {}`, there will be default opacity.\n // Enable `stateTransition` (animation).\n\n\n el.ensureState('emphasis');\n }\n });\n }\n };\n\n MapDraw.prototype.remove = function () {\n this._regionsGroup.removeAll();\n\n this._regionsGroupByName = null;\n\n this._svgGroup.removeAll();\n\n this._freeSVG();\n\n this._controller.dispose();\n\n this._controllerHost = null;\n };\n\n MapDraw.prototype.findHighDownDispatchers = function (name, geoModel) {\n if (name == null) {\n return [];\n }\n\n var geo = geoModel.coordinateSystem;\n\n if (geo.resourceType === 'geoJSON') {\n var regionsGroupByName = this._regionsGroupByName;\n\n if (regionsGroupByName) {\n var regionGroup = regionsGroupByName.get(name);\n return regionGroup ? [regionGroup] : [];\n }\n } else if (geo.resourceType === 'geoSVG') {\n return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];\n }\n };\n\n MapDraw.prototype._svgResourceChanged = function (mapName) {\n return this._svgMapName !== mapName;\n };\n\n MapDraw.prototype._useSVG = function (mapName) {\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n var svgGraphic = resource.useGraphic(this.uid);\n\n this._svgGroup.add(svgGraphic.root);\n\n this._svgGraphicRecord = svgGraphic;\n this._svgMapName = mapName;\n }\n };\n\n MapDraw.prototype._freeSVG = function () {\n var mapName = this._svgMapName;\n\n if (mapName == null) {\n return;\n }\n\n var resource = geoSourceManager.getGeoResource(mapName);\n\n if (resource && resource.type === 'geoSVG') {\n resource.freeGraphic(this.uid);\n }\n\n this._svgGraphicRecord = null;\n this._svgDispatcherMap = null;\n\n this._svgGroup.removeAll();\n\n this._svgMapName = null;\n };\n\n MapDraw.prototype._updateController = function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost; // @ts-ignore FIXME:TS\n\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n // @ts-ignore FIXME:TS\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY,\n animation: {\n duration: 0\n }\n }));\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.containPoint([x, y]) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n };\n /**\r\n * FIXME: this is a temporarily workaround.\r\n * When `geoRoam` the elements need to be reset in `MapView['render']`, because the props like\r\n * `ignore` might have been modified by `LabelManager`, and `LabelManager#addLabelsOfSeries`\r\n * will subsequently cache `defaultAttr` like `ignore`. If do not do this reset, the modified\r\n * props will have no chance to be restored.\r\n * Note: This reset should be after `clearStates` in `renderSeries` because `useStates` in\r\n * `renderSeries` will cache the modified `ignore` to `el._normalState`.\r\n * TODO:\r\n * Use clone/immutable in `LabelManager`?\r\n */\n\n\n MapDraw.prototype.resetForLabelLayout = function () {\n this.group.traverse(function (el) {\n var label = el.getTextContent();\n\n if (label) {\n label.ignore = mapLabelRaw(label).ignore;\n }\n });\n };\n\n MapDraw.prototype._updateMapSelectHandler = function (mapOrGeoModel, regionsGroup, api, fromView) {\n var mapDraw = this;\n regionsGroup.off('mousedown');\n regionsGroup.off('click'); // @ts-ignore FIXME:TS resolve type conflict\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n });\n }\n };\n\n return MapDraw;\n}();\n\n;\n\nfunction applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {\n // All of the path are using `itemStyle`, because\n // (1) Some SVG also use fill on polyline (The different between\n // polyline and polygon is \"open\" or \"close\" but not fill or not).\n // (2) For the common props like opacity, if some use itemStyle\n // and some use `lineStyle`, it might confuse users.\n // (3) Most SVG use , where can not detect whether to draw a \"line\"\n // or a filled shape, so use `itemStyle` for .\n var normalStyleModel = regionModel.getModel('itemStyle');\n var emphasisStyleModel = regionModel.getModel(['emphasis', 'itemStyle']);\n var blurStyleModel = regionModel.getModel(['blur', 'itemStyle']);\n var selectStyleModel = regionModel.getModel(['select', 'itemStyle']); // NOTE: DON'T use 'style' in visual when drawing map.\n // This component is used for drawing underlying map for both geo component and map series.\n\n var normalStyle = getFixedItemStyle(normalStyleModel);\n var emphasisStyle = getFixedItemStyle(emphasisStyleModel);\n var selectStyle = getFixedItemStyle(selectStyleModel);\n var blurStyle = getFixedItemStyle(blurStyleModel); // Update the itemStyle if has data visual\n\n var data = viewBuildCtx.data;\n\n if (data) {\n // Only visual color of each item will be used. It can be encoded by visualMap\n // But visual color of series is used in symbol drawing\n // Visual color for each series is for the symbol draw\n var style = data.getItemVisual(dataIndex, 'style');\n var decal = data.getItemVisual(dataIndex, 'decal');\n\n if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {\n normalStyle.fill = style.fill;\n }\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);\n }\n } // SVG text, tspan and image can be named but not supporeted\n // to be styled by region option yet.\n\n\n el.setStyle(normalStyle);\n el.style.strokeNoScale = true;\n el.ensureState('emphasis').style = emphasisStyle;\n el.ensureState('select').style = selectStyle;\n el.ensureState('blur').style = blurStyle; // Enable blur\n\n setDefaultStateProxy(el);\n}\n\nfunction resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx, // If labelXY not provided, use `textConfig.position: 'inside'`\nlabelXY) {\n var data = viewBuildCtx.data;\n var isGeo = viewBuildCtx.isGeo;\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 3. Region has no series legendIcon, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : regionName;\n var labelFetcher = void 0; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var specifiedTextOpt = labelXY ? {\n normal: {\n align: 'center',\n verticalAlign: 'middle'\n }\n } : null; // Caveat: must be called after `setDefaultStateProxy(el);` called.\n // because textContent will be assign with `el.stateProxy` inside.\n\n setLabelStyle(el, getLabelStatesModels(regionModel), {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: regionName\n }, specifiedTextOpt);\n var textEl = el.getTextContent();\n\n if (textEl) {\n mapLabelRaw(textEl).ignore = textEl.ignore;\n\n if (el.textConfig && labelXY) {\n // Compute a relative offset based on the el bounding rect.\n var rect = el.getBoundingRect().clone(); // Need to make sure the percent position base on the same rect in normal and\n // emphasis state. Otherwise if using boundingRect of el, but the emphasis state\n // has borderWidth (even 0.5px), the text position will be changed obviously\n // if the position is very big like ['1234%', '1345%'].\n\n el.textConfig.layoutRect = rect;\n el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + '%', (labelXY[1] - rect.y) / rect.height * 100 + '%'];\n }\n } // PENDING:\n // If labelLayout is enabled (test/label-layout.html), el.dataIndex should be specified.\n // But el.dataIndex is also used to determine whether user event should be triggered,\n // where el.seriesIndex or el.dataModel must be specified. At present for a single el\n // there is not case that \"only label layout enabled but user event disabled\", so here\n // we depends `resetEventTriggerForRegion` to do the job of setting `el.dataIndex`.\n\n\n el.disableLabelAnimation = true;\n } else {\n el.removeTextContent();\n el.removeTextConfig();\n el.disableLabelAnimation = null;\n }\n}\n\nfunction resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, // Exist only if `viewBuildCtx.data` exists.\ndataIdx) {\n // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the regionGroup\n if (viewBuildCtx.data) {\n // FIXME: when series-map use a SVG map, and there are duplicated name specified\n // on different SVG elements, after `data.setItemGraphicEl(...)`:\n // (1) all of them will be mounted with `dataIndex`, `seriesIndex`, so that tooltip\n // can be triggered only mouse hover. That's correct.\n // (2) only the last element will be kept in `data`, so that if trigger tooltip\n // by `dispatchAction`, only the last one can be found and triggered. That might be\n // not correct. We will fix it in future if anyone demanding that.\n viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);\n } // series-map will not trigger \"geoselectchange\" no matter it is\n // based on a declared geo component. Because series-map will\n // trigger \"selectchange\". If it trigger both the two events,\n // If users call `chart.dispatchAction({type: 'toggleSelect'})`,\n // it not easy to also fire event \"geoselectchanged\".\n else {\n // Package custom mouse event for geo component\n getECData(eventTrigger).eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: regionName,\n region: regionModel && regionModel.option || {}\n };\n }\n}\n\nfunction resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n if (!viewBuildCtx.data) {\n graphic.setTooltipConfig({\n el: el,\n componentModel: mapOrGeoModel,\n itemName: regionName,\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n itemTooltipOption: regionModel.get('tooltip')\n });\n }\n}\n\nfunction resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {\n // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n el.highDownSilentOnTouch = !!mapOrGeoModel.get('selectedMode'); // @ts-ignore FIXME:TS fix the \"compatible with each other\"?\n\n var emphasisModel = regionModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(el, focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n\n if (viewBuildCtx.isGeo) {\n enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);\n }\n\n return focus;\n}\n\nfunction projectPolys(rings, // Polygons include exterior and interiors. Or polylines.\ncreateStream, isLine) {\n var polygons = [];\n var curPoly;\n\n function startPolygon() {\n curPoly = [];\n }\n\n function endPolygon() {\n if (curPoly.length) {\n polygons.push(curPoly);\n curPoly = [];\n }\n }\n\n var stream = createStream({\n polygonStart: startPolygon,\n polygonEnd: endPolygon,\n lineStart: startPolygon,\n lineEnd: endPolygon,\n point: function (x, y) {\n // May have NaN values from stream.\n if (isFinite(x) && isFinite(y)) {\n curPoly.push([x, y]);\n }\n },\n sphere: function () {}\n });\n !isLine && stream.polygonStart();\n zrUtil.each(rings, function (ring) {\n stream.lineStart();\n\n for (var i = 0; i < ring.length; i++) {\n stream.point(ring[i][0], ring[i][1]);\n }\n\n stream.lineEnd();\n });\n !isLine && stream.polygonEnd();\n return polygons;\n}\n\nexport default MapDraw; // @ts-ignore FIXME:TS fix the \"compatible with each other\"?","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport MapDraw from '../../component/helper/MapDraw.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { setStatesFlag, Z2_EMPHASIS_LIFT } from '../../util/states.js';\n\nvar MapView =\n/** @class */\nfunction (_super) {\n __extends(MapView, _super);\n\n function MapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapView.type;\n return _this;\n }\n\n MapView.prototype.render = function (mapModel, ecModel, api, payload) {\n // Not render if it is an toggleSelect action from self\n if (payload && payload.type === 'mapToggleSelect' && payload.from === this.uid) {\n return;\n }\n\n var group = this.group;\n group.removeAll();\n\n if (mapModel.getHostGeoModel()) {\n return;\n }\n\n if (this._mapDraw && payload && payload.type === 'geoRoam') {\n this._mapDraw.resetForLabelLayout();\n } // Not update map if it is an roam action from self\n\n\n if (!(payload && payload.type === 'geoRoam' && payload.componentType === 'series' && payload.seriesId === mapModel.id)) {\n if (mapModel.needsDrawMap) {\n var mapDraw = this._mapDraw || new MapDraw(api);\n group.add(mapDraw.group);\n mapDraw.draw(mapModel, ecModel, api, this, payload);\n this._mapDraw = mapDraw;\n } else {\n // Remove drawn map\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n }\n } else {\n var mapDraw = this._mapDraw;\n mapDraw && group.add(mapDraw.group);\n }\n\n mapModel.get('showLegendSymbol') && ecModel.getComponent('legend') && this._renderSymbols(mapModel, ecModel, api);\n };\n\n MapView.prototype.remove = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n this.group.removeAll();\n };\n\n MapView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n };\n\n MapView.prototype._renderSymbols = function (mapModel, ecModel, api) {\n var originalData = mapModel.originalData;\n var group = this.group;\n originalData.each(originalData.mapDimension('value'), function (value, originalDataIndex) {\n if (isNaN(value)) {\n return;\n }\n\n var layout = originalData.getItemLayout(originalDataIndex);\n\n if (!layout || !layout.point) {\n // Not exists in map\n return;\n }\n\n var point = layout.point;\n var offset = layout.offset;\n var circle = new graphic.Circle({\n style: {\n // Because the special of map draw.\n // Which needs statistic of multiple series and draw on one map.\n // And each series also need a symbol with legend color\n //\n // Layout and visual are put one the different data\n // TODO\n fill: mapModel.getData().getVisual('style').fill\n },\n shape: {\n cx: point[0] + offset * 9,\n cy: point[1],\n r: 3\n },\n silent: true,\n // Do not overlap the first series, on which labels are displayed.\n z2: 8 + (!offset ? Z2_EMPHASIS_LIFT + 1 : 0)\n }); // Only the series that has the first value on the same region is in charge of rendering the label.\n // But consider the case:\n // series: [\n // {id: 'X', type: 'map', map: 'm', {data: [{name: 'A', value: 11}, {name: 'B', {value: 22}]},\n // {id: 'Y', type: 'map', map: 'm', {data: [{name: 'A', value: 21}, {name: 'C', {value: 33}]}\n // ]\n // The offset `0` of item `A` is at series `X`, but of item `C` is at series `Y`.\n // For backward compatibility, we follow the rule that render label `A` by the\n // settings on series `X` but render label `C` by the settings on series `Y`.\n\n if (!offset) {\n var fullData = mapModel.mainSeries.getData();\n var name_1 = originalData.getName(originalDataIndex);\n var fullIndex_1 = fullData.indexOfName(name_1);\n var itemModel = originalData.getItemModel(originalDataIndex);\n var labelModel = itemModel.getModel('label');\n var regionGroup = fullData.getItemGraphicEl(fullIndex_1); // `getFormattedLabel` needs to use `getData` inside. Here\n // `mapModel.getData()` is shallow cloned from `mainSeries.getData()`.\n // FIXME\n // If this is not the `mainSeries`, the item model (like label formatter)\n // set on original data item will never get. But it has been working\n // like that from the beginning, and this scenario is rarely encountered.\n // So it won't be fixed until we have to.\n\n setLabelStyle(circle, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (idx, state) {\n return mapModel.getFormattedLabel(fullIndex_1, state);\n }\n },\n defaultText: name_1\n });\n circle.disableLabelAnimation = true;\n\n if (!labelModel.get('position')) {\n circle.setTextConfig({\n position: 'bottom'\n });\n }\n\n regionGroup.onHoverStateChange = function (toState) {\n setStatesFlag(circle, toState);\n };\n }\n\n group.add(circle);\n });\n };\n\n MapView.type = 'map';\n return MapView;\n}(ChartView);\n\nexport default MapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { createSymbol } from '../../util/symbol.js';\n\nvar MapSeries =\n/** @class */\nfunction (_super) {\n __extends(MapSeries, _super);\n\n function MapSeries() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MapSeries.type; // Only first map series of same mapType will drawMap.\n\n _this.needsDrawMap = false; // Group of all map series with same mapType\n\n _this.seriesGroup = [];\n\n _this.getTooltipPosition = function (dataIndex) {\n if (dataIndex != null) {\n var name_1 = this.getData().getName(dataIndex);\n var geo = this.coordinateSystem;\n var region = geo.getRegion(name_1);\n return region && geo.dataToPoint(region.getCenter());\n }\n };\n\n return _this;\n }\n\n MapSeries.prototype.getInitialData = function (option) {\n var data = createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n var dataNameMap = zrUtil.createHashMap();\n var toAppendNames = [];\n\n for (var i = 0, len = data.count(); i < len; i++) {\n var name_2 = data.getName(i);\n dataNameMap.set(name_2, true);\n }\n\n var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);\n zrUtil.each(geoSource.regions, function (region) {\n var name = region.name;\n\n if (!dataNameMap.get(name)) {\n toAppendNames.push(name);\n }\n }); // Complete data with missing regions. The consequent processes (like visual\n // map and render) can not be performed without a \"full data\". For example,\n // find `dataIndex` by name.\n\n data.appendValues([], toAppendNames);\n return data;\n };\n /**\r\n * If no host geo model, return null, which means using a\r\n * inner exclusive geo model.\r\n */\n\n\n MapSeries.prototype.getHostGeoModel = function () {\n var geoIndex = this.option.geoIndex;\n return geoIndex != null ? this.ecModel.getComponent('geo', geoIndex) : null;\n };\n\n MapSeries.prototype.getMapType = function () {\n return (this.getHostGeoModel() || this).option.map;\n }; // _fillOption(option, mapName) {\n // Shallow clone\n // option = zrUtil.extend({}, option);\n // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);\n // return option;\n // }\n\n\n MapSeries.prototype.getRawValue = function (dataIndex) {\n // Use value stored in data instead because it is calculated from multiple series\n // FIXME Provide all value of multiple series ?\n var data = this.getData();\n return data.get(data.mapDimension('value'), dataIndex);\n };\n /**\r\n * Get model of region\r\n */\n\n\n MapSeries.prototype.getRegionModel = function (regionName) {\n var data = this.getData();\n return data.getItemModel(data.indexOfName(regionName));\n };\n /**\r\n * Map tooltip formatter\r\n */\n\n\n MapSeries.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n // FIXME orignalData and data is a bit confusing\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n var seriesGroup = this.seriesGroup;\n var seriesNames = [];\n\n for (var i = 0; i < seriesGroup.length; i++) {\n var otherIndex = seriesGroup[i].originalData.indexOfName(name);\n var valueDim = data.mapDimension('value');\n\n if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) {\n seriesNames.push(seriesGroup[i].name);\n }\n }\n\n return createTooltipMarkup('section', {\n header: seriesNames.join(', '),\n noHeader: !seriesNames.length,\n blocks: [createTooltipMarkup('nameValue', {\n name: name,\n value: value\n })]\n });\n };\n\n MapSeries.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n MapSeries.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n MapSeries.prototype.getLegendIcon = function (opt) {\n var iconType = opt.icon || 'roundRect';\n var icon = createSymbol(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill);\n icon.setStyle(opt.itemStyle); // Map do not use itemStyle.borderWidth as border width\n\n icon.style.stroke = 'none'; // No rotation because no series visual symbol for map\n\n if (iconType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n\n return icon;\n };\n\n MapSeries.type = 'series.map';\n MapSeries.dependencies = ['geo'];\n MapSeries.layoutMode = 'box';\n MapSeries.defaultOption = {\n // 一级层叠\n // zlevel: 0,\n // 二级层叠\n z: 2,\n coordinateSystem: 'geo',\n // map should be explicitly specified since ec3.\n map: '',\n // If `geoIndex` is not specified, a exclusive geo will be\n // created. Otherwise use the specified geo component, and\n // `map` and `mapType` are ignored.\n // geoIndex: 0,\n // 'center' | 'left' | 'right' | 'x%' | {number}\n left: 'center',\n // 'center' | 'top' | 'bottom' | 'x%' | {number}\n top: 'center',\n // right\n // bottom\n // width:\n // height\n // Aspect is width / height. Inited to be geoJson bbox aspect\n // This parameter is used for scale this aspect\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient.\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n showLegendSymbol: true,\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ],\n // higher priority than center and zoom\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n selectedMode: true,\n label: {\n show: false,\n color: '#000'\n },\n // scaleLimit: null,\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444',\n areaColor: '#eee'\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n areaColor: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n nameProperty: 'name'\n };\n return MapSeries;\n}(SeriesModel);\n\nexport default MapSeries;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // FIXME 公用?\n\nfunction dataStatistics(datas, statisticType) {\n var dataNameMap = {};\n zrUtil.each(datas, function (data) {\n data.each(data.mapDimension('value'), function (value, idx) {\n // Add prefix to avoid conflict with Object.prototype.\n var mapKey = 'ec-' + data.getName(idx);\n dataNameMap[mapKey] = dataNameMap[mapKey] || [];\n\n if (!isNaN(value)) {\n dataNameMap[mapKey].push(value);\n }\n });\n });\n return datas[0].map(datas[0].mapDimension('value'), function (value, idx) {\n var mapKey = 'ec-' + datas[0].getName(idx);\n var sum = 0;\n var min = Infinity;\n var max = -Infinity;\n var len = dataNameMap[mapKey].length;\n\n for (var i = 0; i < len; i++) {\n min = Math.min(min, dataNameMap[mapKey][i]);\n max = Math.max(max, dataNameMap[mapKey][i]);\n sum += dataNameMap[mapKey][i];\n }\n\n var result;\n\n if (statisticType === 'min') {\n result = min;\n } else if (statisticType === 'max') {\n result = max;\n } else if (statisticType === 'average') {\n result = sum / len;\n } else {\n result = sum;\n }\n\n return len === 0 ? NaN : result;\n });\n}\n\nexport default function mapDataStatistic(ecModel) {\n var seriesGroups = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n var hostGeoModel = seriesModel.getHostGeoModel();\n var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType();\n (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);\n });\n zrUtil.each(seriesGroups, function (seriesList, key) {\n var data = dataStatistics(zrUtil.map(seriesList, function (seriesModel) {\n return seriesModel.getData();\n }), seriesList[0].get('mapValueCalculation'));\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].originalData = seriesList[i].getData();\n } // FIXME Put where?\n\n\n for (var i = 0; i < seriesList.length; i++) {\n seriesList[i].seriesGroup = seriesList;\n seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel();\n seriesList[i].setData(data.cloneShallow());\n seriesList[i].mainSeries = seriesList[0];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function mapSymbolLayout(ecModel) {\n var processedMapType = {};\n ecModel.eachSeriesByType('map', function (mapSeries) {\n var mapType = mapSeries.getMapType();\n\n if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {\n return;\n }\n\n var mapSymbolOffsets = {};\n zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {\n var geo = subMapSeries.coordinateSystem;\n var data = subMapSeries.originalData;\n\n if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {\n data.each(data.mapDimension('value'), function (value, idx) {\n var name = data.getName(idx);\n var region = geo.getRegion(name); // If input series.data is [11, 22, '-'/null/undefined, 44],\n // it will be filled with NaN: [11, 22, NaN, 44] and NaN will\n // not be drawn. So here must validate if value is NaN.\n\n if (!region || isNaN(value)) {\n return;\n }\n\n var offset = mapSymbolOffsets[name] || 0;\n var point = geo.dataToPoint(region.getCenter());\n mapSymbolOffsets[name] = offset + 1;\n data.setItemLayout(idx, {\n point: point,\n offset: offset\n });\n });\n }\n }); // Show label of those region not has legendIcon (which is offset 0)\n\n var data = mapSeries.getData();\n data.each(function (idx) {\n var name = data.getName(idx);\n var layout = data.getItemLayout(idx) || {};\n layout.showLabel = !mapSymbolOffsets[name];\n data.setItemLayout(idx, layout);\n });\n processedMapType[mapType] = true;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Simple view coordinate system\r\n * Mapping given x, y to transformd view x, y\r\n */\n\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport Transformable from 'zrender/lib/core/Transformable.js';\nimport { parsePercent } from '../util/number.js';\nvar v2ApplyTransform = vector.applyTransform;\n\nvar View =\n/** @class */\nfunction (_super) {\n __extends(View, _super);\n\n function View(name) {\n var _this = _super.call(this) || this;\n\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\r\n * Represents the transform brought by roam/zoom.\r\n * If `View['_viewRect']` applies roam transform,\r\n * we can get the final displayed rect.\r\n */\n\n _this._roamTransformable = new Transformable();\n /**\r\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\r\n */\n\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\r\n * @return {module:zrender/core/BoundingRect}\r\n */\n\n\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\r\n * Transformed to particular position and size\r\n */\n\n\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n\n this._updateTransform();\n };\n /**\r\n * Set center of view\r\n */\n\n\n View.prototype.setCenter = function (centerCoord, api) {\n if (!centerCoord) {\n return;\n }\n\n this._center = [parsePercent(centerCoord[0], api.getWidth()), parsePercent(centerCoord[1], api.getHeight())];\n\n this._updateCenterAndZoom();\n };\n\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n\n this._zoom = zoom;\n\n this._updateCenterAndZoom();\n };\n /**\r\n * Get default center without roam\r\n */\n\n\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\r\n * Remove roam\r\n */\n\n\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n\n this._updateTransform();\n };\n /**\r\n * Update transform props on `this` based on the current\r\n * `this._roamTransformable` and `this._rawTransformable`.\r\n */\n\n\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable; // Because roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalculate them.\n\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\r\n * Get view rect after roam transform\r\n */\n\n\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\r\n * Convert a single (lon, lat) data item to (x, y) point.\r\n */\n\n\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\r\n * Convert a (x, y) point to (lon, lat) data\r\n */\n\n\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\r\n * @implements\r\n */\n\n\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport View from '../View.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nimport { warn } from '../../util/log.js';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var projection = opt.projection;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n var resourceType = _this.resourceType = resource ? resource.type : null;\n var regions = _this.regions = source.regions;\n var defaultParams = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this.regions = source.regions;\n\n if (process.env.NODE_ENV !== 'production' && projection) {\n // Do some check\n if (resourceType === 'geoSVG') {\n if (process.env.NODE_ENV !== 'production') {\n warn(\"Map \" + map + \" with SVG source can't use projection. Only GeoJSON source supports projection.\");\n }\n\n projection = null;\n }\n\n if (!(projection.project && projection.unproject)) {\n if (process.env.NODE_ENV !== 'production') {\n warn('project and unproject must be both provided in the projeciton.');\n }\n\n projection = null;\n }\n }\n\n _this.projection = projection;\n var boundingRect;\n\n if (projection) {\n // Can't reuse the raw bounding rect\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect(projection);\n boundingRect = boundingRect || regionRect.clone();\n boundingRect.union(regionRect);\n }\n } else {\n boundingRect = source.boundingRect;\n }\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height); // aspectScale and invertLongitute actually is the parameters default raw projection.\n // So we ignore them if projection is given.\n // Ignore default aspect scale if projection exits.\n\n\n _this.aspectScale = projection ? 1 : zrUtil.retrieve2(opt.aspectScale, defaultParams.aspectScale); // Not invert longitude if projection exits.\n\n _this._invertLongitute = projection ? false : defaultParams.invertLongitute;\n return _this;\n }\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitude is inverted.\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\r\n * Add geoCoord for indexing by name\r\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\r\n * Get geoCoord by name\r\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // Calculate center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (zrUtil.isString(data)) {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n data = projection.project(data);\n }\n\n return data && this.projectedToPoint(data, noRoam, out);\n }\n };\n\n Geo.prototype.pointToData = function (point) {\n var projection = this.projection;\n\n if (projection) {\n // projection may return null point.\n point = projection.unproject(point);\n }\n\n return point && this.pointToProjected(point);\n };\n /**\r\n * Point to projected data. Same with pointToData when projection is used.\r\n */\n\n\n Geo.prototype.pointToProjected = function (point) {\n return _super.prototype.pointToData.call(this, point);\n };\n\n Geo.prototype.projectedToPoint = function (projected, noRoam, out) {\n return _super.prototype.dataToPoint.call(this, projected, noRoam, out);\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Geo, { geo2DDimensions } from './Geo.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js';\nimport geoSourceManager from './geoSourceManager.js';\nimport * as vector from 'zrender/lib/core/vector.js';\n/**\r\n * Resize method bound to the geo\r\n */\n\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n\n if (boundingCoords != null) {\n var leftTop_1 = boundingCoords[0];\n var rightBottom_1 = boundingCoords[1];\n\n if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n // Sample around the lng/lat rect and use projection to calculate actual bounding rect.\n var projection_1 = this.projection;\n\n if (projection_1) {\n var xMin = leftTop_1[0];\n var yMin = leftTop_1[1];\n var xMax = rightBottom_1[0];\n var yMax = rightBottom_1[1];\n leftTop_1 = [Infinity, Infinity];\n rightBottom_1 = [-Infinity, -Infinity]; // TODO better way?\n\n var sampleLine = function (x0, y0, x1, y1) {\n var dx = x1 - x0;\n var dy = y1 - y0;\n\n for (var i = 0; i <= 100; i++) {\n var p = i / 100;\n var pt = projection_1.project([x0 + dx * p, y0 + dy * p]);\n vector.min(leftTop_1, leftTop_1, pt);\n vector.max(rightBottom_1, rightBottom_1, pt);\n }\n }; // Top\n\n\n sampleLine(xMin, yMin, xMax, yMin); // Right\n\n sampleLine(xMax, yMin, xMax, yMax); // Bottom\n\n sampleLine(xMax, yMax, xMin, yMax); // Left\n\n sampleLine(xMin, yMax, xMax, yMin);\n }\n\n this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);\n }\n }\n\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n\n var viewRect;\n\n if (useCenterAndSize) {\n viewRect = {};\n\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'), api);\n this.setZoom(geoModel.get('zoom'));\n} // Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\n\n\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\n\nvar GeoCreator =\n/** @class */\nfunction () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = geo2DDimensions;\n }\n\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = [];\n\n function getCommonGeoProperties(model) {\n return {\n nameProperty: model.get('nameProperty'),\n aspectScale: model.get('aspectScale'),\n projection: model.get('projection')\n };\n } // FIXME Create each time may be slow\n\n\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var mapName = geoModel.get('map');\n var geo = new Geo(mapName + idx, mapName, zrUtil.extend({\n nameMap: geoModel.get('nameMap')\n }, getCommonGeoProperties(geoModel)));\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo); // setGeoCoords(geo, geoModel);\n\n geoModel.coordinateSystem = geo;\n geo.model = geoModel; // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n }); // If has map series\n\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, zrUtil.extend({\n nameMap: zrUtil.mergeAll(nameMapList)\n }, getCommonGeoProperties(mapSeries[0])));\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo); // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\r\n * Fill given regions array\r\n */\n\n\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n\n return GeoCreator;\n}();\n\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport Model from '../../model/Model.js';\nimport geoCreator from './geoCreator.js';\nimport geoSourceManager from './geoSourceManager.js';\n;\n\nvar GeoModel =\n/** @class */\nfunction (_super) {\n __extends(GeoModel, _super);\n\n function GeoModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoModel.type;\n return _this;\n }\n\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\n var source = geoSourceManager.getGeoResource(option.map);\n\n if (source && source.type === 'geoJSON') {\n var itemStyle = option.itemStyle = option.itemStyle || {};\n\n if (!('color' in itemStyle)) {\n itemStyle.color = '#eee';\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n };\n\n GeoModel.prototype.optionUpdated = function () {\n var _this = this;\n\n var option = this.option;\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n var selectedMap = {};\n this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n var regionName = regionOpt.name;\n\n if (regionName) {\n optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n\n if (regionOpt.selected) {\n selectedMap[regionName] = true;\n }\n }\n\n return optionModelMap;\n }, zrUtil.createHashMap());\n\n if (!option.selectedMap) {\n option.selectedMap = selectedMap;\n }\n };\n /**\r\n * Get model of region.\r\n */\n\n\n GeoModel.prototype.getRegionModel = function (name) {\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n };\n /**\r\n * Format label\r\n * @param name Region name\r\n */\n\n\n GeoModel.prototype.getFormattedLabel = function (name, status) {\n var regionModel = this.getRegionModel(name);\n var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n var params = {\n name: name\n };\n\n if (zrUtil.isFunction(formatter)) {\n params.status = status;\n return formatter(params);\n } else if (zrUtil.isString(formatter)) {\n return formatter.replace('{a}', name != null ? name : '');\n }\n };\n\n GeoModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GeoModel.prototype.setCenter = function (center) {\n this.option.center = center;\n }; // PENGING If selectedMode is null ?\n\n\n GeoModel.prototype.select = function (name) {\n var option = this.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n if (selectedMode !== 'multiple') {\n option.selectedMap = null;\n }\n\n var selectedMap = option.selectedMap || (option.selectedMap = {});\n selectedMap[name] = true;\n };\n\n GeoModel.prototype.unSelect = function (name) {\n var selectedMap = this.option.selectedMap;\n\n if (selectedMap) {\n selectedMap[name] = false;\n }\n };\n\n GeoModel.prototype.toggleSelected = function (name) {\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n };\n\n GeoModel.prototype.isSelected = function (name) {\n var selectedMap = this.option.selectedMap;\n return !!(selectedMap && selectedMap[name]);\n };\n\n GeoModel.type = 'geo';\n GeoModel.layoutMode = 'box';\n GeoModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n show: true,\n left: 'center',\n top: 'center',\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n // /// Layout with center and size\n // If you want to put map in a fixed size box with right aspect ratio\n // This two properties may be more convenient\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n silent: false,\n // Map type\n map: '',\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ]\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n // selectedMode: false\n label: {\n show: false,\n color: '#000'\n },\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444' // Default color:\n // + geoJSON: #eee\n // + geoSVG: null (use SVG original `fill`)\n // color: '#eee'\n\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n regions: [] // tooltip: {\n // show: false\n // }\n\n };\n return GeoModel;\n}(ComponentModel);\n\nexport default GeoModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction getCenterCoord(view, point) {\n // Use projected coord as center because it's linear.\n return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);\n}\n\nexport function updateCenterAndZoom(view, payload, zoomLimit, api) {\n var previousZoom = view.getZoom();\n var center = view.getCenter();\n var zoom = payload.zoom;\n var point = view.projectedToPoint ? view.projectedToPoint(center) : view.dataToPoint(center);\n\n if (payload.dx != null && payload.dy != null) {\n point[0] -= payload.dx;\n point[1] -= payload.dy;\n view.setCenter(getCenterCoord(view, point), api);\n }\n\n if (zoom != null) {\n if (zoomLimit) {\n var zoomMin = zoomLimit.min || 0;\n var zoomMax = zoomLimit.max || Infinity;\n zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;\n } // Zoom on given point(originX, originY)\n\n\n view.scaleX *= zoom;\n view.scaleY *= zoom;\n var fixX = (payload.originX - view.x) * (zoom - 1);\n var fixY = (payload.originY - view.y) * (zoom - 1);\n view.x -= fixX;\n view.y -= fixY;\n view.updateTransform(); // Get the new center\n\n view.setCenter(getCenterCoord(view, point), api);\n view.setZoom(zoom * previousZoom);\n }\n\n return {\n center: view.getCenter(),\n zoom: view.getZoom()\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MapDraw from '../helper/MapDraw.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { findEventDispatcher } from '../../util/event.js';\n\nvar GeoView =\n/** @class */\nfunction (_super) {\n __extends(GeoView, _super);\n\n function GeoView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoView.type;\n _this.focusBlurEnabled = true;\n return _this;\n }\n\n GeoView.prototype.init = function (ecModel, api) {\n this._api = api;\n };\n\n GeoView.prototype.render = function (geoModel, ecModel, api, payload) {\n this._model = geoModel;\n\n if (!geoModel.get('show')) {\n this._mapDraw && this._mapDraw.remove();\n this._mapDraw = null;\n return;\n }\n\n if (!this._mapDraw) {\n this._mapDraw = new MapDraw(api);\n }\n\n var mapDraw = this._mapDraw;\n mapDraw.draw(geoModel, ecModel, api, this, payload);\n mapDraw.group.on('click', this._handleRegionClick, this);\n mapDraw.group.silent = geoModel.get('silent');\n this.group.add(mapDraw.group);\n this.updateSelectStatus(geoModel, ecModel, api);\n };\n\n GeoView.prototype._handleRegionClick = function (e) {\n var eventData;\n findEventDispatcher(e.target, function (current) {\n return (eventData = getECData(current).eventData) != null;\n }, true);\n\n if (eventData) {\n this._api.dispatchAction({\n type: 'geoToggleSelect',\n geoId: this._model.id,\n name: eventData.name\n });\n }\n };\n\n GeoView.prototype.updateSelectStatus = function (model, ecModel, api) {\n var _this = this;\n\n this._mapDraw.group.traverse(function (node) {\n var eventData = getECData(node).eventData;\n\n if (eventData) {\n _this._model.isSelected(eventData.name) ? api.enterSelect(node) : api.leaveSelect(node); // No need to traverse children.\n\n return true;\n }\n });\n };\n\n GeoView.prototype.findHighDownDispatchers = function (name) {\n return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);\n };\n\n GeoView.prototype.dispose = function () {\n this._mapDraw && this._mapDraw.remove();\n };\n\n GeoView.type = 'geo';\n return GeoView;\n}(ComponentView);\n\nexport default GeoView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport GeoModel from '../../coord/geo/GeoModel.js';\nimport geoCreator from '../../coord/geo/geoCreator.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport GeoView from './GeoView.js';\nimport geoSourceManager from '../../coord/geo/geoSourceManager.js';\n\nfunction registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\n\nexport function install(registers) {\n registers.registerCoordinateSystem('geo', geoCreator);\n registers.registerComponentModel(GeoModel);\n registers.registerComponentView(GeoView);\n registers.registerImpl('registerMap', registerMap);\n registers.registerImpl('getMap', function (mapName) {\n return geoSourceManager.getMapForUser(mapName);\n });\n\n function makeAction(method, actionInfo) {\n actionInfo.update = 'geo:updateSelectStatus';\n registers.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n var allSelected = [];\n ecModel.eachComponent({\n mainType: 'geo',\n query: payload\n }, function (geoModel) {\n geoModel[method](payload.name);\n var geo = geoModel.coordinateSystem;\n each(geo.regions, function (region) {\n selected[region.name] = geoModel.isSelected(region.name) || false;\n }); // Notice: there might be duplicated name in different regions.\n\n var names = [];\n each(selected, function (v, name) {\n selected[name] && names.push(name);\n });\n allSelected.push({\n geoIndex: geoModel.componentIndex,\n // Use singular, the same naming convention as the event `selectchanged`.\n name: names\n });\n });\n return {\n selected: selected,\n allSelected: allSelected,\n name: payload.name\n };\n });\n }\n\n makeAction('toggleSelected', {\n type: 'geoToggleSelect',\n event: 'geoselectchanged'\n });\n makeAction('select', {\n type: 'geoSelect',\n event: 'geoselected'\n });\n makeAction('unSelect', {\n type: 'geoUnSelect',\n event: 'geounselected'\n });\n /**\r\n * @payload\r\n * @property {string} [componentType=series]\r\n * @property {number} [dx]\r\n * @property {number} [dy]\r\n * @property {number} [zoom]\r\n * @property {number} [originX]\r\n * @property {number} [originY]\r\n */\n\n registers.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n }, function (payload, ecModel, api) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'), api);\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport MapView from './MapView.js';\nimport MapSeries from './MapSeries.js';\nimport mapDataStatistic from './mapDataStatistic.js';\nimport mapSymbolLayout from './mapSymbolLayout.js';\nimport { createLegacyDataSelectAction } from '../../legacy/dataSelectAction.js';\nimport { install as installGeo } from '../../component/geo/install.js';\nexport function install(registers) {\n use(installGeo);\n registers.registerChartView(MapView);\n registers.registerSeriesModel(MapSeries);\n registers.registerLayout(mapSymbolLayout);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);\n createLegacyDataSelectAction('map', registers.registerAction);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The tree layoutHelper implementation was originally copied from\r\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\r\n* some modifications made for this project.\r\n* (see more details in the comment of the specific method below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\n\n/**\r\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\r\n * the tree.\r\n */\nimport * as layout from '../../util/layout.js';\n/**\r\n * Initialize all computational message for following algorithm.\r\n */\n\nexport function init(inRoot) {\n var root = inRoot;\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n\n if (node.isExpand && children.length) {\n var n = children.length;\n\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes a preliminary x coordinate for node. Before that, this function is\r\n * applied recursively to the children of node, as well as the function\r\n * apportion(). After spacing out the children by calling executeShifts(), the\r\n * node is placed to the midpoint of its outermost children.\r\n */\n\nexport function firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Computes all real x-coordinates by summing up the modifiers recursively.\r\n */\n\nexport function secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\nexport function separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\r\n * Transform the common coordinate to radial coordinate.\r\n */\n\nexport function radialCoordinate(rad, r) {\n rad -= Math.PI / 2;\n return {\n x: r * Math.cos(rad),\n y: r * Math.sin(rad)\n };\n}\n/**\r\n * Get the layout position of the whole view.\r\n */\n\nexport function getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\r\n * All other shifts, applied to the smaller subtrees between w- and w+, are\r\n * performed by this function.\r\n *\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * The core of the algorithm. Here, a new subtree is combined with the\r\n * previous subtrees. Threads are used to traverse the inside and outside\r\n * contours of the left and right subtree up to the highest common level.\r\n * Whenever two nodes of the inside contours conflict, we compute the left\r\n * one of the greatest uncommon ancestors using the function nextAncestor()\r\n * and call moveSubtree() to shift the subtree and prepare the shifts of\r\n * smaller subtrees. Finally, we add a new thread (if necessary).\r\n */\n\n\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n\n return ancestor;\n}\n/**\r\n * This function is used to traverse the right contour of a subtree.\r\n * It returns the rightmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\n\n\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\r\n * This function is used to traverse the left contour of a subtree (or a subforest).\r\n * It returns the leftmost child of node or the thread of node. The function\r\n * returns null if and only if node is on the highest depth of its subtree.\r\n */\n\n\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\r\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\r\n * Otherwise, returns the specified ancestor.\r\n */\n\n\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * Shifts the current subtree rooted at wr.\r\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\r\n */\n\n\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\r\n * The implementation of this function was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n */\n\n\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport SymbolClz from '../helper/Symbol.js';\nimport { radialCoordinate } from './layoutHelper.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport View from '../../coord/View.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport { parsePercent } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { setStatesStylesFromModel, setStatesFlag, setDefaultStateProxy, HOVER_STATE_BLUR } from '../../util/states.js';\n\nvar TreeEdgeShape =\n/** @class */\nfunction () {\n function TreeEdgeShape() {\n this.parentPoint = [];\n this.childPoints = [];\n }\n\n return TreeEdgeShape;\n}();\n\nvar TreePath =\n/** @class */\nfunction (_super) {\n __extends(TreePath, _super);\n\n function TreePath(opts) {\n return _super.call(this, opts) || this;\n }\n\n TreePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n TreePath.prototype.getDefaultShape = function () {\n return new TreeEdgeShape();\n };\n\n TreePath.prototype.buildPath = function (ctx, shape) {\n var childPoints = shape.childPoints;\n var childLen = childPoints.length;\n var parentPoint = shape.parentPoint;\n var firstChildPos = childPoints[0];\n var lastChildPos = childPoints[childLen - 1];\n\n if (childLen === 1) {\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(firstChildPos[0], firstChildPos[1]);\n return;\n }\n\n var orient = shape.orient;\n var forkDim = orient === 'TB' || orient === 'BT' ? 0 : 1;\n var otherDim = 1 - forkDim;\n var forkPosition = parsePercent(shape.forkPosition, 1);\n var tmpPoint = [];\n tmpPoint[forkDim] = parentPoint[forkDim];\n tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;\n ctx.moveTo(parentPoint[0], parentPoint[1]);\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.moveTo(firstChildPos[0], firstChildPos[1]);\n tmpPoint[forkDim] = firstChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n tmpPoint[forkDim] = lastChildPos[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n ctx.lineTo(lastChildPos[0], lastChildPos[1]);\n\n for (var i = 1; i < childLen - 1; i++) {\n var point = childPoints[i];\n ctx.moveTo(point[0], point[1]);\n tmpPoint[forkDim] = point[forkDim];\n ctx.lineTo(tmpPoint[0], tmpPoint[1]);\n }\n };\n\n return TreePath;\n}(Path);\n\nvar TreeView =\n/** @class */\nfunction (_super) {\n __extends(TreeView, _super);\n\n function TreeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreeView.type;\n _this._mainGroup = new graphic.Group();\n return _this;\n }\n\n TreeView.prototype.init = function (ecModel, api) {\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: this.group\n };\n this.group.add(this._mainGroup);\n };\n\n TreeView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var layoutInfo = seriesModel.layoutInfo;\n var group = this._mainGroup;\n var layout = seriesModel.get('layout');\n\n if (layout === 'radial') {\n group.x = layoutInfo.x + layoutInfo.width / 2;\n group.y = layoutInfo.y + layoutInfo.height / 2;\n } else {\n group.x = layoutInfo.x;\n group.y = layoutInfo.y;\n }\n\n this._updateViewCoordSys(seriesModel, api);\n\n this._updateController(seriesModel, ecModel, api);\n\n var oldData = this._data;\n data.diff(oldData).add(function (newIdx) {\n if (symbolNeedsDraw(data, newIdx)) {\n // Create node and edge\n updateNode(data, newIdx, null, group, seriesModel);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx);\n\n if (!symbolNeedsDraw(data, newIdx)) {\n symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n return;\n } // Update node and edge\n\n\n updateNode(data, newIdx, symbolEl, group, seriesModel);\n }).remove(function (oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // When remove a collapsed node of subtree, since the collapsed\n // node haven't been initialized with a symbol element,\n // you can't found it's symbol element through index.\n // so if we want to remove the symbol element we should insure\n // that the symbol element is not null.\n\n if (symbolEl) {\n removeNode(oldData, oldIdx, symbolEl, group, seriesModel);\n }\n }).execute();\n this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');\n\n this._updateNodeAndLinkScale(seriesModel);\n\n if (seriesModel.get('expandAndCollapse') === true) {\n data.eachItemGraphicEl(function (el, dataIndex) {\n el.off('click').on('click', function () {\n api.dispatchAction({\n type: 'treeExpandAndCollapse',\n seriesId: seriesModel.id,\n dataIndex: dataIndex\n });\n });\n });\n }\n\n this._data = data;\n };\n\n TreeView.prototype._updateViewCoordSys = function (seriesModel, api) {\n var data = seriesModel.getData();\n var points = [];\n data.each(function (idx) {\n var layout = data.getItemLayout(idx);\n\n if (layout && !isNaN(layout.x) && !isNaN(layout.y)) {\n points.push([+layout.x, +layout.y]);\n }\n });\n var min = [];\n var max = [];\n bbox.fromPoints(points, min, max); // If don't Store min max when collapse the root node after roam,\n // the root node will disappear.\n\n var oldMin = this._min;\n var oldMax = this._max; // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n min[0] = oldMin ? oldMin[0] : min[0] - 1;\n max[0] = oldMax ? oldMax[0] : max[0] + 1;\n }\n\n if (max[1] - min[1] === 0) {\n min[1] = oldMin ? oldMin[1] : min[1] - 1;\n max[1] = oldMax ? oldMax[1] : max[1] + 1;\n }\n\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom')); // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group\n\n this.group.attr({\n x: viewCoordSys.x,\n y: viewCoordSys.y,\n scaleX: viewCoordSys.scaleX,\n scaleY: viewCoordSys.scaleY\n });\n this._min = min;\n this._max = max;\n };\n\n TreeView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'treeRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale(seriesModel); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n TreeView.prototype._updateNodeAndLinkScale = function (seriesModel) {\n var data = seriesModel.getData();\n\n var nodeScale = this._getNodeGlobalScale(seriesModel);\n\n data.eachItemGraphicEl(function (el, idx) {\n el.setSymbolScale(nodeScale);\n });\n };\n\n TreeView.prototype._getNodeGlobalScale = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = this._nodeScaleRatio;\n var groupZoom = coordSys.scaleX || 1; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n };\n\n TreeView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n TreeView.prototype.remove = function () {\n this._mainGroup.removeAll();\n\n this._data = null;\n };\n\n TreeView.type = 'tree';\n return TreeView;\n}(ChartView);\n\nfunction symbolNeedsDraw(data, dataIndex) {\n var layout = data.getItemLayout(dataIndex);\n return layout && !isNaN(layout.x) && !isNaN(layout.y);\n}\n\nfunction updateNode(data, dataIndex, symbolEl, group, seriesModel) {\n var isInit = !symbolEl;\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var itemModel = node.getModel();\n var visualColor = node.getVisual('style').fill;\n var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : '#fff';\n var virtualRoot = data.tree.root;\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceLayout = source.getLayout();\n var sourceOldLayout = sourceSymbolEl ? {\n x: sourceSymbolEl.__oldX,\n y: sourceSymbolEl.__oldY,\n rawX: sourceSymbolEl.__radialOldRawX,\n rawY: sourceSymbolEl.__radialOldRawY\n } : sourceLayout;\n var targetLayout = node.getLayout();\n\n if (isInit) {\n symbolEl = new SymbolClz(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n symbolEl.x = sourceOldLayout.x;\n symbolEl.y = sourceOldLayout.y;\n } else {\n symbolEl.updateData(data, dataIndex, null, {\n symbolInnerColor: symbolInnerColor,\n useNameLabel: true\n });\n }\n\n symbolEl.__radialOldRawX = symbolEl.__radialRawX;\n symbolEl.__radialOldRawY = symbolEl.__radialRawY;\n symbolEl.__radialRawX = targetLayout.rawX;\n symbolEl.__radialRawY = targetLayout.rawY;\n group.add(symbolEl);\n data.setItemGraphicEl(dataIndex, symbolEl);\n symbolEl.__oldX = symbolEl.x;\n symbolEl.__oldY = symbolEl.y;\n graphic.updateProps(symbolEl, {\n x: targetLayout.x,\n y: targetLayout.y\n }, seriesModel);\n var symbolPath = symbolEl.getSymbolPath();\n\n if (seriesModel.get('layout') === 'radial') {\n var realRoot = virtualRoot.children[0];\n var rootLayout = realRoot.getLayout();\n var length_1 = realRoot.children.length;\n var rad = void 0;\n var isLeft = void 0;\n\n if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {\n var center = {\n x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,\n y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2\n };\n rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n isLeft = center.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {\n isLeft = targetLayout.x < rootLayout.x;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n } else {\n isLeft = targetLayout.x > rootLayout.x;\n\n if (!isLeft) {\n rad = rad - Math.PI;\n }\n }\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n var normalLabelModel = itemModel.getModel('label');\n var rotate = normalLabelModel.get('rotate');\n var labelRotateRadian = rotate * (Math.PI / 180);\n var textContent = symbolPath.getTextContent();\n\n if (textContent) {\n symbolPath.setTextConfig({\n position: normalLabelModel.get('position') || textPosition,\n rotation: rotate == null ? -rad : labelRotateRadian,\n origin: 'center'\n });\n textContent.setStyle('verticalAlign', 'middle');\n }\n } // Handle status\n\n\n var focus = itemModel.get(['emphasis', 'focus']);\n var focusDataIndices = focus === 'relative' ? zrUtil.concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : null;\n\n if (focusDataIndices) {\n // Modify the focus to data indices.\n getECData(symbolEl).focus = focusDataIndices;\n }\n\n drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);\n\n if (symbolEl.__edge) {\n symbolEl.onHoverStateChange = function (toState) {\n if (toState !== 'blur') {\n // NOTE: Ensure the parent elements will been blurred firstly.\n // According to the return of getAncestorsIndices and getDescendantIndices\n // TODO: A bit tricky.\n var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);\n\n if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {\n setStatesFlag(symbolEl.__edge, toState);\n }\n }\n };\n }\n}\n\nfunction drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {\n var itemModel = node.getModel();\n var edgeShape = seriesModel.get('edgeShape');\n var layout = seriesModel.get('layout');\n var orient = seriesModel.getOrient();\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n var edgeForkPosition = seriesModel.get('edgeForkPosition');\n var lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n var edge = symbolEl.__edge; // curve edge from node -> parent\n // polyline edge from node -> children\n\n if (edgeShape === 'curve') {\n if (node.parentNode && node.parentNode !== virtualRoot) {\n if (!edge) {\n edge = symbolEl.__edge = new graphic.BezierCurve({\n shape: getEdgeShape(layout, orient, curvature, sourceOldLayout, sourceOldLayout)\n });\n }\n\n graphic.updateProps(edge, {\n shape: getEdgeShape(layout, orient, curvature, sourceLayout, targetLayout)\n }, seriesModel);\n }\n } else if (edgeShape === 'polyline') {\n if (layout === 'orthogonal') {\n if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {\n var children = node.children;\n var childPoints = [];\n\n for (var i = 0; i < children.length; i++) {\n var childLayout = children[i].getLayout();\n childPoints.push([childLayout.x, childLayout.y]);\n }\n\n if (!edge) {\n edge = symbolEl.__edge = new TreePath({\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: [[targetLayout.x, targetLayout.y]],\n orient: orient,\n forkPosition: edgeForkPosition\n }\n });\n }\n\n graphic.updateProps(edge, {\n shape: {\n parentPoint: [targetLayout.x, targetLayout.y],\n childPoints: childPoints\n }\n }, seriesModel);\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('The polyline edgeShape can only be used in orthogonal layout');\n }\n }\n } // show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'\n\n\n if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {\n edge.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: null\n }, lineStyle));\n setStatesStylesFromModel(edge, itemModel, 'lineStyle');\n setDefaultStateProxy(edge);\n group.add(edge);\n }\n}\n\nfunction removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) {\n var virtualRoot = data.tree.root;\n\n var _a = getSourceNode(virtualRoot, node),\n source = _a.source,\n sourceLayout = _a.sourceLayout;\n\n var symbolEl = data.getItemGraphicEl(node.dataIndex);\n\n if (!symbolEl) {\n return;\n }\n\n var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);\n var sourceEdge = sourceSymbolEl.__edge; // 1. when expand the sub tree, delete the children node should delete the edge of\n // the source at the same time. because the polyline edge shape is only owned by the source.\n // 2.when the node is the only children of the source, delete the node should delete the edge of\n // the source at the same time. the same reason as above.\n\n var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : undefined);\n var edgeShape = seriesModel.get('edgeShape');\n var layoutOpt = seriesModel.get('layout');\n var orient = seriesModel.get('orient');\n var curvature = seriesModel.get(['lineStyle', 'curveness']);\n\n if (edge) {\n if (edgeShape === 'curve') {\n graphic.removeElement(edge, {\n shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n } else if (edgeShape === 'polyline' && seriesModel.get('layout') === 'orthogonal') {\n graphic.removeElement(edge, {\n shape: {\n parentPoint: [sourceLayout.x, sourceLayout.y],\n childPoints: [[sourceLayout.x, sourceLayout.y]]\n },\n style: {\n opacity: 0\n }\n }, seriesModel, {\n cb: function () {\n group.remove(edge);\n },\n removeOpt: removeAnimationOpt\n });\n }\n }\n}\n\nfunction getSourceNode(virtualRoot, node) {\n var source = node.parentNode === virtualRoot ? node : node.parentNode || node;\n var sourceLayout;\n\n while (sourceLayout = source.getLayout(), sourceLayout == null) {\n source = source.parentNode === virtualRoot ? source : source.parentNode || source;\n }\n\n return {\n source: source,\n sourceLayout: sourceLayout\n };\n}\n\nfunction removeNode(data, dataIndex, symbolEl, group, seriesModel) {\n var node = data.tree.getNodeByDataIndex(dataIndex);\n var virtualRoot = data.tree.root;\n var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout; // Use same duration and easing with update to have more consistent animation.\n\n var removeAnimationOpt = {\n duration: seriesModel.get('animationDurationUpdate'),\n easing: seriesModel.get('animationEasingUpdate')\n };\n graphic.removeElement(symbolEl, {\n x: sourceLayout.x + 1,\n y: sourceLayout.y + 1\n }, seriesModel, {\n cb: function () {\n group.remove(symbolEl);\n data.setItemGraphicEl(dataIndex, null);\n },\n removeOpt: removeAnimationOpt\n });\n symbolEl.fadeOut(null, data.hostModel, {\n fadeLabel: true,\n animation: removeAnimationOpt\n }); // remove edge as parent node\n\n node.children.forEach(function (childNode) {\n removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);\n }); // remove edge as child node\n\n removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);\n}\n\nfunction getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n var x1;\n var x2;\n var y1;\n var y2;\n\n if (layoutOpt === 'radial') {\n x1 = sourceLayout.rawX;\n y1 = sourceLayout.rawY;\n x2 = targetLayout.rawX;\n y2 = targetLayout.rawY;\n var radialCoor1 = radialCoordinate(x1, y1);\n var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);\n var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);\n var radialCoor4 = radialCoordinate(x2, y2);\n return {\n x1: radialCoor1.x || 0,\n y1: radialCoor1.y || 0,\n x2: radialCoor4.x || 0,\n y2: radialCoor4.y || 0,\n cpx1: radialCoor2.x || 0,\n cpy1: radialCoor2.y || 0,\n cpx2: radialCoor3.x || 0,\n cpy2: radialCoor3.y || 0\n };\n } else {\n x1 = sourceLayout.x;\n y1 = sourceLayout.y;\n x2 = targetLayout.x;\n y2 = targetLayout.y;\n\n if (orient === 'LR' || orient === 'RL') {\n cpx1 = x1 + (x2 - x1) * curvature;\n cpy1 = y1;\n cpx2 = x2 + (x1 - x2) * curvature;\n cpy2 = y2;\n }\n\n if (orient === 'TB' || orient === 'BT') {\n cpx1 = x1;\n cpy1 = y1 + (y2 - y1) * curvature;\n cpx2 = x2;\n cpy2 = y2 + (y1 - y2) * curvature;\n }\n }\n\n return {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n };\n}\n\nexport default TreeView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Link lists and struct (graph or tree)\r\n */\nimport { curry, each, assert, extend, map, keys } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\n\nfunction linkSeriesData(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = extend({}, inner(this).datas);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, inner(this).mainData, opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update();\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(inner(res).datas, function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\r\n * Supplement method to List.\r\n *\r\n * @public\r\n * @param [dataType] If not specified, return mainData.\r\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = inner(this).mainData;\n return dataType == null || mainData == null ? mainData : inner(mainData).datas[dataType];\n}\n/**\r\n * Get list of all linked data\r\n */\n\n\nfunction getLinkedDataAll() {\n var mainData = inner(this).mainData;\n return mainData == null ? [{\n data: mainData\n }] : map(keys(inner(mainData).datas), function (type) {\n return {\n type: type,\n data: inner(mainData).datas[type]\n };\n });\n}\n\nfunction isMainData(data) {\n return inner(data).mainData === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n inner(mainData).datas = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n inner(mainData).datas[dataType] = data;\n inner(data).mainData = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n data.getLinkedDataAll = getLinkedDataAll;\n}\n\nexport default linkSeriesData;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Tree data structure\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport linkSeriesData from './helper/linkSeriesData.js';\nimport SeriesData from './SeriesData.js';\nimport prepareSeriesDataSchema from './helper/createDimensions.js';\nimport { convertOptionIdName } from '../util/model.js';\n\nvar TreeNode =\n/** @class */\nfunction () {\n function TreeNode(name, hostTree) {\n this.depth = 0;\n this.height = 0;\n /**\r\n * Reference to list item.\r\n * Do not persistent dataIndex outside,\r\n * besause it may be changed by list.\r\n * If dataIndex -1,\r\n * this node is logical deleted (filtered) in list.\r\n */\n\n this.dataIndex = -1;\n this.children = [];\n this.viewChildren = [];\n this.isExpand = false;\n this.name = name || '';\n this.hostTree = hostTree;\n }\n /**\r\n * The node is removed.\r\n */\n\n\n TreeNode.prototype.isRemoved = function () {\n return this.dataIndex < 0;\n };\n\n TreeNode.prototype.eachNode = function (options, cb, context) {\n if (zrUtil.isFunction(options)) {\n context = cb;\n cb = options;\n options = null;\n }\n\n options = options || {};\n\n if (zrUtil.isString(options)) {\n options = {\n order: options\n };\n }\n\n var order = options.order || 'preorder';\n var children = this[options.attr || 'children'];\n var suppressVisitSub;\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n children[i].eachNode(options, cb, context);\n }\n\n order === 'postorder' && cb.call(context, this);\n };\n /**\r\n * Update depth and height of this subtree.\r\n */\n\n\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\n var height = 0;\n this.depth = depth;\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.updateDepthAndHeight(depth + 1);\n\n if (child.height > height) {\n height = child.height;\n }\n }\n\n this.height = height + 1;\n };\n\n TreeNode.prototype.getNodeById = function (id) {\n if (this.getId() === id) {\n return this;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].getNodeById(id);\n\n if (res) {\n return res;\n }\n }\n };\n\n TreeNode.prototype.contains = function (node) {\n if (node === this) {\n return true;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].contains(node);\n\n if (res) {\n return res;\n }\n }\n };\n /**\r\n * @param includeSelf Default false.\r\n * @return order: [root, child, grandchild, ...]\r\n */\n\n\n TreeNode.prototype.getAncestors = function (includeSelf) {\n var ancestors = [];\n var node = includeSelf ? this : this.parentNode;\n\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n\n ancestors.reverse();\n return ancestors;\n };\n\n TreeNode.prototype.getAncestorsIndices = function () {\n var indices = [];\n var currNode = this;\n\n while (currNode) {\n indices.push(currNode.dataIndex);\n currNode = currNode.parentNode;\n }\n\n indices.reverse();\n return indices;\n };\n\n TreeNode.prototype.getDescendantIndices = function () {\n var indices = [];\n this.eachNode(function (childNode) {\n indices.push(childNode.dataIndex);\n });\n return indices;\n };\n\n TreeNode.prototype.getValue = function (dimension) {\n var data = this.hostTree.data;\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n };\n\n TreeNode.prototype.setLayout = function (layout, merge) {\n this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n };\n /**\r\n * @return {Object} layout\r\n */\n\n\n TreeNode.prototype.getLayout = function () {\n return this.hostTree.data.getItemLayout(this.dataIndex);\n }; // @depcrecated\n // getModel(path: S): Model\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n TreeNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var hostTree = this.hostTree;\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n }; // TODO: TYPE More specific model\n\n\n TreeNode.prototype.getLevelModel = function () {\n return (this.hostTree.levelModels || [])[this.depth];\n };\n\n TreeNode.prototype.setVisual = function (key, value) {\n this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n };\n /**\r\n * Get item visual\r\n * FIXME: make return type better\r\n */\n\n\n TreeNode.prototype.getVisual = function (key) {\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\n };\n\n TreeNode.prototype.getRawIndex = function () {\n return this.hostTree.data.getRawIndex(this.dataIndex);\n };\n\n TreeNode.prototype.getId = function () {\n return this.hostTree.data.getId(this.dataIndex);\n };\n /**\r\n * index in parent's children\r\n */\n\n\n TreeNode.prototype.getChildIndex = function () {\n if (this.parentNode) {\n var children = this.parentNode.children;\n\n for (var i = 0; i < children.length; ++i) {\n if (children[i] === this) {\n return i;\n }\n }\n\n return -1;\n }\n\n return -1;\n };\n /**\r\n * if this is an ancestor of another node\r\n *\r\n * @param node another node\r\n * @return if is ancestor\r\n */\n\n\n TreeNode.prototype.isAncestorOf = function (node) {\n var parent = node.parentNode;\n\n while (parent) {\n if (parent === this) {\n return true;\n }\n\n parent = parent.parentNode;\n }\n\n return false;\n };\n /**\r\n * if this is an descendant of another node\r\n *\r\n * @param node another node\r\n * @return if is descendant\r\n */\n\n\n TreeNode.prototype.isDescendantOf = function (node) {\n return node !== this && node.isAncestorOf(this);\n };\n\n return TreeNode;\n}();\n\nexport { TreeNode };\n;\n\nvar Tree =\n/** @class */\nfunction () {\n function Tree(hostModel) {\n this.type = 'tree';\n this._nodes = [];\n this.hostModel = hostModel;\n }\n\n Tree.prototype.eachNode = function (options, cb, context) {\n this.root.eachNode(options, cb, context);\n };\n\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n var rawIndex = this.data.getRawIndex(dataIndex);\n return this._nodes[rawIndex];\n };\n\n Tree.prototype.getNodeById = function (name) {\n return this.root.getNodeById(name);\n };\n /**\r\n * Update item available by list,\r\n * when list has been performed options like 'filterSelf' or 'map'.\r\n */\n\n\n Tree.prototype.update = function () {\n var data = this.data;\n var nodes = this._nodes;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n };\n /**\r\n * Clear all layouts\r\n */\n\n\n Tree.prototype.clearLayouts = function () {\n this.data.clearItemLayouts();\n };\n /**\r\n * data node format:\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: [\r\n * {\r\n * name: ...\r\n * value: ...\r\n * children: ...\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\n\n\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n var tree = new Tree(hostModel);\n var listData = [];\n var dimMax = 1;\n buildHierarchy(dataRoot);\n\n function buildHierarchy(dataNode, parentNode) {\n var value = dataNode.value;\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n listData.push(dataNode);\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n parentNode ? addChild(node, parentNode) : tree.root = node;\n\n tree._nodes.push(node);\n\n var children = dataNode.children;\n\n if (children) {\n for (var i = 0; i < children.length; i++) {\n buildHierarchy(children[i], node);\n }\n }\n }\n\n tree.root.updateDepthAndHeight(0);\n var dimensions = prepareSeriesDataSchema(listData, {\n coordDimensions: ['value'],\n dimensionsCount: dimMax\n }).dimensions;\n var list = new SeriesData(dimensions, hostModel);\n list.initData(listData);\n beforeLink && beforeLink(list);\n linkSeriesData({\n mainData: list,\n struct: tree,\n structAttr: 'tree'\n });\n tree.update();\n return tree;\n };\n\n return Tree;\n}();\n/**\r\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\r\n * so this function is not ready and not necessary to be public.\r\n */\n\n\nfunction addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}\n\nexport default Tree;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {\n if (payload && zrUtil.indexOf(validPayloadTypes, payload.type) >= 0) {\n var root = seriesModel.getData().tree.root;\n var targetNode = payload.targetNode;\n\n if (zrUtil.isString(targetNode)) {\n targetNode = root.getNodeById(targetNode);\n }\n\n if (targetNode && root.contains(targetNode)) {\n return {\n node: targetNode\n };\n }\n\n var targetNodeId = payload.targetNodeId;\n\n if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {\n return {\n node: targetNode\n };\n }\n }\n} // Not includes the given node at the last item.\n\nexport function getPathToRoot(node) {\n var path = [];\n\n while (node) {\n node = node.parentNode;\n node && path.push(node);\n }\n\n return path.reverse();\n}\nexport function aboveViewRoot(viewRoot, node) {\n var viewPath = getPathToRoot(viewRoot);\n return zrUtil.indexOf(viewPath, node) >= 0;\n} // From root to the input node (the input node will be included).\n\nexport function wrapTreePathInfo(node, seriesModel) {\n var treePathInfo = [];\n\n while (node) {\n var nodeDataIndex = node.dataIndex;\n treePathInfo.push({\n name: node.name,\n dataIndex: nodeDataIndex,\n value: seriesModel.getRawValue(nodeDataIndex)\n });\n node = node.parentNode;\n }\n\n treePathInfo.reverse();\n return treePathInfo;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\n\nvar TreeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreeSeriesModel, _super);\n\n function TreeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.hasSymbolVisual = true; // Do it self.\n\n _this.ignoreStyleOnData = true;\n return _this;\n }\n /**\r\n * Init a tree data structure from data in option series\r\n */\n\n\n TreeSeriesModel.prototype.getInitialData = function (option) {\n // create a virtual root\n var root = {\n name: option.name,\n children: option.data\n };\n var leaves = option.leaves || {};\n var leavesModel = new Model(leaves, this, this.ecModel);\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n\n if (!(node && node.children.length && node.isExpand)) {\n model.parentModel = leavesModel;\n }\n\n return model;\n });\n }\n\n var treeDepth = 0;\n tree.eachNode('preorder', function (node) {\n if (node.depth > treeDepth) {\n treeDepth = node.depth;\n }\n });\n var expandAndCollapse = option.expandAndCollapse;\n var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;\n tree.root.eachNode('preorder', function (node) {\n var item = node.hostTree.data.getRawDataItem(node.dataIndex); // Add item.collapsed != null, because users can collapse node original in the series.data.\n\n node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;\n });\n return tree.data;\n };\n /**\r\n * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'.\r\n * @returns {string} orient\r\n */\n\n\n TreeSeriesModel.prototype.getOrient = function () {\n var orient = this.get('orient');\n\n if (orient === 'horizontal') {\n orient = 'LR';\n } else if (orient === 'vertical') {\n orient = 'TB';\n }\n\n return orient;\n };\n\n TreeSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n TreeSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n TreeSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var tree = this.getData().tree;\n var realRoot = tree.root.children[0];\n var node = tree.getNodeByDataIndex(dataIndex);\n var value = node.getValue();\n var name = node.name;\n\n while (node && node !== realRoot) {\n name = node.parentNode.name + '.' + name;\n node = node.parentNode;\n }\n\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value,\n noValue: isNaN(value) || value == null\n });\n }; // Add tree path to tooltip param\n\n\n TreeSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this);\n params.collapsed = !node.isExpand;\n return params;\n };\n\n TreeSeriesModel.type = 'series.tree'; // can support the position parameters 'left', 'top','right','bottom', 'width',\n // 'height' in the setOption() with 'merge' mode normal.\n\n TreeSeriesModel.layoutMode = 'box';\n TreeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // the position of the whole view\n left: '12%',\n top: '12%',\n right: '12%',\n bottom: '12%',\n // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'\n layout: 'orthogonal',\n // value can be 'polyline'\n edgeShape: 'curve',\n edgeForkPosition: '50%',\n // true | false | 'move' | 'scale', see module:component/helper/RoamController.\n roam: false,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.4,\n // Default on center of graph\n center: null,\n zoom: 1,\n orient: 'LR',\n symbol: 'emptyCircle',\n symbolSize: 7,\n expandAndCollapse: true,\n initialTreeDepth: 2,\n lineStyle: {\n color: '#ccc',\n width: 1.5,\n curveness: 0.5\n },\n itemStyle: {\n color: 'lightsteelblue',\n // borderColor: '#c23531',\n borderWidth: 1.5\n },\n label: {\n show: true\n },\n animationEasing: 'linear',\n animationDuration: 700,\n animationDurationUpdate: 500\n };\n return TreeSeriesModel;\n}(SeriesModel);\n\nexport default TreeSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Traverse the tree from bottom to top and do something\r\n */\nfunction eachAfter(root, callback, separation) {\n var nodes = [root];\n var next = [];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n next.push(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = 0; i < children.length; i++) {\n nodes.push(children[i]);\n }\n }\n }\n }\n\n while (node = next.pop()) {\n // jshint ignore:line\n callback(node, separation);\n }\n}\n/**\r\n * Traverse the tree from top to bottom and do something\r\n */\n\n\nfunction eachBefore(root, callback) {\n var nodes = [root];\n var node;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n callback(node);\n\n if (node.isExpand) {\n var children = node.children;\n\n if (children.length) {\n for (var i = children.length - 1; i >= 0; i--) {\n nodes.push(children[i]);\n }\n }\n }\n }\n}\n\nexport { eachAfter, eachBefore };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { eachAfter, eachBefore } from './traversalHelper.js';\nimport { init, firstWalk, secondWalk, separation as sep, radialCoordinate, getViewRect } from './layoutHelper.js';\nexport default function treeLayout(ecModel, api) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n commonLayout(seriesModel, api);\n });\n}\n\nfunction commonLayout(seriesModel, api) {\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var layout = seriesModel.get('layout');\n var width = 0;\n var height = 0;\n var separation = null;\n\n if (layout === 'radial') {\n width = 2 * Math.PI;\n height = Math.min(layoutInfo.height, layoutInfo.width) / 2;\n separation = sep(function (node1, node2) {\n return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;\n });\n } else {\n width = layoutInfo.width;\n height = layoutInfo.height;\n separation = sep();\n }\n\n var virtualRoot = seriesModel.getData().tree.root;\n var realRoot = virtualRoot.children[0];\n\n if (realRoot) {\n init(virtualRoot);\n eachAfter(realRoot, firstWalk, separation);\n virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;\n eachBefore(realRoot, secondWalk);\n var left_1 = realRoot;\n var right_1 = realRoot;\n var bottom_1 = realRoot;\n eachBefore(realRoot, function (node) {\n var x = node.getLayout().x;\n\n if (x < left_1.getLayout().x) {\n left_1 = node;\n }\n\n if (x > right_1.getLayout().x) {\n right_1 = node;\n }\n\n if (node.depth > bottom_1.depth) {\n bottom_1 = node;\n }\n });\n var delta = left_1 === right_1 ? 1 : separation(left_1, right_1) / 2;\n var tx_1 = delta - left_1.getLayout().x;\n var kx_1 = 0;\n var ky_1 = 0;\n var coorX_1 = 0;\n var coorY_1 = 0;\n\n if (layout === 'radial') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1); // here we use (node.depth - 1), bucause the real root's depth is 1\n\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = (node.depth - 1) * ky_1;\n var finalCoor = radialCoordinate(coorX_1, coorY_1);\n node.setLayout({\n x: finalCoor.x,\n y: finalCoor.y,\n rawX: coorX_1,\n rawY: coorY_1\n }, true);\n });\n } else {\n var orient_1 = seriesModel.getOrient();\n\n if (orient_1 === 'RL' || orient_1 === 'LR') {\n ky_1 = height / (right_1.getLayout().x + delta + tx_1);\n kx_1 = width / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorY_1 = (node.getLayout().x + tx_1) * ky_1;\n coorX_1 = orient_1 === 'LR' ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n } else if (orient_1 === 'TB' || orient_1 === 'BT') {\n kx_1 = width / (right_1.getLayout().x + delta + tx_1);\n ky_1 = height / (bottom_1.depth - 1 || 1);\n eachBefore(realRoot, function (node) {\n coorX_1 = (node.getLayout().x + tx_1) * kx_1;\n coorY_1 = orient_1 === 'TB' ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;\n node.setLayout({\n x: coorX_1,\n y: coorY_1\n }, true);\n });\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nexport default function treeVisual(ecModel) {\n ecModel.eachSeriesByType('tree', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel(); // TODO Optimize\n\n var style = model.getModel('itemStyle').getItemStyle();\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nexport function installTreeAction(registers) {\n registers.registerAction({\n type: 'treeExpandAndCollapse',\n event: 'treeExpandAndCollapse',\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var dataIndex = payload.dataIndex;\n var tree = seriesModel.getData().tree;\n var node = tree.getNodeByDataIndex(dataIndex);\n node.isExpand = !node.isExpand;\n });\n });\n registers.registerAction({\n type: 'treeRoam',\n event: 'treeRoam',\n // Here we set 'none' instead of 'update', because roam action\n // just need to update the transform matrix without having to recalculate\n // the layout. So don't need to go through the whole update process, such\n // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.\n update: 'none'\n }, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'tree',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport TreeView from './TreeView.js';\nimport TreeSeriesModel from './TreeSeries.js';\nimport treeLayout from './treeLayout.js';\nimport treeVisual from './treeVisual.js';\nimport { installTreeAction } from './treeAction.js';\nexport function install(registers) {\n registers.registerChartView(TreeView);\n registers.registerSeriesModel(TreeSeriesModel);\n registers.registerLayout(treeLayout);\n registers.registerVisual(treeVisual);\n installTreeAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as helper from '../helper/treeHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionTypes = ['treemapZoomToNode', 'treemapRender', 'treemapMove'];\nexport function installTreemapAction(registers) {\n for (var i = 0; i < actionTypes.length; i++) {\n registers.registerAction({\n type: actionTypes[i],\n update: 'updateView'\n }, noop);\n }\n\n registers.registerAction({\n type: 'treemapRootToNode',\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { getDecalFromPalette } from '../../model/mixin/palette.js';\nexport default function enableAriaDecalForTree(seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n var decalPaletteScope = {};\n tree.eachNode(function (node) {\n // Use decal of level 1 node\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + '', decalPaletteScope);\n node.setVisual('decal', decal);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport Model from '../../model/Model.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\n\nvar TreemapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(TreemapSeriesModel, _super);\n\n function TreemapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapSeriesModel.type;\n _this.preventUsingHoverLayer = true;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TreemapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levels = option.levels || []; // Used in \"visual priority\" in `treemapVisual.js`.\n // This way is a little tricky, must satisfy the precondition:\n // 1. There is no `treeNode.getModel('itemStyle.xxx')` used.\n // 2. The `Model.prototype.getModel()` will not use any clone-like way.\n\n var designatedVisualItemStyle = this.designatedVisualItemStyle = {};\n var designatedVisualModel = new Model({\n itemStyle: designatedVisualItemStyle\n }, this, ecModel);\n levels = option.levels = setDefault(levels, ecModel);\n var levelModels = zrUtil.map(levels || [], function (levelDefine) {\n return new Model(levelDefine, designatedVisualModel, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = node ? levelModels[node.depth] : null; // If no levelModel, we also need `designatedVisualModel`.\n\n model.parentModel = levelModel || designatedVisualModel;\n return model;\n });\n }\n\n return tree.data;\n };\n\n TreemapSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /**\r\n * @override\r\n * @param {number} dataIndex\r\n * @param {boolean} [mutipleSeries=false]\r\n */\n\n\n TreemapSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var name = data.getName(dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n /**\r\n * Add tree path to tooltip param\r\n *\r\n * @override\r\n * @param {number} dataIndex\r\n * @return {Object}\r\n */\n\n\n TreemapSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treeAncestors = wrapTreePathInfo(node, this); // compatitable the previous code.\n\n params.treePathInfo = params.treeAncestors;\n return params;\n };\n /**\r\n * @public\r\n * @param {Object} layoutInfo {\r\n * x: containerGroup x\r\n * y: containerGroup y\r\n * width: containerGroup width\r\n * height: containerGroup height\r\n * }\r\n */\n\n\n TreemapSeriesModel.prototype.setLayoutInfo = function (layoutInfo) {\n /**\r\n * @readOnly\r\n * @type {Object}\r\n */\n this.layoutInfo = this.layoutInfo || {};\n zrUtil.extend(this.layoutInfo, layoutInfo);\n };\n /**\r\n * @param {string} id\r\n * @return {number} index\r\n */\n\n\n TreemapSeriesModel.prototype.mapIdToIndex = function (id) {\n // A feature is implemented:\n // index is monotone increasing with the sequence of\n // input id at the first time.\n // This feature can make sure that each data item and its\n // mapped color have the same index between data list and\n // color list at the beginning, which is useful for user\n // to adjust data-color mapping.\n\n /**\r\n * @private\r\n * @type {Object}\r\n */\n var idIndexMap = this._idIndexMap;\n\n if (!idIndexMap) {\n idIndexMap = this._idIndexMap = zrUtil.createHashMap();\n /**\r\n * @private\r\n * @type {number}\r\n */\n\n this._idIndexMapCount = 0;\n }\n\n var index = idIndexMap.get(id);\n\n if (index == null) {\n idIndexMap.set(id, index = this._idIndexMapCount++);\n }\n\n return index;\n };\n\n TreemapSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n TreemapSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n TreemapSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n TreemapSeriesModel.type = 'series.treemap';\n TreemapSeriesModel.layoutMode = 'box';\n TreemapSeriesModel.defaultOption = {\n // Disable progressive rendering\n progressive: 0,\n // size: ['80%', '80%'], // deprecated, compatible with ec2.\n left: 'center',\n top: 'middle',\n width: '80%',\n height: '80%',\n sort: true,\n clipWindow: 'origin',\n squareRatio: 0.5 * (1 + Math.sqrt(5)),\n leafDepth: null,\n drillDownIcon: '▶',\n // to align specialized icon. ▷▶❒❐▼✚\n zoomToNodeRatio: 0.32 * 0.32,\n roam: true,\n nodeClick: 'zoomToNode',\n animation: true,\n animationDurationUpdate: 900,\n animationEasing: 'quinticInOut',\n breadcrumb: {\n show: true,\n height: 22,\n left: 'center',\n top: 'bottom',\n // right\n // bottom\n emptyItemWidth: 25,\n itemStyle: {\n color: 'rgba(0,0,0,0.7)',\n textStyle: {\n color: '#fff'\n }\n },\n emphasis: {\n itemStyle: {\n color: 'rgba(0,0,0,0.9)' // '#5793f3',\n\n }\n }\n },\n label: {\n show: true,\n // Do not use textDistance, for ellipsis rect just the same as treemap node rect.\n distance: 0,\n padding: 5,\n position: 'inside',\n // formatter: null,\n color: '#fff',\n overflow: 'truncate' // align\n // verticalAlign\n\n },\n upperLabel: {\n show: false,\n position: [0, '50%'],\n height: 20,\n // formatter: null,\n // color: '#fff',\n overflow: 'truncate',\n // align: null,\n verticalAlign: 'middle'\n },\n itemStyle: {\n color: null,\n colorAlpha: null,\n colorSaturation: null,\n borderWidth: 0,\n gapWidth: 0,\n borderColor: '#fff',\n borderColorSaturation: null // If specified, borderColor will be ineffective, and the\n // border color is evaluated by color of current node and\n // borderColorSaturation.\n\n },\n emphasis: {\n upperLabel: {\n show: true,\n position: [0, '50%'],\n overflow: 'truncate',\n verticalAlign: 'middle'\n }\n },\n visualDimension: 0,\n visualMin: null,\n visualMax: null,\n color: [],\n // level[n].color (if necessary).\n // + Specify color list of each level. level[0].color would be global\n // color list if not specified. (see method `setDefault`).\n // + But set as a empty array to forbid fetch color from global palette\n // when using nodeModel.get('color'), otherwise nodes on deep level\n // will always has color palette set and are not able to inherit color\n // from parent node.\n // + TreemapSeries.color can not be set as 'none', otherwise effect\n // legend color fetching (see seriesColor.js).\n colorAlpha: null,\n colorSaturation: null,\n colorMappingBy: 'index',\n visibleMin: 10,\n // be rendered. Only works when sort is 'asc' or 'desc'.\n childrenVisibleMin: null,\n // grandchildren will not show.\n // Why grandchildren? If not grandchildren but children,\n // some siblings show children and some not,\n // the appearance may be mess and not consistent,\n levels: [] // Each item: {\n // visibleMin, itemStyle, visualDimension, label\n // }\n\n };\n return TreemapSeriesModel;\n}(SeriesModel);\n/**\r\n * @param {Object} dataNode\r\n */\n\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value;\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n/**\r\n * set default to level configuration\r\n */\n\n\nfunction setDefault(levels, ecModel) {\n var globalColorList = normalizeToArray(ecModel.get('color'));\n var globalDecalList = normalizeToArray(ecModel.get(['aria', 'decal', 'decals']));\n\n if (!globalColorList) {\n return;\n }\n\n levels = levels || [];\n var hasColorDefine;\n var hasDecalDefine;\n zrUtil.each(levels, function (levelDefine) {\n var model = new Model(levelDefine);\n var modelColor = model.get('color');\n var modelDecal = model.get('decal');\n\n if (model.get(['itemStyle', 'color']) || modelColor && modelColor !== 'none') {\n hasColorDefine = true;\n }\n\n if (model.get(['itemStyle', 'decal']) || modelDecal && modelDecal !== 'none') {\n hasDecalDefine = true;\n }\n });\n var level0 = levels[0] || (levels[0] = {});\n\n if (!hasColorDefine) {\n level0.color = globalColorList.slice();\n }\n\n if (!hasDecalDefine && globalDecalList) {\n level0.decal = globalDecalList.slice();\n }\n\n return levels;\n}\n\nexport default TreemapSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport * as layout from '../../util/layout.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport { curry, defaults } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName } from '../../util/model.js';\nimport { toggleHoverEmphasis, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar TEXT_PADDING = 8;\nvar ITEM_GAP = 8;\nvar ARRAY_LENGTH = 5;\n\nvar Breadcrumb =\n/** @class */\nfunction () {\n function Breadcrumb(containerGroup) {\n this.group = new graphic.Group();\n containerGroup.add(this.group);\n }\n\n Breadcrumb.prototype.render = function (seriesModel, api, targetNode, onSelect) {\n var model = seriesModel.getModel('breadcrumb');\n var thisGroup = this.group;\n thisGroup.removeAll();\n\n if (!model.get('show') || !targetNode) {\n return;\n }\n\n var normalStyleModel = model.getModel('itemStyle');\n var emphasisModel = model.getModel('emphasis');\n var textStyleModel = normalStyleModel.getModel('textStyle');\n var emphasisTextStyleModel = emphasisModel.getModel(['itemStyle', 'textStyle']);\n var layoutParam = {\n pos: {\n left: model.get('left'),\n right: model.get('right'),\n top: model.get('top'),\n bottom: model.get('bottom')\n },\n box: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n emptyItemWidth: model.get('emptyItemWidth'),\n totalWidth: 0,\n renderList: []\n };\n\n this._prepare(targetNode, layoutParam, textStyleModel);\n\n this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect);\n\n layout.positionElement(thisGroup, layoutParam.pos, layoutParam.box);\n };\n /**\r\n * Prepare render list and total width\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._prepare = function (targetNode, layoutParam, textStyleModel) {\n for (var node = targetNode; node; node = node.parentNode) {\n var text = convertOptionIdName(node.getModel().get('name'), '');\n var textRect = textStyleModel.getTextRect(text);\n var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);\n layoutParam.totalWidth += itemWidth + ITEM_GAP;\n layoutParam.renderList.push({\n node: node,\n text: text,\n width: itemWidth\n });\n }\n };\n /**\r\n * @private\r\n */\n\n\n Breadcrumb.prototype._renderContent = function (seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) {\n // Start rendering.\n var lastX = 0;\n var emptyItemWidth = layoutParam.emptyItemWidth;\n var height = seriesModel.get(['breadcrumb', 'height']);\n var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);\n var totalWidth = layoutParam.totalWidth;\n var renderList = layoutParam.renderList;\n var emphasisItemStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n\n for (var i = renderList.length - 1; i >= 0; i--) {\n var item = renderList[i];\n var itemNode = item.node;\n var itemWidth = item.width;\n var text = item.text; // Hdie text and shorten width if necessary.\n\n if (totalWidth > availableSize.width) {\n totalWidth -= itemWidth - emptyItemWidth;\n itemWidth = emptyItemWidth;\n text = null;\n }\n\n var el = new graphic.Polygon({\n shape: {\n points: makeItemPoints(lastX, 0, itemWidth, height, i === renderList.length - 1, i === 0)\n },\n style: defaults(normalStyleModel.getItemStyle(), {\n lineJoin: 'bevel'\n }),\n textContent: new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: text\n })\n }),\n textConfig: {\n position: 'inside'\n },\n z2: Z2_EMPHASIS_LIFT * 1e4,\n onclick: curry(onSelect, itemNode)\n });\n el.disableLabelAnimation = true;\n el.getTextContent().ensureState('emphasis').style = createTextStyle(emphasisTextStyleModel, {\n text: text\n });\n el.ensureState('emphasis').style = emphasisItemStyle;\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n this.group.add(el);\n packEventData(el, seriesModel, itemNode);\n lastX += itemWidth + ITEM_GAP;\n }\n };\n\n Breadcrumb.prototype.remove = function () {\n this.group.removeAll();\n };\n\n return Breadcrumb;\n}();\n\nfunction makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {\n var points = [[head ? x : x - ARRAY_LENGTH, y], [x + itemWidth, y], [x + itemWidth, y + itemHeight], [head ? x : x - ARRAY_LENGTH, y + itemHeight]];\n !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);\n !head && points.push([x, y + itemHeight / 2]);\n return points;\n} // Package custom mouse event.\n\n\nfunction packEventData(el, seriesModel, itemNode) {\n getECData(el).eventData = {\n componentType: 'series',\n componentSubType: 'treemap',\n componentIndex: seriesModel.componentIndex,\n seriesIndex: seriesModel.seriesIndex,\n seriesName: seriesModel.name,\n seriesType: 'treemap',\n selfType: 'breadcrumb',\n nodeData: {\n dataIndex: itemNode && itemNode.dataIndex,\n name: itemNode && itemNode.name\n },\n treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)\n };\n}\n\nexport default Breadcrumb;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Animate multiple elements with a single done-callback.\r\n *\r\n * @example\r\n * animation\r\n * .createWrap()\r\n * .add(el1, {x: 10, y: 10})\r\n * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)\r\n * .done(function () { // done })\r\n * .start('cubicOut');\r\n */\nvar AnimationWrap =\n/** @class */\nfunction () {\n function AnimationWrap() {\n this._storage = [];\n this._elExistsMap = {};\n }\n /**\r\n * Caution: a el can only be added once, otherwise 'done'\r\n * might not be called. This method checks this (by el.id),\r\n * suppresses adding and returns false when existing el found.\r\n *\r\n * @return Whether adding succeeded.\r\n */\n\n\n AnimationWrap.prototype.add = function (el, target, duration, delay, easing) {\n if (this._elExistsMap[el.id]) {\n return false;\n }\n\n this._elExistsMap[el.id] = true;\n\n this._storage.push({\n el: el,\n target: target,\n duration: duration,\n delay: delay,\n easing: easing\n });\n\n return true;\n };\n /**\r\n * Only execute when animation done/aborted.\r\n */\n\n\n AnimationWrap.prototype.finished = function (callback) {\n this._finishedCallback = callback;\n return this;\n };\n /**\r\n * Will stop exist animation firstly.\r\n */\n\n\n AnimationWrap.prototype.start = function () {\n var _this = this;\n\n var count = this._storage.length;\n\n var checkTerminate = function () {\n count--;\n\n if (count <= 0) {\n // Guard.\n _this._storage.length = 0;\n _this._elExistsMap = {};\n _this._finishedCallback && _this._finishedCallback();\n }\n };\n\n for (var i = 0, len = this._storage.length; i < len; i++) {\n var item = this._storage[i];\n item.el.animateTo(item.target, {\n duration: item.duration,\n delay: item.delay,\n easing: item.easing,\n setToFinal: true,\n done: checkTerminate,\n aborted: checkTerminate\n });\n }\n\n return this;\n };\n\n return AnimationWrap;\n}();\n\nexport function createWrap() {\n return new AnimationWrap();\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, indexOf, curry, extend, normalizeCssArray, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isHighDownDispatcher, setAsHighDownDispatcher, setDefaultStateProxy, enableHoverFocus, Z2_EMPHASIS_LIFT } from '../../util/states.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as helper from '../helper/treeHelper.js';\nimport Breadcrumb from './Breadcrumb.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as animationUtil from '../../util/animation.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport ChartView from '../../view/Chart.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { makeInner, convertOptionIdName } from '../../util/model.js';\nimport { windowOpen } from '../../util/format.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nvar Group = graphic.Group;\nvar Rect = graphic.Rect;\nvar DRAG_THRESHOLD = 3;\nvar PATH_LABEL_NOAMAL = 'label';\nvar PATH_UPPERLABEL_NORMAL = 'upperLabel'; // Should larger than emphasis states lift z\n\nvar Z2_BASE = Z2_EMPHASIS_LIFT * 10; // Should bigger than every z2.\n\nvar Z2_BG = Z2_EMPHASIS_LIFT * 2;\nvar Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;\nvar getStateItemStyle = makeStyleMapper([['fill', 'color'], // `borderColor` and `borderWidth` has been occupied,\n// so use `stroke` to indicate the stroke of the rect.\n['stroke', 'strokeColor'], ['lineWidth', 'strokeWidth'], ['shadowBlur'], ['shadowOffsetX'], ['shadowOffsetY'], ['shadowColor'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n// So do not transfer decal directly.\n]);\n\nvar getItemStyleNormal = function (model) {\n // Normal style props should include emphasis style props.\n var itemStyle = getStateItemStyle(model); // Clear styles set by emphasis.\n\n itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;\n return itemStyle;\n};\n\nvar inner = makeInner();\n\nvar TreemapView =\n/** @class */\nfunction (_super) {\n __extends(TreemapView, _super);\n\n function TreemapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TreemapView.type;\n _this._state = 'ready';\n _this._storage = createStorage();\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TreemapView.prototype.render = function (seriesModel, ecModel, api, payload) {\n var models = ecModel.findComponents({\n mainType: 'series',\n subType: 'treemap',\n query: payload\n });\n\n if (indexOf(models, seriesModel) < 0) {\n return;\n }\n\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var payloadType = payload && payload.type;\n var layoutInfo = seriesModel.layoutInfo;\n var isInit = !this._oldTree;\n var thisStorage = this._storage; // Mark new root when action is treemapRootToNode.\n\n var reRoot = payloadType === 'treemapRootToNode' && targetInfo && thisStorage ? {\n rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],\n direction: payload.direction\n } : null;\n\n var containerGroup = this._giveContainerGroup(layoutInfo);\n\n var hasAnimation = seriesModel.get('animation');\n\n var renderResult = this._doRender(containerGroup, seriesModel, reRoot);\n\n hasAnimation && !isInit && (!payloadType || payloadType === 'treemapZoomToNode' || payloadType === 'treemapRootToNode') ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();\n\n this._resetController(api);\n\n this._renderBreadcrumb(seriesModel, api, targetInfo);\n };\n\n TreemapView.prototype._giveContainerGroup = function (layoutInfo) {\n var containerGroup = this._containerGroup;\n\n if (!containerGroup) {\n // FIXME\n // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。\n containerGroup = this._containerGroup = new Group();\n\n this._initEvents(containerGroup);\n\n this.group.add(containerGroup);\n }\n\n containerGroup.x = layoutInfo.x;\n containerGroup.y = layoutInfo.y;\n return containerGroup;\n };\n\n TreemapView.prototype._doRender = function (containerGroup, seriesModel, reRoot) {\n var thisTree = seriesModel.getData().tree;\n var oldTree = this._oldTree; // Clear last shape records.\n\n var lastsForAnimation = createStorage();\n var thisStorage = createStorage();\n var oldStorage = this._storage;\n var willInvisibleEls = [];\n\n function doRenderNode(thisNode, oldNode, parentGroup, depth) {\n return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);\n } // Notice: When thisTree and oldTree are the same tree (see list.cloneShallow),\n // the oldTree is actually losted, so we cannot find all of the old graphic\n // elements from tree. So we use this strategy: make element storage, move\n // from old storage to new storage, clear old storage.\n\n\n dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0); // Process all removing.\n\n var willDeleteEls = clearStorage(oldStorage);\n this._oldTree = thisTree;\n this._storage = thisStorage;\n return {\n lastsForAnimation: lastsForAnimation,\n willDeleteEls: willDeleteEls,\n renderFinally: renderFinally\n };\n\n function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {\n // When 'render' is triggered by action,\n // 'this' and 'old' may be the same tree,\n // we use rawIndex in that case.\n if (sameTree) {\n oldViewChildren = thisViewChildren;\n each(thisViewChildren, function (child, index) {\n !child.isRemoved() && processNode(index, index);\n });\n } // Diff hierarchically (diff only in each subtree, but not whole).\n // because, consistency of view is important.\n else {\n new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey).add(processNode).update(processNode).remove(curry(processNode, null)).execute();\n }\n\n function getKey(node) {\n // Identify by name or raw index.\n return node.getId();\n }\n\n function processNode(newIndex, oldIndex) {\n var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;\n var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;\n var group = doRenderNode(thisNode, oldNode, parentGroup, depth);\n group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);\n }\n }\n\n function clearStorage(storage) {\n var willDeleteEls = createStorage();\n storage && each(storage, function (store, storageName) {\n var delEls = willDeleteEls[storageName];\n each(store, function (el) {\n el && (delEls.push(el), inner(el).willDelete = true);\n });\n });\n return willDeleteEls;\n }\n\n function renderFinally() {\n each(willDeleteEls, function (els) {\n each(els, function (el) {\n el.parent && el.parent.remove(el);\n });\n });\n each(willInvisibleEls, function (el) {\n el.invisible = true; // Setting invisible is for optimizing, so no need to set dirty,\n // just mark as invisible.\n\n el.dirty();\n });\n }\n };\n\n TreemapView.prototype._doAnimation = function (containerGroup, renderResult, seriesModel, reRoot) {\n var durationOption = seriesModel.get('animationDurationUpdate');\n var easingOption = seriesModel.get('animationEasing'); // TODO: do not support function until necessary.\n\n var duration = (isFunction(durationOption) ? 0 : durationOption) || 0;\n var easing = (isFunction(easingOption) ? null : easingOption) || 'cubicOut';\n var animationWrap = animationUtil.createWrap(); // Make delete animations.\n\n each(renderResult.willDeleteEls, function (store, storageName) {\n each(store, function (el, rawIndex) {\n if (el.invisible) {\n return;\n }\n\n var parent = el.parent; // Always has parent, and parent is nodeGroup.\n\n var target;\n var innerStore = inner(parent);\n\n if (reRoot && reRoot.direction === 'drillDown') {\n target = parent === reRoot.rootNodeGroup // This is the content element of view root.\n // Only `content` will enter this branch, because\n // `background` and `nodeGroup` will not be deleted.\n ? {\n shape: {\n x: 0,\n y: 0,\n width: innerStore.nodeWidth,\n height: innerStore.nodeHeight\n },\n style: {\n opacity: 0\n }\n } // Others.\n : {\n style: {\n opacity: 0\n }\n };\n } else {\n var targetX = 0;\n var targetY = 0;\n\n if (!innerStore.willDelete) {\n // Let node animate to right-bottom corner, cooperating with fadeout,\n // which is appropriate for user understanding.\n // Divided by 2 for reRoot rolling up effect.\n targetX = innerStore.nodeWidth / 2;\n targetY = innerStore.nodeHeight / 2;\n }\n\n target = storageName === 'nodeGroup' ? {\n x: targetX,\n y: targetY,\n style: {\n opacity: 0\n }\n } : {\n shape: {\n x: targetX,\n y: targetY,\n width: 0,\n height: 0\n },\n style: {\n opacity: 0\n }\n };\n } // TODO: do not support delay until necessary.\n\n\n target && animationWrap.add(el, target, duration, 0, easing);\n });\n }); // Make other animations\n\n each(this._storage, function (store, storageName) {\n each(store, function (el, rawIndex) {\n var last = renderResult.lastsForAnimation[storageName][rawIndex];\n var target = {};\n\n if (!last) {\n return;\n }\n\n if (el instanceof graphic.Group) {\n if (last.oldX != null) {\n target.x = el.x;\n target.y = el.y;\n el.x = last.oldX;\n el.y = last.oldY;\n }\n } else {\n if (last.oldShape) {\n target.shape = extend({}, el.shape);\n el.setShape(last.oldShape);\n }\n\n if (last.fadein) {\n el.setStyle('opacity', 0);\n target.style = {\n opacity: 1\n };\n } // When animation is stopped for succedent animation starting,\n // el.style.opacity might not be 1\n else if (el.style.opacity !== 1) {\n target.style = {\n opacity: 1\n };\n }\n }\n\n animationWrap.add(el, target, duration, 0, easing);\n });\n }, this);\n this._state = 'animating';\n animationWrap.finished(bind(function () {\n this._state = 'ready';\n renderResult.renderFinally();\n }, this)).start();\n };\n\n TreemapView.prototype._resetController = function (api) {\n var controller = this._controller; // Init controller.\n\n if (!controller) {\n controller = this._controller = new RoamController(api.getZr());\n controller.enable(this.seriesModel.get('roam'));\n controller.on('pan', bind(this._onPan, this));\n controller.on('zoom', bind(this._onZoom, this));\n }\n\n var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());\n controller.setPointerChecker(function (e, x, y) {\n return rect.contain(x, y);\n });\n };\n\n TreemapView.prototype._clearController = function () {\n var controller = this._controller;\n\n if (controller) {\n controller.dispose();\n controller = null;\n }\n };\n\n TreemapView.prototype._onPan = function (e) {\n if (this._state !== 'animating' && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD)) {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n this.api.dispatchAction({\n type: 'treemapMove',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rootLayout.x + e.dx,\n y: rootLayout.y + e.dy,\n width: rootLayout.width,\n height: rootLayout.height\n }\n });\n }\n };\n\n TreemapView.prototype._onZoom = function (e) {\n var mouseX = e.originX;\n var mouseY = e.originY;\n\n if (this._state !== 'animating') {\n // These param must not be cached.\n var root = this.seriesModel.getData().tree.root;\n\n if (!root) {\n return;\n }\n\n var rootLayout = root.getLayout();\n\n if (!rootLayout) {\n return;\n }\n\n var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);\n var layoutInfo = this.seriesModel.layoutInfo; // Transform mouse coord from global to containerGroup.\n\n mouseX -= layoutInfo.x;\n mouseY -= layoutInfo.y; // Scale root bounding rect.\n\n var m = matrix.create();\n matrix.translate(m, m, [-mouseX, -mouseY]);\n matrix.scale(m, m, [e.scale, e.scale]);\n matrix.translate(m, m, [mouseX, mouseY]);\n rect.applyTransform(m);\n this.api.dispatchAction({\n type: 'treemapRender',\n from: this.uid,\n seriesId: this.seriesModel.id,\n rootRect: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n }\n };\n\n TreemapView.prototype._initEvents = function (containerGroup) {\n var _this = this;\n\n containerGroup.on('click', function (e) {\n if (_this._state !== 'ready') {\n return;\n }\n\n var nodeClick = _this.seriesModel.get('nodeClick', true);\n\n if (!nodeClick) {\n return;\n }\n\n var targetInfo = _this.findTarget(e.offsetX, e.offsetY);\n\n if (!targetInfo) {\n return;\n }\n\n var node = targetInfo.node;\n\n if (node.getLayout().isLeafRoot) {\n _this._rootToNode(targetInfo);\n } else {\n if (nodeClick === 'zoomToNode') {\n _this._zoomToNode(targetInfo);\n } else if (nodeClick === 'link') {\n var itemModel = node.hostTree.data.getItemModel(node.dataIndex);\n var link = itemModel.get('link', true);\n var linkTarget = itemModel.get('target', true) || 'blank';\n link && windowOpen(link, linkTarget);\n }\n }\n }, this);\n };\n\n TreemapView.prototype._renderBreadcrumb = function (seriesModel, api, targetInfo) {\n var _this = this;\n\n if (!targetInfo) {\n targetInfo = seriesModel.get('leafDepth', true) != null ? {\n node: seriesModel.getViewRoot()\n } // FIXME\n // better way?\n // Find breadcrumb tail on center of containerGroup.\n : this.findTarget(api.getWidth() / 2, api.getHeight() / 2);\n\n if (!targetInfo) {\n targetInfo = {\n node: seriesModel.getData().tree.root\n };\n }\n }\n\n (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api, targetInfo.node, function (node) {\n if (_this._state !== 'animating') {\n helper.aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({\n node: node\n }) : _this._zoomToNode({\n node: node\n });\n }\n });\n };\n /**\r\n * @override\r\n */\n\n\n TreemapView.prototype.remove = function () {\n this._clearController();\n\n this._containerGroup && this._containerGroup.removeAll();\n this._storage = createStorage();\n this._state = 'ready';\n this._breadcrumb && this._breadcrumb.remove();\n };\n\n TreemapView.prototype.dispose = function () {\n this._clearController();\n };\n\n TreemapView.prototype._zoomToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapZoomToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n\n TreemapView.prototype._rootToNode = function (targetInfo) {\n this.api.dispatchAction({\n type: 'treemapRootToNode',\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: targetInfo.node\n });\n };\n /**\r\n * @public\r\n * @param {number} x Global coord x.\r\n * @param {number} y Global coord y.\r\n * @return {Object} info If not found, return undefined;\r\n * @return {number} info.node Target node.\r\n * @return {number} info.offsetX x refer to target node.\r\n * @return {number} info.offsetY y refer to target node.\r\n */\n\n\n TreemapView.prototype.findTarget = function (x, y) {\n var targetInfo;\n var viewRoot = this.seriesModel.getViewRoot();\n viewRoot.eachNode({\n attr: 'viewChildren',\n order: 'preorder'\n }, function (node) {\n var bgEl = this._storage.background[node.getRawIndex()]; // If invisible, there might be no element.\n\n\n if (bgEl) {\n var point = bgEl.transformCoordToLocal(x, y);\n var shape = bgEl.shape; // For performance consideration, don't use 'getBoundingRect'.\n\n if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {\n targetInfo = {\n node: node,\n offsetX: point[0],\n offsetY: point[1]\n };\n } else {\n return false; // Suppress visit subtree.\n }\n }\n }, this);\n return targetInfo;\n };\n\n TreemapView.type = 'treemap';\n return TreemapView;\n}(ChartView);\n/**\r\n * @inner\r\n */\n\n\nfunction createStorage() {\n return {\n nodeGroup: [],\n background: [],\n content: []\n };\n}\n/**\r\n * @inner\r\n * @return Return undefined means do not travel further.\r\n */\n\n\nfunction renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {\n // Whether under viewRoot.\n if (!thisNode) {\n // Deleting nodes will be performed finally. This method just find\n // element from old storage, or create new element, set them to new\n // storage, and set styles.\n return;\n } // -------------------------------------------------------------------\n // Start of closure variables available in \"Procedures in renderNode\".\n\n\n var thisLayout = thisNode.getLayout();\n var data = seriesModel.getData();\n var nodeModel = thisNode.getModel(); // Only for enabling highlight/downplay. Clear firstly.\n // Because some node will not be rendered.\n\n data.setItemGraphicEl(thisNode.dataIndex, null);\n\n if (!thisLayout || !thisLayout.isInView) {\n return;\n }\n\n var thisWidth = thisLayout.width;\n var thisHeight = thisLayout.height;\n var borderWidth = thisLayout.borderWidth;\n var thisInvisible = thisLayout.invisible;\n var thisRawIndex = thisNode.getRawIndex();\n var oldRawIndex = oldNode && oldNode.getRawIndex();\n var thisViewChildren = thisNode.viewChildren;\n var upperHeight = thisLayout.upperHeight;\n var isParent = thisViewChildren && thisViewChildren.length;\n var itemStyleNormalModel = nodeModel.getModel('itemStyle');\n var itemStyleEmphasisModel = nodeModel.getModel(['emphasis', 'itemStyle']);\n var itemStyleBlurModel = nodeModel.getModel(['blur', 'itemStyle']);\n var itemStyleSelectModel = nodeModel.getModel(['select', 'itemStyle']);\n var borderRadius = itemStyleNormalModel.get('borderRadius') || 0; // End of closure ariables available in \"Procedures in renderNode\".\n // -----------------------------------------------------------------\n // Node group\n\n var group = giveGraphic('nodeGroup', Group);\n\n if (!group) {\n return;\n }\n\n parentGroup.add(group); // x,y are not set when el is above view root.\n\n group.x = thisLayout.x || 0;\n group.y = thisLayout.y || 0;\n group.markRedraw();\n inner(group).nodeWidth = thisWidth;\n inner(group).nodeHeight = thisHeight;\n\n if (thisLayout.isAboveViewRoot) {\n return group;\n } // Background\n\n\n var bg = giveGraphic('background', Rect, depth, Z2_BG);\n bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);\n var emphasisModel = nodeModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var isDisabled = emphasisModel.get('disabled');\n var focusOrIndices = focus === 'ancestor' ? thisNode.getAncestorsIndices() : focus === 'descendant' ? thisNode.getDescendantIndices() : focus; // No children, render content.\n\n if (isParent) {\n // Because of the implementation about \"traverse\" in graphic hover style, we\n // can not set hover listener on the \"group\" of non-leaf node. Otherwise the\n // hover event from the descendents will be listenered.\n if (isHighDownDispatcher(group)) {\n setAsHighDownDispatcher(group, false);\n }\n\n if (bg) {\n setAsHighDownDispatcher(bg, !isDisabled); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, bg);\n enableHoverFocus(bg, focusOrIndices, blurScope);\n }\n } else {\n var content = giveGraphic('content', Rect, depth, Z2_CONTENT);\n content && renderContent(group, content);\n bg.disableMorphing = true;\n\n if (bg && isHighDownDispatcher(bg)) {\n setAsHighDownDispatcher(bg, false);\n }\n\n setAsHighDownDispatcher(group, !isDisabled); // Only for enabling highlight/downplay.\n\n data.setItemGraphicEl(thisNode.dataIndex, group);\n enableHoverFocus(group, focusOrIndices, blurScope);\n }\n\n return group; // ----------------------------\n // | Procedures in renderNode |\n // ----------------------------\n\n function renderBackground(group, bg, useUpperLabel) {\n var ecData = getECData(bg); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n bg.setShape({\n x: 0,\n y: 0,\n width: thisWidth,\n height: thisHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(bg);\n } else {\n bg.invisible = false;\n var style = thisNode.getVisual('style');\n var visualBorderColor = style.stroke;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualBorderColor;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n emphasisStyle.fill = itemStyleEmphasisModel.get('borderColor');\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n blurStyle.fill = itemStyleBlurModel.get('borderColor');\n var selectStyle = getStateItemStyle(itemStyleSelectModel);\n selectStyle.fill = itemStyleSelectModel.get('borderColor');\n\n if (useUpperLabel) {\n var upperLabelWidth = thisWidth - 2 * borderWidth;\n prepareText( // PENDING: convert ZRColor to ColorString for text.\n bg, visualBorderColor, style.opacity, {\n x: borderWidth,\n y: 0,\n width: upperLabelWidth,\n height: upperHeight\n });\n } // For old bg.\n else {\n bg.removeTextContent();\n }\n\n bg.setStyle(normalStyle);\n bg.ensureState('emphasis').style = emphasisStyle;\n bg.ensureState('blur').style = blurStyle;\n bg.ensureState('select').style = selectStyle;\n setDefaultStateProxy(bg);\n }\n\n group.add(bg);\n }\n\n function renderContent(group, content) {\n var ecData = getECData(content); // For tooltip.\n\n ecData.dataIndex = thisNode.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);\n var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);\n content.culling = true;\n content.setShape({\n x: borderWidth,\n y: borderWidth,\n width: contentWidth,\n height: contentHeight,\n r: borderRadius\n });\n\n if (thisInvisible) {\n // If invisible, do not set visual, otherwise the element will\n // change immediately before animation. We think it is OK to\n // remain its origin color when moving out of the view window.\n processInvisible(content);\n } else {\n content.invisible = false;\n var nodeStyle = thisNode.getVisual('style');\n var visualColor = nodeStyle.fill;\n var normalStyle = getItemStyleNormal(itemStyleNormalModel);\n normalStyle.fill = visualColor;\n normalStyle.decal = nodeStyle.decal;\n var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);\n var blurStyle = getStateItemStyle(itemStyleBlurModel);\n var selectStyle = getStateItemStyle(itemStyleSelectModel); // PENDING: convert ZRColor to ColorString for text.\n\n prepareText(content, visualColor, nodeStyle.opacity, null);\n content.setStyle(normalStyle);\n content.ensureState('emphasis').style = emphasisStyle;\n content.ensureState('blur').style = blurStyle;\n content.ensureState('select').style = selectStyle;\n setDefaultStateProxy(content);\n }\n\n group.add(content);\n }\n\n function processInvisible(element) {\n // Delay invisible setting utill animation finished,\n // avoid element vanish suddenly before animation.\n !element.invisible && willInvisibleEls.push(element);\n }\n\n function prepareText(rectEl, visualColor, visualOpacity, // Can be null/undefined\n upperLabelRect) {\n var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);\n var defaultText = convertOptionIdName(nodeModel.get('name'), null);\n var isShow = normalLabelModel.getShallow('show');\n setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {\n defaultText: isShow ? defaultText : null,\n inheritColor: visualColor,\n defaultOpacity: visualOpacity,\n labelFetcher: seriesModel,\n labelDataIndex: thisNode.dataIndex\n });\n var textEl = rectEl.getTextContent();\n\n if (!textEl) {\n return;\n }\n\n var textStyle = textEl.style;\n var textPadding = normalizeCssArray(textStyle.padding || 0);\n\n if (upperLabelRect) {\n rectEl.setTextConfig({\n layoutRect: upperLabelRect\n });\n textEl.disableLabelLayout = true;\n }\n\n textEl.beforeUpdate = function () {\n var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);\n var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);\n\n if (textStyle.width !== width || textStyle.height !== height) {\n textEl.setStyle({\n width: width,\n height: height\n });\n }\n };\n\n textStyle.truncateMinChar = 2;\n textStyle.lineOverflow = 'truncate';\n addDrillDownIcon(textStyle, upperLabelRect, thisLayout);\n var textEmphasisState = textEl.getState('emphasis');\n addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);\n }\n\n function addDrillDownIcon(style, upperLabelRect, thisLayout) {\n var text = style ? style.text : null;\n\n if (!upperLabelRect && thisLayout.isLeafRoot && text != null) {\n var iconChar = seriesModel.get('drillDownIcon', true);\n style.text = iconChar ? iconChar + ' ' + text : text;\n }\n }\n\n function giveGraphic(storageName, Ctor, depth, z) {\n var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];\n var lasts = lastsForAnimation[storageName];\n\n if (element) {\n // Remove from oldStorage\n oldStorage[storageName][oldRawIndex] = null;\n prepareAnimationWhenHasOld(lasts, element);\n } // If invisible and no old element, do not create new element (for optimizing).\n else if (!thisInvisible) {\n element = new Ctor();\n\n if (element instanceof Displayable) {\n element.z2 = calculateZ2(depth, z);\n }\n\n prepareAnimationWhenNoOld(lasts, element);\n } // Set to thisStorage\n\n\n return thisStorage[storageName][thisRawIndex] = element;\n }\n\n function prepareAnimationWhenHasOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n\n if (element instanceof Group) {\n lastCfg.oldX = element.x;\n lastCfg.oldY = element.y;\n } else {\n lastCfg.oldShape = extend({}, element.shape);\n }\n } // If a element is new, we need to find the animation start point carefully,\n // otherwise it will looks strange when 'zoomToNode'.\n\n\n function prepareAnimationWhenNoOld(lasts, element) {\n var lastCfg = lasts[thisRawIndex] = {};\n var parentNode = thisNode.parentNode;\n var isGroup = element instanceof graphic.Group;\n\n if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) {\n var parentOldX = 0;\n var parentOldY = 0; // New nodes appear from right-bottom corner in 'zoomToNode' animation.\n // For convenience, get old bounding rect from background.\n\n var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];\n\n if (!reRoot && parentOldBg && parentOldBg.oldShape) {\n parentOldX = parentOldBg.oldShape.width;\n parentOldY = parentOldBg.oldShape.height;\n } // When no parent old shape found, its parent is new too,\n // so we can just use {x:0, y:0}.\n\n\n if (isGroup) {\n lastCfg.oldX = 0;\n lastCfg.oldY = parentOldY;\n } else {\n lastCfg.oldShape = {\n x: parentOldX,\n y: parentOldY,\n width: 0,\n height: 0\n };\n }\n } // Fade in, user can be aware that these nodes are new.\n\n\n lastCfg.fadein = !isGroup;\n }\n} // We cannot set all background with the same z, because the behaviour of\n// drill down and roll up differ background creation sequence from tree\n// hierarchy sequence, which cause lower background elements to overlap\n// upper ones. So we calculate z based on depth.\n// Moreover, we try to shrink down z interval to [0, 1] to avoid that\n// treemap with large z overlaps other components.\n\n\nfunction calculateZ2(depth, z2InLevel) {\n return depth * Z2_BASE + z2InLevel;\n}\n\nexport default TreemapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as zrColor from 'zrender/lib/tool/color.js';\nimport { linearMap } from '../util/number.js';\nimport { warn } from '../util/log.js';\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar CATEGORY_DEFAULT_VISUAL_INDEX = -1;\n\nvar VisualMapping =\n/** @class */\nfunction () {\n function VisualMapping(option) {\n var mappingMethod = option.mappingMethod;\n var visualType = option.type;\n var thisOption = this.option = zrUtil.clone(option);\n this.type = visualType;\n this.mappingMethod = mappingMethod;\n this._normalizeData = normalizers[mappingMethod];\n var visualHandler = VisualMapping.visualHandlers[visualType];\n this.applyVisual = visualHandler.applyVisual;\n this.getColorMapper = visualHandler.getColorMapper;\n this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];\n\n if (mappingMethod === 'piecewise') {\n normalizeVisualRange(thisOption);\n preprocessForPiecewise(thisOption);\n } else if (mappingMethod === 'category') {\n thisOption.categories ? preprocessForSpecifiedCategory(thisOption) // categories is ordinal when thisOption.categories not specified,\n // which need no more preprocess except normalize visual.\n : normalizeVisualRange(thisOption, true);\n } else {\n // mappingMethod === 'linear' or 'fixed'\n zrUtil.assert(mappingMethod !== 'linear' || thisOption.dataExtent);\n normalizeVisualRange(thisOption);\n }\n }\n\n VisualMapping.prototype.mapValueToVisual = function (value) {\n var normalized = this._normalizeData(value);\n\n return this._normalizedToVisual(normalized, value);\n };\n\n VisualMapping.prototype.getNormalizer = function () {\n return zrUtil.bind(this._normalizeData, this);\n };\n /**\r\n * List available visual types.\r\n *\r\n * @public\r\n * @return {Array.}\r\n */\n\n\n VisualMapping.listVisualTypes = function () {\n return zrUtil.keys(VisualMapping.visualHandlers);\n }; // /**\n // * @public\n // */\n // static addVisualHandler(name, handler) {\n // visualHandlers[name] = handler;\n // }\n\n /**\r\n * @public\r\n */\n\n\n VisualMapping.isValidType = function (visualType) {\n return VisualMapping.visualHandlers.hasOwnProperty(visualType);\n };\n /**\r\n * Convenient method.\r\n * Visual can be Object or Array or primary type.\r\n */\n\n\n VisualMapping.eachVisual = function (visual, callback, context) {\n if (zrUtil.isObject(visual)) {\n zrUtil.each(visual, callback, context);\n } else {\n callback.call(context, visual);\n }\n };\n\n VisualMapping.mapVisual = function (visual, callback, context) {\n var isPrimary;\n var newVisual = zrUtil.isArray(visual) ? [] : zrUtil.isObject(visual) ? {} : (isPrimary = true, null);\n VisualMapping.eachVisual(visual, function (v, key) {\n var newVal = callback.call(context, v, key);\n isPrimary ? newVisual = newVal : newVisual[key] = newVal;\n });\n return newVisual;\n };\n /**\r\n * Retrieve visual properties from given object.\r\n */\n\n\n VisualMapping.retrieveVisuals = function (obj) {\n var ret = {};\n var hasVisual;\n obj && each(VisualMapping.visualHandlers, function (h, visualType) {\n if (obj.hasOwnProperty(visualType)) {\n ret[visualType] = obj[visualType];\n hasVisual = true;\n }\n });\n return hasVisual ? ret : null;\n };\n /**\r\n * Give order to visual types, considering colorSaturation, colorAlpha depends on color.\r\n *\r\n * @public\r\n * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}\r\n * IF Array, like: ['color', 'symbol', 'colorSaturation']\r\n * @return {Array.} Sorted visual types.\r\n */\n\n\n VisualMapping.prepareVisualTypes = function (visualTypes) {\n if (zrUtil.isArray(visualTypes)) {\n visualTypes = visualTypes.slice();\n } else if (isObject(visualTypes)) {\n var types_1 = [];\n each(visualTypes, function (item, type) {\n types_1.push(type);\n });\n visualTypes = types_1;\n } else {\n return [];\n }\n\n visualTypes.sort(function (type1, type2) {\n // color should be front of colorSaturation, colorAlpha, ...\n // symbol and symbolSize do not matter.\n return type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0 ? 1 : -1;\n });\n return visualTypes;\n };\n /**\r\n * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'.\r\n * Other visuals are only depends on themself.\r\n */\n\n\n VisualMapping.dependsOn = function (visualType1, visualType2) {\n return visualType2 === 'color' ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;\n };\n /**\r\n * @param value\r\n * @param pieceList [{value: ..., interval: [min, max]}, ...]\r\n * Always from small to big.\r\n * @param findClosestWhenOutside Default to be false\r\n * @return index\r\n */\n\n\n VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) {\n var possibleI;\n var abs = Infinity; // value has the higher priority.\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var pieceValue = pieceList[i].value;\n\n if (pieceValue != null) {\n if (pieceValue === value // FIXME\n // It is supposed to compare value according to value type of dimension,\n // but currently value type can exactly be string or number.\n // Compromise for numeric-like string (like '12'), especially\n // in the case that visualMap.categories is ['22', '33'].\n || zrUtil.isString(pieceValue) && pieceValue === value + '') {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(pieceValue, i);\n }\n }\n\n for (var i = 0, len = pieceList.length; i < len; i++) {\n var piece = pieceList[i];\n var interval = piece.interval;\n var close_1 = piece.close;\n\n if (interval) {\n if (interval[0] === -Infinity) {\n if (littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n } else if (interval[1] === Infinity) {\n if (littleThan(close_1[0], interval[0], value)) {\n return i;\n }\n } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {\n return i;\n }\n\n findClosestWhenOutside && updatePossible(interval[0], i);\n findClosestWhenOutside && updatePossible(interval[1], i);\n }\n }\n\n if (findClosestWhenOutside) {\n return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;\n }\n\n function updatePossible(val, index) {\n var newAbs = Math.abs(val - value);\n\n if (newAbs < abs) {\n abs = newAbs;\n possibleI = index;\n }\n }\n };\n\n VisualMapping.visualHandlers = {\n color: {\n applyVisual: makeApplyVisual('color'),\n getColorMapper: function () {\n var thisOption = this.option;\n return zrUtil.bind(thisOption.mappingMethod === 'category' ? function (value, isNormalized) {\n !isNormalized && (value = this._normalizeData(value));\n return doMapCategory.call(this, value);\n } : function (value, isNormalized, out) {\n // If output rgb array\n // which will be much faster and useful in pixel manipulation\n var returnRGBArray = !!out;\n !isNormalized && (value = this._normalizeData(value));\n out = zrColor.fastLerp(value, thisOption.parsedVisual, out);\n return returnRGBArray ? out : zrColor.stringify(out, 'rgba');\n }, this);\n },\n _normalizedToVisual: {\n linear: function (normalized) {\n return zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = zrColor.stringify(zrColor.fastLerp(normalized, this.option.parsedVisual), 'rgba');\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n colorHue: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, value);\n }),\n colorSaturation: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, value);\n }),\n colorLightness: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyHSL(color, null, null, value);\n }),\n colorAlpha: makePartialColorVisualHandler(function (color, value) {\n return zrColor.modifyAlpha(color, value);\n }),\n decal: {\n applyVisual: makeApplyVisual('decal'),\n _normalizedToVisual: {\n linear: null,\n category: doMapCategory,\n piecewise: null,\n fixed: null\n }\n },\n opacity: {\n applyVisual: makeApplyVisual('opacity'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n },\n liftZ: {\n applyVisual: makeApplyVisual('liftZ'),\n _normalizedToVisual: {\n linear: doMapFixed,\n category: doMapFixed,\n piecewise: doMapFixed,\n fixed: doMapFixed\n }\n },\n symbol: {\n applyVisual: function (value, getter, setter) {\n var symbolCfg = this.mapValueToVisual(value);\n setter('symbol', symbolCfg);\n },\n _normalizedToVisual: {\n linear: doMapToArray,\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = doMapToArray.call(this, normalized);\n }\n\n return result;\n },\n fixed: doMapFixed\n }\n },\n symbolSize: {\n applyVisual: makeApplyVisual('symbolSize'),\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n }\n };\n return VisualMapping;\n}();\n\nfunction preprocessForPiecewise(thisOption) {\n var pieceList = thisOption.pieceList;\n thisOption.hasSpecialVisual = false;\n zrUtil.each(pieceList, function (piece, index) {\n piece.originIndex = index; // piece.visual is \"result visual value\" but not\n // a visual range, so it does not need to be normalized.\n\n if (piece.visual != null) {\n thisOption.hasSpecialVisual = true;\n }\n });\n}\n\nfunction preprocessForSpecifiedCategory(thisOption) {\n // Hash categories.\n var categories = thisOption.categories;\n var categoryMap = thisOption.categoryMap = {};\n var visual = thisOption.visual;\n each(categories, function (cate, index) {\n categoryMap[cate] = index;\n }); // Process visual map input.\n\n if (!zrUtil.isArray(visual)) {\n var visualArr_1 = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v, cate) {\n var index = categoryMap[cate];\n visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;\n });\n } else {\n // Is primary type, represents default visual.\n visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;\n }\n\n visual = setVisualToOption(thisOption, visualArr_1);\n } // Remove categories that has no visual,\n // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.\n\n\n for (var i = categories.length - 1; i >= 0; i--) {\n if (visual[i] == null) {\n delete categoryMap[categories[i]];\n categories.pop();\n }\n }\n}\n\nfunction normalizeVisualRange(thisOption, isCategory) {\n var visual = thisOption.visual;\n var visualArr = [];\n\n if (zrUtil.isObject(visual)) {\n each(visual, function (v) {\n visualArr.push(v);\n });\n } else if (visual != null) {\n visualArr.push(visual);\n }\n\n var doNotNeedPair = {\n color: 1,\n symbol: 1\n };\n\n if (!isCategory && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {\n // Do not care visualArr.length === 0, which is illegal.\n visualArr[1] = visualArr[0];\n }\n\n setVisualToOption(thisOption, visualArr);\n}\n\nfunction makePartialColorVisualHandler(applyValue) {\n return {\n applyVisual: function (value, getter, setter) {\n // Only used in HSL\n var colorChannel = this.mapValueToVisual(value); // Must not be array value\n\n setter('color', applyValue(getter('color'), colorChannel));\n },\n _normalizedToVisual: createNormalizedToNumericVisual([0, 1])\n };\n}\n\nfunction doMapToArray(normalized) {\n var visual = this.option.visual;\n return visual[Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true))] || {}; // TODO {}?\n}\n\nfunction makeApplyVisual(visualType) {\n return function (value, getter, setter) {\n setter(visualType, this.mapValueToVisual(value));\n };\n}\n\nfunction doMapCategory(normalized) {\n var visual = this.option.visual;\n return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];\n}\n\nfunction doMapFixed() {\n // visual will be convert to array.\n return this.option.visual[0];\n}\n/**\r\n * Create mapped to numeric visual\r\n */\n\n\nfunction createNormalizedToNumericVisual(sourceExtent) {\n return {\n linear: function (normalized) {\n return linearMap(normalized, sourceExtent, this.option.visual, true);\n },\n category: doMapCategory,\n piecewise: function (normalized, value) {\n var result = getSpecifiedVisual.call(this, value);\n\n if (result == null) {\n result = linearMap(normalized, sourceExtent, this.option.visual, true);\n }\n\n return result;\n },\n fixed: doMapFixed\n };\n}\n\nfunction getSpecifiedVisual(value) {\n var thisOption = this.option;\n var pieceList = thisOption.pieceList;\n\n if (thisOption.hasSpecialVisual) {\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);\n var piece = pieceList[pieceIndex];\n\n if (piece && piece.visual) {\n return piece.visual[this.type];\n }\n }\n}\n\nfunction setVisualToOption(thisOption, visualArr) {\n thisOption.visual = visualArr;\n\n if (thisOption.type === 'color') {\n thisOption.parsedVisual = zrUtil.map(visualArr, function (item) {\n var color = zrColor.parse(item);\n\n if (!color && process.env.NODE_ENV !== 'production') {\n warn(\"'\" + item + \"' is an illegal color, fallback to '#000000'\", true);\n }\n\n return color || [0, 0, 0, 1];\n });\n }\n\n return visualArr;\n}\n/**\r\n * Normalizers by mapping methods.\r\n */\n\n\nvar normalizers = {\n linear: function (value) {\n return linearMap(value, this.option.dataExtent, [0, 1], true);\n },\n piecewise: function (value) {\n var pieceList = this.option.pieceList;\n var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);\n\n if (pieceIndex != null) {\n return linearMap(pieceIndex, [0, pieceList.length - 1], [0, 1], true);\n }\n },\n category: function (value) {\n var index = this.option.categories ? this.option.categoryMap[value] : value; // ordinal value\n\n return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;\n },\n fixed: zrUtil.noop\n};\n\nfunction littleThan(close, a, b) {\n return close ? a <= b : a < b;\n}\n\nexport default VisualMapping;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { each, extend, isArray } from 'zrender/lib/core/util.js';\nimport { modifyHSL, modifyAlpha } from 'zrender/lib/tool/color.js';\nimport { makeInner } from '../../util/model.js';\nvar ITEM_STYLE_NORMAL = 'itemStyle';\nvar inner = makeInner();\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel) {\n var tree = seriesModel.getData().tree;\n var root = tree.root;\n\n if (root.isRemoved()) {\n return;\n }\n\n travelTree(root, // Visual should calculate from tree root but not view root.\n {}, seriesModel.getViewRoot().getAncestors(), seriesModel);\n }\n};\n\nfunction travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {\n var nodeModel = node.getModel();\n var nodeLayout = node.getLayout();\n var data = node.hostTree.data; // Optimize\n\n if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {\n return;\n }\n\n var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);\n var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style'); // calculate border color\n\n var borderColor = nodeItemStyleModel.get('borderColor');\n var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');\n var thisNodeColor;\n\n if (borderColorSaturation != null) {\n // For performance, do not always execute 'calculateColor'.\n thisNodeColor = calculateColor(visuals);\n borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);\n }\n\n existsStyle.stroke = borderColor;\n var viewChildren = node.viewChildren;\n\n if (!viewChildren || !viewChildren.length) {\n thisNodeColor = calculateColor(visuals); // Apply visual to this node.\n\n existsStyle.fill = thisNodeColor;\n } else {\n var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren); // Designate visual to children.\n\n each(viewChildren, function (child, index) {\n // If higher than viewRoot, only ancestors of viewRoot is needed to visit.\n if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {\n var childVisual = mapVisual(nodeModel, visuals, child, index, mapping_1, seriesModel);\n travelTree(child, childVisual, viewRootAncestors, seriesModel);\n }\n });\n }\n}\n\nfunction buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {\n var visuals = extend({}, designatedVisual);\n var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;\n each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {\n // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel\n designatedVisualItemStyle[visualName] = designatedVisual[visualName];\n var val = nodeItemStyleModel.get(visualName);\n designatedVisualItemStyle[visualName] = null;\n val != null && (visuals[visualName] = val);\n });\n return visuals;\n}\n\nfunction calculateColor(visuals) {\n var color = getValueVisualDefine(visuals, 'color');\n\n if (color) {\n var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');\n var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');\n\n if (colorSaturation) {\n color = modifyHSL(color, null, null, colorSaturation);\n }\n\n if (colorAlpha) {\n color = modifyAlpha(color, colorAlpha);\n }\n\n return color;\n }\n}\n\nfunction calculateBorderColor(borderColorSaturation, thisNodeColor) {\n return thisNodeColor != null // Can only be string\n ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;\n}\n\nfunction getValueVisualDefine(visuals, name) {\n var value = visuals[name];\n\n if (value != null && value !== 'none') {\n return value;\n }\n}\n\nfunction buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {\n if (!viewChildren || !viewChildren.length) {\n return;\n }\n\n var rangeVisual = getRangeVisual(nodeModel, 'color') || visuals.color != null && visuals.color !== 'none' && (getRangeVisual(nodeModel, 'colorAlpha') || getRangeVisual(nodeModel, 'colorSaturation'));\n\n if (!rangeVisual) {\n return;\n }\n\n var visualMin = nodeModel.get('visualMin');\n var visualMax = nodeModel.get('visualMax');\n var dataExtent = nodeLayout.dataExtent.slice();\n visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);\n visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);\n var colorMappingBy = nodeModel.get('colorMappingBy');\n var opt = {\n type: rangeVisual.name,\n dataExtent: dataExtent,\n visual: rangeVisual.range\n };\n\n if (opt.type === 'color' && (colorMappingBy === 'index' || colorMappingBy === 'id')) {\n opt.mappingMethod = 'category';\n opt.loop = true; // categories is ordinal, so do not set opt.categories.\n } else {\n opt.mappingMethod = 'linear';\n }\n\n var mapping = new VisualMapping(opt);\n inner(mapping).drColorMappingBy = colorMappingBy;\n return mapping;\n} // Notice: If we don't have the attribute 'colorRange', but only use\n// attribute 'color' to represent both concepts of 'colorRange' and 'color',\n// (It means 'colorRange' when 'color' is Array, means 'color' when not array),\n// this problem will be encountered:\n// If a level-1 node doesn't have children, and its siblings have children,\n// and colorRange is set on level-1, then the node cannot be colored.\n// So we separate 'colorRange' and 'color' to different attributes.\n\n\nfunction getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exists on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}\n\nfunction mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {\n var childVisuals = extend({}, visuals);\n\n if (mapping) {\n // Only support color, colorAlpha, colorSaturation.\n var mappingType = mapping.type;\n var colorMappingBy = mappingType === 'color' && inner(mapping).drColorMappingBy;\n var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get('visualDimension'));\n childVisuals[mappingType] = mapping.mapValueToVisual(value);\n }\n\n return childVisuals;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* The treemap layout implementation was originally copied from\r\n* \"d3.js\" with some modifications made for this project.\r\n* (See more details in the comment of the method \"squarify\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { parsePercent, MAX_SAFE_INTEGER } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from '../helper/treeHelper.js';\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar retrieveValue = zrUtil.retrieve;\nvar each = zrUtil.each;\nvar PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth'];\nvar PATH_GAP_WIDTH = ['itemStyle', 'gapWidth'];\nvar PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show'];\nvar PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height'];\n;\n/**\r\n * @public\r\n */\n\nexport default {\n seriesType: 'treemap',\n reset: function (seriesModel, ecModel, api, payload) {\n // Layout result in each node:\n // {x, y, width, height, area, borderWidth}\n var ecWidth = api.getWidth();\n var ecHeight = api.getHeight();\n var seriesOption = seriesModel.option;\n var layoutInfo = layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n var size = seriesOption.size || []; // Compatible with ec2.\n\n var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);\n var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight); // Fetch payload info.\n\n var payloadType = payload && payload.type;\n var types = ['treemapZoomToNode', 'treemapRootToNode'];\n var targetInfo = helper.retrieveTargetInfo(payload, types, seriesModel);\n var rootRect = payloadType === 'treemapRender' || payloadType === 'treemapMove' ? payload.rootRect : null;\n var viewRoot = seriesModel.getViewRoot();\n var viewAbovePath = helper.getPathToRoot(viewRoot);\n\n if (payloadType !== 'treemapMove') {\n var rootSize = payloadType === 'treemapZoomToNode' ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];\n var sort_1 = seriesOption.sort;\n\n if (sort_1 && sort_1 !== 'asc' && sort_1 !== 'desc') {\n // Default to be desc order.\n sort_1 = 'desc';\n }\n\n var options = {\n squareRatio: seriesOption.squareRatio,\n sort: sort_1,\n leafDepth: seriesOption.leafDepth\n }; // layout should be cleared because using updateView but not update.\n\n viewRoot.hostTree.clearLayouts(); // TODO\n // optimize: if out of view clip, do not layout.\n // But take care that if do not render node out of view clip,\n // how to calculate start po\n\n var viewRootLayout_1 = {\n x: 0,\n y: 0,\n width: rootSize[0],\n height: rootSize[1],\n area: rootSize[0] * rootSize[1]\n };\n viewRoot.setLayout(viewRootLayout_1);\n squarify(viewRoot, options, false, 0); // Supplement layout.\n\n viewRootLayout_1 = viewRoot.getLayout();\n each(viewAbovePath, function (node, index) {\n var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();\n node.setLayout(zrUtil.extend({\n dataExtent: [childValue, childValue],\n borderWidth: 0,\n upperHeight: 0\n }, viewRootLayout_1));\n });\n }\n\n var treeRoot = seriesModel.getData().tree.root;\n treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);\n seriesModel.setLayoutInfo(layoutInfo); // FIXME\n // 现在没有clip功能,暂时取ec高宽。\n\n prunning(treeRoot, // Transform to base element coordinate system.\n new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), viewAbovePath, viewRoot, 0);\n }\n};\n/**\r\n * Layout treemap with squarify algorithm.\r\n * The original presentation of this algorithm\r\n * was made by Mark Bruls, Kees Huizing, and Jarke J. van Wijk\r\n * .\r\n * The implementation of this algorithm was originally copied from \"d3.js\"\r\n * \r\n * with some modifications made for this program.\r\n * See the license statement at the head of this file.\r\n *\r\n * @protected\r\n * @param {module:echarts/data/Tree~TreeNode} node\r\n * @param {Object} options\r\n * @param {string} options.sort 'asc' or 'desc'\r\n * @param {number} options.squareRatio\r\n * @param {boolean} hideChildren\r\n * @param {number} depth\r\n */\n\nfunction squarify(node, options, hideChildren, depth) {\n var width;\n var height;\n\n if (node.isRemoved()) {\n return;\n }\n\n var thisLayout = node.getLayout();\n width = thisLayout.width;\n height = thisLayout.height; // Considering border and gap\n\n var nodeModel = node.getModel();\n var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);\n var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;\n var upperLabelHeight = getUpperLabelHeight(nodeModel);\n var upperHeight = Math.max(borderWidth, upperLabelHeight);\n var layoutOffset = borderWidth - halfGapWidth;\n var layoutOffsetUpper = upperHeight - halfGapWidth;\n node.setLayout({\n borderWidth: borderWidth,\n upperHeight: upperHeight,\n upperLabelHeight: upperLabelHeight\n }, true);\n width = mathMax(width - 2 * layoutOffset, 0);\n height = mathMax(height - layoutOffset - layoutOffsetUpper, 0);\n var totalArea = width * height;\n var viewChildren = initChildren(node, nodeModel, totalArea, options, hideChildren, depth);\n\n if (!viewChildren.length) {\n return;\n }\n\n var rect = {\n x: layoutOffset,\n y: layoutOffsetUpper,\n width: width,\n height: height\n };\n var rowFixedLength = mathMin(width, height);\n var best = Infinity; // the best row score so far\n\n var row = [];\n row.area = 0;\n\n for (var i = 0, len = viewChildren.length; i < len;) {\n var child = viewChildren[i];\n row.push(child);\n row.area += child.getLayout().area;\n var score = worst(row, rowFixedLength, options.squareRatio); // continue with this orientation\n\n if (score <= best) {\n i++;\n best = score;\n } // abort, and try a different orientation\n else {\n row.area -= row.pop().getLayout().area;\n position(row, rowFixedLength, rect, halfGapWidth, false);\n rowFixedLength = mathMin(rect.width, rect.height);\n row.length = row.area = 0;\n best = Infinity;\n }\n }\n\n if (row.length) {\n position(row, rowFixedLength, rect, halfGapWidth, true);\n }\n\n if (!hideChildren) {\n var childrenVisibleMin = nodeModel.get('childrenVisibleMin');\n\n if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {\n hideChildren = true;\n }\n }\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n squarify(viewChildren[i], options, hideChildren, depth + 1);\n }\n}\n/**\r\n * Set area to each child, and calculate data extent for visual coding.\r\n */\n\n\nfunction initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {\n var viewChildren = node.children || [];\n var orderBy = options.sort;\n orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);\n var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth; // leafDepth has higher priority.\n\n if (hideChildren && !overLeafDepth) {\n return node.viewChildren = [];\n } // Sort children, order by desc.\n\n\n viewChildren = zrUtil.filter(viewChildren, function (child) {\n return !child.isRemoved();\n });\n sort(viewChildren, orderBy);\n var info = statistic(nodeModel, viewChildren, orderBy);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n }\n\n info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);\n\n if (info.sum === 0) {\n return node.viewChildren = [];\n } // Set area to each child.\n\n\n for (var i = 0, len = viewChildren.length; i < len; i++) {\n var area = viewChildren[i].getValue() / info.sum * totalArea; // Do not use setLayout({...}, true), because it is needed to clear last layout.\n\n viewChildren[i].setLayout({\n area: area\n });\n }\n\n if (overLeafDepth) {\n viewChildren.length && node.setLayout({\n isLeafRoot: true\n }, true);\n viewChildren.length = 0;\n }\n\n node.viewChildren = viewChildren;\n node.setLayout({\n dataExtent: info.dataExtent\n }, true);\n return viewChildren;\n}\n/**\r\n * Consider 'visibleMin'. Modify viewChildren and get new sum.\r\n */\n\n\nfunction filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {\n // visibleMin is not supported yet when no option.sort.\n if (!orderBy) {\n return sum;\n }\n\n var visibleMin = nodeModel.get('visibleMin');\n var len = orderedChildren.length;\n var deletePoint = len; // Always travel from little value to big value.\n\n for (var i = len - 1; i >= 0; i--) {\n var value = orderedChildren[orderBy === 'asc' ? len - i - 1 : i].getValue();\n\n if (value / sum * totalArea < visibleMin) {\n deletePoint = i;\n sum -= value;\n }\n }\n\n orderBy === 'asc' ? orderedChildren.splice(0, len - deletePoint) : orderedChildren.splice(deletePoint, len - deletePoint);\n return sum;\n}\n/**\r\n * Sort\r\n */\n\n\nfunction sort(viewChildren, orderBy) {\n if (orderBy) {\n viewChildren.sort(function (a, b) {\n var diff = orderBy === 'asc' ? a.getValue() - b.getValue() : b.getValue() - a.getValue();\n return diff === 0 ? orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex : diff;\n });\n }\n\n return viewChildren;\n}\n/**\r\n * Statistic\r\n */\n\n\nfunction statistic(nodeModel, children, orderBy) {\n // Calculate sum.\n var sum = 0;\n\n for (var i = 0, len = children.length; i < len; i++) {\n sum += children[i].getValue();\n } // Statistic data extent for latter visual coding.\n // Notice: data extent should be calculate based on raw children\n // but not filtered view children, otherwise visual mapping will not\n // be stable when zoom (where children is filtered by visibleMin).\n\n\n var dimension = nodeModel.get('visualDimension');\n var dataExtent; // The same as area dimension.\n\n if (!children || !children.length) {\n dataExtent = [NaN, NaN];\n } else if (dimension === 'value' && orderBy) {\n dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];\n orderBy === 'asc' && dataExtent.reverse();\n } // Other dimension.\n else {\n dataExtent = [Infinity, -Infinity];\n each(children, function (child) {\n var value = child.getValue(dimension);\n value < dataExtent[0] && (dataExtent[0] = value);\n value > dataExtent[1] && (dataExtent[1] = value);\n });\n }\n\n return {\n sum: sum,\n dataExtent: dataExtent\n };\n}\n/**\r\n * Computes the score for the specified row,\r\n * as the worst aspect ratio.\r\n */\n\n\nfunction worst(row, rowFixedLength, ratio) {\n var areaMax = 0;\n var areaMin = Infinity;\n\n for (var i = 0, area = void 0, len = row.length; i < len; i++) {\n area = row[i].getLayout().area;\n\n if (area) {\n area < areaMin && (areaMin = area);\n area > areaMax && (areaMax = area);\n }\n }\n\n var squareArea = row.area * row.area;\n var f = rowFixedLength * rowFixedLength * ratio;\n return squareArea ? mathMax(f * areaMax / squareArea, squareArea / (f * areaMin)) : Infinity;\n}\n/**\r\n * Positions the specified row of nodes. Modifies `rect`.\r\n */\n\n\nfunction position(row, rowFixedLength, rect, halfGapWidth, flush) {\n // When rowFixedLength === rect.width,\n // it is horizontal subdivision,\n // rowFixedLength is the width of the subdivision,\n // rowOtherLength is the height of the subdivision,\n // and nodes will be positioned from left to right.\n // wh[idx0WhenH] means: when horizontal,\n // wh[idx0WhenH] => wh[0] => 'width'.\n // xy[idx1WhenH] => xy[1] => 'y'.\n var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;\n var idx1WhenH = 1 - idx0WhenH;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var last = rect[xy[idx0WhenH]];\n var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;\n\n if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {\n rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow\n }\n\n for (var i = 0, rowLen = row.length; i < rowLen; i++) {\n var node = row[i];\n var nodeLayout = {};\n var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;\n var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0); // We use Math.max/min to avoid negative width/height when considering gap width.\n\n var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;\n var modWH = i === rowLen - 1 || remain < step ? remain : step;\n var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);\n nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);\n nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);\n last += modWH;\n node.setLayout(nodeLayout, true);\n }\n\n rect[xy[idx1WhenH]] += rowOtherLength;\n rect[wh[idx1WhenH]] -= rowOtherLength;\n} // Return [containerWidth, containerHeight] as default.\n\n\nfunction estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {\n // If targetInfo.node exists, we zoom to the node,\n // so estimate whole width and height by target node.\n var currNode = (targetInfo || {}).node;\n var defaultSize = [containerWidth, containerHeight];\n\n if (!currNode || currNode === viewRoot) {\n return defaultSize;\n }\n\n var parent;\n var viewArea = containerWidth * containerHeight;\n var area = viewArea * seriesModel.option.zoomToNodeRatio;\n\n while (parent = currNode.parentNode) {\n // jshint ignore:line\n var sum = 0;\n var siblings = parent.children;\n\n for (var i = 0, len = siblings.length; i < len; i++) {\n sum += siblings[i].getValue();\n }\n\n var currNodeValue = currNode.getValue();\n\n if (currNodeValue === 0) {\n return defaultSize;\n }\n\n area *= sum / currNodeValue; // Considering border, suppose aspect ratio is 1.\n\n var parentModel = parent.getModel();\n var borderWidth = parentModel.get(PATH_BORDER_WIDTH);\n var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));\n area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);\n area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);\n currNode = parent;\n }\n\n area < viewArea && (area = viewArea);\n var scale = Math.pow(area / viewArea, 0.5);\n return [containerWidth * scale, containerHeight * scale];\n} // Root position based on coord of containerGroup\n\n\nfunction calculateRootPosition(layoutInfo, rootRect, targetInfo) {\n if (rootRect) {\n return {\n x: rootRect.x,\n y: rootRect.y\n };\n }\n\n var defaultPosition = {\n x: 0,\n y: 0\n };\n\n if (!targetInfo) {\n return defaultPosition;\n } // If targetInfo is fetched by 'retrieveTargetInfo',\n // old tree and new tree are the same tree,\n // so the node still exists and we can visit it.\n\n\n var targetNode = targetInfo.node;\n var layout = targetNode.getLayout();\n\n if (!layout) {\n return defaultPosition;\n } // Transform coord from local to container.\n\n\n var targetCenter = [layout.width / 2, layout.height / 2];\n var node = targetNode;\n\n while (node) {\n var nodeLayout = node.getLayout();\n targetCenter[0] += nodeLayout.x;\n targetCenter[1] += nodeLayout.y;\n node = node.parentNode;\n }\n\n return {\n x: layoutInfo.width / 2 - targetCenter[0],\n y: layoutInfo.height / 2 - targetCenter[1]\n };\n} // Mark nodes visible for prunning when visual coding and rendering.\n// Prunning depends on layout and root position, so we have to do it after layout.\n\n\nfunction prunning(node, clipRect, viewAbovePath, viewRoot, depth) {\n var nodeLayout = node.getLayout();\n var nodeInViewAbovePath = viewAbovePath[depth];\n var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;\n\n if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {\n return;\n }\n\n node.setLayout({\n // isInView means: viewRoot sub tree + viewAbovePath\n isInView: true,\n // invisible only means: outside view clip so that the node can not\n // see but still layout for animation preparation but not render.\n invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),\n isAboveViewRoot: isAboveViewRoot\n }, true); // Transform to child coordinate.\n\n var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);\n each(node.viewChildren || [], function (child) {\n prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);\n });\n}\n\nfunction getUpperLabelHeight(model) {\n return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { installTreemapAction } from './treemapAction.js';\nimport TreemapSeriesModel from './TreemapSeries.js';\nimport TreemapView from './TreemapView.js';\nimport treemapVisual from './treemapVisual.js';\nimport treemapLayout from './treemapLayout.js';\nexport function install(registers) {\n registers.registerSeriesModel(TreemapSeriesModel);\n registers.registerChartView(TreemapView);\n registers.registerVisual(treemapVisual);\n registers.registerLayout(treemapLayout);\n installTreemapAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isNumber } from 'zrender/lib/core/util.js';\nexport default function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (isNumber(category)) {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function categoryVisual(ecModel) {\n var paletteScope = {};\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var categoriesData = seriesModel.getCategoriesData();\n var data = seriesModel.getData();\n var categoryNameIdxMap = {};\n categoriesData.each(function (idx) {\n var name = categoriesData.getName(idx); // Add prefix to avoid conflict with Object.prototype.\n\n categoryNameIdxMap['ec-' + name] = idx;\n var itemModel = categoriesData.getItemModel(idx);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n // Get color from palette.\n style.fill = seriesModel.getColorFromPalette(name, paletteScope);\n }\n\n categoriesData.setItemVisual(idx, 'style', style);\n var symbolVisualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < symbolVisualList.length; i++) {\n var symbolVisual = itemModel.getShallow(symbolVisualList[i], true);\n\n if (symbolVisual != null) {\n categoriesData.setItemVisual(idx, symbolVisualList[i], symbolVisual);\n }\n }\n }); // Assign category color to visual\n\n if (categoriesData.count()) {\n data.each(function (idx) {\n var model = data.getItemModel(idx);\n var categoryIdx = model.getShallow('category');\n\n if (categoryIdx != null) {\n if (isString(categoryIdx)) {\n categoryIdx = categoryNameIdxMap['ec-' + categoryIdx];\n }\n\n var categoryStyle = categoriesData.getItemVisual(categoryIdx, 'style');\n var style = data.ensureUniqueItemVisual(idx, 'style');\n extend(style, categoryStyle);\n var visualList = ['symbol', 'symbolSize', 'symbolKeepAspect'];\n\n for (var i = 0; i < visualList.length; i++) {\n data.setItemVisual(idx, visualList[i], categoriesData.getItemVisual(categoryIdx, visualList[i]));\n }\n }\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\n\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nexport default function graphEdgeVisual(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var edgeData = seriesModel.getEdgeData();\n var symbolType = normalize(seriesModel.get('edgeSymbol'));\n var symbolSize = normalize(seriesModel.get('edgeSymbolSize')); // const colorQuery = ['lineStyle', 'color'] as const;\n // const opacityQuery = ['lineStyle', 'opacity'] as const;\n\n edgeData.setVisual('fromSymbol', symbolType && symbolType[0]);\n edgeData.setVisual('toSymbol', symbolType && symbolType[1]);\n edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n edgeData.setVisual('style', seriesModel.getModel('lineStyle').getLineStyle());\n edgeData.each(function (idx) {\n var itemModel = edgeData.getItemModel(idx);\n var edge = graph.getEdgeByIndex(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true)); // Edge visual must after node visual\n\n var style = itemModel.getModel('lineStyle').getLineStyle();\n var existsStyle = edgeData.ensureUniqueItemVisual(idx, 'style');\n extend(existsStyle, style);\n\n switch (existsStyle.stroke) {\n case 'source':\n {\n var nodeStyle = edge.node1.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n\n case 'target':\n {\n var nodeStyle = edge.node2.getVisual('style');\n existsStyle.stroke = nodeStyle && nodeStyle.fill;\n break;\n }\n }\n\n symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]);\n symbolType[1] && edge.setVisual('toSymbol', symbolType[1]);\n symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]);\n symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar KEY_DELIMITER = '-->';\n/**\r\n * params handler\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {*}\r\n */\n\nvar getAutoCurvenessParams = function (seriesModel) {\n return seriesModel.get('autoCurveness') || null;\n};\n/**\r\n * Generate a list of edge curvatures, 20 is the default\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} appendLength\r\n * @return 20 => [0, -0.2, 0.2, -0.4, 0.4, -0.6, 0.6, -0.8, 0.8, -1, 1, -1.2, 1.2, -1.4, 1.4, -1.6, 1.6, -1.8, 1.8, -2]\r\n */\n\n\nvar createCurveness = function (seriesModel, appendLength) {\n var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);\n var length = 20;\n var curvenessList = []; // handler the function set\n\n if (zrUtil.isNumber(autoCurvenessParmas)) {\n length = autoCurvenessParmas;\n } else if (zrUtil.isArray(autoCurvenessParmas)) {\n seriesModel.__curvenessList = autoCurvenessParmas;\n return;\n } // append length\n\n\n if (appendLength > length) {\n length = appendLength;\n } // make sure the length is even\n\n\n var len = length % 2 ? length + 2 : length + 3;\n curvenessList = [];\n\n for (var i = 0; i < len; i++) {\n curvenessList.push((i % 2 ? i + 1 : i) / 10 * (i % 2 ? -1 : 1));\n }\n\n seriesModel.__curvenessList = curvenessList;\n};\n/**\r\n * Create different cache key data in the positive and negative directions, in order to set the curvature later\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @returns {string} key\r\n */\n\n\nvar getKeyOfEdges = function (n1, n2, seriesModel) {\n var source = [n1.id, n1.dataIndex].join('.');\n var target = [n2.id, n2.dataIndex].join('.');\n return [seriesModel.uid, source, target].join(KEY_DELIMITER);\n};\n/**\r\n * get opposite key\r\n * @param {string} key\r\n * @returns {string}\r\n */\n\n\nvar getOppositeKey = function (key) {\n var keys = key.split(KEY_DELIMITER);\n return [keys[0], keys[2], keys[1]].join(KEY_DELIMITER);\n};\n/**\r\n * get edgeMap with key\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\n\n\nvar getEdgeFromMap = function (edge, seriesModel) {\n var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n return seriesModel.__edgeMap[key];\n};\n/**\r\n * calculate all cases total length\r\n * @param edge\r\n * @param seriesModel\r\n * @returns {number}\r\n */\n\n\nvar getTotalLengthBetweenNodes = function (edge, seriesModel) {\n var len = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);\n var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);\n return len + lenV;\n};\n/**\r\n *\r\n * @param key\r\n */\n\n\nvar getEdgeMapLengthWithKey = function (key, seriesModel) {\n var edgeMap = seriesModel.__edgeMap;\n return edgeMap[key] ? edgeMap[key].length : 0;\n};\n/**\r\n * Count the number of edges between the same two points, used to obtain the curvature table and the parity of the edge\r\n * @see /graph/GraphSeries.js@getInitialData\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n */\n\n\nexport function initCurvenessList(seriesModel) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n seriesModel.__curvenessList = [];\n seriesModel.__edgeMap = {}; // calc the array of curveness List\n\n createCurveness(seriesModel);\n}\n/**\r\n * set edgeMap with key\r\n * @param {number|string|module:echarts/data/Graph.Node} n1\r\n * @param {number|string|module:echarts/data/Graph.Node} n2\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param {number} index\r\n */\n\nexport function createEdgeMapForCurveness(n1, n2, seriesModel, index) {\n if (!getAutoCurvenessParams(seriesModel)) {\n return;\n }\n\n var key = getKeyOfEdges(n1, n2, seriesModel);\n var edgeMap = seriesModel.__edgeMap;\n var oppositeEdges = edgeMap[getOppositeKey(key)]; // set direction\n\n if (edgeMap[key] && !oppositeEdges) {\n edgeMap[key].isForward = true;\n } else if (oppositeEdges && edgeMap[key]) {\n oppositeEdges.isForward = true;\n edgeMap[key].isForward = false;\n }\n\n edgeMap[key] = edgeMap[key] || [];\n edgeMap[key].push(index);\n}\n/**\r\n * get curvature for edge\r\n * @param edge\r\n * @param {module:echarts/model/SeriesModel} seriesModel\r\n * @param index\r\n */\n\nexport function getCurvenessForEdge(edge, seriesModel, index, needReverse) {\n var autoCurvenessParams = getAutoCurvenessParams(seriesModel);\n var isArrayParam = zrUtil.isArray(autoCurvenessParams);\n\n if (!autoCurvenessParams) {\n return null;\n }\n\n var edgeArray = getEdgeFromMap(edge, seriesModel);\n\n if (!edgeArray) {\n return null;\n }\n\n var edgeIndex = -1;\n\n for (var i = 0; i < edgeArray.length; i++) {\n if (edgeArray[i] === index) {\n edgeIndex = i;\n break;\n }\n } // if totalLen is Longer createCurveness\n\n\n var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);\n createCurveness(seriesModel, totalLen);\n edge.lineStyle = edge.lineStyle || {}; // if is opposite edge, must set curvenss to opposite number\n\n var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);\n var curvenessList = seriesModel.__curvenessList; // if pass array no need parity\n\n var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;\n\n if (!edgeArray.isForward) {\n // the opposite edge show outside\n var oppositeKey = getOppositeKey(curKey);\n var len = getEdgeMapLengthWithKey(oppositeKey, seriesModel);\n var resValue = curvenessList[edgeIndex + len + parityCorrection]; // isNeedReverse, simple, force type need reverse the curveness in the junction of the forword and the opposite\n\n if (needReverse) {\n // set as array may make the parity handle with the len of opposite\n if (isArrayParam) {\n if (autoCurvenessParams && autoCurvenessParams[0] === 0) {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n } else {\n return ((len % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return (len + parityCorrection) % 2 ? resValue : -resValue;\n }\n } else {\n return curvenessList[edgeIndex + len + parityCorrection];\n }\n } else {\n return curvenessList[parityCorrection + edgeIndex];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport function simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph, seriesModel);\n}\nexport function simpleLayoutEdge(graph, seriesModel) {\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, seriesModel, index, true), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each } from 'zrender/lib/core/util.js';\nimport { simpleLayout, simpleLayoutEdge } from './simpleLayoutHelper.js';\nexport default function graphSimpleLayout(ecModel, api) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var layout = seriesModel.get('layout');\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n var data_1 = seriesModel.getData();\n var dimensions_1 = [];\n each(coordSys.dimensions, function (coordDim) {\n dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));\n });\n\n for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {\n var value = [];\n var hasValue = false;\n\n for (var i = 0; i < dimensions_1.length; i++) {\n var val = data_1.get(dimensions_1[i], dataIndex);\n\n if (!isNaN(val)) {\n hasValue = true;\n }\n\n value.push(val);\n }\n\n if (hasValue) {\n data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));\n } else {\n // Also {Array.}, not undefined to avoid if...else... statement\n data_1.setItemLayout(dataIndex, [NaN, NaN]);\n }\n }\n\n simpleLayoutEdge(data_1.graph, seriesModel);\n } else if (!layout || layout === 'none') {\n simpleLayout(seriesModel);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport function getNodeGlobalScale(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type !== 'view') {\n return 1;\n }\n\n var nodeScaleRatio = seriesModel.option.nodeScaleRatio;\n var groupZoom = coordSys.scaleX; // Scale node when zoom changes\n\n var roamZoom = coordSys.getZoom();\n var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;\n return nodeScale / groupZoom;\n}\nexport function getSymbolSize(node) {\n var symbolSize = node.getVisual('symbolSize');\n\n if (symbolSize instanceof Array) {\n symbolSize = (symbolSize[0] + symbolSize[1]) / 2;\n }\n\n return +symbolSize;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize, getNodeGlobalScale } from './graphHelper.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nvar PI = Math.PI;\nvar _symbolRadiansHalf = [];\n/**\r\n * `basedOn` can be:\r\n * 'value':\r\n * This layout is not accurate and have same bad case. For example,\r\n * if the min value is very smaller than the max value, the nodes\r\n * with the min value probably overlap even though there is enough\r\n * space to layout them. So we only use this approach in the as the\r\n * init layout of the force layout.\r\n * FIXME\r\n * Probably we do not need this method any more but use\r\n * `basedOn: 'symbolSize'` in force layout if\r\n * delay its init operations to GraphView.\r\n * 'symbolSize':\r\n * This approach work only if all of the symbol size calculated.\r\n * That is, the progressive rendering is not applied to graph.\r\n * FIXME\r\n * If progressive rendering is applied to graph some day,\r\n * probably we have to use `basedOn: 'value'`.\r\n */\n\nexport function circularLayout(seriesModel, basedOn, draggingNode, pointer) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n var count = nodeData.count();\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n\n if (!count) {\n return;\n }\n\n if (draggingNode) {\n var _a = coordSys.pointToData(pointer),\n tempX = _a[0],\n tempY = _a[1];\n\n var v = [tempX - cx, tempY - cy];\n vec2.normalize(v, v);\n vec2.scale(v, v, r);\n draggingNode.setLayout([cx + v[0], cy + v[1]], true);\n var circularRotateLabel = seriesModel.get(['circular', 'rotateLabel']);\n rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);\n }\n\n _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count);\n\n graph.eachEdge(function (edge, index) {\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), getCurvenessForEdge(edge, seriesModel, index), 0);\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\nvar _layoutNodesBasedOn = {\n value: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || count);\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n var radianHalf = unitAngle * (sum ? value : 1) / 2;\n angle += radianHalf;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n },\n symbolSize: function (seriesModel, graph, nodeData, r, cx, cy, count) {\n var sumRadian = 0;\n _symbolRadiansHalf.length = count;\n var nodeScale = getNodeGlobalScale(seriesModel);\n graph.eachNode(function (node) {\n var symbolSize = getSymbolSize(node); // Normally this case will not happen, but we still add\n // some the defensive code (2px is an arbitrary value).\n\n isNaN(symbolSize) && (symbolSize = 2);\n symbolSize < 0 && (symbolSize = 0);\n symbolSize *= nodeScale;\n var symbolRadianHalf = Math.asin(symbolSize / 2 / r); // when `symbolSize / 2` is bigger than `r`.\n\n isNaN(symbolRadianHalf) && (symbolRadianHalf = PI / 2);\n _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;\n sumRadian += symbolRadianHalf * 2;\n });\n var halfRemainRadian = (2 * PI - sumRadian) / count / 2;\n var angle = 0;\n graph.eachNode(function (node) {\n var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];\n angle += radianHalf; // init circular layout for\n // 1. layout undefined node\n // 2. not fixed node\n\n (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += radianHalf;\n });\n }\n};\nexport function rotateNodeLabel(node, circularRotateLabel, cx, cy) {\n var el = node.getGraphicEl(); // need to check if el exists. '-' value may not create node element.\n\n if (!el) {\n return;\n }\n\n var nodeModel = node.getModel();\n var labelRotate = nodeModel.get(['label', 'rotate']) || 0;\n var symbolPath = el.getSymbolPath();\n\n if (circularRotateLabel) {\n var pos = node.getLayout();\n var rad = Math.atan2(pos[1] - cy, pos[0] - cx);\n\n if (rad < 0) {\n rad = Math.PI * 2 + rad;\n }\n\n var isLeft = pos[0] < cx;\n\n if (isLeft) {\n rad = rad - Math.PI;\n }\n\n var textPosition = isLeft ? 'left' : 'right';\n symbolPath.setTextConfig({\n rotation: -rad,\n position: textPosition,\n origin: 'center'\n });\n var emphasisState = symbolPath.ensureState('emphasis');\n zrUtil.extend(emphasisState.textConfig || (emphasisState.textConfig = {}), {\n position: textPosition\n });\n } else {\n symbolPath.setTextConfig({\n rotation: labelRotate *= Math.PI / 180\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { circularLayout } from './circularLayoutHelper.js';\nexport default function graphCircularLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n if (seriesModel.get('layout') === 'circular') {\n circularLayout(seriesModel, 'symbolSize');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/*\r\n* A third-party license is embedded for some of the code in this file:\r\n* Some formulas were originally copied from \"d3.js\" with some\r\n* modifications made for this project.\r\n* (See more details in the comment of the method \"step\" below.)\r\n* The use of the source code of this file is also subject to the terms\r\n* and consitions of the license of \"d3.js\" (BSD-3Clause, see\r\n* ).\r\n*/\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar scaleAndAdd = vec2.scaleAndAdd; // function adjacentNode(n, e) {\n// return e.n1 === n ? e.n2 : e.n1;\n// }\n\nexport function forceLayout(inNodes, inEdges, opts) {\n var nodes = inNodes;\n var edges = inEdges;\n var rect = opts.rect;\n var width = rect.width;\n var height = rect.height;\n var center = [rect.x + width / 2, rect.y + height / 2]; // let scale = opts.scale || 1;\n\n var gravity = opts.gravity == null ? 0.1 : opts.gravity; // for (let i = 0; i < edges.length; i++) {\n // let e = edges[i];\n // let n1 = e.n1;\n // let n2 = e.n2;\n // n1.edges = n1.edges || [];\n // n2.edges = n2.edges || [];\n // n1.edges.push(e);\n // n2.edges.push(e);\n // }\n // Init position\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n\n if (!n.p) {\n n.p = vec2.create(width * (Math.random() - 0.5) + center[0], height * (Math.random() - 0.5) + center[1]);\n }\n\n n.pp = vec2.clone(n.p);\n n.edges = null;\n } // Formula in 'Graph Drawing by Force-directed Placement'\n // let k = scale * Math.sqrt(width * height / nodes.length);\n // let k2 = k * k;\n\n\n var initialFriction = opts.friction == null ? 0.6 : opts.friction;\n var friction = initialFriction;\n var beforeStepCallback;\n var afterStepCallback;\n return {\n warmUp: function () {\n friction = initialFriction * 0.8;\n },\n setFixed: function (idx) {\n nodes[idx].fixed = true;\n },\n setUnfixed: function (idx) {\n nodes[idx].fixed = false;\n },\n\n /**\r\n * Before step hook\r\n */\n beforeStep: function (cb) {\n beforeStepCallback = cb;\n },\n\n /**\r\n * After step hook\r\n */\n afterStep: function (cb) {\n afterStepCallback = cb;\n },\n\n /**\r\n * Some formulas were originally copied from \"d3.js\"\r\n * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js\r\n * with some modifications made for this project.\r\n * See the license statement at the head of this file.\r\n */\n step: function (cb) {\n beforeStepCallback && beforeStepCallback(nodes, edges);\n var v12 = [];\n var nLen = nodes.length;\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n\n if (e.ignoreForceLayout) {\n continue;\n }\n\n var n1 = e.n1;\n var n2 = e.n2;\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12) - e.d;\n var w = n2.w / (n1.w + n2.w);\n\n if (isNaN(w)) {\n w = 0;\n }\n\n vec2.normalize(v12, v12);\n !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);\n !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);\n } // Gravity\n\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v12, center, n.p); // let d = vec2.len(v12);\n // vec2.scale(v12, v12, 1 / d);\n // let gravityFactor = gravity;\n\n scaleAndAdd(n.p, n.p, v12, gravity * friction);\n }\n } // Repulsive\n // PENDING\n\n\n for (var i = 0; i < nLen; i++) {\n var n1 = nodes[i];\n\n for (var j = i + 1; j < nLen; j++) {\n var n2 = nodes[j];\n vec2.sub(v12, n2.p, n1.p);\n var d = vec2.len(v12);\n\n if (d === 0) {\n // Random repulse\n vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);\n d = 1;\n }\n\n var repFact = (n1.rep + n2.rep) / d / d;\n !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);\n !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);\n }\n }\n\n var v = [];\n\n for (var i = 0; i < nLen; i++) {\n var n = nodes[i];\n\n if (!n.fixed) {\n vec2.sub(v, n.p, n.pp);\n scaleAndAdd(n.p, n.p, v, friction);\n vec2.copy(n.pp, n.p);\n }\n }\n\n friction = friction * 0.992;\n var finished = friction < 0.01;\n afterStepCallback && afterStepCallback(nodes, edges, finished);\n cb && cb(finished);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { forceLayout } from './forceHelper.js';\nimport { simpleLayout } from './simpleLayoutHelper.js';\nimport { circularLayout } from './circularLayoutHelper.js';\nimport { linearMap } from '../../util/number.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getCurvenessForEdge } from '../helper/multipleGraphEdgeHelper.js';\nexport default function graphForceLayout(ecModel) {\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var coordSys = graphSeries.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n if (graphSeries.get('layout') === 'force') {\n var preservedPoints_1 = graphSeries.preservedPoints || {};\n var graph_1 = graphSeries.getGraph();\n var nodeData_1 = graph_1.data;\n var edgeData = graph_1.edgeData;\n var forceModel = graphSeries.getModel('force');\n var initLayout = forceModel.get('initLayout');\n\n if (graphSeries.preservedPoints) {\n nodeData_1.each(function (idx) {\n var id = nodeData_1.getId(idx);\n nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);\n });\n } else if (!initLayout || initLayout === 'none') {\n simpleLayout(graphSeries);\n } else if (initLayout === 'circular') {\n circularLayout(graphSeries, 'value');\n }\n\n var nodeDataExtent_1 = nodeData_1.getDataExtent('value');\n var edgeDataExtent_1 = edgeData.getDataExtent('value'); // let edgeDataExtent = edgeData.getDataExtent('value');\n\n var repulsion = forceModel.get('repulsion');\n var edgeLength = forceModel.get('edgeLength');\n var repulsionArr_1 = zrUtil.isArray(repulsion) ? repulsion : [repulsion, repulsion];\n var edgeLengthArr_1 = zrUtil.isArray(edgeLength) ? edgeLength : [edgeLength, edgeLength]; // Larger value has smaller length\n\n edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];\n var nodes_1 = nodeData_1.mapArray('value', function (value, idx) {\n var point = nodeData_1.getItemLayout(idx);\n var rep = linearMap(value, nodeDataExtent_1, repulsionArr_1);\n\n if (isNaN(rep)) {\n rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;\n }\n\n return {\n w: rep,\n rep: rep,\n fixed: nodeData_1.getItemModel(idx).get('fixed'),\n p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point\n };\n });\n var edges = edgeData.mapArray('value', function (value, idx) {\n var edge = graph_1.getEdgeByIndex(idx);\n var d = linearMap(value, edgeDataExtent_1, edgeLengthArr_1);\n\n if (isNaN(d)) {\n d = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;\n }\n\n var edgeModel = edge.getModel();\n var curveness = zrUtil.retrieve3(edge.getModel().get(['lineStyle', 'curveness']), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);\n return {\n n1: nodes_1[edge.node1.dataIndex],\n n2: nodes_1[edge.node2.dataIndex],\n d: d,\n curveness: curveness,\n ignoreForceLayout: edgeModel.get('ignoreForceLayout')\n };\n }); // let coordSys = graphSeries.coordinateSystem;\n\n var rect = coordSys.getBoundingRect();\n var forceInstance = forceLayout(nodes_1, edges, {\n rect: rect,\n gravity: forceModel.get('gravity'),\n friction: forceModel.get('friction')\n });\n forceInstance.beforeStep(function (nodes, edges) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i].fixed) {\n // Write back to layout instance\n vec2.copy(nodes[i].p, graph_1.getNodeByIndex(i).getLayout());\n }\n }\n });\n forceInstance.afterStep(function (nodes, edges, stopped) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (!nodes[i].fixed) {\n graph_1.getNodeByIndex(i).setLayout(nodes[i].p);\n }\n\n preservedPoints_1[nodeData_1.getId(i)] = nodes[i].p;\n }\n\n for (var i = 0, l = edges.length; i < l; i++) {\n var e = edges[i];\n var edge = graph_1.getEdgeByIndex(i);\n var p1 = e.n1.p;\n var p2 = e.n2.p;\n var points = edge.getLayout();\n points = points ? points.slice() : [];\n points[0] = points[0] || [];\n points[1] = points[1] || [];\n vec2.copy(points[0], p1);\n vec2.copy(points[1], p2);\n\n if (+e.curveness) {\n points[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness];\n }\n\n edge.setLayout(points);\n }\n });\n graphSeries.forceLayout = forceInstance;\n graphSeries.preservedPoints = preservedPoints_1; // Step to get the layout\n\n forceInstance.step();\n } else {\n // Remove prev injected forceLayout instance\n graphSeries.forceLayout = null;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// FIXME Where to create the simple view coordinate system\nimport View from '../../coord/View.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport * as bbox from 'zrender/lib/core/bbox.js';\nimport { extend } from 'zrender/lib/core/util.js';\n\nfunction getViewRect(seriesModel, api, aspect) {\n var option = extend(seriesModel.getBoxLayoutParams(), {\n aspect: aspect\n });\n return getLayoutRect(option, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nexport default function createViewCoordSys(ecModel, api) {\n var viewList = [];\n ecModel.eachSeriesByType('graph', function (seriesModel) {\n var coordSysType = seriesModel.get('coordinateSystem');\n\n if (!coordSysType || coordSysType === 'view') {\n var data_1 = seriesModel.getData();\n var positions = data_1.mapArray(function (idx) {\n var itemModel = data_1.getItemModel(idx);\n return [+itemModel.get('x'), +itemModel.get('y')];\n });\n var min = [];\n var max = [];\n bbox.fromPoints(positions, min, max); // If width or height is 0\n\n if (max[0] - min[0] === 0) {\n max[0] += 1;\n min[0] -= 1;\n }\n\n if (max[1] - min[1] === 0) {\n max[1] += 1;\n min[1] -= 1;\n }\n\n var aspect = (max[0] - min[0]) / (max[1] - min[1]); // FIXME If get view rect after data processed?\n\n var viewRect = getViewRect(seriesModel, api, aspect); // Position may be NaN, use view rect instead\n\n if (isNaN(aspect)) {\n min = [viewRect.x, viewRect.y];\n max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];\n }\n\n var bbWidth = max[0] - min[0];\n var bbHeight = max[1] - min[1];\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var viewCoordSys = seriesModel.coordinateSystem = new View();\n viewCoordSys.zoomLimit = seriesModel.get('scaleLimit');\n viewCoordSys.setBoundingRect(min[0], min[1], bbWidth, bbHeight);\n viewCoordSys.setViewRect(viewRect.x, viewRect.y, viewWidth, viewHeight); // Update roam info\n\n viewCoordSys.setCenter(seriesModel.get('center'), api);\n viewCoordSys.setZoom(seriesModel.get('zoom'));\n viewList.push(viewCoordSys);\n }\n });\n return viewList;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Line path for bezier and straight line draw\r\n */\n\nimport * as graphic from '../../util/graphic.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nvar straightLineProto = graphic.Line.prototype;\nvar bezierCurveProto = graphic.BezierCurve.prototype;\n\nvar StraightLineShape =\n/** @class */\nfunction () {\n function StraightLineShape() {\n // Start point\n this.x1 = 0;\n this.y1 = 0; // End point\n\n this.x2 = 0;\n this.y2 = 0;\n this.percent = 1;\n }\n\n return StraightLineShape;\n}();\n\nvar CurveShape =\n/** @class */\nfunction (_super) {\n __extends(CurveShape, _super);\n\n function CurveShape() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return CurveShape;\n}(StraightLineShape);\n\nfunction isStraightLine(shape) {\n return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);\n}\n\nvar ECLinePath =\n/** @class */\nfunction (_super) {\n __extends(ECLinePath, _super);\n\n function ECLinePath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'ec-line';\n return _this;\n }\n\n ECLinePath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n ECLinePath.prototype.getDefaultShape = function () {\n return new StraightLineShape();\n };\n\n ECLinePath.prototype.buildPath = function (ctx, shape) {\n if (isStraightLine(shape)) {\n straightLineProto.buildPath.call(this, ctx, shape);\n } else {\n bezierCurveProto.buildPath.call(this, ctx, shape);\n }\n };\n\n ECLinePath.prototype.pointAt = function (t) {\n if (isStraightLine(this.shape)) {\n return straightLineProto.pointAt.call(this, t);\n } else {\n return bezierCurveProto.pointAt.call(this, t);\n }\n };\n\n ECLinePath.prototype.tangentAt = function (t) {\n var shape = this.shape;\n var p = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);\n return vec2.normalize(p, p);\n };\n\n return ECLinePath;\n}(graphic.Path);\n\nexport default ECLinePath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { isArray, each } from 'zrender/lib/core/util.js';\nimport * as vector from 'zrender/lib/core/vector.js';\nimport * as symbolUtil from '../../util/symbol.js';\nimport ECLinePath from './LinePath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, enterEmphasis, leaveEmphasis, SPECIAL_STATES } from '../../util/states.js';\nimport { getLabelStatesModels, setLabelStyle } from '../../label/labelStyle.js';\nimport { round } from '../../util/number.js';\nvar SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol'];\n\nfunction makeSymbolTypeKey(symbolCategory) {\n return '_' + symbolCategory + 'Type';\n}\n\nfunction makeSymbolTypeValue(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n\n if (!symbolType || symbolType === 'none') {\n return symbolType;\n }\n\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || '') + (symbolKeepAspect || '');\n}\n/**\r\n * @inner\r\n */\n\n\nfunction createSymbol(name, lineData, idx) {\n var symbolType = lineData.getItemVisual(idx, name);\n\n if (!symbolType || symbolType === 'none') {\n return;\n }\n\n var symbolSize = lineData.getItemVisual(idx, name + 'Size');\n var symbolRotate = lineData.getItemVisual(idx, name + 'Rotate');\n var symbolOffset = lineData.getItemVisual(idx, name + 'Offset');\n var symbolKeepAspect = lineData.getItemVisual(idx, name + 'KeepAspect');\n var symbolSizeArr = symbolUtil.normalizeSymbolSize(symbolSize);\n var symbolOffsetArr = symbolUtil.normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);\n var symbolPath = symbolUtil.createSymbol(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);\n symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;\n symbolPath.name = name;\n return symbolPath;\n}\n\nfunction createLine(points) {\n var line = new ECLinePath({\n name: 'line',\n subPixelOptimize: true\n });\n setLinePoints(line.shape, points);\n return line;\n}\n\nfunction setLinePoints(targetShape, points) {\n targetShape.x1 = points[0][0];\n targetShape.y1 = points[0][1];\n targetShape.x2 = points[1][0];\n targetShape.y2 = points[1][1];\n targetShape.percent = 1;\n var cp1 = points[2];\n\n if (cp1) {\n targetShape.cpx1 = cp1[0];\n targetShape.cpy1 = cp1[1];\n } else {\n targetShape.cpx1 = NaN;\n targetShape.cpy1 = NaN;\n }\n}\n\nvar Line =\n/** @class */\nfunction (_super) {\n __extends(Line, _super);\n\n function Line(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createLine(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Line.prototype._createLine = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var linePoints = lineData.getItemLayout(idx);\n var line = createLine(linePoints);\n line.shape.percent = 0;\n graphic.initProps(line, {\n shape: {\n percent: 1\n }\n }, seriesModel, idx);\n this.add(line);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = createSymbol(symbolCategory, lineData, idx); // symbols must added after line to make sure\n // it will be updated after line#update.\n // Or symbol position and rotation update in line#beforeUpdate will be one frame slow\n\n this.add(symbol);\n this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n }; // TODO More strict on the List type in parameters?\n\n\n Line.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var linePoints = lineData.getItemLayout(idx);\n var target = {\n shape: {}\n };\n setLinePoints(target.shape, linePoints);\n graphic.updateProps(line, target, seriesModel, idx);\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);\n var key = makeSymbolTypeKey(symbolCategory); // Symbol changed\n\n if (this[key] !== symbolType) {\n this.remove(this.childOfName(symbolCategory));\n var symbol = createSymbol(symbolCategory, lineData, idx);\n this.add(symbol);\n }\n\n this[key] = symbolType;\n }, this);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Line.prototype.getLinePath = function () {\n return this.childAt(0);\n };\n\n Line.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childOfName('line');\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var blurLineStyle = seriesScope && seriesScope.blurLineStyle;\n var selectLineStyle = seriesScope && seriesScope.selectLineStyle;\n var labelStatesModels = seriesScope && seriesScope.labelStatesModels;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope; // Optimization for large dataset\n\n if (!seriesScope || lineData.hasItemOption) {\n var itemModel = lineData.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n blurLineStyle = itemModel.getModel(['blur', 'lineStyle']).getLineStyle();\n selectLineStyle = itemModel.getModel(['select', 'lineStyle']).getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var visualColor = lineStyle.stroke;\n line.useStyle(lineStyle);\n line.style.fill = null;\n line.style.strokeNoScale = true;\n line.ensureState('emphasis').style = emphasisLineStyle;\n line.ensureState('blur').style = blurLineStyle;\n line.ensureState('select').style = selectLineStyle; // Update symbol\n\n each(SYMBOL_CATEGORIES, function (symbolCategory) {\n var symbol = this.childOfName(symbolCategory);\n\n if (symbol) {\n // Share opacity and color with line.\n symbol.setColor(visualColor);\n symbol.style.opacity = lineStyle.opacity;\n\n for (var i = 0; i < SPECIAL_STATES.length; i++) {\n var stateName = SPECIAL_STATES[i];\n var lineState = line.getState(stateName);\n\n if (lineState) {\n var lineStateStyle = lineState.style || {};\n var state = symbol.ensureState(stateName);\n var stateStyle = state.style || (state.style = {});\n\n if (lineStateStyle.stroke != null) {\n stateStyle[symbol.__isEmptyBrush ? 'stroke' : 'fill'] = lineStateStyle.stroke;\n }\n\n if (lineStateStyle.opacity != null) {\n stateStyle.opacity = lineStateStyle.opacity;\n }\n }\n }\n\n symbol.markRedraw();\n }\n }, this);\n var rawVal = seriesModel.getRawValue(idx);\n setLabelStyle(this, labelStatesModels, {\n labelDataIndex: idx,\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);\n }\n },\n inheritColor: visualColor || '#000',\n defaultOpacity: lineStyle.opacity,\n defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round(rawVal) : rawVal) + ''\n });\n var label = this.getTextContent(); // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n\n if (label) {\n var labelNormalModel = labelStatesModels.normal;\n label.__align = label.style.align;\n label.__verticalAlign = label.style.verticalAlign; // 'start', 'middle', 'end'\n\n label.__position = labelNormalModel.get('position') || 'middle';\n var distance = labelNormalModel.get('distance');\n\n if (!isArray(distance)) {\n distance = [distance, distance];\n }\n\n label.__labelDistance = distance;\n }\n\n this.setTextConfig({\n position: null,\n local: true,\n inside: false // Can't be inside for stroke element.\n\n });\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n Line.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n Line.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n Line.prototype.updateLayout = function (lineData, idx) {\n this.setLinePoints(lineData.getItemLayout(idx));\n };\n\n Line.prototype.setLinePoints = function (points) {\n var linePath = this.childOfName('line');\n setLinePoints(linePath.shape, points);\n linePath.dirty();\n };\n\n Line.prototype.beforeUpdate = function () {\n var lineGroup = this;\n var symbolFrom = lineGroup.childOfName('fromSymbol');\n var symbolTo = lineGroup.childOfName('toSymbol');\n var label = lineGroup.getTextContent(); // Quick reject\n\n if (!symbolFrom && !symbolTo && (!label || label.ignore)) {\n return;\n }\n\n var invScale = 1;\n var parentNode = this.parent;\n\n while (parentNode) {\n if (parentNode.scaleX) {\n invScale /= parentNode.scaleX;\n }\n\n parentNode = parentNode.parent;\n }\n\n var line = lineGroup.childOfName('line'); // If line not changed\n // FIXME Parent scale changed\n\n if (!this.__dirty && !line.__dirty) {\n return;\n }\n\n var percent = line.shape.percent;\n var fromPos = line.pointAt(0);\n var toPos = line.pointAt(percent);\n var d = vector.sub([], toPos, fromPos);\n vector.normalize(d, d);\n\n function setSymbolRotation(symbol, percent) {\n // Fix #12388\n // when symbol is set to be 'arrow' in markLine,\n // symbolRotate value will be ignored, and compulsively use tangent angle.\n // rotate by default if symbol rotation is not specified\n var specifiedRotation = symbol.__specifiedRotation;\n\n if (specifiedRotation == null) {\n var tangent = line.tangentAt(percent);\n symbol.attr('rotation', (percent === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent[1], tangent[0]));\n } else {\n symbol.attr('rotation', specifiedRotation);\n }\n }\n\n if (symbolFrom) {\n symbolFrom.setPosition(fromPos);\n setSymbolRotation(symbolFrom, 0);\n symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;\n symbolFrom.markRedraw();\n }\n\n if (symbolTo) {\n symbolTo.setPosition(toPos);\n setSymbolRotation(symbolTo, 1);\n symbolTo.scaleX = symbolTo.scaleY = invScale * percent;\n symbolTo.markRedraw();\n }\n\n if (label && !label.ignore) {\n label.x = label.y = 0;\n label.originX = label.originY = 0;\n var textAlign = void 0;\n var textVerticalAlign = void 0;\n var distance = label.__labelDistance;\n var distanceX = distance[0] * invScale;\n var distanceY = distance[1] * invScale;\n var halfPercent = percent / 2;\n var tangent = line.tangentAt(halfPercent);\n var n = [tangent[1], -tangent[0]];\n var cp = line.pointAt(halfPercent);\n\n if (n[1] > 0) {\n n[0] = -n[0];\n n[1] = -n[1];\n }\n\n var dir = tangent[0] < 0 ? -1 : 1;\n\n if (label.__position !== 'start' && label.__position !== 'end') {\n var rotation = -Math.atan2(tangent[1], tangent[0]);\n\n if (toPos[0] < fromPos[0]) {\n rotation = Math.PI + rotation;\n }\n\n label.rotation = rotation;\n }\n\n var dy = void 0;\n\n switch (label.__position) {\n case 'insideStartTop':\n case 'insideMiddleTop':\n case 'insideEndTop':\n case 'middle':\n dy = -distanceY;\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideStartBottom':\n case 'insideMiddleBottom':\n case 'insideEndBottom':\n dy = distanceY;\n textVerticalAlign = 'top';\n break;\n\n default:\n dy = 0;\n textVerticalAlign = 'middle';\n }\n\n switch (label.__position) {\n case 'end':\n label.x = d[0] * distanceX + toPos[0];\n label.y = d[1] * distanceY + toPos[1];\n textAlign = d[0] > 0.8 ? 'left' : d[0] < -0.8 ? 'right' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'top' : d[1] < -0.8 ? 'bottom' : 'middle';\n break;\n\n case 'start':\n label.x = -d[0] * distanceX + fromPos[0];\n label.y = -d[1] * distanceY + fromPos[1];\n textAlign = d[0] > 0.8 ? 'right' : d[0] < -0.8 ? 'left' : 'center';\n textVerticalAlign = d[1] > 0.8 ? 'bottom' : d[1] < -0.8 ? 'top' : 'middle';\n break;\n\n case 'insideStartTop':\n case 'insideStart':\n case 'insideStartBottom':\n label.x = distanceX * dir + fromPos[0];\n label.y = fromPos[1] + dy;\n textAlign = tangent[0] < 0 ? 'right' : 'left';\n label.originX = -distanceX * dir;\n label.originY = -dy;\n break;\n\n case 'insideMiddleTop':\n case 'insideMiddle':\n case 'insideMiddleBottom':\n case 'middle':\n label.x = cp[0];\n label.y = cp[1] + dy;\n textAlign = 'center';\n label.originY = -dy;\n break;\n\n case 'insideEndTop':\n case 'insideEnd':\n case 'insideEndBottom':\n label.x = -distanceX * dir + toPos[0];\n label.y = toPos[1] + dy;\n textAlign = tangent[0] >= 0 ? 'right' : 'left';\n label.originX = distanceX * dir;\n label.originY = -dy;\n break;\n }\n\n label.scaleX = label.scaleY = invScale;\n label.setStyle({\n // Use the user specified text align and baseline first\n verticalAlign: label.__verticalAlign || textVerticalAlign,\n align: label.__align || textAlign\n });\n }\n };\n\n return Line;\n}(graphic.Group);\n\nexport default Line;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as graphic from '../../util/graphic.js';\nimport LineGroup from './Line.js';\nimport { getLabelStatesModels } from '../../label/labelStyle.js';\n\nvar LineDraw =\n/** @class */\nfunction () {\n function LineDraw(LineCtor) {\n this.group = new graphic.Group();\n this._LineCtor = LineCtor || LineGroup;\n }\n\n LineDraw.prototype.updateData = function (lineData) {\n var _this = this; // Remove progressive els.\n\n\n this._progressiveEls = null;\n var lineDraw = this;\n var group = lineDraw.group;\n var oldLineData = lineDraw._lineData;\n lineDraw._lineData = lineData; // There is no oldLineData only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!oldLineData) {\n group.removeAll();\n }\n\n var seriesScope = makeSeriesScope(lineData);\n lineData.diff(oldLineData).add(function (idx) {\n _this._doAdd(lineData, idx, seriesScope);\n }).update(function (newIdx, oldIdx) {\n _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);\n }).remove(function (idx) {\n group.remove(oldLineData.getItemGraphicEl(idx));\n }).execute();\n };\n\n ;\n\n LineDraw.prototype.updateLayout = function () {\n var lineData = this._lineData; // Do not support update layout in incremental mode.\n\n if (!lineData) {\n return;\n }\n\n lineData.eachItemGraphicEl(function (el, idx) {\n el.updateLayout(lineData, idx);\n }, this);\n };\n\n ;\n\n LineDraw.prototype.incrementalPrepareUpdate = function (lineData) {\n this._seriesScope = makeSeriesScope(lineData);\n this._lineData = null;\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype.incrementalUpdate = function (taskParams, lineData) {\n this._progressiveEls = [];\n\n function updateIncrementalAndHover(el) {\n if (!el.isGroup && !isEffectObject(el)) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = taskParams.start; idx < taskParams.end; idx++) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (lineNeedsDraw(itemLayout)) {\n var el = new this._LineCtor(lineData, idx, this._seriesScope);\n el.traverse(updateIncrementalAndHover);\n this.group.add(el);\n lineData.setItemGraphicEl(idx, el);\n\n this._progressiveEls.push(el);\n }\n }\n };\n\n ;\n\n LineDraw.prototype.remove = function () {\n this.group.removeAll();\n };\n\n ;\n\n LineDraw.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n LineDraw.prototype._doAdd = function (lineData, idx, seriesScope) {\n var itemLayout = lineData.getItemLayout(idx);\n\n if (!lineNeedsDraw(itemLayout)) {\n return;\n }\n\n var el = new this._LineCtor(lineData, idx, seriesScope);\n lineData.setItemGraphicEl(idx, el);\n this.group.add(el);\n };\n\n LineDraw.prototype._doUpdate = function (oldLineData, newLineData, oldIdx, newIdx, seriesScope) {\n var itemEl = oldLineData.getItemGraphicEl(oldIdx);\n\n if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {\n this.group.remove(itemEl);\n return;\n }\n\n if (!itemEl) {\n itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);\n } else {\n itemEl.updateData(newLineData, newIdx, seriesScope);\n }\n\n newLineData.setItemGraphicEl(newIdx, itemEl);\n this.group.add(itemEl);\n };\n\n return LineDraw;\n}();\n\nfunction isEffectObject(el) {\n return el.animators && el.animators.length > 0;\n}\n\nfunction makeSeriesScope(lineData) {\n var hostModel = lineData.hostModel;\n var emphasisModel = hostModel.getModel('emphasis');\n return {\n lineStyle: hostModel.getModel('lineStyle').getLineStyle(),\n emphasisLineStyle: emphasisModel.getModel(['lineStyle']).getLineStyle(),\n blurLineStyle: hostModel.getModel(['blur', 'lineStyle']).getLineStyle(),\n selectLineStyle: hostModel.getModel(['select', 'lineStyle']).getLineStyle(),\n emphasisDisabled: emphasisModel.get('disabled'),\n blurScope: emphasisModel.get('blurScope'),\n focus: emphasisModel.get('focus'),\n labelStatesModels: getLabelStatesModels(hostModel)\n };\n}\n\nfunction isPointNaN(pt) {\n return isNaN(pt[0]) || isNaN(pt[1]);\n}\n\nfunction lineNeedsDraw(pts) {\n return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);\n}\n\nexport default LineDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as curveTool from 'zrender/lib/core/curve.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport { getSymbolSize } from './graphHelper.js';\nvar v1 = [];\nvar v2 = [];\nvar v3 = [];\nvar quadraticAt = curveTool.quadraticAt;\nvar v2DistSquare = vec2.distSquare;\nvar mathAbs = Math.abs;\n\nfunction intersectCurveCircle(curvePoints, center, radius) {\n var p0 = curvePoints[0];\n var p1 = curvePoints[1];\n var p2 = curvePoints[2];\n var d = Infinity;\n var t;\n var radiusSquare = radius * radius;\n var interval = 0.1;\n\n for (var _t = 0.1; _t <= 0.9; _t += 0.1) {\n v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t);\n v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t);\n var diff = mathAbs(v2DistSquare(v1, center) - radiusSquare);\n\n if (diff < d) {\n d = diff;\n t = _t;\n }\n } // Assume the segment is monotone,Find root through Bisection method\n // At most 32 iteration\n\n\n for (var i = 0; i < 32; i++) {\n // let prev = t - interval;\n var next = t + interval; // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev);\n // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev);\n\n v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);\n v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);\n v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);\n v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);\n var diff = v2DistSquare(v2, center) - radiusSquare;\n\n if (mathAbs(diff) < 1e-2) {\n break;\n } // let prevDiff = v2DistSquare(v1, center) - radiusSquare;\n\n\n var nextDiff = v2DistSquare(v3, center) - radiusSquare;\n interval /= 2;\n\n if (diff < 0) {\n if (nextDiff >= 0) {\n t = t + interval;\n } else {\n t = t - interval;\n }\n } else {\n if (nextDiff >= 0) {\n t = t - interval;\n } else {\n t = t + interval;\n }\n }\n }\n\n return t;\n} // Adjust edge to avoid\n\n\nexport default function adjustEdge(graph, scale) {\n var tmp0 = [];\n var quadraticSubdivide = curveTool.quadraticSubdivide;\n var pts = [[], [], []];\n var pts2 = [[], []];\n var v = [];\n scale /= 2;\n graph.eachEdge(function (edge, idx) {\n var linePoints = edge.getLayout();\n var fromSymbol = edge.getVisual('fromSymbol');\n var toSymbol = edge.getVisual('toSymbol');\n\n if (!linePoints.__original) {\n linePoints.__original = [vec2.clone(linePoints[0]), vec2.clone(linePoints[1])];\n\n if (linePoints[2]) {\n linePoints.__original.push(vec2.clone(linePoints[2]));\n }\n }\n\n var originalPoints = linePoints.__original; // Quadratic curve\n\n if (linePoints[2] != null) {\n vec2.copy(pts[0], originalPoints[0]);\n vec2.copy(pts[1], originalPoints[2]);\n vec2.copy(pts[2], originalPoints[1]);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); // Subdivide and get the second\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[0][0] = tmp0[3];\n pts[1][0] = tmp0[4];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[0][1] = tmp0[3];\n pts[1][1] = tmp0[4];\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); // Subdivide and get the first\n\n quadraticSubdivide(pts[0][0], pts[1][0], pts[2][0], t, tmp0);\n pts[1][0] = tmp0[1];\n pts[2][0] = tmp0[2];\n quadraticSubdivide(pts[0][1], pts[1][1], pts[2][1], t, tmp0);\n pts[1][1] = tmp0[1];\n pts[2][1] = tmp0[2];\n } // Copy back to layout\n\n\n vec2.copy(linePoints[0], pts[0]);\n vec2.copy(linePoints[1], pts[2]);\n vec2.copy(linePoints[2], pts[1]);\n } // Line\n else {\n vec2.copy(pts2[0], originalPoints[0]);\n vec2.copy(pts2[1], originalPoints[1]);\n vec2.sub(v, pts2[1], pts2[0]);\n vec2.normalize(v, v);\n\n if (fromSymbol && fromSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node1);\n vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale);\n }\n\n if (toSymbol && toSymbol !== 'none') {\n var symbolSize = getSymbolSize(edge.node2);\n vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale);\n }\n\n vec2.copy(linePoints[0], pts2[0]);\n vec2.copy(linePoints[1], pts2[1]);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport LineDraw from '../helper/LineDraw.js';\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as roamHelper from '../../component/helper/roamHelper.js';\nimport { onIrrelevantElement } from '../../component/helper/cursorHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport adjustEdge from './adjustEdge.js';\nimport { getNodeGlobalScale } from './graphHelper.js';\nimport ChartView from '../../view/Chart.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { simpleLayoutEdge } from './simpleLayoutHelper.js';\nimport { circularLayout, rotateNodeLabel } from './circularLayoutHelper.js';\n\nfunction isViewCoordSys(coordSys) {\n return coordSys.type === 'view';\n}\n\nvar GraphView =\n/** @class */\nfunction (_super) {\n __extends(GraphView, _super);\n\n function GraphView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphView.type;\n return _this;\n }\n\n GraphView.prototype.init = function (ecModel, api) {\n var symbolDraw = new SymbolDraw();\n var lineDraw = new LineDraw();\n var group = this.group;\n this._controller = new RoamController(api.getZr());\n this._controllerHost = {\n target: group\n };\n group.add(symbolDraw.group);\n group.add(lineDraw.group);\n this._symbolDraw = symbolDraw;\n this._lineDraw = lineDraw;\n this._firstRender = true;\n };\n\n GraphView.prototype.render = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var coordSys = seriesModel.coordinateSystem;\n this._model = seriesModel;\n var symbolDraw = this._symbolDraw;\n var lineDraw = this._lineDraw;\n var group = this.group;\n\n if (isViewCoordSys(coordSys)) {\n var groupNewProp = {\n x: coordSys.x,\n y: coordSys.y,\n scaleX: coordSys.scaleX,\n scaleY: coordSys.scaleY\n };\n\n if (this._firstRender) {\n group.attr(groupNewProp);\n } else {\n graphic.updateProps(group, groupNewProp, seriesModel);\n }\n } // Fix edge contact point with node\n\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n var data = seriesModel.getData();\n symbolDraw.updateData(data);\n var edgeData = seriesModel.getEdgeData(); // TODO: TYPE\n\n lineDraw.updateData(edgeData);\n\n this._updateNodeAndLinkScale();\n\n this._updateController(seriesModel, ecModel, api);\n\n clearTimeout(this._layoutTimeout);\n var forceLayout = seriesModel.forceLayout;\n var layoutAnimation = seriesModel.get(['force', 'layoutAnimation']);\n\n if (forceLayout) {\n this._startForceLayoutIteration(forceLayout, layoutAnimation);\n }\n\n var layout = seriesModel.get('layout');\n data.graph.eachNode(function (node) {\n var idx = node.dataIndex;\n var el = node.getGraphicEl();\n var itemModel = node.getModel();\n\n if (!el) {\n return;\n } // Update draggable\n\n\n el.off('drag').off('dragend');\n var draggable = itemModel.get('draggable');\n\n if (draggable) {\n el.on('drag', function (e) {\n switch (layout) {\n case 'force':\n forceLayout.warmUp();\n !_this._layouting && _this._startForceLayoutIteration(forceLayout, layoutAnimation);\n forceLayout.setFixed(idx); // Write position back to layout\n\n data.setItemLayout(idx, [el.x, el.y]);\n break;\n\n case 'circular':\n data.setItemLayout(idx, [el.x, el.y]); // mark node fixed\n\n node.setLayout({\n fixed: true\n }, true); // recalculate circular layout\n\n circularLayout(seriesModel, 'symbolSize', node, [e.offsetX, e.offsetY]);\n\n _this.updateLayout(seriesModel);\n\n break;\n\n case 'none':\n default:\n data.setItemLayout(idx, [el.x, el.y]); // update edge\n\n simpleLayoutEdge(seriesModel.getGraph(), seriesModel);\n\n _this.updateLayout(seriesModel);\n\n break;\n }\n }).on('dragend', function () {\n if (forceLayout) {\n forceLayout.setUnfixed(idx);\n }\n });\n }\n\n el.setDraggable(draggable, !!itemModel.get('cursor'));\n var focus = itemModel.get(['emphasis', 'focus']);\n\n if (focus === 'adjacency') {\n getECData(el).focus = node.getAdjacentDataIndices();\n }\n });\n data.graph.eachEdge(function (edge) {\n var el = edge.getGraphicEl();\n var focus = edge.getModel().get(['emphasis', 'focus']);\n\n if (!el) {\n return;\n }\n\n if (focus === 'adjacency') {\n getECData(el).focus = {\n edge: [edge.dataIndex],\n node: [edge.node1.dataIndex, edge.node2.dataIndex]\n };\n }\n });\n var circularRotateLabel = seriesModel.get('layout') === 'circular' && seriesModel.get(['circular', 'rotateLabel']);\n var cx = data.getLayout('cx');\n var cy = data.getLayout('cy');\n data.graph.eachNode(function (node) {\n rotateNodeLabel(node, circularRotateLabel, cx, cy);\n });\n this._firstRender = false;\n };\n\n GraphView.prototype.dispose = function () {\n this._controller && this._controller.dispose();\n this._controllerHost = null;\n };\n\n GraphView.prototype._startForceLayoutIteration = function (forceLayout, layoutAnimation) {\n var self = this;\n\n (function step() {\n forceLayout.step(function (stopped) {\n self.updateLayout(self._model);\n (self._layouting = !stopped) && (layoutAnimation ? self._layoutTimeout = setTimeout(step, 16) : step());\n });\n })();\n };\n\n GraphView.prototype._updateController = function (seriesModel, ecModel, api) {\n var _this = this;\n\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n var group = this.group;\n controller.setPointerChecker(function (e, x, y) {\n var rect = group.getBoundingRect();\n rect.applyTransform(group.transform);\n return rect.contain(x, y) && !onIrrelevantElement(e, api, seriesModel);\n });\n\n if (!isViewCoordSys(seriesModel.coordinateSystem)) {\n controller.disable();\n return;\n }\n\n controller.enable(seriesModel.get('roam'));\n controllerHost.zoomLimit = seriesModel.get('scaleLimit');\n controllerHost.zoom = seriesModel.coordinateSystem.getZoom();\n controller.off('pan').off('zoom').on('pan', function (e) {\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n dx: e.dx,\n dy: e.dy\n });\n }).on('zoom', function (e) {\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction({\n seriesId: seriesModel.id,\n type: 'graphRoam',\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n });\n\n _this._updateNodeAndLinkScale();\n\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n _this._lineDraw.updateLayout(); // Only update label layout on zoom\n\n\n api.updateLabelLayout();\n });\n };\n\n GraphView.prototype._updateNodeAndLinkScale = function () {\n var seriesModel = this._model;\n var data = seriesModel.getData();\n var nodeScale = getNodeGlobalScale(seriesModel);\n data.eachItemGraphicEl(function (el, idx) {\n el && el.setSymbolScale(nodeScale);\n });\n };\n\n GraphView.prototype.updateLayout = function (seriesModel) {\n adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));\n\n this._symbolDraw.updateLayout();\n\n this._lineDraw.updateLayout();\n };\n\n GraphView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove();\n this._lineDraw && this._lineDraw.remove();\n };\n\n GraphView.type = 'graph';\n return GraphView;\n}(ChartView);\n\nexport default GraphView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // id may be function name of Object, add a prefix to avoid this problem.\n\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\r\n * @type {Object.}\r\n * @private\r\n */\n\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\r\n * If is directed graph\r\n */\n\n\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n\n ;\n /**\r\n * Add a new node\r\n */\n\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n\n return;\n }\n\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n\n ;\n /**\r\n * Get node by data index\r\n */\n\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n\n ;\n /**\r\n * Get node by id\r\n */\n\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n\n ;\n /**\r\n * Add a new edge\r\n */\n\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap; // PENDING\n\n if (zrUtil.isNumber(n1)) {\n n1 = this.nodes[n1];\n }\n\n if (zrUtil.isNumber(n2)) {\n n2 = this.nodes[n2];\n }\n\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n\n if (!n1 || !n2) {\n return;\n }\n\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n\n n1.edges.push(edge);\n\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n\n ;\n /**\r\n * Get edge by data index\r\n */\n\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n\n ;\n /**\r\n * Get edge by two linked nodes\r\n */\n\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n\n var edgesMap = this._edgesMap;\n\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n\n ;\n /**\r\n * Iterate all nodes\r\n */\n\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n\n ;\n /**\r\n * Iterate all edges\r\n */\n\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n\n ;\n /**\r\n * Breadth first traverse\r\n * Return true to stop traversing\r\n */\n\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n\n if (!startNode) {\n return;\n }\n\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n\n if (cb.call(context, startNode, null)) {\n return;\n }\n\n var queue = [startNode];\n\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n\n ; // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n }); // Update edge\n\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n\n ;\n /**\r\n * @return {module:echarts/data/Graph}\r\n */\n\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n\n return graph;\n };\n\n ;\n return Graph;\n}();\n\nvar GraphNode =\n/** @class */\nfunction () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\r\n * @return {number}\r\n */\n\n\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n\n return dataIndices;\n };\n\n GraphNode.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n connectedEdgesMap.set(adjacentEdge.dataIndex, true);\n var sourceNodesQueue = [adjacentEdge.node1];\n var targetNodesQueue = [adjacentEdge.node2];\n var nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < sourceNodesQueue.length) {\n var sourceNode = sourceNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodesQueue.push(sourceNode.inEdges[j].node1);\n }\n }\n\n nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < targetNodesQueue.length) {\n var targetNode = targetNodesQueue[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodesQueue.push(targetNode.outEdges[j].node2);\n }\n }\n }\n\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n\n return GraphNode;\n}();\n\nvar GraphEdge =\n/** @class */\nfunction () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n } // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n\n GraphEdge.prototype.getTrajectoryDataIndices = function () {\n var connectedEdgesMap = zrUtil.createHashMap();\n var connectedNodesMap = zrUtil.createHashMap();\n connectedEdgesMap.set(this.dataIndex, true);\n var sourceNodes = [this.node1];\n var targetNodes = [this.node2];\n var nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < sourceNodes.length) {\n var sourceNode = sourceNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(sourceNode.dataIndex, true);\n\n for (var j = 0; j < sourceNode.inEdges.length; j++) {\n connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);\n sourceNodes.push(sourceNode.inEdges[j].node1);\n }\n }\n\n nodeIteratorIndex = 0;\n\n while (nodeIteratorIndex < targetNodes.length) {\n var targetNode = targetNodes[nodeIteratorIndex];\n nodeIteratorIndex++;\n connectedNodesMap.set(targetNode.dataIndex, true);\n\n for (var j = 0; j < targetNode.outEdges.length; j++) {\n connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);\n targetNodes.push(targetNode.outEdges[j].node2);\n }\n }\n\n return {\n edge: connectedEdgesMap.keys(),\n node: connectedNodesMap.keys()\n };\n };\n\n return GraphEdge;\n}();\n\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\r\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\r\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport Graph from '../../data/Graph.js';\nimport linkSeriesData from '../../data/helper/linkSeriesData.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport createSeriesData from './createSeriesData.js';\nimport { convertOptionIdName } from '../../util/model.js';\nexport default function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(convertOptionIdName(link.id, null), source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createSeriesData(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensions = prepareSeriesDataSchema(nodes, {\n coordDimensions: coordDimensions,\n encodeDefine: seriesModel.getEncode()\n }).dimensions;\n nodeData = new SeriesData(dimensions, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new SeriesData(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkSeriesData({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport Model from '../../model/Model.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nimport { defaultSeriesFormatTooltip } from '../../component/tooltip/seriesFormatTooltip.js';\nimport { initCurvenessList, createEdgeMapForCurveness } from '../helper/multipleGraphEdgeHelper.js';\n\nvar GraphSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GraphSeriesModel, _super);\n\n function GraphSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n GraphSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments);\n\n var self = this;\n\n function getCategoriesData() {\n return self._categoriesData;\n } // Provide data for legend select\n\n\n this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this.fillDataTextStyle(option.edges || option.links);\n\n this._updateCategoriesData();\n };\n\n GraphSeriesModel.prototype.mergeDefaultAndTheme = function (option) {\n _super.prototype.mergeDefaultAndTheme.apply(this, arguments);\n\n defaultEmphasis(option, 'edgeLabel', ['show']);\n };\n\n GraphSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var edges = option.edges || option.links || [];\n var nodes = option.data || option.nodes || [];\n var self = this;\n\n if (nodes && edges) {\n // auto curveness\n initCurvenessList(this);\n var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);\n zrUtil.each(graph.edges, function (edge) {\n createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);\n }, this);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n // Overwrite nodeData.getItemModel to\n nodeData.wrapMethod('getItemModel', function (model) {\n var categoriesModels = self._categoriesModels;\n var categoryIdx = model.getShallow('category');\n var categoryModel = categoriesModels[categoryIdx];\n\n if (categoryModel) {\n categoryModel.parentModel = model.parentModel;\n model.parentModel = categoryModel;\n }\n\n return model;\n }); // TODO Inherit resolveParentPath by default in Model#getModel?\n\n var oldGetModel = Model.prototype.getModel;\n\n function newGetModel(path, parentModel) {\n var model = oldGetModel.call(this, path, parentModel);\n model.resolveParentPath = resolveParentPath;\n return model;\n }\n\n edgeData.wrapMethod('getItemModel', function (model) {\n model.resolveParentPath = resolveParentPath;\n model.getModel = newGetModel;\n return model;\n });\n\n function resolveParentPath(pathArr) {\n if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 'label')) {\n var newPathArr = pathArr.slice();\n\n if (pathArr[0] === 'label') {\n newPathArr[0] = 'edgeLabel';\n } else if (pathArr[1] === 'label') {\n newPathArr[1] = 'edgeLabel';\n }\n\n return newPathArr;\n }\n\n return pathArr;\n }\n }\n };\n\n GraphSeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n\n GraphSeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n GraphSeriesModel.prototype.getCategoriesData = function () {\n return this._categoriesData;\n };\n\n GraphSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n if (dataType === 'edge') {\n var nodeData = this.getData();\n var params = this.getDataParams(dataIndex, dataType);\n var edge = nodeData.graph.getEdgeByIndex(dataIndex);\n var sourceName = nodeData.getName(edge.node1.dataIndex);\n var targetName = nodeData.getName(edge.node2.dataIndex);\n var nameArr = [];\n sourceName != null && nameArr.push(sourceName);\n targetName != null && nameArr.push(targetName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > '),\n value: params.value,\n noValue: params.value == null\n });\n } // dataType === 'node' or empty\n\n\n var nodeMarkup = defaultSeriesFormatTooltip({\n series: this,\n dataIndex: dataIndex,\n multipleSeries: multipleSeries\n });\n return nodeMarkup;\n };\n\n GraphSeriesModel.prototype._updateCategoriesData = function () {\n var categories = zrUtil.map(this.option.categories || [], function (category) {\n // Data must has value\n return category.value != null ? category : zrUtil.extend({\n value: 0\n }, category);\n });\n var categoriesData = new SeriesData(['value'], this);\n categoriesData.initData(categories);\n this._categoriesData = categoriesData;\n this._categoriesModels = categoriesData.mapArray(function (idx) {\n return categoriesData.getItemModel(idx);\n });\n };\n\n GraphSeriesModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GraphSeriesModel.prototype.setCenter = function (center) {\n this.option.center = center;\n };\n\n GraphSeriesModel.prototype.isAnimationEnabled = function () {\n return _super.prototype.isAnimationEnabled.call(this) // Not enable animation when do force layout\n && !(this.get('layout') === 'force' && this.get(['force', 'layoutAnimation']));\n };\n\n GraphSeriesModel.type = 'series.graph';\n GraphSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n GraphSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n // Default option for all coordinate systems\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // polarIndex: 0,\n // geoIndex: 0,\n legendHoverLink: true,\n layout: null,\n // Configuration of circular layout\n circular: {\n rotateLabel: false\n },\n // Configuration of force directed layout\n force: {\n initLayout: null,\n // Node repulsion. Can be an array to represent range.\n repulsion: [0, 50],\n gravity: 0.1,\n // Initial friction\n friction: 0.6,\n // Edge length. Can be an array to represent range.\n edgeLength: 30,\n layoutAnimation: true\n },\n left: 'center',\n top: 'center',\n // right: null,\n // bottom: null,\n // width: '80%',\n // height: '80%',\n symbol: 'circle',\n symbolSize: 10,\n edgeSymbol: ['none', 'none'],\n edgeSymbolSize: 10,\n edgeLabel: {\n position: 'middle',\n distance: 5\n },\n draggable: false,\n roam: false,\n // Default on center of graph\n center: null,\n zoom: 1,\n // Symbol size scale ratio in roam\n nodeScaleRatio: 0.6,\n // cursor: null,\n // categories: [],\n // data: []\n // Or\n // nodes: []\n //\n // links: []\n // Or\n // edges: []\n label: {\n show: false,\n formatter: '{b}'\n },\n itemStyle: {},\n lineStyle: {\n color: '#aaa',\n width: 1,\n opacity: 0.5\n },\n emphasis: {\n scale: true,\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return GraphSeriesModel;\n}(SeriesModel);\n\nexport default GraphSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport categoryFilter from './categoryFilter.js';\nimport categoryVisual from './categoryVisual.js';\nimport edgeVisual from './edgeVisual.js';\nimport simpleLayout from './simpleLayout.js';\nimport circularLayout from './circularLayout.js';\nimport forceLayout from './forceLayout.js';\nimport createView from './createView.js';\nimport View from '../../coord/View.js';\nimport GraphView from './GraphView.js';\nimport GraphSeriesModel from './GraphSeries.js';\nimport { updateCenterAndZoom } from '../../action/roamHelper.js';\nimport { noop } from 'zrender/lib/core/util.js';\nvar actionInfo = {\n type: 'graphRoam',\n event: 'graphRoam',\n update: 'none'\n};\nexport function install(registers) {\n registers.registerChartView(GraphView);\n registers.registerSeriesModel(GraphSeriesModel);\n registers.registerProcessor(categoryFilter);\n registers.registerVisual(categoryVisual);\n registers.registerVisual(edgeVisual);\n registers.registerLayout(simpleLayout);\n registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, circularLayout);\n registers.registerLayout(forceLayout);\n registers.registerCoordinateSystem('graphView', {\n dimensions: View.dimensions,\n create: createView\n }); // Register legacy focus actions\n\n registers.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n }, noop);\n registers.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n }, noop); // Register roam action.\n\n registers.registerAction(actionInfo, function (payload, ecModel, api) {\n ecModel.eachComponent({\n mainType: 'series',\n query: payload\n }, function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var res = updateCenterAndZoom(coordSys, payload, undefined, api);\n seriesModel.setCenter && seriesModel.setCenter(res.center);\n seriesModel.setZoom && seriesModel.setZoom(res.zoom);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Path from 'zrender/lib/graphic/Path.js';\n\nvar PointerShape =\n/** @class */\nfunction () {\n function PointerShape() {\n this.angle = 0;\n this.width = 10;\n this.r = 10;\n this.x = 0;\n this.y = 0;\n }\n\n return PointerShape;\n}();\n\nvar PointerPath =\n/** @class */\nfunction (_super) {\n __extends(PointerPath, _super);\n\n function PointerPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'pointer';\n return _this;\n }\n\n PointerPath.prototype.getDefaultShape = function () {\n return new PointerShape();\n };\n\n PointerPath.prototype.buildPath = function (ctx, shape) {\n var mathCos = Math.cos;\n var mathSin = Math.sin;\n var r = shape.r;\n var width = shape.width;\n var angle = shape.angle;\n var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);\n var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);\n angle = shape.angle - Math.PI / 2;\n ctx.moveTo(x, y);\n ctx.lineTo(shape.x + mathCos(angle) * width, shape.y + mathSin(angle) * width);\n ctx.lineTo(shape.x + mathCos(shape.angle) * r, shape.y + mathSin(shape.angle) * r);\n ctx.lineTo(shape.x - mathCos(angle) * width, shape.y - mathSin(angle) * width);\n ctx.lineTo(x, y);\n };\n\n return PointerPath;\n}(Path);\n\nexport default PointerPath;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport PointerPath from './PointerPath.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { createTextStyle, setLabelValueAnimation, animateLabelValue } from '../../label/labelStyle.js';\nimport ChartView from '../../view/Chart.js';\nimport { parsePercent, round, linearMap } from '../../util/number.js';\nimport Sausage from '../../util/shape/sausage.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { extend, isFunction, isString, isNumber, each } from 'zrender/lib/core/util.js';\nimport { setCommonECData } from '../../util/innerStore.js';\nimport { normalizeArcAngles } from 'zrender/lib/core/PathProxy.js';\n\nfunction parsePosition(seriesModel, api) {\n var center = seriesModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], api.getWidth());\n var cy = parsePercent(center[1], api.getHeight());\n var r = parsePercent(seriesModel.get('radius'), size / 2);\n return {\n cx: cx,\n cy: cy,\n r: r\n };\n}\n\nfunction formatLabel(value, labelFormatter) {\n var label = value == null ? '' : value + '';\n\n if (labelFormatter) {\n if (isString(labelFormatter)) {\n label = labelFormatter.replace('{value}', label);\n } else if (isFunction(labelFormatter)) {\n label = labelFormatter(value);\n }\n }\n\n return label;\n}\n\nvar GaugeView =\n/** @class */\nfunction (_super) {\n __extends(GaugeView, _super);\n\n function GaugeView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeView.type;\n return _this;\n }\n\n GaugeView.prototype.render = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n var colorList = seriesModel.get(['axisLine', 'lineStyle', 'color']);\n var posInfo = parsePosition(seriesModel, api);\n\n this._renderMain(seriesModel, ecModel, api, colorList, posInfo);\n\n this._data = seriesModel.getData();\n };\n\n GaugeView.prototype.dispose = function () {};\n\n GaugeView.prototype._renderMain = function (seriesModel, ecModel, api, colorList, posInfo) {\n var group = this.group;\n var clockwise = seriesModel.get('clockwise');\n var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;\n var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;\n var axisLineModel = seriesModel.getModel('axisLine');\n var roundCap = axisLineModel.get('roundCap');\n var MainPath = roundCap ? Sausage : graphic.Sector;\n var showAxis = axisLineModel.get('show');\n var lineStyleModel = axisLineModel.getModel('lineStyle');\n var axisLineWidth = lineStyleModel.get('width');\n var angles = [startAngle, endAngle];\n normalizeArcAngles(angles, !clockwise);\n startAngle = angles[0];\n endAngle = angles[1];\n var angleRangeSpan = endAngle - startAngle;\n var prevEndAngle = startAngle;\n var sectors = [];\n\n for (var i = 0; showAxis && i < colorList.length; i++) {\n // Clamp\n var percent = Math.min(Math.max(colorList[i][0], 0), 1);\n endAngle = startAngle + angleRangeSpan * percent;\n var sector = new MainPath({\n shape: {\n startAngle: prevEndAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: posInfo.r - axisLineWidth,\n r: posInfo.r\n },\n silent: true\n });\n sector.setStyle({\n fill: colorList[i][1]\n });\n sector.setStyle(lineStyleModel.getLineStyle( // Because we use sector to simulate arc\n // so the properties for stroking are useless\n ['color', 'width']));\n sectors.push(sector);\n prevEndAngle = endAngle;\n }\n\n sectors.reverse();\n each(sectors, function (sector) {\n return group.add(sector);\n });\n\n var getColor = function (percent) {\n // Less than 0\n if (percent <= 0) {\n return colorList[0][1];\n }\n\n var i;\n\n for (i = 0; i < colorList.length; i++) {\n if (colorList[i][0] >= percent && (i === 0 ? 0 : colorList[i - 1][0]) < percent) {\n return colorList[i][1];\n }\n } // More than 1\n\n\n return colorList[i - 1][1];\n };\n\n this._renderTicks(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n\n this._renderTitleAndDetail(seriesModel, ecModel, api, getColor, posInfo);\n\n this._renderAnchor(seriesModel, posInfo);\n\n this._renderPointer(seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth);\n };\n\n GaugeView.prototype._renderTicks = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var cx = posInfo.cx;\n var cy = posInfo.cy;\n var r = posInfo.r;\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var splitLineModel = seriesModel.getModel('splitLine');\n var tickModel = seriesModel.getModel('axisTick');\n var labelModel = seriesModel.getModel('axisLabel');\n var splitNumber = seriesModel.get('splitNumber');\n var subSplitNumber = tickModel.get('splitNumber');\n var splitLineLen = parsePercent(splitLineModel.get('length'), r);\n var tickLen = parsePercent(tickModel.get('length'), r);\n var angle = startAngle;\n var step = (endAngle - startAngle) / splitNumber;\n var subStep = step / subSplitNumber;\n var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();\n var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();\n var splitLineDistance = splitLineModel.get('distance');\n var unitX;\n var unitY;\n\n for (var i = 0; i <= splitNumber; i++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle); // Split line\n\n if (splitLineModel.get('show')) {\n var distance = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;\n var splitLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - splitLineLen - distance) + cx,\n y2: unitY * (r - splitLineLen - distance) + cy\n },\n style: splitLineStyle,\n silent: true\n });\n\n if (splitLineStyle.stroke === 'auto') {\n splitLine.setStyle({\n stroke: getColor(i / splitNumber)\n });\n }\n\n group.add(splitLine);\n } // Label\n\n\n if (labelModel.get('show')) {\n var distance = labelModel.get('distance') + splitLineDistance;\n var label = formatLabel(round(i / splitNumber * (maxVal - minVal) + minVal), labelModel.get('formatter'));\n var autoColor = getColor(i / splitNumber);\n var textStyleX = unitX * (r - splitLineLen - distance) + cx;\n var textStyleY = unitY * (r - splitLineLen - distance) + cy;\n var rotateType = labelModel.get('rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = -angle + 2 * Math.PI;\n\n if (rotate > Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = -angle - Math.PI / 2;\n } else if (isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n\n if (rotate === 0) {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: unitY < -0.8 ? 'top' : unitY > 0.8 ? 'bottom' : 'middle',\n align: unitX < -0.4 ? 'left' : unitX > 0.4 ? 'right' : 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true\n }));\n } else {\n group.add(new graphic.Text({\n style: createTextStyle(labelModel, {\n text: label,\n x: textStyleX,\n y: textStyleY,\n verticalAlign: 'middle',\n align: 'center'\n }, {\n inheritColor: autoColor\n }),\n silent: true,\n originX: textStyleX,\n originY: textStyleY,\n rotation: rotate\n }));\n }\n } // Axis tick\n\n\n if (tickModel.get('show') && i !== splitNumber) {\n var distance = tickModel.get('distance');\n distance = distance ? distance + axisLineWidth : axisLineWidth;\n\n for (var j = 0; j <= subSplitNumber; j++) {\n unitX = Math.cos(angle);\n unitY = Math.sin(angle);\n var tickLine = new graphic.Line({\n shape: {\n x1: unitX * (r - distance) + cx,\n y1: unitY * (r - distance) + cy,\n x2: unitX * (r - tickLen - distance) + cx,\n y2: unitY * (r - tickLen - distance) + cy\n },\n silent: true,\n style: tickLineStyle\n });\n\n if (tickLineStyle.stroke === 'auto') {\n tickLine.setStyle({\n stroke: getColor((i + j / subSplitNumber) / splitNumber)\n });\n }\n\n group.add(tickLine);\n angle += subStep;\n }\n\n angle -= subStep;\n } else {\n angle += step;\n }\n }\n };\n\n GaugeView.prototype._renderPointer = function (seriesModel, ecModel, api, getColor, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {\n var group = this.group;\n var oldData = this._data;\n var oldProgressData = this._progressEls;\n var progressList = [];\n var showPointer = seriesModel.get(['pointer', 'show']);\n var progressModel = seriesModel.getModel('progress');\n var showProgress = progressModel.get('show');\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var valueExtent = [minVal, maxVal];\n var angleExtent = [startAngle, endAngle];\n\n function createPointer(idx, angle) {\n var itemModel = data.getItemModel(idx);\n var pointerModel = itemModel.getModel('pointer');\n var pointerWidth = parsePercent(pointerModel.get('width'), posInfo.r);\n var pointerLength = parsePercent(pointerModel.get('length'), posInfo.r);\n var pointerStr = seriesModel.get(['pointer', 'icon']);\n var pointerOffset = pointerModel.get('offsetCenter');\n var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);\n var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);\n var pointerKeepAspect = pointerModel.get('keepAspect');\n var pointer; // not exist icon type will be set 'rect'\n\n if (pointerStr) {\n pointer = createSymbol(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);\n } else {\n pointer = new PointerPath({\n shape: {\n angle: -Math.PI / 2,\n width: pointerWidth,\n r: pointerLength,\n x: pointerOffsetX,\n y: pointerOffsetY\n }\n });\n }\n\n pointer.rotation = -(angle + Math.PI / 2);\n pointer.x = posInfo.cx;\n pointer.y = posInfo.cy;\n return pointer;\n }\n\n function createProgress(idx, endAngle) {\n var roundCap = progressModel.get('roundCap');\n var ProgressPath = roundCap ? Sausage : graphic.Sector;\n var isOverlap = progressModel.get('overlap');\n var progressWidth = isOverlap ? progressModel.get('width') : axisLineWidth / data.count();\n var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;\n var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;\n var progress = new ProgressPath({\n shape: {\n startAngle: startAngle,\n endAngle: endAngle,\n cx: posInfo.cx,\n cy: posInfo.cy,\n clockwise: clockwise,\n r0: r0,\n r: r\n }\n });\n isOverlap && (progress.z2 = maxVal - data.get(valueDim, idx) % maxVal);\n return progress;\n }\n\n if (showProgress || showPointer) {\n data.diff(oldData).add(function (idx) {\n var val = data.get(valueDim, idx);\n\n if (showPointer) {\n var pointer = createPointer(idx, startAngle); // TODO hide pointer on NaN value?\n\n graphic.initProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(idx, pointer);\n }\n\n if (showProgress) {\n var progress = createProgress(idx, startAngle);\n var isClip = progressModel.get('clip');\n graphic.initProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);\n progressList[idx] = progress;\n }\n }).update(function (newIdx, oldIdx) {\n var val = data.get(valueDim, newIdx);\n\n if (showPointer) {\n var previousPointer = oldData.getItemGraphicEl(oldIdx);\n var previousRotate = previousPointer ? previousPointer.rotation : startAngle;\n var pointer = createPointer(newIdx, previousRotate);\n pointer.rotation = previousRotate;\n graphic.updateProps(pointer, {\n rotation: -((isNaN(+val) ? angleExtent[0] : linearMap(val, valueExtent, angleExtent, true)) + Math.PI / 2)\n }, seriesModel);\n group.add(pointer);\n data.setItemGraphicEl(newIdx, pointer);\n }\n\n if (showProgress) {\n var previousProgress = oldProgressData[oldIdx];\n var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;\n var progress = createProgress(newIdx, previousEndAngle);\n var isClip = progressModel.get('clip');\n graphic.updateProps(progress, {\n shape: {\n endAngle: linearMap(val, valueExtent, angleExtent, isClip)\n }\n }, seriesModel);\n group.add(progress); // Add data index and series index for indexing the data by element\n // Useful in tooltip\n\n setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);\n progressList[newIdx] = progress;\n }\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n\n if (showPointer) {\n var pointer = data.getItemGraphicEl(idx);\n var symbolStyle = data.getItemVisual(idx, 'style');\n var visualColor = symbolStyle.fill;\n\n if (pointer instanceof ZRImage) {\n var pathStyle = pointer.style;\n pointer.useStyle(extend({\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolStyle));\n } else {\n pointer.useStyle(symbolStyle);\n pointer.type !== 'pointer' && pointer.setColor(visualColor);\n }\n\n pointer.setStyle(itemModel.getModel(['pointer', 'itemStyle']).getItemStyle());\n\n if (pointer.style.fill === 'auto') {\n pointer.setStyle('fill', getColor(linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true)));\n }\n\n pointer.z2EmphasisLift = 0;\n setStatesStylesFromModel(pointer, itemModel);\n toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);\n }\n\n if (showProgress) {\n var progress = progressList[idx];\n progress.useStyle(data.getItemVisual(idx, 'style'));\n progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());\n progress.z2EmphasisLift = 0;\n setStatesStylesFromModel(progress, itemModel);\n toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);\n }\n });\n this._progressEls = progressList;\n }\n };\n\n GaugeView.prototype._renderAnchor = function (seriesModel, posInfo) {\n var anchorModel = seriesModel.getModel('anchor');\n var showAnchor = anchorModel.get('show');\n\n if (showAnchor) {\n var anchorSize = anchorModel.get('size');\n var anchorType = anchorModel.get('icon');\n var offsetCenter = anchorModel.get('offsetCenter');\n var anchorKeepAspect = anchorModel.get('keepAspect');\n var anchor = createSymbol(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);\n anchor.z2 = anchorModel.get('showAbove') ? 1 : 0;\n anchor.setStyle(anchorModel.getModel('itemStyle').getItemStyle());\n this.group.add(anchor);\n }\n };\n\n GaugeView.prototype._renderTitleAndDetail = function (seriesModel, ecModel, api, getColor, posInfo) {\n var _this = this;\n\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var minVal = +seriesModel.get('min');\n var maxVal = +seriesModel.get('max');\n var contentGroup = new graphic.Group();\n var newTitleEls = [];\n var newDetailEls = [];\n var hasAnimation = seriesModel.isAnimationEnabled();\n var showPointerAbove = seriesModel.get(['pointer', 'showAbove']);\n data.diff(this._data).add(function (idx) {\n newTitleEls[idx] = new graphic.Text({\n silent: true\n });\n newDetailEls[idx] = new graphic.Text({\n silent: true\n });\n }).update(function (idx, oldIdx) {\n newTitleEls[idx] = _this._titleEls[oldIdx];\n newDetailEls[idx] = _this._detailEls[oldIdx];\n }).execute();\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var value = data.get(valueDim, idx);\n var itemGroup = new graphic.Group();\n var autoColor = getColor(linearMap(value, [minVal, maxVal], [0, 1], true));\n var itemTitleModel = itemModel.getModel('title');\n\n if (itemTitleModel.get('show')) {\n var titleOffsetCenter = itemTitleModel.get('offsetCenter');\n var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);\n var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);\n var labelEl = newTitleEls[idx];\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemTitleModel, {\n x: titleX,\n y: titleY,\n text: data.getName(idx),\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: autoColor\n })\n });\n itemGroup.add(labelEl);\n }\n\n var itemDetailModel = itemModel.getModel('detail');\n\n if (itemDetailModel.get('show')) {\n var detailOffsetCenter = itemDetailModel.get('offsetCenter');\n var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);\n var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);\n var width = parsePercent(itemDetailModel.get('width'), posInfo.r);\n var height = parsePercent(itemDetailModel.get('height'), posInfo.r);\n var detailColor = seriesModel.get(['progress', 'show']) ? data.getItemVisual(idx, 'style').fill : autoColor;\n var labelEl = newDetailEls[idx];\n var formatter_1 = itemDetailModel.get('formatter');\n labelEl.attr({\n z2: showPointerAbove ? 0 : 2,\n style: createTextStyle(itemDetailModel, {\n x: detailX,\n y: detailY,\n text: formatLabel(value, formatter_1),\n width: isNaN(width) ? null : width,\n height: isNaN(height) ? null : height,\n align: 'center',\n verticalAlign: 'middle'\n }, {\n inheritColor: detailColor\n })\n });\n setLabelValueAnimation(labelEl, {\n normal: itemDetailModel\n }, value, function (value) {\n return formatLabel(value, formatter_1);\n });\n hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {\n getFormattedLabel: function (labelDataIndex, status, dataType, labelDimIndex, fmt, extendParams) {\n return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);\n }\n });\n itemGroup.add(labelEl);\n }\n\n contentGroup.add(itemGroup);\n });\n this.group.add(contentGroup);\n this._titleEls = newTitleEls;\n this._detailEls = newDetailEls;\n };\n\n GaugeView.type = 'gauge';\n return GaugeView;\n}(ChartView);\n\nexport default GaugeView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar GaugeSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(GaugeSeriesModel, _super);\n\n function GaugeSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GaugeSeriesModel.type;\n _this.visualStyleAccessPath = 'itemStyle';\n return _this;\n }\n\n GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, ['value']);\n };\n\n GaugeSeriesModel.type = 'series.gauge';\n GaugeSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n // 默认全局居中\n center: ['50%', '50%'],\n legendHoverLink: true,\n radius: '75%',\n startAngle: 225,\n endAngle: -45,\n clockwise: true,\n // 最小值\n min: 0,\n // 最大值\n max: 100,\n // 分割段数,默认为10\n splitNumber: 10,\n // 坐标轴线\n axisLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n roundCap: false,\n lineStyle: {\n color: [[1, '#E6EBF8']],\n width: 10\n }\n },\n // 坐标轴线\n progress: {\n // 默认显示,属性show控制显示与否\n show: false,\n overlap: true,\n width: 10,\n roundCap: false,\n clip: true\n },\n // 分隔线\n splitLine: {\n // 默认显示,属性show控制显示与否\n show: true,\n // 属性length控制线长\n length: 10,\n distance: 10,\n // 属性lineStyle(详见lineStyle)控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 3,\n type: 'solid'\n }\n },\n // 坐标轴小标记\n axisTick: {\n // 属性show控制显示与否,默认不显示\n show: true,\n // 每份split细分多少段\n splitNumber: 5,\n // 属性length控制线长\n length: 6,\n distance: 10,\n // 属性lineStyle控制线条样式\n lineStyle: {\n color: '#63677A',\n width: 1,\n type: 'solid'\n }\n },\n axisLabel: {\n show: true,\n distance: 15,\n // formatter: null,\n color: '#464646',\n fontSize: 12,\n rotate: 0\n },\n pointer: {\n icon: null,\n offsetCenter: [0, 0],\n show: true,\n showAbove: true,\n length: '60%',\n width: 6,\n keepAspect: false\n },\n anchor: {\n show: false,\n showAbove: false,\n size: 6,\n icon: 'circle',\n offsetCenter: [0, 0],\n keepAspect: false,\n itemStyle: {\n color: '#fff',\n borderWidth: 0,\n borderColor: '#5470c6'\n }\n },\n title: {\n show: true,\n // x, y,单位px\n offsetCenter: [0, '20%'],\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 16,\n valueAnimation: false\n },\n detail: {\n show: true,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n borderColor: '#ccc',\n width: 100,\n height: null,\n padding: [5, 10],\n // x, y,单位px\n offsetCenter: [0, '40%'],\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#464646',\n fontSize: 30,\n fontWeight: 'bold',\n lineHeight: 30,\n valueAnimation: false\n }\n };\n return GaugeSeriesModel;\n}(SeriesModel);\n\nexport default GaugeSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport GaugeView from './GaugeView.js';\nimport GaugeSeriesModel from './GaugeSeries.js';\nexport function install(registers) {\n registers.registerChartView(GaugeView);\n registers.registerSeriesModel(GaugeSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar opacityAccessPath = ['itemStyle', 'opacity'];\n/**\r\n * Piece of pie including Sector, Label, LabelLine\r\n */\n\nvar FunnelPiece =\n/** @class */\nfunction (_super) {\n __extends(FunnelPiece, _super);\n\n function FunnelPiece(data, idx) {\n var _this = _super.call(this) || this;\n\n var polygon = _this;\n var labelLine = new graphic.Polyline();\n var text = new graphic.Text();\n polygon.setTextContent(text);\n\n _this.setTextGuideLine(labelLine);\n\n _this.updateData(data, idx, true);\n\n return _this;\n }\n\n FunnelPiece.prototype.updateData = function (data, idx, firstCreate) {\n var polygon = this;\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var emphasisModel = itemModel.getModel('emphasis');\n var opacity = itemModel.get(opacityAccessPath);\n opacity = opacity == null ? 1 : opacity;\n\n if (!firstCreate) {\n saveOldStyle(polygon);\n } // Update common style\n\n\n polygon.useStyle(data.getItemVisual(idx, 'style'));\n polygon.style.lineJoin = 'round';\n\n if (firstCreate) {\n polygon.setShape({\n points: layout.points\n });\n polygon.style.opacity = 0;\n graphic.initProps(polygon, {\n style: {\n opacity: opacity\n }\n }, seriesModel, idx);\n } else {\n graphic.updateProps(polygon, {\n style: {\n opacity: opacity\n },\n shape: {\n points: layout.points\n }\n }, seriesModel, idx);\n }\n\n setStatesStylesFromModel(polygon, itemModel);\n\n this._updateLabel(data, idx);\n\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n FunnelPiece.prototype._updateLabel = function (data, idx) {\n var polygon = this;\n var labelLine = this.getTextGuideLine();\n var labelText = polygon.getTextContent();\n var seriesModel = data.hostModel;\n var itemModel = data.getItemModel(idx);\n var layout = data.getItemLayout(idx);\n var labelLayout = layout.label;\n var style = data.getItemVisual(idx, 'style');\n var visualColor = style.fill;\n setLabelStyle( // position will not be used in setLabelStyle\n labelText, getLabelStatesModels(itemModel), {\n labelFetcher: data.hostModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: data.getName(idx)\n }, {\n normal: {\n align: labelLayout.textAlign,\n verticalAlign: labelLayout.verticalAlign\n }\n });\n polygon.setTextConfig({\n local: true,\n inside: !!labelLayout.inside,\n insideStroke: visualColor,\n // insideFill: 'auto',\n outsideFill: visualColor\n });\n var linePoints = labelLayout.linePoints;\n labelLine.setShape({\n points: linePoints\n });\n polygon.textGuideLineConfig = {\n anchor: linePoints ? new graphic.Point(linePoints[0][0], linePoints[0][1]) : null\n }; // Make sure update style on labelText after setLabelStyle.\n // Because setLabelStyle will replace a new style on it.\n\n graphic.updateProps(labelText, {\n style: {\n x: labelLayout.x,\n y: labelLayout.y\n }\n }, seriesModel, idx);\n labelText.attr({\n rotation: labelLayout.rotation,\n originX: labelLayout.x,\n originY: labelLayout.y,\n z2: 10\n });\n setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {\n // Default use item visual color\n stroke: visualColor\n });\n };\n\n return FunnelPiece;\n}(graphic.Polygon);\n\nvar FunnelView =\n/** @class */\nfunction (_super) {\n __extends(FunnelView, _super);\n\n function FunnelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelView.type;\n _this.ignoreLabelLineUpdate = true;\n return _this;\n }\n\n FunnelView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n data.diff(oldData).add(function (idx) {\n var funnelPiece = new FunnelPiece(data, idx);\n data.setItemGraphicEl(idx, funnelPiece);\n group.add(funnelPiece);\n }).update(function (newIdx, oldIdx) {\n var piece = oldData.getItemGraphicEl(oldIdx);\n piece.updateData(data, newIdx);\n group.add(piece);\n data.setItemGraphicEl(newIdx, piece);\n }).remove(function (idx) {\n var piece = oldData.getItemGraphicEl(idx);\n graphic.removeElementWithFadeOut(piece, seriesModel, idx);\n }).execute();\n this._data = data;\n };\n\n FunnelView.prototype.remove = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n FunnelView.prototype.dispose = function () {};\n\n FunnelView.type = 'funnel';\n return FunnelView;\n}(ChartView);\n\nexport default FunnelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport createSeriesDataSimply from '../helper/createSeriesDataSimply.js';\nimport { defaultEmphasis } from '../../util/model.js';\nimport { makeSeriesEncodeForNameBased } from '../../data/helper/sourceHelper.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar FunnelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(FunnelSeriesModel, _super);\n\n function FunnelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = FunnelSeriesModel.type;\n return _this;\n }\n\n FunnelSeriesModel.prototype.init = function (option) {\n _super.prototype.init.apply(this, arguments); // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this)); // Extend labelLine emphasis\n\n this._defaultLabelLine(option);\n };\n\n FunnelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesDataSimply(this, {\n coordDimensions: ['value'],\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForNameBased, this)\n });\n };\n\n FunnelSeriesModel.prototype._defaultLabelLine = function (option) {\n // Extend labelLine emphasis\n defaultEmphasis(option, 'labelLine', ['show']);\n var labelLineNormalOpt = option.labelLine;\n var labelLineEmphasisOpt = option.emphasis.labelLine; // Not show label line if `label.normal.show = false`\n\n labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;\n labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;\n }; // Overwrite\n\n\n FunnelSeriesModel.prototype.getDataParams = function (dataIndex) {\n var data = this.getData();\n\n var params = _super.prototype.getDataParams.call(this, dataIndex);\n\n var valueDim = data.mapDimension('value');\n var sum = data.getSum(valueDim); // Percent is 0 if sum is 0\n\n params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2);\n params.$vars.push('percent');\n return params;\n };\n\n FunnelSeriesModel.type = 'series.funnel';\n FunnelSeriesModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 2,\n legendHoverLink: true,\n colorBy: 'data',\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n // 默认取数据最小最大值\n // min: 0,\n // max: 100,\n minSize: '0%',\n maxSize: '100%',\n sort: 'descending',\n orient: 'vertical',\n gap: 0,\n funnelAlign: 'center',\n label: {\n show: true,\n position: 'outer' // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n labelLine: {\n show: true,\n length: 20,\n lineStyle: {\n // color: 各异,\n width: 1\n }\n },\n itemStyle: {\n // color: 各异,\n borderColor: '#fff',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return FunnelSeriesModel;\n}(SeriesModel);\n\nexport default FunnelSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as layout from '../../util/layout.js';\nimport { parsePercent, linearMap } from '../../util/number.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction getSortedIndices(data, sort) {\n var valueDim = data.mapDimension('value');\n var valueArr = data.mapArray(valueDim, function (val) {\n return val;\n });\n var indices = [];\n var isAscending = sort === 'ascending';\n\n for (var i = 0, len = data.count(); i < len; i++) {\n indices[i] = i;\n } // Add custom sortable function & none sortable opetion by \"options.sort\"\n\n\n if (isFunction(sort)) {\n indices.sort(sort);\n } else if (sort !== 'none') {\n indices.sort(function (a, b) {\n return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];\n });\n }\n\n return indices;\n}\n\nfunction labelLayout(data) {\n var seriesModel = data.hostModel;\n var orient = seriesModel.get('orient');\n data.each(function (idx) {\n var itemModel = data.getItemModel(idx);\n var labelModel = itemModel.getModel('label');\n var labelPosition = labelModel.get('position');\n var labelLineModel = itemModel.getModel('labelLine');\n var layout = data.getItemLayout(idx);\n var points = layout.points;\n var isLabelInside = labelPosition === 'inner' || labelPosition === 'inside' || labelPosition === 'center' || labelPosition === 'insideLeft' || labelPosition === 'insideRight';\n var textAlign;\n var textX;\n var textY;\n var linePoints;\n\n if (isLabelInside) {\n if (labelPosition === 'insideLeft') {\n textX = (points[0][0] + points[3][0]) / 2 + 5;\n textY = (points[0][1] + points[3][1]) / 2;\n textAlign = 'left';\n } else if (labelPosition === 'insideRight') {\n textX = (points[1][0] + points[2][0]) / 2 - 5;\n textY = (points[1][1] + points[2][1]) / 2;\n textAlign = 'right';\n } else {\n textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;\n textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;\n textAlign = 'center';\n }\n\n linePoints = [[textX, textY], [textX, textY]];\n } else {\n var x1 = void 0;\n var y1 = void 0;\n var x2 = void 0;\n var y2 = void 0;\n var labelLineLen = labelLineModel.get('length');\n\n if (process.env.NODE_ENV !== 'production') {\n if (orient === 'vertical' && ['top', 'bottom'].indexOf(labelPosition) > -1) {\n labelPosition = 'left';\n console.warn('Position error: Funnel chart on vertical orient dose not support top and bottom.');\n }\n\n if (orient === 'horizontal' && ['left', 'right'].indexOf(labelPosition) > -1) {\n labelPosition = 'bottom';\n console.warn('Position error: Funnel chart on horizontal orient dose not support left and right.');\n }\n }\n\n if (labelPosition === 'left') {\n // Left side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n } else if (labelPosition === 'right') {\n // Right side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n } else if (labelPosition === 'top') {\n // Top side\n x1 = (points[3][0] + points[0][0]) / 2;\n y1 = (points[3][1] + points[0][1]) / 2;\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else if (labelPosition === 'bottom') {\n // Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else if (labelPosition === 'rightTop') {\n // RightTop side\n x1 = orient === 'horizontal' ? points[3][0] : points[1][0];\n y1 = orient === 'horizontal' ? points[3][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'top';\n }\n } else if (labelPosition === 'rightBottom') {\n // RightBottom side\n x1 = points[2][0];\n y1 = points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'bottom';\n }\n } else if (labelPosition === 'leftTop') {\n // LeftTop side\n x1 = points[0][0];\n y1 = orient === 'horizontal' ? points[0][1] : points[1][1];\n\n if (orient === 'horizontal') {\n y2 = y1 - labelLineLen;\n textY = y2 - 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else if (labelPosition === 'leftBottom') {\n // LeftBottom side\n x1 = orient === 'horizontal' ? points[1][0] : points[3][0];\n y1 = orient === 'horizontal' ? points[1][1] : points[2][1];\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 - labelLineLen;\n textX = x2 - 5;\n textAlign = 'right';\n }\n } else {\n // Right side or Bottom side\n x1 = (points[1][0] + points[2][0]) / 2;\n y1 = (points[1][1] + points[2][1]) / 2;\n\n if (orient === 'horizontal') {\n y2 = y1 + labelLineLen;\n textY = y2 + 5;\n textAlign = 'center';\n } else {\n x2 = x1 + labelLineLen;\n textX = x2 + 5;\n textAlign = 'left';\n }\n }\n\n if (orient === 'horizontal') {\n x2 = x1;\n textX = x2;\n } else {\n y2 = y1;\n textY = y2;\n }\n\n linePoints = [[x1, y1], [x2, y2]];\n }\n\n layout.label = {\n linePoints: linePoints,\n x: textX,\n y: textY,\n verticalAlign: 'middle',\n textAlign: textAlign,\n inside: isLabelInside\n };\n });\n}\n\nexport default function funnelLayout(ecModel, api) {\n ecModel.eachSeriesByType('funnel', function (seriesModel) {\n var data = seriesModel.getData();\n var valueDim = data.mapDimension('value');\n var sort = seriesModel.get('sort');\n var viewRect = getViewRect(seriesModel, api);\n var orient = seriesModel.get('orient');\n var viewWidth = viewRect.width;\n var viewHeight = viewRect.height;\n var indices = getSortedIndices(data, sort);\n var x = viewRect.x;\n var y = viewRect.y;\n var sizeExtent = orient === 'horizontal' ? [parsePercent(seriesModel.get('minSize'), viewHeight), parsePercent(seriesModel.get('maxSize'), viewHeight)] : [parsePercent(seriesModel.get('minSize'), viewWidth), parsePercent(seriesModel.get('maxSize'), viewWidth)];\n var dataExtent = data.getDataExtent(valueDim);\n var min = seriesModel.get('min');\n var max = seriesModel.get('max');\n\n if (min == null) {\n min = Math.min(dataExtent[0], 0);\n }\n\n if (max == null) {\n max = dataExtent[1];\n }\n\n var funnelAlign = seriesModel.get('funnelAlign');\n var gap = seriesModel.get('gap');\n var viewSize = orient === 'horizontal' ? viewWidth : viewHeight;\n var itemSize = (viewSize - gap * (data.count() - 1)) / data.count();\n\n var getLinePoints = function (idx, offset) {\n // End point index is data.count() and we assign it 0\n if (orient === 'horizontal') {\n var val_1 = data.get(valueDim, idx) || 0;\n var itemHeight = linearMap(val_1, [min, max], sizeExtent, true);\n var y0 = void 0;\n\n switch (funnelAlign) {\n case 'top':\n y0 = y;\n break;\n\n case 'center':\n y0 = y + (viewHeight - itemHeight) / 2;\n break;\n\n case 'bottom':\n y0 = y + (viewHeight - itemHeight);\n break;\n }\n\n return [[offset, y0], [offset, y0 + itemHeight]];\n }\n\n var val = data.get(valueDim, idx) || 0;\n var itemWidth = linearMap(val, [min, max], sizeExtent, true);\n var x0;\n\n switch (funnelAlign) {\n case 'left':\n x0 = x;\n break;\n\n case 'center':\n x0 = x + (viewWidth - itemWidth) / 2;\n break;\n\n case 'right':\n x0 = x + viewWidth - itemWidth;\n break;\n }\n\n return [[x0, offset], [x0 + itemWidth, offset]];\n };\n\n if (sort === 'ascending') {\n // From bottom to top\n itemSize = -itemSize;\n gap = -gap;\n\n if (orient === 'horizontal') {\n x += viewWidth;\n } else {\n y += viewHeight;\n }\n\n indices = indices.reverse();\n }\n\n for (var i = 0; i < indices.length; i++) {\n var idx = indices[i];\n var nextIdx = indices[i + 1];\n var itemModel = data.getItemModel(idx);\n\n if (orient === 'horizontal') {\n var width = itemModel.get(['itemStyle', 'width']);\n\n if (width == null) {\n width = itemSize;\n } else {\n width = parsePercent(width, viewWidth);\n\n if (sort === 'ascending') {\n width = -width;\n }\n }\n\n var start = getLinePoints(idx, x);\n var end = getLinePoints(nextIdx, x + width);\n x += width + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n } else {\n var height = itemModel.get(['itemStyle', 'height']);\n\n if (height == null) {\n height = itemSize;\n } else {\n height = parsePercent(height, viewHeight);\n\n if (sort === 'ascending') {\n height = -height;\n }\n }\n\n var start = getLinePoints(idx, y);\n var end = getLinePoints(nextIdx, y + height);\n y += height + gap;\n data.setItemLayout(idx, {\n points: start.concat(end.slice().reverse())\n });\n }\n }\n\n labelLayout(data);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport FunnelView from './FunnelView.js';\nimport FunnelSeriesModel from './FunnelSeries.js';\nimport funnelLayout from './funnelLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(FunnelView);\n registers.registerSeriesModel(FunnelSeriesModel);\n registers.registerLayout(funnelLayout);\n registers.registerProcessor(dataFilter('funnel'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { numericToNumber } from '../../util/number.js';\nimport { eqNaN } from 'zrender/lib/core/util.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar DEFAULT_SMOOTH = 0.3;\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n _this._dataGroup = new graphic.Group();\n _this._initialized = false;\n return _this;\n }\n\n ParallelView.prototype.init = function () {\n this.group.add(this._dataGroup);\n };\n /**\r\n * @override\r\n */\n\n\n ParallelView.prototype.render = function (seriesModel, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var dataGroup = this._dataGroup;\n var data = seriesModel.getData();\n var oldData = this._data;\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n data.diff(oldData).add(add).update(update).remove(remove).execute();\n\n function add(newDataIndex) {\n var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function update(newDataIndex, oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n var points = createLinePoints(data, newDataIndex, dimensions, coordSys);\n data.setItemGraphicEl(newDataIndex, line);\n graphic.updateProps(line, {\n shape: {\n points: points\n }\n }, seriesModel, newDataIndex);\n saveOldStyle(line);\n updateElCommon(line, data, newDataIndex, seriesScope);\n }\n\n function remove(oldDataIndex) {\n var line = oldData.getItemGraphicEl(oldDataIndex);\n dataGroup.remove(line);\n } // First create\n\n\n if (!this._initialized) {\n this._initialized = true;\n var clipPath = createGridClipShape(coordSys, seriesModel, function () {\n // Callback will be invoked immediately if there is no animation\n setTimeout(function () {\n dataGroup.removeClipPath();\n });\n });\n dataGroup.setClipPath(clipPath);\n }\n\n this._data = data;\n };\n\n ParallelView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._initialized = true;\n this._data = null;\n\n this._dataGroup.removeAll();\n };\n\n ParallelView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dimensions = coordSys.dimensions;\n var seriesScope = makeSeriesScope(seriesModel);\n var progressiveEls = this._progressiveEls = [];\n\n for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {\n var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);\n line.incremental = true;\n updateElCommon(line, data, dataIndex, seriesScope);\n progressiveEls.push(line);\n }\n };\n\n ParallelView.prototype.remove = function () {\n this._dataGroup && this._dataGroup.removeAll();\n this._data = null;\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ChartView);\n\nfunction createGridClipShape(coordSys, seriesModel, cb) {\n var parallelModel = coordSys.model;\n var rect = coordSys.getRect();\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n }\n });\n var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';\n rectEl.setShape(dim, 0);\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width,\n height: rect.height\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nfunction createLinePoints(data, dataIndex, dimensions, coordSys) {\n var points = [];\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimName = dimensions[i];\n var value = data.get(data.mapDimension(dimName), dataIndex);\n\n if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {\n points.push(coordSys.dataToPoint(value, dimName));\n }\n }\n\n return points;\n}\n\nfunction addEl(data, dataGroup, dataIndex, dimensions, coordSys) {\n var points = createLinePoints(data, dataIndex, dimensions, coordSys);\n var line = new graphic.Polyline({\n shape: {\n points: points\n },\n // silent: true,\n z2: 10\n });\n dataGroup.add(line);\n data.setItemGraphicEl(dataIndex, line);\n return line;\n}\n\nfunction makeSeriesScope(seriesModel) {\n var smooth = seriesModel.get('smooth', true);\n smooth === true && (smooth = DEFAULT_SMOOTH);\n smooth = numericToNumber(smooth);\n eqNaN(smooth) && (smooth = 0);\n return {\n smooth: smooth\n };\n}\n\nfunction updateElCommon(el, data, dataIndex, seriesScope) {\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.fill = null;\n el.setShape('smooth', seriesScope.smooth);\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel, 'lineStyle');\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n} // function simpleDiff(oldData, newData, dimensions) {\n// let oldLen;\n// if (!oldData\n// || !oldData.__plProgressive\n// || (oldLen = oldData.count()) !== newData.count()\n// ) {\n// return true;\n// }\n// let dimLen = dimensions.length;\n// for (let i = 0; i < oldLen; i++) {\n// for (let j = 0; j < dimLen; j++) {\n// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) {\n// return true;\n// }\n// }\n// }\n// return false;\n// }\n// FIXME put in common util?\n\n\nfunction isEmptyValue(val, axisType) {\n return axisType === 'category' ? val == null : val == null || isNaN(val); // axisType === 'value'\n}\n\nexport default ParallelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { each, bind } from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\n\nvar ParallelSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelSeriesModel, _super);\n\n function ParallelSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n ParallelSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: bind(makeDefaultEncode, null, this)\n });\n };\n /**\r\n * User can get data raw indices on 'axisAreaSelected' event received.\r\n *\r\n * @return Raw indices\r\n */\n\n\n ParallelSeriesModel.prototype.getRawIndicesByActiveState = function (activeState) {\n var coordSys = this.coordinateSystem;\n var data = this.getData();\n var indices = [];\n coordSys.eachActiveState(data, function (theActiveState, dataIndex) {\n if (activeState === theActiveState) {\n indices.push(data.getRawIndex(dataIndex));\n }\n });\n return indices;\n };\n\n ParallelSeriesModel.type = 'series.parallel';\n ParallelSeriesModel.dependencies = ['parallel'];\n ParallelSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'parallel',\n parallelIndex: 0,\n label: {\n show: false\n },\n inactiveOpacity: 0.05,\n activeOpacity: 1,\n lineStyle: {\n width: 1,\n opacity: 0.45,\n type: 'solid'\n },\n emphasis: {\n label: {\n show: false\n }\n },\n progressive: 500,\n smooth: false,\n animationEasing: 'linear'\n };\n return ParallelSeriesModel;\n}(SeriesModel);\n\nfunction makeDefaultEncode(seriesModel) {\n // The mapping of parallelAxis dimension to data dimension can\n // be specified in parallelAxis.option.dim. For example, if\n // parallelAxis.option.dim is 'dim3', it mapping to the third\n // dimension of data. But `data.encode` has higher priority.\n // Moreover, parallelModel.dimension should not be regarded as data\n // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6'];\n var parallelModel = seriesModel.ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n\n if (!parallelModel) {\n return;\n }\n\n var encodeDefine = {};\n each(parallelModel.dimensions, function (axisDim) {\n var dataDimIndex = convertDimNameToNumber(axisDim);\n encodeDefine[axisDim] = dataDimIndex;\n });\n return encodeDefine;\n}\n\nfunction convertDimNameToNumber(dimName) {\n return +dimName.replace('dim', '');\n}\n\nexport default ParallelSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar opacityAccessPath = ['lineStyle', 'opacity'];\nvar parallelVisual = {\n seriesType: 'parallel',\n reset: function (seriesModel, ecModel) {\n var coordSys = seriesModel.coordinateSystem;\n var opacityMap = {\n normal: seriesModel.get(['lineStyle', 'opacity']),\n active: seriesModel.get('activeOpacity'),\n inactive: seriesModel.get('inactiveOpacity')\n };\n return {\n progress: function (params, data) {\n coordSys.eachActiveState(data, function (activeState, dataIndex) {\n var opacity = opacityMap[activeState];\n\n if (activeState === 'normal' && data.hasItemOption) {\n var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);\n itemOpacity != null && (opacity = itemOpacity);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n existsStyle.opacity = opacity;\n }, params.start, params.end);\n }\n };\n }\n};\nexport default parallelVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nexport default function parallelPreprocessor(option) {\n createParallelIfNeeded(option);\n mergeAxisOptionFromParallel(option);\n}\n/**\r\n * Create a parallel coordinate if not exists.\r\n * @inner\r\n */\n\nfunction createParallelIfNeeded(option) {\n if (option.parallel) {\n return;\n }\n\n var hasParallelSeries = false;\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'parallel') {\n hasParallelSeries = true;\n }\n });\n\n if (hasParallelSeries) {\n option.parallel = [{}];\n }\n}\n/**\r\n * Merge aixs definition from parallel option (if exists) to axis option.\r\n * @inner\r\n */\n\n\nfunction mergeAxisOptionFromParallel(option) {\n var axes = modelUtil.normalizeToArray(option.parallelAxis);\n zrUtil.each(axes, function (axisOption) {\n if (!zrUtil.isObject(axisOption)) {\n return;\n }\n\n var parallelIndex = axisOption.parallelIndex || 0;\n var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n\n if (parallelOption && parallelOption.parallelAxisDefault) {\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { each, bind, extend } from 'zrender/lib/core/util.js';\nimport { createOrUpdate, clear } from '../../util/throttle.js';\nvar CLICK_THRESHOLD = 5; // > 4\n\nvar ParallelView =\n/** @class */\nfunction (_super) {\n __extends(ParallelView, _super);\n\n function ParallelView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelView.type;\n return _this;\n }\n\n ParallelView.prototype.render = function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this));\n }, this);\n }\n\n createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n };\n\n ParallelView.prototype.dispose = function (ecModel, api) {\n clear(this, '_throttledDispatchExpand');\n each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n };\n /**\r\n * @internal\r\n * @param {Object} [opt] If null, cancel the last action triggering for debounce.\r\n */\n\n\n ParallelView.prototype._throttledDispatchExpand = function (opt) {\n this._dispatchExpand(opt);\n };\n /**\r\n * @internal\r\n */\n\n\n ParallelView.prototype._dispatchExpand = function (opt) {\n opt && this._api.dispatchAction(extend({\n type: 'parallelAxisExpand'\n }, opt));\n };\n\n ParallelView.type = 'parallel';\n return ParallelView;\n}(ComponentView);\n\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancel the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : {\n duration: 0 // Disable animation.\n\n }\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\nexport default ParallelView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar ParallelModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelModel, _super);\n\n function ParallelModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelModel.type;\n return _this;\n }\n\n ParallelModel.prototype.init = function () {\n _super.prototype.init.apply(this, arguments);\n\n this.mergeOption({});\n };\n\n ParallelModel.prototype.mergeOption = function (newOption) {\n var thisOption = this.option;\n newOption && zrUtil.merge(thisOption, newOption, true);\n\n this._initDimensions();\n };\n /**\r\n * Whether series or axis is in this coordinate system.\r\n */\n\n\n ParallelModel.prototype.contains = function (model, ecModel) {\n var parallelIndex = model.get('parallelIndex');\n return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n };\n\n ParallelModel.prototype.setAxisExpand = function (opt) {\n zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n if (opt.hasOwnProperty(name)) {\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n this.option[name] = opt[name];\n }\n }, this);\n };\n\n ParallelModel.prototype._initDimensions = function () {\n var dimensions = this.dimensions = [];\n var parallelAxisIndex = this.parallelAxisIndex = [];\n var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n mainType: 'parallelAxis'\n }), function (axisModel) {\n // Can not use this.contains here, because\n // initialization has not been completed yet.\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n }, this);\n zrUtil.each(axisModels, function (axisModel) {\n dimensions.push('dim' + axisModel.get('dim'));\n parallelAxisIndex.push(axisModel.componentIndex);\n });\n };\n\n ParallelModel.type = 'parallel';\n ParallelModel.dependencies = ['parallelAxis'];\n ParallelModel.layoutMode = 'box';\n ParallelModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n layout: 'horizontal',\n // FIXME\n // naming?\n axisExpandable: false,\n axisExpandCenter: null,\n axisExpandCount: 0,\n axisExpandWidth: 50,\n axisExpandRate: 17,\n axisExpandDebounce: 50,\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n // Do not doc to user until necessary.\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n axisExpandTriggerOn: 'click',\n parallelAxisDefault: null\n };\n return ParallelModel;\n}(ComponentModel);\n\nexport default ParallelModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar ParallelAxis =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxis, _super);\n\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.axisIndex = axisIndex;\n return _this;\n }\n\n ParallelAxis.prototype.isHorizontal = function () {\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n };\n\n return ParallelAxis;\n}(Axis);\n\nexport default ParallelAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Calculate slider move result.\r\n * Usage:\r\n * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as\r\n * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`.\r\n * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`.\r\n *\r\n * @param delta Move length.\r\n * @param handleEnds handleEnds[0] can be bigger then handleEnds[1].\r\n * handleEnds will be modified in this method.\r\n * @param extent handleEnds is restricted by extent.\r\n * extent[0] should less or equals than extent[1].\r\n * @param handleIndex Can be 'all', means that both move the two handleEnds.\r\n * @param minSpan The range of dataZoom can not be smaller than that.\r\n * If not set, handle0 and cross handle1. If set as a non-negative\r\n * number (including `0`), handles will push each other when reaching\r\n * the minSpan.\r\n * @param maxSpan The range of dataZoom can not be larger than that.\r\n * @return The input handleEnds.\r\n */\nexport default function sliderMove(delta, handleEnds, extent, handleIndex, minSpan, maxSpan) {\n delta = delta || 0;\n var extentSpan = extent[1] - extent[0]; // Notice maxSpan and minSpan can be null/undefined.\n\n if (minSpan != null) {\n minSpan = restrict(minSpan, [0, extentSpan]);\n }\n\n if (maxSpan != null) {\n maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);\n }\n\n if (handleIndex === 'all') {\n var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);\n handleSpan = restrict(handleSpan, [0, extentSpan]);\n minSpan = maxSpan = restrict(handleSpan, [minSpan, maxSpan]);\n handleIndex = 0;\n }\n\n handleEnds[0] = restrict(handleEnds[0], extent);\n handleEnds[1] = restrict(handleEnds[1], extent);\n var originalDistSign = getSpanSign(handleEnds, handleIndex);\n handleEnds[handleIndex] += delta; // Restrict in extent.\n\n var extentMinSpan = minSpan || 0;\n var realExtent = extent.slice();\n originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;\n handleEnds[handleIndex] = restrict(handleEnds[handleIndex], realExtent); // Expand span.\n\n var currDistSign;\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {\n // If minSpan exists, 'cross' is forbidden.\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;\n } // Shrink span.\n\n\n currDistSign = getSpanSign(handleEnds, handleIndex);\n\n if (maxSpan != null && currDistSign.span > maxSpan) {\n handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;\n }\n\n return handleEnds;\n}\n\nfunction getSpanSign(handleEnds, handleIndex) {\n var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0]\n // is at left of handleEnds[1] for non-cross case.\n\n return {\n span: Math.abs(dist),\n sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1\n };\n}\n\nfunction restrict(value, extend) {\n return Math.min(extend[1] != null ? extend[1] : Infinity, Math.max(extend[0] != null ? extend[0] : -Infinity, value));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parallel Coordinates\r\n * \r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport ParallelAxis from './ParallelAxis.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../../component/helper/sliderMove.js';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\n\nvar Parallel =\n/** @class */\nfunction () {\n function Parallel(parallelModel, ecModel, api) {\n this.type = 'parallel';\n /**\r\n * key: dimension\r\n */\n\n this._axesMap = zrUtil.createHashMap();\n /**\r\n * key: dimension\r\n * value: {position: [], rotation, }\r\n */\n\n this._axesLayout = {};\n this.dimensions = parallelModel.dimensions;\n this._model = parallelModel;\n\n this._init(parallelModel, ecModel, api);\n }\n\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\n var dimensions = parallelModel.dimensions;\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\n each(dimensions, function (dim, idx) {\n var axisIndex = parallelAxisIndex[idx];\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Injection\n\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = axisModel.coordinateSystem = this;\n }, this);\n };\n /**\r\n * Update axis scale after data processed\r\n */\n\n\n Parallel.prototype.update = function (ecModel, api) {\n this._updateAxesFromSeries(this._model, ecModel);\n };\n\n Parallel.prototype.containPoint = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var axisBase = layoutInfo.axisBase;\n var layoutBase = layoutInfo.layoutBase;\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var pAxis = point[1 - pixelDimIndex];\n var pLayout = point[pixelDimIndex];\n return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n };\n\n Parallel.prototype.getModel = function () {\n return this._model;\n };\n /**\r\n * Update properties from series\r\n */\n\n\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n ecModel.eachSeries(function (seriesModel) {\n if (!parallelModel.contains(seriesModel, ecModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n each(this.dimensions, function (dim) {\n var axis = this._axesMap.get(dim);\n\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n axisHelper.niceScaleExtent(axis.scale, axis.model);\n }, this);\n }, this);\n };\n /**\r\n * Resize the parallel coordinate system.\r\n */\n\n\n Parallel.prototype.resize = function (parallelModel, api) {\n this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._layoutAxes();\n };\n\n Parallel.prototype.getRect = function () {\n return this._rect;\n };\n\n Parallel.prototype._makeLayoutInfo = function () {\n var parallelModel = this._model;\n var rect = this._rect;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var layout = parallelModel.get('layout');\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n var layoutLength = rect[wh[pixelDimIndex]];\n var layoutExtent = [0, layoutLength];\n var axisCount = this.dimensions.length;\n var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n // where collapsed axes should be overlapped.\n\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\n var winSize;\n\n if (!axisExpandWindow) {\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n } else {\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n }\n\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small.\n\n axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1].\n\n var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates.\n\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n return {\n layout: layout,\n pixelDimIndex: pixelDimIndex,\n layoutBase: rect[xy[pixelDimIndex]],\n layoutLength: layoutLength,\n axisBase: rect[xy[1 - pixelDimIndex]],\n axisLength: rect[wh[1 - pixelDimIndex]],\n axisExpandable: axisExpandable,\n axisExpandWidth: axisExpandWidth,\n axisCollapseWidth: axisCollapseWidth,\n axisExpandWindow: axisExpandWindow,\n axisCount: axisCount,\n winInnerIndices: winInnerIndices,\n axisExpandWindow0Pos: axisExpandWindow0Pos\n };\n };\n\n Parallel.prototype._layoutAxes = function () {\n var rect = this._rect;\n var axes = this._axesMap;\n var dimensions = this.dimensions;\n\n var layoutInfo = this._makeLayoutInfo();\n\n var layout = layoutInfo.layout;\n axes.each(function (axis) {\n var axisExtent = [0, layoutInfo.axisLength];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n });\n each(dimensions, function (dim, idx) {\n var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n var positionTable = {\n horizontal: {\n x: posInfo.position,\n y: layoutInfo.axisLength\n },\n vertical: {\n x: 0,\n y: posInfo.position\n }\n };\n var rotationTable = {\n horizontal: PI / 2,\n vertical: 0\n };\n var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n var rotation = rotationTable[layout];\n var transform = matrix.create();\n matrix.rotate(transform, transform, rotation);\n matrix.translate(transform, transform, position); // TODO\n // tick layout info\n // TODO\n // update dimensions info based on axis order.\n\n this._axesLayout[dim] = {\n position: position,\n rotation: rotation,\n transform: transform,\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n axisLabelShow: posInfo.axisLabelShow,\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n tickDirection: 1,\n labelDirection: 1\n };\n }, this);\n };\n /**\r\n * Get axis by dim.\r\n */\n\n\n Parallel.prototype.getAxis = function (dim) {\n return this._axesMap.get(dim);\n };\n /**\r\n * Convert a dim value of a single item of series data to Point.\r\n */\n\n\n Parallel.prototype.dataToPoint = function (value, dim) {\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n };\n /**\r\n * Travel data for one time, get activeState of each data item.\r\n * @param start the start dataIndex that travel from.\r\n * @param end the next dataIndex of the last dataIndex will be travel.\r\n */\n\n\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n start == null && (start = 0);\n end == null && (end = data.count());\n var axesMap = this._axesMap;\n var dimensions = this.dimensions;\n var dataDimensions = [];\n var axisModels = [];\n zrUtil.each(dimensions, function (axisDim) {\n dataDimensions.push(data.mapDimension(axisDim));\n axisModels.push(axesMap.get(axisDim).model);\n });\n var hasActiveSet = this.hasAxisBrushed();\n\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\n var activeState = void 0;\n\n if (!hasActiveSet) {\n activeState = 'normal';\n } else {\n activeState = 'active';\n var values = data.getValues(dataDimensions, dataIndex);\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n var state = axisModels[j].getActiveState(values[j]);\n\n if (state === 'inactive') {\n activeState = 'inactive';\n break;\n }\n }\n }\n\n callback(activeState, dataIndex);\n }\n };\n /**\r\n * Whether has any activeSet.\r\n */\n\n\n Parallel.prototype.hasAxisBrushed = function () {\n var dimensions = this.dimensions;\n var axesMap = this._axesMap;\n var hasActiveSet = false;\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n hasActiveSet = true;\n }\n }\n\n return hasActiveSet;\n };\n /**\r\n * Convert coords of each axis to Point.\r\n * Return point. For example: [10, 20]\r\n */\n\n\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n var axisLayout = this._axesLayout[dim];\n return graphic.applyTransform([coord, 0], axisLayout.transform);\n };\n /**\r\n * Get axis layout.\r\n */\n\n\n Parallel.prototype.getAxisLayout = function (dim) {\n return zrUtil.clone(this._axesLayout[dim]);\n };\n /**\r\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\r\n */\n\n\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system.\n\n if (!this.containPoint(point)) {\n return {\n behavior: 'none',\n axisExpandWindow: axisExpandWindow\n };\n } // Convert the point from global to expand coordinates.\n\n\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be\n // slided when mouse is the center area of the window.\n\n var delta;\n var behavior = 'slide';\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n\n var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary.\n\n\n var useJump = triggerArea[0] != null;\n\n if (axisCollapseWidth) {\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n behavior = 'jump';\n delta = pointCoord - winSize * triggerArea[2];\n } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n behavior = 'jump';\n delta = pointCoord - winSize * (1 - triggerArea[2]);\n } else {\n (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n }\n\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove.\n : behavior = 'none';\n } // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n else {\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n var pos = extent[1] * pointCoord / winSize2;\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n }\n\n return {\n axisExpandWindow: axisExpandWindow,\n behavior: behavior\n };\n };\n\n return Parallel;\n}();\n\nfunction restrict(len, extent) {\n return mathMin(mathMax(len, extent[0]), extent[1]);\n}\n\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n return {\n position: step * axisIndex,\n axisNameAvailableWidth: step,\n axisLabelShow: true\n };\n}\n\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n var layoutLength = layoutInfo.layoutLength;\n var axisExpandWidth = layoutInfo.axisExpandWidth;\n var axisCount = layoutInfo.axisCount;\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var winInnerIndices = layoutInfo.winInnerIndices;\n var position;\n var axisNameAvailableWidth = axisCollapseWidth;\n var axisLabelShow = false;\n var nameTruncateMaxWidth;\n\n if (axisIndex < winInnerIndices[0]) {\n position = axisIndex * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n } else if (axisIndex <= winInnerIndices[1]) {\n position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n axisNameAvailableWidth = axisExpandWidth;\n axisLabelShow = true;\n } else {\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n }\n\n return {\n position: position,\n axisNameAvailableWidth: axisNameAvailableWidth,\n axisLabelShow: axisLabelShow,\n nameTruncateMaxWidth: nameTruncateMaxWidth\n };\n}\n\nexport default Parallel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Parallel coordinate system creater.\r\n */\nimport Parallel from './Parallel.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nfunction createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nvar parallelCoordSysCreator = {\n create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper.js';\nimport * as numberUtil from '../../util/number.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\n\nvar ParallelAxisModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisModel, _super);\n\n function ParallelAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisModel.type;\n /**\r\n * @readOnly\r\n */\n\n _this.activeIntervals = [];\n return _this;\n }\n\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n // So do not transfer decal directly.\n ])(this.getModel('areaSelectStyle'));\n };\n /**\r\n * The code of this feature is put on AxisModel but not ParallelAxis,\r\n * because axisModel can be alive after echarts updating but instance of\r\n * ParallelAxis having been disposed. this._activeInterval should be kept\r\n * when action dispatched (i.e. legend click).\r\n *\r\n * @param intervals `interval.length === 0` means set all active.\r\n */\n\n\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n var activeIntervals = this.activeIntervals = zrUtil.clone(intervals); // Normalize\n\n if (activeIntervals) {\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\n numberUtil.asc(activeIntervals[i]);\n }\n }\n };\n /**\r\n * @param value When only attempting detect whether 'no activeIntervals set',\r\n * `value` is not needed to be input.\r\n */\n\n\n ParallelAxisModel.prototype.getActiveState = function (value) {\n var activeIntervals = this.activeIntervals;\n\n if (!activeIntervals.length) {\n return 'normal';\n }\n\n if (value == null || isNaN(+value)) {\n return 'inactive';\n } // Simple optimization\n\n\n if (activeIntervals.length === 1) {\n var interval = activeIntervals[0];\n\n if (interval[0] <= value && value <= interval[1]) {\n return 'active';\n }\n } else {\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n return 'active';\n }\n }\n }\n\n return 'inactive';\n };\n\n return ParallelAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { curry, each, map, bind, merge, clone, defaults, assert } from 'zrender/lib/core/util.js';\nimport Eventful from 'zrender/lib/core/Eventful.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as interactionMutex from './interactionMutex.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nvar BRUSH_PANEL_GLOBAL = true;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathPow = Math.pow;\nvar COVER_Z = 10000;\nvar UNSELECT_THRESHOLD = 6;\nvar MIN_RESIZE_LINE_WIDTH = 6;\nvar MUTEX_RESOURCE_KEY = 'globalPan';\nvar DIRECTION_MAP = {\n w: [0, 0],\n e: [0, 1],\n n: [1, 0],\n s: [1, 1]\n};\nvar CURSOR_MAP = {\n w: 'ew',\n e: 'ew',\n n: 'ns',\n s: 'ns',\n ne: 'nesw',\n sw: 'nesw',\n nw: 'nwse',\n se: 'nwse'\n};\nvar DEFAULT_BRUSH_OPT = {\n brushStyle: {\n lineWidth: 2,\n stroke: 'rgba(210,219,238,0.3)',\n fill: '#D2DBEE'\n },\n transformable: true,\n brushMode: 'single',\n removeOnClick: false\n};\nvar baseUID = 0;\n/**\r\n * params:\r\n * areas: Array., coord relates to container group,\r\n * If no container specified, to global.\r\n * opt {\r\n * isEnd: boolean,\r\n * removeOnClick: boolean\r\n * }\r\n */\n\nvar BrushController =\n/** @class */\nfunction (_super) {\n __extends(BrushController, _super);\n\n function BrushController(zr) {\n var _this = _super.call(this) || this;\n /**\r\n * @internal\r\n */\n\n\n _this._track = [];\n /**\r\n * @internal\r\n */\n\n _this._covers = [];\n _this._handlers = {};\n\n if (process.env.NODE_ENV !== 'production') {\n assert(zr);\n }\n\n _this._zr = zr;\n _this.group = new graphic.Group();\n _this._uid = 'brushController_' + baseUID++;\n each(pointerHandlers, function (handler, eventName) {\n this._handlers[eventName] = bind(handler, this);\n }, _this);\n return _this;\n }\n /**\r\n * If set to `false`, select disabled.\r\n */\n\n\n BrushController.prototype.enableBrush = function (brushOption) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n this._brushType && this._doDisableBrush();\n brushOption.brushType && this._doEnableBrush(brushOption);\n return this;\n };\n\n BrushController.prototype._doEnableBrush = function (brushOption) {\n var zr = this._zr; // Consider roam, which takes globalPan too.\n\n if (!this._enableGlobalPan) {\n interactionMutex.take(zr, MUTEX_RESOURCE_KEY, this._uid);\n }\n\n each(this._handlers, function (handler, eventName) {\n zr.on(eventName, handler);\n });\n this._brushType = brushOption.brushType;\n this._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true);\n };\n\n BrushController.prototype._doDisableBrush = function () {\n var zr = this._zr;\n interactionMutex.release(zr, MUTEX_RESOURCE_KEY, this._uid);\n each(this._handlers, function (handler, eventName) {\n zr.off(eventName, handler);\n });\n this._brushType = this._brushOption = null;\n };\n /**\r\n * @param panelOpts If not pass, it is global brush.\r\n */\n\n\n BrushController.prototype.setPanels = function (panelOpts) {\n if (panelOpts && panelOpts.length) {\n var panels_1 = this._panels = {};\n each(panelOpts, function (panelOpts) {\n panels_1[panelOpts.panelId] = clone(panelOpts);\n });\n } else {\n this._panels = null;\n }\n\n return this;\n };\n\n BrushController.prototype.mount = function (opt) {\n opt = opt || {};\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = true; // should be at first.\n }\n\n this._enableGlobalPan = opt.enableGlobalPan;\n var thisGroup = this.group;\n\n this._zr.add(thisGroup);\n\n thisGroup.attr({\n x: opt.x || 0,\n y: opt.y || 0,\n rotation: opt.rotation || 0,\n scaleX: opt.scaleX || 1,\n scaleY: opt.scaleY || 1\n });\n this._transform = thisGroup.getLocalTransform();\n return this;\n }; // eachCover(cb, context): void {\n // each(this._covers, cb, context);\n // }\n\n /**\r\n * Update covers.\r\n * @param coverConfigList\r\n * If coverConfigList is null/undefined, all covers removed.\r\n */\n\n\n BrushController.prototype.updateCovers = function (coverConfigList) {\n if (process.env.NODE_ENV !== 'production') {\n assert(this._mounted);\n }\n\n coverConfigList = map(coverConfigList, function (coverConfig) {\n return merge(clone(DEFAULT_BRUSH_OPT), coverConfig, true);\n });\n var tmpIdPrefix = '\\0-brush-index-';\n var oldCovers = this._covers;\n var newCovers = this._covers = [];\n var controller = this;\n var creatingCover = this._creatingCover;\n new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey).add(addOrUpdate).update(addOrUpdate).remove(remove).execute();\n return this;\n\n function getKey(brushOption, index) {\n return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + '-' + brushOption.brushType;\n }\n\n function oldGetKey(cover, index) {\n return getKey(cover.__brushOption, index);\n }\n\n function addOrUpdate(newIndex, oldIndex) {\n var newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect,\n // where updating cover when creating should be forbidden.\n\n if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {\n newCovers[newIndex] = oldCovers[oldIndex];\n } else {\n var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));\n updateCoverAfterCreation(controller, cover);\n }\n }\n\n function remove(oldIndex) {\n if (oldCovers[oldIndex] !== creatingCover) {\n controller.group.remove(oldCovers[oldIndex]);\n }\n }\n };\n\n BrushController.prototype.unmount = function () {\n if (process.env.NODE_ENV !== 'production') {\n if (!this._mounted) {\n return;\n }\n }\n\n this.enableBrush(false); // container may 'removeAll' outside.\n\n clearCovers(this);\n\n this._zr.remove(this.group);\n\n if (process.env.NODE_ENV !== 'production') {\n this._mounted = false; // should be at last.\n }\n\n return this;\n };\n\n BrushController.prototype.dispose = function () {\n this.unmount();\n this.off();\n };\n\n return BrushController;\n}(Eventful);\n\nfunction createCover(controller, brushOption) {\n var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);\n cover.__brushOption = brushOption;\n updateZ(cover, brushOption);\n controller.group.add(cover);\n return cover;\n}\n\nfunction endCreating(controller, creatingCover) {\n var coverRenderer = getCoverRenderer(creatingCover);\n\n if (coverRenderer.endCreating) {\n coverRenderer.endCreating(controller, creatingCover);\n updateZ(creatingCover, creatingCover.__brushOption);\n }\n\n return creatingCover;\n}\n\nfunction updateCoverShape(controller, cover) {\n var brushOption = cover.__brushOption;\n getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);\n}\n\nfunction updateZ(cover, brushOption) {\n var z = brushOption.z;\n z == null && (z = COVER_Z);\n cover.traverse(function (el) {\n el.z = z;\n el.z2 = z; // Consider in given container.\n });\n}\n\nfunction updateCoverAfterCreation(controller, cover) {\n getCoverRenderer(cover).updateCommon(controller, cover);\n updateCoverShape(controller, cover);\n}\n\nfunction getCoverRenderer(cover) {\n return coverRenderers[cover.__brushOption.brushType];\n} // return target panel or `true` (means global panel)\n\n\nfunction getPanelByPoint(controller, e, localCursorPoint) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panel;\n var transform = controller._transform;\n each(panels, function (pn) {\n pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn);\n });\n return panel;\n} // Return a panel or true\n\n\nfunction getPanelByCover(controller, cover) {\n var panels = controller._panels;\n\n if (!panels) {\n return BRUSH_PANEL_GLOBAL; // Global panel\n }\n\n var panelId = cover.__brushOption.panelId; // User may give cover without coord sys info,\n // which is then treated as global panel.\n\n return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;\n}\n\nfunction clearCovers(controller) {\n var covers = controller._covers;\n var originalLength = covers.length;\n each(covers, function (cover) {\n controller.group.remove(cover);\n }, controller);\n covers.length = 0;\n return !!originalLength;\n}\n\nfunction trigger(controller, opt) {\n var areas = map(controller._covers, function (cover) {\n var brushOption = cover.__brushOption;\n var range = clone(brushOption.range);\n return {\n brushType: brushOption.brushType,\n panelId: brushOption.panelId,\n range: range\n };\n });\n controller.trigger('brush', {\n areas: areas,\n isEnd: !!opt.isEnd,\n removeOnClick: !!opt.removeOnClick\n });\n}\n\nfunction shouldShowCover(controller) {\n var track = controller._track;\n\n if (!track.length) {\n return false;\n }\n\n var p2 = track[track.length - 1];\n var p1 = track[0];\n var dx = p2[0] - p1[0];\n var dy = p2[1] - p1[1];\n var dist = mathPow(dx * dx + dy * dy, 0.5);\n return dist > UNSELECT_THRESHOLD;\n}\n\nfunction getTrackEnds(track) {\n var tail = track.length - 1;\n tail < 0 && (tail = 0);\n return [track[0], track[tail]];\n}\n\n;\n\nfunction createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {\n var cover = new graphic.Group();\n cover.add(new graphic.Rect({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true,\n draggable: true,\n cursor: 'move',\n drift: curry(driftRect, rectRangeConverter, controller, cover, ['n', 's', 'w', 'e']),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n each(edgeNameSequences, function (nameSequence) {\n cover.add(new graphic.Rect({\n name: nameSequence.join(''),\n style: {\n opacity: 0\n },\n draggable: true,\n silent: true,\n invisible: true,\n drift: curry(driftRect, rectRangeConverter, controller, cover, nameSequence),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n });\n return cover;\n}\n\nfunction updateBaseRect(controller, cover, localRange, brushOption) {\n var lineWidth = brushOption.brushStyle.lineWidth || 0;\n var handleSize = mathMax(lineWidth, MIN_RESIZE_LINE_WIDTH);\n var x = localRange[0][0];\n var y = localRange[1][0];\n var xa = x - lineWidth / 2;\n var ya = y - lineWidth / 2;\n var x2 = localRange[0][1];\n var y2 = localRange[1][1];\n var x2a = x2 - handleSize + lineWidth / 2;\n var y2a = y2 - handleSize + lineWidth / 2;\n var width = x2 - x;\n var height = y2 - y;\n var widtha = width + lineWidth;\n var heighta = height + lineWidth;\n updateRectShape(controller, cover, 'main', x, y, width, height);\n\n if (brushOption.transformable) {\n updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta);\n updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize);\n updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize);\n updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize);\n updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize);\n updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize);\n }\n}\n\nfunction updateCommon(controller, cover) {\n var brushOption = cover.__brushOption;\n var transformable = brushOption.transformable;\n var mainEl = cover.childAt(0);\n mainEl.useStyle(makeStyle(brushOption));\n mainEl.attr({\n silent: !transformable,\n cursor: transformable ? 'move' : 'default'\n });\n each([['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']], function (nameSequence) {\n var el = cover.childOfName(nameSequence.join(''));\n var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);\n el && el.attr({\n silent: !transformable,\n invisible: !transformable,\n cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null\n });\n });\n}\n\nfunction updateRectShape(controller, cover, name, x, y, w, h) {\n var el = cover.childOfName(name);\n el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x, y], [x + w, y + h]])));\n}\n\nfunction makeStyle(brushOption) {\n return defaults({\n strokeNoScale: true\n }, brushOption.brushStyle);\n}\n\nfunction formatRectRange(x, y, x2, y2) {\n var min = [mathMin(x, x2), mathMin(y, y2)];\n var max = [mathMax(x, x2), mathMax(y, y2)];\n return [[min[0], max[0]], [min[1], max[1]] // y range\n ];\n}\n\nfunction getTransform(controller) {\n return graphic.getTransform(controller.group);\n}\n\nfunction getGlobalDirection1(controller, localDirName) {\n var map = {\n w: 'left',\n e: 'right',\n n: 'top',\n s: 'bottom'\n };\n var inverseMap = {\n left: 'w',\n right: 'e',\n top: 'n',\n bottom: 's'\n };\n var dir = graphic.transformDirection(map[localDirName], getTransform(controller));\n return inverseMap[dir];\n}\n\nfunction getGlobalDirection2(controller, localDirNameSeq) {\n var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];\n (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse();\n return globalDir.join('');\n}\n\nfunction driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {\n var brushOption = cover.__brushOption;\n var rectRange = rectRangeConverter.toRectRange(brushOption.range);\n var localDelta = toLocalDelta(controller, dx, dy);\n each(dirNameSequence, function (dirName) {\n var ind = DIRECTION_MAP[dirName];\n rectRange[ind[0]][ind[1]] += localDelta[ind[0]];\n });\n brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction driftPolygon(controller, cover, dx, dy) {\n var range = cover.__brushOption.range;\n var localDelta = toLocalDelta(controller, dx, dy);\n each(range, function (point) {\n point[0] += localDelta[0];\n point[1] += localDelta[1];\n });\n updateCoverAfterCreation(controller, cover);\n trigger(controller, {\n isEnd: false\n });\n}\n\nfunction toLocalDelta(controller, dx, dy) {\n var thisGroup = controller.group;\n var localD = thisGroup.transformCoordToLocal(dx, dy);\n var localZero = thisGroup.transformCoordToLocal(0, 0);\n return [localD[0] - localZero[0], localD[1] - localZero[1]];\n}\n\nfunction clipByPanel(controller, cover, data) {\n var panel = getPanelByCover(controller, cover);\n return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone(data);\n}\n\nfunction pointsToRect(points) {\n var xmin = mathMin(points[0][0], points[1][0]);\n var ymin = mathMin(points[0][1], points[1][1]);\n var xmax = mathMax(points[0][0], points[1][0]);\n var ymax = mathMax(points[0][1], points[1][1]);\n return {\n x: xmin,\n y: ymin,\n width: xmax - xmin,\n height: ymax - ymin\n };\n}\n\nfunction resetCursor(controller, e, localCursorPoint) {\n if ( // Check active\n !controller._brushType // resetCursor should be always called when mouse is in zr area,\n // but not called when mouse is out of zr area to avoid bad influence\n // if `mousemove`, `mouseup` are triggered from `document` event.\n || isOutsideZrArea(controller, e.offsetX, e.offsetY)) {\n return;\n }\n\n var zr = controller._zr;\n var covers = controller._covers;\n var currPanel = getPanelByPoint(controller, e, localCursorPoint); // Check whether in covers.\n\n if (!controller._dragging) {\n for (var i = 0; i < covers.length; i++) {\n var brushOption = covers[i].__brushOption;\n\n if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) {\n // Use cursor style set on cover.\n return;\n }\n }\n }\n\n currPanel && zr.setCursorStyle('crosshair');\n}\n\nfunction preventDefault(e) {\n var rawE = e.event;\n rawE.preventDefault && rawE.preventDefault();\n}\n\nfunction mainShapeContain(cover, x, y) {\n return cover.childOfName('main').contain(x, y);\n}\n\nfunction updateCoverByMouse(controller, e, localCursorPoint, isEnd) {\n var creatingCover = controller._creatingCover;\n var panel = controller._creatingPanel;\n var thisBrushOption = controller._brushOption;\n var eventParams;\n\n controller._track.push(localCursorPoint.slice());\n\n if (shouldShowCover(controller) || creatingCover) {\n if (panel && !creatingCover) {\n thisBrushOption.brushMode === 'single' && clearCovers(controller);\n var brushOption = clone(thisBrushOption);\n brushOption.brushType = determineBrushType(brushOption.brushType, panel);\n brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;\n creatingCover = controller._creatingCover = createCover(controller, brushOption);\n\n controller._covers.push(creatingCover);\n }\n\n if (creatingCover) {\n var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];\n var coverBrushOption = creatingCover.__brushOption;\n coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));\n\n if (isEnd) {\n endCreating(controller, creatingCover);\n coverRenderer.updateCommon(controller, creatingCover);\n }\n\n updateCoverShape(controller, creatingCover);\n eventParams = {\n isEnd: isEnd\n };\n }\n } else if (isEnd && thisBrushOption.brushMode === 'single' && thisBrushOption.removeOnClick) {\n // Help user to remove covers easily, only by a tiny drag, in 'single' mode.\n // But a single click do not clear covers, because user may have casual\n // clicks (for example, click on other component and do not expect covers\n // disappear).\n // Only some cover removed, trigger action, but not every click trigger action.\n if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) {\n eventParams = {\n isEnd: isEnd,\n removeOnClick: true\n };\n }\n }\n\n return eventParams;\n}\n\nfunction determineBrushType(brushType, panel) {\n if (brushType === 'auto') {\n if (process.env.NODE_ENV !== 'production') {\n assert(panel && panel.defaultBrushType, 'MUST have defaultBrushType when brushType is \"atuo\"');\n }\n\n return panel.defaultBrushType;\n }\n\n return brushType;\n}\n\nvar pointerHandlers = {\n mousedown: function (e) {\n if (this._dragging) {\n // In case some browser do not support globalOut,\n // and release mouse out side the browser.\n handleDragEnd(this, e);\n } else if (!e.target || !e.target.draggable) {\n preventDefault(e);\n var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY);\n this._creatingCover = null;\n var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint);\n\n if (panel) {\n this._dragging = true;\n this._track = [localCursorPoint.slice()];\n }\n }\n },\n mousemove: function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = this.group.transformCoordToLocal(x, y);\n resetCursor(this, e, localCursorPoint);\n\n if (this._dragging) {\n preventDefault(e);\n var eventParams = updateCoverByMouse(this, e, localCursorPoint, false);\n eventParams && trigger(this, eventParams);\n }\n },\n mouseup: function (e) {\n handleDragEnd(this, e);\n }\n};\n\nfunction handleDragEnd(controller, e) {\n if (controller._dragging) {\n preventDefault(e);\n var x = e.offsetX;\n var y = e.offsetY;\n var localCursorPoint = controller.group.transformCoordToLocal(x, y);\n var eventParams = updateCoverByMouse(controller, e, localCursorPoint, true);\n controller._dragging = false;\n controller._track = [];\n controller._creatingCover = null; // trigger event should be at final, after procedure will be nested.\n\n eventParams && trigger(controller, eventParams);\n }\n}\n\nfunction isOutsideZrArea(controller, x, y) {\n var zr = controller._zr;\n return x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight();\n}\n/**\r\n * key: brushType\r\n */\n\n\nvar coverRenderers = {\n lineX: getLineRenderer(0),\n lineY: getLineRenderer(1),\n rect: {\n createCover: function (controller, brushOption) {\n function returnInput(range) {\n return range;\n }\n\n return createBaseRectCover({\n toRectRange: returnInput,\n fromRectRange: returnInput\n }, controller, brushOption, [['w'], ['e'], ['n'], ['s'], ['s', 'e'], ['s', 'w'], ['n', 'e'], ['n', 'w']]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n updateBaseRect(controller, cover, localRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n },\n polygon: {\n createCover: function (controller, brushOption) {\n var cover = new graphic.Group(); // Do not use graphic.Polygon because graphic.Polyline do not close the\n // border of the shape when drawing, which is a better experience for user.\n\n cover.add(new graphic.Polyline({\n name: 'main',\n style: makeStyle(brushOption),\n silent: true\n }));\n return cover;\n },\n getCreatingRange: function (localTrack) {\n return localTrack;\n },\n endCreating: function (controller, cover) {\n cover.remove(cover.childAt(0)); // Use graphic.Polygon close the shape.\n\n cover.add(new graphic.Polygon({\n name: 'main',\n draggable: true,\n drift: curry(driftPolygon, controller, cover),\n ondragend: curry(trigger, controller, {\n isEnd: true\n })\n }));\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n cover.childAt(0).setShape({\n points: clipByPanel(controller, cover, localRange)\n });\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n }\n};\n\nfunction getLineRenderer(xyIndex) {\n return {\n createCover: function (controller, brushOption) {\n return createBaseRectCover({\n toRectRange: function (range) {\n var rectRange = [range, [0, 100]];\n xyIndex && rectRange.reverse();\n return rectRange;\n },\n fromRectRange: function (rectRange) {\n return rectRange[xyIndex];\n }\n }, controller, brushOption, [[['w'], ['e']], [['n'], ['s']]][xyIndex]);\n },\n getCreatingRange: function (localTrack) {\n var ends = getTrackEnds(localTrack);\n var min = mathMin(ends[0][xyIndex], ends[1][xyIndex]);\n var max = mathMax(ends[0][xyIndex], ends[1][xyIndex]);\n return [min, max];\n },\n updateCoverShape: function (controller, cover, localRange, brushOption) {\n var otherExtent; // If brushWidth not specified, fit the panel.\n\n var panel = getPanelByCover(controller, cover);\n\n if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {\n otherExtent = panel.getLinearBrushOtherExtent(xyIndex);\n } else {\n var zr = controller._zr;\n otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];\n }\n\n var rectRange = [localRange, otherExtent];\n xyIndex && rectRange.reverse();\n updateBaseRect(controller, cover, rectRange, brushOption);\n },\n updateCommon: updateCommon,\n contain: mainShapeContain\n };\n}\n\nexport default BrushController;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { onIrrelevantElement } from './cursorHelper.js';\nimport * as graphicUtil from '../../util/graphic.js';\nexport function makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\nexport function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\nexport function makeRectIsTargetByCursor(rect, api, targetModel) {\n var boundingRect = normalizeRect(rect);\n return function (e, localCursorPoint) {\n return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport BrushController from '../helper/BrushController.js';\nimport * as brushHelper from '../helper/brushHelper.js';\nimport * as graphic from '../../util/graphic.js';\nimport ComponentView from '../../view/Component.js';\nvar elementList = ['axisLine', 'axisTickLabel', 'axisName'];\n\nvar ParallelAxisView =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisView, _super);\n\n function ParallelAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisView.type;\n return _this;\n }\n\n ParallelAxisView.prototype.init = function (ecModel, api) {\n _super.prototype.init.apply(this, arguments);\n\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this));\n };\n\n ParallelAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n if (fromAxisAreaSelect(axisModel, ecModel, payload)) {\n return;\n }\n\n this.axisModel = axisModel;\n this.api = api;\n this.group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n this.group.add(this._axisGroup);\n\n if (!axisModel.get('show')) {\n return;\n }\n\n var coordSysModel = getCoordSysModel(axisModel, ecModel);\n var coordSys = coordSysModel.coordinateSystem;\n var areaSelectStyle = axisModel.getAreaSelectStyle();\n var areaWidth = areaSelectStyle.width;\n var dim = axisModel.axis.dim;\n var axisLayout = coordSys.getAxisLayout(dim);\n var builderOpt = zrUtil.extend({\n strokeContainThreshold: areaWidth\n }, axisLayout);\n var axisBuilder = new AxisBuilder(axisModel, builderOpt);\n zrUtil.each(elementList, axisBuilder.add, axisBuilder);\n\n this._axisGroup.add(axisBuilder.getGroup());\n\n this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api);\n\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n }; // /**\n // * @override\n // */\n // updateVisual(axisModel, ecModel, api, payload) {\n // this._brushController && this._brushController\n // .updateCovers(getCoverInfoList(axisModel));\n // }\n\n\n ParallelAxisView.prototype._refreshBrushController = function (builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api) {\n // After filtering, axis may change, select area needs to be update.\n var extent = axisModel.axis.getExtent();\n var extentLen = extent[1] - extent[0];\n var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value.\n // width/height might be negative, which will be\n // normalized in BoundingRect.\n\n var rect = graphic.BoundingRect.create({\n x: extent[0],\n y: -areaWidth / 2,\n width: extentLen,\n height: areaWidth\n });\n rect.x -= extra;\n rect.width += 2 * extra;\n\n this._brushController.mount({\n enableGlobalPan: true,\n rotation: builderOpt.rotation,\n x: builderOpt.position[0],\n y: builderOpt.position[1]\n }).setPanels([{\n panelId: 'pl',\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect, 0)\n }]).enableBrush({\n brushType: 'lineX',\n brushStyle: areaSelectStyle,\n removeOnClick: true\n }).updateCovers(getCoverInfoList(axisModel));\n };\n\n ParallelAxisView.prototype._onBrush = function (eventParam) {\n var coverInfoList = eventParam.areas; // Do not cache these object, because the mey be changed.\n\n var axisModel = this.axisModel;\n var axis = axisModel.axis;\n var intervals = zrUtil.map(coverInfoList, function (coverInfo) {\n return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];\n }); // If realtime is true, action is not dispatched on drag end, because\n // the drag end emits the same params with the last drag move event,\n // and may have some delay when using touch pad.\n\n if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'axisAreaSelect',\n parallelAxisId: axisModel.id,\n intervals: intervals\n });\n }\n };\n\n ParallelAxisView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n ParallelAxisView.type = 'parallelAxis';\n return ParallelAxisView;\n}(ComponentView);\n\nfunction fromAxisAreaSelect(axisModel, ecModel, payload) {\n return payload && payload.type === 'axisAreaSelect' && ecModel.findComponents({\n mainType: 'parallelAxis',\n query: payload\n })[0] === axisModel;\n}\n\nfunction getCoverInfoList(axisModel) {\n var axis = axisModel.axis;\n return zrUtil.map(axisModel.activeIntervals, function (interval) {\n return {\n brushType: 'lineX',\n panelId: 'pl',\n range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]\n };\n });\n}\n\nfunction getCoordSysModel(axisModel, ecModel) {\n return ecModel.getComponent('parallel', axisModel.get('parallelIndex'));\n}\n\nexport default ParallelAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nvar actionInfo = {\n type: 'axisAreaSelect',\n event: 'axisAreaSelected' // update: 'updateVisual'\n\n};\nexport function installParallelActions(registers) {\n registers.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallelAxis',\n query: payload\n }, function (parallelAxisModel) {\n parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);\n });\n });\n /**\r\n * @payload\r\n */\n\n registers.registerAction('parallelAxisExpand', function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'parallel',\n query: payload\n }, function (parallelModel) {\n parallelModel.setAxisExpand(payload);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport parallelPreprocessor from '../../coord/parallel/parallelPreprocessor.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelModel from '../../coord/parallel/ParallelModel.js';\nimport parallelCoordSysCreator from '../../coord/parallel/parallelCreator.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport ParallelAxisModel from '../../coord/parallel/AxisModel.js';\nimport ParallelAxisView from '../axis/ParallelAxisView.js';\nimport { installParallelActions } from '../axis/parallelAxisAction.js';\nvar defaultAxisOption = {\n type: 'value',\n areaSelectStyle: {\n width: 20,\n borderWidth: 1,\n borderColor: 'rgba(160,197,232)',\n color: 'rgba(160,197,232)',\n opacity: 0.3\n },\n realtime: true,\n z: 10\n};\nexport function install(registers) {\n registers.registerComponentView(ParallelView);\n registers.registerComponentModel(ParallelModel);\n registers.registerCoordinateSystem('parallel', parallelCoordSysCreator);\n registers.registerPreprocessor(parallelPreprocessor);\n registers.registerComponentModel(ParallelAxisModel);\n registers.registerComponentView(ParallelAxisView);\n axisModelCreator(registers, 'parallel', ParallelAxisModel, defaultAxisOption);\n installParallelActions(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport ParallelView from './ParallelView.js';\nimport ParallelSeriesModel from './ParallelSeries.js';\nimport parallelVisual from './parallelVisual.js';\nimport { install as installParallelComponent } from '../../component/parallel/install.js';\nexport function install(registers) {\n use(installParallelComponent);\n registers.registerChartView(ParallelView);\n registers.registerSeriesModel(ParallelSeriesModel);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport ChartView from '../../view/Chart.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isString, retrieve3 } from 'zrender/lib/core/util.js';\n\nvar SankeyPathShape =\n/** @class */\nfunction () {\n function SankeyPathShape() {\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.cpx1 = 0;\n this.cpy1 = 0;\n this.cpx2 = 0;\n this.cpy2 = 0;\n this.extent = 0;\n }\n\n return SankeyPathShape;\n}();\n\nvar SankeyPath =\n/** @class */\nfunction (_super) {\n __extends(SankeyPath, _super);\n\n function SankeyPath(opts) {\n return _super.call(this, opts) || this;\n }\n\n SankeyPath.prototype.getDefaultShape = function () {\n return new SankeyPathShape();\n };\n\n SankeyPath.prototype.buildPath = function (ctx, shape) {\n var extent = shape.extent;\n ctx.moveTo(shape.x1, shape.y1);\n ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);\n\n if (shape.orient === 'vertical') {\n ctx.lineTo(shape.x2 + extent, shape.y2);\n ctx.bezierCurveTo(shape.cpx2 + extent, shape.cpy2, shape.cpx1 + extent, shape.cpy1, shape.x1 + extent, shape.y1);\n } else {\n ctx.lineTo(shape.x2, shape.y2 + extent);\n ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent, shape.cpx1, shape.cpy1 + extent, shape.x1, shape.y1 + extent);\n }\n\n ctx.closePath();\n };\n\n SankeyPath.prototype.highlight = function () {\n enterEmphasis(this);\n };\n\n SankeyPath.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n return SankeyPath;\n}(graphic.Path);\n\nvar SankeyView =\n/** @class */\nfunction (_super) {\n __extends(SankeyView, _super);\n\n function SankeyView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeyView.type;\n _this._focusAdjacencyDisabled = false;\n return _this;\n }\n\n SankeyView.prototype.render = function (seriesModel, ecModel, api) {\n var sankeyView = this;\n var graph = seriesModel.getGraph();\n var group = this.group;\n var layoutInfo = seriesModel.layoutInfo; // view width\n\n var width = layoutInfo.width; // view height\n\n var height = layoutInfo.height;\n var nodeData = seriesModel.getData();\n var edgeData = seriesModel.getData('edge');\n var orient = seriesModel.get('orient');\n this._model = seriesModel;\n group.removeAll();\n group.x = layoutInfo.x;\n group.y = layoutInfo.y; // generate a bezire Curve for each edge\n\n graph.eachEdge(function (edge) {\n var curve = new SankeyPath();\n var ecData = getECData(curve);\n ecData.dataIndex = edge.dataIndex;\n ecData.seriesIndex = seriesModel.seriesIndex;\n ecData.dataType = 'edge';\n var edgeModel = edge.getModel();\n var lineStyleModel = edgeModel.getModel('lineStyle');\n var curvature = lineStyleModel.get('curveness');\n var n1Layout = edge.node1.getLayout();\n var node1Model = edge.node1.getModel();\n var dragX1 = node1Model.get('localX');\n var dragY1 = node1Model.get('localY');\n var n2Layout = edge.node2.getLayout();\n var node2Model = edge.node2.getModel();\n var dragX2 = node2Model.get('localX');\n var dragY2 = node2Model.get('localY');\n var edgeLayout = edge.getLayout();\n var x1;\n var y1;\n var x2;\n var y2;\n var cpx1;\n var cpy1;\n var cpx2;\n var cpy2;\n curve.shape.extent = Math.max(1, edgeLayout.dy);\n curve.shape.orient = orient;\n\n if (orient === 'vertical') {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;\n x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;\n y2 = dragY2 != null ? dragY2 * height : n2Layout.y;\n cpx1 = x1;\n cpy1 = y1 * (1 - curvature) + y2 * curvature;\n cpx2 = x2;\n cpy2 = y1 * curvature + y2 * (1 - curvature);\n } else {\n x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;\n y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;\n x2 = dragX2 != null ? dragX2 * width : n2Layout.x;\n y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;\n cpx1 = x1 * (1 - curvature) + x2 * curvature;\n cpy1 = y1;\n cpx2 = x1 * curvature + x2 * (1 - curvature);\n cpy2 = y2;\n }\n\n curve.setShape({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n cpx1: cpx1,\n cpy1: cpy1,\n cpx2: cpx2,\n cpy2: cpy2\n });\n curve.useStyle(lineStyleModel.getItemStyle()); // Special color, use source node color or target node color\n\n applyCurveStyle(curve.style, orient, edge);\n var defaultEdgeLabelText = \"\" + edgeModel.get('value');\n var edgeLabelStateModels = getLabelStatesModels(edgeModel, 'edgeLabel');\n setLabelStyle(curve, edgeLabelStateModels, {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName, dataType, labelDimIndex, formatter, extendParams) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'edge', labelDimIndex, // ensure edgeLabel formatter is provided\n // to prevent the inheritance from `label.formatter` of the series\n retrieve3(formatter, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get('formatter'), defaultEdgeLabelText), extendParams);\n }\n },\n labelDataIndex: edge.dataIndex,\n defaultText: defaultEdgeLabelText\n });\n curve.setTextConfig({\n position: 'inside'\n });\n var emphasisModel = edgeModel.getModel('emphasis');\n setStatesStylesFromModel(curve, edgeModel, 'lineStyle', function (model) {\n var style = model.getItemStyle();\n applyCurveStyle(style, orient, edge);\n return style;\n });\n group.add(curve);\n edgeData.setItemGraphicEl(edge.dataIndex, curve);\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(curve, focus === 'adjacency' ? edge.getAdjacentDataIndices() : focus === 'trajectory' ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n }); // Generate a rect for each node\n\n graph.eachNode(function (node) {\n var layout = node.getLayout();\n var itemModel = node.getModel();\n var dragX = itemModel.get('localX');\n var dragY = itemModel.get('localY');\n var emphasisModel = itemModel.getModel('emphasis');\n var rect = new graphic.Rect({\n shape: {\n x: dragX != null ? dragX * width : layout.x,\n y: dragY != null ? dragY * height : layout.y,\n width: layout.dx,\n height: layout.dy\n },\n style: itemModel.getModel('itemStyle').getItemStyle(),\n z2: 10\n });\n setLabelStyle(rect, getLabelStatesModels(itemModel), {\n labelFetcher: {\n getFormattedLabel: function (dataIndex, stateName) {\n return seriesModel.getFormattedLabel(dataIndex, stateName, 'node');\n }\n },\n labelDataIndex: node.dataIndex,\n defaultText: node.id\n });\n rect.disableLabelAnimation = true;\n rect.setStyle('fill', node.getVisual('color'));\n rect.setStyle('decal', node.getVisual('style').decal);\n setStatesStylesFromModel(rect, itemModel);\n group.add(rect);\n nodeData.setItemGraphicEl(node.dataIndex, rect);\n getECData(rect).dataType = 'node';\n var focus = emphasisModel.get('focus');\n toggleHoverEmphasis(rect, focus === 'adjacency' ? node.getAdjacentDataIndices() : focus === 'trajectory' ? node.getTrajectoryDataIndices() : focus, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n });\n nodeData.eachItemGraphicEl(function (el, dataIndex) {\n var itemModel = nodeData.getItemModel(dataIndex);\n\n if (itemModel.get('draggable')) {\n el.drift = function (dx, dy) {\n sankeyView._focusAdjacencyDisabled = true;\n this.shape.x += dx;\n this.shape.y += dy;\n this.dirty();\n api.dispatchAction({\n type: 'dragNode',\n seriesId: seriesModel.id,\n dataIndex: nodeData.getRawIndex(dataIndex),\n localX: this.shape.x / width,\n localY: this.shape.y / height\n });\n };\n\n el.ondragend = function () {\n sankeyView._focusAdjacencyDisabled = false;\n };\n\n el.draggable = true;\n el.cursor = 'move';\n }\n });\n\n if (!this._data && seriesModel.isAnimationEnabled()) {\n group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {\n group.removeClipPath();\n }));\n }\n\n this._data = seriesModel.getData();\n };\n\n SankeyView.prototype.dispose = function () {};\n\n SankeyView.type = 'sankey';\n return SankeyView;\n}(ChartView);\n/**\r\n * Special color, use source node color or target node color\r\n * @param curveProps curve's style to parse\r\n * @param orient direction\r\n * @param edge current curve data\r\n */\n\n\nfunction applyCurveStyle(curveProps, orient, edge) {\n switch (curveProps.fill) {\n case 'source':\n curveProps.fill = edge.node1.getVisual('color');\n curveProps.decal = edge.node1.getVisual('style').decal;\n break;\n\n case 'target':\n curveProps.fill = edge.node2.getVisual('color');\n curveProps.decal = edge.node2.getVisual('style').decal;\n break;\n\n case 'gradient':\n var sourceColor = edge.node1.getVisual('color');\n var targetColor = edge.node2.getVisual('color');\n\n if (isString(sourceColor) && isString(targetColor)) {\n curveProps.fill = new graphic.LinearGradient(0, 0, +(orient === 'horizontal'), +(orient === 'vertical'), [{\n color: sourceColor,\n offset: 0\n }, {\n color: targetColor,\n offset: 1\n }]);\n }\n\n }\n} // Add animation to the view\n\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n width: rect.width + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default SankeyView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge.js';\nimport Model from '../../model/Model.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\n\nvar SankeySeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SankeySeriesModel, _super);\n\n function SankeySeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SankeySeriesModel.type;\n return _this;\n }\n /**\r\n * Init a graph data structure from data in option series\r\n */\n\n\n SankeySeriesModel.prototype.getInitialData = function (option, ecModel) {\n var links = option.edges || option.links;\n var nodes = option.data || option.nodes;\n var levels = option.levels;\n this.levelModels = [];\n var levelModels = this.levelModels;\n\n for (var i = 0; i < levels.length; i++) {\n if (levels[i].depth != null && levels[i].depth >= 0) {\n levelModels[levels[i].depth] = new Model(levels[i], this, ecModel);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('levels[i].depth is mandatory and should be natural number');\n }\n }\n }\n\n if (nodes && links) {\n var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);\n return graph.data;\n }\n\n function beforeLink(nodeData, edgeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var layout = seriesModel.getData().getItemLayout(idx);\n\n if (layout) {\n var nodeDepth = layout.depth;\n var levelModel = seriesModel.levelModels[nodeDepth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n edgeData.wrapMethod('getItemModel', function (model, idx) {\n var seriesModel = model.parentModel;\n var edge = seriesModel.getGraph().getEdgeByIndex(idx);\n var layout = edge.node1.getLayout();\n\n if (layout) {\n var depth = layout.depth;\n var levelModel = seriesModel.levelModels[depth];\n\n if (levelModel) {\n model.parentModel = levelModel;\n }\n }\n\n return model;\n });\n }\n };\n\n SankeySeriesModel.prototype.setNodePosition = function (dataIndex, localPosition) {\n var nodes = this.option.data || this.option.nodes;\n var dataItem = nodes[dataIndex];\n dataItem.localX = localPosition[0];\n dataItem.localY = localPosition[1];\n };\n /**\r\n * Return the graphic data structure\r\n *\r\n * @return graphic data structure\r\n */\n\n\n SankeySeriesModel.prototype.getGraph = function () {\n return this.getData().graph;\n };\n /**\r\n * Get edge data of graphic data structure\r\n *\r\n * @return data structure of list\r\n */\n\n\n SankeySeriesModel.prototype.getEdgeData = function () {\n return this.getGraph().edgeData;\n };\n\n SankeySeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n function noValue(val) {\n return isNaN(val) || val == null;\n } // dataType === 'node' or empty do not show tooltip by default\n\n\n if (dataType === 'edge') {\n var params = this.getDataParams(dataIndex, dataType);\n var rawDataOpt = params.data;\n var edgeValue = params.value;\n var edgeName = rawDataOpt.source + ' -- ' + rawDataOpt.target;\n return createTooltipMarkup('nameValue', {\n name: edgeName,\n value: edgeValue,\n noValue: noValue(edgeValue)\n });\n } // dataType === 'node'\n else {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var value = node.getLayout().value;\n var name_1 = this.getDataParams(dataIndex, dataType).data.name;\n return createTooltipMarkup('nameValue', {\n name: name_1 != null ? name_1 + '' : null,\n value: value,\n noValue: noValue(value)\n });\n }\n };\n\n SankeySeriesModel.prototype.optionUpdated = function () {}; // Override Series.getDataParams()\n\n\n SankeySeriesModel.prototype.getDataParams = function (dataIndex, dataType) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n if (params.value == null && dataType === 'node') {\n var node = this.getGraph().getNodeByIndex(dataIndex);\n var nodeValue = node.getLayout().value;\n params.value = nodeValue;\n }\n\n return params;\n };\n\n SankeySeriesModel.type = 'series.sankey';\n SankeySeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'view',\n left: '5%',\n top: '5%',\n right: '20%',\n bottom: '5%',\n orient: 'horizontal',\n nodeWidth: 20,\n nodeGap: 8,\n draggable: true,\n layoutIterations: 32,\n label: {\n show: true,\n position: 'right',\n fontSize: 12\n },\n edgeLabel: {\n show: false,\n fontSize: 12\n },\n levels: [],\n nodeAlign: 'justify',\n lineStyle: {\n color: '#314656',\n opacity: 0.2,\n curveness: 0.5\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n opacity: 0.5\n }\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n },\n animationEasing: 'linear',\n animationDuration: 1000\n };\n return SankeySeriesModel;\n}(SeriesModel);\n\nexport default SankeySeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as layout from '../../util/layout.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData } from '../../util/model.js';\nexport default function sankeyLayout(ecModel, api) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var nodeWidth = seriesModel.get('nodeWidth');\n var nodeGap = seriesModel.get('nodeGap');\n var layoutInfo = getViewRect(seriesModel, api);\n seriesModel.layoutInfo = layoutInfo;\n var width = layoutInfo.width;\n var height = layoutInfo.height;\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n computeNodeValues(nodes);\n var filteredNodes = zrUtil.filter(nodes, function (node) {\n return node.getLayout().value === 0;\n });\n var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get('layoutIterations');\n var orient = seriesModel.get('orient');\n var nodeAlign = seriesModel.get('nodeAlign');\n layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);\n });\n}\n/**\r\n * Get the layout position of the whole view\r\n */\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n\nfunction layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {\n computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);\n computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);\n computeEdgeDepths(nodes, orient);\n}\n/**\r\n * Compute the value of each node by summing the associated edge's value\r\n */\n\n\nfunction computeNodeValues(nodes) {\n zrUtil.each(nodes, function (node) {\n var value1 = sum(node.outEdges, getEdgeValue);\n var value2 = sum(node.inEdges, getEdgeValue);\n var nodeRawValue = node.getValue() || 0;\n var value = Math.max(value1, value2, nodeRawValue);\n node.setLayout({\n value: value\n }, true);\n });\n}\n/**\r\n * Compute the x-position for each node.\r\n *\r\n * Here we use Kahn algorithm to detect cycle when we traverse\r\n * the node to computer the initial x position.\r\n */\n\n\nfunction computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {\n // Used to mark whether the edge is deleted. if it is deleted,\n // the value is 0, otherwise it is 1.\n var remainEdges = []; // Storage each node's indegree.\n\n var indegreeArr = []; // Used to storage the node with indegree is equal to 0.\n\n var zeroIndegrees = [];\n var nextTargetNode = [];\n var x = 0; // let kx = 0;\n\n for (var i = 0; i < edges.length; i++) {\n remainEdges[i] = 1;\n }\n\n for (var i = 0; i < nodes.length; i++) {\n indegreeArr[i] = nodes[i].inEdges.length;\n\n if (indegreeArr[i] === 0) {\n zeroIndegrees.push(nodes[i]);\n }\n }\n\n var maxNodeDepth = -1; // Traversing nodes using topological sorting to calculate the\n // horizontal(if orient === 'horizontal') or vertical(if orient === 'vertical')\n // position of the nodes.\n\n while (zeroIndegrees.length) {\n for (var idx = 0; idx < zeroIndegrees.length; idx++) {\n var node = zeroIndegrees[idx];\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n var isItemDepth = item.depth != null && item.depth >= 0;\n\n if (isItemDepth && item.depth > maxNodeDepth) {\n maxNodeDepth = item.depth;\n }\n\n node.setLayout({\n depth: isItemDepth ? item.depth : x\n }, true);\n orient === 'vertical' ? node.setLayout({\n dy: nodeWidth\n }, true) : node.setLayout({\n dx: nodeWidth\n }, true);\n\n for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {\n var edge = node.outEdges[edgeIdx];\n var indexEdge = edges.indexOf(edge);\n remainEdges[indexEdge] = 0;\n var targetNode = edge.node2;\n var nodeIndex = nodes.indexOf(targetNode);\n\n if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {\n nextTargetNode.push(targetNode);\n }\n }\n }\n\n ++x;\n zeroIndegrees = nextTargetNode;\n nextTargetNode = [];\n }\n\n for (var i = 0; i < remainEdges.length; i++) {\n if (remainEdges[i] === 1) {\n throw new Error('Sankey is a DAG, the original data has cycle!');\n }\n }\n\n var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1;\n\n if (nodeAlign && nodeAlign !== 'left') {\n adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);\n }\n\n var kx = orient === 'vertical' ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;\n scaleNodeBreadths(nodes, kx, orient);\n}\n\nfunction isNodeDepth(node) {\n var item = node.hostGraph.data.getRawDataItem(node.dataIndex);\n return item.depth != null && item.depth >= 0;\n}\n\nfunction adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {\n if (nodeAlign === 'right') {\n var nextSourceNode = [];\n var remainNodes = nodes;\n var nodeHeight = 0;\n\n while (remainNodes.length) {\n for (var i = 0; i < remainNodes.length; i++) {\n var node = remainNodes[i];\n node.setLayout({\n skNodeHeight: nodeHeight\n }, true);\n\n for (var j = 0; j < node.inEdges.length; j++) {\n var edge = node.inEdges[j];\n\n if (nextSourceNode.indexOf(edge.node1) < 0) {\n nextSourceNode.push(edge.node1);\n }\n }\n }\n\n remainNodes = nextSourceNode;\n nextSourceNode = [];\n ++nodeHeight;\n }\n\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node)) {\n node.setLayout({\n depth: Math.max(0, maxDepth - node.getLayout().skNodeHeight)\n }, true);\n }\n });\n } else if (nodeAlign === 'justify') {\n moveSinksRight(nodes, maxDepth);\n }\n}\n/**\r\n * All the node without outEgdes are assigned maximum x-position and\r\n * be aligned in the last column.\r\n *\r\n * @param nodes. node of sankey view.\r\n * @param maxDepth. use to assign to node without outEdges as x-position.\r\n */\n\n\nfunction moveSinksRight(nodes, maxDepth) {\n zrUtil.each(nodes, function (node) {\n if (!isNodeDepth(node) && !node.outEdges.length) {\n node.setLayout({\n depth: maxDepth\n }, true);\n }\n });\n}\n/**\r\n * Scale node x-position to the width\r\n *\r\n * @param nodes node of sankey view\r\n * @param kx multiple used to scale nodes\r\n */\n\n\nfunction scaleNodeBreadths(nodes, kx, orient) {\n zrUtil.each(nodes, function (node) {\n var nodeDepth = node.getLayout().depth * kx;\n orient === 'vertical' ? node.setLayout({\n y: nodeDepth\n }, true) : node.setLayout({\n x: nodeDepth\n }, true);\n });\n}\n/**\r\n * Using Gauss-Seidel iterations method to compute the node depth(y-position)\r\n *\r\n * @param nodes node of sankey view\r\n * @param edges edge of sankey view\r\n * @param height the whole height of the area to draw the view\r\n * @param nodeGap the vertical distance between two nodes\r\n * in the same column.\r\n * @param iterations the number of iterations for the algorithm\r\n */\n\n\nfunction computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {\n var nodesByBreadth = prepareNodesByBreadth(nodes, orient);\n initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n\n for (var alpha = 1; iterations > 0; iterations--) {\n // 0.99 is a experience parameter, ensure that each iterations of\n // changes as small as possible.\n alpha *= 0.99;\n relaxRightToLeft(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n relaxLeftToRight(nodesByBreadth, alpha, orient);\n resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);\n }\n}\n\nfunction prepareNodesByBreadth(nodes, orient) {\n var nodesByBreadth = [];\n var keyAttr = orient === 'vertical' ? 'y' : 'x';\n var groupResult = groupData(nodes, function (node) {\n return node.getLayout()[keyAttr];\n });\n groupResult.keys.sort(function (a, b) {\n return a - b;\n });\n zrUtil.each(groupResult.keys, function (key) {\n nodesByBreadth.push(groupResult.buckets.get(key));\n });\n return nodesByBreadth;\n}\n/**\r\n * Compute the original y-position for each node\r\n */\n\n\nfunction initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {\n var minKy = Infinity;\n zrUtil.each(nodesByBreadth, function (nodes) {\n var n = nodes.length;\n var sum = 0;\n zrUtil.each(nodes, function (node) {\n sum += node.getLayout().value;\n });\n var ky = orient === 'vertical' ? (width - (n - 1) * nodeGap) / sum : (height - (n - 1) * nodeGap) / sum;\n\n if (ky < minKy) {\n minKy = ky;\n }\n });\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node, i) {\n var nodeDy = node.getLayout().value * minKy;\n\n if (orient === 'vertical') {\n node.setLayout({\n x: i\n }, true);\n node.setLayout({\n dx: nodeDy\n }, true);\n } else {\n node.setLayout({\n y: i\n }, true);\n node.setLayout({\n dy: nodeDy\n }, true);\n }\n });\n });\n zrUtil.each(edges, function (edge) {\n var edgeDy = +edge.getValue() * minKy;\n edge.setLayout({\n dy: edgeDy\n }, true);\n });\n}\n/**\r\n * Resolve the collision of initialized depth (y-position)\r\n */\n\n\nfunction resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodesByBreadth, function (nodes) {\n nodes.sort(function (a, b) {\n return a.getLayout()[keyAttr] - b.getLayout()[keyAttr];\n });\n var nodeX;\n var node;\n var dy;\n var y0 = 0;\n var n = nodes.length;\n var nodeDyAttr = orient === 'vertical' ? 'dx' : 'dy';\n\n for (var i = 0; i < n; i++) {\n node = nodes[i];\n dy = y0 - node.getLayout()[keyAttr];\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] + dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;\n }\n\n var viewWidth = orient === 'vertical' ? width : height; // If the bottommost node goes outside the bounds, push it back up\n\n dy = y0 - nodeGap - viewWidth;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n y0 = nodeX;\n\n for (var i = n - 2; i >= 0; --i) {\n node = nodes[i];\n dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;\n\n if (dy > 0) {\n nodeX = node.getLayout()[keyAttr] - dy;\n orient === 'vertical' ? node.setLayout({\n x: nodeX\n }, true) : node.setLayout({\n y: nodeX\n }, true);\n }\n\n y0 = node.getLayout()[keyAttr];\n }\n }\n });\n}\n/**\r\n * Change the y-position of the nodes, except most the right side nodes\r\n * @param nodesByBreadth\r\n * @param alpha parameter used to adjust the nodes y-position\r\n */\n\n\nfunction relaxRightToLeft(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.outEdges.length) {\n var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.outEdges.length;\n y = len ? sum(node.outEdges, centerTarget, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n\nfunction weightedTarget(edge, orient) {\n return center(edge.node2, orient) * edge.getValue();\n}\n\nfunction centerTarget(edge, orient) {\n return center(edge.node2, orient);\n}\n\nfunction weightedSource(edge, orient) {\n return center(edge.node1, orient) * edge.getValue();\n}\n\nfunction centerSource(edge, orient) {\n return center(edge.node1, orient);\n}\n\nfunction center(node, orient) {\n return orient === 'vertical' ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;\n}\n\nfunction getEdgeValue(edge) {\n return edge.getValue();\n}\n\nfunction sum(array, cb, orient) {\n var sum = 0;\n var len = array.length;\n var i = -1;\n\n while (++i < len) {\n var value = +cb(array[i], orient);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n\n return sum;\n}\n/**\r\n * Change the y-position of the nodes, except most the left side nodes\r\n */\n\n\nfunction relaxLeftToRight(nodesByBreadth, alpha, orient) {\n zrUtil.each(nodesByBreadth, function (nodes) {\n zrUtil.each(nodes, function (node) {\n if (node.inEdges.length) {\n var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);\n\n if (isNaN(y)) {\n var len = node.inEdges.length;\n y = len ? sum(node.inEdges, centerSource, orient) / len : 0;\n }\n\n if (orient === 'vertical') {\n var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;\n node.setLayout({\n x: nodeX\n }, true);\n } else {\n var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;\n node.setLayout({\n y: nodeY\n }, true);\n }\n }\n });\n });\n}\n/**\r\n * Compute the depth(y-position) of each edge\r\n */\n\n\nfunction computeEdgeDepths(nodes, orient) {\n var keyAttr = orient === 'vertical' ? 'x' : 'y';\n zrUtil.each(nodes, function (node) {\n node.outEdges.sort(function (a, b) {\n return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr];\n });\n node.inEdges.sort(function (a, b) {\n return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr];\n });\n });\n zrUtil.each(nodes, function (node) {\n var sy = 0;\n var ty = 0;\n zrUtil.each(node.outEdges, function (edge) {\n edge.setLayout({\n sy: sy\n }, true);\n sy += edge.getLayout().dy;\n });\n zrUtil.each(node.inEdges, function (edge) {\n edge.setLayout({\n ty: ty\n }, true);\n ty += edge.getLayout().dy;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nexport default function sankeyVisual(ecModel) {\n ecModel.eachSeriesByType('sankey', function (seriesModel) {\n var graph = seriesModel.getGraph();\n var nodes = graph.nodes;\n var edges = graph.edges;\n\n if (nodes.length) {\n var minValue_1 = Infinity;\n var maxValue_1 = -Infinity;\n zrUtil.each(nodes, function (node) {\n var nodeValue = node.getLayout().value;\n\n if (nodeValue < minValue_1) {\n minValue_1 = nodeValue;\n }\n\n if (nodeValue > maxValue_1) {\n maxValue_1 = nodeValue;\n }\n });\n zrUtil.each(nodes, function (node) {\n var mapping = new VisualMapping({\n type: 'color',\n mappingMethod: 'linear',\n dataExtent: [minValue_1, maxValue_1],\n visual: seriesModel.get('color')\n });\n var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);\n var customColor = node.getModel().get(['itemStyle', 'color']);\n\n if (customColor != null) {\n node.setVisual('color', customColor);\n node.setVisual('style', {\n fill: customColor\n });\n } else {\n node.setVisual('color', mapValueToColor);\n node.setVisual('style', {\n fill: mapValueToColor\n });\n }\n });\n }\n\n if (edges.length) {\n zrUtil.each(edges, function (edge) {\n var edgeStyle = edge.getModel().get('lineStyle');\n edge.setVisual('style', edgeStyle);\n });\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SankeyView from './SankeyView.js';\nimport SankeySeriesModel from './SankeySeries.js';\nimport sankeyLayout from './sankeyLayout.js';\nimport sankeyVisual from './sankeyVisual.js';\nexport function install(registers) {\n registers.registerChartView(SankeyView);\n registers.registerSeriesModel(SankeySeriesModel);\n registers.registerLayout(sankeyLayout);\n registers.registerVisual(sankeyVisual);\n registers.registerAction({\n type: 'dragNode',\n event: 'dragnode',\n // here can only use 'update' now, other value is not support in echarts.\n update: 'update'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sankey',\n query: payload\n }, function (seriesModel) {\n seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport createSeriesDataSimply from './createSeriesDataSimply.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport { makeSeriesEncodeForAxisCoordSys } from '../../data/helper/sourceHelper.js';\n\nvar WhiskerBoxCommonMixin =\n/** @class */\nfunction () {\n function WhiskerBoxCommonMixin() {}\n /**\r\n * @override\r\n */\n\n\n WhiskerBoxCommonMixin.prototype.getInitialData = function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal; // FIXME\n // Consider time axis.\n\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data; // Clone a new data for next setOption({}) usage.\n // Avoid modifying current data will affect further update.\n\n if (data && addOrdinal) {\n var newOptionData_1 = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n\n if (zrUtil.isArray(item)) {\n newItem = item.slice(); // Modify current using data.\n\n item.unshift(index);\n } else if (zrUtil.isArray(item.value)) {\n newItem = zrUtil.extend({}, item);\n newItem.value = newItem.value.slice(); // Modify current using data.\n\n item.value.unshift(index);\n } else {\n newItem = item;\n }\n\n newOptionData_1.push(newItem);\n });\n option.data = newOptionData_1;\n }\n\n var defaultValueDimensions = this.defaultValueDimensions;\n var coordDimensions = [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }];\n return createSeriesDataSimply(this, {\n coordDimensions: coordDimensions,\n dimensionsCount: defaultValueDimensions.length + 1,\n encodeDefaulter: zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)\n });\n };\n /**\r\n * If horizontal, base axis is x, otherwise y.\r\n * @override\r\n */\n\n\n WhiskerBoxCommonMixin.prototype.getBaseAxis = function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n };\n\n return WhiskerBoxCommonMixin;\n}();\n\n;\nexport { WhiskerBoxCommonMixin };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar BoxplotSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(BoxplotSeriesModel, _super);\n\n function BoxplotSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotSeriesModel.type; // TODO\n // box width represents group size, so dimension should have 'size'.\n\n /**\r\n * @see \r\n * The meanings of 'min' and 'max' depend on user,\r\n * and echarts do not need to know it.\r\n * @readOnly\r\n */\n\n _this.defaultValueDimensions = [{\n name: 'min',\n defaultTooltip: true\n }, {\n name: 'Q1',\n defaultTooltip: true\n }, {\n name: 'median',\n defaultTooltip: true\n }, {\n name: 'Q3',\n defaultTooltip: true\n }, {\n name: 'max',\n defaultTooltip: true\n }];\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n BoxplotSeriesModel.type = 'series.boxplot';\n BoxplotSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n BoxplotSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n layout: null,\n boxWidth: [7, 50],\n itemStyle: {\n color: '#fff',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2,\n shadowBlur: 5,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n }\n },\n animationDuration: 800\n };\n return BoxplotSeriesModel;\n}(SeriesModel);\n\nmixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);\nexport default BoxplotSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar BoxplotView =\n/** @class */\nfunction (_super) {\n __extends(BoxplotView, _super);\n\n function BoxplotView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BoxplotView.type;\n return _this;\n }\n\n BoxplotView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var group = this.group;\n var oldData = this._data; // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0;\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, true);\n data.setItemGraphicEl(newIdx, symbolEl);\n group.add(symbolEl);\n }\n }).update(function (newIdx, oldIdx) {\n var symbolEl = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(symbolEl);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (!symbolEl) {\n symbolEl = createNormalBox(itemLayout, data, newIdx, constDim);\n } else {\n saveOldStyle(symbolEl);\n updateNormalBoxData(itemLayout, symbolEl, data, newIdx);\n }\n\n group.add(symbolEl);\n data.setItemGraphicEl(newIdx, symbolEl);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n BoxplotView.prototype.remove = function (ecModel) {\n var group = this.group;\n var data = this._data;\n this._data = null;\n data && data.eachItemGraphicEl(function (el) {\n el && group.remove(el);\n });\n };\n\n BoxplotView.type = 'boxplot';\n return BoxplotView;\n}(ChartView);\n\nvar BoxPathShape =\n/** @class */\nfunction () {\n function BoxPathShape() {}\n\n return BoxPathShape;\n}();\n\nvar BoxPath =\n/** @class */\nfunction (_super) {\n __extends(BoxPath, _super);\n\n function BoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'boxplotBoxPath';\n return _this;\n }\n\n BoxPath.prototype.getDefaultShape = function () {\n return new BoxPathShape();\n };\n\n BoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n var i = 0;\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n\n for (; i < 4; i++) {\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n\n ctx.closePath();\n\n for (; i < ends.length; i++) {\n ctx.moveTo(ends[i][0], ends[i][1]);\n i++;\n ctx.lineTo(ends[i][0], ends[i][1]);\n }\n };\n\n return BoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, data, dataIndex, constDim, isInit) {\n var ends = itemLayout.ends;\n var el = new BoxPath({\n shape: {\n points: isInit ? transInit(ends, constDim, itemLayout) : ends\n }\n });\n updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);\n return el;\n}\n\nfunction updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {\n var seriesModel = data.hostModel;\n var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];\n updateMethod(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.z2 = 100;\n var itemModel = data.getItemModel(dataIndex);\n var emphasisModel = itemModel.getModel('emphasis');\n setStatesStylesFromModel(el, itemModel);\n toggleHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n}\n\nfunction transInit(points, dim, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[dim] = itemLayout.initBaseline;\n return point;\n });\n}\n\nexport default BoxplotView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../../util/number.js';\nvar each = zrUtil.each;\nexport default function boxplotLayout(ecModel) {\n var groupResult = groupSeriesByAxis(ecModel);\n each(groupResult, function (groupItem) {\n var seriesModels = groupItem.seriesModels;\n\n if (!seriesModels.length) {\n return;\n }\n\n calculateBase(groupItem);\n each(seriesModels, function (seriesModel, idx) {\n layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);\n });\n });\n}\n/**\r\n * Group series by axis.\r\n */\n\nfunction groupSeriesByAxis(ecModel) {\n var result = [];\n var axisList = [];\n ecModel.eachSeriesByType('boxplot', function (seriesModel) {\n var baseAxis = seriesModel.getBaseAxis();\n var idx = zrUtil.indexOf(axisList, baseAxis);\n\n if (idx < 0) {\n idx = axisList.length;\n axisList[idx] = baseAxis;\n result[idx] = {\n axis: baseAxis,\n seriesModels: []\n };\n }\n\n result[idx].seriesModels.push(seriesModel);\n });\n return result;\n}\n/**\r\n * Calculate offset and box width for each series.\r\n */\n\n\nfunction calculateBase(groupItem) {\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n var extent = baseAxis.getExtent();\n bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}\n/**\r\n * Calculate points location for each series.\r\n */\n\n\nfunction layoutSingleSeries(seriesModel, offset, boxWidth) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var halfWidth = boxWidth / 2;\n var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1;\n var vDimIdx = 1 - cDimIdx;\n var coordDims = ['x', 'y'];\n var cDim = data.mapDimension(coordDims[cDimIdx]);\n var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);\n\n if (cDim == null || vDims.length < 5) {\n return;\n }\n\n for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {\n var axisDimVal = data.get(cDim, dataIndex);\n var median = getPoint(axisDimVal, vDims[2], dataIndex);\n var end1 = getPoint(axisDimVal, vDims[0], dataIndex);\n var end2 = getPoint(axisDimVal, vDims[1], dataIndex);\n var end4 = getPoint(axisDimVal, vDims[3], dataIndex);\n var end5 = getPoint(axisDimVal, vDims[4], dataIndex);\n var ends = [];\n addBodyEnd(ends, end2, false);\n addBodyEnd(ends, end4, true);\n ends.push(end1, end2, end5, end4);\n layEndLine(ends, end1);\n layEndLine(ends, end5);\n layEndLine(ends, median);\n data.setItemLayout(dataIndex, {\n initBaseline: median[vDimIdx],\n ends: ends\n });\n }\n\n function getPoint(axisDimVal, dim, dataIndex) {\n var val = data.get(dim, dataIndex);\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n var point;\n\n if (isNaN(axisDimVal) || isNaN(val)) {\n point = [NaN, NaN];\n } else {\n point = coordSys.dataToPoint(p);\n point[cDimIdx] += offset;\n }\n\n return point;\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] += halfWidth;\n point2[cDimIdx] -= halfWidth;\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function layEndLine(ends, endCenter) {\n var from = endCenter.slice();\n var to = endCenter.slice();\n from[cDimIdx] -= halfWidth;\n to[cDimIdx] += halfWidth;\n ends.push(from, to);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { quantile, asc } from '../../util/number.js';\nimport { isFunction, isString } from 'zrender/lib/core/util.js';\n/**\r\n * See:\r\n * \r\n * \r\n *\r\n * Helper method for preparing data.\r\n *\r\n * @param rawData like\r\n * [\r\n * [12,232,443], (raw data set for the first box)\r\n * [3843,5545,1232], (raw data set for the second box)\r\n * ...\r\n * ]\r\n * @param opt.boundIQR=1.5 Data less than min bound is outlier.\r\n * default 1.5, means Q1 - 1.5 * (Q3 - Q1).\r\n * If 'none'/0 passed, min bound will not be used.\r\n */\n\nexport default function prepareBoxplotData(rawData, opt) {\n opt = opt || {};\n var boxData = [];\n var outliers = [];\n var boundIQR = opt.boundIQR;\n var useExtreme = boundIQR === 'none' || boundIQR === 0;\n\n for (var i = 0; i < rawData.length; i++) {\n var ascList = asc(rawData[i].slice());\n var Q1 = quantile(ascList, 0.25);\n var Q2 = quantile(ascList, 0.5);\n var Q3 = quantile(ascList, 0.75);\n var min = ascList[0];\n var max = ascList[ascList.length - 1];\n var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);\n var low = useExtreme ? min : Math.max(min, Q1 - bound);\n var high = useExtreme ? max : Math.min(max, Q3 + bound);\n var itemNameFormatter = opt.itemNameFormatter;\n var itemName = isFunction(itemNameFormatter) ? itemNameFormatter({\n value: i\n }) : isString(itemNameFormatter) ? itemNameFormatter.replace('{value}', i + '') : i + '';\n boxData.push([itemName, low, Q1, Q2, Q3, high]);\n\n for (var j = 0; j < ascList.length; j++) {\n var dataItem = ascList[j];\n\n if (dataItem < low || dataItem > high) {\n var outlier = [itemName, dataItem];\n outliers.push(outlier);\n }\n }\n }\n\n return {\n boxData: boxData,\n outliers: outliers\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport prepareBoxplotData from './prepareBoxplotData.js';\nimport { throwError, makePrintable } from '../../util/log.js';\nimport { SOURCE_FORMAT_ARRAY_ROWS } from '../../util/types.js';\nexport var boxplotTransform = {\n type: 'echarts:boxplot',\n transform: function transform(params) {\n var upstream = params.upstream;\n\n if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('source data is not applicable for this boxplot transform. Expect number[][].');\n }\n\n throwError(errMsg);\n }\n\n var result = prepareBoxplotData(upstream.getRawData(), params.config);\n return [{\n dimensions: ['ItemName', 'Low', 'Q1', 'Q2', 'Q3', 'High'],\n data: result.boxData\n }, {\n data: result.outliers\n }];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport BoxplotSeriesModel from './BoxplotSeries.js';\nimport BoxplotView from './BoxplotView.js';\nimport boxplotLayout from './boxplotLayout.js';\nimport { boxplotTransform } from './boxplotTransform.js';\nexport function install(registers) {\n registers.registerSeriesModel(BoxplotSeriesModel);\n registers.registerChartView(BoxplotView);\n registers.registerLayout(boxplotLayout);\n registers.registerTransform(boxplotTransform);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel } from '../../util/states.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nvar SKIP_PROPS = ['color', 'borderColor'];\n\nvar CandlestickView =\n/** @class */\nfunction (_super) {\n __extends(CandlestickView, _super);\n\n function CandlestickView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickView.type;\n return _this;\n }\n\n CandlestickView.prototype.render = function (seriesModel, ecModel, api) {\n // If there is clipPath created in large mode. Remove it.\n this.group.removeClipPath(); // Clear previously rendered progressive elements.\n\n this._progressiveEls = null;\n\n this._updateDrawMode(seriesModel);\n\n this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);\n };\n\n CandlestickView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this._clear();\n\n this._updateDrawMode(seriesModel);\n };\n\n CandlestickView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n this._progressiveEls = [];\n this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);\n };\n\n CandlestickView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CandlestickView.prototype._updateDrawMode = function (seriesModel) {\n var isLargeDraw = seriesModel.pipelineContext.large;\n\n if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {\n this._isLargeDraw = isLargeDraw;\n\n this._clear();\n }\n };\n\n CandlestickView.prototype._renderNormal = function (seriesModel) {\n var data = seriesModel.getData();\n var oldData = this._data;\n var group = this.group;\n var isSimpleBox = data.getLayout('isSimpleBox');\n var needsClip = seriesModel.get('clip', true);\n var coord = seriesModel.coordinateSystem;\n var clipArea = coord.getArea && coord.getArea(); // There is no old data only when first rendering or switching from\n // stream mode to normal mode, where previous elements should be removed.\n\n if (!this._data) {\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n if (data.hasValue(newIdx)) {\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n return;\n }\n\n var el = createNormalBox(itemLayout, newIdx, true);\n graphic.initProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }\n }).update(function (newIdx, oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx); // Empty data\n\n if (!data.hasValue(newIdx)) {\n group.remove(el);\n return;\n }\n\n var itemLayout = data.getItemLayout(newIdx);\n\n if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {\n group.remove(el);\n return;\n }\n\n if (!el) {\n el = createNormalBox(itemLayout, newIdx);\n } else {\n graphic.updateProps(el, {\n shape: {\n points: itemLayout.ends\n }\n }, seriesModel, newIdx);\n saveOldStyle(el);\n }\n\n setBoxCommon(el, data, newIdx, isSimpleBox);\n group.add(el);\n data.setItemGraphicEl(newIdx, el);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && group.remove(el);\n }).execute();\n this._data = data;\n };\n\n CandlestickView.prototype._renderLarge = function (seriesModel) {\n this._clear();\n\n createLarge(seriesModel, this.group);\n var clipPath = seriesModel.get('clip', true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n };\n\n CandlestickView.prototype._incrementalRenderNormal = function (params, seriesModel) {\n var data = seriesModel.getData();\n var isSimpleBox = data.getLayout('isSimpleBox');\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemLayout = data.getItemLayout(dataIndex);\n var el = createNormalBox(itemLayout, dataIndex);\n setBoxCommon(el, data, dataIndex, isSimpleBox);\n el.incremental = true;\n this.group.add(el);\n\n this._progressiveEls.push(el);\n }\n };\n\n CandlestickView.prototype._incrementalRenderLarge = function (params, seriesModel) {\n createLarge(seriesModel, this.group, this._progressiveEls, true);\n };\n\n CandlestickView.prototype.remove = function (ecModel) {\n this._clear();\n };\n\n CandlestickView.prototype._clear = function () {\n this.group.removeAll();\n this._data = null;\n };\n\n CandlestickView.type = 'candlestick';\n return CandlestickView;\n}(ChartView);\n\nvar NormalBoxPathShape =\n/** @class */\nfunction () {\n function NormalBoxPathShape() {}\n\n return NormalBoxPathShape;\n}();\n\nvar NormalBoxPath =\n/** @class */\nfunction (_super) {\n __extends(NormalBoxPath, _super);\n\n function NormalBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'normalCandlestickBox';\n return _this;\n }\n\n NormalBoxPath.prototype.getDefaultShape = function () {\n return new NormalBoxPathShape();\n };\n\n NormalBoxPath.prototype.buildPath = function (ctx, shape) {\n var ends = shape.points;\n\n if (this.__simpleBox) {\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[6][0], ends[6][1]);\n } else {\n ctx.moveTo(ends[0][0], ends[0][1]);\n ctx.lineTo(ends[1][0], ends[1][1]);\n ctx.lineTo(ends[2][0], ends[2][1]);\n ctx.lineTo(ends[3][0], ends[3][1]);\n ctx.closePath();\n ctx.moveTo(ends[4][0], ends[4][1]);\n ctx.lineTo(ends[5][0], ends[5][1]);\n ctx.moveTo(ends[6][0], ends[6][1]);\n ctx.lineTo(ends[7][0], ends[7][1]);\n }\n };\n\n return NormalBoxPath;\n}(Path);\n\nfunction createNormalBox(itemLayout, dataIndex, isInit) {\n var ends = itemLayout.ends;\n return new NormalBoxPath({\n shape: {\n points: isInit ? transInit(ends, itemLayout) : ends\n },\n z2: 100\n });\n}\n\nfunction isNormalBoxClipped(clipArea, itemLayout) {\n var clipped = true;\n\n for (var i = 0; i < itemLayout.ends.length; i++) {\n // If any point are in the region.\n if (clipArea.contain(itemLayout.ends[i][0], itemLayout.ends[i][1])) {\n clipped = false;\n break;\n }\n }\n\n return clipped;\n}\n\nfunction setBoxCommon(el, data, dataIndex, isSimpleBox) {\n var itemModel = data.getItemModel(dataIndex);\n el.useStyle(data.getItemVisual(dataIndex, 'style'));\n el.style.strokeNoScale = true;\n el.__simpleBox = isSimpleBox;\n setStatesStylesFromModel(el, itemModel);\n}\n\nfunction transInit(points, itemLayout) {\n return zrUtil.map(points, function (point) {\n point = point.slice();\n point[1] = itemLayout.initBaseline;\n return point;\n });\n}\n\nvar LargeBoxPathShape =\n/** @class */\nfunction () {\n function LargeBoxPathShape() {}\n\n return LargeBoxPathShape;\n}();\n\nvar LargeBoxPath =\n/** @class */\nfunction (_super) {\n __extends(LargeBoxPath, _super);\n\n function LargeBoxPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this.type = 'largeCandlestickBox';\n return _this;\n }\n\n LargeBoxPath.prototype.getDefaultShape = function () {\n return new LargeBoxPathShape();\n };\n\n LargeBoxPath.prototype.buildPath = function (ctx, shape) {\n // Drawing lines is more efficient than drawing\n // a whole line or drawing rects.\n var points = shape.points;\n\n for (var i = 0; i < points.length;) {\n if (this.__sign === points[i++]) {\n var x = points[i++];\n ctx.moveTo(x, points[i++]);\n ctx.lineTo(x, points[i++]);\n } else {\n i += 3;\n }\n }\n };\n\n return LargeBoxPath;\n}(Path);\n\nfunction createLarge(seriesModel, group, progressiveEls, incremental) {\n var data = seriesModel.getData();\n var largePoints = data.getLayout('largePoints');\n var elP = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 1,\n ignoreCoarsePointer: true\n });\n group.add(elP);\n var elN = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: -1,\n ignoreCoarsePointer: true\n });\n group.add(elN);\n var elDoji = new LargeBoxPath({\n shape: {\n points: largePoints\n },\n __sign: 0,\n ignoreCoarsePointer: true\n });\n group.add(elDoji);\n setLargeStyle(1, elP, seriesModel, data);\n setLargeStyle(-1, elN, seriesModel, data);\n setLargeStyle(0, elDoji, seriesModel, data);\n\n if (incremental) {\n elP.incremental = true;\n elN.incremental = true;\n }\n\n if (progressiveEls) {\n progressiveEls.push(elP, elN);\n }\n}\n\nfunction setLargeStyle(sign, el, seriesModel, data) {\n // TODO put in visual?\n var borderColor = seriesModel.get(['itemStyle', sign > 0 ? 'borderColor' : 'borderColor0']) // Use color for border color by default.\n || seriesModel.get(['itemStyle', sign > 0 ? 'color' : 'color0']);\n\n if (sign === 0) {\n borderColor = seriesModel.get(['itemStyle', 'borderColorDoji']);\n } // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n\n var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(SKIP_PROPS);\n el.useStyle(itemStyle);\n el.style.fill = null;\n el.style.stroke = borderColor;\n}\n\nexport default CandlestickView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar CandlestickSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CandlestickSeriesModel, _super);\n\n function CandlestickSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CandlestickSeriesModel.type;\n _this.defaultValueDimensions = [{\n name: 'open',\n defaultTooltip: true\n }, {\n name: 'close',\n defaultTooltip: true\n }, {\n name: 'lowest',\n defaultTooltip: true\n }, {\n name: 'highest',\n defaultTooltip: true\n }];\n return _this;\n }\n /**\r\n * Get dimension for shadow in dataZoom\r\n * @return dimension name\r\n */\n\n\n CandlestickSeriesModel.prototype.getShadowDim = function () {\n return 'open';\n };\n\n CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n var itemLayout = data.getItemLayout(dataIndex);\n return itemLayout && selectors.rect(itemLayout.brushRect);\n };\n\n CandlestickSeriesModel.type = 'series.candlestick';\n CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];\n CandlestickSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n layout: null,\n clip: true,\n itemStyle: {\n color: '#eb5454',\n color0: '#47b262',\n borderColor: '#eb5454',\n borderColor0: '#47b262',\n borderColorDoji: null,\n // borderColor: '#d24040',\n // borderColor0: '#398f4f',\n borderWidth: 1\n },\n emphasis: {\n scale: true,\n itemStyle: {\n borderWidth: 2\n }\n },\n barMaxWidth: null,\n barMinWidth: null,\n barWidth: null,\n large: true,\n largeThreshold: 600,\n progressive: 3e3,\n progressiveThreshold: 1e4,\n progressiveChunkMode: 'mod',\n animationEasing: 'linear',\n animationDuration: 300\n };\n return CandlestickSeriesModel;\n}(SeriesModel);\n\nmixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);\nexport default CandlestickSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function candlestickPreprocessor(option) {\n if (!option || !zrUtil.isArray(option.series)) {\n return;\n } // Translate 'k' to 'candlestick'.\n\n\n zrUtil.each(option.series, function (seriesItem) {\n if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {\n seriesItem.type = 'candlestick';\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { extend } from 'zrender/lib/core/util.js';\nvar positiveBorderColorQuery = ['itemStyle', 'borderColor'];\nvar negativeBorderColorQuery = ['itemStyle', 'borderColor0'];\nvar dojiBorderColorQuery = ['itemStyle', 'borderColorDoji'];\nvar positiveColorQuery = ['itemStyle', 'color'];\nvar negativeColorQuery = ['itemStyle', 'color0'];\nvar candlestickVisual = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n // For legend.\n performRawSeries: true,\n reset: function (seriesModel, ecModel) {\n function getColor(sign, model) {\n return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);\n }\n\n function getBorderColor(sign, model) {\n return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);\n } // Only visible series has each data be visual encoded\n\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var isLargeRender = seriesModel.pipelineContext.large;\n return !isLargeRender && {\n progress: function (params, data) {\n var dataIndex;\n\n while ((dataIndex = params.next()) != null) {\n var itemModel = data.getItemModel(dataIndex);\n var sign = data.getItemLayout(dataIndex).sign;\n var style = itemModel.getItemStyle();\n style.fill = getColor(sign, itemModel);\n style.stroke = getBorderColor(sign, itemModel) || style.fill;\n var existsStyle = data.ensureUniqueItemVisual(dataIndex, 'style');\n extend(existsStyle, style);\n }\n }\n };\n }\n};\nexport default candlestickVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { subPixelOptimize } from '../../util/graphic.js';\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { parsePercent } from '../../util/number.js';\nimport { map, retrieve2 } from 'zrender/lib/core/util.js';\nimport { createFloat32Array } from '../../util/vendor.js';\nvar candlestickLayout = {\n seriesType: 'candlestick',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var data = seriesModel.getData();\n var candleWidth = calculateCandleWidth(seriesModel, data);\n var cDimIdx = 0;\n var vDimIdx = 1;\n var coordDims = ['x', 'y'];\n var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));\n var vDimsI = map(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);\n var openDimI = vDimsI[0];\n var closeDimI = vDimsI[1];\n var lowestDimI = vDimsI[2];\n var highestDimI = vDimsI[3];\n data.setLayout({\n candleWidth: candleWidth,\n // The value is experimented visually.\n isSimpleBox: candleWidth <= 1.3\n });\n\n if (cDimI < 0 || vDimsI.length < 4) {\n return;\n }\n\n return {\n progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress\n };\n\n function normalProgress(params, data) {\n var dataIndex;\n var store = data.getStore();\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n var ocLow = Math.min(openVal, closeVal);\n var ocHigh = Math.max(openVal, closeVal);\n var ocLowPoint = getPoint(ocLow, axisDimVal);\n var ocHighPoint = getPoint(ocHigh, axisDimVal);\n var lowestPoint = getPoint(lowestVal, axisDimVal);\n var highestPoint = getPoint(highestVal, axisDimVal);\n var ends = [];\n addBodyEnd(ends, ocHighPoint, 0);\n addBodyEnd(ends, ocLowPoint, 1);\n ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));\n var itemModel = data.getItemModel(dataIndex);\n var hasDojiColor = !!itemModel.get(['itemStyle', 'borderColorDoji']);\n data.setItemLayout(dataIndex, {\n sign: getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),\n initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],\n ends: ends,\n brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)\n });\n }\n\n function getPoint(val, axisDimVal) {\n var p = [];\n p[cDimIdx] = axisDimVal;\n p[vDimIdx] = val;\n return isNaN(axisDimVal) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p);\n }\n\n function addBodyEnd(ends, point, start) {\n var point1 = point.slice();\n var point2 = point.slice();\n point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);\n point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);\n start ? ends.push(point1, point2) : ends.push(point2, point1);\n }\n\n function makeBrushRect(lowestVal, highestVal, axisDimVal) {\n var pmin = getPoint(lowestVal, axisDimVal);\n var pmax = getPoint(highestVal, axisDimVal);\n pmin[cDimIdx] -= candleWidth / 2;\n pmax[cDimIdx] -= candleWidth / 2;\n return {\n x: pmin[0],\n y: pmin[1],\n width: vDimIdx ? candleWidth : pmax[0] - pmin[0],\n height: vDimIdx ? pmax[1] - pmin[1] : candleWidth\n };\n }\n\n function subPixelOptimizePoint(point) {\n point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);\n return point;\n }\n }\n\n function largeProgress(params, data) {\n // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...]\n var points = createFloat32Array(params.count * 4);\n var offset = 0;\n var point;\n var tmpIn = [];\n var tmpOut = [];\n var dataIndex;\n var store = data.getStore();\n var hasDojiColor = !!seriesModel.get(['itemStyle', 'borderColorDoji']);\n\n while ((dataIndex = params.next()) != null) {\n var axisDimVal = store.get(cDimI, dataIndex);\n var openVal = store.get(openDimI, dataIndex);\n var closeVal = store.get(closeDimI, dataIndex);\n var lowestVal = store.get(lowestDimI, dataIndex);\n var highestVal = store.get(highestDimI, dataIndex);\n\n if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {\n points[offset++] = NaN;\n offset += 3;\n continue;\n }\n\n points[offset++] = getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);\n tmpIn[cDimIdx] = axisDimVal;\n tmpIn[vDimIdx] = lowestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[0] : NaN;\n points[offset++] = point ? point[1] : NaN;\n tmpIn[vDimIdx] = highestVal;\n point = coordSys.dataToPoint(tmpIn, null, tmpOut);\n points[offset++] = point ? point[1] : NaN;\n }\n\n data.setLayout('largePoints', points);\n }\n }\n};\n/**\r\n * Get the sign of a single data.\r\n *\r\n * @returns 0 for doji with hasDojiColor: true,\r\n * 1 for positive,\r\n * -1 for negative.\r\n */\n\nfunction getSign(store, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) {\n var sign;\n\n if (openVal > closeVal) {\n sign = -1;\n } else if (openVal < closeVal) {\n sign = 1;\n } else {\n sign = hasDojiColor // When doji color is set, use it instead of color/color0.\n ? 0 : dataIndex > 0 // If close === open, compare with close of last record\n ? store.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : // No record of previous, set to be positive\n 1;\n }\n\n return sign;\n}\n\nfunction calculateCandleWidth(seriesModel, data) {\n var baseAxis = seriesModel.getBaseAxis();\n var extent;\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : (extent = baseAxis.getExtent(), Math.abs(extent[1] - extent[0]) / data.count());\n var barMaxWidth = parsePercent(retrieve2(seriesModel.get('barMaxWidth'), bandWidth), bandWidth);\n var barMinWidth = parsePercent(retrieve2(seriesModel.get('barMinWidth'), 1), bandWidth);\n var barWidth = seriesModel.get('barWidth');\n return barWidth != null ? parsePercent(barWidth, bandWidth) // Put max outer to ensure bar visible in spite of overlap.\n : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);\n}\n\nexport default candlestickLayout;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CandlestickView from './CandlestickView.js';\nimport CandlestickSeriesModel from './CandlestickSeries.js';\nimport preprocessor from './preprocessor.js';\nimport candlestickVisual from './candlestickVisual.js';\nimport candlestickLayout from './candlestickLayout.js';\nexport function install(registers) {\n registers.registerChartView(CandlestickView);\n registers.registerSeriesModel(CandlestickSeriesModel);\n registers.registerPreprocessor(preprocessor);\n registers.registerVisual(candlestickVisual);\n registers.registerLayout(candlestickLayout);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport { Group } from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis, toggleHoverEmphasis } from '../../util/states.js';\nimport SymbolClz from './Symbol.js';\n\nfunction updateRipplePath(rippleGroup, effectCfg) {\n var color = effectCfg.rippleEffectColor || effectCfg.color;\n rippleGroup.eachChild(function (ripplePath) {\n ripplePath.attr({\n z: effectCfg.z,\n zlevel: effectCfg.zlevel,\n style: {\n stroke: effectCfg.brushType === 'stroke' ? color : null,\n fill: effectCfg.brushType === 'fill' ? color : null\n }\n });\n });\n}\n\nvar EffectSymbol =\n/** @class */\nfunction (_super) {\n __extends(EffectSymbol, _super);\n\n function EffectSymbol(data, idx) {\n var _this = _super.call(this) || this;\n\n var symbol = new SymbolClz(data, idx);\n var rippleGroup = new Group();\n\n _this.add(symbol);\n\n _this.add(rippleGroup);\n\n _this.updateData(data, idx);\n\n return _this;\n }\n\n EffectSymbol.prototype.stopEffectAnimation = function () {\n this.childAt(1).removeAll();\n };\n\n EffectSymbol.prototype.startEffectAnimation = function (effectCfg) {\n var symbolType = effectCfg.symbolType;\n var color = effectCfg.color;\n var rippleNumber = effectCfg.rippleNumber;\n var rippleGroup = this.childAt(1);\n\n for (var i = 0; i < rippleNumber; i++) {\n // If width/height are set too small (e.g., set to 1) on ios10\n // and macOS Sierra, a circle stroke become a rect, no matter what\n // the scale is set. So we set width/height as 2. See #4136.\n var ripplePath = createSymbol(symbolType, -1, -1, 2, 2, color);\n ripplePath.attr({\n style: {\n strokeNoScale: true\n },\n z2: 99,\n silent: true,\n scaleX: 0.5,\n scaleY: 0.5\n });\n var delay = -i / rippleNumber * effectCfg.period + effectCfg.effectOffset;\n ripplePath.animate('', true).when(effectCfg.period, {\n scaleX: effectCfg.rippleScale / 2,\n scaleY: effectCfg.rippleScale / 2\n }).delay(delay).start();\n ripplePath.animateStyle(true).when(effectCfg.period, {\n opacity: 0\n }).delay(delay).start();\n rippleGroup.add(ripplePath);\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\r\n * Update effect symbol\r\n */\n\n\n EffectSymbol.prototype.updateEffectAnimation = function (effectCfg) {\n var oldEffectCfg = this._effectCfg;\n var rippleGroup = this.childAt(1); // Must reinitialize effect if following configuration changed\n\n var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale', 'rippleNumber'];\n\n for (var i = 0; i < DIFFICULT_PROPS.length; i++) {\n var propName = DIFFICULT_PROPS[i];\n\n if (oldEffectCfg[propName] !== effectCfg[propName]) {\n this.stopEffectAnimation();\n this.startEffectAnimation(effectCfg);\n return;\n }\n }\n\n updateRipplePath(rippleGroup, effectCfg);\n };\n /**\r\n * Highlight symbol\r\n */\n\n\n EffectSymbol.prototype.highlight = function () {\n enterEmphasis(this);\n };\n /**\r\n * Downplay symbol\r\n */\n\n\n EffectSymbol.prototype.downplay = function () {\n leaveEmphasis(this);\n };\n\n EffectSymbol.prototype.getSymbolType = function () {\n var symbol = this.childAt(0);\n return symbol && symbol.getSymbolType();\n };\n /**\r\n * Update symbol properties\r\n */\n\n\n EffectSymbol.prototype.updateData = function (data, idx) {\n var _this = this;\n\n var seriesModel = data.hostModel;\n this.childAt(0).updateData(data, idx);\n var rippleGroup = this.childAt(1);\n var itemModel = data.getItemModel(idx);\n var symbolType = data.getItemVisual(idx, 'symbol');\n var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));\n var symbolStyle = data.getItemVisual(idx, 'style');\n var color = symbolStyle && symbolStyle.fill;\n var emphasisModel = itemModel.getModel('emphasis');\n rippleGroup.setScale(symbolSize);\n rippleGroup.traverse(function (ripplePath) {\n ripplePath.setStyle('fill', color);\n });\n var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, 'symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n rippleGroup.x = symbolOffset[0];\n rippleGroup.y = symbolOffset[1];\n }\n\n var symbolRotate = data.getItemVisual(idx, 'symbolRotate');\n rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var effectCfg = {};\n effectCfg.showEffectOn = seriesModel.get('showEffectOn');\n effectCfg.rippleScale = itemModel.get(['rippleEffect', 'scale']);\n effectCfg.brushType = itemModel.get(['rippleEffect', 'brushType']);\n effectCfg.period = itemModel.get(['rippleEffect', 'period']) * 1000;\n effectCfg.effectOffset = idx / data.count();\n effectCfg.z = seriesModel.getShallow('z') || 0;\n effectCfg.zlevel = seriesModel.getShallow('zlevel') || 0;\n effectCfg.symbolType = symbolType;\n effectCfg.color = color;\n effectCfg.rippleEffectColor = itemModel.get(['rippleEffect', 'color']);\n effectCfg.rippleNumber = itemModel.get(['rippleEffect', 'number']);\n\n if (effectCfg.showEffectOn === 'render') {\n this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);\n this._effectCfg = effectCfg;\n } else {\n // Not keep old effect config\n this._effectCfg = null;\n this.stopEffectAnimation();\n\n this.onHoverStateChange = function (toState) {\n if (toState === 'emphasis') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.startEffectAnimation(effectCfg);\n }\n } else if (toState === 'normal') {\n if (effectCfg.showEffectOn !== 'render') {\n _this.stopEffectAnimation();\n }\n }\n };\n }\n\n this._effectCfg = effectCfg;\n toggleHoverEmphasis(this, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n ;\n\n EffectSymbol.prototype.fadeOut = function (cb) {\n cb && cb();\n };\n\n ;\n return EffectSymbol;\n}(Group);\n\nexport default EffectSymbol;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../helper/SymbolDraw.js';\nimport EffectSymbol from '../helper/EffectSymbol.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport pointsLayout from '../../layout/points.js';\nimport ChartView from '../../view/Chart.js';\n\nvar EffectScatterView =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterView, _super);\n\n function EffectScatterView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterView.type;\n return _this;\n }\n\n EffectScatterView.prototype.init = function () {\n this._symbolDraw = new SymbolDraw(EffectSymbol);\n };\n\n EffectScatterView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var effectSymbolDraw = this._symbolDraw;\n effectSymbolDraw.updateData(data, {\n clipShape: this._getClipShape(seriesModel)\n });\n this.group.add(effectSymbolDraw.group);\n };\n\n EffectScatterView.prototype._getClipShape = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var clipArea = coordSys && coordSys.getArea && coordSys.getArea();\n return seriesModel.get('clip', true) ? clipArea : null;\n };\n\n EffectScatterView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n this.group.dirty();\n var res = pointsLayout('').reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n }\n\n this._symbolDraw.updateLayout();\n };\n\n EffectScatterView.prototype._updateGroupTransform = function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.getRoamTransform) {\n this.group.transform = matrix.clone(coordSys.getRoamTransform());\n this.group.decomposeTransform();\n }\n };\n\n EffectScatterView.prototype.remove = function (ecModel, api) {\n this._symbolDraw && this._symbolDraw.remove(true);\n };\n\n EffectScatterView.type = 'effectScatter';\n return EffectScatterView;\n}(ChartView);\n\nexport default EffectScatterView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport SeriesModel from '../../model/Series.js';\n\nvar EffectScatterSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(EffectScatterSeriesModel, _super);\n\n function EffectScatterSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = EffectScatterSeriesModel.type;\n _this.hasSymbolVisual = true;\n return _this;\n }\n\n EffectScatterSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n useEncodeDefaulter: true\n });\n };\n\n EffectScatterSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {\n return selectors.point(data.getItemLayout(dataIndex));\n };\n\n EffectScatterSeriesModel.type = 'series.effectScatter';\n EffectScatterSeriesModel.dependencies = ['grid', 'polar'];\n EffectScatterSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n effectType: 'ripple',\n progressive: 0,\n // When to show the effect, option: 'render'|'emphasis'\n showEffectOn: 'render',\n clip: true,\n // Ripple effect config\n rippleEffect: {\n period: 4,\n // Scale of ripple\n scale: 2.5,\n // Brush type can be fill or stroke\n brushType: 'fill',\n // Ripple number\n number: 3\n },\n universalTransition: {\n divideShape: 'clone'\n },\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n // symbol: null, // 图形类型\n symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2\n // symbolRotate: null, // 图形旋转控制\n // itemStyle: {\n // opacity: 1\n // }\n\n };\n return EffectScatterSeriesModel;\n}(SeriesModel);\n\nexport default EffectScatterSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport EffectScatterView from './EffectScatterView.js';\nimport EffectScatterSeriesModel from './EffectScatterSeries.js';\nimport layoutPoints from '../../layout/points.js';\nexport function install(registers) {\n registers.registerChartView(EffectScatterView);\n registers.registerSeriesModel(EffectScatterSeriesModel);\n registers.registerLayout(layoutPoints('effectScatter'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Provide effect for line\r\n */\n\nimport * as graphic from '../../util/graphic.js';\nimport Line from './Line.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\nimport * as curveUtil from 'zrender/lib/core/curve.js';\n\nvar EffectLine =\n/** @class */\nfunction (_super) {\n __extends(EffectLine, _super);\n\n function EffectLine(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this.add(_this.createLine(lineData, idx, seriesScope));\n\n _this._updateEffectSymbol(lineData, idx);\n\n return _this;\n }\n\n EffectLine.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n };\n\n EffectLine.prototype._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var lineStyle = lineData.getItemVisual(idx, 'style');\n var color = effectModel.get('color') || lineStyle && lineStyle.stroke;\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.scaleX = size[0];\n symbol.scaleY = size[1];\n symbol.setColor(color);\n this._symbolType = symbolType;\n this._symbolScale = size;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n EffectLine.prototype._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var roundTrip = effectModel.get('roundTrip');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n }); // Ignore when updating\n\n symbol.ignore = true;\n\n this._updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this._getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {\n symbol.stopAnimation();\n var delayNum = void 0;\n\n if (zrUtil.isFunction(delayExpr)) {\n delayNum = delayExpr(idx);\n } else {\n delayNum = delayExpr;\n }\n\n if (symbol.__t > 0) {\n delayNum = -period * symbol.__t;\n }\n\n this._animateSymbol(symbol, period, delayNum, loop, roundTrip);\n }\n\n this._period = period;\n this._loop = loop;\n this._roundTrip = roundTrip;\n };\n\n EffectLine.prototype._animateSymbol = function (symbol, period, delayNum, loop, roundTrip) {\n if (period > 0) {\n symbol.__t = 0;\n var self_1 = this;\n var animator = symbol.animate('', loop).when(roundTrip ? period * 2 : period, {\n __t: roundTrip ? 2 : 1\n }).delay(delayNum).during(function () {\n self_1._updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self_1.remove(symbol);\n });\n }\n\n animator.start();\n }\n };\n\n EffectLine.prototype._getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n };\n\n EffectLine.prototype._updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n };\n\n EffectLine.prototype.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n };\n\n EffectLine.prototype._updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var pos = [symbol.x, symbol.y];\n var lastPos = pos.slice();\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = symbol.__t < 1 ? quadraticDerivativeAt(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt(p2[0], cp1[0], p1[0], 1 - t);\n var ty = symbol.__t < 1 ? quadraticDerivativeAt(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt(p2[1], cp1[1], p1[1], 1 - t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; // enable continuity trail for 'line', 'rect', 'roundRect' symbolType\n\n if (this._symbolType === 'line' || this._symbolType === 'rect' || this._symbolType === 'roundRect') {\n if (symbol.__lastT !== undefined && symbol.__lastT < symbol.__t) {\n symbol.scaleY = vec2.dist(lastPos, pos) * 1.05; // make sure the last segment render within endPoint\n\n if (t === 1) {\n pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;\n pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;\n }\n } else if (symbol.__lastT === 1) {\n // After first loop, symbol.__t does NOT start with 0, so connect p1 to pos directly.\n symbol.scaleY = 2 * vec2.dist(p1, pos);\n } else {\n symbol.scaleY = this._symbolScale[1];\n }\n }\n\n symbol.__lastT = symbol.__t;\n symbol.ignore = false;\n symbol.x = pos[0];\n symbol.y = pos[1];\n };\n\n EffectLine.prototype.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n };\n\n return EffectLine;\n}(graphic.Group);\n\nexport default EffectLine;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\n\nvar Polyline =\n/** @class */\nfunction (_super) {\n __extends(Polyline, _super);\n\n function Polyline(lineData, idx, seriesScope) {\n var _this = _super.call(this) || this;\n\n _this._createPolyline(lineData, idx, seriesScope);\n\n return _this;\n }\n\n Polyline.prototype._createPolyline = function (lineData, idx, seriesScope) {\n // let seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n };\n\n ;\n\n Polyline.prototype._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;\n var focus = seriesScope && seriesScope.focus;\n var blurScope = seriesScope && seriesScope.blurScope;\n var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;\n\n if (!seriesScope || lineData.hasItemOption) {\n var emphasisModel = itemModel.getModel('emphasis');\n emphasisLineStyle = emphasisModel.getModel('lineStyle').getLineStyle();\n emphasisDisabled = emphasisModel.get('disabled');\n focus = emphasisModel.get('focus');\n blurScope = emphasisModel.get('blurScope');\n }\n\n line.useStyle(lineData.getItemVisual(idx, 'style'));\n line.style.fill = null;\n line.style.strokeNoScale = true;\n var lineEmphasisState = line.ensureState('emphasis');\n lineEmphasisState.style = emphasisLineStyle;\n toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);\n };\n\n ;\n\n Polyline.prototype.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n };\n\n ;\n return Polyline;\n}(graphic.Group);\n\nexport default Polyline;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Polyline from './Polyline.js';\nimport EffectLine from './EffectLine.js';\nimport * as vec2 from 'zrender/lib/core/vector.js';\n\nvar EffectPolyline =\n/** @class */\nfunction (_super) {\n __extends(EffectPolyline, _super);\n\n function EffectPolyline() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this._lastFrame = 0;\n _this._lastFramePercent = 0;\n return _this;\n } // Override\n\n\n EffectPolyline.prototype.createLine = function (lineData, idx, seriesScope) {\n return new Polyline(lineData, idx, seriesScope);\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateAnimationPoints = function (symbol, points) {\n this._points = points;\n var accLenArr = [0];\n var len = 0;\n\n for (var i = 1; i < points.length; i++) {\n var p1 = points[i - 1];\n var p2 = points[i];\n len += vec2.dist(p1, p2);\n accLenArr.push(len);\n }\n\n if (len === 0) {\n this._length = 0;\n return;\n }\n\n for (var i = 0; i < accLenArr.length; i++) {\n accLenArr[i] /= len;\n }\n\n this._offsets = accLenArr;\n this._length = len;\n };\n\n ; // Override\n\n EffectPolyline.prototype._getLineLength = function () {\n return this._length;\n };\n\n ; // Override\n\n EffectPolyline.prototype._updateSymbolPosition = function (symbol) {\n var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;\n var points = this._points;\n var offsets = this._offsets;\n var len = points.length;\n\n if (!offsets) {\n // Has length 0\n return;\n }\n\n var lastFrame = this._lastFrame;\n var frame;\n\n if (t < this._lastFramePercent) {\n // Start from the next frame\n // PENDING start from lastFrame ?\n var start = Math.min(lastFrame + 1, len - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (offsets[frame] <= t) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, len - 2);\n } else {\n for (frame = lastFrame; frame < len; frame++) {\n if (offsets[frame] > t) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, len - 2);\n }\n\n var p = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);\n var p0 = points[frame];\n var p1 = points[frame + 1];\n symbol.x = p0[0] * (1 - p) + p * p1[0];\n symbol.y = p0[1] * (1 - p) + p * p1[1];\n var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];\n var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n this._lastFrame = frame;\n this._lastFramePercent = t;\n symbol.ignore = false;\n };\n\n ;\n return EffectPolyline;\n}(EffectLine);\n\nexport default EffectPolyline;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO Batch by color\n\nimport * as graphic from '../../util/graphic.js';\nimport * as lineContain from 'zrender/lib/contain/line.js';\nimport * as quadraticContain from 'zrender/lib/contain/quadratic.js';\nimport { getECData } from '../../util/innerStore.js';\n\nvar LargeLinesPathShape =\n/** @class */\nfunction () {\n function LargeLinesPathShape() {\n this.polyline = false;\n this.curveness = 0;\n this.segs = [];\n }\n\n return LargeLinesPathShape;\n}();\n\nvar LargeLinesPath =\n/** @class */\nfunction (_super) {\n __extends(LargeLinesPath, _super);\n\n function LargeLinesPath(opts) {\n var _this = _super.call(this, opts) || this;\n\n _this._off = 0;\n _this.hoverDataIdx = -1;\n return _this;\n }\n\n LargeLinesPath.prototype.reset = function () {\n this.notClear = false;\n this._off = 0;\n };\n\n LargeLinesPath.prototype.getDefaultStyle = function () {\n return {\n stroke: '#000',\n fill: null\n };\n };\n\n LargeLinesPath.prototype.getDefaultShape = function () {\n return new LargeLinesPathShape();\n };\n\n LargeLinesPath.prototype.buildPath = function (ctx, shape) {\n var segs = shape.segs;\n var curveness = shape.curveness;\n var i;\n\n if (shape.polyline) {\n for (i = this._off; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n ctx.moveTo(segs[i++], segs[i++]);\n\n for (var k = 1; k < count; k++) {\n ctx.lineTo(segs[i++], segs[i++]);\n }\n }\n }\n } else {\n for (i = this._off; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n ctx.moveTo(x0, y0);\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n ctx.quadraticCurveTo(x2, y2, x1, y1);\n } else {\n ctx.lineTo(x1, y1);\n }\n }\n }\n\n if (this.incremental) {\n this._off = i;\n this.notClear = true;\n }\n };\n\n LargeLinesPath.prototype.findDataIndex = function (x, y) {\n var shape = this.shape;\n var segs = shape.segs;\n var curveness = shape.curveness;\n var lineWidth = this.style.lineWidth;\n\n if (shape.polyline) {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var count = segs[i++];\n\n if (count > 0) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n\n for (var k = 1; k < count; k++) {\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n }\n\n dataIndex++;\n }\n } else {\n var dataIndex = 0;\n\n for (var i = 0; i < segs.length;) {\n var x0 = segs[i++];\n var y0 = segs[i++];\n var x1 = segs[i++];\n var y1 = segs[i++];\n\n if (curveness > 0) {\n var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;\n var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;\n\n if (quadraticContain.containStroke(x0, y0, x2, y2, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n } else {\n if (lineContain.containStroke(x0, y0, x1, y1, lineWidth, x, y)) {\n return dataIndex;\n }\n }\n\n dataIndex++;\n }\n }\n\n return -1;\n };\n\n LargeLinesPath.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n // Cache found data index.\n var dataIdx = this.hoverDataIdx = this.findDataIndex(x, y);\n return dataIdx >= 0;\n }\n\n this.hoverDataIdx = -1;\n return false;\n };\n\n LargeLinesPath.prototype.getBoundingRect = function () {\n // Ignore stroke for large symbol draw.\n var rect = this._rect;\n\n if (!rect) {\n var shape = this.shape;\n var points = shape.segs;\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n\n for (var i = 0; i < points.length;) {\n var x = points[i++];\n var y = points[i++];\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n\n rect = this._rect = new graphic.BoundingRect(minX, minY, maxX, maxY);\n }\n\n return rect;\n };\n\n return LargeLinesPath;\n}(graphic.Path);\n\nvar LargeLineDraw =\n/** @class */\nfunction () {\n function LargeLineDraw() {\n this.group = new graphic.Group();\n }\n /**\r\n * Update symbols draw by new data\r\n */\n\n\n LargeLineDraw.prototype.updateData = function (data) {\n this._clear();\n\n var lineEl = this._create();\n\n lineEl.setShape({\n segs: data.getLayout('linesPoints')\n });\n\n this._setCommon(lineEl, data);\n };\n\n ;\n /**\r\n * @override\r\n */\n\n LargeLineDraw.prototype.incrementalPrepareUpdate = function (data) {\n this.group.removeAll();\n\n this._clear();\n };\n\n ;\n /**\r\n * @override\r\n */\n\n LargeLineDraw.prototype.incrementalUpdate = function (taskParams, data) {\n var lastAdded = this._newAdded[0];\n var linePoints = data.getLayout('linesPoints');\n var oldSegs = lastAdded && lastAdded.shape.segs; // Merging the exists. Each element has 1e4 points.\n // Consider the performance balance between too much elements and too much points in one shape(may affect hover optimization)\n\n if (oldSegs && oldSegs.length < 2e4) {\n var oldLen = oldSegs.length;\n var newSegs = new Float32Array(oldLen + linePoints.length); // Concat two array\n\n newSegs.set(oldSegs);\n newSegs.set(linePoints, oldLen);\n lastAdded.setShape({\n segs: newSegs\n });\n } else {\n // Clear\n this._newAdded = [];\n\n var lineEl = this._create();\n\n lineEl.incremental = true;\n lineEl.setShape({\n segs: linePoints\n });\n\n this._setCommon(lineEl, data);\n\n lineEl.__startIndex = taskParams.start;\n }\n };\n /**\r\n * @override\r\n */\n\n\n LargeLineDraw.prototype.remove = function () {\n this._clear();\n };\n\n LargeLineDraw.prototype.eachRendered = function (cb) {\n this._newAdded[0] && cb(this._newAdded[0]);\n };\n\n LargeLineDraw.prototype._create = function () {\n var lineEl = new LargeLinesPath({\n cursor: 'default',\n ignoreCoarsePointer: true\n });\n\n this._newAdded.push(lineEl);\n\n this.group.add(lineEl);\n return lineEl;\n };\n\n LargeLineDraw.prototype._setCommon = function (lineEl, data, isIncremental) {\n var hostModel = data.hostModel;\n lineEl.setShape({\n polyline: hostModel.get('polyline'),\n curveness: hostModel.get(['lineStyle', 'curveness'])\n });\n lineEl.useStyle(hostModel.getModel('lineStyle').getLineStyle());\n lineEl.style.strokeNoScale = true;\n var style = data.getVisual('style');\n\n if (style && style.stroke) {\n lineEl.setStyle('stroke', style.stroke);\n }\n\n lineEl.setStyle('fill', null);\n var ecData = getECData(lineEl); // Enable tooltip\n // PENDING May have performance issue when path is extremely large\n\n ecData.seriesIndex = hostModel.seriesIndex;\n lineEl.on('mousemove', function (e) {\n ecData.dataIndex = null;\n var dataIndex = lineEl.hoverDataIdx;\n\n if (dataIndex > 0) {\n // Provide dataIndex for tooltip\n ecData.dataIndex = dataIndex + lineEl.__startIndex;\n }\n });\n };\n\n ;\n\n LargeLineDraw.prototype._clear = function () {\n this._newAdded = [];\n this.group.removeAll();\n };\n\n ;\n return LargeLineDraw;\n}();\n\nexport default LargeLineDraw;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Float32Array */\nimport createRenderPlanner from '../helper/createRenderPlanner.js';\nimport { error } from '../../util/log.js';\nvar linesLayout = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (!coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n error('The lines series must have a coordinate system.');\n }\n\n return;\n }\n\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n return {\n progress: function (params, lineData) {\n var lineCoords = [];\n\n if (isLarge) {\n var points = void 0;\n var segCount = params.end - params.start;\n\n if (isPolyline) {\n var totalCoordsCount = 0;\n\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n\n var offset = 0;\n var pt = [];\n\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n\n if (isPolyline) {\n points[offset++] = len;\n }\n\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get(['lineStyle', 'curveness']);\n\n if (+curveness) {\n 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];\n }\n }\n\n lineData.setItemLayout(i, pts);\n }\n }\n }\n };\n }\n};\nexport default linesLayout;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport LineDraw from '../helper/LineDraw.js';\nimport EffectLine from '../helper/EffectLine.js';\nimport Line from '../helper/Line.js';\nimport Polyline from '../helper/Polyline.js';\nimport EffectPolyline from '../helper/EffectPolyline.js';\nimport LargeLineDraw from '../helper/LargeLineDraw.js';\nimport linesLayout from './linesLayout.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport ChartView from '../../view/Chart.js';\n\nvar LinesView =\n/** @class */\nfunction (_super) {\n __extends(LinesView, _super);\n\n function LinesView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesView.type;\n return _this;\n }\n\n LinesView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n var zlevel = seriesModel.get('zlevel');\n var trailLength = seriesModel.get(['effect', 'trailLength']);\n var zr = api.getZr(); // Avoid the drag cause ghost shadow\n // FIXME Better way ?\n // SVG doesn't support\n\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg) {\n zr.painter.getLayer(zlevel).clear(true);\n } // Config layer with motion blur\n\n\n if (this._lastZlevel != null && !isSvg) {\n zr.configLayer(this._lastZlevel, {\n motionBlur: false\n });\n }\n\n if (this._showEffect(seriesModel) && trailLength > 0) {\n if (!isSvg) {\n zr.configLayer(zlevel, {\n motionBlur: true,\n lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)\n });\n } else if (process.env.NODE_ENV !== 'production') {\n console.warn('SVG render mode doesn\\'t support lines with trail effect');\n }\n }\n\n lineDraw.updateData(data);\n var clipPath = seriesModel.get('clip', true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);\n\n if (clipPath) {\n this.group.setClipPath(clipPath);\n } else {\n this.group.removeClipPath();\n }\n\n this._lastZlevel = zlevel;\n this._finished = true;\n };\n\n LinesView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n\n var lineDraw = this._updateLineDraw(data, seriesModel);\n\n lineDraw.incrementalPrepareUpdate(data);\n\n this._clearLayer(api);\n\n this._finished = false;\n };\n\n LinesView.prototype.incrementalRender = function (taskParams, seriesModel, ecModel) {\n this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());\n\n this._finished = taskParams.end === seriesModel.getData().count();\n };\n\n LinesView.prototype.eachRendered = function (cb) {\n this._lineDraw && this._lineDraw.eachRendered(cb);\n };\n\n LinesView.prototype.updateTransform = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {\n // TODO Don't have to do update in large mode. Only do it when there are millions of data.\n return {\n update: true\n };\n } else {\n // TODO Use same logic with ScatterView.\n // Manually update layout\n var res = linesLayout.reset(seriesModel, ecModel, api);\n\n if (res.progress) {\n res.progress({\n start: 0,\n end: data.count(),\n count: data.count()\n }, data);\n } // Not in large mode\n\n\n this._lineDraw.updateLayout();\n\n this._clearLayer(api);\n }\n };\n\n LinesView.prototype._updateLineDraw = function (data, seriesModel) {\n var lineDraw = this._lineDraw;\n\n var hasEffect = this._showEffect(seriesModel);\n\n var isPolyline = !!seriesModel.get('polyline');\n var pipelineContext = seriesModel.pipelineContext;\n var isLargeDraw = pipelineContext.large;\n\n if (process.env.NODE_ENV !== 'production') {\n if (hasEffect && isLargeDraw) {\n console.warn('Large lines not support effect');\n }\n }\n\n if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {\n if (lineDraw) {\n lineDraw.remove();\n }\n\n lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);\n this._hasEffet = hasEffect;\n this._isPolyline = isPolyline;\n this._isLargeDraw = isLargeDraw;\n }\n\n this.group.add(lineDraw.group);\n return lineDraw;\n };\n\n LinesView.prototype._showEffect = function (seriesModel) {\n return !!seriesModel.get(['effect', 'show']);\n };\n\n LinesView.prototype._clearLayer = function (api) {\n // Not use motion when dragging or zooming\n var zr = api.getZr();\n var isSvg = zr.painter.getType() === 'svg';\n\n if (!isSvg && this._lastZlevel != null) {\n zr.painter.getLayer(this._lastZlevel).clear(true);\n }\n };\n\n LinesView.prototype.remove = function (ecModel, api) {\n this._lineDraw && this._lineDraw.remove();\n this._lineDraw = null; // Clear motion when lineDraw is removed\n\n this._clearLayer(api);\n };\n\n LinesView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n LinesView.type = 'lines';\n return LinesView;\n}(ChartView);\n\nexport default LinesView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Uint32Array, Float64Array, Float32Array */\n\nimport SeriesModel from '../../model/Series.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { concatArray, mergeAll, map, isNumber } from 'zrender/lib/core/util.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array;\nvar Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array;\n\nfunction compatEc2(seriesOpt) {\n var data = seriesOpt.data;\n\n if (data && data[0] && data[0][0] && data[0][0].coord) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Lines data configuration has been changed to' + ' { coords:[[1,2],[2,3]] }');\n }\n\n seriesOpt.data = map(data, function (itemOpt) {\n var coords = [itemOpt[0].coord, itemOpt[1].coord];\n var target = {\n coords: coords\n };\n\n if (itemOpt[0].name) {\n target.fromName = itemOpt[0].name;\n }\n\n if (itemOpt[1].name) {\n target.toName = itemOpt[1].name;\n }\n\n return mergeAll([target, itemOpt[0], itemOpt[1]]);\n });\n }\n}\n\nvar LinesSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(LinesSeriesModel, _super);\n\n function LinesSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LinesSeriesModel.type;\n _this.visualStyleAccessPath = 'lineStyle';\n _this.visualDrawType = 'stroke';\n return _this;\n }\n\n LinesSeriesModel.prototype.init = function (option) {\n // The input data may be null/undefined.\n option.data = option.data || []; // Not using preprocessor because mergeOption may not have series.type\n\n compatEc2(option);\n\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n\n _super.prototype.init.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.mergeOption = function (option) {\n compatEc2(option);\n\n if (option.data) {\n // Only update when have option data to merge.\n var result = this._processFlatCoordsArray(option.data);\n\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n\n if (result.flatCoords) {\n option.data = new Float32Array(result.count);\n }\n }\n\n _super.prototype.mergeOption.apply(this, arguments);\n };\n\n LinesSeriesModel.prototype.appendData = function (params) {\n var result = this._processFlatCoordsArray(params.data);\n\n if (result.flatCoords) {\n if (!this._flatCoords) {\n this._flatCoords = result.flatCoords;\n this._flatCoordsOffset = result.flatCoordsOffset;\n } else {\n this._flatCoords = concatArray(this._flatCoords, result.flatCoords);\n this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);\n }\n\n params.data = new Float32Array(result.count);\n }\n\n this.getRawData().appendData(params.data);\n };\n\n LinesSeriesModel.prototype._getCoordsFromItemModel = function (idx) {\n var itemModel = this.getData().getItemModel(idx);\n var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow('coords');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) {\n throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.');\n }\n }\n\n return coords;\n };\n\n LinesSeriesModel.prototype.getLineCoordsCount = function (idx) {\n if (this._flatCoordsOffset) {\n return this._flatCoordsOffset[idx * 2 + 1];\n } else {\n return this._getCoordsFromItemModel(idx).length;\n }\n };\n\n LinesSeriesModel.prototype.getLineCoords = function (idx, out) {\n if (this._flatCoordsOffset) {\n var offset = this._flatCoordsOffset[idx * 2];\n var len = this._flatCoordsOffset[idx * 2 + 1];\n\n for (var i = 0; i < len; i++) {\n out[i] = out[i] || [];\n out[i][0] = this._flatCoords[offset + i * 2];\n out[i][1] = this._flatCoords[offset + i * 2 + 1];\n }\n\n return len;\n } else {\n var coords = this._getCoordsFromItemModel(idx);\n\n for (var i = 0; i < coords.length; i++) {\n out[i] = out[i] || [];\n out[i][0] = coords[i][0];\n out[i][1] = coords[i][1];\n }\n\n return coords.length;\n }\n };\n\n LinesSeriesModel.prototype._processFlatCoordsArray = function (data) {\n var startOffset = 0;\n\n if (this._flatCoords) {\n startOffset = this._flatCoords.length;\n } // Stored as a typed array. In format\n // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y |\n\n\n if (isNumber(data[0])) {\n var len = data.length; // Store offset and len of each segment\n\n var coordsOffsetAndLenStorage = new Uint32Arr(len);\n var coordsStorage = new Float64Arr(len);\n var coordsCursor = 0;\n var offsetCursor = 0;\n var dataCount = 0;\n\n for (var i = 0; i < len;) {\n dataCount++;\n var count = data[i++]; // Offset\n\n coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; // Len\n\n coordsOffsetAndLenStorage[offsetCursor++] = count;\n\n for (var k = 0; k < count; k++) {\n var x = data[i++];\n var y = data[i++];\n coordsStorage[coordsCursor++] = x;\n coordsStorage[coordsCursor++] = y;\n\n if (i > len) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invalid data format.');\n }\n }\n }\n }\n\n return {\n flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),\n flatCoords: coordsStorage,\n count: dataCount\n };\n }\n\n return {\n flatCoordsOffset: null,\n flatCoords: null,\n count: data.length\n };\n };\n\n LinesSeriesModel.prototype.getInitialData = function (option, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n var CoordSys = CoordinateSystem.get(option.coordinateSystem);\n\n if (!CoordSys) {\n throw new Error('Unknown coordinate system ' + option.coordinateSystem);\n }\n }\n\n var lineData = new SeriesData(['value'], this);\n lineData.hasItemOption = false;\n lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) {\n // dataItem is simply coords\n if (dataItem instanceof Array) {\n return NaN;\n } else {\n lineData.hasItemOption = true;\n var value = dataItem.value;\n\n if (value != null) {\n return value instanceof Array ? value[dimIndex] : value;\n }\n }\n });\n return lineData;\n };\n\n LinesSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var itemModel = data.getItemModel(dataIndex);\n var name = itemModel.get('name');\n\n if (name) {\n return name;\n }\n\n var fromName = itemModel.get('fromName');\n var toName = itemModel.get('toName');\n var nameArr = [];\n fromName != null && nameArr.push(fromName);\n toName != null && nameArr.push(toName);\n return createTooltipMarkup('nameValue', {\n name: nameArr.join(' > ')\n });\n };\n\n LinesSeriesModel.prototype.preventIncremental = function () {\n return !!this.get(['effect', 'show']);\n };\n\n LinesSeriesModel.prototype.getProgressive = function () {\n var progressive = this.option.progressive;\n\n if (progressive == null) {\n return this.option.large ? 1e4 : this.get('progressive');\n }\n\n return progressive;\n };\n\n LinesSeriesModel.prototype.getProgressiveThreshold = function () {\n var progressiveThreshold = this.option.progressiveThreshold;\n\n if (progressiveThreshold == null) {\n return this.option.large ? 2e4 : this.get('progressiveThreshold');\n }\n\n return progressiveThreshold;\n };\n\n LinesSeriesModel.prototype.getZLevelKey = function () {\n var effectModel = this.getModel('effect');\n var trailLength = effectModel.get('trailLength');\n return this.getData().count() > this.getProgressiveThreshold() // Each progressive series has individual key.\n ? this.id : effectModel.get('show') && trailLength > 0 ? trailLength + '' : '';\n };\n\n LinesSeriesModel.type = 'series.lines';\n LinesSeriesModel.dependencies = ['grid', 'polar', 'geo', 'calendar'];\n LinesSeriesModel.defaultOption = {\n coordinateSystem: 'geo',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Cartesian coordinate system\n xAxisIndex: 0,\n yAxisIndex: 0,\n symbol: ['none', 'none'],\n symbolSize: [10, 10],\n // Geo coordinate system\n geoIndex: 0,\n effect: {\n show: false,\n period: 4,\n constantSpeed: 0,\n symbol: 'circle',\n symbolSize: 3,\n loop: true,\n trailLength: 0.2\n },\n large: false,\n // Available when large is true\n largeThreshold: 2000,\n polyline: false,\n clip: true,\n label: {\n show: false,\n position: 'end' // distance: 5,\n // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调\n\n },\n lineStyle: {\n opacity: 0.5\n }\n };\n return LinesSeriesModel;\n}(SeriesModel);\n\nexport default LinesSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nfunction normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}\n\nvar linesVisual = {\n seriesType: 'lines',\n reset: function (seriesModel) {\n var symbolType = normalize(seriesModel.get('symbol'));\n var symbolSize = normalize(seriesModel.get('symbolSize'));\n var data = seriesModel.getData();\n data.setVisual('fromSymbol', symbolType && symbolType[0]);\n data.setVisual('toSymbol', symbolType && symbolType[1]);\n data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]);\n data.setVisual('toSymbolSize', symbolSize && symbolSize[1]);\n\n function dataEach(data, idx) {\n var itemModel = data.getItemModel(idx);\n var symbolType = normalize(itemModel.getShallow('symbol', true));\n var symbolSize = normalize(itemModel.getShallow('symbolSize', true));\n symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]);\n symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]);\n symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]);\n symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]);\n }\n\n return {\n dataEach: data.hasItemOption ? dataEach : null\n };\n }\n};\nexport default linesVisual;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LinesView from './LinesView.js';\nimport LinesSeriesModel from './LinesSeries.js';\nimport linesLayout from './linesLayout.js';\nimport linesVisual from './linesVisual.js';\nexport function install(registers) {\n registers.registerChartView(LinesView);\n registers.registerSeriesModel(LinesSeriesModel);\n registers.registerLayout(linesLayout);\n registers.registerVisual(linesVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/* global Uint8ClampedArray */\nimport { platformApi } from 'zrender/lib/core/platform.js';\nvar GRADIENT_LEVELS = 256;\n\nvar HeatmapLayer =\n/** @class */\nfunction () {\n function HeatmapLayer() {\n this.blurSize = 30;\n this.pointSize = 20;\n this.maxOpacity = 1;\n this.minOpacity = 0;\n this._gradientPixels = {\n inRange: null,\n outOfRange: null\n };\n var canvas = platformApi.createCanvas();\n this.canvas = canvas;\n }\n /**\r\n * Renders Heatmap and returns the rendered canvas\r\n * @param data array of data, each has x, y, value\r\n * @param width canvas width\r\n * @param height canvas height\r\n */\n\n\n HeatmapLayer.prototype.update = function (data, width, height, normalize, colorFunc, isInRange) {\n var brush = this._getBrush();\n\n var gradientInRange = this._getGradient(colorFunc, 'inRange');\n\n var gradientOutOfRange = this._getGradient(colorFunc, 'outOfRange');\n\n var r = this.pointSize + this.blurSize;\n var canvas = this.canvas;\n var ctx = canvas.getContext('2d');\n var len = data.length;\n canvas.width = width;\n canvas.height = height;\n\n for (var i = 0; i < len; ++i) {\n var p = data[i];\n var x = p[0];\n var y = p[1];\n var value = p[2]; // calculate alpha using value\n\n var alpha = normalize(value); // draw with the circle brush with alpha\n\n ctx.globalAlpha = alpha;\n ctx.drawImage(brush, x - r, y - r);\n }\n\n if (!canvas.width || !canvas.height) {\n // Avoid \"Uncaught DOMException: Failed to execute 'getImageData' on\n // 'CanvasRenderingContext2D': The source height is 0.\"\n return canvas;\n } // colorize the canvas using alpha value and set with gradient\n\n\n var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);\n var pixels = imageData.data;\n var offset = 0;\n var pixelLen = pixels.length;\n var minOpacity = this.minOpacity;\n var maxOpacity = this.maxOpacity;\n var diffOpacity = maxOpacity - minOpacity;\n\n while (offset < pixelLen) {\n var alpha = pixels[offset + 3] / 256;\n var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data\n\n if (alpha > 0) {\n var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange; // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]\n\n alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);\n pixels[offset++] = gradient[gradientOffset];\n pixels[offset++] = gradient[gradientOffset + 1];\n pixels[offset++] = gradient[gradientOffset + 2];\n pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;\n } else {\n offset += 4;\n }\n }\n\n ctx.putImageData(imageData, 0, 0);\n return canvas;\n };\n /**\r\n * get canvas of a black circle brush used for canvas to draw later\r\n */\n\n\n HeatmapLayer.prototype._getBrush = function () {\n var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas()); // set brush size\n\n var r = this.pointSize + this.blurSize;\n var d = r * 2;\n brushCanvas.width = d;\n brushCanvas.height = d;\n var ctx = brushCanvas.getContext('2d');\n ctx.clearRect(0, 0, d, d); // in order to render shadow without the distinct circle,\n // draw the distinct circle in an invisible place,\n // and use shadowOffset to draw shadow in the center of the canvas\n\n ctx.shadowOffsetX = d;\n ctx.shadowBlur = this.blurSize; // draw the shadow in black, and use alpha and shadow blur to generate\n // color in color map\n\n ctx.shadowColor = '#000'; // draw circle in the left to the canvas\n\n ctx.beginPath();\n ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);\n ctx.closePath();\n ctx.fill();\n return brushCanvas;\n };\n /**\r\n * get gradient color map\r\n * @private\r\n */\n\n\n HeatmapLayer.prototype._getGradient = function (colorFunc, state) {\n var gradientPixels = this._gradientPixels;\n var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));\n var color = [0, 0, 0, 0];\n var off = 0;\n\n for (var i = 0; i < 256; i++) {\n colorFunc[state](i / 255, true, color);\n pixelsSingleState[off++] = color[0];\n pixelsSingleState[off++] = color[1];\n pixelsSingleState[off++] = color[2];\n pixelsSingleState[off++] = color[3];\n }\n\n return pixelsSingleState;\n };\n\n return HeatmapLayer;\n}();\n\nexport default HeatmapLayer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport HeatmapLayer from './HeatmapLayer.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\n\nfunction getIsInPiecewiseRange(dataExtent, pieceList, selected) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n pieceList = zrUtil.map(pieceList, function (piece) {\n return {\n interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]\n };\n });\n var len = pieceList.length;\n var lastIndex = 0;\n return function (val) {\n var i; // Try to find in the location of the last found\n\n for (i = lastIndex; i < len; i++) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n\n if (i === len) {\n // Not found, back interation\n for (i = lastIndex - 1; i >= 0; i--) {\n var interval = pieceList[i].interval;\n\n if (interval[0] <= val && val <= interval[1]) {\n lastIndex = i;\n break;\n }\n }\n }\n\n return i >= 0 && i < len && selected[i];\n };\n}\n\nfunction getIsInContinuousRange(dataExtent, range) {\n var dataSpan = dataExtent[1] - dataExtent[0];\n range = [(range[0] - dataExtent[0]) / dataSpan, (range[1] - dataExtent[0]) / dataSpan];\n return function (val) {\n return val >= range[0] && val <= range[1];\n };\n}\n\nfunction isGeoCoordSys(coordSys) {\n var dimensions = coordSys.dimensions; // Not use coordSys.type === 'geo' because coordSys maybe extended\n\n return dimensions[0] === 'lng' && dimensions[1] === 'lat';\n}\n\nvar HeatmapView =\n/** @class */\nfunction (_super) {\n __extends(HeatmapView, _super);\n\n function HeatmapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapView.type;\n return _this;\n }\n\n HeatmapView.prototype.render = function (seriesModel, ecModel, api) {\n var visualMapOfThisSeries;\n ecModel.eachComponent('visualMap', function (visualMap) {\n visualMap.eachTargetSeries(function (targetSeries) {\n if (targetSeries === seriesModel) {\n visualMapOfThisSeries = visualMap;\n }\n });\n });\n\n if (process.env.NODE_ENV !== 'production') {\n if (!visualMapOfThisSeries) {\n throw new Error('Heatmap must use with visualMap');\n }\n } // Clear previously rendered progressive elements.\n\n\n this._progressiveEls = null;\n this.group.removeAll();\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') {\n this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count());\n } else if (isGeoCoordSys(coordSys)) {\n this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api);\n }\n };\n\n HeatmapView.prototype.incrementalPrepareRender = function (seriesModel, ecModel, api) {\n this.group.removeAll();\n };\n\n HeatmapView.prototype.incrementalRender = function (params, seriesModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys) {\n // geo does not support incremental rendering?\n if (isGeoCoordSys(coordSys)) {\n this.render(seriesModel, ecModel, api);\n } else {\n this._progressiveEls = [];\n\n this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true);\n }\n }\n };\n\n HeatmapView.prototype.eachRendered = function (cb) {\n graphic.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n HeatmapView.prototype._renderOnCartesianAndCalendar = function (seriesModel, api, start, end, incremental) {\n var coordSys = seriesModel.coordinateSystem;\n var isCartesian2d = isCoordinateSystemType(coordSys, 'cartesian2d');\n var width;\n var height;\n var xAxisExtent;\n var yAxisExtent;\n\n if (isCartesian2d) {\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(xAxis.type === 'category' && yAxis.type === 'category')) {\n throw new Error('Heatmap on cartesian must have two category axes');\n }\n\n if (!(xAxis.onBand && yAxis.onBand)) {\n throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');\n }\n } // add 0.5px to avoid the gaps\n\n\n width = xAxis.getBandWidth() + .5;\n height = yAxis.getBandWidth() + .5;\n xAxisExtent = xAxis.scale.getExtent();\n yAxisExtent = yAxis.scale.getExtent();\n }\n\n var group = this.group;\n var data = seriesModel.getData();\n var emphasisStyle = seriesModel.getModel(['emphasis', 'itemStyle']).getItemStyle();\n var blurStyle = seriesModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = seriesModel.getModel(['select', 'itemStyle']).getItemStyle();\n var borderRadius = seriesModel.get(['itemStyle', 'borderRadius']);\n var labelStatesModels = getLabelStatesModels(seriesModel);\n var emphasisModel = seriesModel.getModel('emphasis');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var emphasisDisabled = emphasisModel.get('disabled');\n var dataDims = isCartesian2d ? [data.mapDimension('x'), data.mapDimension('y'), data.mapDimension('value')] : [data.mapDimension('time'), data.mapDimension('value')];\n\n for (var idx = start; idx < end; idx++) {\n var rect = void 0;\n var style = data.getItemVisual(idx, 'style');\n\n if (isCartesian2d) {\n var dataDimX = data.get(dataDims[0], idx);\n var dataDimY = data.get(dataDims[1], idx); // Ignore empty data and out of extent data\n\n if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {\n continue;\n }\n\n var point = coordSys.dataToPoint([dataDimX, dataDimY]);\n rect = new graphic.Rect({\n shape: {\n x: point[0] - width / 2,\n y: point[1] - height / 2,\n width: width,\n height: height\n },\n style: style\n });\n } else {\n // Ignore empty data\n if (isNaN(data.get(dataDims[1], idx))) {\n continue;\n }\n\n rect = new graphic.Rect({\n z2: 1,\n shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,\n style: style\n });\n } // Optimization for large dataset\n\n\n if (data.hasItemOption) {\n var itemModel = data.getItemModel(idx);\n var emphasisModel_1 = itemModel.getModel('emphasis');\n emphasisStyle = emphasisModel_1.getModel('itemStyle').getItemStyle();\n blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle(); // Each item value struct in the data would be firstly\n // {\n // itemStyle: { borderRadius: [30, 30] },\n // value: [2022, 02, 22]\n // }\n\n borderRadius = itemModel.get(['itemStyle', 'borderRadius']);\n focus = emphasisModel_1.get('focus');\n blurScope = emphasisModel_1.get('blurScope');\n emphasisDisabled = emphasisModel_1.get('disabled');\n labelStatesModels = getLabelStatesModels(itemModel);\n }\n\n rect.shape.r = borderRadius;\n var rawValue = seriesModel.getRawValue(idx);\n var defaultText = '-';\n\n if (rawValue && rawValue[2] != null) {\n defaultText = rawValue[2] + '';\n }\n\n setLabelStyle(rect, labelStatesModels, {\n labelFetcher: seriesModel,\n labelDataIndex: idx,\n defaultOpacity: style.opacity,\n defaultText: defaultText\n });\n rect.ensureState('emphasis').style = emphasisStyle;\n rect.ensureState('blur').style = blurStyle;\n rect.ensureState('select').style = selectStyle;\n toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);\n rect.incremental = incremental; // PENDING\n\n if (incremental) {\n // Rect must use hover layer if it's incremental.\n rect.states.emphasis.hoverLayer = true;\n }\n\n group.add(rect);\n data.setItemGraphicEl(idx, rect);\n\n if (this._progressiveEls) {\n this._progressiveEls.push(rect);\n }\n }\n };\n\n HeatmapView.prototype._renderOnGeo = function (geo, seriesModel, visualMapModel, api) {\n var inRangeVisuals = visualMapModel.targetVisuals.inRange;\n var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange; // if (!visualMapping) {\n // throw new Error('Data range must have color visuals');\n // }\n\n var data = seriesModel.getData();\n var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();\n hmLayer.blurSize = seriesModel.get('blurSize');\n hmLayer.pointSize = seriesModel.get('pointSize');\n hmLayer.minOpacity = seriesModel.get('minOpacity');\n hmLayer.maxOpacity = seriesModel.get('maxOpacity');\n var rect = geo.getViewRect().clone();\n var roamTransform = geo.getRoamTransform();\n rect.applyTransform(roamTransform); // Clamp on viewport\n\n var x = Math.max(rect.x, 0);\n var y = Math.max(rect.y, 0);\n var x2 = Math.min(rect.width + rect.x, api.getWidth());\n var y2 = Math.min(rect.height + rect.y, api.getHeight());\n var width = x2 - x;\n var height = y2 - y;\n var dims = [data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value')];\n var points = data.mapArray(dims, function (lng, lat, value) {\n var pt = geo.dataToPoint([lng, lat]);\n pt[0] -= x;\n pt[1] -= y;\n pt.push(value);\n return pt;\n });\n var dataExtent = visualMapModel.getExtent();\n var isInRange = visualMapModel.type === 'visualMap.continuous' ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);\n hmLayer.update(points, width, height, inRangeVisuals.color.getNormalizer(), {\n inRange: inRangeVisuals.color.getColorMapper(),\n outOfRange: outOfRangeVisuals.color.getColorMapper()\n }, isInRange);\n var img = new graphic.Image({\n style: {\n width: width,\n height: height,\n x: x,\n y: y,\n image: hmLayer.canvas\n },\n silent: true\n });\n this.group.add(img);\n };\n\n HeatmapView.type = 'heatmap';\n return HeatmapView;\n}(ChartView);\n\nexport default HeatmapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport createSeriesData from '../helper/createSeriesData.js';\nimport CoordinateSystem from '../../core/CoordinateSystem.js';\n\nvar HeatmapSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(HeatmapSeriesModel, _super);\n\n function HeatmapSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = HeatmapSeriesModel.type;\n return _this;\n }\n\n HeatmapSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this, {\n generateCoord: 'value'\n });\n };\n\n HeatmapSeriesModel.prototype.preventIncremental = function () {\n var coordSysCreator = CoordinateSystem.get(this.get('coordinateSystem'));\n\n if (coordSysCreator && coordSysCreator.dimensions) {\n return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat';\n }\n };\n\n HeatmapSeriesModel.type = 'series.heatmap';\n HeatmapSeriesModel.dependencies = ['grid', 'geo', 'calendar'];\n HeatmapSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Geo coordinate system\n geoIndex: 0,\n blurSize: 30,\n pointSize: 20,\n maxOpacity: 1,\n minOpacity: 0,\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n };\n return HeatmapSeriesModel;\n}(SeriesModel);\n\nexport default HeatmapSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport HeatmapView from './HeatmapView.js';\nimport HeatmapSeriesModel from './HeatmapSeries.js';\nexport function install(registers) {\n registers.registerChartView(HeatmapView);\n registers.registerSeriesModel(HeatmapSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, normalizeSymbolOffset } from '../../util/symbol.js';\nimport { parsePercent, isNumeric } from '../../util/number.js';\nimport ChartView from '../../view/Chart.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nvar BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'borderWidth']; // index: +isHorizontal\n\nvar LAYOUT_ATTRS = [{\n xy: 'x',\n wh: 'width',\n index: 0,\n posDesc: ['left', 'right']\n}, {\n xy: 'y',\n wh: 'height',\n index: 1,\n posDesc: ['top', 'bottom']\n}];\nvar pathForLineWidth = new graphic.Circle();\n\nvar PictorialBarView =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarView, _super);\n\n function PictorialBarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarView.type;\n return _this;\n }\n\n PictorialBarView.prototype.render = function (seriesModel, ecModel, api) {\n var group = this.group;\n var data = seriesModel.getData();\n var oldData = this._data;\n var cartesian = seriesModel.coordinateSystem;\n var baseAxis = cartesian.getBaseAxis();\n var isHorizontal = baseAxis.isHorizontal();\n var coordSysRect = cartesian.master.getRect();\n var opt = {\n ecSize: {\n width: api.getWidth(),\n height: api.getHeight()\n },\n seriesModel: seriesModel,\n coordSys: cartesian,\n coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],\n isHorizontal: isHorizontal,\n valueDim: LAYOUT_ATTRS[+isHorizontal],\n categoryDim: LAYOUT_ATTRS[1 - +isHorizontal]\n };\n data.diff(oldData).add(function (dataIndex) {\n if (!data.hasValue(dataIndex)) {\n return;\n }\n\n var itemModel = getItemModel(data, dataIndex);\n var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);\n var bar = createBar(data, opt, symbolMeta);\n data.setItemGraphicEl(dataIndex, bar);\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).update(function (newIndex, oldIndex) {\n var bar = oldData.getItemGraphicEl(oldIndex);\n\n if (!data.hasValue(newIndex)) {\n group.remove(bar);\n return;\n }\n\n var itemModel = getItemModel(data, newIndex);\n var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);\n var pictorialShapeStr = getShapeStr(data, symbolMeta);\n\n if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {\n group.remove(bar);\n data.setItemGraphicEl(newIndex, null);\n bar = null;\n }\n\n if (bar) {\n updateBar(bar, opt, symbolMeta);\n } else {\n bar = createBar(data, opt, symbolMeta, true);\n }\n\n data.setItemGraphicEl(newIndex, bar);\n bar.__pictorialSymbolMeta = symbolMeta; // Add back\n\n group.add(bar);\n updateCommon(bar, opt, symbolMeta);\n }).remove(function (dataIndex) {\n var bar = oldData.getItemGraphicEl(dataIndex);\n bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);\n }).execute();\n this._data = data;\n return this.group;\n };\n\n PictorialBarView.prototype.remove = function (ecModel, api) {\n var group = this.group;\n var data = this._data;\n\n if (ecModel.get('animation')) {\n if (data) {\n data.eachItemGraphicEl(function (bar) {\n removeBar(data, getECData(bar).dataIndex, ecModel, bar);\n });\n }\n } else {\n group.removeAll();\n }\n };\n\n PictorialBarView.type = 'pictorialBar';\n return PictorialBarView;\n}(ChartView); // Set or calculate default value about symbol, and calculate layout info.\n\n\nfunction getSymbolMeta(data, dataIndex, itemModel, opt) {\n var layout = data.getItemLayout(dataIndex);\n var symbolRepeat = itemModel.get('symbolRepeat');\n var symbolClip = itemModel.get('symbolClip');\n var symbolPosition = itemModel.get('symbolPosition') || 'start';\n var symbolRotate = itemModel.get('symbolRotate');\n var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n var symbolPatternSize = itemModel.get('symbolPatternSize') || 2;\n var isAnimationEnabled = itemModel.isAnimationEnabled();\n var symbolMeta = {\n dataIndex: dataIndex,\n layout: layout,\n itemModel: itemModel,\n symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle',\n style: data.getItemVisual(dataIndex, 'style'),\n symbolClip: symbolClip,\n symbolRepeat: symbolRepeat,\n symbolRepeatDirection: itemModel.get('symbolRepeatDirection'),\n symbolPatternSize: symbolPatternSize,\n rotation: rotation,\n animationModel: isAnimationEnabled ? itemModel : null,\n hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']),\n z2: itemModel.getShallow('z', true) || 0\n };\n prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta);\n prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);\n prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);\n var symbolSize = symbolMeta.symbolSize;\n var symbolOffset = normalizeSymbolOffset(itemModel.get('symbolOffset'), symbolSize);\n prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);\n return symbolMeta;\n} // bar length can be negative.\n\n\nfunction prepareBarLength(itemModel, symbolRepeat, layout, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();\n boundingLength = symbolBoundingExtent[pxSignIdx];\n } else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n } else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n } else {\n boundingLength = layout[valueDim.wh];\n }\n\n outputSymbolMeta.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n outputSymbolMeta.repeatCutLength = layout[valueDim.wh];\n } // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero\n // and when borderWidth be settled, the actual linewidth will be NaN\n\n\n outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1;\n}\n\nfunction convertToCoordOnAxis(axis, value) {\n return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));\n} // Support ['100%', '100%']\n\n\nfunction prepareSymbolSize(data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {\n var valueDim = opt.valueDim;\n var categoryDim = opt.categoryDim;\n var categorySize = Math.abs(layout[categoryDim.wh]);\n var symbolSize = data.getItemVisual(dataIndex, 'symbolSize');\n var parsedSymbolSize;\n\n if (zrUtil.isArray(symbolSize)) {\n parsedSymbolSize = symbolSize.slice();\n } else {\n if (symbolSize == null) {\n // will parse to number below\n parsedSymbolSize = ['100%', '100%'];\n } else {\n parsedSymbolSize = [symbolSize, symbolSize];\n }\n } // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is\n // to complicated to calculate real percent value if considering scaled lineWidth.\n // So the actual size will bigger than layout size if lineWidth is bigger than zero,\n // which can be tolerated in pictorial chart.\n\n\n parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);\n parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));\n outputSymbolMeta.symbolSize = parsedSymbolSize; // If x or y is less than zero, show reversed shape.\n\n var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize]; // Follow convention, 'right' and 'top' is the normal scale.\n\n symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;\n}\n\nfunction prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {\n // In symbols are drawn with scale, so do not need to care about the case that width\n // or height are too small. But symbol use strokeNoScale, where acture lineWidth should\n // be calculated.\n var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;\n\n if (valueLineWidth) {\n pathForLineWidth.attr({\n scaleX: symbolScale[0],\n scaleY: symbolScale[1],\n rotation: rotation\n });\n pathForLineWidth.updateTransform();\n valueLineWidth /= pathForLineWidth.getLineScale();\n valueLineWidth *= symbolScale[opt.valueDim.index];\n }\n\n outputSymbolMeta.valueLineWidth = valueLineWidth || 0;\n}\n\nfunction prepareLayoutInfo(itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {\n var categoryDim = opt.categoryDim;\n var valueDim = opt.valueDim;\n var pxSign = outputSymbolMeta.pxSign;\n var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);\n var pathLen = unitLength; // Note: rotation will not effect the layout of symbols, because user may\n // want symbols to rotate on its center, which should not be translated\n // when rotating.\n\n if (symbolRepeat) {\n var absBoundingLength = Math.abs(boundingLength);\n var symbolMargin = zrUtil.retrieve(itemModel.get('symbolMargin'), '15%') + '';\n var hasEndGap = false;\n\n if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) {\n hasEndGap = true;\n symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);\n }\n\n var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);\n var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0); // When symbol margin is less than 0, margin at both ends will be subtracted\n // to ensure that all of the symbols will not be overflow the given area.\n\n var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Both final repeatTimes and final symbolMarginNumeric area calculated based on\n // boundingLength.\n\n var repeatSpecified = isNumeric(symbolRepeat);\n var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); // Adjust calculate margin, to ensure each symbol is displayed\n // entirely in the given layout area.\n\n var mDiff = absBoundingLength - repeatTimes * unitLength;\n symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));\n uLenWithMargin = unitLength + symbolMarginNumeric * 2;\n endFix = hasEndGap ? 0 : symbolMarginNumeric * 2; // Update repeatTimes when not all symbol will be shown.\n\n if (!repeatSpecified && symbolRepeat !== 'fixed') {\n repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;\n }\n\n pathLen = repeatTimes * uLenWithMargin - endFix;\n outputSymbolMeta.repeatTimes = repeatTimes;\n outputSymbolMeta.symbolMargin = symbolMarginNumeric;\n }\n\n var sizeFix = pxSign * (pathLen / 2);\n var pathPosition = outputSymbolMeta.pathPosition = [];\n pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2;\n pathPosition[valueDim.index] = symbolPosition === 'start' ? sizeFix : symbolPosition === 'end' ? boundingLength - sizeFix : boundingLength / 2; // 'center'\n\n if (symbolOffset) {\n pathPosition[0] += symbolOffset[0];\n pathPosition[1] += symbolOffset[1];\n }\n\n var bundlePosition = outputSymbolMeta.bundlePosition = [];\n bundlePosition[categoryDim.index] = layout[categoryDim.xy];\n bundlePosition[valueDim.index] = layout[valueDim.xy];\n var barRectShape = outputSymbolMeta.barRectShape = zrUtil.extend({}, layout);\n barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));\n barRectShape[categoryDim.wh] = layout[categoryDim.wh];\n var clipShape = outputSymbolMeta.clipShape = {}; // Consider that symbol may be overflow layout rect.\n\n clipShape[categoryDim.xy] = -layout[categoryDim.xy];\n clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];\n clipShape[valueDim.xy] = 0;\n clipShape[valueDim.wh] = layout[valueDim.wh];\n}\n\nfunction createPath(symbolMeta) {\n var symbolPatternSize = symbolMeta.symbolPatternSize;\n var path = createSymbol( // Consider texture img, make a big size.\n symbolMeta.symbolType, -symbolPatternSize / 2, -symbolPatternSize / 2, symbolPatternSize, symbolPatternSize);\n path.attr({\n culling: true\n });\n path.type !== 'image' && path.setStyle({\n strokeNoScale: true\n });\n return path;\n}\n\nfunction createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var symbolSize = symbolMeta.symbolSize;\n var valueLineWidth = symbolMeta.valueLineWidth;\n var pathPosition = symbolMeta.pathPosition;\n var valueDim = opt.valueDim;\n var repeatTimes = symbolMeta.repeatTimes || 0;\n var index = 0;\n var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;\n eachPath(bar, function (path) {\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n\n if (index < repeatTimes) {\n updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate);\n } else {\n updateAttr(path, null, {\n scaleX: 0,\n scaleY: 0\n }, symbolMeta, isUpdate, function () {\n bundle.remove(path);\n });\n } // updateHoverAnimation(path, symbolMeta);\n\n\n index++;\n });\n\n for (; index < repeatTimes; index++) {\n var path = createPath(symbolMeta);\n path.__pictorialAnimationIndex = index;\n path.__pictorialRepeatTimes = repeatTimes;\n bundle.add(path);\n var target = makeTarget(index);\n updateAttr(path, {\n x: target.x,\n y: target.y,\n scaleX: 0,\n scaleY: 0\n }, {\n scaleX: target.scaleX,\n scaleY: target.scaleY,\n rotation: target.rotation\n }, symbolMeta, isUpdate);\n }\n\n function makeTarget(index) {\n var position = pathPosition.slice(); // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index\n // Otherwise: i = index;\n\n var pxSign = symbolMeta.pxSign;\n var i = index;\n\n if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) {\n i = repeatTimes - 1 - index;\n }\n\n position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];\n return {\n x: position[0],\n y: position[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n };\n }\n}\n\nfunction createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {\n var bundle = bar.__pictorialBundle;\n var mainPath = bar.__pictorialMainPath;\n\n if (!mainPath) {\n mainPath = bar.__pictorialMainPath = createPath(symbolMeta);\n bundle.add(mainPath);\n updateAttr(mainPath, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: 0,\n scaleY: 0,\n rotation: symbolMeta.rotation\n }, {\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1]\n }, symbolMeta, isUpdate);\n } else {\n updateAttr(mainPath, null, {\n x: symbolMeta.pathPosition[0],\n y: symbolMeta.pathPosition[1],\n scaleX: symbolMeta.symbolScale[0],\n scaleY: symbolMeta.symbolScale[1],\n rotation: symbolMeta.rotation\n }, symbolMeta, isUpdate);\n }\n} // bar rect is used for label.\n\n\nfunction createOrUpdateBarRect(bar, symbolMeta, isUpdate) {\n var rectShape = zrUtil.extend({}, symbolMeta.barRectShape);\n var barRect = bar.__pictorialBarRect;\n\n if (!barRect) {\n barRect = bar.__pictorialBarRect = new graphic.Rect({\n z2: 2,\n shape: rectShape,\n silent: true,\n style: {\n stroke: 'transparent',\n fill: 'transparent',\n lineWidth: 0\n }\n });\n barRect.disableMorphing = true;\n bar.add(barRect);\n } else {\n updateAttr(barRect, null, {\n shape: rectShape\n }, symbolMeta, isUpdate);\n }\n}\n\nfunction createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {\n // If not clip, symbol will be remove and rebuilt.\n if (symbolMeta.symbolClip) {\n var clipPath = bar.__pictorialClipPath;\n var clipShape = zrUtil.extend({}, symbolMeta.clipShape);\n var valueDim = opt.valueDim;\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n\n if (clipPath) {\n graphic.updateProps(clipPath, {\n shape: clipShape\n }, animationModel, dataIndex);\n } else {\n clipShape[valueDim.wh] = 0;\n clipPath = new graphic.Rect({\n shape: clipShape\n });\n\n bar.__pictorialBundle.setClipPath(clipPath);\n\n bar.__pictorialClipPath = clipPath;\n var target = {};\n target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];\n graphic[isUpdate ? 'updateProps' : 'initProps'](clipPath, {\n shape: target\n }, animationModel, dataIndex);\n }\n }\n}\n\nfunction getItemModel(data, dataIndex) {\n var itemModel = data.getItemModel(dataIndex);\n itemModel.getAnimationDelayParams = getAnimationDelayParams;\n itemModel.isAnimationEnabled = isAnimationEnabled;\n return itemModel;\n}\n\nfunction getAnimationDelayParams(path) {\n // The order is the same as the z-order, see `symbolRepeatDiretion`.\n return {\n index: path.__pictorialAnimationIndex,\n count: path.__pictorialRepeatTimes\n };\n}\n\nfunction isAnimationEnabled() {\n // `animation` prop can be set on itemModel in pictorial bar chart.\n return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation');\n}\n\nfunction createBar(data, opt, symbolMeta, isUpdate) {\n // bar is the main element for each data.\n var bar = new graphic.Group(); // bundle is used for location and clip.\n\n var bundle = new graphic.Group();\n bar.add(bundle);\n bar.__pictorialBundle = bundle;\n bundle.x = symbolMeta.bundlePosition[0];\n bundle.y = symbolMeta.bundlePosition[1];\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, isUpdate);\n createOrUpdateClip(bar, opt, symbolMeta, isUpdate);\n bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);\n bar.__pictorialSymbolMeta = symbolMeta;\n return bar;\n}\n\nfunction updateBar(bar, opt, symbolMeta) {\n var animationModel = symbolMeta.animationModel;\n var dataIndex = symbolMeta.dataIndex;\n var bundle = bar.__pictorialBundle;\n graphic.updateProps(bundle, {\n x: symbolMeta.bundlePosition[0],\n y: symbolMeta.bundlePosition[1]\n }, animationModel, dataIndex);\n\n if (symbolMeta.symbolRepeat) {\n createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);\n } else {\n createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);\n }\n\n createOrUpdateBarRect(bar, symbolMeta, true);\n createOrUpdateClip(bar, opt, symbolMeta, true);\n}\n\nfunction removeBar(data, dataIndex, animationModel, bar) {\n // Not show text when animating\n var labelRect = bar.__pictorialBarRect;\n labelRect && labelRect.removeTextContent();\n var paths = [];\n eachPath(bar, function (path) {\n paths.push(path);\n });\n bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath); // I do not find proper remove animation for clip yet.\n\n bar.__pictorialClipPath && (animationModel = null);\n zrUtil.each(paths, function (path) {\n graphic.removeElement(path, {\n scaleX: 0,\n scaleY: 0\n }, animationModel, dataIndex, function () {\n bar.parent && bar.parent.remove(bar);\n });\n });\n data.setItemGraphicEl(dataIndex, null);\n}\n\nfunction getShapeStr(data, symbolMeta) {\n return [data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(':');\n}\n\nfunction eachPath(bar, cb, context) {\n // Do not use Group#eachChild, because it do not support remove.\n zrUtil.each(bar.__pictorialBundle.children(), function (el) {\n el !== bar.__pictorialBarRect && cb.call(context, el);\n });\n}\n\nfunction updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {\n immediateAttrs && el.attr(immediateAttrs); // when symbolCip used, only clip path has init animation, otherwise it would be weird effect.\n\n if (symbolMeta.symbolClip && !isUpdate) {\n animationAttrs && el.attr(animationAttrs);\n } else {\n animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps'](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);\n }\n}\n\nfunction updateCommon(bar, opt, symbolMeta) {\n var dataIndex = symbolMeta.dataIndex;\n var itemModel = symbolMeta.itemModel; // Color must be excluded.\n // Because symbol provide setColor individually to set fill and stroke\n\n var emphasisModel = itemModel.getModel('emphasis');\n var emphasisStyle = emphasisModel.getModel('itemStyle').getItemStyle();\n var blurStyle = itemModel.getModel(['blur', 'itemStyle']).getItemStyle();\n var selectStyle = itemModel.getModel(['select', 'itemStyle']).getItemStyle();\n var cursorStyle = itemModel.getShallow('cursor');\n var focus = emphasisModel.get('focus');\n var blurScope = emphasisModel.get('blurScope');\n var hoverScale = emphasisModel.get('scale');\n eachPath(bar, function (path) {\n if (path instanceof ZRImage) {\n var pathStyle = path.style;\n path.useStyle(zrUtil.extend({\n // TODO other properties like dx, dy ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, symbolMeta.style));\n } else {\n path.useStyle(symbolMeta.style);\n }\n\n var emphasisState = path.ensureState('emphasis');\n emphasisState.style = emphasisStyle;\n\n if (hoverScale) {\n // NOTE: Must after scale is set after updateAttr\n emphasisState.scaleX = path.scaleX * 1.1;\n emphasisState.scaleY = path.scaleY * 1.1;\n }\n\n path.ensureState('blur').style = blurStyle;\n path.ensureState('select').style = selectStyle;\n cursorStyle && (path.cursor = cursorStyle);\n path.z2 = symbolMeta.z2;\n });\n var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];\n var barRect = bar.__pictorialBarRect;\n setLabelStyle(barRect, getLabelStatesModels(itemModel), {\n labelFetcher: opt.seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),\n inheritColor: symbolMeta.style.fill,\n defaultOpacity: symbolMeta.style.opacity,\n defaultOutsidePosition: barPositionOutside\n });\n toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get('disabled'));\n}\n\nfunction toIntTimes(times) {\n var roundedTimes = Math.round(times); // Escapse accurate error\n\n return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);\n}\n\nexport default PictorialBarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseBarSeriesModel from './BaseBarSeries.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar PictorialBarSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(PictorialBarSeriesModel, _super);\n\n function PictorialBarSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PictorialBarSeriesModel.type;\n _this.hasSymbolVisual = true;\n _this.defaultSymbol = 'roundRect';\n return _this;\n }\n\n PictorialBarSeriesModel.prototype.getInitialData = function (option) {\n // Disable stack.\n option.stack = null;\n return _super.prototype.getInitialData.apply(this, arguments);\n };\n\n PictorialBarSeriesModel.type = 'series.pictorialBar';\n PictorialBarSeriesModel.dependencies = ['grid'];\n PictorialBarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {\n symbol: 'circle',\n symbolSize: null,\n symbolRotate: null,\n symbolPosition: null,\n symbolOffset: null,\n symbolMargin: null,\n symbolRepeat: false,\n symbolRepeatDirection: 'end',\n symbolClip: false,\n symbolBoundingData: null,\n symbolPatternSize: 400,\n barGap: '-100%',\n // z can be set in data item, which is z2 actually.\n // Disable progressive\n progressive: 0,\n emphasis: {\n // By default pictorialBar do not hover scale. Hover scale is not suitable\n // for the case that both has foreground and background.\n scale: false\n },\n select: {\n itemStyle: {\n borderColor: '#212121'\n }\n }\n });\n return PictorialBarSeriesModel;\n}(BaseBarSeriesModel);\n\nexport default PictorialBarSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport PictorialBarView from './PictorialBarView.js';\nimport PictorialBarSeriesModel from './PictorialBarSeries.js';\nimport { createProgressiveLayout, layout } from '../../layout/barGrid.js';\nimport { curry } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerChartView(PictorialBarView);\n registers.registerSeriesModel(PictorialBarSeriesModel);\n registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry(layout, 'pictorialBar')); // Do layout after other overall layout, which can prepare some information.\n\n registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout('pictorialBar'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { ECPolygon } from '../line/poly.js';\nimport * as graphic from '../../util/graphic.js';\nimport { setStatesStylesFromModel, toggleHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { bind } from 'zrender/lib/core/util.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\n\nvar ThemeRiverView =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverView, _super);\n\n function ThemeRiverView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverView.type;\n _this._layers = [];\n return _this;\n }\n\n ThemeRiverView.prototype.render = function (seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var self = this;\n var group = this.group;\n var layersSeries = seriesModel.getLayerSeries();\n var layoutInfo = data.getLayout('layoutInfo');\n var rect = layoutInfo.rect;\n var boundaryGap = layoutInfo.boundaryGap;\n group.x = 0;\n group.y = rect.y + boundaryGap[0];\n\n function keyGetter(item) {\n return item.name;\n }\n\n var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);\n var newLayersGroups = [];\n dataDiffer.add(bind(process, this, 'add')).update(bind(process, this, 'update')).remove(bind(process, this, 'remove')).execute();\n\n function process(status, idx, oldIdx) {\n var oldLayersGroups = self._layers;\n\n if (status === 'remove') {\n group.remove(oldLayersGroups[idx]);\n return;\n }\n\n var points0 = [];\n var points1 = [];\n var style;\n var indices = layersSeries[idx].indices;\n var j = 0;\n\n for (; j < indices.length; j++) {\n var layout = data.getItemLayout(indices[j]);\n var x = layout.x;\n var y0 = layout.y0;\n var y = layout.y;\n points0.push(x, y0);\n points1.push(x, y0 + y);\n style = data.getItemVisual(indices[j], 'style');\n }\n\n var polygon;\n var textLayout = data.getItemLayout(indices[0]);\n var labelModel = seriesModel.getModel('label');\n var margin = labelModel.get('margin');\n var emphasisModel = seriesModel.getModel('emphasis');\n\n if (status === 'add') {\n var layerGroup = newLayersGroups[idx] = new graphic.Group();\n polygon = new ECPolygon({\n shape: {\n points: points0,\n stackedOnPoints: points1,\n smooth: 0.4,\n stackedOnSmooth: 0.4,\n smoothConstraint: false\n },\n z2: 0\n });\n layerGroup.add(polygon);\n group.add(layerGroup);\n\n if (seriesModel.isAnimationEnabled()) {\n polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function () {\n polygon.removeClipPath();\n }));\n }\n } else {\n var layerGroup = oldLayersGroups[oldIdx];\n polygon = layerGroup.childAt(0);\n group.add(layerGroup);\n newLayersGroups[idx] = layerGroup;\n graphic.updateProps(polygon, {\n shape: {\n points: points0,\n stackedOnPoints: points1\n }\n }, seriesModel);\n saveOldStyle(polygon);\n }\n\n setLabelStyle(polygon, getLabelStatesModels(seriesModel), {\n labelDataIndex: indices[j - 1],\n defaultText: data.getName(indices[j - 1]),\n inheritColor: style.fill\n }, {\n normal: {\n verticalAlign: 'middle' // align: 'right'\n\n }\n });\n polygon.setTextConfig({\n position: null,\n local: true\n });\n var labelEl = polygon.getTextContent(); // TODO More label position options.\n\n if (labelEl) {\n labelEl.x = textLayout.x - margin;\n labelEl.y = textLayout.y0 + textLayout.y / 2;\n }\n\n polygon.useStyle(style);\n data.setItemGraphicEl(idx, polygon);\n setStatesStylesFromModel(polygon, seriesModel);\n toggleHoverEmphasis(polygon, emphasisModel.get('focus'), emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n }\n\n this._layersSeries = layersSeries;\n this._layers = newLayersGroups;\n };\n\n ThemeRiverView.type = 'themeRiver';\n return ThemeRiverView;\n}(ChartView);\n\n; // add animation to the view\n\nfunction createGridClipShape(rect, seriesModel, cb) {\n var rectEl = new graphic.Rect({\n shape: {\n x: rect.x - 10,\n y: rect.y - 10,\n width: 0,\n height: rect.height + 20\n }\n });\n graphic.initProps(rectEl, {\n shape: {\n x: rect.x - 50,\n width: rect.width + 100,\n height: rect.height + 20\n }\n }, seriesModel, cb);\n return rectEl;\n}\n\nexport default ThemeRiverView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesModel from '../../model/Series.js';\nimport prepareSeriesDataSchema from '../../data/helper/createDimensions.js';\nimport { getDimensionTypeByAxis } from '../../data/helper/dimensionHelper.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { groupData, SINGLE_REFERRING } from '../../util/model.js';\nimport LegendVisualProvider from '../../visual/LegendVisualProvider.js';\nimport { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup.js';\nvar DATA_NAME_INDEX = 2;\n\nvar ThemeRiverSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(ThemeRiverSeriesModel, _super);\n\n function ThemeRiverSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ThemeRiverSeriesModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n ThemeRiverSeriesModel.prototype.init = function (option) {\n // eslint-disable-next-line\n _super.prototype.init.apply(this, arguments); // Put this function here is for the sake of consistency of code style.\n // Enable legend selection for each data item\n // Use a function instead of direct access because data reference may changed\n\n\n this.legendVisualProvider = new LegendVisualProvider(zrUtil.bind(this.getData, this), zrUtil.bind(this.getRawData, this));\n };\n /**\r\n * If there is no value of a certain point in the time for some event,set it value to 0.\r\n *\r\n * @param {Array} data initial data in the option\r\n * @return {Array}\r\n */\n\n\n ThemeRiverSeriesModel.prototype.fixData = function (data) {\n var rawDataLength = data.length;\n /**\r\n * Make sure every layer data get the same keys.\r\n * The value index tells which layer has visited.\r\n * {\r\n * 2014/01/01: -1\r\n * }\r\n */\n\n var timeValueKeys = {}; // grouped data by name\n\n var groupResult = groupData(data, function (item) {\n if (!timeValueKeys.hasOwnProperty(item[0] + '')) {\n timeValueKeys[item[0] + ''] = -1;\n }\n\n return item[2];\n });\n var layerData = [];\n groupResult.buckets.each(function (items, key) {\n layerData.push({\n name: key,\n dataList: items\n });\n });\n var layerNum = layerData.length;\n\n for (var k = 0; k < layerNum; ++k) {\n var name_1 = layerData[k].name;\n\n for (var j = 0; j < layerData[k].dataList.length; ++j) {\n var timeValue = layerData[k].dataList[j][0] + '';\n timeValueKeys[timeValue] = k;\n }\n\n for (var timeValue in timeValueKeys) {\n if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k) {\n timeValueKeys[timeValue] = k;\n data[rawDataLength] = [timeValue, 0, name_1];\n rawDataLength++;\n }\n }\n }\n\n return data;\n };\n /**\r\n * @override\r\n * @param option the initial option that user gave\r\n * @param ecModel the model object for themeRiver option\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getInitialData = function (option, ecModel) {\n var singleAxisModel = this.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n var axisType = singleAxisModel.get('type'); // filter the data item with the value of label is undefined\n\n var filterData = zrUtil.filter(option.data, function (dataItem) {\n return dataItem[2] !== undefined;\n }); // ??? TODO design a stage to transfer data for themeRiver and lines?\n\n var data = this.fixData(filterData || []);\n var nameList = [];\n var nameMap = this.nameMap = zrUtil.createHashMap();\n var count = 0;\n\n for (var i = 0; i < data.length; ++i) {\n nameList.push(data[i][DATA_NAME_INDEX]);\n\n if (!nameMap.get(data[i][DATA_NAME_INDEX])) {\n nameMap.set(data[i][DATA_NAME_INDEX], count);\n count++;\n }\n }\n\n var dimensions = prepareSeriesDataSchema(data, {\n coordDimensions: ['single'],\n dimensionsDefine: [{\n name: 'time',\n type: getDimensionTypeByAxis(axisType)\n }, {\n name: 'value',\n type: 'float'\n }, {\n name: 'name',\n type: 'ordinal'\n }],\n encodeDefine: {\n single: 0,\n value: 1,\n itemName: 2\n }\n }).dimensions;\n var list = new SeriesData(dimensions, this);\n list.initData(data);\n return list;\n };\n /**\r\n * The raw data is divided into multiple layers and each layer\r\n * has same name.\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getLayerSeries = function () {\n var data = this.getData();\n var lenCount = data.count();\n var indexArr = [];\n\n for (var i = 0; i < lenCount; ++i) {\n indexArr[i] = i;\n }\n\n var timeDim = data.mapDimension('single'); // data group by name\n\n var groupResult = groupData(indexArr, function (index) {\n return data.get('name', index);\n });\n var layerSeries = [];\n groupResult.buckets.each(function (items, key) {\n items.sort(function (index1, index2) {\n return data.get(timeDim, index1) - data.get(timeDim, index2);\n });\n layerSeries.push({\n name: key,\n indices: items\n });\n });\n return layerSeries;\n };\n /**\r\n * Get data indices for show tooltip content\r\n */\n\n\n ThemeRiverSeriesModel.prototype.getAxisTooltipData = function (dim, value, baseAxis) {\n if (!zrUtil.isArray(dim)) {\n dim = dim ? [dim] : [];\n }\n\n var data = this.getData();\n var layerSeries = this.getLayerSeries();\n var indices = [];\n var layerNum = layerSeries.length;\n var nestestValue;\n\n for (var i = 0; i < layerNum; ++i) {\n var minDist = Number.MAX_VALUE;\n var nearestIdx = -1;\n var pointNum = layerSeries[i].indices.length;\n\n for (var j = 0; j < pointNum; ++j) {\n var theValue = data.get(dim[0], layerSeries[i].indices[j]);\n var dist = Math.abs(theValue - value);\n\n if (dist <= minDist) {\n nestestValue = theValue;\n minDist = dist;\n nearestIdx = layerSeries[i].indices[j];\n }\n }\n\n indices.push(nearestIdx);\n }\n\n return {\n dataIndices: indices,\n nestestValue: nestestValue\n };\n };\n\n ThemeRiverSeriesModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var name = data.getName(dataIndex);\n var value = data.get(data.mapDimension('value'), dataIndex);\n return createTooltipMarkup('nameValue', {\n name: name,\n value: value\n });\n };\n\n ThemeRiverSeriesModel.type = 'series.themeRiver';\n ThemeRiverSeriesModel.dependencies = ['singleAxis'];\n ThemeRiverSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n colorBy: 'data',\n coordinateSystem: 'singleAxis',\n // gap in axis's orthogonal orientation\n boundaryGap: ['10%', '10%'],\n // legendHoverLink: true,\n singleAxisIndex: 0,\n animationEasing: 'linear',\n label: {\n margin: 4,\n show: true,\n position: 'left',\n fontSize: 11\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return ThemeRiverSeriesModel;\n}(SeriesModel);\n\nexport default ThemeRiverSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nexport default function themeRiverLayout(ecModel, api) {\n ecModel.eachSeriesByType('themeRiver', function (seriesModel) {\n var data = seriesModel.getData();\n var single = seriesModel.coordinateSystem;\n var layoutInfo = {}; // use the axis boundingRect for view\n\n var rect = single.getRect();\n layoutInfo.rect = rect;\n var boundaryGap = seriesModel.get('boundaryGap');\n var axis = single.getAxis();\n layoutInfo.boundaryGap = boundaryGap;\n\n if (axis.orient === 'horizontal') {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);\n var height = rect.height - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, height);\n } else {\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);\n var width = rect.width - boundaryGap[0] - boundaryGap[1];\n doThemeRiverLayout(data, seriesModel, width);\n }\n\n data.setLayout('layoutInfo', layoutInfo);\n });\n}\n/**\r\n * The layout information about themeriver\r\n *\r\n * @param data data in the series\r\n * @param seriesModel the model object of themeRiver series\r\n * @param height value used to compute every series height\r\n */\n\nfunction doThemeRiverLayout(data, seriesModel, height) {\n if (!data.count()) {\n return;\n }\n\n var coordSys = seriesModel.coordinateSystem; // the data in each layer are organized into a series.\n\n var layerSeries = seriesModel.getLayerSeries(); // the points in each layer.\n\n var timeDim = data.mapDimension('single');\n var valueDim = data.mapDimension('value');\n var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {\n return zrUtil.map(singleLayer.indices, function (idx) {\n var pt = coordSys.dataToPoint(data.get(timeDim, idx));\n pt[1] = data.get(valueDim, idx);\n return pt;\n });\n });\n var base = computeBaseline(layerPoints);\n var baseLine = base.y0;\n var ky = height / base.max; // set layout information for each item.\n\n var n = layerSeries.length;\n var m = layerSeries[0].indices.length;\n var baseY0;\n\n for (var j = 0; j < m; ++j) {\n baseY0 = baseLine[j] * ky;\n data.setItemLayout(layerSeries[0].indices[j], {\n layerIndex: 0,\n x: layerPoints[0][j][0],\n y0: baseY0,\n y: layerPoints[0][j][1] * ky\n });\n\n for (var i = 1; i < n; ++i) {\n baseY0 += layerPoints[i - 1][j][1] * ky;\n data.setItemLayout(layerSeries[i].indices[j], {\n layerIndex: i,\n x: layerPoints[i][j][0],\n y0: baseY0,\n y: layerPoints[i][j][1] * ky\n });\n }\n }\n}\n/**\r\n * Compute the baseLine of the rawdata\r\n * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics\r\n *\r\n * @param data the points in each layer\r\n */\n\n\nfunction computeBaseline(data) {\n var layerNum = data.length;\n var pointNum = data[0].length;\n var sums = [];\n var y0 = [];\n var max = 0;\n\n for (var i = 0; i < pointNum; ++i) {\n var temp = 0;\n\n for (var j = 0; j < layerNum; ++j) {\n temp += data[j][i][1];\n }\n\n if (temp > max) {\n max = temp;\n }\n\n sums.push(temp);\n }\n\n for (var k = 0; k < pointNum; ++k) {\n y0[k] = (max - sums[k]) / 2;\n }\n\n max = 0;\n\n for (var l = 0; l < pointNum; ++l) {\n var sum = sums[l] + y0[l];\n\n if (sum > max) {\n max = sum;\n }\n }\n\n return {\n y0: y0,\n max: max\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport ThemeRiverView from './ThemeRiverView.js';\nimport ThemeRiverSeriesModel from './ThemeRiverSeries.js';\nimport themeRiverLayout from './themeRiverLayout.js';\nimport dataFilter from '../../processor/dataFilter.js';\nexport function install(registers) {\n registers.registerChartView(ThemeRiverView);\n registers.registerSeriesModel(ThemeRiverSeriesModel);\n registers.registerLayout(themeRiverLayout);\n registers.registerProcessor(dataFilter('themeRiver'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, SPECIAL_STATES, DISPLAY_STATES } from '../../util/states.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getSectorCornerRadius } from '../helper/sectorHelper.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { saveOldStyle } from '../../animation/basicTransition.js';\nimport { normalizeRadian } from 'zrender/lib/contain/util.js';\nvar DEFAULT_SECTOR_Z = 2;\nvar DEFAULT_TEXT_Z = 4;\n/**\r\n * Sunburstce of Sunburst including Sector, Label, LabelLine\r\n */\n\nvar SunburstPiece =\n/** @class */\nfunction (_super) {\n __extends(SunburstPiece, _super);\n\n function SunburstPiece(node, seriesModel, ecModel, api) {\n var _this = _super.call(this) || this;\n\n _this.z2 = DEFAULT_SECTOR_Z;\n _this.textConfig = {\n inside: true\n };\n getECData(_this).seriesIndex = seriesModel.seriesIndex;\n var text = new graphic.Text({\n z2: DEFAULT_TEXT_Z,\n silent: node.getModel().get(['label', 'silent'])\n });\n\n _this.setTextContent(text);\n\n _this.updateData(true, node, seriesModel, ecModel, api);\n\n return _this;\n }\n\n SunburstPiece.prototype.updateData = function (firstCreate, node, // state: 'emphasis' | 'normal' | 'highlight' | 'downplay',\n seriesModel, ecModel, api) {\n this.node = node;\n node.piece = this;\n seriesModel = seriesModel || this._seriesModel;\n ecModel = ecModel || this._ecModel;\n var sector = this;\n getECData(sector).dataIndex = node.dataIndex;\n var itemModel = node.getModel();\n var emphasisModel = itemModel.getModel('emphasis');\n var layout = node.getLayout();\n var sectorShape = zrUtil.extend({}, layout);\n sectorShape.label = null;\n var normalStyle = node.getVisual('style');\n normalStyle.lineJoin = 'bevel';\n var decal = node.getVisual('decal');\n\n if (decal) {\n normalStyle.decal = createOrUpdatePatternFromDecal(decal, api);\n }\n\n var cornerRadius = getSectorCornerRadius(itemModel.getModel('itemStyle'), sectorShape, true);\n zrUtil.extend(sectorShape, cornerRadius);\n zrUtil.each(SPECIAL_STATES, function (stateName) {\n var state = sector.ensureState(stateName);\n var itemStyleModel = itemModel.getModel([stateName, 'itemStyle']);\n state.style = itemStyleModel.getItemStyle(); // border radius\n\n var cornerRadius = getSectorCornerRadius(itemStyleModel, sectorShape);\n\n if (cornerRadius) {\n state.shape = cornerRadius;\n }\n });\n\n if (firstCreate) {\n sector.setShape(sectorShape);\n sector.shape.r = layout.r0;\n graphic.initProps(sector, {\n shape: {\n r: layout.r\n }\n }, seriesModel, node.dataIndex);\n } else {\n // Disable animation for gradient since no interpolation method\n // is supported for gradient\n graphic.updateProps(sector, {\n shape: sectorShape\n }, seriesModel);\n saveOldStyle(sector);\n }\n\n sector.useStyle(normalStyle);\n\n this._updateLabel(seriesModel);\n\n var cursorStyle = itemModel.getShallow('cursor');\n cursorStyle && sector.attr('cursor', cursorStyle);\n this._seriesModel = seriesModel || this._seriesModel;\n this._ecModel = ecModel || this._ecModel;\n var focus = emphasisModel.get('focus');\n var focusOrIndices = focus === 'ancestor' ? node.getAncestorsIndices() : focus === 'descendant' ? node.getDescendantIndices() : focus;\n toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get('blurScope'), emphasisModel.get('disabled'));\n };\n\n SunburstPiece.prototype._updateLabel = function (seriesModel) {\n var _this = this;\n\n var itemModel = this.node.getModel();\n var normalLabelModel = itemModel.getModel('label');\n var layout = this.node.getLayout();\n var angle = layout.endAngle - layout.startAngle;\n var midAngle = (layout.startAngle + layout.endAngle) / 2;\n var dx = Math.cos(midAngle);\n var dy = Math.sin(midAngle);\n var sector = this;\n var label = sector.getTextContent();\n var dataIndex = this.node.dataIndex;\n var labelMinAngle = normalLabelModel.get('minAngle') / 180 * Math.PI;\n var isNormalShown = normalLabelModel.get('show') && !(labelMinAngle != null && Math.abs(angle) < labelMinAngle);\n label.ignore = !isNormalShown; // TODO use setLabelStyle\n\n zrUtil.each(DISPLAY_STATES, function (stateName) {\n var labelStateModel = stateName === 'normal' ? itemModel.getModel('label') : itemModel.getModel([stateName, 'label']);\n var isNormal = stateName === 'normal';\n var state = isNormal ? label : label.ensureState(stateName);\n var text = seriesModel.getFormattedLabel(dataIndex, stateName);\n\n if (isNormal) {\n text = text || _this.node.name;\n }\n\n state.style = createTextStyle(labelStateModel, {}, null, stateName !== 'normal', true);\n\n if (text) {\n state.style.text = text;\n } // Not displaying text when angle is too small\n\n\n var isShown = labelStateModel.get('show');\n\n if (isShown != null && !isNormal) {\n state.ignore = !isShown;\n }\n\n var labelPosition = getLabelAttr(labelStateModel, 'position');\n var sectorState = isNormal ? sector : sector.states[stateName];\n var labelColor = sectorState.style.fill;\n sectorState.textConfig = {\n outsideFill: labelStateModel.get('color') === 'inherit' ? labelColor : null,\n inside: labelPosition !== 'outside'\n };\n var r;\n var labelPadding = getLabelAttr(labelStateModel, 'distance') || 0;\n var textAlign = getLabelAttr(labelStateModel, 'align');\n\n if (labelPosition === 'outside') {\n r = layout.r + labelPadding;\n textAlign = midAngle > Math.PI / 2 ? 'right' : 'left';\n } else {\n if (!textAlign || textAlign === 'center') {\n // Put label in the center if it's a circle\n if (angle === 2 * Math.PI && layout.r0 === 0) {\n r = 0;\n } else {\n r = (layout.r + layout.r0) / 2;\n }\n\n textAlign = 'center';\n } else if (textAlign === 'left') {\n r = layout.r0 + labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'right';\n }\n } else if (textAlign === 'right') {\n r = layout.r - labelPadding;\n\n if (midAngle > Math.PI / 2) {\n textAlign = 'left';\n }\n }\n }\n\n state.style.align = textAlign;\n state.style.verticalAlign = getLabelAttr(labelStateModel, 'verticalAlign') || 'middle';\n state.x = r * dx + layout.cx;\n state.y = r * dy + layout.cy;\n var rotateType = getLabelAttr(labelStateModel, 'rotate');\n var rotate = 0;\n\n if (rotateType === 'radial') {\n rotate = normalizeRadian(-midAngle);\n\n if (rotate > Math.PI / 2 && rotate < Math.PI * 1.5) {\n rotate += Math.PI;\n }\n } else if (rotateType === 'tangential') {\n rotate = Math.PI / 2 - midAngle;\n\n if (rotate > Math.PI / 2) {\n rotate -= Math.PI;\n } else if (rotate < -Math.PI / 2) {\n rotate += Math.PI;\n }\n } else if (zrUtil.isNumber(rotateType)) {\n rotate = rotateType * Math.PI / 180;\n }\n\n state.rotation = normalizeRadian(rotate);\n });\n\n function getLabelAttr(model, name) {\n var stateAttr = model.get(name);\n\n if (stateAttr == null) {\n return normalLabelModel.get(name);\n }\n\n return stateAttr;\n }\n\n label.dirtyStyle();\n };\n\n return SunburstPiece;\n}(graphic.Sector);\n\nexport default SunburstPiece;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { extend } from 'zrender/lib/core/util.js';\nimport { deprecateReplaceLog } from '../../util/log.js';\nimport { retrieveTargetInfo, aboveViewRoot } from '../helper/treeHelper.js';\nexport var ROOT_TO_NODE_ACTION = 'sunburstRootToNode';\nvar HIGHLIGHT_ACTION = 'sunburstHighlight';\nvar UNHIGHLIGHT_ACTION = 'sunburstUnhighlight';\nexport function installSunburstAction(registers) {\n registers.registerAction({\n type: ROOT_TO_NODE_ACTION,\n update: 'updateView'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleRootToNode);\n\n function handleRootToNode(model, index) {\n var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);\n\n if (targetInfo) {\n var originViewRoot = model.getViewRoot();\n\n if (originViewRoot) {\n payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? 'rollUp' : 'drillDown';\n }\n\n model.resetViewRoot(targetInfo.node);\n }\n }\n });\n registers.registerAction({\n type: HIGHLIGHT_ACTION,\n update: 'none'\n }, function (payload, ecModel, api) {\n // Clone\n payload = extend({}, payload);\n ecModel.eachComponent({\n mainType: 'series',\n subType: 'sunburst',\n query: payload\n }, handleHighlight);\n\n function handleHighlight(model) {\n var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);\n\n if (targetInfo) {\n payload.dataIndex = targetInfo.node.dataIndex;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstHighlight', 'highlight');\n } // Fast forward action\n\n\n api.dispatchAction(extend(payload, {\n type: 'highlight'\n }));\n });\n registers.registerAction({\n type: UNHIGHLIGHT_ACTION,\n update: 'updateView'\n }, function (payload, ecModel, api) {\n payload = extend({}, payload);\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateReplaceLog('sunburstUnhighlight', 'downplay');\n }\n\n api.dispatchAction(extend(payload, {\n type: 'downplay'\n }));\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ChartView from '../../view/Chart.js';\nimport SunburstPiece from './SunburstPiece.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport { ROOT_TO_NODE_ACTION } from './sunburstAction.js';\nimport { windowOpen } from '../../util/format.js';\n\nvar SunburstView =\n/** @class */\nfunction (_super) {\n __extends(SunburstView, _super);\n\n function SunburstView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstView.type;\n return _this;\n }\n\n SunburstView.prototype.render = function (seriesModel, ecModel, api, // @ts-ignore\n payload) {\n var self = this;\n this.seriesModel = seriesModel;\n this.api = api;\n this.ecModel = ecModel;\n var data = seriesModel.getData();\n var virtualRoot = data.tree.root;\n var newRoot = seriesModel.getViewRoot();\n var group = this.group;\n var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData');\n var newChildren = [];\n newRoot.eachNode(function (node) {\n newChildren.push(node);\n });\n var oldChildren = this._oldChildren || [];\n dualTravel(newChildren, oldChildren);\n renderRollUp(virtualRoot, newRoot);\n\n this._initEvents();\n\n this._oldChildren = newChildren;\n\n function dualTravel(newChildren, oldChildren) {\n if (newChildren.length === 0 && oldChildren.length === 0) {\n return;\n }\n\n new DataDiffer(oldChildren, newChildren, getKey, getKey).add(processNode).update(processNode).remove(zrUtil.curry(processNode, null)).execute();\n\n function getKey(node) {\n return node.getId();\n }\n\n function processNode(newIdx, oldIdx) {\n var newNode = newIdx == null ? null : newChildren[newIdx];\n var oldNode = oldIdx == null ? null : oldChildren[oldIdx];\n doRenderNode(newNode, oldNode);\n }\n }\n\n function doRenderNode(newNode, oldNode) {\n if (!renderLabelForZeroData && newNode && !newNode.getValue()) {\n // Not render data with value 0\n newNode = null;\n }\n\n if (newNode !== virtualRoot && oldNode !== virtualRoot) {\n if (oldNode && oldNode.piece) {\n if (newNode) {\n // Update\n oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);\n } else {\n // Remove\n removeNode(oldNode);\n }\n } else if (newNode) {\n // Add\n var piece = new SunburstPiece(newNode, seriesModel, ecModel, api);\n group.add(piece); // For tooltip\n\n data.setItemGraphicEl(newNode.dataIndex, piece);\n }\n }\n }\n\n function removeNode(node) {\n if (!node) {\n return;\n }\n\n if (node.piece) {\n group.remove(node.piece);\n node.piece = null;\n }\n }\n\n function renderRollUp(virtualRoot, viewRoot) {\n if (viewRoot.depth > 0) {\n // Render\n if (self.virtualPiece) {\n // Update\n self.virtualPiece.updateData(false, virtualRoot, seriesModel, ecModel, api);\n } else {\n // Add\n self.virtualPiece = new SunburstPiece(virtualRoot, seriesModel, ecModel, api);\n group.add(self.virtualPiece);\n } // TODO event scope\n\n\n viewRoot.piece.off('click');\n self.virtualPiece.on('click', function (e) {\n self._rootToNode(viewRoot.parentNode);\n });\n } else if (self.virtualPiece) {\n // Remove\n group.remove(self.virtualPiece);\n self.virtualPiece = null;\n }\n }\n };\n /**\r\n * @private\r\n */\n\n\n SunburstView.prototype._initEvents = function () {\n var _this = this;\n\n this.group.off('click');\n this.group.on('click', function (e) {\n var targetFound = false;\n\n var viewRoot = _this.seriesModel.getViewRoot();\n\n viewRoot.eachNode(function (node) {\n if (!targetFound && node.piece && node.piece === e.target) {\n var nodeClick = node.getModel().get('nodeClick');\n\n if (nodeClick === 'rootToNode') {\n _this._rootToNode(node);\n } else if (nodeClick === 'link') {\n var itemModel = node.getModel();\n var link = itemModel.get('link');\n\n if (link) {\n var linkTarget = itemModel.get('target', true) || '_blank';\n windowOpen(link, linkTarget);\n }\n }\n\n targetFound = true;\n }\n });\n });\n };\n /**\r\n * @private\r\n */\n\n\n SunburstView.prototype._rootToNode = function (node) {\n if (node !== this.seriesModel.getViewRoot()) {\n this.api.dispatchAction({\n type: ROOT_TO_NODE_ACTION,\n from: this.uid,\n seriesId: this.seriesModel.id,\n targetNode: node\n });\n }\n };\n /**\r\n * @implement\r\n */\n\n\n SunburstView.prototype.containPoint = function (point, seriesModel) {\n var treeRoot = seriesModel.getData();\n var itemLayout = treeRoot.getItemLayout(0);\n\n if (itemLayout) {\n var dx = point[0] - itemLayout.cx;\n var dy = point[1] - itemLayout.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n return radius <= itemLayout.r && radius >= itemLayout.r0;\n }\n };\n\n SunburstView.type = 'sunburst';\n return SunburstView;\n}(ChartView);\n\nexport default SunburstView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport SeriesModel from '../../model/Series.js';\nimport Tree from '../../data/Tree.js';\nimport { wrapTreePathInfo } from '../helper/treeHelper.js';\nimport Model from '../../model/Model.js';\nimport enableAriaDecalForTree from '../helper/enableAriaDecalForTree.js';\n\nvar SunburstSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(SunburstSeriesModel, _super);\n\n function SunburstSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SunburstSeriesModel.type;\n _this.ignoreStyleOnData = true;\n return _this;\n }\n\n SunburstSeriesModel.prototype.getInitialData = function (option, ecModel) {\n // Create a virtual root.\n var root = {\n name: option.name,\n children: option.data\n };\n completeTreeValue(root);\n var levelModels = this._levelModels = zrUtil.map(option.levels || [], function (levelDefine) {\n return new Model(levelDefine, this, ecModel);\n }, this); // Make sure always a new tree is created when setOption,\n // in TreemapView, we check whether oldTree === newTree\n // to choose mappings approach among old shapes and new shapes.\n\n var tree = Tree.createTree(root, this, beforeLink);\n\n function beforeLink(nodeData) {\n nodeData.wrapMethod('getItemModel', function (model, idx) {\n var node = tree.getNodeByDataIndex(idx);\n var levelModel = levelModels[node.depth];\n levelModel && (model.parentModel = levelModel);\n return model;\n });\n }\n\n return tree.data;\n };\n\n SunburstSeriesModel.prototype.optionUpdated = function () {\n this.resetViewRoot();\n };\n /*\r\n * @override\r\n */\n\n\n SunburstSeriesModel.prototype.getDataParams = function (dataIndex) {\n var params = _super.prototype.getDataParams.apply(this, arguments);\n\n var node = this.getData().tree.getNodeByDataIndex(dataIndex);\n params.treePathInfo = wrapTreePathInfo(node, this);\n return params;\n };\n\n SunburstSeriesModel.prototype.getLevelModel = function (node) {\n return this._levelModels && this._levelModels[node.depth];\n };\n\n SunburstSeriesModel.prototype.getViewRoot = function () {\n return this._viewRoot;\n };\n\n SunburstSeriesModel.prototype.resetViewRoot = function (viewRoot) {\n viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;\n var root = this.getRawData().tree.root;\n\n if (!viewRoot || viewRoot !== root && !root.contains(viewRoot)) {\n this._viewRoot = root;\n }\n };\n\n SunburstSeriesModel.prototype.enableAriaDecal = function () {\n enableAriaDecalForTree(this);\n };\n\n SunburstSeriesModel.type = 'series.sunburst';\n SunburstSeriesModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n // 默认全局居中\n center: ['50%', '50%'],\n radius: [0, '75%'],\n // 默认顺时针\n clockwise: true,\n startAngle: 90,\n // 最小角度改为0\n minAngle: 0,\n // If still show when all data zero.\n stillShowZeroSum: true,\n // 'rootToNode', 'link', or false\n nodeClick: 'rootToNode',\n renderLabelForZeroData: false,\n label: {\n // could be: 'radial', 'tangential', or 'none'\n rotate: 'radial',\n show: true,\n opacity: 1,\n // 'left' is for inner side of inside, and 'right' is for outer\n // side for inside\n align: 'center',\n position: 'inside',\n distance: 5,\n silent: true\n },\n itemStyle: {\n borderWidth: 1,\n borderColor: 'white',\n borderType: 'solid',\n shadowBlur: 0,\n shadowColor: 'rgba(0, 0, 0, 0.2)',\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n opacity: 1\n },\n emphasis: {\n focus: 'descendant'\n },\n blur: {\n itemStyle: {\n opacity: 0.2\n },\n label: {\n opacity: 0.1\n }\n },\n // Animation type can be expansion, scale.\n animationType: 'expansion',\n animationDuration: 1000,\n animationDurationUpdate: 500,\n data: [],\n\n /**\r\n * Sort order.\r\n *\r\n * Valid values: 'desc', 'asc', null, or callback function.\r\n * 'desc' and 'asc' for descend and ascendant order;\r\n * null for not sorting;\r\n * example of callback function:\r\n * function(nodeA, nodeB) {\r\n * return nodeA.getValue() - nodeB.getValue();\r\n * }\r\n */\n sort: 'desc'\n };\n return SunburstSeriesModel;\n}(SeriesModel);\n\nfunction completeTreeValue(dataNode) {\n // Postorder travel tree.\n // If value of none-leaf node is not set,\n // calculate it by suming up the value of all children.\n var sum = 0;\n zrUtil.each(dataNode.children, function (child) {\n completeTreeValue(child);\n var childValue = child.value; // TODO First value of array must be a number\n\n zrUtil.isArray(childValue) && (childValue = childValue[0]);\n sum += childValue;\n });\n var thisValue = dataNode.value;\n\n if (zrUtil.isArray(thisValue)) {\n thisValue = thisValue[0];\n }\n\n if (thisValue == null || isNaN(thisValue)) {\n thisValue = sum;\n } // Value should not less than 0.\n\n\n if (thisValue < 0) {\n thisValue = 0;\n }\n\n zrUtil.isArray(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;\n}\n\nexport default SunburstSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parsePercent } from '../../util/number.js';\nimport * as zrUtil from 'zrender/lib/core/util.js'; // let PI2 = Math.PI * 2;\n\nvar RADIAN = Math.PI / 180;\nexport default function sunburstLayout(seriesType, ecModel, api) {\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n var center = seriesModel.get('center');\n var radius = seriesModel.get('radius');\n\n if (!zrUtil.isArray(radius)) {\n radius = [0, radius];\n }\n\n if (!zrUtil.isArray(center)) {\n center = [center, center];\n }\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n var r0 = parsePercent(radius[0], size / 2);\n var r = parsePercent(radius[1], size / 2);\n var startAngle = -seriesModel.get('startAngle') * RADIAN;\n var minAngle = seriesModel.get('minAngle') * RADIAN;\n var virtualRoot = seriesModel.getData().tree.root;\n var treeRoot = seriesModel.getViewRoot();\n var rootDepth = treeRoot.depth;\n var sort = seriesModel.get('sort');\n\n if (sort != null) {\n initChildren(treeRoot, sort);\n }\n\n var validDataCount = 0;\n zrUtil.each(treeRoot.children, function (child) {\n !isNaN(child.getValue()) && validDataCount++;\n });\n var sum = treeRoot.getValue(); // Sum may be 0\n\n var unitRadian = Math.PI / (sum || validDataCount) * 2;\n var renderRollupNode = treeRoot.depth > 0;\n var levels = treeRoot.height - (renderRollupNode ? -1 : 1);\n var rPerLevel = (r - r0) / (levels || 1);\n var clockwise = seriesModel.get('clockwise');\n var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); // In the case some sector angle is smaller than minAngle\n // let restAngle = PI2;\n // let valueSumLargerThanMinAngle = 0;\n\n var dir = clockwise ? 1 : -1;\n /**\r\n * Render a tree\r\n * @return increased angle\r\n */\n\n var renderNode = function (node, startAngle) {\n if (!node) {\n return;\n }\n\n var endAngle = startAngle; // Render self\n\n if (node !== virtualRoot) {\n // Tree node is virtual, so it doesn't need to be drawn\n var value = node.getValue();\n var angle = sum === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;\n\n if (angle < minAngle) {\n angle = minAngle; // restAngle -= minAngle;\n } // else {\n // valueSumLargerThanMinAngle += value;\n // }\n\n\n endAngle = startAngle + dir * angle;\n var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);\n var rStart = r0 + rPerLevel * depth;\n var rEnd = r0 + rPerLevel * (depth + 1);\n var levelModel = seriesModel.getLevelModel(node);\n\n if (levelModel) {\n var r0_1 = levelModel.get('r0', true);\n var r_1 = levelModel.get('r', true);\n var radius_1 = levelModel.get('radius', true);\n\n if (radius_1 != null) {\n r0_1 = radius_1[0];\n r_1 = radius_1[1];\n }\n\n r0_1 != null && (rStart = parsePercent(r0_1, size / 2));\n r_1 != null && (rEnd = parsePercent(r_1, size / 2));\n }\n\n node.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n } // Render children\n\n\n if (node.children && node.children.length) {\n // currentAngle = startAngle;\n var siblingAngle_1 = 0;\n zrUtil.each(node.children, function (node) {\n siblingAngle_1 += renderNode(node, startAngle + siblingAngle_1);\n });\n }\n\n return endAngle - startAngle;\n }; // Virtual root node for roll up\n\n\n if (renderRollupNode) {\n var rStart = r0;\n var rEnd = r0 + rPerLevel;\n var angle = Math.PI * 2;\n virtualRoot.setLayout({\n angle: angle,\n startAngle: startAngle,\n endAngle: startAngle + angle,\n clockwise: clockwise,\n cx: cx,\n cy: cy,\n r0: rStart,\n r: rEnd\n });\n }\n\n renderNode(treeRoot, startAngle);\n });\n}\n/**\r\n * Init node children by order and update visual\r\n */\n\nfunction initChildren(node, sortOrder) {\n var children = node.children || [];\n node.children = sort(children, sortOrder); // Init children recursively\n\n if (children.length) {\n zrUtil.each(node.children, function (child) {\n initChildren(child, sortOrder);\n });\n }\n}\n/**\r\n * Sort children nodes\r\n *\r\n * @param {TreeNode[]} children children of node to be sorted\r\n * @param {string | function | null} sort sort method\r\n * See SunburstSeries.js for details.\r\n */\n\n\nfunction sort(children, sortOrder) {\n if (zrUtil.isFunction(sortOrder)) {\n var sortTargets = zrUtil.map(children, function (child, idx) {\n var value = child.getValue();\n return {\n params: {\n depth: child.depth,\n height: child.height,\n dataIndex: child.dataIndex,\n getValue: function () {\n return value;\n }\n },\n index: idx\n };\n });\n sortTargets.sort(function (a, b) {\n return sortOrder(a.params, b.params);\n });\n return zrUtil.map(sortTargets, function (target) {\n return children[target.index];\n });\n } else {\n var isAsc_1 = sortOrder === 'asc';\n return children.sort(function (a, b) {\n var diff = (a.getValue() - b.getValue()) * (isAsc_1 ? 1 : -1);\n return diff === 0 ? (a.dataIndex - b.dataIndex) * (isAsc_1 ? -1 : 1) : diff;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { lift } from 'zrender/lib/tool/color.js';\nimport { extend, isString } from 'zrender/lib/core/util.js';\nexport default function sunburstVisual(ecModel) {\n var paletteScope = {}; // Default color strategy\n\n function pickColor(node, seriesModel, treeHeight) {\n // Choose color from palette based on the first level.\n var current = node;\n\n while (current && current.depth > 1) {\n current = current.parentNode;\n }\n\n var color = seriesModel.getColorFromPalette(current.name || current.dataIndex + '', paletteScope);\n\n if (node.depth > 1 && isString(color)) {\n // Lighter on the deeper level.\n color = lift(color, (node.depth - 1) / (treeHeight - 1) * 0.5);\n }\n\n return color;\n }\n\n ecModel.eachSeriesByType('sunburst', function (seriesModel) {\n var data = seriesModel.getData();\n var tree = data.tree;\n tree.eachNode(function (node) {\n var model = node.getModel();\n var style = model.getModel('itemStyle').getItemStyle();\n\n if (!style.fill) {\n style.fill = pickColor(node, seriesModel, tree.root.height);\n }\n\n var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, 'style');\n extend(existsStyle, style);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SunburstView from './SunburstView.js';\nimport SunburstSeriesModel from './SunburstSeries.js';\nimport sunburstLayout from './sunburstLayout.js';\nimport sunburstVisual from './sunburstVisual.js';\nimport dataFilter from '../../processor/dataFilter.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport { installSunburstAction } from './sunburstAction.js';\nexport function install(registers) {\n registers.registerChartView(SunburstView);\n registers.registerSeriesModel(SunburstSeriesModel);\n registers.registerLayout(curry(sunburstLayout, 'sunburst'));\n registers.registerProcessor(curry(dataFilter, 'sunburst'));\n registers.registerVisual(sunburstVisual);\n installSunburstAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport createSeriesData from '../helper/createSeriesData.js';\nimport { makeInner } from '../../util/model.js';\nimport SeriesModel from '../../model/Series.js'; // Also compat with ec4, where\n// `visual('color') visual('borderColor')` is supported.\n\nexport var STYLE_VISUAL_TYPE = {\n color: 'fill',\n borderColor: 'stroke'\n};\nexport var NON_STYLE_VISUAL_PROPS = {\n symbol: 1,\n symbolSize: 1,\n symbolKeepAspect: 1,\n legendIcon: 1,\n visualMeta: 1,\n liftZ: 1,\n decal: 1\n};\n;\nexport var customInnerStore = makeInner();\n\nvar CustomSeriesModel =\n/** @class */\nfunction (_super) {\n __extends(CustomSeriesModel, _super);\n\n function CustomSeriesModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomSeriesModel.type;\n return _this;\n }\n\n CustomSeriesModel.prototype.optionUpdated = function () {\n this.currentZLevel = this.get('zlevel', true);\n this.currentZ = this.get('z', true);\n };\n\n CustomSeriesModel.prototype.getInitialData = function (option, ecModel) {\n return createSeriesData(null, this);\n };\n\n CustomSeriesModel.prototype.getDataParams = function (dataIndex, dataType, el) {\n var params = _super.prototype.getDataParams.call(this, dataIndex, dataType);\n\n el && (params.info = customInnerStore(el).info);\n return params;\n };\n\n CustomSeriesModel.type = 'series.custom';\n CustomSeriesModel.dependencies = ['grid', 'polar', 'geo', 'singleAxis', 'calendar'];\n CustomSeriesModel.defaultOption = {\n coordinateSystem: 'cartesian2d',\n // zlevel: 0,\n z: 2,\n legendHoverLink: true,\n // Custom series will not clip by default.\n // Some case will use custom series to draw label\n // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight\n clip: false // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // Polar coordinate system\n // polarIndex: 0,\n // Geo coordinate system\n // geoIndex: 0,\n\n };\n return CustomSeriesModel;\n}(SeriesModel);\n\nexport default CustomSeriesModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n var axis = this.getAxis(dim);\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n }, this);\n}\n\nexport default function cartesianPrepareCustom(coordSys) {\n var rect = coordSys.master.getRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'cartesian2d',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\n\nexport default function geoPrepareCustom(coordSys) {\n var rect = coordSys.getBoundingRect();\n return {\n coordSys: {\n type: 'geo',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n zoom: coordSys.getZoom()\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" and noRoam param,\n // Compatible with this usage:\n // echarts.util.map(item.points, api.coord)\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { bind } from 'zrender/lib/core/util.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\n\nexport default function singlePrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n return {\n coordSys: {\n type: 'singleAxis',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (val) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(val);\n },\n size: bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js'; // import AngleAxis from './AngleAxis.js';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis\n\n var axis = this[getterName]();\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n\n if (dim === 'Angle') {\n result = result * Math.PI / 180;\n }\n\n return result;\n }, this);\n}\n\nexport default function polarPrepareCustom(coordSys) {\n var radiusAxis = coordSys.getRadiusAxis();\n var angleAxis = coordSys.getAngleAxis();\n var radius = radiusAxis.getExtent();\n radius[0] > radius[1] && radius.reverse();\n return {\n coordSys: {\n type: 'polar',\n cx: coordSys.cx,\n cy: coordSys.cy,\n r: radius[1],\n r0: radius[0]\n },\n api: {\n coord: function (data) {\n var radius = radiusAxis.dataToRadius(data[0]);\n var angle = angleAxis.dataToAngle(data[1]);\n var coord = coordSys.coordToPoint([radius, angle]);\n coord.push(radius, angle * Math.PI / 180);\n return coord;\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function calendarPrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n var rangeInfo = coordSys.getRangeInfo();\n return {\n coordSys: {\n type: 'calendar',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n cellWidth: coordSys.getCellWidth(),\n cellHeight: coordSys.getCellHeight(),\n rangeInfo: {\n start: rangeInfo.start,\n end: rangeInfo.end,\n weeks: rangeInfo.weeks,\n dayCount: rangeInfo.allDay\n }\n },\n api: {\n coord: function (data, clamp) {\n return coordSys.dataToPoint(data, clamp);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, hasOwn } from 'zrender/lib/core/util.js';\nvar deprecatedLogs = {};\n/**\r\n * Whether need to call `convertEC4CompatibleStyle`.\r\n */\n\nexport function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {\n // Since echarts5, `RectText` is separated from its host element and style.text\n // does not exist any more. The compat work brings some extra burden on performance.\n // So we provide:\n // `legacy: true` force make compat.\n // `legacy: false`, force do not compat.\n // `legacy` not set: auto detect whether legacy.\n // But in this case we do not compat (difficult to detect and rare case):\n // Becuse custom series and graphic component support \"merge\", users may firstly\n // only set `textStrokeWidth` style or secondly only set `text`.\n return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== 'tspan' // Difficult to detect whether legacy for a \"text\" el.\n && (elType === 'text' || hasOwn(style, 'text')));\n}\n/**\r\n * `EC4CompatibleStyle` is style that might be in echarts4 format or echarts5 format.\r\n * @param hostStyle The properties might be modified.\r\n * @return If be text el, `textContentStyle` and `textConfig` will not be returned.\r\n * Otherwise a `textContentStyle` and `textConfig` will be created, whose props area\r\n * retried from the `hostStyle`.\r\n */\n\nexport function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {\n var srcStyle = hostStyle;\n var textConfig;\n var textContent;\n var textContentStyle;\n\n if (elType === 'text') {\n textContentStyle = srcStyle;\n } else {\n textContentStyle = {};\n hasOwn(srcStyle, 'text') && (textContentStyle.text = srcStyle.text);\n hasOwn(srcStyle, 'rich') && (textContentStyle.rich = srcStyle.rich);\n hasOwn(srcStyle, 'textFill') && (textContentStyle.fill = srcStyle.textFill);\n hasOwn(srcStyle, 'textStroke') && (textContentStyle.stroke = srcStyle.textStroke);\n hasOwn(srcStyle, 'fontFamily') && (textContentStyle.fontFamily = srcStyle.fontFamily);\n hasOwn(srcStyle, 'fontSize') && (textContentStyle.fontSize = srcStyle.fontSize);\n hasOwn(srcStyle, 'fontStyle') && (textContentStyle.fontStyle = srcStyle.fontStyle);\n hasOwn(srcStyle, 'fontWeight') && (textContentStyle.fontWeight = srcStyle.fontWeight);\n textContent = {\n type: 'text',\n style: textContentStyle,\n // ec4 does not support rectText trigger.\n // And when text position is different in normal and emphasis\n // => hover text trigger emphasis;\n // => text position changed, leave mouse pointer immediately;\n // That might cause incorrect state.\n silent: true\n };\n textConfig = {};\n var hasOwnPos = hasOwn(srcStyle, 'textPosition');\n\n if (isNormal) {\n textConfig.position = hasOwnPos ? srcStyle.textPosition : 'inside';\n } else {\n hasOwnPos && (textConfig.position = srcStyle.textPosition);\n }\n\n hasOwn(srcStyle, 'textPosition') && (textConfig.position = srcStyle.textPosition);\n hasOwn(srcStyle, 'textOffset') && (textConfig.offset = srcStyle.textOffset);\n hasOwn(srcStyle, 'textRotation') && (textConfig.rotation = srcStyle.textRotation);\n hasOwn(srcStyle, 'textDistance') && (textConfig.distance = srcStyle.textDistance);\n }\n\n convertEC4CompatibleRichItem(textContentStyle, hostStyle);\n each(textContentStyle.rich, function (richItem) {\n convertEC4CompatibleRichItem(richItem, richItem);\n });\n return {\n textConfig: textConfig,\n textContent: textContent\n };\n}\n/**\r\n * The result will be set to `out`.\r\n */\n\nfunction convertEC4CompatibleRichItem(out, richItem) {\n if (!richItem) {\n return;\n } // (1) For simplicity, make textXXX properties (deprecated since ec5) has\n // higher priority. For example, consider in ec4 `borderColor: 5, textBorderColor: 10`\n // on a rect means `borderColor: 4` on the rect and `borderColor: 10` on an attached\n // richText in ec5.\n // (2) `out === richItem` if and only if `out` is text el or rich item.\n // So we can overwrite existing props in `out` since textXXX has higher priority.\n\n\n richItem.font = richItem.textFont || richItem.font;\n hasOwn(richItem, 'textStrokeWidth') && (out.lineWidth = richItem.textStrokeWidth);\n hasOwn(richItem, 'textAlign') && (out.align = richItem.textAlign);\n hasOwn(richItem, 'textVerticalAlign') && (out.verticalAlign = richItem.textVerticalAlign);\n hasOwn(richItem, 'textLineHeight') && (out.lineHeight = richItem.textLineHeight);\n hasOwn(richItem, 'textWidth') && (out.width = richItem.textWidth);\n hasOwn(richItem, 'textHeight') && (out.height = richItem.textHeight);\n hasOwn(richItem, 'textBackgroundColor') && (out.backgroundColor = richItem.textBackgroundColor);\n hasOwn(richItem, 'textPadding') && (out.padding = richItem.textPadding);\n hasOwn(richItem, 'textBorderColor') && (out.borderColor = richItem.textBorderColor);\n hasOwn(richItem, 'textBorderWidth') && (out.borderWidth = richItem.textBorderWidth);\n hasOwn(richItem, 'textBorderRadius') && (out.borderRadius = richItem.textBorderRadius);\n hasOwn(richItem, 'textBoxShadowColor') && (out.shadowColor = richItem.textBoxShadowColor);\n hasOwn(richItem, 'textBoxShadowBlur') && (out.shadowBlur = richItem.textBoxShadowBlur);\n hasOwn(richItem, 'textBoxShadowOffsetX') && (out.shadowOffsetX = richItem.textBoxShadowOffsetX);\n hasOwn(richItem, 'textBoxShadowOffsetY') && (out.shadowOffsetY = richItem.textBoxShadowOffsetY);\n}\n/**\r\n * Convert to pure echarts4 format style.\r\n * `itemStyle` will be modified, added with ec4 style properties from\r\n * `textStyle` and `textConfig`.\r\n *\r\n * [Caveat]: For simplicity, `insideRollback` in ec4 does not compat, where\r\n * `styleEmphasis: {textFill: 'red'}` will remove the normal auto added stroke.\r\n */\n\n\nexport function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {\n var out = itemStl; // See `custom.ts`, a trick to set extra `textPosition` firstly.\n\n out.textPosition = out.textPosition || txCfg.position || 'inside';\n txCfg.offset != null && (out.textOffset = txCfg.offset);\n txCfg.rotation != null && (out.textRotation = txCfg.rotation);\n txCfg.distance != null && (out.textDistance = txCfg.distance);\n var isInside = out.textPosition.indexOf('inside') >= 0;\n var hostFill = itemStl.fill || '#000';\n convertToEC4RichItem(out, txStl);\n var textFillNotSet = out.textFill == null;\n\n if (isInside) {\n if (textFillNotSet) {\n out.textFill = txCfg.insideFill || '#fff';\n !out.textStroke && txCfg.insideStroke && (out.textStroke = txCfg.insideStroke);\n !out.textStroke && (out.textStroke = hostFill);\n out.textStrokeWidth == null && (out.textStrokeWidth = 2);\n }\n } else {\n if (textFillNotSet) {\n out.textFill = itemStl.fill || txCfg.outsideFill || '#000';\n }\n\n !out.textStroke && txCfg.outsideStroke && (out.textStroke = txCfg.outsideStroke);\n }\n\n out.text = txStl.text;\n out.rich = txStl.rich;\n each(txStl.rich, function (richItem) {\n convertToEC4RichItem(richItem, richItem);\n });\n return out;\n}\n\nfunction convertToEC4RichItem(out, richItem) {\n if (!richItem) {\n return;\n }\n\n hasOwn(richItem, 'fill') && (out.textFill = richItem.fill);\n hasOwn(richItem, 'stroke') && (out.textStroke = richItem.fill);\n hasOwn(richItem, 'lineWidth') && (out.textStrokeWidth = richItem.lineWidth);\n hasOwn(richItem, 'font') && (out.font = richItem.font);\n hasOwn(richItem, 'fontStyle') && (out.fontStyle = richItem.fontStyle);\n hasOwn(richItem, 'fontWeight') && (out.fontWeight = richItem.fontWeight);\n hasOwn(richItem, 'fontSize') && (out.fontSize = richItem.fontSize);\n hasOwn(richItem, 'fontFamily') && (out.fontFamily = richItem.fontFamily);\n hasOwn(richItem, 'align') && (out.textAlign = richItem.align);\n hasOwn(richItem, 'verticalAlign') && (out.textVerticalAlign = richItem.verticalAlign);\n hasOwn(richItem, 'lineHeight') && (out.textLineHeight = richItem.lineHeight);\n hasOwn(richItem, 'width') && (out.textWidth = richItem.width);\n hasOwn(richItem, 'height') && (out.textHeight = richItem.height);\n hasOwn(richItem, 'backgroundColor') && (out.textBackgroundColor = richItem.backgroundColor);\n hasOwn(richItem, 'padding') && (out.textPadding = richItem.padding);\n hasOwn(richItem, 'borderColor') && (out.textBorderColor = richItem.borderColor);\n hasOwn(richItem, 'borderWidth') && (out.textBorderWidth = richItem.borderWidth);\n hasOwn(richItem, 'borderRadius') && (out.textBorderRadius = richItem.borderRadius);\n hasOwn(richItem, 'shadowColor') && (out.textBoxShadowColor = richItem.shadowColor);\n hasOwn(richItem, 'shadowBlur') && (out.textBoxShadowBlur = richItem.shadowBlur);\n hasOwn(richItem, 'shadowOffsetX') && (out.textBoxShadowOffsetX = richItem.shadowOffsetX);\n hasOwn(richItem, 'shadowOffsetY') && (out.textBoxShadowOffsetY = richItem.shadowOffsetY);\n hasOwn(richItem, 'textShadowColor') && (out.textShadowColor = richItem.textShadowColor);\n hasOwn(richItem, 'textShadowBlur') && (out.textShadowBlur = richItem.textShadowBlur);\n hasOwn(richItem, 'textShadowOffsetX') && (out.textShadowOffsetX = richItem.textShadowOffsetX);\n hasOwn(richItem, 'textShadowOffsetY') && (out.textShadowOffsetY = richItem.textShadowOffsetY);\n}\n\nexport function warnDeprecated(deprecated, insteadApproach) {\n if (process.env.NODE_ENV !== 'production') {\n var key = deprecated + '^_^' + insteadApproach;\n\n if (!deprecatedLogs[key]) {\n console.warn(\"[ECharts] DEPRECATED: \\\"\" + deprecated + \"\\\" has been deprecated. \" + insteadApproach);\n deprecatedLogs[key] = true;\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { assert, bind, each, eqNaN, extend, hasOwn, indexOf, isArrayLike, keys, reduce } from 'zrender/lib/core/util.js';\nimport { cloneValue } from 'zrender/lib/animation/Animator.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { Path } from '../util/graphic.js';\nimport { warn } from '../util/log.js';\nimport { TRANSFORMABLE_PROPS } from 'zrender/lib/core/Transformable.js';\nvar LEGACY_TRANSFORM_PROPS_MAP = {\n position: ['x', 'y'],\n scale: ['scaleX', 'scaleY'],\n origin: ['originX', 'originY']\n};\nvar LEGACY_TRANSFORM_PROPS = keys(LEGACY_TRANSFORM_PROPS_MAP);\nvar TRANSFORM_PROPS_MAP = reduce(TRANSFORMABLE_PROPS, function (obj, key) {\n obj[key] = 1;\n return obj;\n}, {});\nvar transformPropNamesStr = TRANSFORMABLE_PROPS.join(', '); // '' means root\n\nexport var ELEMENT_ANIMATABLE_PROPS = ['', 'style', 'shape', 'extra'];\n;\nvar transitionInnerStore = makeInner();\n;\n\nfunction getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {\n var animationProp = animationType + \"Animation\";\n var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};\n var userDuring = transitionInnerStore(el).userDuring; // Only set when duration is > 0 and it's need to be animated.\n\n if (config.duration > 0) {\n // For simplicity, if during not specified, the previous during will not work any more.\n config.during = userDuring ? bind(duringCall, {\n el: el,\n userDuring: userDuring\n }) : null;\n config.setToFinal = true;\n config.scope = animationType;\n }\n\n extend(config, elOption[animationProp]);\n return config;\n}\n\nexport function applyUpdateTransition(el, elOption, animatableModel, opts) {\n opts = opts || {};\n var dataIndex = opts.dataIndex,\n isInit = opts.isInit,\n clearStyle = opts.clearStyle;\n var hasAnimation = animatableModel.isAnimationEnabled(); // Save the meta info for further morphing. Like apply on the sub morphing elements.\n\n var store = transitionInnerStore(el);\n var styleOpt = elOption.style;\n store.userDuring = elOption.during;\n var transFromProps = {};\n var propsToSet = {};\n prepareTransformAllPropsFinal(el, elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('shape', elOption, propsToSet);\n prepareShapeOrExtraAllPropsFinal('extra', elOption, propsToSet);\n\n if (!isInit && hasAnimation) {\n prepareTransformTransitionFrom(el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('shape', el, elOption, transFromProps);\n prepareShapeOrExtraTransitionFrom('extra', el, elOption, transFromProps);\n prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);\n }\n\n propsToSet.style = styleOpt;\n applyPropsDirectly(el, propsToSet, clearStyle);\n applyMiscProps(el, elOption);\n\n if (hasAnimation) {\n if (isInit) {\n var enterFromProps_1 = {};\n each(ELEMENT_ANIMATABLE_PROPS, function (propName) {\n var prop = propName ? elOption[propName] : elOption;\n\n if (prop && prop.enterFrom) {\n if (propName) {\n enterFromProps_1[propName] = enterFromProps_1[propName] || {};\n }\n\n extend(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);\n }\n });\n var config = getElementAnimationConfig('enter', el, elOption, animatableModel, dataIndex);\n\n if (config.duration > 0) {\n el.animateFrom(enterFromProps_1, config);\n }\n } else {\n applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);\n }\n } // Store leave to be used in leave transition.\n\n\n updateLeaveTo(el, elOption);\n styleOpt ? el.dirty() : el.markRedraw();\n}\nexport function updateLeaveTo(el, elOption) {\n // Try merge to previous set leaveTo\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n\n for (var i = 0; i < ELEMENT_ANIMATABLE_PROPS.length; i++) {\n var propName = ELEMENT_ANIMATABLE_PROPS[i];\n var prop = propName ? elOption[propName] : elOption;\n\n if (prop && prop.leaveTo) {\n if (!leaveToProps) {\n leaveToProps = transitionInnerStore(el).leaveToProps = {};\n }\n\n if (propName) {\n leaveToProps[propName] = leaveToProps[propName] || {};\n }\n\n extend(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);\n }\n }\n}\nexport function applyLeaveTransition(el, elOption, animatableModel, onRemove) {\n if (el) {\n var parent_1 = el.parent;\n var leaveToProps = transitionInnerStore(el).leaveToProps;\n\n if (leaveToProps) {\n // TODO TODO use leave after leaveAnimation in series is introduced\n // TODO Data index?\n var config = getElementAnimationConfig('update', el, elOption, animatableModel, 0);\n\n config.done = function () {\n parent_1.remove(el);\n onRemove && onRemove();\n };\n\n el.animateTo(leaveToProps, config);\n } else {\n parent_1.remove(el);\n onRemove && onRemove();\n }\n }\n}\nexport function isTransitionAll(transition) {\n return transition === 'all';\n}\n\nfunction applyPropsDirectly(el, // Can be null/undefined\nallPropsFinal, clearStyle) {\n var styleOpt = allPropsFinal.style;\n\n if (!el.isGroup && styleOpt) {\n if (clearStyle) {\n el.useStyle({}); // When style object changed, how to trade the existing animation?\n // It is probably complicated and not needed to cover all the cases.\n // But still need consider the case:\n // (1) When using init animation on `style.opacity`, and before the animation\n // ended users triggers an update by mousewhel. At that time the init\n // animation should better be continued rather than terminated.\n // So after `useStyle` called, we should change the animation target manually\n // to continue the effect of the init animation.\n // (2) PENDING: If the previous animation targeted at a `val1`, and currently we need\n // to update the value to `val2` and no animation declared, should be terminate\n // the previous animation or just modify the target of the animation?\n // Therotically That will happen not only on `style` but also on `shape` and\n // `transfrom` props. But we haven't handle this case at present yet.\n // (3) PENDING: Is it proper to visit `animators` and `targetName`?\n\n var animators = el.animators;\n\n for (var i = 0; i < animators.length; i++) {\n var animator = animators[i]; // targetName is the \"topKey\".\n\n if (animator.targetName === 'style') {\n animator.changeTarget(el.style);\n }\n }\n }\n\n el.setStyle(styleOpt);\n }\n\n if (allPropsFinal) {\n // Not set style here.\n allPropsFinal.style = null; // Set el to the final state firstly.\n\n allPropsFinal && el.attr(allPropsFinal);\n allPropsFinal.style = styleOpt;\n }\n}\n\nfunction applyPropsTransition(el, elOption, dataIndex, model, // Can be null/undefined\ntransFromProps) {\n if (transFromProps) {\n var config = getElementAnimationConfig('update', el, elOption, model, dataIndex);\n\n if (config.duration > 0) {\n el.animateFrom(transFromProps, config);\n }\n }\n}\n\nfunction applyMiscProps(el, elOption) {\n // Merge by default.\n hasOwn(elOption, 'silent') && (el.silent = elOption.silent);\n hasOwn(elOption, 'ignore') && (el.ignore = elOption.ignore);\n\n if (el instanceof Displayable) {\n hasOwn(elOption, 'invisible') && (el.invisible = elOption.invisible);\n }\n\n if (el instanceof Path) {\n hasOwn(elOption, 'autoBatch') && (el.autoBatch = elOption.autoBatch);\n }\n} // Use it to avoid it be exposed to user.\n\n\nvar tmpDuringScope = {};\nvar transitionDuringAPI = {\n // Usually other props do not need to be changed in animation during.\n setTransform: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `setTransform`.');\n }\n\n tmpDuringScope.el[key] = val;\n return this;\n },\n getTransform: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assert(hasOwn(TRANSFORM_PROPS_MAP, key), 'Only ' + transformPropNamesStr + ' available in `getTransform`.');\n }\n\n return tmpDuringScope.el[key];\n },\n setShape: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var el = tmpDuringScope.el;\n var shape = el.shape || (el.shape = {});\n shape[key] = val;\n el.dirtyShape && el.dirtyShape();\n return this;\n },\n getShape: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var shape = tmpDuringScope.el.shape;\n\n if (shape) {\n return shape[key];\n }\n },\n setStyle: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var el = tmpDuringScope.el;\n var style = el.style;\n\n if (style) {\n if (process.env.NODE_ENV !== 'production') {\n if (eqNaN(val)) {\n warn('style.' + key + ' must not be assigned with NaN.');\n }\n }\n\n style[key] = val;\n el.dirtyStyle && el.dirtyStyle();\n }\n\n return this;\n },\n getStyle: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var style = tmpDuringScope.el.style;\n\n if (style) {\n return style[key];\n }\n },\n setExtra: function (key, val) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});\n extra[key] = val;\n return this;\n },\n getExtra: function (key) {\n if (process.env.NODE_ENV !== 'production') {\n assertNotReserved(key);\n }\n\n var extra = tmpDuringScope.el.extra;\n\n if (extra) {\n return extra[key];\n }\n }\n};\n\nfunction assertNotReserved(key) {\n if (process.env.NODE_ENV !== 'production') {\n if (key === 'transition' || key === 'enterFrom' || key === 'leaveTo') {\n throw new Error('key must not be \"' + key + '\"');\n }\n }\n}\n\nfunction duringCall() {\n // Do not provide \"percent\" until some requirements come.\n // Because consider thies case:\n // enterFrom: {x: 100, y: 30}, transition: 'x'.\n // And enter duration is different from update duration.\n // Thus it might be confused about the meaning of \"percent\" in during callback.\n var scope = this;\n var el = scope.el;\n\n if (!el) {\n return;\n } // If el is remove from zr by reason like legend, during still need to called,\n // because el will be added back to zr and the prop value should not be incorrect.\n\n\n var latestUserDuring = transitionInnerStore(el).userDuring;\n var scopeUserDuring = scope.userDuring; // Ensured a during is only called once in each animation frame.\n // If a during is called multiple times in one frame, maybe some users' calculation logic\n // might be wrong (not sure whether this usage exists).\n // The case of a during might be called twice can be: by default there is a animator for\n // 'x', 'y' when init. Before the init animation finished, call `setOption` to start\n // another animators for 'style'/'shape'/'extra'.\n\n if (latestUserDuring !== scopeUserDuring) {\n // release\n scope.el = scope.userDuring = null;\n return;\n }\n\n tmpDuringScope.el = el; // Give no `this` to user in \"during\" calling.\n\n scopeUserDuring(transitionDuringAPI); // FIXME: if in future meet the case that some prop will be both modified in `during` and `state`,\n // consider the issue that the prop might be incorrect when return to \"normal\" state.\n}\n\nfunction prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var elPropsInAttr = fromEl[mainAttr];\n var transFromPropsInAttr;\n\n if (elPropsInAttr) {\n var transition = elOption.transition;\n var attrTransition = attrOpt.transition;\n\n if (attrTransition) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n\n if (isTransitionAll(attrTransition)) {\n extend(transFromPropsInAttr, elPropsInAttr);\n } else {\n var transitionKeys = normalizeToArray(attrTransition);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = elPropsInAttr[key];\n transFromPropsInAttr[key] = elVal;\n }\n }\n } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {\n !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});\n var elPropsInAttrKeys = keys(elPropsInAttr);\n\n for (var i = 0; i < elPropsInAttrKeys.length; i++) {\n var key = elPropsInAttrKeys[i];\n var elVal = elPropsInAttr[key];\n\n if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {\n transFromPropsInAttr[key] = elVal;\n }\n }\n }\n }\n}\n\nfunction prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {\n var attrOpt = elOption[mainAttr];\n\n if (!attrOpt) {\n return;\n }\n\n var allPropsInAttr = allProps[mainAttr] = {};\n var keysInAttr = keys(attrOpt);\n\n for (var i = 0; i < keysInAttr.length; i++) {\n var key = keysInAttr[i]; // To avoid share one object with different element, and\n // to avoid user modify the object inexpectedly, have to clone.\n\n allPropsInAttr[key] = cloneValue(attrOpt[key]);\n }\n}\n\nfunction prepareTransformTransitionFrom(el, elOption, transFromProps) {\n var transition = elOption.transition;\n var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n\n if (key === 'style' || key === 'shape' || key === 'extra') {\n continue;\n }\n\n var elVal = el[key];\n\n if (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer(key, 'el.transition');\n } // Do not clone, animator will perform that clone.\n\n\n transFromProps[key] = elVal;\n }\n}\n\nfunction prepareTransformAllPropsFinal(el, elOption, allProps) {\n for (var i = 0; i < LEGACY_TRANSFORM_PROPS.length; i++) {\n var legacyName = LEGACY_TRANSFORM_PROPS[i];\n var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];\n var legacyArr = elOption[legacyName];\n\n if (legacyArr) {\n allProps[xyName[0]] = legacyArr[0];\n allProps[xyName[1]] = legacyArr[1];\n }\n }\n\n for (var i = 0; i < TRANSFORMABLE_PROPS.length; i++) {\n var key = TRANSFORMABLE_PROPS[i];\n\n if (elOption[key] != null) {\n allProps[key] = elOption[key];\n }\n }\n}\n\nfunction prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {\n if (!styleOpt) {\n return;\n }\n\n var fromElStyle = fromEl.style;\n var transFromStyleProps;\n\n if (fromElStyle) {\n var styleTransition = styleOpt.transition;\n var elTransition = elOption.transition;\n\n if (styleTransition && !isTransitionAll(styleTransition)) {\n var transitionKeys = normalizeToArray(styleTransition);\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n\n for (var i = 0; i < transitionKeys.length; i++) {\n var key = transitionKeys[i];\n var elVal = fromElStyle[key]; // Do not clone, see `checkNonStyleTansitionRefer`.\n\n transFromStyleProps[key] = elVal;\n }\n } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, 'style') >= 0)) {\n var animationProps = fromEl.getAnimationStyleProps();\n var animationStyleProps = animationProps ? animationProps.style : null;\n\n if (animationStyleProps) {\n !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});\n var styleKeys = keys(styleOpt);\n\n for (var i = 0; i < styleKeys.length; i++) {\n var key = styleKeys[i];\n\n if (animationStyleProps[key]) {\n var elVal = fromElStyle[key];\n transFromStyleProps[key] = elVal;\n }\n }\n }\n }\n }\n}\n\nfunction isNonStyleTransitionEnabled(optVal, elVal) {\n // The same as `checkNonStyleTansitionRefer`.\n return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;\n}\n\nvar checkTransformPropRefer;\n\nif (process.env.NODE_ENV !== 'production') {\n checkTransformPropRefer = function (key, usedIn) {\n if (!hasOwn(TRANSFORM_PROPS_MAP, key)) {\n warn('Prop `' + key + '` is not a permitted in `' + usedIn + '`. ' + 'Only `' + keys(TRANSFORM_PROPS_MAP).join('`, `') + '` are permitted.');\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { keys, filter, each, isArray, indexOf } from 'zrender/lib/core/util.js';\nimport { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { warn } from '../util/log.js';\nimport { makeInner } from '../util/model.js';\nvar getStateToRestore = makeInner();\nvar KEYFRAME_EXCLUDE_KEYS = ['percent', 'easing', 'shape', 'style', 'extra'];\n/**\r\n * Stop previous keyframe animation and restore the attributes.\r\n * Avoid new keyframe animation starts with wrong internal state when the percent: 0 is not set.\r\n */\n\nexport function stopPreviousKeyframeAnimationAndRestore(el) {\n // Stop previous keyframe animation.\n el.stopAnimation('keyframe'); // Restore\n\n el.attr(getStateToRestore(el));\n}\nexport function applyKeyframeAnimation(el, animationOpts, animatableModel) {\n if (!animatableModel.isAnimationEnabled() || !animationOpts) {\n return;\n }\n\n if (isArray(animationOpts)) {\n each(animationOpts, function (singleAnimationOpts) {\n applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);\n });\n return;\n }\n\n var keyframes = animationOpts.keyframes;\n var duration = animationOpts.duration;\n\n if (animatableModel && duration == null) {\n // Default to use duration of config.\n // NOTE: animation config from payload will be ignored because they are mainly for transitions.\n var config = getAnimationConfig('enter', animatableModel, 0);\n duration = config && config.duration;\n }\n\n if (!keyframes || !duration) {\n return;\n }\n\n var stateToRestore = getStateToRestore(el);\n each(ELEMENT_ANIMATABLE_PROPS, function (targetPropName) {\n if (targetPropName && !el[targetPropName]) {\n return;\n }\n\n var animator;\n var endFrameIsSet = false; // Sort keyframes by percent.\n\n keyframes.sort(function (a, b) {\n return a.percent - b.percent;\n });\n each(keyframes, function (kf) {\n // Stop current animation.\n var animators = el.animators;\n var kfValues = targetPropName ? kf[targetPropName] : kf;\n\n if (process.env.NODE_ENV !== 'production') {\n if (kf.percent >= 1) {\n endFrameIsSet = true;\n }\n }\n\n if (!kfValues) {\n return;\n }\n\n var propKeys = keys(kfValues);\n\n if (!targetPropName) {\n // PENDING performance?\n propKeys = filter(propKeys, function (key) {\n return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;\n });\n }\n\n if (!propKeys.length) {\n return;\n }\n\n if (!animator) {\n animator = el.animate(targetPropName, animationOpts.loop, true);\n animator.scope = 'keyframe';\n }\n\n for (var i = 0; i < animators.length; i++) {\n // Stop all other animation that is not keyframe.\n if (animators[i] !== animator && animators[i].targetName === animator.targetName) {\n animators[i].stopTracks(propKeys);\n }\n }\n\n targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});\n var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;\n each(propKeys, function (key) {\n // Save original value.\n savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];\n });\n animator.whenWithKeys(duration * kf.percent, kfValues, propKeys, kf.easing);\n });\n\n if (!animator) {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!endFrameIsSet) {\n warn('End frame with percent: 1 is missing in the keyframeAnimation.', true);\n }\n }\n\n animator.delay(animationOpts.delay || 0).duration(duration).start(animationOpts.easing);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, indexOf } from 'zrender/lib/core/util.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport { setDefaultStateProxy, toggleHoverEmphasis } from '../../util/states.js';\nimport * as labelStyleHelper from '../../label/labelStyle.js';\nimport { getDefaultLabel } from '../helper/labelHelper.js';\nimport { getLayoutOnAxis } from '../../layout/barGrid.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport ChartView from '../../view/Chart.js';\nimport { createClipPath } from '../helper/createClipPathFromCoordSys.js';\nimport prepareCartesian2d from '../../coord/cartesian/prepareCustom.js';\nimport prepareGeo from '../../coord/geo/prepareCustom.js';\nimport prepareSingleAxis from '../../coord/single/prepareCustom.js';\nimport preparePolar from '../../coord/polar/prepareCustom.js';\nimport prepareCalendar from '../../coord/calendar/prepareCustom.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport { convertToEC4StyleForCustomSerise, isEC4CompatibleStyle, convertFromEC4CompatibleStyle, warnDeprecated } from '../../util/styleCompat.js';\nimport { throwError } from '../../util/log.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nimport { STYLE_VISUAL_TYPE, NON_STYLE_VISUAL_PROPS, customInnerStore } from './CustomSeries.js';\nimport { applyLeaveTransition, applyUpdateTransition } from '../../animation/customGraphicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar EMPHASIS = 'emphasis';\nvar NORMAL = 'normal';\nvar BLUR = 'blur';\nvar SELECT = 'select';\nvar STATES = [NORMAL, EMPHASIS, BLUR, SELECT];\nvar PATH_ITEM_STYLE = {\n normal: ['itemStyle'],\n emphasis: [EMPHASIS, 'itemStyle'],\n blur: [BLUR, 'itemStyle'],\n select: [SELECT, 'itemStyle']\n};\nvar PATH_LABEL = {\n normal: ['label'],\n emphasis: [EMPHASIS, 'label'],\n blur: [BLUR, 'label'],\n select: [SELECT, 'label']\n};\nvar DEFAULT_TRANSITION = ['x', 'y']; // Use prefix to avoid index to be the same as el.name,\n// which will cause weird update animation.\n\nvar GROUP_DIFF_PREFIX = 'e\\0\\0';\nvar attachedTxInfoTmp = {\n normal: {},\n emphasis: {},\n blur: {},\n select: {}\n};\n/**\r\n * To reduce total package size of each coordinate systems, the modules `prepareCustom`\r\n * of each coordinate systems are not required by each coordinate systems directly, but\r\n * required by the module `custom`.\r\n *\r\n * prepareInfoForCustomSeries {Function}: optional\r\n * @return {Object} {coordSys: {...}, api: {\r\n * coord: function (data, clamp) {}, // return point in global.\r\n * size: function (dataSize, dataItem) {} // return size of each axis in coordSys.\r\n * }}\r\n */\n\nvar prepareCustoms = {\n cartesian2d: prepareCartesian2d,\n geo: prepareGeo,\n single: prepareSingleAxis,\n polar: preparePolar,\n calendar: prepareCalendar\n};\n\nfunction isPath(el) {\n return el instanceof graphicUtil.Path;\n}\n\nfunction isDisplayable(el) {\n return el instanceof Displayable;\n}\n\nfunction copyElement(sourceEl, targetEl) {\n targetEl.copyTransform(sourceEl);\n\n if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {\n targetEl.setStyle(sourceEl.style);\n targetEl.z = sourceEl.z;\n targetEl.z2 = sourceEl.z2;\n targetEl.zlevel = sourceEl.zlevel;\n targetEl.invisible = sourceEl.invisible;\n targetEl.ignore = sourceEl.ignore;\n\n if (isPath(targetEl) && isPath(sourceEl)) {\n targetEl.setShape(sourceEl.shape);\n }\n }\n}\n\nvar CustomChartView =\n/** @class */\nfunction (_super) {\n __extends(CustomChartView, _super);\n\n function CustomChartView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CustomChartView.type;\n return _this;\n }\n\n CustomChartView.prototype.render = function (customSeries, ecModel, api, payload) {\n // Clear previously rendered progressive elements.\n this._progressiveEls = null;\n var oldData = this._data;\n var data = customSeries.getData();\n var group = this.group;\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n\n if (!oldData) {\n // Previous render is incremental render or first render.\n // Needs remove the incremental rendered elements.\n group.removeAll();\n }\n\n data.diff(oldData).add(function (newIdx) {\n createOrUpdateItem(api, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).remove(function (oldIdx) {\n var el = oldData.getItemGraphicEl(oldIdx);\n el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);\n }).update(function (newIdx, oldIdx) {\n var oldEl = oldData.getItemGraphicEl(oldIdx);\n createOrUpdateItem(api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);\n }).execute(); // Do clipping\n\n var clipPath = customSeries.get('clip', true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;\n\n if (clipPath) {\n group.setClipPath(clipPath);\n } else {\n group.removeClipPath();\n }\n\n this._data = data;\n };\n\n CustomChartView.prototype.incrementalPrepareRender = function (customSeries, ecModel, api) {\n this.group.removeAll();\n this._data = null;\n };\n\n CustomChartView.prototype.incrementalRender = function (params, customSeries, ecModel, api, payload) {\n var data = customSeries.getData();\n var renderItem = makeRenderItem(customSeries, data, ecModel, api);\n var progressiveEls = this._progressiveEls = [];\n\n function setIncrementalAndHoverLayer(el) {\n if (!el.isGroup) {\n el.incremental = true;\n el.ensureState('emphasis').hoverLayer = true;\n }\n }\n\n for (var idx = params.start; idx < params.end; idx++) {\n var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);\n\n if (el) {\n el.traverse(setIncrementalAndHoverLayer);\n progressiveEls.push(el);\n }\n }\n };\n\n CustomChartView.prototype.eachRendered = function (cb) {\n graphicUtil.traverseElements(this._progressiveEls || this.group, cb);\n };\n\n CustomChartView.prototype.filterForExposedEvent = function (eventType, query, targetEl, packedEvent) {\n var elementName = query.element;\n\n if (elementName == null || targetEl.name === elementName) {\n return true;\n } // Enable to give a name on a group made by `renderItem`, and listen\n // events that are triggered by its descendents.\n\n\n while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {\n if (targetEl.name === elementName) {\n return true;\n }\n }\n\n return false;\n };\n\n CustomChartView.type = 'custom';\n return CustomChartView;\n}(ChartView);\n\nexport default CustomChartView;\n\nfunction createEl(elOption) {\n var graphicType = elOption.type;\n var el; // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n\n if (graphicType === 'path') {\n var shape = elOption.shape; // Using pathRect brings convenience to users sacle svg path.\n\n var pathRect = shape.width != null && shape.height != null ? {\n x: shape.x || 0,\n y: shape.y || 0,\n width: shape.width,\n height: shape.height\n } : null;\n var pathData = getPathData(shape); // Path is also used for icon, so layout 'center' by default.\n\n el = graphicUtil.makePath(pathData, null, pathRect, shape.layout || 'center');\n customInnerStore(el).customPathData = pathData;\n } else if (graphicType === 'image') {\n el = new graphicUtil.Image({});\n customInnerStore(el).customImagePath = elOption.style.image;\n } else if (graphicType === 'text') {\n el = new graphicUtil.Text({}); // customInnerStore(el).customText = (elOption.style as TextStyleProps).text;\n } else if (graphicType === 'group') {\n el = new graphicUtil.Group();\n } else if (graphicType === 'compoundPath') {\n throw new Error('\"compoundPath\" is not supported yet.');\n } else {\n var Clz = graphicUtil.getShapeClass(graphicType);\n\n if (!Clz) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'graphic type \"' + graphicType + '\" can not be found.';\n }\n\n throwError(errMsg);\n }\n\n el = new Clz();\n }\n\n customInnerStore(el).customGraphicType = graphicType;\n el.name = elOption.name; // Compat ec4: the default z2 lift is 1. If changing the number,\n // some cases probably be broken: hierarchy layout along z, like circle packing,\n // where emphasis only intending to modify color/border rather than lift z2.\n\n el.z2EmphasisLift = 1;\n el.z2SelectLift = 1;\n return el;\n}\n\nfunction updateElNormal( // Can be null/undefined\napi, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {\n // Stop and restore before update any other attributes.\n stopPreviousKeyframeAnimationAndRestore(el);\n var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;\n\n if (txCfgOpt) {\n // PENDING: whether use user object directly rather than clone?\n // TODO:5.0 textConfig transition animation?\n el.setTextConfig(txCfgOpt);\n } // Default transition ['x', 'y']\n\n\n if (elOption && elOption.transition == null) {\n elOption.transition = DEFAULT_TRANSITION;\n } // Do some normalization on style.\n\n\n var styleOpt = elOption && elOption.style;\n\n if (styleOpt) {\n if (el.type === 'text') {\n var textOptionStyle = styleOpt; // Compatible with ec4: if `textFill` or `textStroke` exists use them.\n\n hasOwn(textOptionStyle, 'textFill') && (textOptionStyle.fill = textOptionStyle.textFill);\n hasOwn(textOptionStyle, 'textStroke') && (textOptionStyle.stroke = textOptionStyle.textStroke);\n }\n\n var decalPattern = void 0;\n var decalObj = isPath(el) ? styleOpt.decal : null;\n\n if (api && decalObj) {\n decalObj.dirty = true;\n decalPattern = createOrUpdatePatternFromDecal(decalObj, api);\n } // Always overwrite in case user specify this prop.\n\n\n styleOpt.__decalPattern = decalPattern;\n }\n\n if (isDisplayable(el)) {\n if (styleOpt) {\n var decalPattern = styleOpt.__decalPattern;\n\n if (decalPattern) {\n styleOpt.decal = decalPattern;\n }\n }\n }\n\n applyUpdateTransition(el, elOption, seriesModel, {\n dataIndex: dataIndex,\n isInit: isInit,\n clearStyle: true\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);\n}\n\nfunction updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {\n var elDisplayable = el.isGroup ? null : el;\n var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg; // PENDING:5.0 support customize scale change and transition animation?\n\n if (elDisplayable) {\n // By default support auto lift color when hover whether `emphasis` specified.\n var stateObj = elDisplayable.ensureState(state);\n\n if (styleOpt === false) {\n var existingEmphasisState = elDisplayable.getState(state);\n\n if (existingEmphasisState) {\n existingEmphasisState.style = null;\n }\n } else {\n // style is needed to enable default emphasis.\n stateObj.style = styleOpt || null;\n } // If `elOption.styleEmphasis` or `elOption.emphasis.style` is `false`,\n // remove hover style.\n // If `elOption.textConfig` or `elOption.emphasis.textConfig` is null/undefined, it does not\n // make sense. So for simplicity, we do not ditinguish `hasOwnProperty` and null/undefined.\n\n\n if (txCfgOpt) {\n stateObj.textConfig = txCfgOpt;\n }\n\n setDefaultStateProxy(elDisplayable);\n }\n}\n\nfunction updateZ(el, elOption, seriesModel) {\n // Group not support textContent and not support z yet.\n if (el.isGroup) {\n return;\n }\n\n var elDisplayable = el;\n var currentZ = seriesModel.currentZ;\n var currentZLevel = seriesModel.currentZLevel; // Always erase.\n\n elDisplayable.z = currentZ;\n elDisplayable.zlevel = currentZLevel; // z2 must not be null/undefined, otherwise sort error may occur.\n\n var optZ2 = elOption.z2;\n optZ2 != null && (elDisplayable.z2 = optZ2 || 0);\n\n for (var i = 0; i < STATES.length; i++) {\n updateZForEachState(elDisplayable, elOption, STATES[i]);\n }\n}\n\nfunction updateZForEachState(elDisplayable, elOption, state) {\n var isNormal = state === NORMAL;\n var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);\n var optZ2 = elStateOpt ? elStateOpt.z2 : null;\n var stateObj;\n\n if (optZ2 != null) {\n // Do not `ensureState` until required.\n stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);\n stateObj.z2 = optZ2 || 0;\n }\n}\n\nfunction makeRenderItem(customSeries, data, ecModel, api) {\n var renderItem = customSeries.get('renderItem');\n var coordSys = customSeries.coordinateSystem;\n var prepareResult = {};\n\n if (coordSys) {\n if (process.env.NODE_ENV !== 'production') {\n assert(renderItem, 'series.render is required.');\n assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.');\n } // `coordSys.prepareCustoms` is used for external coord sys like bmap.\n\n\n prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);\n }\n\n var userAPI = defaults({\n getWidth: api.getWidth,\n getHeight: api.getHeight,\n getZr: api.getZr,\n getDevicePixelRatio: api.getDevicePixelRatio,\n value: value,\n style: style,\n ordinalRawValue: ordinalRawValue,\n styleEmphasis: styleEmphasis,\n visual: visual,\n barLayout: barLayout,\n currentSeriesIndices: currentSeriesIndices,\n font: font\n }, prepareResult.api || {});\n var userParams = {\n // The life cycle of context: current round of rendering.\n // The global life cycle is probably not necessary, because\n // user can store global status by themselves.\n context: {},\n seriesId: customSeries.id,\n seriesName: customSeries.name,\n seriesIndex: customSeries.seriesIndex,\n coordSys: prepareResult.coordSys,\n dataInsideLength: data.count(),\n encode: wrapEncodeDef(customSeries.getData())\n }; // If someday intending to refactor them to a class, should consider do not\n // break change: currently these attribute member are encapsulated in a closure\n // so that do not need to force user to call these method with a scope.\n // Do not support call `api` asynchronously without dataIndexInside input.\n\n var currDataIndexInside;\n var currItemModel;\n var currItemStyleModels = {};\n var currLabelModels = {};\n var seriesItemStyleModels = {};\n var seriesLabelModels = {};\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);\n seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);\n }\n\n function getItemModel(dataIndexInside) {\n return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);\n }\n\n function getItemStyleModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);\n }\n\n function getLabelModel(dataIndexInside, state) {\n return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel(dataIndexInside).getModel(PATH_LABEL[state]);\n }\n\n return function (dataIndexInside, payload) {\n currDataIndexInside = dataIndexInside;\n currItemModel = null;\n currItemStyleModels = {};\n currLabelModels = {};\n return renderItem && renderItem(defaults({\n dataIndexInside: dataIndexInside,\n dataIndex: data.getRawIndex(dataIndexInside),\n // Can be used for optimization when zoom or roam.\n actionType: payload ? payload.type : null\n }, userParams), userAPI);\n };\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n function value(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);\n }\n /**\r\n * @public\r\n * @param dim by default 0.\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function ordinalRawValue(dim, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n dim = dim || 0;\n var dimInfo = data.getDimensionInfo(dim);\n\n if (!dimInfo) {\n var dimIndex = data.getDimensionIndex(dim);\n return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : undefined;\n }\n\n var val = data.get(dimInfo.name, dataIndexInside);\n var ordinalMeta = dimInfo && dimInfo.ordinalMeta;\n return ordinalMeta ? ordinalMeta.categories[val] : val;\n }\n /**\r\n * @deprecated The original intention of `api.style` is enable to set itemStyle\r\n * like other series. But it is not necessary and not easy to give a strict definition\r\n * of what it returns. And since echarts5 it needs to be make compat work. So\r\n * deprecates it since echarts5.\r\n *\r\n * By default, `visual` is applied to style (to support visualMap).\r\n * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`,\r\n * it can be implemented as:\r\n * `api.style({stroke: api.visual('color'), fill: null})`;\r\n *\r\n * [Compat]: since ec5, RectText has been separated from its hosts el.\r\n * so `api.style()` will only return the style from `itemStyle` but not handle `label`\r\n * any more. But `series.label` config is never published in doc.\r\n * We still compat it in `api.style()`. But not encourage to use it and will still not\r\n * to pulish it to doc.\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function style(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.style', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var style = data.getItemVisual(dataIndexInside, 'style');\n var visualColor = style && style.fill;\n var opacity = style && style.opacity;\n var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();\n visualColor != null && (itemStyle.fill = visualColor);\n opacity != null && (itemStyle.opacity = opacity);\n var opt = {\n inheritColor: isString(visualColor) ? visualColor : '#000'\n };\n var labelModel = getLabelModel(dataIndexInside, NORMAL); // Now that the feature of \"auto adjust text fill/stroke\" has been migrated to zrender\n // since ec5, we should set `isAttached` as `false` here and make compat in\n // `convertToEC4StyleForCustomSerise`.\n\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, opt, false, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, opt, false);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n /**\r\n * @deprecated The reason see `api.style()`\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function styleEmphasis(userProps, dataIndexInside) {\n if (process.env.NODE_ENV !== 'production') {\n warnDeprecated('api.styleEmphasis', 'Please write literal style directly instead.');\n }\n\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();\n var labelModel = getLabelModel(dataIndexInside, EMPHASIS);\n var textStyle = labelStyleHelper.createTextStyle(labelModel, null, null, true, true);\n textStyle.text = labelModel.getShallow('show') ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;\n var textConfig = labelStyleHelper.createTextConfig(labelModel, null, true);\n preFetchFromExtra(userProps, itemStyle);\n itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);\n userProps && applyUserPropsAfter(itemStyle, userProps);\n itemStyle.legacy = true;\n return itemStyle;\n }\n\n function applyUserPropsAfter(itemStyle, extra) {\n for (var key in extra) {\n if (hasOwn(extra, key)) {\n itemStyle[key] = extra[key];\n }\n }\n }\n\n function preFetchFromExtra(extra, itemStyle) {\n // A trick to retrieve those props firstly, which are used to\n // apply auto inside fill/stroke in `convertToEC4StyleForCustomSerise`.\n // (It's not reasonable but only for a degree of compat)\n if (extra) {\n extra.textFill && (itemStyle.textFill = extra.textFill);\n extra.textPosition && (itemStyle.textPosition = extra.textPosition);\n }\n }\n /**\r\n * @public\r\n * @param dataIndexInside by default `currDataIndexInside`.\r\n */\n\n\n function visual(visualType, dataIndexInside) {\n dataIndexInside == null && (dataIndexInside = currDataIndexInside);\n\n if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {\n var style_1 = data.getItemVisual(dataIndexInside, 'style');\n return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;\n } // Only support these visuals. Other visual might be inner tricky\n // for performance (like `style`), do not expose to users.\n\n\n if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {\n return data.getItemVisual(dataIndexInside, visualType);\n }\n }\n /**\r\n * @public\r\n * @return If not support, return undefined.\r\n */\n\n\n function barLayout(opt) {\n if (coordSys.type === 'cartesian2d') {\n var baseAxis = coordSys.getBaseAxis();\n return getLayoutOnAxis(defaults({\n axis: baseAxis\n }, opt));\n }\n }\n /**\r\n * @public\r\n */\n\n\n function currentSeriesIndices() {\n return ecModel.getCurrentSeriesIndices();\n }\n /**\r\n * @public\r\n * @return font string\r\n */\n\n\n function font(opt) {\n return labelStyleHelper.getFont(opt, ecModel);\n }\n}\n\nfunction wrapEncodeDef(data) {\n var encodeDef = {};\n each(data.dimensions, function (dimName) {\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isExtraCoord) {\n var coordDim = dimInfo.coordDim;\n var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];\n dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);\n }\n });\n return encodeDef;\n}\n\nfunction createOrUpdateItem(api, existsEl, dataIndex, elOption, seriesModel, group, data) {\n // [Rule]\n // If `renderItem` returns `null`/`undefined`/`false`, remove the previous el if existing.\n // (It seems that violate the \"merge\" principle, but most of users probably intuitively\n // regard \"return;\" as \"show nothing element whatever\", so make a exception to meet the\n // most cases.)\n // The rule or \"merge\" see [STRATEGY_MERGE].\n // If `elOption` is `null`/`undefined`/`false` (when `renderItem` returns nothing).\n if (!elOption) {\n group.remove(existsEl);\n return;\n }\n\n var el = doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group);\n el && data.setItemGraphicEl(dataIndex, el);\n el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);\n return el;\n}\n\nfunction doCreateOrUpdateEl(api, existsEl, dataIndex, elOption, seriesModel, group) {\n if (process.env.NODE_ENV !== 'production') {\n assert(elOption, 'should not have an null/undefined element setting');\n }\n\n var toBeReplacedIdx = -1;\n var oldEl = existsEl;\n\n if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel) // || (\n // // PENDING: even in one-to-one mapping case, if el is marked as morph,\n // // do not sure whether the el will be mapped to another el with different\n // // hierarchy in Group tree. So always recreate el rather than reuse the el.\n // morphHelper && morphHelper.isOneToOneFrom(el)\n // )\n ) {\n // Should keep at the original index, otherwise \"merge by index\" will be incorrect.\n toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);\n existsEl = null;\n }\n\n var isInit = !existsEl;\n var el = existsEl;\n\n if (!el) {\n el = createEl(elOption);\n\n if (oldEl) {\n copyElement(oldEl, el);\n }\n } else {\n // FIMXE:NEXT unified clearState?\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n el.clearStates();\n } // Need to set morph: false explictly to disable automatically morphing.\n\n\n if (elOption.morph === false) {\n el.disableMorphing = true;\n } else if (el.disableMorphing) {\n el.disableMorphing = false;\n }\n\n attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;\n attachedTxInfoTmp.isLegacy = false;\n doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);\n doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);\n updateElNormal(api, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit); // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n // Update them only when user specified, otherwise, remain.\n\n hasOwn(elOption, 'info') && (customInnerStore(el).info = elOption.info);\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var otherStateOpt = retrieveStateOption(elOption, stateName);\n var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);\n updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);\n }\n }\n\n updateZ(el, elOption, seriesModel);\n\n if (elOption.type === 'group') {\n mergeChildren(api, el, dataIndex, elOption, seriesModel);\n }\n\n if (toBeReplacedIdx >= 0) {\n group.replaceAt(el, toBeReplacedIdx);\n } else {\n group.add(el);\n }\n\n return el;\n} // `el` must not be null/undefined.\n\n\nfunction doesElNeedRecreate(el, elOption, seriesModel) {\n var elInner = customInnerStore(el);\n var elOptionType = elOption.type;\n var elOptionShape = elOption.shape;\n var elOptionStyle = elOption.style;\n return (// Always create new if universal transition is enabled.\n // Because we do transition after render. It needs to know what old element is. Replacement will loose it.\n seriesModel.isUniversalTransitionEnabled() // If `elOptionType` is `null`, follow the merge principle.\n || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === 'path' && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === 'image' && hasOwn(elOptionStyle, 'image') && elOptionStyle.image !== elInner.customImagePath // // FIXME test and remove this restriction?\n // || (elOptionType === 'text'\n // && hasOwn(elOptionStyle, 'text')\n // && (elOptionStyle as TextStyleProps).text !== elInner.customText\n // )\n\n );\n}\n\nfunction doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {\n // Based on the \"merge\" principle, if no clipPath provided,\n // do nothing. The exists clip will be totally removed only if\n // `el.clipPath` is `false`. Otherwise it will be merged/replaced.\n var clipPathOpt = elOption.clipPath;\n\n if (clipPathOpt === false) {\n if (el && el.getClipPath()) {\n el.removeClipPath();\n }\n } else if (clipPathOpt) {\n var clipPath = el.getClipPath();\n\n if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {\n clipPath = null;\n }\n\n if (!clipPath) {\n clipPath = createEl(clipPathOpt);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(isPath(clipPath), 'Only any type of `path` can be used in `clipPath`, rather than ' + clipPath.type + '.');\n }\n\n el.setClipPath(clipPath);\n }\n\n updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);\n } // If not define `clipPath` in option, do nothing unnecessary.\n\n}\n\nfunction doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {\n // Group does not support textContent temporarily until necessary.\n if (el.isGroup) {\n return;\n } // Normal must be called before emphasis, for `isLegacy` detection.\n\n\n processTxInfo(elOption, null, attachedTxInfo);\n processTxInfo(elOption, EMPHASIS, attachedTxInfo); // If `elOption.textConfig` or `elOption.textContent` is null/undefined, it does not make sense.\n // So for simplicity, if \"elOption hasOwnProperty of them but be null/undefined\", we do not\n // trade them as set to null to el.\n // Especially:\n // `elOption.textContent: false` means remove textContent.\n // `elOption.textContent.emphasis.style: false` means remove the style from emphasis state.\n\n var txConOptNormal = attachedTxInfo.normal.conOpt;\n var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;\n var txConOptBlur = attachedTxInfo.blur.conOpt;\n var txConOptSelect = attachedTxInfo.select.conOpt;\n\n if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {\n var textContent = el.getTextContent();\n\n if (txConOptNormal === false) {\n textContent && el.removeTextContent();\n } else {\n txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {\n type: 'text'\n };\n\n if (!textContent) {\n textContent = createEl(txConOptNormal);\n el.setTextContent(textContent);\n } else {\n // If in some case the performance issue arised, consider\n // do not clearState but update cached normal state directly.\n textContent.clearStates();\n }\n\n updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);\n var txConStlOptNormal = txConOptNormal && txConOptNormal.style;\n\n for (var i = 0; i < STATES.length; i++) {\n var stateName = STATES[i];\n\n if (stateName !== NORMAL) {\n var txConOptOtherState = attachedTxInfo[stateName].conOpt;\n updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);\n }\n }\n\n txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();\n }\n }\n}\n\nfunction processTxInfo(elOption, state, attachedTxInfo) {\n var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);\n var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);\n var elType = elOption.type;\n var txCfg = stateOpt ? stateOpt.textConfig : null;\n var txConOptNormal = elOption.textContent;\n var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);\n\n if (styleOpt && ( // Because emphasis style has little info to detect legacy,\n // if normal is legacy, emphasis is trade as legacy.\n attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {\n attachedTxInfo.isLegacy = true;\n var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state); // Explicitly specified `textConfig` and `textContent` has higher priority than\n // the ones generated by legacy style. Otherwise if users use them and `api.style`\n // at the same time, they not both work and hardly to known why.\n\n if (!txCfg && convertResult.textConfig) {\n txCfg = convertResult.textConfig;\n }\n\n if (!txConOpt && convertResult.textContent) {\n txConOpt = convertResult.textContent;\n }\n }\n\n if (!state && txConOpt) {\n var txConOptNormal_1 = txConOpt; // `textContent: {type: 'text'}`, the \"type\" is easy to be missing. So we tolerate it.\n\n !txConOptNormal_1.type && (txConOptNormal_1.type = 'text');\n\n if (process.env.NODE_ENV !== 'production') {\n // Do not tolerate incorrcet type for forward compat.\n assert(txConOptNormal_1.type === 'text', 'textContent.type must be \"text\"');\n }\n }\n\n var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];\n info.cfg = txCfg;\n info.conOpt = txConOpt;\n}\n\nfunction retrieveStateOption(elOption, state) {\n return !state ? elOption : elOption ? elOption[state] : null;\n}\n\nfunction retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {\n var style = stateOption && stateOption.style;\n\n if (style == null && state === EMPHASIS && stateOptionNormal) {\n style = stateOptionNormal.styleEmphasis;\n }\n\n return style;\n} // Usage:\n// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates\n// that the existing children will not be removed, and enables the feature\n// that update some of the props of some of the children simply by construct\n// the returned children of `renderItem` like:\n// `var children = group.children = []; children[3] = {opacity: 0.5};`\n// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children\n// by child.name. But that might be lower performance.\n// (3) If `elOption.$mergeChildren` is `false`, the existing children will be\n// replaced totally.\n// (4) If `!elOption.children`, following the \"merge\" principle, nothing will\n// happen.\n// (5) If `elOption.$mergeChildren` is not `false` neither `'byName'` and the\n// `el` is a group, and if any of the new child is null, it means to remove\n// the element at the same index, if exists. On the other hand, if the new\n// child is and empty object `{}`, it means to keep the element not changed.\n//\n// For implementation simpleness, do not provide a direct way to remove single\n// child (otherwise the total indices of the children array have to be modified).\n// User can remove a single child by setting its `ignore` to `true`.\n\n\nfunction mergeChildren(api, el, dataIndex, elOption, seriesModel) {\n var newChildren = elOption.children;\n var newLen = newChildren ? newChildren.length : 0;\n var mergeChildren = elOption.$mergeChildren; // `diffChildrenByName` has been deprecated.\n\n var byName = mergeChildren === 'byName' || elOption.diffChildrenByName;\n var notMerge = mergeChildren === false; // For better performance on roam update, only enter if necessary.\n\n if (!newLen && !byName && !notMerge) {\n return;\n }\n\n if (byName) {\n diffGroupChildren({\n api: api,\n oldChildren: el.children() || [],\n newChildren: newChildren || [],\n dataIndex: dataIndex,\n seriesModel: seriesModel,\n group: el\n });\n return;\n }\n\n notMerge && el.removeAll(); // Mapping children of a group simply by index, which\n // might be better performance.\n\n var index = 0;\n\n for (; index < newLen; index++) {\n var newChild = newChildren[index];\n var oldChild = el.childAt(index);\n\n if (newChild) {\n if (newChild.ignore == null) {\n // The old child is set to be ignored if null (see comments\n // below). So we need to set ignore to be false back.\n newChild.ignore = false;\n }\n\n doCreateOrUpdateEl(api, oldChild, dataIndex, newChild, seriesModel, el);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n assert(oldChild, 'renderItem should not return a group containing elements' + ' as null/undefined/{} if they do not exist before.');\n } // If the new element option is null, it means to remove the old\n // element. But we cannot really remove the element from the group\n // directly, because the element order may not be stable when this\n // element is added back. So we set the element to be ignored.\n\n\n oldChild.ignore = true;\n }\n }\n\n for (var i = el.childCount() - 1; i >= index; i--) {\n var child = el.childAt(i);\n removeChildFromGroup(el, child, seriesModel);\n }\n}\n\nfunction removeChildFromGroup(group, child, seriesModel) {\n // Do not support leave elements that are not mentioned in the latest\n // `renderItem` return. Otherwise users may not have a clear and simple\n // concept that how to control all of the elements.\n child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);\n}\n\nfunction diffGroupChildren(context) {\n new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();\n}\n\nfunction getKey(item, idx) {\n var name = item && item.name;\n return name != null ? name : GROUP_DIFF_PREFIX + idx;\n}\n\nfunction processAddUpdate(newIndex, oldIndex) {\n var context = this.context;\n var childOption = newIndex != null ? context.newChildren[newIndex] : null;\n var child = oldIndex != null ? context.oldChildren[oldIndex] : null;\n doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);\n}\n\nfunction processRemove(oldIndex) {\n var context = this.context;\n var child = context.oldChildren[oldIndex];\n child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);\n}\n/**\r\n * @return SVG Path data.\r\n */\n\n\nfunction getPathData(shape) {\n // \"d\" follows the SVG convention.\n return shape && (shape.pathData || shape.d);\n}\n\nfunction hasOwnPathData(shape) {\n return shape && (hasOwn(shape, 'pathData') || hasOwn(shape, 'd'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CustomSeriesModel from './CustomSeries.js';\nimport CustomChartView from './CustomView.js';\nexport function install(registers) {\n registers.registerChartView(CustomChartView);\n registers.registerSeriesModel(CustomSeriesModel);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as axisPointerModelHelper from './modelHelper.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar clone = zrUtil.clone;\nvar bind = zrUtil.bind;\n/**\r\n * Base axis pointer class in 2D.\r\n */\n\nvar BaseAxisPointer =\n/** @class */\nfunction () {\n function BaseAxisPointer() {\n this._dragging = false;\n /**\r\n * In px, arbitrary value. Do not set too small,\r\n * no animation is ok for most cases.\r\n */\n\n this.animationThreshold = 15;\n }\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.render = function (axisModel, axisPointerModel, api, forceRender) {\n var value = axisPointerModel.get('value');\n var status = axisPointerModel.get('status'); // Bind them to `this`, not in closure, otherwise they will not\n // be replaced when user calling setOption in not merge mode.\n\n this._axisModel = axisModel;\n this._axisPointerModel = axisPointerModel;\n this._api = api; // Optimize: `render` will be called repeatedly during mouse move.\n // So it is power consuming if performing `render` each time,\n // especially on mobile device.\n\n if (!forceRender && this._lastValue === value && this._lastStatus === status) {\n return;\n }\n\n this._lastValue = value;\n this._lastStatus = status;\n var group = this._group;\n var handle = this._handle;\n\n if (!status || status === 'hide') {\n // Do not clear here, for animation better.\n group && group.hide();\n handle && handle.hide();\n return;\n }\n\n group && group.show();\n handle && handle.show(); // Otherwise status is 'show'\n\n var elOption = {};\n this.makeElOption(elOption, value, axisModel, axisPointerModel, api); // Enable change axis pointer type.\n\n var graphicKey = elOption.graphicKey;\n\n if (graphicKey !== this._lastGraphicKey) {\n this.clear(api);\n }\n\n this._lastGraphicKey = graphicKey;\n var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);\n\n if (!group) {\n group = this._group = new graphic.Group();\n this.createPointerEl(group, elOption, axisModel, axisPointerModel);\n this.createLabelEl(group, elOption, axisModel, axisPointerModel);\n api.getZr().add(group);\n } else {\n var doUpdateProps = zrUtil.curry(updateProps, axisPointerModel, moveAnimation);\n this.updatePointerEl(group, elOption, doUpdateProps);\n this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);\n }\n\n updateMandatoryProps(group, axisPointerModel, true);\n\n this._renderHandle(value);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.remove = function (api) {\n this.clear(api);\n };\n /**\r\n * @implement\r\n */\n\n\n BaseAxisPointer.prototype.dispose = function (api) {\n this.clear(api);\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.determineAnimation = function (axisModel, axisPointerModel) {\n var animation = axisPointerModel.get('animation');\n var axis = axisModel.axis;\n var isCategoryAxis = axis.type === 'category';\n var useSnap = axisPointerModel.get('snap'); // Value axis without snap always do not snap.\n\n if (!useSnap && !isCategoryAxis) {\n return false;\n }\n\n if (animation === 'auto' || animation == null) {\n var animationThreshold = this.animationThreshold;\n\n if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {\n return true;\n } // It is important to auto animation when snap used. Consider if there is\n // a dataZoom, animation will be disabled when too many points exist, while\n // it will be enabled for better visual effect when little points exist.\n\n\n if (useSnap) {\n var seriesDataCount = axisPointerModelHelper.getAxisInfo(axisModel).seriesDataCount;\n var axisExtent = axis.getExtent(); // Approximate band width\n\n return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;\n }\n\n return false;\n }\n\n return animation === true;\n };\n /**\r\n * add {pointer, label, graphicKey} to elOption\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {// Should be implemenented by sub-class.\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createPointerEl = function (group, elOption, axisModel, axisPointerModel) {\n var pointerOption = elOption.pointer;\n\n if (pointerOption) {\n var pointerEl = inner(group).pointerEl = new graphic[pointerOption.type](clone(elOption.pointer));\n group.add(pointerEl);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.createLabelEl = function (group, elOption, axisModel, axisPointerModel) {\n if (elOption.label) {\n var labelEl = inner(group).labelEl = new graphic.Text(clone(elOption.label));\n group.add(labelEl);\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updatePointerEl = function (group, elOption, updateProps) {\n var pointerEl = inner(group).pointerEl;\n\n if (pointerEl && elOption.pointer) {\n pointerEl.setStyle(elOption.pointer.style);\n updateProps(pointerEl, {\n shape: elOption.pointer.shape\n });\n }\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.updateLabelEl = function (group, elOption, updateProps, axisPointerModel) {\n var labelEl = inner(group).labelEl;\n\n if (labelEl) {\n labelEl.setStyle(elOption.label.style);\n updateProps(labelEl, {\n // Consider text length change in vertical axis, animation should\n // be used on shape, otherwise the effect will be weird.\n // TODOTODO\n // shape: elOption.label.shape,\n x: elOption.label.x,\n y: elOption.label.y\n });\n updateLabelShowHide(labelEl, axisPointerModel);\n }\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype._renderHandle = function (value) {\n if (this._dragging || !this.updateHandleTransform) {\n return;\n }\n\n var axisPointerModel = this._axisPointerModel;\n\n var zr = this._api.getZr();\n\n var handle = this._handle;\n var handleModel = axisPointerModel.getModel('handle');\n var status = axisPointerModel.get('status');\n\n if (!handleModel.get('show') || !status || status === 'hide') {\n handle && zr.remove(handle);\n this._handle = null;\n return;\n }\n\n var isInit;\n\n if (!this._handle) {\n isInit = true;\n handle = this._handle = graphic.createIcon(handleModel.get('icon'), {\n cursor: 'move',\n draggable: true,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n onmousedown: bind(this._onHandleDragMove, this, 0, 0),\n drift: bind(this._onHandleDragMove, this),\n ondragend: bind(this._onHandleDragEnd, this)\n });\n zr.add(handle);\n }\n\n updateMandatoryProps(handle, axisPointerModel, false); // update style\n\n handle.setStyle(handleModel.getItemStyle(null, ['color', 'borderColor', 'borderWidth', 'opacity', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'])); // update position\n\n var handleSize = handleModel.get('size');\n\n if (!zrUtil.isArray(handleSize)) {\n handleSize = [handleSize, handleSize];\n }\n\n handle.scaleX = handleSize[0] / 2;\n handle.scaleY = handleSize[1] / 2;\n throttleUtil.createOrUpdate(this, '_doDispatchAxisPointer', handleModel.get('throttle') || 0, 'fixRate');\n\n this._moveHandleToValue(value, isInit);\n };\n\n BaseAxisPointer.prototype._moveHandleToValue = function (value, isInit) {\n updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));\n };\n\n BaseAxisPointer.prototype._onHandleDragMove = function (dx, dy) {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n this._dragging = true; // Persistent for throttle.\n\n var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);\n this._payloadInfo = trans;\n handle.stopAnimation();\n handle.attr(getHandleTransProps(trans));\n inner(handle).lastProp = null;\n\n this._doDispatchAxisPointer();\n };\n /**\r\n * Throttled method.\r\n */\n\n\n BaseAxisPointer.prototype._doDispatchAxisPointer = function () {\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var payloadInfo = this._payloadInfo;\n var axisModel = this._axisModel;\n\n this._api.dispatchAction({\n type: 'updateAxisPointer',\n x: payloadInfo.cursorPoint[0],\n y: payloadInfo.cursorPoint[1],\n tooltipOption: payloadInfo.tooltipOption,\n axesInfo: [{\n axisDim: axisModel.axis.dim,\n axisIndex: axisModel.componentIndex\n }]\n });\n };\n\n BaseAxisPointer.prototype._onHandleDragEnd = function () {\n this._dragging = false;\n var handle = this._handle;\n\n if (!handle) {\n return;\n }\n\n var value = this._axisPointerModel.get('value'); // Consider snap or categroy axis, handle may be not consistent with\n // axisPointer. So move handle to align the exact value position when\n // drag ended.\n\n\n this._moveHandleToValue(value); // For the effect: tooltip will be shown when finger holding on handle\n // button, and will be hidden after finger left handle button.\n\n\n this._api.dispatchAction({\n type: 'hideTip'\n });\n };\n /**\r\n * @private\r\n */\n\n\n BaseAxisPointer.prototype.clear = function (api) {\n this._lastValue = null;\n this._lastStatus = null;\n var zr = api.getZr();\n var group = this._group;\n var handle = this._handle;\n\n if (zr && group) {\n this._lastGraphicKey = null;\n group && zr.remove(group);\n handle && zr.remove(handle);\n this._group = null;\n this._handle = null;\n this._payloadInfo = null;\n }\n\n throttleUtil.clear(this, '_doDispatchAxisPointer');\n };\n /**\r\n * @protected\r\n */\n\n\n BaseAxisPointer.prototype.doClear = function () {// Implemented by sub-class if necessary.\n };\n\n BaseAxisPointer.prototype.buildLabel = function (xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n };\n\n return BaseAxisPointer;\n}();\n\nfunction updateProps(animationModel, moveAnimation, el, props) {\n // Animation optimize.\n if (!propsEqual(inner(el).lastProp, props)) {\n inner(el).lastProp = props;\n moveAnimation ? graphic.updateProps(el, props, animationModel) : (el.stopAnimation(), el.attr(props));\n }\n}\n\nfunction propsEqual(lastProps, newProps) {\n if (zrUtil.isObject(lastProps) && zrUtil.isObject(newProps)) {\n var equals_1 = true;\n zrUtil.each(newProps, function (item, key) {\n equals_1 = equals_1 && propsEqual(lastProps[key], item);\n });\n return !!equals_1;\n } else {\n return lastProps === newProps;\n }\n}\n\nfunction updateLabelShowHide(labelEl, axisPointerModel) {\n labelEl[axisPointerModel.get(['label', 'show']) ? 'show' : 'hide']();\n}\n\nfunction getHandleTransProps(trans) {\n return {\n x: trans.x || 0,\n y: trans.y || 0,\n rotation: trans.rotation || 0\n };\n}\n\nfunction updateMandatoryProps(group, axisPointerModel, silent) {\n var z = axisPointerModel.get('z');\n var zlevel = axisPointerModel.get('zlevel');\n group && group.traverse(function (el) {\n if (el.type !== 'group') {\n z != null && (el.z = z);\n zlevel != null && (el.zlevel = zlevel);\n el.silent = silent;\n }\n });\n}\n\nexport default BaseAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nexport function buildElStyle(axisPointerModel) {\n var axisPointerType = axisPointerModel.get('type');\n var styleModel = axisPointerModel.getModel(axisPointerType + 'Style');\n var style;\n\n if (axisPointerType === 'line') {\n style = styleModel.getLineStyle();\n style.fill = null;\n } else if (axisPointerType === 'shadow') {\n style = styleModel.getAreaStyle();\n style.stroke = null;\n }\n\n return style;\n}\n/**\r\n * @param {Function} labelPos {align, verticalAlign, position}\r\n */\n\nexport function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) {\n var value = axisPointerModel.get('value');\n var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n });\n var labelModel = axisPointerModel.getModel('label');\n var paddings = formatUtil.normalizeCssArray(labelModel.get('padding') || 0);\n var font = labelModel.getFont();\n var textRect = textContain.getBoundingRect(text, font);\n var position = labelPos.position;\n var width = textRect.width + paddings[1] + paddings[3];\n var height = textRect.height + paddings[0] + paddings[2]; // Adjust by align.\n\n var align = labelPos.align;\n align === 'right' && (position[0] -= width);\n align === 'center' && (position[0] -= width / 2);\n var verticalAlign = labelPos.verticalAlign;\n verticalAlign === 'bottom' && (position[1] -= height);\n verticalAlign === 'middle' && (position[1] -= height / 2); // Not overflow ec container\n\n confineInContainer(position, width, height, api);\n var bgColor = labelModel.get('backgroundColor');\n\n if (!bgColor || bgColor === 'auto') {\n bgColor = axisModel.get(['axisLine', 'lineStyle', 'color']);\n }\n\n elOption.label = {\n // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},\n x: position[0],\n y: position[1],\n style: createTextStyle(labelModel, {\n text: text,\n font: font,\n fill: labelModel.getTextColor(),\n padding: paddings,\n backgroundColor: bgColor\n }),\n // Label should be over axisPointer.\n z2: 10\n };\n} // Do not overflow ec container\n\nfunction confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}\n\nexport function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {\n value = axis.scale.parse(value);\n var text = axis.scale.getLabel({\n value: value\n }, {\n // If `precision` is set, width can be fixed (like '12.00500'), which\n // helps to debounce when when moving label.\n precision: opt.precision\n });\n var formatter = opt.formatter;\n\n if (formatter) {\n var params_1 = {\n value: axisHelper.getAxisRawValue(axis, {\n value: value\n }),\n axisDimension: axis.dim,\n axisIndex: axis.index,\n seriesData: []\n };\n zrUtil.each(seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var dataParams = series && series.getDataParams(dataIndex);\n dataParams && params_1.seriesData.push(dataParams);\n });\n\n if (zrUtil.isString(formatter)) {\n text = formatter.replace('{value}', text);\n } else if (zrUtil.isFunction(formatter)) {\n text = formatter(params_1);\n }\n }\n\n return text;\n}\nexport function getTransformedPosition(axis, value, layoutInfo) {\n var transform = matrix.create();\n matrix.rotate(transform, transform, layoutInfo.rotation);\n matrix.translate(transform, transform, layoutInfo.position);\n return graphic.applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform);\n}\nexport function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api) {\n // @ts-ignore\n var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);\n layoutInfo.labelMargin = axisPointerModel.get(['label', 'margin']);\n buildLabelElOption(elOption, axisModel, axisPointerModel, api, {\n position: getTransformedPosition(axisModel.axis, value, layoutInfo),\n align: textLayout.textAlign,\n verticalAlign: textLayout.textVerticalAlign\n });\n}\nexport function makeLineShape(p1, p2, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x1: p1[xDimIndex],\n y1: p1[1 - xDimIndex],\n x2: p2[xDimIndex],\n y2: p2[1 - xDimIndex]\n };\n}\nexport function makeRectShape(xy, wh, xDimIndex) {\n xDimIndex = xDimIndex || 0;\n return {\n x: xy[xDimIndex],\n y: xy[1 - xDimIndex],\n width: wh[xDimIndex],\n height: wh[1 - xDimIndex]\n };\n}\nexport function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {\n return {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n startAngle: startAngle,\n endAngle: endAngle,\n clockwise: true\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as cartesianAxisHelper from '../../coord/cartesian/cartesianAxisHelper.js';\n\nvar CartesianAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisPointer, _super);\n\n function CartesianAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var pos = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: pos[0],\n y: pos[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\r\n * @override\r\n */\n\n\n CartesianAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n };\n\n return CartesianAxisPointer;\n}(BaseAxisPointer);\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nexport default CartesianAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar AxisPointerModel =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerModel, _super);\n\n function AxisPointerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerModel.type;\n return _this;\n }\n\n AxisPointerModel.type = 'axisPointer';\n AxisPointerModel.defaultOption = {\n // 'auto' means that show when triggered by tooltip or handle.\n show: 'auto',\n // zlevel: 0,\n z: 50,\n type: 'line',\n // axispointer triggered by tootip determine snap automatically,\n // see `modelHelper`.\n snap: false,\n triggerTooltip: true,\n triggerEmphasis: true,\n value: null,\n status: null,\n link: [],\n // Do not set 'auto' here, otherwise global animation: false\n // will not effect at this axispointer.\n animation: null,\n animationDurationUpdate: 200,\n lineStyle: {\n color: '#B9BEC9',\n width: 1,\n type: 'dashed'\n },\n shadowStyle: {\n color: 'rgba(210,219,238,0.2)'\n },\n label: {\n show: true,\n formatter: null,\n precision: 'auto',\n margin: 3,\n color: '#fff',\n padding: [5, 7, 5, 7],\n backgroundColor: 'auto',\n borderColor: null,\n borderWidth: 0,\n borderRadius: 3\n },\n handle: {\n show: false,\n // eslint-disable-next-line\n 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',\n size: 45,\n // handle margin is from symbol center to axis, which is stable when circular move.\n margin: 50,\n // color: '#1b8bbd'\n // color: '#2f4554'\n color: '#333',\n shadowBlur: 3,\n shadowColor: '#aaa',\n shadowOffsetX: 0,\n shadowOffsetY: 2,\n // For mobile performance\n throttle: 40\n }\n };\n return AxisPointerModel;\n}(ComponentModel);\n\nexport default AxisPointerModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\r\n * @param {string} key\r\n * @param {module:echarts/ExtensionAPI} api\r\n * @param {Function} handler\r\n * param: {string} currTrigger\r\n * param: {Array.} point\r\n */\n\nexport function register(key, api, handler) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\n\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave);\n\n useHandler('globalout', onLeave);\n\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\n\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\n\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\n\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\n\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n }; // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\n\nexport function unregister(key, api) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n\n if (record) {\n inner(zr).records[key] = null;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as globalListener from './globalListener.js';\nimport ComponentView from '../../view/Component.js';\n\nvar AxisPointerView =\n/** @class */\nfunction (_super) {\n __extends(AxisPointerView, _super);\n\n function AxisPointerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AxisPointerView.type;\n return _this;\n }\n\n AxisPointerView.prototype.render = function (globalAxisPointerModel, ecModel, api) {\n var globalTooltipModel = ecModel.getComponent('tooltip');\n var triggerOn = globalAxisPointerModel.get('triggerOn') || globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'; // Register global listener in AxisPointerView to enable\n // AxisPointerView to be independent to Tooltip.\n\n globalListener.register('axisPointer', api, function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none' && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0)) {\n dispatchAction({\n type: 'updateAxisPointer',\n currTrigger: currTrigger,\n x: e && e.offsetX,\n y: e && e.offsetY\n });\n }\n });\n };\n\n AxisPointerView.prototype.remove = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.prototype.dispose = function (ecModel, api) {\n globalListener.unregister('axisPointer', api);\n };\n\n AxisPointerView.type = 'axisPointer';\n return AxisPointerView;\n}(ComponentView);\n\nexport default AxisPointerView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\n/**\r\n * @param finder contains {seriesIndex, dataIndex, dataIndexInside}\r\n * @param ecModel\r\n * @return {point: [x, y], el: ...} point Will not be null.\r\n */\n\nexport default function findPointFromSeries(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n if (finder.isStacked) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueAxisDim = valueAxis.dim;\n var baseAxisDim = baseAxis.dim;\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var baseDim = data.mapDimension(baseAxisDim);\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(baseDim, dataIndex);\n stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo('stackResultDimension'), dataIndex);\n point = coordSys.dataToPoint(stackedData) || [];\n } else {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex)) || [];\n }\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n\n return {\n point: point,\n el: el\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { makeInner } from '../../util/model.js';\nimport * as modelHelper from './modelHelper.js';\nimport findPointFromSeries from './findPointFromSeries.js';\nimport { each, curry, bind, extend } from 'zrender/lib/core/util.js';\nvar inner = makeInner();\n/**\r\n * Basic logic: check all axis, if they do not demand show/highlight,\r\n * then hide/downplay them.\r\n *\r\n * @return content of event obj for echarts.connect.\r\n */\n\nexport default function axisTrigger(payload, ecModel, api) {\n var currTrigger = payload.currTrigger;\n var point = [payload.x, payload.y];\n var finder = payload;\n var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api);\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; // Pending\n // See #6121. But we are not able to reproduce it yet.\n\n if (!coordSysAxesInfo) {\n return;\n }\n\n if (illegalPoint(point)) {\n // Used in the default behavior of `connection`: use the sample seriesIndex\n // and dataIndex. And also used in the tooltipView trigger.\n point = findPointFromSeries({\n seriesIndex: finder.seriesIndex,\n // Do not use dataIndexInside from other ec instance.\n // FIXME: auto detect it?\n dataIndex: finder.dataIndex\n }, ecModel).point;\n }\n\n var isIllegalPoint = illegalPoint(point); // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}).\n // Notice: In this case, it is difficult to get the `point` (which is necessary to show\n // tooltip, so if point is not given, we just use the point found by sample seriesIndex\n // and dataIndex.\n\n var inputAxesInfo = finder.axesInfo;\n var axesInfo = coordSysAxesInfo.axesInfo;\n var shouldHide = currTrigger === 'leave' || illegalPoint(point);\n var outputPayload = {};\n var showValueMap = {};\n var dataByCoordSys = {\n list: [],\n map: {}\n };\n var updaters = {\n showPointer: curry(showPointer, showValueMap),\n showTooltip: curry(showTooltip, dataByCoordSys)\n }; // Process for triggered axes.\n\n each(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) {\n // If a point given, it must be contained by the coordinate system.\n var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);\n each(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) {\n var axis = axisInfo.axis;\n var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); // If no inputAxesInfo, no axis is restricted.\n\n if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {\n var val = inputAxisInfo && inputAxisInfo.value;\n\n if (val == null && !isIllegalPoint) {\n val = axis.pointToData(point);\n }\n\n val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);\n }\n });\n }); // Process for linked axes.\n\n var linkTriggers = {};\n each(axesInfo, function (tarAxisInfo, tarKey) {\n var linkGroup = tarAxisInfo.linkGroup; // If axis has been triggered in the previous stage, it should not be triggered by link.\n\n if (linkGroup && !showValueMap[tarKey]) {\n each(linkGroup.axesInfo, function (srcAxisInfo, srcKey) {\n var srcValItem = showValueMap[srcKey]; // If srcValItem exist, source axis is triggered, so link to target axis.\n\n if (srcAxisInfo !== tarAxisInfo && srcValItem) {\n var val = srcValItem.value;\n linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));\n linkTriggers[tarAxisInfo.key] = val;\n }\n });\n }\n });\n each(linkTriggers, function (val, tarKey) {\n processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);\n });\n updateModelActually(showValueMap, axesInfo, outputPayload);\n dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction);\n dispatchHighDownActually(axesInfo, dispatchAction, api);\n return outputPayload;\n}\n\nfunction processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {\n var axis = axisInfo.axis;\n\n if (axis.scale.isBlank() || !axis.containData(newValue)) {\n return;\n }\n\n if (!axisInfo.involveSeries) {\n updaters.showPointer(axisInfo, newValue);\n return;\n } // Heavy calculation. So put it after axis.containData checking.\n\n\n var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);\n var payloadBatch = payloadInfo.payloadBatch;\n var snapToValue = payloadInfo.snapToValue; // Fill content of event obj for echarts.connect.\n // By default use the first involved series data as a sample to connect.\n\n if (payloadBatch[0] && outputFinder.seriesIndex == null) {\n extend(outputFinder, payloadBatch[0]);\n } // If no linkSource input, this process is for collecting link\n // target, where snap should not be accepted.\n\n\n if (!noSnap && axisInfo.snap) {\n if (axis.containData(snapToValue) && snapToValue != null) {\n newValue = snapToValue;\n }\n }\n\n updaters.showPointer(axisInfo, newValue, payloadBatch); // Tooltip should always be snapToValue, otherwise there will be\n // incorrect \"axis value ~ series value\" mapping displayed in tooltip.\n\n updaters.showTooltip(axisInfo, payloadInfo, snapToValue);\n}\n\nfunction buildPayloadsBySeries(value, axisInfo) {\n var axis = axisInfo.axis;\n var dim = axis.dim;\n var snapToValue = value;\n var payloadBatch = [];\n var minDist = Number.MAX_VALUE;\n var minDiff = -1;\n each(axisInfo.seriesModels, function (series, idx) {\n var dataDim = series.getData().mapDimensionsAll(dim);\n var seriesNestestValue;\n var dataIndices;\n\n if (series.getAxisTooltipData) {\n var result = series.getAxisTooltipData(dataDim, value, axis);\n dataIndices = result.dataIndices;\n seriesNestestValue = result.nestestValue;\n } else {\n dataIndices = series.getData().indicesOfNearest(dataDim[0], value, // Add a threshold to avoid find the wrong dataIndex\n // when data length is not same.\n // false,\n axis.type === 'category' ? 0.5 : null);\n\n if (!dataIndices.length) {\n return;\n }\n\n seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);\n }\n\n if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {\n return;\n }\n\n var diff = value - seriesNestestValue;\n var dist = Math.abs(diff); // Consider category case\n\n if (dist <= minDist) {\n if (dist < minDist || diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n snapToValue = seriesNestestValue;\n payloadBatch.length = 0;\n }\n\n each(dataIndices, function (dataIndex) {\n payloadBatch.push({\n seriesIndex: series.seriesIndex,\n dataIndexInside: dataIndex,\n dataIndex: series.getData().getRawIndex(dataIndex)\n });\n });\n }\n });\n return {\n payloadBatch: payloadBatch,\n snapToValue: snapToValue\n };\n}\n\nfunction showPointer(showValueMap, axisInfo, value, payloadBatch) {\n showValueMap[axisInfo.key] = {\n value: value,\n payloadBatch: payloadBatch\n };\n}\n\nfunction showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {\n var payloadBatch = payloadInfo.payloadBatch;\n var axis = axisInfo.axis;\n var axisModel = axis.model;\n var axisPointerModel = axisInfo.axisPointerModel; // If no data, do not create anything in dataByCoordSys,\n // whose length will be used to judge whether dispatch action.\n\n if (!axisInfo.triggerTooltip || !payloadBatch.length) {\n return;\n }\n\n var coordSysModel = axisInfo.coordSys.model;\n var coordSysKey = modelHelper.makeKey(coordSysModel);\n var coordSysItem = dataByCoordSys.map[coordSysKey];\n\n if (!coordSysItem) {\n coordSysItem = dataByCoordSys.map[coordSysKey] = {\n coordSysId: coordSysModel.id,\n coordSysIndex: coordSysModel.componentIndex,\n coordSysType: coordSysModel.type,\n coordSysMainType: coordSysModel.mainType,\n dataByAxis: []\n };\n dataByCoordSys.list.push(coordSysItem);\n }\n\n coordSysItem.dataByAxis.push({\n axisDim: axis.dim,\n axisIndex: axisModel.componentIndex,\n axisType: axisModel.type,\n axisId: axisModel.id,\n value: value,\n // Caustion: viewHelper.getValueLabel is actually on \"view stage\", which\n // depends that all models have been updated. So it should not be performed\n // here. Considering axisPointerModel used here is volatile, which is hard\n // to be retrieve in TooltipView, we prepare parameters here.\n valueLabelOpt: {\n precision: axisPointerModel.get(['label', 'precision']),\n formatter: axisPointerModel.get(['label', 'formatter'])\n },\n seriesDataIndices: payloadBatch.slice()\n });\n}\n\nfunction updateModelActually(showValueMap, axesInfo, outputPayload) {\n var outputAxesInfo = outputPayload.axesInfo = []; // Basic logic: If no 'show' required, 'hide' this axisPointer.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n var valItem = showValueMap[key];\n\n if (valItem) {\n !axisInfo.useHandle && (option.status = 'show');\n option.value = valItem.value; // For label formatter param and highlight.\n\n option.seriesDataIndices = (valItem.payloadBatch || []).slice();\n } // When always show (e.g., handle used), remain\n // original value and status.\n else {\n // If hide, value still need to be set, consider\n // click legend to toggle axis blank.\n !axisInfo.useHandle && (option.status = 'hide');\n } // If status is 'hide', should be no info in payload.\n\n\n option.status === 'show' && outputAxesInfo.push({\n axisDim: axisInfo.axis.dim,\n axisIndex: axisInfo.axis.model.componentIndex,\n value: option.value\n });\n });\n}\n\nfunction dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) {\n // Basic logic: If no showTip required, hideTip will be dispatched.\n if (illegalPoint(point) || !dataByCoordSys.list.length) {\n dispatchAction({\n type: 'hideTip'\n });\n return;\n } // In most case only one axis (or event one series is used). It is\n // convenient to fetch payload.seriesIndex and payload.dataIndex\n // directly. So put the first seriesIndex and dataIndex of the first\n // axis on the payload.\n\n\n var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};\n dispatchAction({\n type: 'showTip',\n escapeConnect: true,\n x: point[0],\n y: point[1],\n tooltipOption: payload.tooltipOption,\n position: payload.position,\n dataIndexInside: sampleItem.dataIndexInside,\n dataIndex: sampleItem.dataIndex,\n seriesIndex: sampleItem.seriesIndex,\n dataByCoordSys: dataByCoordSys.list\n });\n}\n\nfunction dispatchHighDownActually(axesInfo, dispatchAction, api) {\n // FIXME\n // highlight status modification should be a stage of main process?\n // (Consider confilct (e.g., legend and axisPointer) and setOption)\n var zr = api.getZr();\n var highDownKey = 'axisPointerLastHighlights';\n var lastHighlights = inner(zr)[highDownKey] || {};\n var newHighlights = inner(zr)[highDownKey] = {}; // Update highlight/downplay status according to axisPointer model.\n // Build hash map and remove duplicate incidentally.\n\n each(axesInfo, function (axisInfo, key) {\n var option = axisInfo.axisPointerModel.option;\n option.status === 'show' && axisInfo.triggerEmphasis && each(option.seriesDataIndices, function (batchItem) {\n var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex;\n newHighlights[key] = batchItem;\n });\n }); // Diff.\n\n var toHighlight = [];\n var toDownplay = [];\n each(lastHighlights, function (batchItem, key) {\n !newHighlights[key] && toDownplay.push(batchItem);\n });\n each(newHighlights, function (batchItem, key) {\n !lastHighlights[key] && toHighlight.push(batchItem);\n });\n toDownplay.length && api.dispatchAction({\n type: 'downplay',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toDownplay\n });\n toHighlight.length && api.dispatchAction({\n type: 'highlight',\n escapeConnect: true,\n // Not blur others when highlight in axisPointer.\n notBlur: true,\n batch: toHighlight\n });\n}\n\nfunction findInputAxisInfo(inputAxesInfo, axisInfo) {\n for (var i = 0; i < (inputAxesInfo || []).length; i++) {\n var inputAxisInfo = inputAxesInfo[i];\n\n if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {\n return inputAxisInfo;\n }\n }\n}\n\nfunction makeMapperParam(axisInfo) {\n var axisModel = axisInfo.axis.model;\n var item = {};\n var dim = item.axisDim = axisInfo.axis.dim;\n item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex;\n item.axisName = item[dim + 'AxisName'] = axisModel.name;\n item.axisId = item[dim + 'AxisId'] = axisModel.id;\n return item;\n}\n\nfunction illegalPoint(point) {\n return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport AxisView from '../axis/AxisView.js';\nimport CartesianAxisPointer from './CartesianAxisPointer.js';\nimport AxisPointerModel from './AxisPointerModel.js';\nimport AxisPointerView from './AxisPointerView.js';\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { collect } from './modelHelper.js';\nimport axisTrigger from './axisTrigger.js';\nexport function install(registers) {\n // CartesianAxisPointer is not supposed to be required here. But consider\n // echarts.simple.js and online build tooltip, which only require gridSimple,\n // CartesianAxisPointer should be able to required somewhere.\n AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\n registers.registerComponentModel(AxisPointerModel);\n registers.registerComponentView(AxisPointerView);\n registers.registerPreprocessor(function (option) {\n // Always has a global axisPointerModel for default setting.\n if (option) {\n (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});\n var link = option.axisPointer.link; // Normalize to array to avoid object mergin. But if link\n // is not set, remain null/undefined, otherwise it will\n // override existent link setting.\n\n if (link && !isArray(link)) {\n option.axisPointer.link = [link];\n }\n }\n }); // This process should proformed after coordinate systems created\n // and series data processed. So put it on statistic processing stage.\n\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {\n // Build axisPointerModel, mergin tooltip.axisPointer model for each axis.\n // allAxesInfo should be updated when setOption performed.\n ecModel.getComponent('axisPointer').coordSysAxesInfo = collect(ecModel, api);\n }); // Broadcast to all views.\n\n registers.registerAction({\n type: 'updateAxisPointer',\n event: 'updateAxisPointer',\n update: ':updateAxisPointer'\n }, axisTrigger);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { install as installSimple } from './installSimple.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nexport function install(registers) {\n use(installSimple);\n use(installAxisPointer);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport AxisBuilder from '../axis/AxisBuilder.js';\n\nvar PolarAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisPointer, _super);\n\n function PolarAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n PolarAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n\n if (axis.dim === 'angle') {\n this.animationThreshold = Math.PI / 18;\n }\n\n var polar = axis.polar;\n var otherAxis = polar.getOtherAxis(axis);\n var otherExtent = otherAxis.getExtent();\n var coordValue = axis.dataToCoord(value);\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, polar, coordValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var labelMargin = axisPointerModel.get(['label', 'margin']);\n var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);\n viewHelper.buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos);\n };\n\n return PolarAxisPointer;\n}(BaseAxisPointer);\n\n;\n\nfunction getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {\n var axis = axisModel.axis;\n var coord = axis.dataToCoord(value);\n var axisAngle = polar.getAngleAxis().getExtent()[0];\n axisAngle = axisAngle / 180 * Math.PI;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var position;\n var align;\n var verticalAlign;\n\n if (axis.dim === 'radius') {\n var transform = matrix.create();\n matrix.rotate(transform, transform, axisAngle);\n matrix.translate(transform, transform, [polar.cx, polar.cy]);\n position = graphic.applyTransform([coord, -labelMargin], transform);\n var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; // @ts-ignore\n\n var labelLayout = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);\n align = labelLayout.textAlign;\n verticalAlign = labelLayout.textVerticalAlign;\n } else {\n // angle axis\n var r = radiusExtent[1];\n position = polar.coordToPoint([r + labelMargin, coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n align = Math.abs(position[0] - cx) / r < 0.3 ? 'center' : position[0] > cx ? 'left' : 'right';\n verticalAlign = Math.abs(position[1] - cy) / r < 0.3 ? 'middle' : position[1] > cy ? 'top' : 'bottom';\n }\n\n return {\n position: position,\n align: align,\n verticalAlign: verticalAlign\n };\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, polar, coordValue, otherExtent) {\n return axis.dim === 'angle' ? {\n type: 'Line',\n shape: viewHelper.makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))\n } : {\n type: 'Circle',\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: coordValue\n }\n };\n },\n shadow: function (axis, polar, coordValue, otherExtent) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var radian = Math.PI / 180;\n return axis.dim === 'angle' ? {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, otherExtent[0], otherExtent[1], // In ECharts y is negative if angle is positive\n (-coordValue - bandWidth / 2) * radian, (-coordValue + bandWidth / 2) * radian)\n } : {\n type: 'Sector',\n shape: viewHelper.makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)\n };\n }\n};\nexport default PolarAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar PolarModel =\n/** @class */\nfunction (_super) {\n __extends(PolarModel, _super);\n\n function PolarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarModel.type;\n return _this;\n }\n\n PolarModel.prototype.findAxisModel = function (axisType) {\n var foundAxisModel;\n var ecModel = this.ecModel;\n ecModel.eachComponent(axisType, function (axisModel) {\n if (axisModel.getCoordSysModel() === this) {\n foundAxisModel = axisModel;\n }\n }, this);\n return foundAxisModel;\n };\n\n PolarModel.type = 'polar';\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n PolarModel.defaultOption = {\n // zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '80%'\n };\n return PolarModel;\n}(ComponentModel);\n\nexport default PolarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n\nvar PolarAxisModel =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisModel, _super);\n\n function PolarAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n PolarAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n };\n\n PolarAxisModel.type = 'polarAxis';\n return PolarAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\n\nvar AngleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisModel, _super);\n\n function AngleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisModel.type;\n return _this;\n }\n\n AngleAxisModel.type = 'angleAxis';\n return AngleAxisModel;\n}(PolarAxisModel);\n\nexport { AngleAxisModel };\n\nvar RadiusAxisModel =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisModel, _super);\n\n function RadiusAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisModel.type;\n return _this;\n }\n\n RadiusAxisModel.type = 'radiusAxis';\n return RadiusAxisModel;\n}(PolarAxisModel);\n\nexport { RadiusAxisModel };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar RadiusAxis =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxis, _super);\n\n function RadiusAxis(scale, radiusExtent) {\n return _super.call(this, 'radius', scale, radiusExtent) || this;\n }\n\n RadiusAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n\n return RadiusAxis;\n}(Axis);\n\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport Axis from '../Axis.js';\nimport { makeInner } from '../../util/model.js';\nvar inner = makeInner();\n\nvar AngleAxis =\n/** @class */\nfunction (_super) {\n __extends(AngleAxis, _super);\n\n function AngleAxis(scale, angleExtent) {\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n }\n\n AngleAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n /**\r\n * Only be called in category axis.\r\n * Angle axis uses text height to decide interval\r\n *\r\n * @override\r\n * @return {number} Auto interval for cateogry axis tick and label\r\n */\n\n\n AngleAxis.prototype.calculateCategoryInterval = function () {\n var axis = this;\n var labelModel = axis.getLabelModel();\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitH = Math.abs(unitSpan); // Not precise, just use height as text width\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n var maxH = Math.max(rect.height, 7);\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(dh));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n };\n\n return AngleAxis;\n}(Axis);\n\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport RadiusAxis from './RadiusAxis.js';\nimport AngleAxis from './AngleAxis.js';\nexport var polarDimensions = ['radius', 'angle'];\n\nvar Polar =\n/** @class */\nfunction () {\n function Polar(name) {\n this.dimensions = polarDimensions;\n this.type = 'polar';\n /**\r\n * x of polar center\r\n */\n\n this.cx = 0;\n /**\r\n * y of polar center\r\n */\n\n this.cy = 0;\n this._radiusAxis = new RadiusAxis();\n this._angleAxis = new AngleAxis();\n this.axisPointerEnabled = true;\n this.name = name || '';\n this._radiusAxis.polar = this._angleAxis.polar = this;\n }\n /**\r\n * If contain coord\r\n */\n\n\n Polar.prototype.containPoint = function (point) {\n var coord = this.pointToCoord(point);\n return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n };\n /**\r\n * If contain data\r\n */\n\n\n Polar.prototype.containData = function (data) {\n return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n };\n\n Polar.prototype.getAxis = function (dim) {\n var key = '_' + dim + 'Axis';\n return this[key];\n };\n\n Polar.prototype.getAxes = function () {\n return [this._radiusAxis, this._angleAxis];\n };\n /**\r\n * Get axes by type of scale\r\n */\n\n\n Polar.prototype.getAxesByScale = function (scaleType) {\n var axes = [];\n var angleAxis = this._angleAxis;\n var radiusAxis = this._radiusAxis;\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n return axes;\n };\n\n Polar.prototype.getAngleAxis = function () {\n return this._angleAxis;\n };\n\n Polar.prototype.getRadiusAxis = function () {\n return this._radiusAxis;\n };\n\n Polar.prototype.getOtherAxis = function (axis) {\n var angleAxis = this._angleAxis;\n return axis === angleAxis ? this._radiusAxis : angleAxis;\n };\n /**\r\n * Base axis will be used on stacking.\r\n *\r\n */\n\n\n Polar.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n };\n\n Polar.prototype.getTooltipAxes = function (dim) {\n var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n return {\n baseAxes: [baseAxis],\n otherAxes: [this.getOtherAxis(baseAxis)]\n };\n };\n /**\r\n * Convert a single data item to (x, y) point.\r\n * Parameter data is an array which the first element is radius and the second is angle\r\n */\n\n\n Polar.prototype.dataToPoint = function (data, clamp) {\n return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);\n };\n /**\r\n * Convert a (x, y) point to data\r\n */\n\n\n Polar.prototype.pointToData = function (point, clamp) {\n var coord = this.pointToCoord(point);\n return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];\n };\n /**\r\n * Convert a (x, y) point to (radius, angle) coord\r\n */\n\n\n Polar.prototype.pointToCoord = function (point) {\n var dx = point[0] - this.cx;\n var dy = point[1] - this.cy;\n var angleAxis = this.getAngleAxis();\n var extent = angleAxis.getExtent();\n var minAngle = Math.min(extent[0], extent[1]);\n var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator\n // FIXME\n\n angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent\n\n var dir = radian < minAngle ? 1 : -1;\n\n while (radian < minAngle || radian > maxAngle) {\n radian += dir * 360;\n }\n\n return [radius, radian];\n };\n /**\r\n * Convert a (radius, angle) coord to (x, y) point\r\n */\n\n\n Polar.prototype.coordToPoint = function (coord) {\n var radius = coord[0];\n var radian = coord[1] / 180 * Math.PI;\n var x = Math.cos(radian) * radius + this.cx; // Inverse the y\n\n var y = -Math.sin(radian) * radius + this.cy;\n return [x, y];\n };\n /**\r\n * Get ring area of cartesian.\r\n * Area will have a contain function to determine if a point is in the coordinate system.\r\n */\n\n\n Polar.prototype.getArea = function () {\n var angleAxis = this.getAngleAxis();\n var radiusAxis = this.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180;\n return {\n cx: this.cx,\n cy: this.cy,\n r0: radiusExtent[0],\n r: radiusExtent[1],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse,\n contain: function (x, y) {\n // It's a ring shape.\n // Start angle and end angle don't matter\n var dx = x - this.cx;\n var dy = y - this.cy; // minus a tiny value 1e-4 to avoid being clipped unexpectedly\n\n var d2 = dx * dx + dy * dy - 1e-4;\n var r = this.r;\n var r0 = this.r0;\n return d2 <= r * r && d2 >= r0 * r0;\n }\n };\n };\n\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Polar;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var polarModel = finder.polarModel;\n return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Polar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Polar, { polarDimensions } from './Polar.js';\nimport { parsePercent } from '../../util/number.js';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Resize method bound to the polar\r\n */\n\nfunction resizePolar(polar, polarModel, api) {\n var center = polarModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n polar.cx = parsePercent(center[0], width);\n polar.cy = parsePercent(center[1], height);\n var radiusAxis = polar.getRadiusAxis();\n var size = Math.min(width, height) / 2;\n var radius = polarModel.get('radius');\n\n if (radius == null) {\n radius = [0, '100%'];\n } else if (!zrUtil.isArray(radius)) {\n // r0 = 0\n radius = [0, radius];\n }\n\n var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\r\n * Update polar\r\n */\n\n\nfunction updatePolarScale(ecModel, api) {\n var polar = this;\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis(); // Reset scale\n\n angleAxis.scale.setExtent(Infinity, -Infinity);\n radiusAxis.scale.setExtent(Infinity, -Infinity);\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === polar) {\n var data_1 = seriesModel.getData();\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n radiusAxis.scale.unionExtentFromData(data_1, dim);\n });\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n angleAxis.scale.unionExtentFromData(data_1, dim);\n });\n }\n });\n niceScaleExtent(angleAxis.scale, angleAxis.model);\n niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis\n\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\n var extent = angleAxis.getExtent();\n var diff = 360 / angleAxis.scale.count();\n angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n angleAxis.setExtent(extent[0], extent[1]);\n }\n}\n\nfunction isAngleAxisModel(axisModel) {\n return axisModel.mainType === 'angleAxis';\n}\n/**\r\n * Set common axis properties\r\n */\n\n\nfunction setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}\n\nvar polarCreator = {\n dimensions: polarDimensions,\n create: function (ecModel, api) {\n var polarList = [];\n ecModel.eachComponent('polar', function (polarModel, idx) {\n var polar = new Polar(idx + ''); // Inject resize and update method\n\n polar.update = updatePolarScale;\n var radiusAxis = polar.getRadiusAxis();\n var angleAxis = polar.getAngleAxis();\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n setAxis(radiusAxis, radiusAxisModel);\n setAxis(angleAxis, angleAxisModel);\n resizePolar(polar, polarModel, api);\n polarList.push(polar);\n polarModel.coordinateSystem = polar;\n polar.model = polarModel;\n }); // Inject coordinateSystem to series\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'polar') {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!polarModel) {\n throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n }\n }\n\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\n }\n });\n return polarList;\n }\n};\nexport default polarCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport Model from '../../model/Model.js';\nimport AxisView from './AxisView.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport { getECData } from '../../util/innerStore.js';\nvar elementList = ['axisLine', 'axisLabel', 'axisTick', 'minorTick', 'splitLine', 'minorSplitLine', 'splitArea'];\n\nfunction getAxisLineShape(polar, rExtent, angle) {\n rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());\n var start = polar.coordToPoint([rExtent[0], angle]);\n var end = polar.coordToPoint([rExtent[1], angle]);\n return {\n x1: start[0],\n y1: start[1],\n x2: end[0],\n y2: end[1]\n };\n}\n\nfunction getRadiusIdx(polar) {\n var radiusAxis = polar.getRadiusAxis();\n return radiusAxis.inverse ? 0 : 1;\n} // Remove the last tick which will overlap the first tick\n\n\nfunction fixAngleOverlap(list) {\n var firstItem = list[0];\n var lastItem = list[list.length - 1];\n\n if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {\n list.pop();\n }\n}\n\nvar AngleAxisView =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisView, _super);\n\n function AngleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n AngleAxisView.prototype.render = function (angleAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!angleAxisModel.get('show')) {\n return;\n }\n\n var angleAxis = angleAxisModel.axis;\n var polar = angleAxis.polar;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var ticksAngles = angleAxis.getTicksCoords();\n var minorTickAngles = angleAxis.getMinorTicksCoords();\n var labels = zrUtil.map(angleAxis.getViewLabels(), function (labelItem) {\n labelItem = zrUtil.clone(labelItem);\n var scale = angleAxis.scale;\n var tickValue = scale.type === 'ordinal' ? scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;\n labelItem.coord = angleAxis.dataToCoord(tickValue);\n return labelItem;\n });\n fixAngleOverlap(labels);\n fixAngleOverlap(ticksAngles);\n zrUtil.each(elementList, function (name) {\n if (angleAxisModel.get([name, 'show']) && (!angleAxis.scale.isBlank() || name === 'axisLine')) {\n angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);\n }\n }, this);\n };\n\n AngleAxisView.type = 'angleAxis';\n return AngleAxisView;\n}(AxisView);\n\nvar angelAxisElementsBuilders = {\n axisLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var lineStyleModel = angleAxisModel.getModel(['axisLine', 'lineStyle']); // extent id of the axis radius (r0 and r)\n\n var rId = getRadiusIdx(polar);\n var r0Id = rId ? 0 : 1;\n var shape;\n\n if (radiusExtent[r0Id] === 0) {\n shape = new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n } else {\n shape = new graphic.Ring({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: radiusExtent[rId],\n r0: radiusExtent[r0Id]\n },\n style: lineStyleModel.getLineStyle(),\n z2: 1,\n silent: true\n });\n }\n\n shape.style.fill = null;\n group.add(shape);\n },\n axisTick: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var tickModel = angleAxisModel.getModel('axisTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = zrUtil.map(ticksAngles, function (tickAngleItem) {\n return new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)\n });\n });\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(tickModel.getModel('lineStyle').getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n })\n }));\n },\n minorTick: function (group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var tickModel = angleAxisModel.getModel('axisTick');\n var minorTickModel = angleAxisModel.getModel('minorTick');\n var tickLen = (tickModel.get('inside') ? -1 : 1) * minorTickModel.get('length');\n var radius = radiusExtent[getRadiusIdx(polar)];\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults(minorTickModel.getModel('lineStyle').getLineStyle(), zrUtil.defaults(tickModel.getLineStyle(), {\n stroke: angleAxisModel.get(['axisLine', 'lineStyle', 'color'])\n }))\n }));\n },\n axisLabel: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {\n var rawCategoryData = angleAxisModel.getCategories(true);\n var commonLabelModel = angleAxisModel.getModel('axisLabel');\n var labelMargin = commonLabelModel.get('margin');\n var triggerEvent = angleAxisModel.get('triggerEvent'); // Use length of ticksAngles because it may remove the last tick to avoid overlapping\n\n zrUtil.each(labels, function (labelItem, idx) {\n var labelModel = commonLabelModel;\n var tickValue = labelItem.tickValue;\n var r = radiusExtent[getRadiusIdx(polar)];\n var p = polar.coordToPoint([r + labelMargin, labelItem.coord]);\n var cx = polar.cx;\n var cy = polar.cy;\n var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3 ? 'center' : p[0] > cx ? 'left' : 'right';\n var labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 ? 'middle' : p[1] > cy ? 'top' : 'bottom';\n\n if (rawCategoryData && rawCategoryData[tickValue]) {\n var rawCategoryItem = rawCategoryData[tickValue];\n\n if (zrUtil.isObject(rawCategoryItem) && rawCategoryItem.textStyle) {\n labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);\n }\n }\n\n var textEl = new graphic.Text({\n silent: AxisBuilder.isLabelSilent(angleAxisModel),\n style: createTextStyle(labelModel, {\n x: p[0],\n y: p[1],\n fill: labelModel.getTextColor() || angleAxisModel.get(['axisLine', 'lineStyle', 'color']),\n text: labelItem.formattedLabel,\n align: labelTextAlign,\n verticalAlign: labelTextVerticalAlign\n })\n });\n group.add(textEl); // Pack data for mouse event\n\n if (triggerEvent) {\n var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);\n eventData.targetType = 'axisLabel';\n eventData.value = labelItem.rawLabel;\n getECData(textEl).eventData = eventData;\n }\n }, this);\n },\n splitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n var splitLineModel = angleAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksAngles.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord)\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyleModel.getLineStyle()),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n }\n },\n minorSplitLine: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!minorTickAngles.length) {\n return;\n }\n\n var minorSplitLineModel = angleAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTickAngles.length; i++) {\n for (var k = 0; k < minorTickAngles[i].length; k++) {\n lines.push(new graphic.Line({\n shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i][k].coord)\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: lineStyleModel.getLineStyle(),\n silent: true,\n z: angleAxisModel.get('z')\n }));\n },\n splitArea: function (group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {\n if (!ticksAngles.length) {\n return;\n }\n\n var splitAreaModel = angleAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var RADIAN = Math.PI / 180;\n var prevAngle = -ticksAngles[0].coord * RADIAN;\n var r0 = Math.min(radiusExtent[0], radiusExtent[1]);\n var r1 = Math.max(radiusExtent[0], radiusExtent[1]);\n var clockwise = angleAxisModel.get('clockwise');\n\n for (var i = 1, len = ticksAngles.length; i <= len; i++) {\n var coord = i === len ? ticksAngles[0].coord : ticksAngles[i].coord;\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: r0,\n r: r1,\n startAngle: prevAngle,\n endAngle: -coord * RADIAN,\n clockwise: clockwise\n },\n silent: true\n }));\n prevAngle = -coord * RADIAN;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\nexport default AngleAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport AxisView from './AxisView.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitLine', 'splitArea', 'minorSplitLine'];\n\nvar RadiusAxisView =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisView, _super);\n\n function RadiusAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisView.type;\n _this.axisPointerClass = 'PolarAxisPointer';\n return _this;\n }\n\n RadiusAxisView.prototype.render = function (radiusAxisModel, ecModel) {\n this.group.removeAll();\n\n if (!radiusAxisModel.get('show')) {\n return;\n }\n\n var oldAxisGroup = this._axisGroup;\n var newAxisGroup = this._axisGroup = new graphic.Group();\n this.group.add(newAxisGroup);\n var radiusAxis = radiusAxisModel.axis;\n var polar = radiusAxis.polar;\n var angleAxis = polar.getAngleAxis();\n var ticksCoords = radiusAxis.getTicksCoords();\n var minorTicksCoords = radiusAxis.getMinorTicksCoords();\n var axisAngle = angleAxis.getExtent()[0];\n var radiusExtent = radiusAxis.getExtent();\n var layout = layoutAxis(polar, radiusAxisModel, axisAngle);\n var axisBuilder = new AxisBuilder(radiusAxisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n newAxisGroup.add(axisBuilder.getGroup());\n graphic.groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (radiusAxisModel.get([name, 'show']) && !radiusAxis.scale.isBlank()) {\n axisElementBuilders[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);\n }\n }, this);\n };\n\n RadiusAxisView.type = 'radiusAxis';\n return RadiusAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n var splitLineModel = radiusAxisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n var lineCount = 0;\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var splitLines = [];\n\n for (var i = 0; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n // ensure circle radius >= 0\n r: Math.max(ticksCoords[i].coord, 0)\n }\n }));\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitLines.length; i++) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length],\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n }\n },\n minorSplitLine: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {\n if (!minorTicksCoords.length) {\n return;\n }\n\n var minorSplitLineModel = radiusAxisModel.getModel('minorSplitLine');\n var lineStyleModel = minorSplitLineModel.getModel('lineStyle');\n var lines = [];\n\n for (var i = 0; i < minorTicksCoords.length; i++) {\n for (var k = 0; k < minorTicksCoords[i].length; k++) {\n lines.push(new graphic.Circle({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r: minorTicksCoords[i][k].coord\n }\n }));\n }\n }\n\n group.add(graphic.mergePath(lines, {\n style: zrUtil.defaults({\n fill: null\n }, lineStyleModel.getLineStyle()),\n silent: true\n }));\n },\n splitArea: function (group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {\n if (!ticksCoords.length) {\n return;\n }\n\n var splitAreaModel = radiusAxisModel.getModel('splitArea');\n var areaStyleModel = splitAreaModel.getModel('areaStyle');\n var areaColors = areaStyleModel.get('color');\n var lineCount = 0;\n areaColors = areaColors instanceof Array ? areaColors : [areaColors];\n var splitAreas = [];\n var prevRadius = ticksCoords[0].coord;\n\n for (var i = 1; i < ticksCoords.length; i++) {\n var colorIndex = lineCount++ % areaColors.length;\n splitAreas[colorIndex] = splitAreas[colorIndex] || [];\n splitAreas[colorIndex].push(new graphic.Sector({\n shape: {\n cx: polar.cx,\n cy: polar.cy,\n r0: prevRadius,\n r: ticksCoords[i].coord,\n startAngle: 0,\n endAngle: Math.PI * 2\n },\n silent: true\n }));\n prevRadius = ticksCoords[i].coord;\n } // Simple optimization\n // Batching the lines if color are the same\n\n\n for (var i = 0; i < splitAreas.length; i++) {\n group.add(graphic.mergePath(splitAreas[i], {\n style: zrUtil.defaults({\n fill: areaColors[i % areaColors.length]\n }, areaStyleModel.getAreaStyle()),\n silent: true\n }));\n }\n }\n};\n/**\r\n * @inner\r\n */\n\nfunction layoutAxis(polar, radiusAxisModel, axisAngle) {\n return {\n position: [polar.cx, polar.cy],\n rotation: axisAngle / 180 * Math.PI,\n labelDirection: -1,\n tickDirection: -1,\n nameDirection: 1,\n labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'),\n // Over splitLine and splitArea\n z2: 1\n };\n}\n\nexport default RadiusAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parsePercent } from '../util/number.js';\nimport { isDimensionStacked } from '../data/helper/dataStackHelper.js';\n\nfunction getSeriesStackId(seriesModel) {\n return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;\n}\n\nfunction getAxisKey(polar, axis) {\n return axis.dim + polar.model.componentIndex;\n}\n\nfunction barLayoutPolar(seriesType, ecModel, api) {\n var lastStackCoords = {};\n var barWidthAndOffset = calRadialBar(zrUtil.filter(ecModel.getSeriesByType(seriesType), function (seriesModel) {\n return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'polar';\n }));\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n // Check series coordinate, do layout for polar only\n if (seriesModel.coordinateSystem.type !== 'polar') {\n return;\n }\n\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var stackId = getSeriesStackId(seriesModel);\n var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];\n var columnOffset = columnLayoutInfo.offset;\n var columnWidth = columnLayoutInfo.width;\n var valueAxis = polar.getOtherAxis(baseAxis);\n var cx = seriesModel.coordinateSystem.cx;\n var cy = seriesModel.coordinateSystem.cy;\n var barMinHeight = seriesModel.get('barMinHeight') || 0;\n var barMinAngle = seriesModel.get('barMinAngle') || 0;\n lastStackCoords[stackId] = lastStackCoords[stackId] || [];\n var valueDim = data.mapDimension(valueAxis.dim);\n var baseDim = data.mapDimension(baseAxis.dim);\n var stacked = isDimensionStacked(data, valueDim\n /* , baseDim */\n );\n var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true);\n var valueAxisStart = valueAxis.dataToCoord(0);\n\n for (var idx = 0, len = data.count(); idx < len; idx++) {\n var value = data.get(valueDim, idx);\n var baseValue = data.get(baseDim, idx);\n var sign = value >= 0 ? 'p' : 'n';\n var baseCoord = valueAxisStart; // Because of the barMinHeight, we can not use the value in\n // stackResultDimension directly.\n // Only ordinal axis can be stacked.\n\n if (stacked) {\n if (!lastStackCoords[stackId][baseValue]) {\n lastStackCoords[stackId][baseValue] = {\n p: valueAxisStart,\n n: valueAxisStart // Negative stack\n\n };\n } // Should also consider #4243\n\n\n baseCoord = lastStackCoords[stackId][baseValue][sign];\n }\n\n var r0 = void 0;\n var r = void 0;\n var startAngle = void 0;\n var endAngle = void 0; // radial sector\n\n if (valueAxis.dim === 'radius') {\n var radiusSpan = valueAxis.dataToCoord(value) - valueAxisStart;\n var angle = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(radiusSpan) < barMinHeight) {\n radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;\n }\n\n r0 = baseCoord;\n r = baseCoord + radiusSpan;\n startAngle = angle - columnOffset;\n endAngle = startAngle - columnWidth;\n stacked && (lastStackCoords[stackId][baseValue][sign] = r);\n } // tangential sector\n else {\n var angleSpan = valueAxis.dataToCoord(value, clampLayout) - valueAxisStart;\n var radius = baseAxis.dataToCoord(baseValue);\n\n if (Math.abs(angleSpan) < barMinAngle) {\n angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;\n }\n\n r0 = radius + columnOffset;\n r = r0 + columnWidth;\n startAngle = baseCoord;\n endAngle = baseCoord + angleSpan; // if the previous stack is at the end of the ring,\n // add a round to differentiate it from origin\n // let extent = angleAxis.getExtent();\n // let stackCoord = angle;\n // if (stackCoord === extent[0] && value > 0) {\n // stackCoord = extent[1];\n // }\n // else if (stackCoord === extent[1] && value < 0) {\n // stackCoord = extent[0];\n // }\n\n stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);\n }\n\n data.setItemLayout(idx, {\n cx: cx,\n cy: cy,\n r0: r0,\n r: r,\n // Consider that positive angle is anti-clockwise,\n // while positive radian of sector is clockwise\n startAngle: -startAngle * Math.PI / 180,\n endAngle: -endAngle * Math.PI / 180,\n\n /**\r\n * Keep the same logic with bar in catesion: use end value to\r\n * control direction. Notice that if clockwise is true (by\r\n * default), the sector will always draw clockwisely, no matter\r\n * whether endAngle is greater or less than startAngle.\r\n */\n clockwise: startAngle >= endAngle\n });\n }\n });\n}\n/**\r\n * Calculate bar width and offset for radial bar charts\r\n */\n\n\nfunction calRadialBar(barSeries) {\n // Columns info on each category axis. Key is polar name\n var columnsMap = {};\n zrUtil.each(barSeries, function (seriesModel, idx) {\n var data = seriesModel.getData();\n var polar = seriesModel.coordinateSystem;\n var baseAxis = polar.getBaseAxis();\n var axisKey = getAxisKey(polar, baseAxis);\n var axisExtent = baseAxis.getExtent();\n var bandWidth = baseAxis.type === 'category' ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();\n var columnsOnAxis = columnsMap[axisKey] || {\n bandWidth: bandWidth,\n remainedWidth: bandWidth,\n autoWidthCount: 0,\n categoryGap: '20%',\n gap: '30%',\n stacks: {}\n };\n var stacks = columnsOnAxis.stacks;\n columnsMap[axisKey] = columnsOnAxis;\n var stackId = getSeriesStackId(seriesModel);\n\n if (!stacks[stackId]) {\n columnsOnAxis.autoWidthCount++;\n }\n\n stacks[stackId] = stacks[stackId] || {\n width: 0,\n maxWidth: 0\n };\n var barWidth = parsePercent(seriesModel.get('barWidth'), bandWidth);\n var barMaxWidth = parsePercent(seriesModel.get('barMaxWidth'), bandWidth);\n var barGap = seriesModel.get('barGap');\n var barCategoryGap = seriesModel.get('barCategoryGap');\n\n if (barWidth && !stacks[stackId].width) {\n barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);\n stacks[stackId].width = barWidth;\n columnsOnAxis.remainedWidth -= barWidth;\n }\n\n barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);\n barGap != null && (columnsOnAxis.gap = barGap);\n barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);\n });\n var result = {};\n zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {\n result[coordSysName] = {};\n var stacks = columnsOnAxis.stacks;\n var bandWidth = columnsOnAxis.bandWidth;\n var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);\n var barGapPercent = parsePercent(columnsOnAxis.gap, 1);\n var remainedWidth = columnsOnAxis.remainedWidth;\n var autoWidthCount = columnsOnAxis.autoWidthCount;\n var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0); // Find if any auto calculated bar exceeded maxBarWidth\n\n zrUtil.each(stacks, function (column, stack) {\n var maxWidth = column.maxWidth;\n\n if (maxWidth && maxWidth < autoWidth) {\n maxWidth = Math.min(maxWidth, remainedWidth);\n\n if (column.width) {\n maxWidth = Math.min(maxWidth, column.width);\n }\n\n remainedWidth -= maxWidth;\n column.width = maxWidth;\n autoWidthCount--;\n }\n }); // Recalculate width again\n\n autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);\n autoWidth = Math.max(autoWidth, 0);\n var widthSum = 0;\n var lastColumn;\n zrUtil.each(stacks, function (column, idx) {\n if (!column.width) {\n column.width = autoWidth;\n }\n\n lastColumn = column;\n widthSum += column.width * (1 + barGapPercent);\n });\n\n if (lastColumn) {\n widthSum -= lastColumn.width * barGapPercent;\n }\n\n var offset = -widthSum / 2;\n zrUtil.each(stacks, function (column, stackId) {\n result[coordSysName][stackId] = result[coordSysName][stackId] || {\n offset: offset,\n width: column.width\n };\n offset += column.width * (1 + barGapPercent);\n });\n });\n return result;\n}\n\nexport default barLayoutPolar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport AxisView from '../axis/AxisView.js';\nimport PolarAxisPointer from '../axisPointer/PolarAxisPointer.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport PolarModel from '../../coord/polar/PolarModel.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport { AngleAxisModel, RadiusAxisModel } from '../../coord/polar/AxisModel.js';\nimport polarCreator from '../../coord/polar/polarCreator.js';\nimport AngleAxisView from '../axis/AngleAxisView.js';\nimport RadiusAxisView from '../axis/RadiusAxisView.js';\nimport ComponentView from '../../view/Component.js';\nimport { curry } from 'zrender/lib/core/util.js';\nimport barLayoutPolar from '../../layout/barPolar.js';\nvar angleAxisExtraOption = {\n startAngle: 90,\n clockwise: true,\n splitNumber: 12,\n axisLabel: {\n rotate: 0\n }\n};\nvar radiusAxisExtraOption = {\n splitNumber: 5\n};\n\nvar PolarView =\n/** @class */\nfunction (_super) {\n __extends(PolarView, _super);\n\n function PolarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarView.type;\n return _this;\n }\n\n PolarView.type = 'polar';\n return PolarView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer);\n registers.registerCoordinateSystem('polar', polarCreator);\n registers.registerComponentModel(PolarModel);\n registers.registerComponentView(PolarView); // Model and view for angleAxis and radiusAxis\n\n axisModelCreator(registers, 'angle', AngleAxisModel, angleAxisExtraOption);\n axisModelCreator(registers, 'radius', RadiusAxisModel, radiusAxisExtraOption);\n registers.registerComponentView(AngleAxisView);\n registers.registerComponentView(RadiusAxisView);\n registers.registerLayout(curry(barLayoutPolar, 'bar'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport AxisBuilder from './AxisBuilder.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nimport AxisView from './AxisView.js';\nimport { rectCoordAxisBuildSplitArea, rectCoordAxisHandleRemove } from './axisSplitHelper.js';\nvar axisBuilderAttrs = ['axisLine', 'axisTickLabel', 'axisName'];\nvar selfBuilderAttrs = ['splitArea', 'splitLine'];\n\nvar SingleAxisView =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisView, _super);\n\n function SingleAxisView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisView.type;\n _this.axisPointerClass = 'SingleAxisPointer';\n return _this;\n }\n\n SingleAxisView.prototype.render = function (axisModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n var oldAxisGroup = this._axisGroup;\n this._axisGroup = new graphic.Group();\n var layout = singleAxisHelper.layout(axisModel);\n var axisBuilder = new AxisBuilder(axisModel, layout);\n zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);\n group.add(this._axisGroup);\n group.add(axisBuilder.getGroup());\n zrUtil.each(selfBuilderAttrs, function (name) {\n if (axisModel.get([name, 'show'])) {\n axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);\n }\n }, this);\n graphic.groupTransition(oldAxisGroup, this._axisGroup, axisModel);\n\n _super.prototype.render.call(this, axisModel, ecModel, api, payload);\n };\n\n SingleAxisView.prototype.remove = function () {\n rectCoordAxisHandleRemove(this);\n };\n\n SingleAxisView.type = 'singleAxis';\n return SingleAxisView;\n}(AxisView);\n\nvar axisElementBuilders = {\n splitLine: function (axisView, group, axisGroup, axisModel) {\n var axis = axisModel.axis;\n\n if (axis.scale.isBlank()) {\n return;\n }\n\n var splitLineModel = axisModel.getModel('splitLine');\n var lineStyleModel = splitLineModel.getModel('lineStyle');\n var lineColors = lineStyleModel.get('color');\n lineColors = lineColors instanceof Array ? lineColors : [lineColors];\n var lineWidth = lineStyleModel.get('width');\n var gridRect = axisModel.coordinateSystem.getRect();\n var isHorizontal = axis.isHorizontal();\n var splitLines = [];\n var lineCount = 0;\n var ticksCoords = axis.getTicksCoords({\n tickModel: splitLineModel\n });\n var p1 = [];\n var p2 = [];\n\n for (var i = 0; i < ticksCoords.length; ++i) {\n var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);\n\n if (isHorizontal) {\n p1[0] = tickCoord;\n p1[1] = gridRect.y;\n p2[0] = tickCoord;\n p2[1] = gridRect.y + gridRect.height;\n } else {\n p1[0] = gridRect.x;\n p1[1] = tickCoord;\n p2[0] = gridRect.x + gridRect.width;\n p2[1] = tickCoord;\n }\n\n var line = new graphic.Line({\n shape: {\n x1: p1[0],\n y1: p1[1],\n x2: p2[0],\n y2: p2[1]\n },\n silent: true\n });\n graphic.subPixelOptimizeLine(line.shape, lineWidth);\n var colorIndex = lineCount++ % lineColors.length;\n splitLines[colorIndex] = splitLines[colorIndex] || [];\n splitLines[colorIndex].push(line);\n }\n\n var lineStyle = lineStyleModel.getLineStyle(['color']);\n\n for (var i = 0; i < splitLines.length; ++i) {\n group.add(graphic.mergePath(splitLines[i], {\n style: zrUtil.defaults({\n stroke: lineColors[i % lineColors.length]\n }, lineStyle),\n silent: true\n }));\n }\n },\n splitArea: function (axisView, group, axisGroup, axisModel) {\n rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);\n }\n};\nexport default SingleAxisView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin.js';\nimport { mixin } from 'zrender/lib/core/util.js';\n\nvar SingleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisModel, _super);\n\n function SingleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisModel.type;\n return _this;\n }\n\n SingleAxisModel.prototype.getCoordSysModel = function () {\n return this;\n };\n\n SingleAxisModel.type = 'singleAxis';\n SingleAxisModel.layoutMode = 'box';\n SingleAxisModel.defaultOption = {\n left: '5%',\n top: '5%',\n right: '5%',\n bottom: '5%',\n type: 'value',\n position: 'bottom',\n orient: 'horizontal',\n axisLine: {\n show: true,\n lineStyle: {\n width: 1,\n type: 'solid'\n }\n },\n // Single coordinate system and single axis is the,\n // which is used as the parent tooltip model.\n // same model, so we set default tooltip show as true.\n tooltip: {\n show: true\n },\n axisTick: {\n show: true,\n length: 6,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n interval: 'auto'\n },\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n opacity: 0.2\n }\n }\n };\n return SingleAxisModel;\n}(ComponentModel);\n\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis.js';\n\nvar SingleAxis =\n/** @class */\nfunction (_super) {\n __extends(SingleAxis, _super);\n\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n /**\r\n * Judge the orient of the axis.\r\n */\n\n\n SingleAxis.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n\n SingleAxis.prototype.pointToData = function (point, clamp) {\n return this.coordinateSystem.pointToData(point)[0];\n };\n\n return SingleAxis;\n}(Axis);\n\nexport default SingleAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Single coordinates system.\r\n */\nimport SingleAxis from './SingleAxis.js';\nimport * as axisHelper from '../axisHelper.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport var singleDimensions = ['single'];\n/**\r\n * Create a single coordinates system.\r\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\r\n * Add it just for draw tooltip.\r\n */\n\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\r\n * Initialize single coordinate system.\r\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\r\n * Update axis scale after data processed\r\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\r\n * Resize the single coordinate system.\r\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\r\n * Get axis.\r\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\r\n * Get axis, add it just for draw tooltip.\r\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\r\n * If contain point.\r\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\r\n * Convert the series data to concrete point.\r\n * Can be [val] | val\r\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * Single coordinate system creator.\r\n */\nimport Single, { singleDimensions } from './Single.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\n/**\r\n * Create single coordinate system and inject it into seriesModel.\r\n */\n\nfunction create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}\n\nvar singleCreator = {\n create: create,\n dimensions: singleDimensions\n};\nexport default singleCreator;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BaseAxisPointer from './BaseAxisPointer.js';\nimport * as viewHelper from './viewHelper.js';\nimport * as singleAxisHelper from '../../coord/single/singleAxisHelper.js';\nvar XY = ['x', 'y'];\nvar WH = ['width', 'height'];\n\nvar SingleAxisPointer =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisPointer, _super);\n\n function SingleAxisPointer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.makeElOption = function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));\n var pixelValue = coordSys.dataToPoint(value)[0];\n var axisPointerType = axisPointerModel.get('type');\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = singleAxisHelper.layout(axisModel);\n viewHelper.buildCartesianSingleLabelElOption( // @ts-ignore\n value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n };\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.getHandleTransform = function (value, axisModel, axisPointerModel) {\n var layoutInfo = singleAxisHelper.layout(axisModel, {\n labelInside: false\n }); // @ts-ignore\n\n layoutInfo.labelMargin = axisPointerModel.get(['handle', 'margin']);\n var position = viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo);\n return {\n x: position[0],\n y: position[1],\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n };\n /**\r\n * @override\r\n */\n\n\n SingleAxisPointer.prototype.updateHandleTransform = function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var coordSys = axis.coordinateSystem;\n var dimIndex = getPointDimIndex(axis);\n var axisExtent = getGlobalExtent(coordSys, dimIndex);\n var currPosition = [transform.x, transform.y];\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex];\n return {\n x: currPosition[0],\n y: currPosition[1],\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: {\n verticalAlign: 'middle'\n }\n };\n };\n\n return SingleAxisPointer;\n}(BaseAxisPointer);\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));\n return {\n type: 'Line',\n subPixelOptimize: true,\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent) {\n var bandWidth = axis.getBandWidth();\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))\n };\n }\n};\n\nfunction getPointDimIndex(axis) {\n return axis.isHorizontal() ? 0 : 1;\n}\n\nfunction getGlobalExtent(coordSys, dimIndex) {\n var rect = coordSys.getRect();\n return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]];\n}\n\nexport default SingleAxisPointer;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { use } from '../../extension.js';\nimport ComponentView from '../../view/Component.js';\nimport SingleAxisView from '../axis/SingleAxisView.js';\nimport axisModelCreator from '../../coord/axisModelCreator.js';\nimport SingleAxisModel from '../../coord/single/AxisModel.js';\nimport singleCreator from '../../coord/single/singleCreator.js';\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport AxisView from '../axis/AxisView.js';\nimport SingleAxisPointer from '../axisPointer/SingleAxisPointer.js';\n\nvar SingleView =\n/** @class */\nfunction (_super) {\n __extends(SingleView, _super);\n\n function SingleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleView.type;\n return _this;\n }\n\n SingleView.type = 'single';\n return SingleView;\n}(ComponentView);\n\nexport function install(registers) {\n use(installAxisPointer);\n AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer);\n registers.registerComponentView(SingleView); // Axis\n\n registers.registerComponentView(SingleAxisView);\n registers.registerComponentModel(SingleAxisModel);\n axisModelCreator(registers, 'single', SingleAxisModel, SingleAxisModel.defaultOption);\n registers.registerCoordinateSystem('single', singleCreator);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout.js';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\r\n * @override\r\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n // zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { isString, extend, map, isFunction } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { formatTplSimple } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getLocaleModel } from '../../core/locale.js';\n\nvar CalendarView =\n/** @class */\nfunction (_super) {\n __extends(CalendarView, _super);\n\n function CalendarView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarView.type;\n return _this;\n }\n\n CalendarView.prototype.render = function (calendarModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n var coordSys = calendarModel.coordinateSystem; // range info\n\n var rangeData = coordSys.getRangeInfo();\n var orient = coordSys.getOrient(); // locale\n\n var localeModel = ecModel.getLocaleModel();\n\n this._renderDayRect(calendarModel, rangeData, group); // _renderLines must be called prior to following function\n\n\n this._renderLines(calendarModel, rangeData, orient, group);\n\n this._renderYearText(calendarModel, rangeData, orient, group);\n\n this._renderMonthText(calendarModel, localeModel, orient, group);\n\n this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);\n }; // render day rect\n\n\n CalendarView.prototype._renderDayRect = function (calendarModel, rangeData, group) {\n var coordSys = calendarModel.coordinateSystem;\n var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle();\n var sw = coordSys.getCellWidth();\n var sh = coordSys.getCellHeight();\n\n for (var i = rangeData.start.time; i <= rangeData.end.time; i = coordSys.getNextNDay(i, 1).time) {\n var point = coordSys.dataToRect([i], false).tl; // every rect\n\n var rect = new graphic.Rect({\n shape: {\n x: point[0],\n y: point[1],\n width: sw,\n height: sh\n },\n cursor: 'default',\n style: itemRectStyleModel\n });\n group.add(rect);\n }\n }; // render separate line\n\n\n CalendarView.prototype._renderLines = function (calendarModel, rangeData, orient, group) {\n var self = this;\n var coordSys = calendarModel.coordinateSystem;\n var lineStyleModel = calendarModel.getModel(['splitLine', 'lineStyle']).getLineStyle();\n var show = calendarModel.get(['splitLine', 'show']);\n var lineWidth = lineStyleModel.lineWidth;\n this._tlpoints = [];\n this._blpoints = [];\n this._firstDayOfMonth = [];\n this._firstDayPoints = [];\n var firstDay = rangeData.start;\n\n for (var i = 0; firstDay.time <= rangeData.end.time; i++) {\n addPoints(firstDay.formatedDate);\n\n if (i === 0) {\n firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m);\n }\n\n var date = firstDay.date;\n date.setMonth(date.getMonth() + 1);\n firstDay = coordSys.getDateInfo(date);\n }\n\n addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);\n\n function addPoints(date) {\n self._firstDayOfMonth.push(coordSys.getDateInfo(date));\n\n self._firstDayPoints.push(coordSys.dataToRect([date], false).tl);\n\n var points = self._getLinePointsOfOneWeek(calendarModel, date, orient);\n\n self._tlpoints.push(points[0]);\n\n self._blpoints.push(points[points.length - 1]);\n\n show && self._drawSplitline(points, lineStyleModel, group);\n } // render top/left line\n\n\n show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); // render bottom/right line\n\n show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group);\n }; // get points at both ends\n\n\n CalendarView.prototype._getEdgesPoints = function (points, lineWidth, orient) {\n var rs = [points[0].slice(), points[points.length - 1].slice()];\n var idx = orient === 'horizontal' ? 0 : 1; // both ends of the line are extend half lineWidth\n\n rs[0][idx] = rs[0][idx] - lineWidth / 2;\n rs[1][idx] = rs[1][idx] + lineWidth / 2;\n return rs;\n }; // render split line\n\n\n CalendarView.prototype._drawSplitline = function (points, lineStyle, group) {\n var poyline = new graphic.Polyline({\n z2: 20,\n shape: {\n points: points\n },\n style: lineStyle\n });\n group.add(poyline);\n }; // render month line of one week points\n\n\n CalendarView.prototype._getLinePointsOfOneWeek = function (calendarModel, date, orient) {\n var coordSys = calendarModel.coordinateSystem;\n var parsedDate = coordSys.getDateInfo(date);\n var points = [];\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(parsedDate.time, i);\n var point = coordSys.dataToRect([tmpD.time], false);\n points[2 * tmpD.day] = point.tl;\n points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr'];\n }\n\n return points;\n };\n\n CalendarView.prototype._formatterLabel = function (formatter, params) {\n if (isString(formatter) && formatter) {\n return formatTplSimple(formatter, params);\n }\n\n if (isFunction(formatter)) {\n return formatter(params);\n }\n\n return params.nameMap;\n };\n\n CalendarView.prototype._yearTextPositionControl = function (textEl, point, orient, position, margin) {\n var x = point[0];\n var y = point[1];\n var aligns = ['center', 'bottom'];\n\n if (position === 'bottom') {\n y += margin;\n aligns = ['center', 'top'];\n } else if (position === 'left') {\n x -= margin;\n } else if (position === 'right') {\n x += margin;\n aligns = ['center', 'top'];\n } else {\n // top\n y -= margin;\n }\n\n var rotate = 0;\n\n if (position === 'left' || position === 'right') {\n rotate = Math.PI / 2;\n }\n\n return {\n rotation: rotate,\n x: x,\n y: y,\n style: {\n align: aligns[0],\n verticalAlign: aligns[1]\n }\n };\n }; // render year\n\n\n CalendarView.prototype._renderYearText = function (calendarModel, rangeData, orient, group) {\n var yearLabel = calendarModel.getModel('yearLabel');\n\n if (!yearLabel.get('show')) {\n return;\n }\n\n var margin = yearLabel.get('margin');\n var pos = yearLabel.get('position');\n\n if (!pos) {\n pos = orient !== 'horizontal' ? 'top' : 'left';\n }\n\n var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];\n var xc = (points[0][0] + points[1][0]) / 2;\n var yc = (points[0][1] + points[1][1]) / 2;\n var idx = orient === 'horizontal' ? 0 : 1;\n var posPoints = {\n top: [xc, points[idx][1]],\n bottom: [xc, points[1 - idx][1]],\n left: [points[1 - idx][0], yc],\n right: [points[idx][0], yc]\n };\n var name = rangeData.start.y;\n\n if (+rangeData.end.y > +rangeData.start.y) {\n name = name + '-' + rangeData.end.y;\n }\n\n var formatter = yearLabel.get('formatter');\n var params = {\n start: rangeData.start.y,\n end: rangeData.end.y,\n nameMap: name\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var yearText = new graphic.Text({\n z2: 30,\n style: createTextStyle(yearLabel, {\n text: content\n })\n });\n yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));\n group.add(yearText);\n };\n\n CalendarView.prototype._monthTextPositionControl = function (point, isCenter, orient, position, margin) {\n var align = 'left';\n var vAlign = 'top';\n var x = point[0];\n var y = point[1];\n\n if (orient === 'horizontal') {\n y = y + margin;\n\n if (isCenter) {\n align = 'center';\n }\n\n if (position === 'start') {\n vAlign = 'bottom';\n }\n } else {\n x = x + margin;\n\n if (isCenter) {\n vAlign = 'middle';\n }\n\n if (position === 'start') {\n align = 'right';\n }\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render month and year text\n\n\n CalendarView.prototype._renderMonthText = function (calendarModel, localeModel, orient, group) {\n var monthLabel = calendarModel.getModel('monthLabel');\n\n if (!monthLabel.get('show')) {\n return;\n }\n\n var nameMap = monthLabel.get('nameMap');\n var margin = monthLabel.get('margin');\n var pos = monthLabel.get('position');\n var align = monthLabel.get('align');\n var termPoints = [this._tlpoints, this._blpoints];\n\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n } // PENDING\n // for ZH locale, original form is `一月` but current form is `1月`\n\n\n nameMap = localeModel.get(['time', 'monthAbbr']) || [];\n }\n\n var idx = pos === 'start' ? 0 : 1;\n var axis = orient === 'horizontal' ? 0 : 1;\n margin = pos === 'start' ? -margin : margin;\n var isCenter = align === 'center';\n\n for (var i = 0; i < termPoints[idx].length - 1; i++) {\n var tmp = termPoints[idx][i].slice();\n var firstDay = this._firstDayOfMonth[i];\n\n if (isCenter) {\n var firstDayPoints = this._firstDayPoints[i];\n tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2;\n }\n\n var formatter = monthLabel.get('formatter');\n var name_1 = nameMap[+firstDay.m - 1];\n var params = {\n yyyy: firstDay.y,\n yy: (firstDay.y + '').slice(2),\n MM: firstDay.m,\n M: +firstDay.m,\n nameMap: name_1\n };\n\n var content = this._formatterLabel(formatter, params);\n\n var monthText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(monthLabel, {\n text: content\n }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin))\n });\n group.add(monthText);\n }\n };\n\n CalendarView.prototype._weekTextPositionControl = function (point, orient, position, margin, cellSize) {\n var align = 'center';\n var vAlign = 'middle';\n var x = point[0];\n var y = point[1];\n var isStart = position === 'start';\n\n if (orient === 'horizontal') {\n x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2;\n align = isStart ? 'right' : 'left';\n } else {\n y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;\n vAlign = isStart ? 'bottom' : 'top';\n }\n\n return {\n x: x,\n y: y,\n align: align,\n verticalAlign: vAlign\n };\n }; // render weeks\n\n\n CalendarView.prototype._renderWeekText = function (calendarModel, localeModel, rangeData, orient, group) {\n var dayLabel = calendarModel.getModel('dayLabel');\n\n if (!dayLabel.get('show')) {\n return;\n }\n\n var coordSys = calendarModel.coordinateSystem;\n var pos = dayLabel.get('position');\n var nameMap = dayLabel.get('nameMap');\n var margin = dayLabel.get('margin');\n var firstDayOfWeek = coordSys.getFirstDayOfWeek();\n\n if (!nameMap || isString(nameMap)) {\n if (nameMap) {\n // case-sensitive\n localeModel = getLocaleModel(nameMap) || localeModel;\n } // Use the first letter of `dayOfWeekAbbr` if `dayOfWeekShort` doesn't exist in the locale file\n\n\n var dayOfWeekShort = localeModel.get(['time', 'dayOfWeekShort']);\n nameMap = dayOfWeekShort || map(localeModel.get(['time', 'dayOfWeekAbbr']), function (val) {\n return val[0];\n });\n }\n\n var start = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;\n var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];\n margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));\n\n if (pos === 'start') {\n start = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;\n margin = -margin;\n }\n\n for (var i = 0; i < 7; i++) {\n var tmpD = coordSys.getNextNDay(start, i);\n var point = coordSys.dataToRect([tmpD.time], false).center;\n var day = i;\n day = Math.abs((i + firstDayOfWeek) % 7);\n var weekText = new graphic.Text({\n z2: 30,\n style: extend(createTextStyle(dayLabel, {\n text: nameMap[day]\n }), this._weekTextPositionControl(point, orient, pos, margin, cellSize))\n });\n group.add(weekText);\n }\n };\n\n CalendarView.type = 'calendar';\n return CalendarView;\n}(ComponentView);\n\nexport default CalendarView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as layout from '../../util/layout.js';\nimport * as numberUtil from '../../util/number.js'; // (24*60*60*1000)\n\nvar PROXIMATE_ONE_DAY = 86400000;\n\nvar Calendar =\n/** @class */\nfunction () {\n function Calendar(calendarModel, ecModel, api) {\n this.type = 'calendar';\n this.dimensions = Calendar.dimensions; // Required in createListFromData\n\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\n this._model = calendarModel;\n }\n\n Calendar.getDimensionsInfo = function () {\n return [{\n name: 'time',\n type: 'time'\n }, 'value'];\n };\n\n Calendar.prototype.getRangeInfo = function () {\n return this._rangeInfo;\n };\n\n Calendar.prototype.getModel = function () {\n return this._model;\n };\n\n Calendar.prototype.getRect = function () {\n return this._rect;\n };\n\n Calendar.prototype.getCellWidth = function () {\n return this._sw;\n };\n\n Calendar.prototype.getCellHeight = function () {\n return this._sh;\n };\n\n Calendar.prototype.getOrient = function () {\n return this._orient;\n };\n /**\r\n * getFirstDayOfWeek\r\n *\r\n * @example\r\n * 0 : start at Sunday\r\n * 1 : start at Monday\r\n *\r\n * @return {number}\r\n */\n\n\n Calendar.prototype.getFirstDayOfWeek = function () {\n return this._firstDayOfWeek;\n };\n /**\r\n * get date info\r\n * }\r\n */\n\n\n Calendar.prototype.getDateInfo = function (date) {\n date = numberUtil.parseDate(date);\n var y = date.getFullYear();\n var m = date.getMonth() + 1;\n var mStr = m < 10 ? '0' + m : '' + m;\n var d = date.getDate();\n var dStr = d < 10 ? '0' + d : '' + d;\n var day = date.getDay();\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n return {\n y: y + '',\n m: mStr,\n d: dStr,\n day: day,\n time: date.getTime(),\n formatedDate: y + '-' + mStr + '-' + dStr,\n date: date\n };\n };\n\n Calendar.prototype.getNextNDay = function (date, n) {\n n = n || 0;\n\n if (n === 0) {\n return this.getDateInfo(date);\n }\n\n date = new Date(this.getDateInfo(date).time);\n date.setDate(date.getDate() + n);\n return this.getDateInfo(date);\n };\n\n Calendar.prototype.update = function (ecModel, api) {\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n this._orient = this._model.get('orient');\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n var weeks = this._rangeInfo.weeks || 1;\n var whNames = ['width', 'height'];\n\n var cellSize = this._model.getCellSize().slice();\n\n var layoutParams = this._model.getBoxLayoutParams();\n\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n zrUtil.each([0, 1], function (idx) {\n if (cellSizeSpecified(cellSize, idx)) {\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n }\n });\n var whGlobal = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n zrUtil.each([0, 1], function (idx) {\n if (!cellSizeSpecified(cellSize, idx)) {\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n }\n });\n\n function cellSizeSpecified(cellSize, idx) {\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\n } // Has been calculated out number.\n\n\n this._sw = cellSize[0];\n this._sh = cellSize[1];\n };\n /**\r\n * Convert a time data(time, value) item to (x, y) point.\r\n */\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\n // It will return NaN if data exceeds.\n\n\n Calendar.prototype.dataToPoint = function (data, clamp) {\n zrUtil.isArray(data) && (data = data[0]);\n clamp == null && (clamp = true);\n var dayInfo = this.getDateInfo(data);\n var range = this._rangeInfo;\n var date = dayInfo.formatedDate; // if not in range return [NaN, NaN]\n\n if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n return [NaN, NaN];\n }\n\n var week = dayInfo.day;\n\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n\n if (this._orient === 'vertical') {\n return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];\n }\n\n return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];\n };\n /**\r\n * Convert a (x, y) point to time data\r\n */\n\n\n Calendar.prototype.pointToData = function (point) {\n var date = this.pointToDate(point);\n return date && date.time;\n };\n /**\r\n * Convert a time date item to (x, y) four point.\r\n */\n\n\n Calendar.prototype.dataToRect = function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n height: this._sh - this._lineWidth\n },\n center: point,\n tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n };\n };\n /**\r\n * Convert a (x, y) point to time date\r\n *\r\n * @param {Array} point point\r\n * @return {Object} date\r\n */\n\n\n Calendar.prototype.pointToDate = function (point) {\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n var range = this._rangeInfo.range;\n\n if (this._orient === 'vertical') {\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n }\n\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n };\n\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n Calendar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n /**\r\n * initRange\r\n * Normalize to an [start, end] array\r\n */\n\n\n Calendar.prototype._initRangeOption = function () {\n var range = this._model.get('range');\n\n var normalizedRange; // Convert [1990] to 1990\n\n if (zrUtil.isArray(range) && range.length === 1) {\n range = range[0];\n }\n\n if (!zrUtil.isArray(range)) {\n var rangeStr = range.toString(); // One year.\n\n if (/^\\d{4}$/.test(rangeStr)) {\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n } // One month\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n var start = this.getDateInfo(rangeStr);\n var firstDay = start.date;\n firstDay.setMonth(firstDay.getMonth() + 1);\n var end = this.getNextNDay(firstDay, -1);\n normalizedRange = [start.formatedDate, end.formatedDate];\n } // One day\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n normalizedRange = [rangeStr, rangeStr];\n }\n } else {\n normalizedRange = range;\n }\n\n if (!normalizedRange) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.logError('Invalid date range.');\n } // Not handling it.\n\n\n return range;\n }\n\n var tmp = this._getRangeInfo(normalizedRange);\n\n if (tmp.start.time > tmp.end.time) {\n normalizedRange.reverse();\n }\n\n return normalizedRange;\n };\n /**\r\n * range info\r\n *\r\n * @private\r\n * @param {Array} range range ['2017-01-01', '2017-07-08']\r\n * If range[0] > range[1], they will not be reversed.\r\n * @return {Object} obj\r\n */\n\n\n Calendar.prototype._getRangeInfo = function (range) {\n var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n var reversed;\n\n if (parsedRange[0].time > parsedRange[1].time) {\n reversed = true;\n parsedRange.reverse();\n }\n\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430):\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n // Consider case2:\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\n // ```\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n // let second = new Date(1478412000000);\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n // ```\n // will get wrong result because of DST. So we should fix it.\n\n var date = new Date(parsedRange[0].time);\n var startDateNum = date.getDate();\n var endDateNum = parsedRange[1].date.getDate();\n date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date.\n\n var dateNum = date.getDate();\n\n if (dateNum !== endDateNum) {\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n\n while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n allDay -= sign;\n date.setDate(dateNum - sign);\n }\n }\n\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n reversed && parsedRange.reverse();\n return {\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n start: parsedRange[0],\n end: parsedRange[1],\n allDay: allDay,\n weeks: weeks,\n // From 0.\n nthWeek: nthWeek,\n fweek: parsedRange[0].day,\n lweek: parsedRange[1].day\n };\n };\n /**\r\n * get date by nthWeeks and week day in range\r\n *\r\n * @private\r\n * @param {number} nthWeek the week\r\n * @param {number} day the week day\r\n * @param {Array} range [d1, d2]\r\n * @return {Object}\r\n */\n\n\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n var rangeInfo = this._getRangeInfo(range);\n\n if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n return null;\n }\n\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n var date = new Date(rangeInfo.start.time);\n date.setDate(+rangeInfo.start.d + nthDay);\n return this.getDateInfo(date);\n };\n\n Calendar.create = function (ecModel, api) {\n var calendarList = [];\n ecModel.eachComponent('calendar', function (calendarModel) {\n var calendar = new Calendar(calendarModel, ecModel, api);\n calendarList.push(calendar);\n calendarModel.coordinateSystem = calendar;\n });\n ecModel.eachSeries(function (calendarSeries) {\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\n // Inject coordinate system\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\n }\n });\n return calendarList;\n };\n\n Calendar.dimensions = ['time', 'value'];\n return Calendar;\n}();\n\nfunction getCoordSys(finder) {\n var calendarModel = finder.calendarModel;\n var seriesModel = finder.seriesModel;\n var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n return coordSys;\n}\n\nexport default Calendar;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport CalendarModel from '../../coord/calendar/CalendarModel.js';\nimport CalendarView from './CalendarView.js';\nimport Calendar from '../../coord/calendar/Calendar.js';\nexport function install(registers) {\n registers.registerComponentModel(CalendarModel);\n registers.registerComponentView(CalendarView);\n registers.registerCoordinateSystem('calendar', Calendar);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as modelUtil from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\nimport { copyLayoutParams, mergeLayoutParam } from '../../util/layout.js';\n;\n;\n;\nexport function setKeyInfoToNewElOption(resultItem, newElOption) {\n var existElOption = resultItem.existing; // Set id and type after id assigned.\n\n newElOption.id = resultItem.keyInfo.id;\n !newElOption.type && existElOption && (newElOption.type = existElOption.type); // Set parent id if not specified\n\n if (newElOption.parentId == null) {\n var newElParentOption = newElOption.parentOption;\n\n if (newElParentOption) {\n newElOption.parentId = newElParentOption.id;\n } else if (existElOption) {\n newElOption.parentId = existElOption.parentId;\n }\n } // Clear\n\n\n newElOption.parentOption = null;\n}\n\nfunction isSetLoc(obj, props) {\n var isSet;\n zrUtil.each(props, function (prop) {\n obj[prop] != null && obj[prop] !== 'auto' && (isSet = true);\n });\n return isSet;\n}\n\nfunction mergeNewElOptionToExist(existList, index, newElOption) {\n // Update existing options, for `getOption` feature.\n var newElOptCopy = zrUtil.extend({}, newElOption);\n var existElOption = existList[index];\n var $action = newElOption.$action || 'merge';\n\n if ($action === 'merge') {\n if (existElOption) {\n if (process.env.NODE_ENV !== 'production') {\n var newType = newElOption.type;\n zrUtil.assert(!newType || existElOption.type === newType, 'Please set $action: \"replace\" to change `type`');\n } // We can ensure that newElOptCopy and existElOption are not\n // the same object, so `merge` will not change newElOptCopy.\n\n\n zrUtil.merge(existElOption, newElOptCopy, true); // Rigid body, use ignoreSize.\n\n mergeLayoutParam(existElOption, newElOptCopy, {\n ignoreSize: true\n }); // Will be used in render.\n\n copyLayoutParams(newElOption, existElOption); // Copy transition info to new option so it can be used in the transition.\n // DO IT AFTER merge\n\n copyTransitionInfo(newElOption, existElOption);\n copyTransitionInfo(newElOption, existElOption, 'shape');\n copyTransitionInfo(newElOption, existElOption, 'style');\n copyTransitionInfo(newElOption, existElOption, 'extra'); // Copy clipPath\n\n newElOption.clipPath = existElOption.clipPath;\n } else {\n existList[index] = newElOptCopy;\n }\n } else if ($action === 'replace') {\n existList[index] = newElOptCopy;\n } else if ($action === 'remove') {\n // null will be cleaned later.\n existElOption && (existList[index] = null);\n }\n}\n\nvar TRANSITION_PROPS_TO_COPY = ['transition', 'enterFrom', 'leaveTo'];\nvar ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(['enterAnimation', 'updateAnimation', 'leaveAnimation']);\n\nfunction copyTransitionInfo(target, source, targetProp) {\n if (targetProp) {\n if (!target[targetProp] && source[targetProp]) {\n // TODO avoid creating this empty object when there is no transition configuration.\n target[targetProp] = {};\n }\n\n target = target[targetProp];\n source = source[targetProp];\n }\n\n if (!target || !source) {\n return;\n }\n\n var props = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;\n\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n\n if (target[prop] == null && source[prop] != null) {\n target[prop] = source[prop];\n }\n }\n}\n\nfunction setLayoutInfoToExist(existItem, newElOption) {\n if (!existItem) {\n return;\n }\n\n existItem.hv = newElOption.hv = [// Rigid body, don't care about `width`.\n isSetLoc(newElOption, ['left', 'right']), // Rigid body, don't care about `height`.\n isSetLoc(newElOption, ['top', 'bottom'])]; // Give default group size. Otherwise layout error may occur.\n\n if (existItem.type === 'group') {\n var existingGroupOpt = existItem;\n var newGroupOpt = newElOption;\n existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);\n existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);\n }\n}\n\nvar GraphicComponentModel =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentModel, _super);\n\n function GraphicComponentModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentModel.type;\n _this.preventAutoZ = true;\n return _this;\n }\n\n GraphicComponentModel.prototype.mergeOption = function (option, ecModel) {\n // Prevent default merge to elements\n var elements = this.option.elements;\n this.option.elements = null;\n\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this.option.elements = elements;\n };\n\n GraphicComponentModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n var newList = (isInit ? thisOption : newOption).elements;\n var existList = thisOption.elements = isInit ? [] : thisOption.elements;\n var flattenedList = [];\n\n this._flatten(newList, flattenedList, null);\n\n var mappingResult = modelUtil.mappingToExists(existList, flattenedList, 'normalMerge'); // Clear elOptionsToUpdate\n\n var elOptionsToUpdate = this._elOptionsToUpdate = [];\n zrUtil.each(mappingResult, function (resultItem, index) {\n var newElOption = resultItem.newOption;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isObject(newElOption) || resultItem.existing, 'Empty graphic option definition');\n }\n\n if (!newElOption) {\n return;\n }\n\n elOptionsToUpdate.push(newElOption);\n setKeyInfoToNewElOption(resultItem, newElOption);\n mergeNewElOptionToExist(existList, index, newElOption);\n setLayoutInfoToExist(existList[index], newElOption);\n }, this); // Clean\n\n thisOption.elements = zrUtil.filter(existList, function (item) {\n // $action should be volatile, otherwise option gotten from\n // `getOption` will contain unexpected $action.\n item && delete item.$action;\n return item != null;\n });\n };\n /**\r\n * Convert\r\n * [{\r\n * type: 'group',\r\n * id: 'xx',\r\n * children: [{type: 'circle'}, {type: 'polygon'}]\r\n * }]\r\n * to\r\n * [\r\n * {type: 'group', id: 'xx'},\r\n * {type: 'circle', parentId: 'xx'},\r\n * {type: 'polygon', parentId: 'xx'}\r\n * ]\r\n */\n\n\n GraphicComponentModel.prototype._flatten = function (optionList, result, parentOption) {\n zrUtil.each(optionList, function (option) {\n if (!option) {\n return;\n }\n\n if (parentOption) {\n option.parentOption = parentOption;\n }\n\n result.push(option);\n var children = option.children; // here we don't judge if option.type is `group`\n // when new option doesn't provide `type`, it will cause that the children can't be updated.\n\n if (children && children.length) {\n this._flatten(children, result, option);\n } // Deleting for JSON output, and for not affecting group creation.\n\n\n delete option.children;\n }, this);\n }; // FIXME\n // Pass to view using payload? setOption has a payload?\n\n\n GraphicComponentModel.prototype.useElOptionsToUpdate = function () {\n var els = this._elOptionsToUpdate; // Clear to avoid render duplicately when zooming.\n\n this._elOptionsToUpdate = null;\n return els;\n };\n\n GraphicComponentModel.type = 'graphic';\n GraphicComponentModel.defaultOption = {\n elements: [] // parentId: null\n\n };\n return GraphicComponentModel;\n}(ComponentModel);\n\nexport { GraphicComponentModel };","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as graphicUtil from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport { parsePercent } from '../../util/number.js';\nimport ComponentView from '../../view/Component.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { isEC4CompatibleStyle, convertFromEC4CompatibleStyle } from '../../util/styleCompat.js';\nimport { applyLeaveTransition, applyUpdateTransition, isTransitionAll, updateLeaveTo } from '../../animation/customGraphicTransition.js';\nimport { updateProps } from '../../animation/basicTransition.js';\nimport { applyKeyframeAnimation, stopPreviousKeyframeAnimationAndRestore } from '../../animation/customGraphicKeyframeAnimation.js';\nvar nonShapeGraphicElements = {\n // Reserved but not supported in graphic component.\n path: null,\n compoundPath: null,\n // Supported in graphic component.\n group: graphicUtil.Group,\n image: graphicUtil.Image,\n text: graphicUtil.Text\n};\nexport var inner = modelUtil.makeInner(); // ------------------------\n// View\n// ------------------------\n\nvar GraphicComponentView =\n/** @class */\nfunction (_super) {\n __extends(GraphicComponentView, _super);\n\n function GraphicComponentView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GraphicComponentView.type;\n return _this;\n }\n\n GraphicComponentView.prototype.init = function () {\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.render = function (graphicModel, ecModel, api) {\n // Having leveraged between use cases and algorithm complexity, a very\n // simple layout mechanism is used:\n // The size(width/height) can be determined by itself or its parent (not\n // implemented yet), but can not by its children. (Top-down travel)\n // The location(x/y) can be determined by the bounding rect of itself\n // (can including its descendants or not) and the size of its parent.\n // (Bottom-up travel)\n // When `chart.clear()` or `chart.setOption({...}, true)` with the same id,\n // view will be reused.\n if (graphicModel !== this._lastGraphicModel) {\n this._clear();\n }\n\n this._lastGraphicModel = graphicModel;\n\n this._updateElements(graphicModel);\n\n this._relocate(graphicModel, api);\n };\n /**\r\n * Update graphic elements.\r\n */\n\n\n GraphicComponentView.prototype._updateElements = function (graphicModel) {\n var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();\n\n if (!elOptionsToUpdate) {\n return;\n }\n\n var elMap = this._elMap;\n var rootGroup = this.group;\n var globalZ = graphicModel.get('z');\n var globalZLevel = graphicModel.get('zlevel'); // Top-down tranverse to assign graphic settings to each elements.\n\n zrUtil.each(elOptionsToUpdate, function (elOption) {\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var elExisting = id != null ? elMap.get(id) : null;\n var parentId = modelUtil.convertOptionIdName(elOption.parentId, null);\n var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;\n var elType = elOption.type;\n var elOptionStyle = elOption.style;\n\n if (elType === 'text' && elOptionStyle) {\n // In top/bottom mode, textVerticalAlign should not be used, which cause\n // inaccurately locating.\n if (elOption.hv && elOption.hv[1]) {\n elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;\n }\n }\n\n var textContentOption = elOption.textContent;\n var textConfig = elOption.textConfig;\n\n if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {\n var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);\n\n if (!textConfig && convertResult.textConfig) {\n textConfig = elOption.textConfig = convertResult.textConfig;\n }\n\n if (!textContentOption && convertResult.textContent) {\n textContentOption = convertResult.textContent;\n }\n } // Remove unnecessary props to avoid potential problems.\n\n\n var elOptionCleaned = getCleanedElOption(elOption); // For simple, do not support parent change, otherwise reorder is needed.\n\n if (process.env.NODE_ENV !== 'production') {\n elExisting && zrUtil.assert(targetElParent === elExisting.parent, 'Changing parent is not supported.');\n }\n\n var $action = elOption.$action || 'merge';\n var isMerge = $action === 'merge';\n var isReplace = $action === 'replace';\n\n if (isMerge) {\n var isInit = !elExisting;\n var el_1 = elExisting;\n\n if (isInit) {\n el_1 = createEl(id, targetElParent, elOption.type, elMap);\n } else {\n el_1 && (inner(el_1).isNew = false); // Stop and restore before update any other attributes.\n\n stopPreviousKeyframeAnimationAndRestore(el_1);\n }\n\n if (el_1) {\n applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {\n isInit: isInit\n });\n updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);\n }\n } else if (isReplace) {\n removeEl(elExisting, elOption, elMap, graphicModel);\n var el_2 = createEl(id, targetElParent, elOption.type, elMap);\n\n if (el_2) {\n applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {\n isInit: true\n });\n updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);\n }\n } else if ($action === 'remove') {\n updateLeaveTo(elExisting, elOption);\n removeEl(elExisting, elOption, elMap, graphicModel);\n }\n\n var el = elMap.get(id);\n\n if (el && textContentOption) {\n if (isMerge) {\n var textContentExisting = el.getTextContent();\n textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new graphicUtil.Text(textContentOption));\n } else if (isReplace) {\n el.setTextContent(new graphicUtil.Text(textContentOption));\n }\n }\n\n if (el) {\n var clipPathOption = elOption.clipPath;\n\n if (clipPathOption) {\n var clipPathType = clipPathOption.type;\n var clipPath = void 0;\n var isInit = false;\n\n if (isMerge) {\n var oldClipPath = el.getClipPath();\n isInit = !oldClipPath || inner(oldClipPath).type !== clipPathType;\n clipPath = isInit ? newEl(clipPathType) : oldClipPath;\n } else if (isReplace) {\n isInit = true;\n clipPath = newEl(clipPathType);\n }\n\n el.setClipPath(clipPath);\n applyUpdateTransition(clipPath, clipPathOption, graphicModel, {\n isInit: isInit\n });\n applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);\n }\n\n var elInner = inner(el);\n el.setTextConfig(textConfig);\n elInner.option = elOption;\n setEventData(el, graphicModel, elOption);\n graphicUtil.setTooltipConfig({\n el: el,\n componentModel: graphicModel,\n itemName: el.name,\n itemTooltipOption: elOption.tooltip\n });\n applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);\n }\n });\n };\n /**\r\n * Locate graphic elements.\r\n */\n\n\n GraphicComponentView.prototype._relocate = function (graphicModel, api) {\n var elOptions = graphicModel.option.elements;\n var rootGroup = this.group;\n var elMap = this._elMap;\n var apiWidth = api.getWidth();\n var apiHeight = api.getHeight();\n var xy = ['x', 'y']; // Top-down to calculate percentage width/height of group\n\n for (var i = 0; i < elOptions.length; i++) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el || !el.isGroup) {\n continue;\n }\n\n var parentEl = el.parent;\n var isParentRoot = parentEl === rootGroup; // Like 'position:absolut' in css, default 0.\n\n var elInner = inner(el);\n var parentElInner = inner(parentEl);\n elInner.width = parsePercent(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;\n elInner.height = parsePercent(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;\n } // Bottom-up tranvese all elements (consider ec resize) to locate elements.\n\n\n for (var i = elOptions.length - 1; i >= 0; i--) {\n var elOption = elOptions[i];\n var id = modelUtil.convertOptionIdName(elOption.id, null);\n var el = id != null ? elMap.get(id) : null;\n\n if (!el) {\n continue;\n }\n\n var parentEl = el.parent;\n var parentElInner = inner(parentEl);\n var containerInfo = parentEl === rootGroup ? {\n width: apiWidth,\n height: apiHeight\n } : {\n width: parentElInner.width,\n height: parentElInner.height\n }; // PENDING\n // Currently, when `bounding: 'all'`, the union bounding rect of the group\n // does not include the rect of [0, 0, group.width, group.height], which\n // is probably weird for users. Should we make a break change for it?\n\n var layoutPos = {};\n var layouted = layoutUtil.positionElement(el, elOption, containerInfo, null, {\n hv: elOption.hv,\n boundingMode: elOption.bounding\n }, layoutPos);\n\n if (!inner(el).isNew && layouted) {\n var transition = elOption.transition;\n var animatePos = {};\n\n for (var k = 0; k < xy.length; k++) {\n var key = xy[k];\n var val = layoutPos[key];\n\n if (transition && (isTransitionAll(transition) || zrUtil.indexOf(transition, key) >= 0)) {\n animatePos[key] = val;\n } else {\n el[key] = val;\n }\n }\n\n updateProps(el, animatePos, graphicModel, 0);\n } else {\n el.attr(layoutPos);\n }\n }\n };\n /**\r\n * Clear all elements.\r\n */\n\n\n GraphicComponentView.prototype._clear = function () {\n var _this = this;\n\n var elMap = this._elMap;\n elMap.each(function (el) {\n removeEl(el, inner(el).option, elMap, _this._lastGraphicModel);\n });\n this._elMap = zrUtil.createHashMap();\n };\n\n GraphicComponentView.prototype.dispose = function () {\n this._clear();\n };\n\n GraphicComponentView.type = 'graphic';\n return GraphicComponentView;\n}(ComponentView);\n\nexport { GraphicComponentView };\n\nfunction newEl(graphicType) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(graphicType, 'graphic type MUST be set');\n }\n\n var Clz = zrUtil.hasOwn(nonShapeGraphicElements, graphicType) // Those graphic elements are not shapes. They should not be\n // overwritten by users, so do them first.\n ? nonShapeGraphicElements[graphicType] : graphicUtil.getShapeClass(graphicType);\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(Clz, \"graphic type \" + graphicType + \" can not be found\");\n }\n\n var el = new Clz({});\n inner(el).type = graphicType;\n return el;\n}\n\nfunction createEl(id, targetElParent, graphicType, elMap) {\n var el = newEl(graphicType);\n targetElParent.add(el);\n elMap.set(id, el);\n inner(el).id = id;\n inner(el).isNew = true;\n return el;\n}\n\nfunction removeEl(elExisting, elOption, elMap, graphicModel) {\n var existElParent = elExisting && elExisting.parent;\n\n if (existElParent) {\n elExisting.type === 'group' && elExisting.traverse(function (el) {\n removeEl(el, elOption, elMap, graphicModel);\n });\n applyLeaveTransition(elExisting, elOption, graphicModel);\n elMap.removeKey(inner(elExisting).id);\n }\n}\n\nfunction updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {\n if (!el.isGroup) {\n zrUtil.each([['cursor', Displayable.prototype.cursor], // We should not support configure z and zlevel in the element level.\n // But seems we didn't limit it previously. So here still use it to avoid breaking.\n ['zlevel', defaultZlevel || 0], ['z', defaultZ || 0], // z2 must not be null/undefined, otherwise sort error may occur.\n ['z2', 0]], function (item) {\n var prop = item[0];\n\n if (zrUtil.hasOwn(elOption, prop)) {\n el[prop] = zrUtil.retrieve2(elOption[prop], item[1]);\n } else if (el[prop] == null) {\n el[prop] = item[1];\n }\n });\n }\n\n zrUtil.each(zrUtil.keys(elOption), function (key) {\n // Assign event handlers.\n // PENDING: should enumerate all event names or use pattern matching?\n if (key.indexOf('on') === 0) {\n var val = elOption[key];\n el[key] = zrUtil.isFunction(val) ? val : null;\n }\n });\n\n if (zrUtil.hasOwn(elOption, 'draggable')) {\n el.draggable = elOption.draggable;\n } // Other attributes\n\n\n elOption.name != null && (el.name = elOption.name);\n elOption.id != null && (el.id = elOption.id);\n} // Remove unnecessary props to avoid potential problems.\n\n\nfunction getCleanedElOption(elOption) {\n elOption = zrUtil.extend({}, elOption);\n zrUtil.each(['id', 'parentId', '$action', 'hv', 'bounding', 'textContent', 'clipPath'].concat(layoutUtil.LOCATION_PARAMS), function (name) {\n delete elOption[name];\n });\n return elOption;\n}\n\nfunction setEventData(el, graphicModel, elOption) {\n var eventData = getECData(el).eventData; // Simple optimize for large amount of elements that no need event.\n\n if (!el.silent && !el.ignore && !eventData) {\n eventData = getECData(el).eventData = {\n componentType: 'graphic',\n componentIndex: graphicModel.componentIndex,\n name: el.name\n };\n } // `elOption.info` enables user to mount some info on\n // elements and use them in event handlers.\n\n\n if (eventData) {\n eventData.info = elOption.info;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nimport { GraphicComponentModel } from './GraphicModel.js';\nimport { GraphicComponentView } from './GraphicView.js';\nexport function install(registers) {\n registers.registerComponentModel(GraphicComponentModel);\n registers.registerComponentView(GraphicComponentView);\n registers.registerPreprocessor(function (option) {\n var graphicOption = option.graphic; // Convert\n // {graphic: [{left: 10, type: 'circle'}, ...]}\n // or\n // {graphic: {left: 10, type: 'circle'}}\n // to\n // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]}\n\n if (isArray(graphicOption)) {\n if (!graphicOption[0] || !graphicOption[0].elements) {\n option.graphic = [{\n elements: graphicOption\n }];\n } else {\n // Only one graphic instance can be instantiated. (We don't\n // want that too many views are created in echarts._viewMap.)\n option.graphic = [option.graphic[0]];\n }\n } else if (graphicOption && !graphicOption.elements) {\n option.graphic = [{\n elements: [graphicOption]\n }];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { indexOf, createHashMap, assert } from 'zrender/lib/core/util.js';\nexport var DATA_ZOOM_AXIS_DIMENSIONS = ['x', 'y', 'radius', 'angle', 'single']; // Supported coords.\n// FIXME: polar has been broken (but rarely used).\n\nvar SERIES_COORDS = ['cartesian2d', 'polar', 'singleAxis'];\nexport function isCoordSupported(seriesModel) {\n var coordType = seriesModel.get('coordinateSystem');\n return indexOf(SERIES_COORDS, coordType) >= 0;\n}\nexport function getAxisMainType(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'Axis';\n}\nexport function getAxisIndexPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisIndex';\n}\nexport function getAxisIdPropName(axisDim) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim);\n }\n\n return axisDim + 'AxisId';\n}\n/**\r\n * If two dataZoomModels has the same axis controlled, we say that they are 'linked'.\r\n * This function finds all linked dataZoomModels start from the given payload.\r\n */\n\nexport function findEffectedDataZooms(ecModel, payload) {\n // Key: `DataZoomAxisDimension`\n var axisRecords = createHashMap();\n var effectedModels = []; // Key: uid of dataZoomModel\n\n var effectedModelMap = createHashMap(); // Find the dataZooms specified by payload.\n\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid)) {\n addToEffected(dataZoomModel);\n }\n }); // Start from the given dataZoomModels, travel the graph to find\n // all of the linked dataZoom models.\n\n var foundNewLink;\n\n do {\n foundNewLink = false;\n ecModel.eachComponent('dataZoom', processSingle);\n } while (foundNewLink);\n\n function processSingle(dataZoomModel) {\n if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {\n addToEffected(dataZoomModel);\n foundNewLink = true;\n }\n }\n\n function addToEffected(dataZoom) {\n effectedModelMap.set(dataZoom.uid, true);\n effectedModels.push(dataZoom);\n markAxisControlled(dataZoom);\n }\n\n function isLinked(dataZoomModel) {\n var isLink = false;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisIdxArr = axisRecords.get(axisDim);\n\n if (axisIdxArr && axisIdxArr[axisIndex]) {\n isLink = true;\n }\n });\n return isLink;\n }\n\n function markAxisControlled(dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;\n });\n }\n\n return effectedModels;\n}\n/**\r\n * Find the first target coordinate system.\r\n * Available after model built.\r\n *\r\n * @return Like {\r\n * grid: [\r\n * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},\r\n * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},\r\n * ...\r\n * ], // cartesians must not be null/undefined.\r\n * polar: [\r\n * {model: coord0, axisModels: [axis4], coordIndex: 0},\r\n * ...\r\n * ], // polars must not be null/undefined.\r\n * singleAxis: [\r\n * {model: coord0, axisModels: [], coordIndex: 0}\r\n * ]\r\n * }\r\n */\n\nexport function collectReferCoordSysModelInfo(dataZoomModel) {\n var ecModel = dataZoomModel.ecModel;\n var coordSysInfoWrap = {\n infoList: [],\n infoMap: createHashMap()\n };\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n\n if (!axisModel) {\n return;\n }\n\n var coordSysModel = axisModel.getCoordSysModel();\n\n if (!coordSysModel) {\n return;\n }\n\n var coordSysUid = coordSysModel.uid;\n var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);\n\n if (!coordSysInfo) {\n coordSysInfo = {\n model: coordSysModel,\n axisModels: []\n };\n coordSysInfoWrap.infoList.push(coordSysInfo);\n coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);\n }\n\n coordSysInfo.axisModels.push(axisModel);\n });\n return coordSysInfoWrap;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { each, createHashMap, merge, assert } from 'zrender/lib/core/util.js';\nimport ComponentModel from '../../model/Component.js';\nimport { getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS } from './helper.js';\nimport { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model.js';\n\nvar DataZoomAxisInfo =\n/** @class */\nfunction () {\n function DataZoomAxisInfo() {\n this.indexList = [];\n this.indexMap = [];\n }\n\n DataZoomAxisInfo.prototype.add = function (axisCmptIdx) {\n // Remove duplication.\n if (!this.indexMap[axisCmptIdx]) {\n this.indexList.push(axisCmptIdx);\n this.indexMap[axisCmptIdx] = true;\n }\n };\n\n return DataZoomAxisInfo;\n}();\n\nvar DataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(DataZoomModel, _super);\n\n function DataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomModel.type;\n _this._autoThrottle = true;\n _this._noTarget = true;\n /**\r\n * It is `[rangeModeForMin, rangeModeForMax]`.\r\n * The optional values for `rangeMode`:\r\n * + `'value'` mode: the axis extent will always be determined by\r\n * `dataZoom.startValue` and `dataZoom.endValue`, despite\r\n * how data like and how `axis.min` and `axis.max` are.\r\n * + `'percent'` mode: `100` represents 100% of the `[dMin, dMax]`,\r\n * where `dMin` is `axis.min` if `axis.min` specified, otherwise `data.extent[0]`,\r\n * and `dMax` is `axis.max` if `axis.max` specified, otherwise `data.extent[1]`.\r\n * Axis extent will be determined by the result of the percent of `[dMin, dMax]`.\r\n *\r\n * For example, when users are using dynamic data (update data periodically via `setOption`),\r\n * if in `'value`' mode, the window will be kept in a fixed value range despite how\r\n * data are appended, while if in `'percent'` mode, whe window range will be changed alone with\r\n * the appended data (suppose `axis.min` and `axis.max` are not specified).\r\n */\n\n _this._rangePropMode = ['percent', 'percent'];\n return _this;\n }\n\n DataZoomModel.prototype.init = function (option, parentModel, ecModel) {\n var inputRawOption = retrieveRawOption(option);\n /**\r\n * Suppose a \"main process\" start at the point that model prepared (that is,\r\n * model initialized or merged or method called in `action`).\r\n * We should keep the `main process` idempotent, that is, given a set of values\r\n * on `option`, we get the same result.\r\n *\r\n * But sometimes, values on `option` will be updated for providing users\r\n * a \"final calculated value\" (`dataZoomProcessor` will do that). Those value\r\n * should not be the base/input of the `main process`.\r\n *\r\n * So in that case we should save and keep the input of the `main process`\r\n * separately, called `settledOption`.\r\n *\r\n * For example, consider the case:\r\n * (Step_1) brush zoom the grid by `toolbox.dataZoom`,\r\n * where the original input `option.startValue`, `option.endValue` are earsed by\r\n * calculated value.\r\n * (Step)2) click the legend to hide and show a series,\r\n * where the new range is calculated by the earsed `startValue` and `endValue`,\r\n * which brings incorrect result.\r\n */\n\n this.settledOption = inputRawOption;\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype.mergeOption = function (newOption) {\n var inputRawOption = retrieveRawOption(newOption); // FIX #2591\n\n merge(this.option, newOption, true);\n merge(this.settledOption, inputRawOption, true);\n\n this._doInit(inputRawOption);\n };\n\n DataZoomModel.prototype._doInit = function (inputRawOption) {\n var thisOption = this.option;\n\n this._setDefaultThrottle(inputRawOption);\n\n this._updateRangeUse(inputRawOption);\n\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n // start/end has higher priority over startValue/endValue if they\n // both set, but we should make chart.setOption({endValue: 1000})\n // effective, rather than chart.setOption({endValue: 1000, end: null}).\n if (this._rangePropMode[index] === 'value') {\n thisOption[names[0]] = settledOption[names[0]] = null;\n } // Otherwise do nothing and use the merge result.\n\n }, this);\n\n this._resetTarget();\n };\n\n DataZoomModel.prototype._resetTarget = function () {\n var optionOrient = this.get('orient', true);\n var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();\n\n var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);\n\n if (hasAxisSpecified) {\n this._orient = optionOrient || this._makeAutoOrientByTargetAxis();\n } else {\n this._orient = optionOrient || 'horizontal';\n\n this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);\n }\n\n this._noTarget = true;\n targetAxisIndexMap.each(function (axisInfo) {\n if (axisInfo.indexList.length) {\n this._noTarget = false;\n }\n }, this);\n };\n\n DataZoomModel.prototype._fillSpecifiedTargetAxis = function (targetAxisIndexMap) {\n var hasAxisSpecified = false;\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING); // When user set axisIndex as a empty array, we think that user specify axisIndex\n // but do not want use auto mode. Because empty array may be encountered when\n // some error occurred.\n\n if (!refering.specified) {\n return;\n }\n\n hasAxisSpecified = true;\n var axisInfo = new DataZoomAxisInfo();\n each(refering.models, function (axisModel) {\n axisInfo.add(axisModel.componentIndex);\n });\n targetAxisIndexMap.set(axisDim, axisInfo);\n }, this);\n return hasAxisSpecified;\n };\n\n DataZoomModel.prototype._fillAutoTargetAxisByOrient = function (targetAxisIndexMap, orient) {\n var ecModel = this.ecModel;\n var needAuto = true; // Find axis that parallel to dataZoom as default.\n\n if (needAuto) {\n var axisDim = orient === 'vertical' ? 'y' : 'x';\n var axisModels = ecModel.findComponents({\n mainType: axisDim + 'Axis'\n });\n setParallelAxis(axisModels, axisDim);\n } // Find axis that parallel to dataZoom as default.\n\n\n if (needAuto) {\n var axisModels = ecModel.findComponents({\n mainType: 'singleAxis',\n filter: function (axisModel) {\n return axisModel.get('orient', true) === orient;\n }\n });\n setParallelAxis(axisModels, 'single');\n }\n\n function setParallelAxis(axisModels, axisDim) {\n // At least use the first parallel axis as the target axis.\n var axisModel = axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModel.componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false; // Find parallel axes in the same grid.\n\n if (axisDim === 'x' || axisDim === 'y') {\n var gridModel_1 = axisModel.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n gridModel_1 && each(axisModels, function (axModel) {\n if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents('grid', SINGLE_REFERRING).models[0]) {\n axisInfo.add(axModel.componentIndex);\n }\n });\n }\n }\n\n if (needAuto) {\n // If no parallel axis, find the first category axis as default. (Also consider polar).\n each(DATA_ZOOM_AXIS_DIMENSIONS, function (axisDim) {\n if (!needAuto) {\n return;\n }\n\n var axisModels = ecModel.findComponents({\n mainType: getAxisMainType(axisDim),\n filter: function (axisModel) {\n return axisModel.get('type', true) === 'category';\n }\n });\n\n if (axisModels[0]) {\n var axisInfo = new DataZoomAxisInfo();\n axisInfo.add(axisModels[0].componentIndex);\n targetAxisIndexMap.set(axisDim, axisInfo);\n needAuto = false;\n }\n }, this);\n }\n };\n\n DataZoomModel.prototype._makeAutoOrientByTargetAxis = function () {\n var dim; // Find the first axis\n\n this.eachTargetAxis(function (axisDim) {\n !dim && (dim = axisDim);\n }, this);\n return dim === 'y' ? 'vertical' : 'horizontal';\n };\n\n DataZoomModel.prototype._setDefaultThrottle = function (inputRawOption) {\n // When first time user set throttle, auto throttle ends.\n if (inputRawOption.hasOwnProperty('throttle')) {\n this._autoThrottle = false;\n }\n\n if (this._autoThrottle) {\n var globalOption = this.ecModel.option;\n this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;\n }\n };\n\n DataZoomModel.prototype._updateRangeUse = function (inputRawOption) {\n var rangePropMode = this._rangePropMode;\n var rangeModeInOption = this.get('rangeMode');\n each([['start', 'startValue'], ['end', 'endValue']], function (names, index) {\n var percentSpecified = inputRawOption[names[0]] != null;\n var valueSpecified = inputRawOption[names[1]] != null;\n\n if (percentSpecified && !valueSpecified) {\n rangePropMode[index] = 'percent';\n } else if (!percentSpecified && valueSpecified) {\n rangePropMode[index] = 'value';\n } else if (rangeModeInOption) {\n rangePropMode[index] = rangeModeInOption[index];\n } else if (percentSpecified) {\n // percentSpecified && valueSpecified\n rangePropMode[index] = 'percent';\n } // else remain its original setting.\n\n });\n };\n\n DataZoomModel.prototype.noTarget = function () {\n return this._noTarget;\n };\n\n DataZoomModel.prototype.getFirstTargetAxisModel = function () {\n var firstAxisModel;\n this.eachTargetAxis(function (axisDim, axisIndex) {\n if (firstAxisModel == null) {\n firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n }, this);\n return firstAxisModel;\n };\n /**\r\n * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel\r\n */\n\n\n DataZoomModel.prototype.eachTargetAxis = function (callback, context) {\n this._targetAxisInfoMap.each(function (axisInfo, axisDim) {\n each(axisInfo.indexList, function (axisIndex) {\n callback.call(context, axisDim, axisIndex);\n });\n });\n };\n /**\r\n * @return If not found, return null/undefined.\r\n */\n\n\n DataZoomModel.prototype.getAxisProxy = function (axisDim, axisIndex) {\n var axisModel = this.getAxisModel(axisDim, axisIndex);\n\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n }\n };\n /**\r\n * @return If not found, return null/undefined.\r\n */\n\n\n DataZoomModel.prototype.getAxisModel = function (axisDim, axisIndex) {\n if (process.env.NODE_ENV !== 'production') {\n assert(axisDim && axisIndex != null);\n }\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n if (axisInfo && axisInfo.indexMap[axisIndex]) {\n return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n }\n };\n /**\r\n * If not specified, set to undefined.\r\n */\n\n\n DataZoomModel.prototype.setRawRange = function (opt) {\n var thisOption = this.option;\n var settledOption = this.settledOption;\n each([['start', 'startValue'], ['end', 'endValue']], function (names) {\n // Consider the pair :\n // If one has value and the other one is `null/undefined`, we both set them\n // to `settledOption`. This strategy enables the feature to clear the original\n // value in `settledOption` to `null/undefined`.\n // But if both of them are `null/undefined`, we do not set them to `settledOption`\n // and keep `settledOption` with the original value. This strategy enables users to\n // only set but not set when calling\n // `dispatchAction`.\n // The pair is treated in the same way.\n if (opt[names[0]] != null || opt[names[1]] != null) {\n thisOption[names[0]] = settledOption[names[0]] = opt[names[0]];\n thisOption[names[1]] = settledOption[names[1]] = opt[names[1]];\n }\n }, this);\n\n this._updateRangeUse(opt);\n };\n\n DataZoomModel.prototype.setCalculatedRange = function (opt) {\n var option = this.option;\n each(['start', 'startValue', 'end', 'endValue'], function (name) {\n option[name] = opt[name];\n });\n };\n\n DataZoomModel.prototype.getPercentRange = function () {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataPercentWindow();\n }\n };\n /**\r\n * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);\r\n *\r\n * @return [startValue, endValue] value can only be '-' or finite number.\r\n */\n\n\n DataZoomModel.prototype.getValueRange = function (axisDim, axisIndex) {\n if (axisDim == null && axisIndex == null) {\n var axisProxy = this.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n return axisProxy.getDataValueWindow();\n }\n } else {\n return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();\n }\n };\n /**\r\n * @param axisModel If axisModel given, find axisProxy\r\n * corresponding to the axisModel\r\n */\n\n\n DataZoomModel.prototype.findRepresentativeAxisProxy = function (axisModel) {\n if (axisModel) {\n return axisModel.__dzAxisProxy;\n } // Find the first hosted axisProxy\n\n\n var firstProxy;\n\n var axisDimList = this._targetAxisInfoMap.keys();\n\n for (var i = 0; i < axisDimList.length; i++) {\n var axisDim = axisDimList[i];\n\n var axisInfo = this._targetAxisInfoMap.get(axisDim);\n\n for (var j = 0; j < axisInfo.indexList.length; j++) {\n var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);\n\n if (proxy.hostedBy(this)) {\n return proxy;\n }\n\n if (!firstProxy) {\n firstProxy = proxy;\n }\n }\n } // If no hosted proxy found, still need to return a proxy.\n // This case always happens in toolbox dataZoom, where axes are all hosted by\n // other dataZooms.\n\n\n return firstProxy;\n };\n\n DataZoomModel.prototype.getRangePropMode = function () {\n return this._rangePropMode.slice();\n };\n\n DataZoomModel.prototype.getOrient = function () {\n if (process.env.NODE_ENV !== 'production') {\n // Should not be called before initialized.\n assert(this._orient);\n }\n\n return this._orient;\n };\n\n DataZoomModel.type = 'dataZoom';\n DataZoomModel.dependencies = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'series', 'toolbox'];\n DataZoomModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n filterMode: 'filter',\n start: 0,\n end: 100\n };\n return DataZoomModel;\n}(ComponentModel);\n/**\r\n * Retrieve those raw params from option, which will be cached separately,\r\n * because they will be overwritten by normalized/calculated values in the main\r\n * process.\r\n */\n\n\nfunction retrieveRawOption(option) {\n var ret = {};\n each(['start', 'end', 'startValue', 'endValue', 'throttle'], function (name) {\n option.hasOwnProperty(name) && (ret[name] = option[name]);\n });\n return ret;\n}\n\nexport default DataZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\n\nvar SelectDataZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomModel, _super);\n\n function SelectDataZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomModel.type;\n return _this;\n }\n\n SelectDataZoomModel.type = 'dataZoom.select';\n return SelectDataZoomModel;\n}(DataZoomModel);\n\nexport default SelectDataZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\n\nvar DataZoomView =\n/** @class */\nfunction (_super) {\n __extends(DataZoomView, _super);\n\n function DataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = DataZoomView.type;\n return _this;\n }\n\n DataZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n this.dataZoomModel = dataZoomModel;\n this.ecModel = ecModel;\n this.api = api;\n };\n\n DataZoomView.type = 'dataZoom';\n return DataZoomView;\n}(ComponentView);\n\nexport default DataZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\n\nvar SelectDataZoomView =\n/** @class */\nfunction (_super) {\n __extends(SelectDataZoomView, _super);\n\n function SelectDataZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SelectDataZoomView.type;\n return _this;\n }\n\n SelectDataZoomView.type = 'dataZoom.select';\n return SelectDataZoomView;\n}(DataZoomView);\n\nexport default SelectDataZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { unionAxisExtentFromData } from '../../coord/axisHelper.js';\nimport { ensureScaleRawExtentInfo } from '../../coord/scaleRawExtentInfo.js';\nimport { getAxisMainType, isCoordSupported } from './helper.js';\nimport { SINGLE_REFERRING } from '../../util/model.js';\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\n/**\r\n * Operate single axis.\r\n * One axis can only operated by one axis operator.\r\n * Different dataZoomModels may be defined to operate the same axis.\r\n * (i.e. 'inside' data zoom and 'slider' data zoom components)\r\n * So dataZoomModels share one axisProxy in that case.\r\n */\n\nvar AxisProxy =\n/** @class */\nfunction () {\n function AxisProxy(dimName, axisIndex, dataZoomModel, ecModel) {\n this._dimName = dimName;\n this._axisIndex = axisIndex;\n this.ecModel = ecModel;\n this._dataZoomModel = dataZoomModel; // /**\n // * @readOnly\n // * @private\n // */\n // this.hasSeriesStacked;\n }\n /**\r\n * Whether the axisProxy is hosted by dataZoomModel.\r\n */\n\n\n AxisProxy.prototype.hostedBy = function (dataZoomModel) {\n return this._dataZoomModel === dataZoomModel;\n };\n /**\r\n * @return Value can only be NaN or finite value.\r\n */\n\n\n AxisProxy.prototype.getDataValueWindow = function () {\n return this._valueWindow.slice();\n };\n /**\r\n * @return {Array.}\r\n */\n\n\n AxisProxy.prototype.getDataPercentWindow = function () {\n return this._percentWindow.slice();\n };\n\n AxisProxy.prototype.getTargetSeriesModels = function () {\n var seriesModels = [];\n this.ecModel.eachSeries(function (seriesModel) {\n if (isCoordSupported(seriesModel)) {\n var axisMainType = getAxisMainType(this._dimName);\n var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];\n\n if (axisModel && this._axisIndex === axisModel.componentIndex) {\n seriesModels.push(seriesModel);\n }\n }\n }, this);\n return seriesModels;\n };\n\n AxisProxy.prototype.getAxisModel = function () {\n return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);\n };\n\n AxisProxy.prototype.getMinMaxSpan = function () {\n return zrUtil.clone(this._minMaxSpan);\n };\n /**\r\n * Only calculate by given range and this._dataExtent, do not change anything.\r\n */\n\n\n AxisProxy.prototype.calculateDataWindow = function (opt) {\n var dataExtent = this._dataExtent;\n var axisModel = this.getAxisModel();\n var scale = axisModel.axis.scale;\n\n var rangePropMode = this._dataZoomModel.getRangePropMode();\n\n var percentExtent = [0, 100];\n var percentWindow = [];\n var valueWindow = [];\n var hasPropModeValue;\n each(['start', 'end'], function (prop, idx) {\n var boundPercent = opt[prop];\n var boundValue = opt[prop + 'Value']; // Notice: dataZoom is based either on `percentProp` ('start', 'end') or\n // on `valueProp` ('startValue', 'endValue'). (They are based on the data extent\n // but not min/max of axis, which will be calculated by data window then).\n // The former one is suitable for cases that a dataZoom component controls multiple\n // axes with different unit or extent, and the latter one is suitable for accurate\n // zoom by pixel (e.g., in dataZoomSelect).\n // we use `getRangePropMode()` to mark which prop is used. `rangePropMode` is updated\n // only when setOption or dispatchAction, otherwise it remains its original value.\n // (Why not only record `percentProp` and always map to `valueProp`? Because\n // the map `valueProp` -> `percentProp` -> `valueProp` probably not the original\n // `valueProp`. consider two axes constrolled by one dataZoom. They have different\n // data extent. All of values that are overflow the `dataExtent` will be calculated\n // to percent '100%').\n\n if (rangePropMode[idx] === 'percent') {\n boundPercent == null && (boundPercent = percentExtent[idx]); // Use scale.parse to math round for category or time axis.\n\n boundValue = scale.parse(numberUtil.linearMap(boundPercent, percentExtent, dataExtent));\n } else {\n hasPropModeValue = true;\n boundValue = boundValue == null ? dataExtent[idx] : scale.parse(boundValue); // Calculating `percent` from `value` may be not accurate, because\n // This calculation can not be inversed, because all of values that\n // are overflow the `dataExtent` will be calculated to percent '100%'\n\n boundPercent = numberUtil.linearMap(boundValue, dataExtent, percentExtent);\n } // valueWindow[idx] = round(boundValue);\n // percentWindow[idx] = round(boundPercent);\n // fallback to extent start/end when parsed value or percent is invalid\n\n\n valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue;\n percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent;\n });\n asc(valueWindow);\n asc(percentWindow); // The windows from user calling of `dispatchAction` might be out of the extent,\n // or do not obey the `min/maxSpan`, `min/maxValueSpan`. But we don't restrict window\n // by `zoomLock` here, because we see `zoomLock` just as a interaction constraint,\n // where API is able to initialize/modify the window size even though `zoomLock`\n // specified.\n\n var spans = this._minMaxSpan;\n hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);\n\n function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {\n var suffix = toValue ? 'Span' : 'ValueSpan';\n sliderMove(0, fromWindow, fromExtent, 'all', spans['min' + suffix], spans['max' + suffix]);\n\n for (var i = 0; i < 2; i++) {\n toWindow[i] = numberUtil.linearMap(fromWindow[i], fromExtent, toExtent, true);\n toValue && (toWindow[i] = scale.parse(toWindow[i]));\n }\n }\n\n return {\n valueWindow: valueWindow,\n percentWindow: percentWindow\n };\n };\n /**\r\n * Notice: reset should not be called before series.restoreData() is called,\r\n * so it is recommended to be called in \"process stage\" but not \"model init\r\n * stage\".\r\n */\n\n\n AxisProxy.prototype.reset = function (dataZoomModel) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var targetSeries = this.getTargetSeriesModels(); // Culculate data window and data extent, and record them.\n\n this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); // `calculateDataWindow` uses min/maxSpan.\n\n this._updateMinMaxSpan();\n\n var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);\n this._valueWindow = dataWindow.valueWindow;\n this._percentWindow = dataWindow.percentWindow; // Update axis setting then.\n\n this._setAxisModel();\n };\n\n AxisProxy.prototype.filterData = function (dataZoomModel, api) {\n if (dataZoomModel !== this._dataZoomModel) {\n return;\n }\n\n var axisDim = this._dimName;\n var seriesModels = this.getTargetSeriesModels();\n var filterMode = dataZoomModel.get('filterMode');\n var valueWindow = this._valueWindow;\n\n if (filterMode === 'none') {\n return;\n } // FIXME\n // Toolbox may has dataZoom injected. And if there are stacked bar chart\n // with NaN data, NaN will be filtered and stack will be wrong.\n // So we need to force the mode to be set empty.\n // In fect, it is not a big deal that do not support filterMode-'filter'\n // when using toolbox#dataZoom, utill tooltip#dataZoom support \"single axis\n // selection\" some day, which might need \"adapt to data extent on the\n // otherAxis\", which is disabled by filterMode-'empty'.\n // But currently, stack has been fixed to based on value but not index,\n // so this is not an issue any more.\n // let otherAxisModel = this.getOtherAxisModel();\n // if (dataZoomModel.get('$fromToolbox')\n // && otherAxisModel\n // && otherAxisModel.hasSeriesStacked\n // ) {\n // filterMode = 'empty';\n // }\n // TODO\n // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet.\n\n\n each(seriesModels, function (seriesModel) {\n var seriesData = seriesModel.getData();\n var dataDims = seriesData.mapDimensionsAll(axisDim);\n\n if (!dataDims.length) {\n return;\n }\n\n if (filterMode === 'weakFilter') {\n var store_1 = seriesData.getStore();\n var dataDimIndices_1 = zrUtil.map(dataDims, function (dim) {\n return seriesData.getDimensionIndex(dim);\n }, seriesData);\n seriesData.filterSelf(function (dataIndex) {\n var leftOut;\n var rightOut;\n var hasValue;\n\n for (var i = 0; i < dataDims.length; i++) {\n var value = store_1.get(dataDimIndices_1[i], dataIndex);\n var thisHasValue = !isNaN(value);\n var thisLeftOut = value < valueWindow[0];\n var thisRightOut = value > valueWindow[1];\n\n if (thisHasValue && !thisLeftOut && !thisRightOut) {\n return true;\n }\n\n thisHasValue && (hasValue = true);\n thisLeftOut && (leftOut = true);\n thisRightOut && (rightOut = true);\n } // If both left out and right out, do not filter.\n\n\n return hasValue && leftOut && rightOut;\n });\n } else {\n each(dataDims, function (dim) {\n if (filterMode === 'empty') {\n seriesModel.setData(seriesData = seriesData.map(dim, function (value) {\n return !isInWindow(value) ? NaN : value;\n }));\n } else {\n var range = {};\n range[dim] = valueWindow; // console.time('select');\n\n seriesData.selectRange(range); // console.timeEnd('select');\n }\n });\n }\n\n each(dataDims, function (dim) {\n seriesData.setApproximateExtent(valueWindow, dim);\n });\n });\n\n function isInWindow(value) {\n return value >= valueWindow[0] && value <= valueWindow[1];\n }\n };\n\n AxisProxy.prototype._updateMinMaxSpan = function () {\n var minMaxSpan = this._minMaxSpan = {};\n var dataZoomModel = this._dataZoomModel;\n var dataExtent = this._dataExtent;\n each(['min', 'max'], function (minMax) {\n var percentSpan = dataZoomModel.get(minMax + 'Span');\n var valueSpan = dataZoomModel.get(minMax + 'ValueSpan');\n valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan)); // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan\n\n if (valueSpan != null) {\n percentSpan = numberUtil.linearMap(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);\n } else if (percentSpan != null) {\n valueSpan = numberUtil.linearMap(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];\n }\n\n minMaxSpan[minMax + 'Span'] = percentSpan;\n minMaxSpan[minMax + 'ValueSpan'] = valueSpan;\n }, this);\n };\n\n AxisProxy.prototype._setAxisModel = function () {\n var axisModel = this.getAxisModel();\n var percentWindow = this._percentWindow;\n var valueWindow = this._valueWindow;\n\n if (!percentWindow) {\n return;\n } // [0, 500]: arbitrary value, guess axis extent.\n\n\n var precision = numberUtil.getPixelPrecision(valueWindow, [0, 500]);\n precision = Math.min(precision, 20); // For value axis, if min/max/scale are not set, we just use the extent obtained\n // by series data, which may be a little different from the extent calculated by\n // `axisHelper.getScaleExtent`. But the different just affects the experience a\n // little when zooming. So it will not be fixed until some users require it strongly.\n\n var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;\n\n if (percentWindow[0] !== 0) {\n rawExtentInfo.setDeterminedMinMax('min', +valueWindow[0].toFixed(precision));\n }\n\n if (percentWindow[1] !== 100) {\n rawExtentInfo.setDeterminedMinMax('max', +valueWindow[1].toFixed(precision));\n }\n\n rawExtentInfo.freeze();\n };\n\n return AxisProxy;\n}();\n\nfunction calculateDataExtent(axisProxy, axisDim, seriesModels) {\n var dataExtent = [Infinity, -Infinity];\n each(seriesModels, function (seriesModel) {\n unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);\n }); // It is important to get \"consistent\" extent when more then one axes is\n // controlled by a `dataZoom`, otherwise those axes will not be synchronized\n // when zooming. But it is difficult to know what is \"consistent\", considering\n // axes have different type or even different meanings (For example, two\n // time axes are used to compare data of the same date in different years).\n // So basically dataZoom just obtains extent by series.data (in category axis\n // extent can be obtained from axis.data).\n // Nevertheless, user can set min/max/scale on axes to make extent of axes\n // consistent.\n\n var axisModel = axisProxy.getAxisModel();\n var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();\n return [rawExtentResult.min, rawExtentResult.max];\n}\n\nexport default AxisProxy;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport { getAxisMainType } from './helper.js';\nimport AxisProxy from './AxisProxy.js';\nvar dataZoomProcessor = {\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n function eachAxisModel(cb) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);\n cb(axisDim, axisIndex, axisModel, dataZoomModel);\n });\n });\n } // FIXME: it brings side-effect to `getTargetSeries`.\n // Prepare axis proxies.\n\n\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // dispose all last axis proxy, in case that some axis are deleted.\n axisModel.__dzAxisProxy = null;\n });\n var proxyList = [];\n eachAxisModel(function (axisDim, axisIndex, axisModel, dataZoomModel) {\n // Different dataZooms may constrol the same axis. In that case,\n // an axisProxy serves both of them.\n if (!axisModel.__dzAxisProxy) {\n // Use the first dataZoomModel as the main model of axisProxy.\n axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);\n proxyList.push(axisModel.__dzAxisProxy);\n }\n });\n var seriesModelMap = createHashMap();\n each(proxyList, function (axisProxy) {\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n return seriesModelMap;\n },\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);\n }); // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setCalculatedRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n });\n }\n });\n }\n};\nexport default dataZoomProcessor;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { findEffectedDataZooms } from './helper.js';\nimport { each } from 'zrender/lib/core/util.js';\nexport default function installDataZoomAction(registers) {\n registers.registerAction('dataZoom', function (payload, ecModel) {\n var effectedModels = findEffectedDataZooms(ecModel, payload);\n each(effectedModels, function (dataZoomModel) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport dataZoomProcessor from './dataZoomProcessor.js';\nimport installDataZoomAction from './dataZoomAction.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);\n installDataZoomAction(registers);\n registers.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SelectZoomModel from './SelectZoomModel.js';\nimport SelectZoomView from './SelectZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SelectZoomModel);\n registers.registerComponentView(SelectZoomView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nvar ToolboxFeature =\n/** @class */\nfunction () {\n function ToolboxFeature() {}\n\n return ToolboxFeature;\n}();\n\nexport { ToolboxFeature };\nvar features = {};\nexport function registerFeature(name, ctor) {\n features[name] = ctor;\n}\nexport function getFeature(name) {\n return features[name];\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as featureManager from './featureManager.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar ToolboxModel =\n/** @class */\nfunction (_super) {\n __extends(ToolboxModel, _super);\n\n function ToolboxModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ToolboxModel.type;\n return _this;\n }\n\n ToolboxModel.prototype.optionUpdated = function () {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n var ecModel = this.ecModel;\n zrUtil.each(this.option.feature, function (featureOpt, featureName) {\n var Feature = featureManager.getFeature(featureName);\n\n if (Feature) {\n if (Feature.getDefaultOption) {\n Feature.defaultOption = Feature.getDefaultOption(ecModel);\n }\n\n zrUtil.merge(featureOpt, Feature.defaultOption);\n }\n });\n };\n\n ToolboxModel.type = 'toolbox';\n ToolboxModel.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n ToolboxModel.defaultOption = {\n show: true,\n z: 6,\n // zlevel: 0,\n orient: 'horizontal',\n left: 'right',\n top: 'top',\n // right\n // bottom\n backgroundColor: 'transparent',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemSize: 15,\n itemGap: 8,\n showTitle: true,\n iconStyle: {\n borderColor: '#666',\n color: 'none'\n },\n emphasis: {\n iconStyle: {\n borderColor: '#3E98C5'\n }\n },\n // textStyle: {},\n // feature\n tooltip: {\n show: false,\n position: 'bottom'\n }\n };\n return ToolboxModel;\n}(ComponentModel);\n\nexport default ToolboxModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport { getLayoutRect, box as layoutBox, positionElement } from '../../util/layout.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as graphic from '../../util/graphic.js';\n/**\r\n * Layout list like component.\r\n * It will box layout each items in group of component and then position the whole group in the viewport\r\n * @param {module:zrender/group/Group} group\r\n * @param {module:echarts/model/Component} componentModel\r\n * @param {module:echarts/ExtensionAPI}\r\n */\n\nexport function layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\nexport function makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as textContain from 'zrender/lib/contain/text.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enterEmphasis, leaveEmphasis } from '../../util/states.js';\nimport Model from '../../model/Model.js';\nimport DataDiffer from '../../data/DataDiffer.js';\nimport * as listComponentHelper from '../helper/listComponent.js';\nimport ComponentView from '../../view/Component.js';\nimport { ToolboxFeature, getFeature } from './featureManager.js';\nimport { getUID } from '../../util/component.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\n\nvar ToolboxView =\n/** @class */\nfunction (_super) {\n __extends(ToolboxView, _super);\n\n function ToolboxView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n ToolboxView.prototype.render = function (toolboxModel, ecModel, api, payload) {\n var group = this.group;\n group.removeAll();\n\n if (!toolboxModel.get('show')) {\n return;\n }\n\n var itemSize = +toolboxModel.get('itemSize');\n var isVertical = toolboxModel.get('orient') === 'vertical';\n var featureOpts = toolboxModel.get('feature') || {};\n var features = this._features || (this._features = {});\n var featureNames = [];\n zrUtil.each(featureOpts, function (opt, name) {\n featureNames.push(name);\n });\n new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(zrUtil.curry(processFeature, null)).execute(); // Keep for diff.\n\n this._featureNames = featureNames;\n\n function processFeature(newIndex, oldIndex) {\n var featureName = featureNames[newIndex];\n var oldName = featureNames[oldIndex];\n var featureOpt = featureOpts[featureName];\n var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);\n var feature; // FIX#11236, merge feature title from MagicType newOption. TODO: consider seriesIndex ?\n\n if (payload && payload.newTitle != null && payload.featureName === featureName) {\n featureOpt.title = payload.newTitle;\n }\n\n if (featureName && !oldName) {\n // Create\n if (isUserFeatureName(featureName)) {\n feature = {\n onclick: featureModel.option.onclick,\n featureName: featureName\n };\n } else {\n var Feature = getFeature(featureName);\n\n if (!Feature) {\n return;\n }\n\n feature = new Feature();\n }\n\n features[featureName] = feature;\n } else {\n feature = features[oldName]; // If feature does not exist.\n\n if (!feature) {\n return;\n }\n }\n\n feature.uid = getUID('toolbox-feature');\n feature.model = featureModel;\n feature.ecModel = ecModel;\n feature.api = api;\n var isToolboxFeature = feature instanceof ToolboxFeature;\n\n if (!featureName && oldName) {\n isToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n return;\n }\n\n if (!featureModel.get('show') || isToolboxFeature && feature.unusable) {\n isToolboxFeature && feature.remove && feature.remove(ecModel, api);\n return;\n }\n\n createIconPaths(featureModel, feature, featureName);\n\n featureModel.setIconStatus = function (iconName, status) {\n var option = this.option;\n var iconPaths = this.iconPaths;\n option.iconStatus = option.iconStatus || {};\n option.iconStatus[iconName] = status;\n\n if (iconPaths[iconName]) {\n (status === 'emphasis' ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);\n }\n };\n\n if (feature instanceof ToolboxFeature) {\n if (feature.render) {\n feature.render(featureModel, ecModel, api, payload);\n }\n }\n }\n\n function createIconPaths(featureModel, feature, featureName) {\n var iconStyleModel = featureModel.getModel('iconStyle');\n var iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); // If one feature has multiple icons, they are organized as\n // {\n // icon: {\n // foo: '',\n // bar: ''\n // },\n // title: {\n // foo: '',\n // bar: ''\n // }\n // }\n\n var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get('icon');\n var titles = featureModel.get('title') || {};\n var iconsMap;\n var titlesMap;\n\n if (zrUtil.isString(icons)) {\n iconsMap = {};\n iconsMap[featureName] = icons;\n } else {\n iconsMap = icons;\n }\n\n if (zrUtil.isString(titles)) {\n titlesMap = {};\n titlesMap[featureName] = titles;\n } else {\n titlesMap = titles;\n }\n\n var iconPaths = featureModel.iconPaths = {};\n zrUtil.each(iconsMap, function (iconStr, iconName) {\n var path = graphic.createIcon(iconStr, {}, {\n x: -itemSize / 2,\n y: -itemSize / 2,\n width: itemSize,\n height: itemSize\n }); // TODO handling image\n\n path.setStyle(iconStyleModel.getItemStyle());\n var pathEmphasisState = path.ensureState('emphasis');\n pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle(); // Text position calculation\n\n var textContent = new ZRText({\n style: {\n text: titlesMap[iconName],\n align: iconStyleEmphasisModel.get('textAlign'),\n borderRadius: iconStyleEmphasisModel.get('textBorderRadius'),\n padding: iconStyleEmphasisModel.get('textPadding'),\n fill: null\n },\n ignore: true\n });\n path.setTextContent(textContent);\n graphic.setTooltipConfig({\n el: path,\n componentModel: toolboxModel,\n itemName: iconName,\n formatterParamsExtra: {\n title: titlesMap[iconName]\n }\n });\n path.__title = titlesMap[iconName];\n path.on('mouseover', function () {\n // Should not reuse above hoverStyle, which might be modified.\n var hoverStyle = iconStyleEmphasisModel.getItemStyle();\n var defaultTextPosition = isVertical ? toolboxModel.get('right') == null && toolboxModel.get('left') !== 'right' ? 'right' : 'left' : toolboxModel.get('bottom') == null && toolboxModel.get('top') !== 'bottom' ? 'bottom' : 'top';\n textContent.setStyle({\n fill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',\n backgroundColor: iconStyleEmphasisModel.get('textBackgroundColor')\n });\n path.setTextConfig({\n position: iconStyleEmphasisModel.get('textPosition') || defaultTextPosition\n });\n textContent.ignore = !toolboxModel.get('showTitle'); // Use enterEmphasis and leaveEmphasis provide by ec.\n // There are flags managed by the echarts.\n\n api.enterEmphasis(this);\n }).on('mouseout', function () {\n if (featureModel.get(['iconStatus', iconName]) !== 'emphasis') {\n api.leaveEmphasis(this);\n }\n\n textContent.hide();\n });\n (featureModel.get(['iconStatus', iconName]) === 'emphasis' ? enterEmphasis : leaveEmphasis)(path);\n group.add(path);\n path.on('click', zrUtil.bind(feature.onclick, feature, ecModel, api, iconName));\n iconPaths[iconName] = path;\n });\n }\n\n listComponentHelper.layout(group, toolboxModel, api); // Render background after group is layout\n // FIXME\n\n group.add(listComponentHelper.makeBackground(group.getBoundingRect(), toolboxModel)); // Adjust icon title positions to avoid them out of screen\n\n isVertical || group.eachChild(function (icon) {\n var titleText = icon.__title; // const hoverStyle = icon.hoverStyle;\n // TODO simplify code?\n\n var emphasisState = icon.ensureState('emphasis');\n var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});\n var textContent = icon.getTextContent();\n var emphasisTextState = textContent && textContent.ensureState('emphasis'); // May be background element\n\n if (emphasisTextState && !zrUtil.isFunction(emphasisTextState) && titleText) {\n var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});\n var rect = textContain.getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));\n var offsetX = icon.x + group.x;\n var offsetY = icon.y + group.y + itemSize;\n var needPutOnTop = false;\n\n if (offsetY + rect.height > api.getHeight()) {\n emphasisTextConfig.position = 'top';\n needPutOnTop = true;\n }\n\n var topOffset = needPutOnTop ? -5 - rect.height : itemSize + 10;\n\n if (offsetX + rect.width / 2 > api.getWidth()) {\n emphasisTextConfig.position = ['100%', topOffset];\n emphasisTextStyle.align = 'right';\n } else if (offsetX - rect.width / 2 < 0) {\n emphasisTextConfig.position = [0, topOffset];\n emphasisTextStyle.align = 'left';\n }\n }\n });\n };\n\n ToolboxView.prototype.updateView = function (toolboxModel, ecModel, api, payload) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api, payload);\n });\n }; // updateLayout(toolboxModel, ecModel, api, payload) {\n // zrUtil.each(this._features, function (feature) {\n // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload);\n // });\n // },\n\n\n ToolboxView.prototype.remove = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api);\n });\n this.group.removeAll();\n };\n\n ToolboxView.prototype.dispose = function (ecModel, api) {\n zrUtil.each(this._features, function (feature) {\n feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api);\n });\n };\n\n ToolboxView.type = 'toolbox';\n return ToolboxView;\n}(ComponentView);\n\nfunction isUserFeatureName(featureName) {\n return featureName.indexOf('my') === 0;\n}\n\nexport default ToolboxView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global Uint8Array, document */\n\nimport env from 'zrender/lib/core/env.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { isFunction } from 'zrender/lib/core/util.js';\n/* global window, document */\n\nvar SaveAsImage =\n/** @class */\nfunction (_super) {\n __extends(SaveAsImage, _super);\n\n function SaveAsImage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n SaveAsImage.prototype.onclick = function (ecModel, api) {\n var model = this.model;\n var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';\n var isSvg = api.getZr().painter.getType() === 'svg';\n var type = isSvg ? 'svg' : model.get('type', true) || 'png';\n var url = api.getConnectedDataURL({\n type: type,\n backgroundColor: model.get('backgroundColor', true) || ecModel.get('backgroundColor') || '#fff',\n connectedBackgroundColor: model.get('connectedBackgroundColor'),\n excludeComponents: model.get('excludeComponents'),\n pixelRatio: model.get('pixelRatio')\n });\n var browser = env.browser; // Chrome, Firefox, New Edge\n\n if (isFunction(MouseEvent) && (browser.newEdge || !browser.ie && !browser.edge)) {\n var $a = document.createElement('a');\n $a.download = title + '.' + type;\n $a.target = '_blank';\n $a.href = url;\n var evt = new MouseEvent('click', {\n // some micro front-end framework, window maybe is a Proxy\n view: document.defaultView,\n bubbles: true,\n cancelable: false\n });\n $a.dispatchEvent(evt);\n } // IE or old Edge\n else {\n // @ts-ignore\n if (window.navigator.msSaveOrOpenBlob || isSvg) {\n var parts = url.split(','); // data:[][;charset=][;base64],\n\n var base64Encoded = parts[0].indexOf('base64') > -1;\n var bstr = isSvg // should decode the svg data uri first\n ? decodeURIComponent(parts[1]) : parts[1]; // only `atob` when the data uri is encoded with base64\n // otherwise, like `svg` data uri exported by zrender,\n // there will be an error, for it's not encoded with base64.\n // (just a url-encoded string through `encodeURIComponent`)\n\n base64Encoded && (bstr = window.atob(bstr));\n var filename = title + '.' + type; // @ts-ignore\n\n if (window.navigator.msSaveOrOpenBlob) {\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n var blob = new Blob([u8arr]); // @ts-ignore\n\n window.navigator.msSaveOrOpenBlob(blob, filename);\n } else {\n var frame = document.createElement('iframe');\n document.body.appendChild(frame);\n var cw = frame.contentWindow;\n var doc = cw.document;\n doc.open('image/svg+xml', 'replace');\n doc.write(bstr);\n doc.close();\n cw.focus();\n doc.execCommand('SaveAs', true, filename);\n document.body.removeChild(frame);\n }\n } else {\n var lang = model.get('lang');\n var html = '' + '' + '' + '';\n var tab = window.open();\n tab.document.write(html);\n tab.document.title = title;\n }\n }\n };\n\n SaveAsImage.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'title']),\n type: 'png',\n // Default use option.backgroundColor\n // backgroundColor: '#fff',\n connectedBackgroundColor: '#fff',\n name: '',\n excludeComponents: ['toolbox'],\n // use current pixel ratio of device by default\n // pixelRatio: 1,\n lang: ecModel.getLocaleModel().get(['toolbox', 'saveAsImage', 'lang'])\n };\n return defaultOption;\n };\n\n return SaveAsImage;\n}(ToolboxFeature);\n\nexport default SaveAsImage;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { SINGLE_REFERRING } from '../../../util/model.js';\nvar INNER_STACK_KEYWORD = '__ec_magicType_stack__';\nvar ICON_TYPES = ['line', 'bar', 'stack']; // stack and tiled appears in pair for the title\n\nvar TITLE_TYPES = ['line', 'bar', 'stack', 'tiled'];\nvar radioTypes = [['line', 'bar'], ['stack']];\n\nvar MagicType =\n/** @class */\nfunction (_super) {\n __extends(MagicType, _super);\n\n function MagicType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n MagicType.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon');\n var icons = {};\n zrUtil.each(model.get('type'), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n MagicType.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: [],\n // Icon group\n icon: {\n line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',\n bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',\n // eslint-disable-next-line\n 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\n\n },\n // `line`, `bar`, `stack`, `tiled`\n title: ecModel.getLocaleModel().get(['toolbox', 'magicType', 'title']),\n option: {},\n seriesIndex: {}\n };\n return defaultOption;\n };\n\n MagicType.prototype.onclick = function (ecModel, api, type) {\n var model = this.model;\n var seriesIndex = model.get(['seriesIndex', type]); // Not supported magicType\n\n if (!seriesOptGenreator[type]) {\n return;\n }\n\n var newOption = {\n series: []\n };\n\n var generateNewSeriesTypes = function (seriesModel) {\n var seriesType = seriesModel.subType;\n var seriesId = seriesModel.id;\n var newSeriesOpt = seriesOptGenreator[type](seriesType, seriesId, seriesModel, model);\n\n if (newSeriesOpt) {\n // PENDING If merge original option?\n zrUtil.defaults(newSeriesOpt, seriesModel.option);\n newOption.series.push(newSeriesOpt);\n } // Modify boundaryGap\n\n\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) {\n var categoryAxis = coordSys.getAxesByScale('ordinal')[0];\n\n if (categoryAxis) {\n var axisDim = categoryAxis.dim;\n var axisType = axisDim + 'Axis';\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n var axisIndex = axisModel.componentIndex;\n newOption[axisType] = newOption[axisType] || [];\n\n for (var i = 0; i <= axisIndex; i++) {\n newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};\n }\n\n newOption[axisType][axisIndex].boundaryGap = type === 'bar';\n }\n }\n };\n\n zrUtil.each(radioTypes, function (radio) {\n if (zrUtil.indexOf(radio, type) >= 0) {\n zrUtil.each(radio, function (item) {\n model.setIconStatus(item, 'normal');\n });\n }\n });\n model.setIconStatus(type, 'emphasis');\n ecModel.eachComponent({\n mainType: 'series',\n query: seriesIndex == null ? null : {\n seriesIndex: seriesIndex\n }\n }, generateNewSeriesTypes);\n var newTitle;\n var currentType = type; // Change title of stack\n\n if (type === 'stack') {\n // use titles in model instead of ecModel\n // as stack and tiled appears in pair, just flip them\n // no need of checking stack state\n newTitle = zrUtil.merge({\n stack: model.option.title.tiled,\n tiled: model.option.title.stack\n }, model.option.title);\n\n if (model.get(['iconStatus', type]) !== 'emphasis') {\n currentType = 'tiled';\n }\n }\n\n api.dispatchAction({\n type: 'changeMagicType',\n currentType: currentType,\n newOption: newOption,\n newTitle: newTitle,\n featureName: 'magicType'\n });\n };\n\n return MagicType;\n}(ToolboxFeature);\n\nvar seriesOptGenreator = {\n 'line': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'bar') {\n return zrUtil.merge({\n id: seriesId,\n type: 'line',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'line']) || {}, true);\n }\n },\n 'bar': function (seriesType, seriesId, seriesModel, model) {\n if (seriesType === 'line') {\n return zrUtil.merge({\n id: seriesId,\n type: 'bar',\n // Preserve data related option\n data: seriesModel.get('data'),\n stack: seriesModel.get('stack'),\n markPoint: seriesModel.get('markPoint'),\n markLine: seriesModel.get('markLine')\n }, model.get(['option', 'bar']) || {}, true);\n }\n },\n 'stack': function (seriesType, seriesId, seriesModel, model) {\n var isStack = seriesModel.get('stack') === INNER_STACK_KEYWORD;\n\n if (seriesType === 'line' || seriesType === 'bar') {\n model.setIconStatus('stack', isStack ? 'normal' : 'emphasis');\n return zrUtil.merge({\n id: seriesId,\n stack: isStack ? '' : INNER_STACK_KEYWORD\n }, model.get(['option', 'stack']) || {}, true);\n }\n }\n}; // TODO: SELF REGISTERED.\n\necharts.registerAction({\n type: 'changeMagicType',\n event: 'magicTypeChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.mergeOption(payload.newOption);\n});\nexport default MagicType;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/* global document */\n\nimport * as echarts from '../../../core/echarts.js';\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { addEventListener } from 'zrender/lib/core/event.js';\nimport { warn } from '../../../util/log.js';\n/* global document */\n\nvar BLOCK_SPLITER = new Array(60).join('-');\nvar ITEM_SPLITER = '\\t';\n/**\r\n * Group series into two types\r\n * 1. on category axis, like line, bar\r\n * 2. others, like scatter, pie\r\n */\n\nfunction groupSeries(ecModel) {\n var seriesGroupByCategoryAxis = {};\n var otherSeries = [];\n var meta = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {\n // TODO: TYPE Consider polar? Include polar may increase unecessary bundle size.\n var baseAxis = coordSys.getBaseAxis();\n\n if (baseAxis.type === 'category') {\n var key = baseAxis.dim + '_' + baseAxis.index;\n\n if (!seriesGroupByCategoryAxis[key]) {\n seriesGroupByCategoryAxis[key] = {\n categoryAxis: baseAxis,\n valueAxis: coordSys.getOtherAxis(baseAxis),\n series: []\n };\n meta.push({\n axisDim: baseAxis.dim,\n axisIndex: baseAxis.index\n });\n }\n\n seriesGroupByCategoryAxis[key].series.push(seriesModel);\n } else {\n otherSeries.push(seriesModel);\n }\n } else {\n otherSeries.push(seriesModel);\n }\n });\n return {\n seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,\n other: otherSeries,\n meta: meta\n };\n}\n/**\r\n * Assemble content of series on cateogory axis\r\n * @inner\r\n */\n\n\nfunction assembleSeriesWithCategoryAxis(groups) {\n var tables = [];\n zrUtil.each(groups, function (group, key) {\n var categoryAxis = group.categoryAxis;\n var valueAxis = group.valueAxis;\n var valueAxisDim = valueAxis.dim;\n var headers = [' '].concat(zrUtil.map(group.series, function (series) {\n return series.name;\n })); // @ts-ignore TODO Polar\n\n var columns = [categoryAxis.model.getCategories()];\n zrUtil.each(group.series, function (series) {\n var rawData = series.getRawData();\n columns.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function (val) {\n return val;\n }));\n }); // Assemble table content\n\n var lines = [headers.join(ITEM_SPLITER)];\n\n for (var i = 0; i < columns[0].length; i++) {\n var items = [];\n\n for (var j = 0; j < columns.length; j++) {\n items.push(columns[j][i]);\n }\n\n lines.push(items.join(ITEM_SPLITER));\n }\n\n tables.push(lines.join('\\n'));\n });\n return tables.join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n/**\r\n * Assemble content of other series\r\n */\n\n\nfunction assembleOtherSeries(series) {\n return zrUtil.map(series, function (series) {\n var data = series.getRawData();\n var lines = [series.name];\n var vals = [];\n data.each(data.dimensions, function () {\n var argLen = arguments.length;\n var dataIndex = arguments[argLen - 1];\n var name = data.getName(dataIndex);\n\n for (var i = 0; i < argLen - 1; i++) {\n vals[i] = arguments[i];\n }\n\n lines.push((name ? name + ITEM_SPLITER : '') + vals.join(ITEM_SPLITER));\n });\n return lines.join('\\n');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n');\n}\n\nfunction getContentFromModel(ecModel) {\n var result = groupSeries(ecModel);\n return {\n value: zrUtil.filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function (str) {\n return !!str.replace(/[\\n\\t\\s]/g, '');\n }).join('\\n\\n' + BLOCK_SPLITER + '\\n\\n'),\n meta: result.meta\n };\n}\n\nfunction trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}\n/**\r\n * If a block is tsv format\r\n */\n\n\nfunction isTSVFormat(block) {\n // Simple method to find out if a block is tsv format\n var firstLine = block.slice(0, block.indexOf('\\n'));\n\n if (firstLine.indexOf(ITEM_SPLITER) >= 0) {\n return true;\n }\n}\n\nvar itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');\n/**\r\n * @param {string} tsv\r\n * @return {Object}\r\n */\n\nfunction parseTSVContents(tsv) {\n var tsvLines = tsv.split(/\\n+/g);\n var headers = trim(tsvLines.shift()).split(itemSplitRegex);\n var categories = [];\n var series = zrUtil.map(headers, function (header) {\n return {\n name: header,\n data: []\n };\n });\n\n for (var i = 0; i < tsvLines.length; i++) {\n var items = trim(tsvLines[i]).split(itemSplitRegex);\n categories.push(items.shift());\n\n for (var j = 0; j < items.length; j++) {\n series[j] && (series[j].data[i] = items[j]);\n }\n }\n\n return {\n series: series,\n categories: categories\n };\n}\n\nfunction parseListContents(str) {\n var lines = str.split(/\\n+/g);\n var seriesName = trim(lines.shift());\n var data = [];\n\n for (var i = 0; i < lines.length; i++) {\n // if line is empty, ignore it.\n // there is a case that a user forgot to delete `\\n`.\n var line = trim(lines[i]);\n\n if (!line) {\n continue;\n }\n\n var items = line.split(itemSplitRegex);\n var name_1 = '';\n var value = void 0;\n var hasName = false;\n\n if (isNaN(items[0])) {\n // First item is name\n hasName = true;\n name_1 = items[0];\n items = items.slice(1);\n data[i] = {\n name: name_1,\n value: []\n };\n value = data[i].value;\n } else {\n value = data[i] = [];\n }\n\n for (var j = 0; j < items.length; j++) {\n value.push(+items[j]);\n }\n\n if (value.length === 1) {\n hasName ? data[i].value = value[0] : data[i] = value[0];\n }\n }\n\n return {\n name: seriesName,\n data: data\n };\n}\n\nfunction parseContents(str, blockMetaList) {\n var blocks = str.split(new RegExp('\\n*' + BLOCK_SPLITER + '\\n*', 'g'));\n var newOption = {\n series: []\n };\n zrUtil.each(blocks, function (block, idx) {\n if (isTSVFormat(block)) {\n var result = parseTSVContents(block);\n var blockMeta = blockMetaList[idx];\n var axisKey = blockMeta.axisDim + 'Axis';\n\n if (blockMeta) {\n newOption[axisKey] = newOption[axisKey] || [];\n newOption[axisKey][blockMeta.axisIndex] = {\n data: result.categories\n };\n newOption.series = newOption.series.concat(result.series);\n }\n } else {\n var result = parseListContents(block);\n newOption.series.push(result);\n }\n });\n return newOption;\n}\n\nvar DataView =\n/** @class */\nfunction (_super) {\n __extends(DataView, _super);\n\n function DataView() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataView.prototype.onclick = function (ecModel, api) {\n // FIXME: better way?\n setTimeout(function () {\n api.dispatchAction({\n type: 'hideTip'\n });\n });\n var container = api.getDom();\n var model = this.model;\n\n if (this._dom) {\n container.removeChild(this._dom);\n }\n\n var root = document.createElement('div'); // use padding to avoid 5px whitespace\n\n root.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;padding:5px';\n root.style.backgroundColor = model.get('backgroundColor') || '#fff'; // Create elements\n\n var header = document.createElement('h4');\n var lang = model.get('lang') || [];\n header.innerHTML = lang[0] || model.get('title');\n header.style.cssText = 'margin:10px 20px';\n header.style.color = model.get('textColor');\n var viewMain = document.createElement('div');\n var textarea = document.createElement('textarea');\n viewMain.style.cssText = 'overflow:auto';\n var optionToContent = model.get('optionToContent');\n var contentToOption = model.get('contentToOption');\n var result = getContentFromModel(ecModel);\n\n if (zrUtil.isFunction(optionToContent)) {\n var htmlOrDom = optionToContent(api.getOption());\n\n if (zrUtil.isString(htmlOrDom)) {\n viewMain.innerHTML = htmlOrDom;\n } else if (zrUtil.isDom(htmlOrDom)) {\n viewMain.appendChild(htmlOrDom);\n }\n } else {\n // Use default textarea\n textarea.readOnly = model.get('readOnly');\n var style = textarea.style; // eslint-disable-next-line max-len\n\n style.cssText = 'display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none';\n style.color = model.get('textColor');\n style.borderColor = model.get('textareaBorderColor');\n style.backgroundColor = model.get('textareaColor');\n textarea.value = result.value;\n viewMain.appendChild(textarea);\n }\n\n var blockMetaList = result.meta;\n var buttonContainer = document.createElement('div');\n buttonContainer.style.cssText = 'position:absolute;bottom:5px;left:0;right:0'; // eslint-disable-next-line max-len\n\n var buttonStyle = 'float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';\n var closeButton = document.createElement('div');\n var refreshButton = document.createElement('div');\n buttonStyle += ';background-color:' + model.get('buttonColor');\n buttonStyle += ';color:' + model.get('buttonTextColor');\n var self = this;\n\n function close() {\n container.removeChild(root);\n self._dom = null;\n }\n\n addEventListener(closeButton, 'click', close);\n addEventListener(refreshButton, 'click', function () {\n if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.');\n }\n\n close();\n return;\n }\n\n var newOption;\n\n try {\n if (zrUtil.isFunction(contentToOption)) {\n newOption = contentToOption(viewMain, api.getOption());\n } else {\n newOption = parseContents(textarea.value, blockMetaList);\n }\n } catch (e) {\n close();\n throw new Error('Data view format error ' + e);\n }\n\n if (newOption) {\n api.dispatchAction({\n type: 'changeDataView',\n newOption: newOption\n });\n }\n\n close();\n });\n closeButton.innerHTML = lang[1];\n refreshButton.innerHTML = lang[2];\n refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;\n !model.get('readOnly') && buttonContainer.appendChild(refreshButton);\n buttonContainer.appendChild(closeButton);\n root.appendChild(header);\n root.appendChild(viewMain);\n root.appendChild(buttonContainer);\n viewMain.style.height = container.clientHeight - 80 + 'px';\n container.appendChild(root);\n this._dom = root;\n };\n\n DataView.prototype.remove = function (ecModel, api) {\n this._dom && api.getDom().removeChild(this._dom);\n };\n\n DataView.prototype.dispose = function (ecModel, api) {\n this.remove(ecModel, api);\n };\n\n DataView.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n readOnly: false,\n optionToContent: null,\n contentToOption: null,\n // eslint-disable-next-line\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'title']),\n lang: ecModel.getLocaleModel().get(['toolbox', 'dataView', 'lang']),\n backgroundColor: '#fff',\n textColor: '#000',\n textareaColor: '#fff',\n textareaBorderColor: '#333',\n buttonColor: '#c23531',\n buttonTextColor: '#fff'\n };\n return defaultOption;\n };\n\n return DataView;\n}(ToolboxFeature);\n/**\r\n * @inner\r\n */\n\n\nfunction tryMergeDataOption(newData, originalData) {\n return zrUtil.map(newData, function (newVal, idx) {\n var original = originalData && originalData[idx];\n\n if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {\n var newValIsObject = zrUtil.isObject(newVal) && !zrUtil.isArray(newVal);\n\n if (!newValIsObject) {\n newVal = {\n value: newVal\n };\n } // original data has name but new data has no name\n\n\n var shouldDeleteName = original.name != null && newVal.name == null; // Original data has option\n\n newVal = zrUtil.defaults(newVal, original);\n shouldDeleteName && delete newVal.name;\n return newVal;\n } else {\n return newVal;\n }\n });\n} // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'changeDataView',\n event: 'dataViewChanged',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n var newSeriesOptList = [];\n zrUtil.each(payload.newOption.series, function (seriesOpt) {\n var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];\n\n if (!seriesModel) {\n // New created series\n // Geuss the series type\n newSeriesOptList.push(zrUtil.extend({\n // Default is scatter\n type: 'scatter'\n }, seriesOpt));\n } else {\n var originalData = seriesModel.get('data');\n newSeriesOptList.push({\n name: seriesOpt.name,\n data: tryMergeDataOption(seriesOpt.data, originalData)\n });\n }\n });\n ecModel.mergeOption(zrUtil.defaults({\n series: newSeriesOptList\n }, payload.newOption));\n});\nexport default DataView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\r\n * @param ecModel\r\n * @param newSnapshot key is dataZoomId\r\n */\n\nexport function push(ecModel, newSnapshot) {\n var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = storedSnapshots.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = storedSnapshots[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n storedSnapshots[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n var head = storedSnapshots[storedSnapshots.length - 1];\n storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n batchItem = storedSnapshots[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\nexport function clear(ecModel) {\n inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n return getStoreSnapshots(ecModel).length;\n}\n/**\r\n * History length of each dataZoom may be different.\r\n * this._history[0] is used to store origin range.\r\n */\n\nfunction getStoreSnapshots(ecModel) {\n var store = inner(ecModel);\n\n if (!store.snapshots) {\n store.snapshots = [{}];\n }\n\n return store.snapshots;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as echarts from '../../../core/echarts.js';\nimport * as history from '../../dataZoom/history.js';\nimport { ToolboxFeature } from '../featureManager.js';\n\nvar RestoreOption =\n/** @class */\nfunction (_super) {\n __extends(RestoreOption, _super);\n\n function RestoreOption() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n RestoreOption.prototype.onclick = function (ecModel, api) {\n history.clear(ecModel);\n api.dispatchAction({\n type: 'restore',\n from: this.uid\n });\n };\n\n RestoreOption.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n // eslint-disable-next-line\n 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',\n title: ecModel.getLocaleModel().get(['toolbox', 'restore', 'title'])\n };\n return defaultOption;\n };\n\n return RestoreOption;\n}(ToolboxFeature); // TODO: SELF REGISTERED.\n\n\necharts.registerAction({\n type: 'restore',\n event: 'restore',\n update: 'prepareAndUpdate'\n}, function (payload, ecModel) {\n ecModel.resetOption('recreate');\n});\nexport default RestoreOption;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { each, indexOf, curry, assert, map, createHashMap } from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as brushHelper from './brushHelper.js';\nimport { parseFinder as modelUtilParseFinder } from '../../util/model.js'; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n\nvar BrushTargetManager =\n/** @class */\nfunction () {\n /**\r\n * @param finder contains Index/Id/Name of xAxis/yAxis/geo/grid\r\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\r\n * @param opt.include include coordinate system types.\r\n */\n function BrushTargetManager(finder, ecModel, opt) {\n var _this = this;\n\n this._targetInfoList = [];\n var foundCpts = parseFinder(ecModel, finder);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, _this._targetInfoList);\n }\n });\n }\n\n BrushTargetManager.prototype.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n return areas;\n };\n\n BrushTargetManager.prototype.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range, true);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n };\n /**\r\n * the `areas` is `BrushModel.areas`.\r\n * Called in layout stage.\r\n * convert `area.coordRange` to global range and set panelId to `area.range`.\r\n */\n\n\n BrushTargetManager.prototype.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!targetInfo || targetInfo === true || area.coordRange, 'coordRange must be specified when coord index specified.');\n assert(!targetInfo || targetInfo !== true || area.range, 'range must be specified in global brush.');\n }\n\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range should always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n };\n\n BrushTargetManager.prototype.makePanelOpts = function (api, getDefaultBrushType) {\n return map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n };\n\n BrushTargetManager.prototype.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n };\n /**\r\n * If return Object, a coord found.\r\n * If return true, global found.\r\n * Otherwise nothing found.\r\n */\n\n\n BrushTargetManager.prototype.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var j = 0; j < targetInfoMatchers.length; j++) {\n if (targetInfoMatchers[j](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n };\n\n return BrushTargetManager;\n}();\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, finder) {\n return modelUtilParseFinder(ecModel, finder, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilders.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilders.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilders = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.master.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp);\n var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange, clamp) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = map(rangeOrCoordRange, function (item) {\n var p = to ? coordSys.pointToData(item, clamp) : coordSys.dataToPoint(item, clamp);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n if (process.env.NODE_ENV !== 'production') {\n assert(coordSys.type === 'cartesian2d', 'lineX/lineY brush is available only in cartesian2d.');\n }\n\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n 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]]];\n },\n polygon: function (values, refer, scales) {\n return map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n// Return [0~1, 0~1]\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nexport default BrushTargetManager;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO depends on DataZoom and Brush\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../../helper/BrushController.js';\nimport BrushTargetManager from '../../helper/BrushTargetManager.js';\nimport * as history from '../../dataZoom/history.js';\nimport sliderMove from '../../helper/sliderMove.js';\nimport { ToolboxFeature } from '../featureManager.js';\nimport { makeInternalComponentId, parseFinder } from '../../../util/model.js';\nimport { registerInternalOptionCreator } from '../../../model/internalComponentCreator.js';\nvar each = zrUtil.each;\nvar DATA_ZOOM_ID_BASE = makeInternalComponentId('toolbox-dataZoom_');\nvar ICON_TYPES = ['zoom', 'back'];\n\nvar DataZoomFeature =\n/** @class */\nfunction (_super) {\n __extends(DataZoomFeature, _super);\n\n function DataZoomFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n DataZoomFeature.prototype.render = function (featureModel, ecModel, api, payload) {\n if (!this._brushController) {\n this._brushController = new BrushController(api.getZr());\n\n this._brushController.on('brush', zrUtil.bind(this._onBrush, this)).mount();\n }\n\n updateZoomBtnStatus(featureModel, ecModel, this, payload, api);\n updateBackBtnStatus(featureModel, ecModel);\n };\n\n DataZoomFeature.prototype.onclick = function (ecModel, api, type) {\n handlers[type].call(this);\n };\n\n DataZoomFeature.prototype.remove = function (ecModel, api) {\n this._brushController && this._brushController.unmount();\n };\n\n DataZoomFeature.prototype.dispose = function (ecModel, api) {\n this._brushController && this._brushController.dispose();\n };\n\n DataZoomFeature.prototype._onBrush = function (eventParam) {\n var areas = eventParam.areas;\n\n if (!eventParam.isEnd || !areas.length) {\n return;\n }\n\n var snapshot = {};\n var ecModel = this.ecModel;\n\n this._brushController.updateCovers([]); // remove cover\n\n\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {\n include: ['grid']\n });\n brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n if (coordSys.type !== 'cartesian2d') {\n return;\n }\n\n var brushType = area.brushType;\n\n if (brushType === 'rect') {\n setBatch('x', coordSys, coordRange[0]);\n setBatch('y', coordSys, coordRange[1]);\n } else {\n setBatch({\n lineX: 'x',\n lineY: 'y'\n }[brushType], coordSys, coordRange);\n }\n });\n history.push(ecModel, snapshot);\n\n this._dispatchZoomAction(snapshot);\n\n function setBatch(dimName, coordSys, minMax) {\n var axis = coordSys.getAxis(dimName);\n var axisModel = axis.model;\n var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); // Restrict range.\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();\n\n if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {\n minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);\n }\n\n dataZoomModel && (snapshot[dataZoomModel.id] = {\n dataZoomId: dataZoomModel.id,\n startValue: minMax[0],\n endValue: minMax[1]\n });\n }\n\n function findDataZoom(dimName, axisModel, ecModel) {\n var found;\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'select'\n }, function (dzModel) {\n var has = dzModel.getAxisModel(dimName, axisModel.componentIndex);\n has && (found = dzModel);\n });\n return found;\n }\n };\n\n ;\n\n DataZoomFeature.prototype._dispatchZoomAction = function (snapshot) {\n var batch = []; // Convert from hash map to array.\n\n each(snapshot, function (batchItem, dataZoomId) {\n batch.push(zrUtil.clone(batchItem));\n });\n batch.length && this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n batch: batch\n });\n };\n\n DataZoomFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n filterMode: 'filter',\n // Icon group\n icon: {\n zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',\n back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'\n },\n // `zoom`, `back`\n title: ecModel.getLocaleModel().get(['toolbox', 'dataZoom', 'title']),\n brushStyle: {\n borderWidth: 0,\n color: 'rgba(210,219,238,0.2)'\n }\n };\n return defaultOption;\n };\n\n return DataZoomFeature;\n}(ToolboxFeature);\n\nvar handlers = {\n zoom: function () {\n var nextActive = !this._isZoomActive;\n this.api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: nextActive\n });\n },\n back: function () {\n this._dispatchZoomAction(history.pop(this.ecModel));\n }\n};\n\nfunction makeAxisFinder(dzFeatureModel) {\n var setting = {\n xAxisIndex: dzFeatureModel.get('xAxisIndex', true),\n yAxisIndex: dzFeatureModel.get('yAxisIndex', true),\n xAxisId: dzFeatureModel.get('xAxisId', true),\n yAxisId: dzFeatureModel.get('yAxisId', true)\n }; // If both `xAxisIndex` `xAxisId` not set, it means 'all'.\n // If both `yAxisIndex` `yAxisId` not set, it means 'all'.\n // Some old cases set like this below to close yAxis control but leave xAxis control:\n // `{ feature: { dataZoom: { yAxisIndex: false } }`.\n\n if (setting.xAxisIndex == null && setting.xAxisId == null) {\n setting.xAxisIndex = 'all';\n }\n\n if (setting.yAxisIndex == null && setting.yAxisId == null) {\n setting.yAxisIndex = 'all';\n }\n\n return setting;\n}\n\nfunction updateBackBtnStatus(featureModel, ecModel) {\n featureModel.setIconStatus('back', history.count(ecModel) > 1 ? 'emphasis' : 'normal');\n}\n\nfunction updateZoomBtnStatus(featureModel, ecModel, view, payload, api) {\n var zoomActive = view._isZoomActive;\n\n if (payload && payload.type === 'takeGlobalCursor') {\n zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false;\n }\n\n view._isZoomActive = zoomActive;\n featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal');\n var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {\n include: ['grid']\n });\n var panels = brushTargetManager.makePanelOpts(api, function (targetInfo) {\n return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? 'lineX' : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? 'lineY' : 'rect';\n });\n\n view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {\n brushType: 'auto',\n brushStyle: featureModel.getModel('brushStyle').getItemStyle()\n } : false);\n}\n\nregisterInternalOptionCreator('dataZoom', function (ecModel) {\n var toolboxModel = ecModel.getComponent('toolbox', 0);\n var featureDataZoomPath = ['feature', 'dataZoom'];\n\n if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {\n return;\n }\n\n var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);\n var dzOptions = [];\n var finder = makeAxisFinder(dzFeatureModel);\n var finderResult = parseFinder(ecModel, finder);\n each(finderResult.xAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'xAxis', 'xAxisIndex');\n });\n each(finderResult.yAxisModels, function (axisModel) {\n return buildInternalOptions(axisModel, 'yAxis', 'yAxisIndex');\n });\n\n function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {\n var axisIndex = axisModel.componentIndex;\n var newOpt = {\n type: 'select',\n $fromToolbox: true,\n // Default to be filter\n filterMode: dzFeatureModel.get('filterMode', true) || 'filter',\n // Id for merge mapping.\n id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex\n };\n newOpt[axisIndexPropName] = axisIndex;\n dzOptions.push(newOpt);\n }\n\n return dzOptions;\n});\nexport default DataZoomFeature;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomSelect } from '../../component/dataZoom/installDataZoomSelect.js';\nimport ToolboxModel from './ToolboxModel.js';\nimport ToolboxView from './ToolboxView.js'; // TODOD: REGISTER IN INSTALL\n\nimport { registerFeature } from './featureManager.js';\nimport SaveAsImage from './feature/SaveAsImage.js';\nimport MagicType from './feature/MagicType.js';\nimport DataView from './feature/DataView.js';\nimport Restore from './feature/Restore.js';\nimport DataZoom from './feature/DataZoom.js';\nexport function install(registers) {\n registers.registerComponentModel(ToolboxModel);\n registers.registerComponentView(ToolboxView);\n registerFeature('saveAsImage', SaveAsImage);\n registerFeature('magicType', MagicType);\n registerFeature('dataView', DataView);\n registerFeature('dataZoom', DataZoom);\n registerFeature('restore', Restore);\n use(installDataZoomSelect);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\n\nvar TooltipModel =\n/** @class */\nfunction (_super) {\n __extends(TooltipModel, _super);\n\n function TooltipModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipModel.type;\n return _this;\n }\n\n TooltipModel.type = 'tooltip';\n TooltipModel.dependencies = ['axisPointer'];\n TooltipModel.defaultOption = {\n // zlevel: 0,\n z: 60,\n show: true,\n // tooltip main content\n showContent: true,\n // 'trigger' only works on coordinate system.\n // 'item' | 'axis' | 'none'\n trigger: 'item',\n // 'click' | 'mousemove' | 'none'\n triggerOn: 'mousemove|click',\n alwaysShowContent: false,\n displayMode: 'single',\n renderMode: 'auto',\n // whether restraint content inside viewRect.\n // If renderMode: 'richText', default true.\n // If renderMode: 'html', defaut false (for backward compat).\n confine: null,\n showDelay: 0,\n hideDelay: 100,\n // Animation transition time, unit is second\n transitionDuration: 0.4,\n enterable: false,\n backgroundColor: '#fff',\n // box shadow\n shadowBlur: 10,\n shadowColor: 'rgba(0, 0, 0, .2)',\n shadowOffsetX: 1,\n shadowOffsetY: 2,\n // tooltip border radius, unit is px, default is 4\n borderRadius: 4,\n // tooltip border width, unit is px, default is 0 (no border)\n borderWidth: 1,\n // Tooltip inside padding, default is 5 for all direction\n // Array is allowed to set up, right, bottom, left, same with css\n // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.\n padding: null,\n // Extra css text\n extraCssText: '',\n // axis indicator, trigger by axis\n axisPointer: {\n // default is line\n // legal values: 'line' | 'shadow' | 'cross'\n type: 'line',\n // Valid when type is line, appoint tooltip line locate on which line. Optional\n // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'\n // default is 'auto', chose the axis which type is category.\n // for multiply y axis, cartesian coord chose x axis, polar chose angle axis\n axis: 'auto',\n animation: 'auto',\n animationDurationUpdate: 200,\n animationEasingUpdate: 'exponentialOut',\n crossStyle: {\n color: '#999',\n width: 1,\n type: 'dashed',\n // TODO formatter\n textStyle: {}\n } // lineStyle and shadowStyle should not be specified here,\n // otherwise it will always override those styles on option.axisPointer.\n\n },\n textStyle: {\n color: '#666',\n fontSize: 14\n }\n };\n return TooltipModel;\n}(ComponentModel);\n\nexport default TooltipModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { toCamelCase } from '../../util/format.js';\nimport env from 'zrender/lib/core/env.js';\n/* global document */\n\nexport function shouldTooltipConfine(tooltipModel) {\n var confineOption = tooltipModel.get('confine');\n return confineOption != null ? !!confineOption // In richText mode, the outside part can not be visible.\n : tooltipModel.get('renderMode') === 'richText';\n}\n\nfunction testStyle(styleProps) {\n if (!env.domSupported) {\n return;\n }\n\n var style = document.documentElement.style;\n\n for (var i = 0, len = styleProps.length; i < len; i++) {\n if (styleProps[i] in style) {\n return styleProps[i];\n }\n }\n}\n\nexport var TRANSFORM_VENDOR = testStyle(['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\nexport var TRANSITION_VENDOR = testStyle(['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\nexport function toCSSVendorPrefix(styleVendor, styleProp) {\n if (!styleVendor) {\n return styleProp;\n }\n\n styleProp = toCamelCase(styleProp, true);\n var idx = styleVendor.indexOf(styleProp);\n styleVendor = idx === -1 ? styleProp : \"-\" + styleVendor.slice(0, idx) + \"-\" + styleProp;\n return styleVendor.toLowerCase();\n}\nexport function getComputedStyle(el, style) {\n var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);\n return stl ? style ? stl[style] : stl : null;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isString, indexOf, each, bind, isArray, isDom } from 'zrender/lib/core/util.js';\nimport { normalizeEvent } from 'zrender/lib/core/event.js';\nimport { transformLocalCoord } from 'zrender/lib/core/dom.js';\nimport env from 'zrender/lib/core/env.js';\nimport { convertToColorString, toCamelCase, normalizeCssArray } from '../../util/format.js';\nimport { shouldTooltipConfine, toCSSVendorPrefix, getComputedStyle, TRANSFORM_VENDOR, TRANSITION_VENDOR } from './helper.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\n/* global document, window */\n\nvar CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');\nvar CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform'); // eslint-disable-next-line\n\nvar gCssText = \"position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;\" + (env.transform3dSupported ? 'will-change:transform;' : '');\n\nfunction mirrorPos(pos) {\n pos = pos === 'left' ? 'right' : pos === 'right' ? 'left' : pos === 'top' ? 'bottom' : 'top';\n return pos;\n}\n\nfunction assembleArrow(tooltipModel, borderColor, arrowPosition) {\n if (!isString(arrowPosition) || arrowPosition === 'inside') {\n return '';\n }\n\n var backgroundColor = tooltipModel.get('backgroundColor');\n var borderWidth = tooltipModel.get('borderWidth');\n borderColor = convertToColorString(borderColor);\n var arrowPos = mirrorPos(arrowPosition);\n var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);\n var positionStyle = '';\n var transformStyle = CSS_TRANSFORM_VENDOR + ':';\n var rotateDeg;\n\n if (indexOf(['left', 'right'], arrowPos) > -1) {\n positionStyle += 'top:50%';\n transformStyle += \"translateY(-50%) rotate(\" + (rotateDeg = arrowPos === 'left' ? -225 : -45) + \"deg)\";\n } else {\n positionStyle += 'left:50%';\n transformStyle += \"translateX(-50%) rotate(\" + (rotateDeg = arrowPos === 'top' ? 225 : 45) + \"deg)\";\n }\n\n var rotateRadian = rotateDeg * Math.PI / 180;\n var arrowWH = arrowSize + borderWidth;\n var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));\n var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;\n positionStyle += \";\" + arrowPos + \":-\" + arrowOffset + \"px\";\n var borderStyle = borderColor + \" solid \" + borderWidth + \"px;\";\n var styleCss = [\"position:absolute;width:\" + arrowSize + \"px;height:\" + arrowSize + \"px;z-index:-1;\", positionStyle + \";\" + transformStyle + \";\", \"border-bottom:\" + borderStyle, \"border-right:\" + borderStyle, \"background-color:\" + backgroundColor + \";\"];\n return \"
\";\n}\n\nfunction assembleTransition(duration, onlyFade) {\n var transitionCurve = 'cubic-bezier(0.23,1,0.32,1)';\n var transitionOption = \" \" + duration / 2 + \"s \" + transitionCurve;\n var transitionText = \"opacity\" + transitionOption + \",visibility\" + transitionOption;\n\n if (!onlyFade) {\n transitionOption = \" \" + duration + \"s \" + transitionCurve;\n transitionText += env.transformSupported ? \",\" + CSS_TRANSFORM_VENDOR + transitionOption : \",left\" + transitionOption + \",top\" + transitionOption;\n }\n\n return CSS_TRANSITION_VENDOR + ':' + transitionText;\n}\n\nfunction assembleTransform(x, y, toString) {\n // If using float on style, the final width of the dom might\n // keep changing slightly while mouse move. So `toFixed(0)` them.\n var x0 = x.toFixed(0) + 'px';\n var y0 = y.toFixed(0) + 'px'; // not support transform, use `left` and `top` instead.\n\n if (!env.transformSupported) {\n return toString ? \"top:\" + y0 + \";left:\" + x0 + \";\" : [['top', y0], ['left', x0]];\n } // support transform\n\n\n var is3d = env.transform3dSupported;\n var translate = \"translate\" + (is3d ? '3d' : '') + \"(\" + x0 + \",\" + y0 + (is3d ? ',0' : '') + \")\";\n return toString ? 'top:0;left:0;' + CSS_TRANSFORM_VENDOR + ':' + translate + ';' : [['top', 0], ['left', 0], [TRANSFORM_VENDOR, translate]];\n}\n/**\r\n * @param {Object} textStyle\r\n * @return {string}\r\n * @inner\r\n */\n\n\nfunction assembleFont(textStyleModel) {\n var cssText = [];\n var fontSize = textStyleModel.get('fontSize');\n var color = textStyleModel.getTextColor();\n color && cssText.push('color:' + color);\n cssText.push('font:' + textStyleModel.getFont());\n fontSize // @ts-ignore, leave it to the tooltip refactor.\n && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');\n var shadowColor = textStyleModel.get('textShadowColor');\n var shadowBlur = textStyleModel.get('textShadowBlur') || 0;\n var shadowOffsetX = textStyleModel.get('textShadowOffsetX') || 0;\n var shadowOffsetY = textStyleModel.get('textShadowOffsetY') || 0;\n shadowColor && shadowBlur && cssText.push('text-shadow:' + shadowOffsetX + 'px ' + shadowOffsetY + 'px ' + shadowBlur + 'px ' + shadowColor);\n each(['decoration', 'align'], function (name) {\n var val = textStyleModel.get(name);\n val && cssText.push('text-' + name + ':' + val);\n });\n return cssText.join(';');\n}\n\nfunction assembleCssText(tooltipModel, enableTransition, onlyFade) {\n var cssText = [];\n var transitionDuration = tooltipModel.get('transitionDuration');\n var backgroundColor = tooltipModel.get('backgroundColor');\n var shadowBlur = tooltipModel.get('shadowBlur');\n var shadowColor = tooltipModel.get('shadowColor');\n var shadowOffsetX = tooltipModel.get('shadowOffsetX');\n var shadowOffsetY = tooltipModel.get('shadowOffsetY');\n var textStyleModel = tooltipModel.getModel('textStyle');\n var padding = getPaddingFromTooltipModel(tooltipModel, 'html');\n var boxShadow = shadowOffsetX + \"px \" + shadowOffsetY + \"px \" + shadowBlur + \"px \" + shadowColor;\n cssText.push('box-shadow:' + boxShadow); // Animation transition. Do not animate when transitionDuration is 0.\n\n enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));\n\n if (backgroundColor) {\n cssText.push('background-color:' + backgroundColor);\n } // Border style\n\n\n each(['width', 'color', 'radius'], function (name) {\n var borderName = 'border-' + name;\n var camelCase = toCamelCase(borderName);\n var val = tooltipModel.get(camelCase);\n val != null && cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));\n }); // Text style\n\n cssText.push(assembleFont(textStyleModel)); // Padding\n\n if (padding != null) {\n cssText.push('padding:' + normalizeCssArray(padding).join('px ') + 'px');\n }\n\n return cssText.join(';') + ';';\n} // If not able to make, do not modify the input `out`.\n\n\nfunction makeStyleCoord(out, zr, appendToBody, zrX, zrY) {\n var zrPainter = zr && zr.painter;\n\n if (appendToBody) {\n var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();\n\n if (zrViewportRoot) {\n // Some APPs might use scale on body, so we support CSS transform here.\n transformLocalCoord(out, zrViewportRoot, document.body, zrX, zrY);\n }\n } else {\n out[0] = zrX;\n out[1] = zrY; // xy should be based on canvas root. But tooltipContent is\n // the sibling of canvas root. So padding of ec container\n // should be considered here.\n\n var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();\n\n if (viewportRootOffset) {\n out[0] += viewportRootOffset.offsetLeft;\n out[1] += viewportRootOffset.offsetTop;\n }\n }\n\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nvar TooltipHTMLContent =\n/** @class */\nfunction () {\n function TooltipHTMLContent(container, api, opt) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._enterable = true;\n this._alwaysShowContent = false;\n this._firstShow = true;\n this._longHide = true;\n\n if (env.wxa) {\n return null;\n }\n\n var el = document.createElement('div'); // TODO: TYPE\n\n el.domBelongToZr = true;\n this.el = el;\n var zr = this._zr = api.getZr();\n var appendToBody = this._appendToBody = opt && opt.appendToBody;\n makeStyleCoord(this._styleCoord, zr, appendToBody, api.getWidth() / 2, api.getHeight() / 2);\n\n if (appendToBody) {\n document.body.appendChild(el);\n } else {\n container.appendChild(el);\n }\n\n this._container = container; // FIXME\n // Is it needed to trigger zr event manually if\n // the browser do not support `pointer-events: none`.\n\n var self = this;\n\n el.onmouseenter = function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n };\n\n el.onmousemove = function (e) {\n e = e || window.event;\n\n if (!self._enterable) {\n // `pointer-events: none` is set to tooltip content div\n // if `enterable` is set as `false`, and `el.onmousemove`\n // can not be triggered. But in browser that do not\n // support `pointer-events`, we need to do this:\n // Try trigger zrender event to avoid mouse\n // in and out shape too frequently\n var handler = zr.handler;\n var zrViewportRoot = zr.painter.getViewportRoot();\n normalizeEvent(zrViewportRoot, e, true);\n handler.dispatch('mousemove', e);\n }\n };\n\n el.onmouseleave = function () {\n // set `_inContent` to `false` before `hideLater`\n self._inContent = false;\n\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n };\n }\n /**\r\n * Update when tooltip is rendered\r\n */\n\n\n TooltipHTMLContent.prototype.update = function (tooltipModel) {\n // FIXME\n // Move this logic to ec main?\n var container = this._container;\n var position = getComputedStyle(container, 'position');\n var domStyle = container.style;\n\n if (domStyle.position !== 'absolute' && position !== 'absolute') {\n domStyle.position = 'relative';\n } // move tooltip if chart resized\n\n\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized(); // update alwaysShowContent\n\n this._alwaysShowContent = alwaysShowContent; // update className\n\n this.el.className = tooltipModel.get('className') || ''; // Hide the tooltip\n // PENDING\n // this.hide();\n };\n\n TooltipHTMLContent.prototype.show = function (tooltipModel, nearPointColor) {\n clearTimeout(this._hideTimeout);\n clearTimeout(this._longHideTimeout);\n var el = this.el;\n var style = el.style;\n var styleCoord = this._styleCoord;\n\n if (!el.innerHTML) {\n style.display = 'none';\n } else {\n style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) // initial transform\n + assembleTransform(styleCoord[0], styleCoord[1], true) + (\"border-color:\" + convertToColorString(nearPointColor) + \";\") + (tooltipModel.get('extraCssText') || '') // If mouse occasionally move over the tooltip, a mouseout event will be\n // triggered by canvas, and cause some unexpectable result like dragging\n // stop, \"unfocusAdjacency\". Here `pointer-events: none` is used to solve\n // it. Although it is not supported by IE8~IE10, fortunately it is a rare\n // scenario.\n + (\";pointer-events:\" + (this._enterable ? 'auto' : 'none'));\n }\n\n this._show = true;\n this._firstShow = false;\n this._longHide = false;\n };\n\n TooltipHTMLContent.prototype.setContent = function (content, markers, tooltipModel, borderColor, arrowPosition) {\n var el = this.el;\n\n if (content == null) {\n el.innerHTML = '';\n return;\n }\n\n var arrow = '';\n\n if (isString(arrowPosition) && tooltipModel.get('trigger') === 'item' && !shouldTooltipConfine(tooltipModel)) {\n arrow = assembleArrow(tooltipModel, borderColor, arrowPosition);\n }\n\n if (isString(content)) {\n el.innerHTML = content + arrow;\n } else if (content) {\n // Clear previous\n el.innerHTML = '';\n\n if (!isArray(content)) {\n content = [content];\n }\n\n for (var i = 0; i < content.length; i++) {\n if (isDom(content[i]) && content[i].parentNode !== el) {\n el.appendChild(content[i]);\n }\n } // no arrow if empty\n\n\n if (arrow && el.childNodes.length) {\n // no need to create a new parent element, but it's not supported by IE 10 and older.\n // const arrowEl = document.createRange().createContextualFragment(arrow);\n var arrowEl = document.createElement('div');\n arrowEl.innerHTML = arrow;\n el.appendChild(arrowEl);\n }\n }\n };\n\n TooltipHTMLContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipHTMLContent.prototype.getSize = function () {\n var el = this.el;\n return [el.offsetWidth, el.offsetHeight];\n };\n\n TooltipHTMLContent.prototype.moveTo = function (zrX, zrY) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, this._appendToBody, zrX, zrY);\n\n if (styleCoord[0] != null && styleCoord[1] != null) {\n var style_1 = this.el.style;\n var transforms = assembleTransform(styleCoord[0], styleCoord[1]);\n each(transforms, function (transform) {\n style_1[transform[0]] = transform[1];\n });\n }\n };\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\n\n\n TooltipHTMLContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipHTMLContent.prototype.hide = function () {\n var _this = this;\n\n var style = this.el.style;\n style.visibility = 'hidden';\n style.opacity = '0';\n env.transform3dSupported && (style.willChange = '');\n this._show = false;\n this._longHideTimeout = setTimeout(function () {\n return _this._longHide = true;\n }, 500);\n };\n\n TooltipHTMLContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipHTMLContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipHTMLContent.prototype.dispose = function () {\n this.el.parentNode.removeChild(this.el);\n };\n\n return TooltipHTMLContent;\n}();\n\nexport default TooltipHTMLContent;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport ZRText from 'zrender/lib/graphic/Text.js';\nimport { getPaddingFromTooltipModel } from './tooltipMarkup.js';\nimport { throwError } from '../../util/log.js';\n\nvar TooltipRichContent =\n/** @class */\nfunction () {\n function TooltipRichContent(api) {\n this._show = false;\n this._styleCoord = [0, 0, 0, 0];\n this._alwaysShowContent = false;\n this._enterable = true;\n this._zr = api.getZr();\n makeStyleCoord(this._styleCoord, this._zr, api.getWidth() / 2, api.getHeight() / 2);\n }\n /**\r\n * Update when tooltip is rendered\r\n */\n\n\n TooltipRichContent.prototype.update = function (tooltipModel) {\n var alwaysShowContent = tooltipModel.get('alwaysShowContent');\n alwaysShowContent && this._moveIfResized(); // update alwaysShowContent\n\n this._alwaysShowContent = alwaysShowContent;\n };\n\n TooltipRichContent.prototype.show = function () {\n if (this._hideTimeout) {\n clearTimeout(this._hideTimeout);\n }\n\n this.el.show();\n this._show = true;\n };\n /**\r\n * Set tooltip content\r\n */\n\n\n TooltipRichContent.prototype.setContent = function (content, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {\n var _this = this;\n\n if (zrUtil.isObject(content)) {\n throwError(process.env.NODE_ENV !== 'production' ? 'Passing DOM nodes as content is not supported in richText tooltip!' : '');\n }\n\n if (this.el) {\n this._zr.remove(this.el);\n }\n\n var textStyleModel = tooltipModel.getModel('textStyle');\n this.el = new ZRText({\n style: {\n rich: markupStyleCreator.richTextStyles,\n text: content,\n lineHeight: 22,\n borderWidth: 1,\n borderColor: borderColor,\n textShadowColor: textStyleModel.get('textShadowColor'),\n fill: tooltipModel.get(['textStyle', 'color']),\n padding: getPaddingFromTooltipModel(tooltipModel, 'richText'),\n verticalAlign: 'top',\n align: 'left'\n },\n z: tooltipModel.get('z')\n });\n zrUtil.each(['backgroundColor', 'borderRadius', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY'], function (propName) {\n _this.el.style[propName] = tooltipModel.get(propName);\n });\n zrUtil.each(['textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY'], function (propName) {\n _this.el.style[propName] = textStyleModel.get(propName) || 0;\n });\n\n this._zr.add(this.el);\n\n var self = this;\n this.el.on('mouseover', function () {\n // clear the timeout in hideLater and keep showing tooltip\n if (self._enterable) {\n clearTimeout(self._hideTimeout);\n self._show = true;\n }\n\n self._inContent = true;\n });\n this.el.on('mouseout', function () {\n if (self._enterable) {\n if (self._show) {\n self.hideLater(self._hideDelay);\n }\n }\n\n self._inContent = false;\n });\n };\n\n TooltipRichContent.prototype.setEnterable = function (enterable) {\n this._enterable = enterable;\n };\n\n TooltipRichContent.prototype.getSize = function () {\n var el = this.el;\n var bounding = this.el.getBoundingRect(); // bounding rect does not include shadow. For renderMode richText,\n // if overflow, it will be cut. So calculate them accurately.\n\n var shadowOuterSize = calcShadowOuterSize(el.style);\n return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];\n };\n\n TooltipRichContent.prototype.moveTo = function (x, y) {\n var el = this.el;\n\n if (el) {\n var styleCoord = this._styleCoord;\n makeStyleCoord(styleCoord, this._zr, x, y);\n x = styleCoord[0];\n y = styleCoord[1];\n var style = el.style;\n var borderWidth = mathMaxWith0(style.borderWidth || 0);\n var shadowOuterSize = calcShadowOuterSize(style); // rich text x, y do not include border.\n\n el.x = x + borderWidth + shadowOuterSize.left;\n el.y = y + borderWidth + shadowOuterSize.top;\n el.markRedraw();\n }\n };\n /**\r\n * when `alwaysShowContent` is true,\r\n * move the tooltip after chart resized\r\n */\n\n\n TooltipRichContent.prototype._moveIfResized = function () {\n // The ratio of left to width\n var ratioX = this._styleCoord[2]; // The ratio of top to height\n\n var ratioY = this._styleCoord[3];\n this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());\n };\n\n TooltipRichContent.prototype.hide = function () {\n if (this.el) {\n this.el.hide();\n }\n\n this._show = false;\n };\n\n TooltipRichContent.prototype.hideLater = function (time) {\n if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {\n if (time) {\n this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times\n\n this._show = false;\n this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);\n } else {\n this.hide();\n }\n }\n };\n\n TooltipRichContent.prototype.isShow = function () {\n return this._show;\n };\n\n TooltipRichContent.prototype.dispose = function () {\n this._zr.remove(this.el);\n };\n\n return TooltipRichContent;\n}();\n\nfunction mathMaxWith0(val) {\n return Math.max(0, val);\n}\n\nfunction calcShadowOuterSize(style) {\n var shadowBlur = mathMaxWith0(style.shadowBlur || 0);\n var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);\n var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);\n return {\n left: mathMaxWith0(shadowBlur - shadowOffsetX),\n right: mathMaxWith0(shadowBlur + shadowOffsetX),\n top: mathMaxWith0(shadowBlur - shadowOffsetY),\n bottom: mathMaxWith0(shadowBlur + shadowOffsetY)\n };\n}\n\nfunction makeStyleCoord(out, zr, zrX, zrY) {\n out[0] = zrX;\n out[1] = zrY;\n out[2] = out[0] / zr.getWidth();\n out[3] = out[1] / zr.getHeight();\n}\n\nexport default TooltipRichContent;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\nimport { bind, each, clone, trim, isString, isFunction, isArray, isObject, extend } from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport TooltipHTMLContent from './TooltipHTMLContent.js';\nimport TooltipRichContent from './TooltipRichContent.js';\nimport { convertToColorString, formatTpl } from '../../util/format.js';\nimport { parsePercent } from '../../util/number.js';\nimport { Rect } from '../../util/graphic.js';\nimport findPointFromSeries from '../axisPointer/findPointFromSeries.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport Model from '../../model/Model.js';\nimport * as globalListener from '../axisPointer/globalListener.js';\nimport * as axisHelper from '../../coord/axisHelper.js';\nimport * as axisPointerViewHelper from '../axisPointer/viewHelper.js';\nimport { getTooltipRenderMode, preParseFinder, queryReferringComponents } from '../../util/model.js';\nimport ComponentView from '../../view/Component.js';\nimport { format as timeFormat } from '../../util/time.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { shouldTooltipConfine } from './helper.js';\nimport { normalizeTooltipFormatResult } from '../../model/mixin/dataFormat.js';\nimport { createTooltipMarkup, buildTooltipMarkup, TooltipMarkupStyleCreator } from './tooltipMarkup.js';\nimport { findEventDispatcher } from '../../util/event.js';\nimport { clear, createOrUpdate } from '../../util/throttle.js';\nvar proxyRect = new Rect({\n shape: {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n }\n});\n\nvar TooltipView =\n/** @class */\nfunction (_super) {\n __extends(TooltipView, _super);\n\n function TooltipView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TooltipView.type;\n return _this;\n }\n\n TooltipView.prototype.init = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n\n var tooltipModel = ecModel.getComponent('tooltip');\n var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get('renderMode'));\n this._tooltipContent = renderMode === 'richText' ? new TooltipRichContent(api) : new TooltipHTMLContent(api.getDom(), api, {\n appendToBody: tooltipModel.get('appendToBody', true)\n });\n };\n\n TooltipView.prototype.render = function (tooltipModel, ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n } // Reset\n\n\n this.group.removeAll();\n this._tooltipModel = tooltipModel;\n this._ecModel = ecModel;\n this._api = api;\n var tooltipContent = this._tooltipContent;\n tooltipContent.update(tooltipModel);\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n\n this._initGlobalListener();\n\n this._keepShow(); // PENDING\n // `mousemove` event will be triggered very frequently when the mouse moves fast,\n // which causes that the `updatePosition` function was also called frequently.\n // In Chrome with devtools open and Firefox, tooltip looks laggy and shakes. See #14695 #16101\n // To avoid frequent triggering,\n // consider throttling it in 50ms when transition is enabled\n\n\n if (this._renderMode !== 'richText' && tooltipModel.get('transitionDuration')) {\n createOrUpdate(this, '_updatePosition', 50, 'fixRate');\n } else {\n clear(this, '_updatePosition');\n }\n };\n\n TooltipView.prototype._initGlobalListener = function () {\n var tooltipModel = this._tooltipModel;\n var triggerOn = tooltipModel.get('triggerOn');\n globalListener.register('itemTooltip', this._api, bind(function (currTrigger, e, dispatchAction) {\n // If 'none', it is not controlled by mouse totally.\n if (triggerOn !== 'none') {\n if (triggerOn.indexOf(currTrigger) >= 0) {\n this._tryShow(e, dispatchAction);\n } else if (currTrigger === 'leave') {\n this._hide(dispatchAction);\n }\n }\n }, this));\n };\n\n TooltipView.prototype._keepShow = function () {\n var tooltipModel = this._tooltipModel;\n var ecModel = this._ecModel;\n var api = this._api;\n var triggerOn = tooltipModel.get('triggerOn'); // Try to keep the tooltip show when refreshing\n\n if (this._lastX != null && this._lastY != null // When user is willing to control tooltip totally using API,\n // self.manuallyShowTip({x, y}) might cause tooltip hide,\n // which is not expected.\n && triggerOn !== 'none' && triggerOn !== 'click') {\n var self_1 = this;\n clearTimeout(this._refreshUpdateTimeout);\n this._refreshUpdateTimeout = setTimeout(function () {\n // Show tip next tick after other charts are rendered\n // In case highlight action has wrong result\n // FIXME\n !api.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api, {\n x: self_1._lastX,\n y: self_1._lastY,\n dataByCoordSys: self_1._lastDataByCoordSys\n });\n });\n }\n };\n /**\r\n * Show tip manually by\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * x: 10,\r\n * y: 10\r\n * });\r\n * Or\r\n * dispatchAction({\r\n * type: 'showTip',\r\n * seriesIndex: 0,\r\n * dataIndex or dataIndexInside or name\r\n * });\r\n *\r\n * TODO Batch\r\n */\n\n\n TooltipView.prototype.manuallyShowTip = function (tooltipModel, ecModel, api, payload) {\n if (payload.from === this.uid || env.node || !api.getDom()) {\n return;\n }\n\n var dispatchAction = makeDispatchAction(payload, api); // Reset ticket\n\n this._ticket = ''; // When triggered from axisPointer.\n\n var dataByCoordSys = payload.dataByCoordSys;\n var cmptRef = findComponentReference(payload, ecModel, api);\n\n if (cmptRef) {\n var rect = cmptRef.el.getBoundingRect().clone();\n rect.applyTransform(cmptRef.el.transform);\n\n this._tryShow({\n offsetX: rect.x + rect.width / 2,\n offsetY: rect.y + rect.height / 2,\n target: cmptRef.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n } else if (payload.tooltip && payload.x != null && payload.y != null) {\n var el = proxyRect;\n el.x = payload.x;\n el.y = payload.y;\n el.update();\n getECData(el).tooltipConfig = {\n name: null,\n option: payload.tooltip\n }; // Manually show tooltip while view is not using zrender elements.\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n target: el\n }, dispatchAction);\n } else if (dataByCoordSys) {\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n dataByCoordSys: dataByCoordSys,\n tooltipOption: payload.tooltipOption\n }, dispatchAction);\n } else if (payload.seriesIndex != null) {\n if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) {\n return;\n }\n\n var pointInfo = findPointFromSeries(payload, ecModel);\n var cx = pointInfo.point[0];\n var cy = pointInfo.point[1];\n\n if (cx != null && cy != null) {\n this._tryShow({\n offsetX: cx,\n offsetY: cy,\n target: pointInfo.el,\n position: payload.position,\n // When manully trigger, the mouse is not on the el, so we'd better to\n // position tooltip on the bottom of the el and display arrow is possible.\n positionDefault: 'bottom'\n }, dispatchAction);\n }\n } else if (payload.x != null && payload.y != null) {\n // FIXME\n // should wrap dispatchAction like `axisPointer/globalListener` ?\n api.dispatchAction({\n type: 'updateAxisPointer',\n x: payload.x,\n y: payload.y\n });\n\n this._tryShow({\n offsetX: payload.x,\n offsetY: payload.y,\n position: payload.position,\n target: api.getZr().findHover(payload.x, payload.y).target\n }, dispatchAction);\n }\n };\n\n TooltipView.prototype.manuallyHideTip = function (tooltipModel, ecModel, api, payload) {\n var tooltipContent = this._tooltipContent;\n\n if (this._tooltipModel) {\n tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));\n }\n\n this._lastX = this._lastY = this._lastDataByCoordSys = null;\n\n if (payload.from !== this.uid) {\n this._hide(makeDispatchAction(payload, api));\n }\n }; // Be compatible with previous design, that is, when tooltip.type is 'axis' and\n // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer\n // and tooltip.\n\n\n TooltipView.prototype._manuallyAxisShowTip = function (tooltipModel, ecModel, api, payload) {\n var seriesIndex = payload.seriesIndex;\n var dataIndex = payload.dataIndex; // @ts-ignore\n\n var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo;\n\n if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {\n return;\n }\n\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (!seriesModel) {\n return;\n }\n\n var data = seriesModel.getData();\n var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);\n\n if (tooltipCascadedModel.get('trigger') !== 'axis') {\n return;\n }\n\n api.dispatchAction({\n type: 'updateAxisPointer',\n seriesIndex: seriesIndex,\n dataIndex: dataIndex,\n position: payload.position\n });\n return true;\n };\n\n TooltipView.prototype._tryShow = function (e, dispatchAction) {\n var el = e.target;\n var tooltipModel = this._tooltipModel;\n\n if (!tooltipModel) {\n return;\n } // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed\n\n\n this._lastX = e.offsetX;\n this._lastY = e.offsetY;\n var dataByCoordSys = e.dataByCoordSys;\n\n if (dataByCoordSys && dataByCoordSys.length) {\n this._showAxisTooltip(dataByCoordSys, e);\n } else if (el) {\n this._lastDataByCoordSys = null;\n var seriesDispatcher_1;\n var cmptDispatcher_1;\n findEventDispatcher(el, function (target) {\n // Always show item tooltip if mouse is on the element with dataIndex\n if (getECData(target).dataIndex != null) {\n seriesDispatcher_1 = target;\n return true;\n } // Tooltip provided directly. Like legend.\n\n\n if (getECData(target).tooltipConfig != null) {\n cmptDispatcher_1 = target;\n return true;\n }\n }, true);\n\n if (seriesDispatcher_1) {\n this._showSeriesItemTooltip(e, seriesDispatcher_1, dispatchAction);\n } else if (cmptDispatcher_1) {\n this._showComponentItemTooltip(e, cmptDispatcher_1, dispatchAction);\n } else {\n this._hide(dispatchAction);\n }\n } else {\n this._lastDataByCoordSys = null;\n\n this._hide(dispatchAction);\n }\n };\n\n TooltipView.prototype._showOrMove = function (tooltipModel, cb) {\n // showDelay is used in this case: tooltip.enterable is set\n // as true. User intent to move mouse into tooltip and click\n // something. `showDelay` makes it easier to enter the content\n // but tooltip do not move immediately.\n var delay = tooltipModel.get('showDelay');\n cb = bind(cb, this);\n clearTimeout(this._showTimout);\n delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();\n };\n\n TooltipView.prototype._showAxisTooltip = function (dataByCoordSys, e) {\n var ecModel = this._ecModel;\n var globalTooltipModel = this._tooltipModel;\n var point = [e.offsetX, e.offsetY];\n var singleTooltipModel = buildTooltipModel([e.tooltipOption], globalTooltipModel);\n var renderMode = this._renderMode;\n var cbParamsList = [];\n var articleMarkup = createTooltipMarkup('section', {\n blocks: [],\n noHeader: true\n }); // Only for legacy: `Serise['formatTooltip']` returns a string.\n\n var markupTextArrLegacy = [];\n var markupStyleCreator = new TooltipMarkupStyleCreator();\n each(dataByCoordSys, function (itemCoordSys) {\n each(itemCoordSys.dataByAxis, function (axisItem) {\n var axisModel = ecModel.getComponent(axisItem.axisDim + 'Axis', axisItem.axisIndex);\n var axisValue = axisItem.value;\n\n if (!axisModel || axisValue == null) {\n return;\n }\n\n var axisValueLabel = axisPointerViewHelper.getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);\n var axisSectionMarkup = createTooltipMarkup('section', {\n header: axisValueLabel,\n noHeader: !trim(axisValueLabel),\n sortBlocks: true,\n blocks: []\n });\n articleMarkup.blocks.push(axisSectionMarkup);\n each(axisItem.seriesDataIndices, function (idxItem) {\n var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);\n var dataIndex = idxItem.dataIndexInside;\n var cbParams = series.getDataParams(dataIndex); // Can't find data.\n\n if (cbParams.dataIndex < 0) {\n return;\n }\n\n cbParams.axisDim = axisItem.axisDim;\n cbParams.axisIndex = axisItem.axisIndex;\n cbParams.axisType = axisItem.axisType;\n cbParams.axisId = axisItem.axisId;\n cbParams.axisValue = axisHelper.getAxisRawValue(axisModel.axis, {\n value: axisValue\n });\n cbParams.axisValueLabel = axisValueLabel; // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n cbParams.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(cbParams.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));\n var frag = seriesTooltipResult.frag;\n\n if (frag) {\n var valueFormatter = buildTooltipModel([series], globalTooltipModel).get('valueFormatter');\n axisSectionMarkup.blocks.push(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag);\n }\n\n if (seriesTooltipResult.text) {\n markupTextArrLegacy.push(seriesTooltipResult.text);\n }\n\n cbParamsList.push(cbParams);\n });\n });\n }); // In most cases, the second axis is displays upper on the first one.\n // So we reverse it to look better.\n\n articleMarkup.blocks.reverse();\n markupTextArrLegacy.reverse();\n var positionExpr = e.position;\n var orderMode = singleTooltipModel.get('order');\n var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), singleTooltipModel.get('textStyle'));\n builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);\n var blockBreak = renderMode === 'richText' ? '\\n\\n' : '
';\n var allMarkupText = markupTextArrLegacy.join(blockBreak);\n\n this._showOrMove(singleTooltipModel, function () {\n if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {\n this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);\n } else {\n this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + '', point[0], point[1], positionExpr, null, markupStyleCreator);\n }\n }); // Do not trigger events here, because this branch only be entered\n // from dispatchAction.\n\n };\n\n TooltipView.prototype._showSeriesItemTooltip = function (e, dispatcher, dispatchAction) {\n var ecModel = this._ecModel;\n var ecData = getECData(dispatcher); // Use dataModel in element if possible\n // Used when mouseover on a element like markPoint or edge\n // In which case, the data is not main data in series.\n\n var seriesIndex = ecData.seriesIndex;\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex); // For example, graph link.\n\n var dataModel = ecData.dataModel || seriesModel;\n var dataIndex = ecData.dataIndex;\n var dataType = ecData.dataType;\n var data = dataModel.getData(dataType);\n var renderMode = this._renderMode;\n var positionDefault = e.positionDefault;\n var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var tooltipTrigger = tooltipModel.get('trigger');\n\n if (tooltipTrigger != null && tooltipTrigger !== 'item') {\n return;\n }\n\n var params = dataModel.getDataParams(dataIndex, dataType);\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Pre-create marker style for makers. Users can assemble richText\n // text in `formatter` callback and use those markers style.\n\n params.marker = markupStyleCreator.makeTooltipMarker('item', convertToColorString(params.color), renderMode);\n var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType));\n var orderMode = tooltipModel.get('order');\n var valueFormatter = tooltipModel.get('valueFormatter');\n var frag = seriesTooltipResult.frag;\n var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend({\n valueFormatter: valueFormatter\n }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get('useUTC'), tooltipModel.get('textStyle')) : seriesTooltipResult.text;\n var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex;\n\n this._showOrMove(tooltipModel, function () {\n this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e.offsetX, e.offsetY, e.position, e.target, markupStyleCreator);\n }); // FIXME\n // duplicated showtip if manuallyShowTip is called from dispatchAction.\n\n\n dispatchAction({\n type: 'showTip',\n dataIndexInside: dataIndex,\n dataIndex: data.getRawIndex(dataIndex),\n seriesIndex: seriesIndex,\n from: this.uid\n });\n };\n\n TooltipView.prototype._showComponentItemTooltip = function (e, el, dispatchAction) {\n var ecData = getECData(el);\n var tooltipConfig = ecData.tooltipConfig;\n var tooltipOpt = tooltipConfig.option || {};\n\n if (isString(tooltipOpt)) {\n var content = tooltipOpt;\n tooltipOpt = {\n content: content,\n // Fixed formatter\n formatter: content\n };\n }\n\n var tooltipModelCascade = [tooltipOpt];\n\n var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);\n\n if (cmpt) {\n tooltipModelCascade.push(cmpt);\n } // In most cases, component tooltip formatter has different params with series tooltip formatter,\n // so that they cannot share the same formatter. Since the global tooltip formatter is used for series\n // by convention, we do not use it as the default formatter for component.\n\n\n tooltipModelCascade.push({\n formatter: tooltipOpt.content\n });\n var positionDefault = e.positionDefault;\n var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {\n position: positionDefault\n } : null);\n var defaultHtml = subTooltipModel.get('content');\n var asyncTicket = Math.random() + ''; // PENDING: this case do not support richText style yet.\n\n var markupStyleCreator = new TooltipMarkupStyleCreator(); // Do not check whether `trigger` is 'none' here, because `trigger`\n // only works on coordinate system. In fact, we have not found case\n // that requires setting `trigger` nothing on component yet.\n\n this._showOrMove(subTooltipModel, function () {\n // Use formatterParams from element defined in component\n // Avoid users modify it.\n var formatterParams = clone(subTooltipModel.get('formatterParams') || {});\n\n this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e.offsetX, e.offsetY, e.position, el, markupStyleCreator);\n }); // If not dispatch showTip, tip may be hide triggered by axis.\n\n\n dispatchAction({\n type: 'showTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype._showTooltipContent = function ( // Use Model insteadof TooltipModel because this model may be from series or other options.\n // Instead of top level tooltip.\n tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markupStyleCreator) {\n // Reset ticket\n this._ticket = '';\n\n if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) {\n return;\n }\n\n var tooltipContent = this._tooltipContent;\n tooltipContent.setEnterable(tooltipModel.get('enterable'));\n var formatter = tooltipModel.get('formatter');\n positionExpr = positionExpr || tooltipModel.get('position');\n var html = defaultHtml;\n\n var nearPoint = this._getNearestPoint([x, y], params, tooltipModel.get('trigger'), tooltipModel.get('borderColor'));\n\n var nearPointColor = nearPoint.color;\n\n if (formatter) {\n if (isString(formatter)) {\n var useUTC = tooltipModel.ecModel.get('useUTC');\n var params0 = isArray(params) ? params[0] : params;\n var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf('time') >= 0;\n html = formatter;\n\n if (isTimeAxis) {\n html = timeFormat(params0.axisValue, html, useUTC);\n }\n\n html = formatTpl(html, params, true);\n } else if (isFunction(formatter)) {\n var callback = bind(function (cbTicket, html) {\n if (cbTicket === this._ticket) {\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n }\n }, this);\n this._ticket = asyncTicket;\n html = formatter(params, asyncTicket, callback);\n } else {\n html = formatter;\n }\n }\n\n tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);\n tooltipContent.show(tooltipModel, nearPointColor);\n\n this._updatePosition(tooltipModel, positionExpr, x, y, tooltipContent, params, el);\n };\n\n TooltipView.prototype._getNearestPoint = function (point, tooltipDataParams, trigger, borderColor) {\n if (trigger === 'axis' || isArray(tooltipDataParams)) {\n return {\n color: borderColor || (this._renderMode === 'html' ? '#fff' : 'none')\n };\n }\n\n if (!isArray(tooltipDataParams)) {\n return {\n color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor\n };\n }\n };\n\n TooltipView.prototype._updatePosition = function (tooltipModel, positionExpr, x, // Mouse x\n y, // Mouse y\n content, params, el) {\n var viewWidth = this._api.getWidth();\n\n var viewHeight = this._api.getHeight();\n\n positionExpr = positionExpr || tooltipModel.get('position');\n var contentSize = content.getSize();\n var align = tooltipModel.get('align');\n var vAlign = tooltipModel.get('verticalAlign');\n var rect = el && el.getBoundingRect().clone();\n el && rect.applyTransform(el.transform);\n\n if (isFunction(positionExpr)) {\n // Callback of position can be an array or a string specify the position\n positionExpr = positionExpr([x, y], params, content.el, rect, {\n viewSize: [viewWidth, viewHeight],\n contentSize: contentSize.slice()\n });\n }\n\n if (isArray(positionExpr)) {\n x = parsePercent(positionExpr[0], viewWidth);\n y = parsePercent(positionExpr[1], viewHeight);\n } else if (isObject(positionExpr)) {\n var boxLayoutPosition = positionExpr;\n boxLayoutPosition.width = contentSize[0];\n boxLayoutPosition.height = contentSize[1];\n var layoutRect = getLayoutRect(boxLayoutPosition, {\n width: viewWidth,\n height: viewHeight\n });\n x = layoutRect.x;\n y = layoutRect.y;\n align = null; // When positionExpr is left/top/right/bottom,\n // align and verticalAlign will not work.\n\n vAlign = null;\n } // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element\n else if (isString(positionExpr) && el) {\n var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get('borderWidth'));\n x = pos[0];\n y = pos[1];\n } else {\n var pos = refixTooltipPosition(x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);\n x = pos[0];\n y = pos[1];\n }\n\n align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0);\n vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0);\n\n if (shouldTooltipConfine(tooltipModel)) {\n var pos = confineTooltipPosition(x, y, content, viewWidth, viewHeight);\n x = pos[0];\n y = pos[1];\n }\n\n content.moveTo(x, y);\n }; // FIXME\n // Should we remove this but leave this to user?\n\n\n TooltipView.prototype._updateContentNotChangedOnAxis = function (dataByCoordSys, cbParamsList) {\n var lastCoordSys = this._lastDataByCoordSys;\n var lastCbParamsList = this._cbParamsList;\n var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;\n contentNotChanged && each(lastCoordSys, function (lastItemCoordSys, indexCoordSys) {\n var lastDataByAxis = lastItemCoordSys.dataByAxis || [];\n var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};\n var thisDataByAxis = thisItemCoordSys.dataByAxis || [];\n contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;\n contentNotChanged && each(lastDataByAxis, function (lastItem, indexAxis) {\n var thisItem = thisDataByAxis[indexAxis] || {};\n var lastIndices = lastItem.seriesDataIndices || [];\n var newIndices = thisItem.seriesDataIndices || [];\n contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;\n contentNotChanged && each(lastIndices, function (lastIdxItem, j) {\n var newIdxItem = newIndices[j];\n contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;\n }); // check is cbParams data value changed\n\n lastCbParamsList && each(lastItem.seriesDataIndices, function (idxItem) {\n var seriesIdx = idxItem.seriesIndex;\n var cbParams = cbParamsList[seriesIdx];\n var lastCbParams = lastCbParamsList[seriesIdx];\n\n if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {\n contentNotChanged = false;\n }\n });\n });\n });\n this._lastDataByCoordSys = dataByCoordSys;\n this._cbParamsList = cbParamsList;\n return !!contentNotChanged;\n };\n\n TooltipView.prototype._hide = function (dispatchAction) {\n // Do not directly hideLater here, because this behavior may be prevented\n // in dispatchAction when showTip is dispatched.\n // FIXME\n // duplicated hideTip if manuallyHideTip is called from dispatchAction.\n this._lastDataByCoordSys = null;\n dispatchAction({\n type: 'hideTip',\n from: this.uid\n });\n };\n\n TooltipView.prototype.dispose = function (ecModel, api) {\n if (env.node || !api.getDom()) {\n return;\n }\n\n clear(this, '_updatePosition');\n\n this._tooltipContent.dispose();\n\n globalListener.unregister('itemTooltip', api);\n };\n\n TooltipView.type = 'tooltip';\n return TooltipView;\n}(ComponentView);\n/**\r\n * From top to bottom. (the last one should be globalTooltipModel);\r\n */\n\n\nfunction buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {\n // Last is always tooltip model.\n var ecModel = globalTooltipModel.ecModel;\n var resultModel;\n\n if (defaultTooltipOption) {\n resultModel = new Model(defaultTooltipOption, ecModel, ecModel);\n resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);\n } else {\n resultModel = globalTooltipModel;\n }\n\n for (var i = modelCascade.length - 1; i >= 0; i--) {\n var tooltipOpt = modelCascade[i];\n\n if (tooltipOpt) {\n if (tooltipOpt instanceof Model) {\n tooltipOpt = tooltipOpt.get('tooltip', true);\n } // In each data item tooltip can be simply write:\n // {\n // value: 10,\n // tooltip: 'Something you need to know'\n // }\n\n\n if (isString(tooltipOpt)) {\n tooltipOpt = {\n formatter: tooltipOpt\n };\n }\n\n if (tooltipOpt) {\n resultModel = new Model(tooltipOpt, resultModel, ecModel);\n }\n }\n }\n\n return resultModel;\n}\n\nfunction makeDispatchAction(payload, api) {\n return payload.dispatchAction || bind(api.dispatchAction, api);\n}\n\nfunction refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n\n if (gapH != null) {\n // Add extra 2 pixels for this case:\n // At present the \"values\" in default tooltip are using CSS `float: right`.\n // When the right edge of the tooltip box is on the right side of the\n // viewport, the `float` layout might push the \"values\" to the second line.\n if (x + width + gapH + 2 > viewWidth) {\n x -= width + gapH;\n } else {\n x += gapH;\n }\n }\n\n if (gapV != null) {\n if (y + height + gapV > viewHeight) {\n y -= height + gapV;\n } else {\n y += gapV;\n }\n }\n\n return [x, y];\n}\n\nfunction confineTooltipPosition(x, y, content, viewWidth, viewHeight) {\n var size = content.getSize();\n var width = size[0];\n var height = size[1];\n x = Math.min(x + width, viewWidth) - width;\n y = Math.min(y + height, viewHeight) - height;\n x = Math.max(x, 0);\n y = Math.max(y, 0);\n return [x, y];\n}\n\nfunction calcTooltipPosition(position, rect, contentSize, borderWidth) {\n var domWidth = contentSize[0];\n var domHeight = contentSize[1];\n var offset = Math.ceil(Math.SQRT2 * borderWidth) + 8;\n var x = 0;\n var y = 0;\n var rectWidth = rect.width;\n var rectHeight = rect.height;\n\n switch (position) {\n case 'inside':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'top':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y - domHeight - offset;\n break;\n\n case 'bottom':\n x = rect.x + rectWidth / 2 - domWidth / 2;\n y = rect.y + rectHeight + offset;\n break;\n\n case 'left':\n x = rect.x - domWidth - offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n break;\n\n case 'right':\n x = rect.x + rectWidth + offset;\n y = rect.y + rectHeight / 2 - domHeight / 2;\n }\n\n return [x, y];\n}\n\nfunction isCenterAlign(align) {\n return align === 'center' || align === 'middle';\n}\n/**\r\n * Find target component by payload like:\r\n * ```js\r\n * { legendId: 'some_id', name: 'xxx' }\r\n * { toolboxIndex: 1, name: 'xxx' }\r\n * { geoName: 'some_name', name: 'xxx' }\r\n * ```\r\n * PENDING: at present only\r\n *\r\n * If not found, return null/undefined.\r\n */\n\n\nfunction findComponentReference(payload, ecModel, api) {\n var queryOptionMap = preParseFinder(payload).queryOptionMap;\n var componentMainType = queryOptionMap.keys()[0];\n\n if (!componentMainType || componentMainType === 'series') {\n return;\n }\n\n var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {\n useDefault: false,\n enableAll: false,\n enableNone: false\n });\n var model = queryResult.models[0];\n\n if (!model) {\n return;\n }\n\n var view = api.getViewOfComponentModel(model);\n var el;\n view.group.traverse(function (subEl) {\n var tooltipConfig = getECData(subEl).tooltipConfig;\n\n if (tooltipConfig && tooltipConfig.name === payload.name) {\n el = subEl;\n return true; // stop\n }\n });\n\n if (el) {\n return {\n componentMainType: componentMainType,\n componentIndex: model.componentIndex,\n el: el\n };\n }\n}\n\nexport default TooltipView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { install as installAxisPointer } from '../axisPointer/install.js';\nimport { use } from '../../extension.js';\nimport TooltipModel from './TooltipModel.js';\nimport TooltipView from './TooltipView.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n use(installAxisPointer);\n registers.registerComponentModel(TooltipModel);\n registers.registerComponentView(TooltipView);\n /**\r\n * @action\r\n * @property {string} type\r\n * @property {number} seriesIndex\r\n * @property {number} dataIndex\r\n * @property {number} [x]\r\n * @property {number} [y]\r\n */\n\n registers.registerAction({\n type: 'showTip',\n event: 'showTip',\n update: 'tooltip:manuallyShowTip'\n }, noop);\n registers.registerAction({\n type: 'hideTip',\n event: 'hideTip',\n update: 'tooltip:manuallyHideTip'\n }, noop);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nvar DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear'];\nexport default function brushPreprocessor(option, isNew) {\n var brushComponents = normalizeToArray(option ? option.brush : []);\n\n if (!brushComponents.length) {\n return;\n }\n\n var brushComponentSpecifiedBtns = [];\n zrUtil.each(brushComponents, function (brushOpt) {\n var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : [];\n\n if (tbs instanceof Array) {\n brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);\n }\n });\n var toolbox = option && option.toolbox;\n\n if (zrUtil.isArray(toolbox)) {\n toolbox = toolbox[0];\n }\n\n if (!toolbox) {\n toolbox = {\n feature: {}\n };\n option.toolbox = [toolbox];\n }\n\n var toolboxFeature = toolbox.feature || (toolbox.feature = {});\n var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});\n var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);\n brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);\n removeDuplicate(brushTypes);\n\n if (isNew && !brushTypes.length) {\n brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);\n }\n}\n\nfunction removeDuplicate(arr) {\n var map = {};\n zrUtil.each(arr, function (val) {\n map[val] = 1;\n });\n arr.length = 0;\n zrUtil.each(map, function (flag, val) {\n arr.push(val);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * @file Visual solution, for consistent option specification.\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapping from './VisualMapping.js';\nimport { getItemVisualFromData, setItemVisualFromData } from './helper.js';\nvar each = zrUtil.each;\n\nfunction hasKeys(obj) {\n if (obj) {\n for (var name_1 in obj) {\n if (obj.hasOwnProperty(name_1)) {\n return true;\n }\n }\n }\n}\n\nexport function createVisualMappings(option, stateList, supplementVisualOption) {\n var visualMappings = {};\n each(stateList, function (state) {\n var mappings = visualMappings[state] = createMappings();\n each(option[state], function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var mappingOption = {\n type: visualType,\n visual: visualData\n };\n supplementVisualOption && supplementVisualOption(mappingOption, state);\n mappings[visualType] = new VisualMapping(mappingOption); // Prepare a alpha for opacity, for some case that opacity\n // is not supported, such as rendering using gradient color.\n\n if (visualType === 'opacity') {\n mappingOption = zrUtil.clone(mappingOption);\n mappingOption.type = 'colorAlpha';\n mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);\n }\n });\n });\n return visualMappings;\n\n function createMappings() {\n var Creater = function () {}; // Make sure hidden fields will not be visited by\n // object iteration (with hasOwnProperty checking).\n\n\n Creater.prototype.__hidden = Creater.prototype;\n var obj = new Creater();\n return obj;\n }\n}\nexport function replaceVisualOption(thisOption, newOption, keys) {\n // Visual attributes merge is not supported, otherwise it\n // brings overcomplicated merge logic. See #2853. So if\n // newOption has anyone of these keys, all of these keys\n // will be reset. Otherwise, all keys remain.\n var has;\n zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n has = true;\n }\n });\n has && zrUtil.each(keys, function (key) {\n if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {\n thisOption[key] = zrUtil.clone(newOption[key]);\n } else {\n delete thisOption[key];\n }\n });\n}\n/**\r\n * @param stateList\r\n * @param visualMappings\r\n * @param list\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param scope Scope for getValueState\r\n * @param dimension Concrete dimension, if used.\r\n */\n// ???! handle brush?\n\nexport function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n var dataIndex;\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n if (dimension == null) {\n data.each(eachItem);\n } else {\n data.each([dimension], eachItem);\n }\n\n function eachItem(valueOrIndex, index) {\n dataIndex = dimension == null ? valueOrIndex // First argument is index\n : index;\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n return;\n }\n\n var valueState = getValueState.call(scope, valueOrIndex);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);\n }\n }\n}\n/**\r\n * @param data\r\n * @param stateList\r\n * @param visualMappings >\r\n * @param getValueState param: valueOrIndex, return: state.\r\n * @param dim dimension or dimension index.\r\n */\n\nexport function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {\n var visualTypesMap = {};\n zrUtil.each(stateList, function (state) {\n var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);\n visualTypesMap[state] = visualTypes;\n });\n return {\n progress: function progress(params, data) {\n var dimIndex;\n\n if (dim != null) {\n dimIndex = data.getDimensionIndex(dim);\n }\n\n function getVisual(key) {\n return getItemVisualFromData(data, dataIndex, key);\n }\n\n function setVisual(key, value) {\n setItemVisualFromData(data, dataIndex, key, value);\n }\n\n var dataIndex;\n var store = data.getStore();\n\n while ((dataIndex = params.next()) != null) {\n var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance\n // @ts-ignore\n\n if (rawDataItem && rawDataItem.visualMap === false) {\n continue;\n }\n\n var value = dim != null ? store.get(dimIndex, dataIndex) : dataIndex;\n var valueState = getValueState(value);\n var mappings = visualMappings[valueState];\n var visualTypes = visualTypesMap[valueState];\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);\n }\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as polygonContain from 'zrender/lib/contain/polygon.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport { linePolygonIntersect } from '../../util/graphic.js';\nexport function makeBrushCommonSelectorForSeries(area) {\n var brushType = area.brushType; // Do not use function binding or curry for performance.\n\n var selectors = {\n point: function (itemLayout) {\n return selector[brushType].point(itemLayout, selectors, area);\n },\n rect: function (itemLayout) {\n return selector[brushType].rect(itemLayout, selectors, area);\n }\n };\n return selectors;\n}\nvar selector = {\n lineX: getLineSelectors(0),\n lineY: getLineSelectors(1),\n rect: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.intersect(itemLayout);\n }\n },\n polygon: {\n point: function (itemLayout, selectors, area) {\n return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && polygonContain.contain(area.range, itemLayout[0], itemLayout[1]);\n },\n rect: function (itemLayout, selectors, area) {\n var points = area.range;\n\n if (!itemLayout || points.length <= 1) {\n return false;\n }\n\n var x = itemLayout.x;\n var y = itemLayout.y;\n var width = itemLayout.width;\n var height = itemLayout.height;\n var p = points[0];\n\n if (polygonContain.contain(points, x, y) || polygonContain.contain(points, x + width, y) || polygonContain.contain(points, x, y + height) || polygonContain.contain(points, x + width, y + height) || BoundingRect.create(itemLayout).contain(p[0], p[1]) || linePolygonIntersect(x, y, x + width, y, points) || linePolygonIntersect(x, y, x, y + height, points) || linePolygonIntersect(x + width, y, x + width, y + height, points) || linePolygonIntersect(x, y + height, x + width, y + height, points)) {\n return true;\n }\n }\n }\n};\n\nfunction getLineSelectors(xyIndex) {\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n return {\n point: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var p = itemLayout[xyIndex];\n return inLineRange(p, range);\n }\n },\n rect: function (itemLayout, selectors, area) {\n if (itemLayout) {\n var range = area.range;\n var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];\n layoutRange[1] < layoutRange[0] && layoutRange.reverse();\n return inLineRange(layoutRange[0], range) || inLineRange(layoutRange[1], range) || inLineRange(range[0], layoutRange) || inLineRange(range[1], layoutRange);\n }\n }\n };\n}\n\nfunction inLineRange(p, range) {\n return range[0] <= p && p <= range[1];\n}\n\nexport default selector;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport { makeBrushCommonSelectorForSeries } from './selector.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport BrushTargetManager from '../helper/BrushTargetManager.js';\nvar STATE_LIST = ['inBrush', 'outOfBrush'];\nvar DISPATCH_METHOD = '__ecBrushSelect';\nvar DISPATCH_FLAG = '__ecInBrushSelectEvent';\n;\nexport function layoutCovers(ecModel) {\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);\n brushTargetManager.setInputRanges(brushModel.areas, ecModel);\n });\n}\n/**\r\n * Register the visual encoding if this modules required.\r\n */\n\nexport default function brushVisual(ecModel, api, payload) {\n var brushSelected = [];\n var throttleType;\n var throttleDelay;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption(payload.key === 'brush' ? payload.brushOption : {\n brushType: false\n });\n });\n layoutCovers(ecModel);\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel, brushIndex) {\n var thisBrushSelected = {\n brushId: brushModel.id,\n brushIndex: brushIndex,\n brushName: brushModel.name,\n areas: zrUtil.clone(brushModel.areas),\n selected: []\n }; // Every brush component exists in event params, convenient\n // for user to find by index.\n\n brushSelected.push(thisBrushSelected);\n var brushOption = brushModel.option;\n var brushLink = brushOption.brushLink;\n var linkedSeriesMap = [];\n var selectedDataIndexForLink = [];\n var rangeInfoBySeries = [];\n var hasBrushExists = false;\n\n if (!brushIndex) {\n // Only the first throttle setting works.\n throttleType = brushOption.throttleType;\n throttleDelay = brushOption.throttleDelay;\n } // Add boundingRect and selectors to range.\n\n\n var areas = zrUtil.map(brushModel.areas, function (area) {\n var builder = boundingRectBuilders[area.brushType];\n var selectableArea = zrUtil.defaults({\n boundingRect: builder ? builder(area) : void 0\n }, area);\n selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);\n return selectableArea;\n });\n var visualMappings = visualSolution.createVisualMappings(brushModel.option, STATE_LIST, function (mappingOption) {\n mappingOption.mappingMethod = 'fixed';\n });\n zrUtil.isArray(brushLink) && zrUtil.each(brushLink, function (seriesIndex) {\n linkedSeriesMap[seriesIndex] = 1;\n });\n\n function linkOthers(seriesIndex) {\n return brushLink === 'all' || !!linkedSeriesMap[seriesIndex];\n } // If no supported brush or no brush on the series,\n // all visuals should be in original state.\n\n\n function brushed(rangeInfoList) {\n return !!rangeInfoList.length;\n }\n /**\r\n * Logic for each series: (If the logic has to be modified one day, do it carefully!)\r\n *\r\n * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord.\r\n * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord.\r\n * └!hasBrushExist┘ └nothing.\r\n * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord.\r\n * └!hasBrushExist┘ └nothing.\r\n * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck.\r\n * !brushed┘ └nothing.\r\n * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing.\r\n */\n // Step A\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];\n seriesModel.subType === 'parallel' ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);\n });\n\n function stepAParallel(seriesModel, seriesIndex) {\n var coordSys = seriesModel.coordinateSystem;\n hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();\n linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function (activeState, dataIndex) {\n activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1);\n });\n }\n\n function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {\n if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {\n return;\n }\n\n zrUtil.each(areas, function (area) {\n if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {\n rangeInfoList.push(area);\n }\n\n hasBrushExists = hasBrushExists || brushed(rangeInfoList);\n });\n\n if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {\n var data_1 = seriesModel.getData();\n data_1.each(function (dataIndex) {\n if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {\n selectedDataIndexForLink[dataIndex] = 1;\n }\n });\n }\n } // Step B\n\n\n ecModel.eachSeries(function (seriesModel, seriesIndex) {\n var seriesBrushSelected = {\n seriesId: seriesModel.id,\n seriesIndex: seriesIndex,\n seriesName: seriesModel.name,\n dataIndex: []\n }; // Every series exists in event params, convenient\n // for user to find series by seriesIndex.\n\n thisBrushSelected.selected.push(seriesBrushSelected);\n var rangeInfoList = rangeInfoBySeries[seriesIndex];\n var data = seriesModel.getData();\n var getValueState = linkOthers(seriesIndex) ? function (dataIndex) {\n return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n } : function (dataIndex) {\n return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') : 'outOfBrush';\n }; // If no supported brush or no brush, all visuals are in original state.\n\n (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && visualSolution.applyVisual(STATE_LIST, visualMappings, data, getValueState);\n });\n });\n dispatchAction(api, throttleType, throttleDelay, brushSelected, payload);\n}\n;\n\nfunction dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) {\n // This event will not be triggered when `setOpion`, otherwise dead lock may\n // triggered when do `setOption` in event listener, which we do not find\n // satisfactory way to solve yet. Some considered resolutions:\n // (a) Diff with prevoius selected data ant only trigger event when changed.\n // But store previous data and diff precisely (i.e., not only by dataIndex, but\n // also detect value changes in selected data) might bring complexity or fragility.\n // (b) Use spectial param like `silent` to suppress event triggering.\n // But such kind of volatile param may be weird in `setOption`.\n if (!payload) {\n return;\n }\n\n var zr = api.getZr();\n\n if (zr[DISPATCH_FLAG]) {\n return;\n }\n\n if (!zr[DISPATCH_METHOD]) {\n zr[DISPATCH_METHOD] = doDispatch;\n }\n\n var fn = throttleUtil.createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);\n fn(api, brushSelected);\n}\n\nfunction doDispatch(api, brushSelected) {\n if (!api.isDisposed()) {\n var zr = api.getZr();\n zr[DISPATCH_FLAG] = true;\n api.dispatchAction({\n type: 'brushSelect',\n batch: brushSelected\n });\n zr[DISPATCH_FLAG] = false;\n }\n}\n\nfunction checkInRange(seriesModel, rangeInfoList, data, dataIndex) {\n for (var i = 0, len = rangeInfoList.length; i < len; i++) {\n var area = rangeInfoList[i];\n\n if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {\n return true;\n }\n }\n}\n\nfunction brushModelNotControll(brushModel, seriesIndex) {\n var seriesIndices = brushModel.option.seriesIndex;\n return seriesIndices != null && seriesIndices !== 'all' && (zrUtil.isArray(seriesIndices) ? zrUtil.indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);\n}\n\nvar boundingRectBuilders = {\n rect: function (area) {\n return getBoundingRectFromMinMax(area.range);\n },\n polygon: function (area) {\n var minMax;\n var range = area.range;\n\n for (var i = 0, len = range.length; i < len; i++) {\n minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];\n var rg = range[i];\n rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);\n rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);\n rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);\n rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);\n }\n\n return minMax && getBoundingRectFromMinMax(minMax);\n }\n};\n\nfunction getBoundingRectFromMinMax(minMax) {\n return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport BrushController from '../helper/BrushController.js';\nimport { layoutCovers } from './visualEncoding.js';\nimport ComponentView from '../../view/Component.js';\n\nvar BrushView =\n/** @class */\nfunction (_super) {\n __extends(BrushView, _super);\n\n function BrushView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushView.type;\n return _this;\n }\n\n BrushView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n this.model;\n (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount();\n };\n\n BrushView.prototype.render = function (brushModel, ecModel, api, payload) {\n this.model = brushModel;\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateTransform = function (brushModel, ecModel, api, payload) {\n // PENDING: `updateTransform` is a little tricky, whose layout need\n // to be calculate mandatorily and other stages will not be performed.\n // Take care the correctness of the logic. See #11754 .\n layoutCovers(ecModel);\n\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateVisual = function (brushModel, ecModel, api, payload) {\n this.updateTransform(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype.updateView = function (brushModel, ecModel, api, payload) {\n this._updateController(brushModel, ecModel, api, payload);\n };\n\n BrushView.prototype._updateController = function (brushModel, ecModel, api, payload) {\n // Do not update controller when drawing.\n (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());\n }; // updateLayout: updateController,\n // updateVisual: updateController,\n\n\n BrushView.prototype.dispose = function () {\n this._brushController.dispose();\n };\n\n BrushView.prototype._onBrush = function (eventParam) {\n var modelId = this.model.id;\n var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel); // Action is not dispatched on drag end, because the drag end\n // emits the same params with the last drag move event, and\n // may have some delay when using touch pad, which makes\n // animation not smooth (when using debounce).\n\n (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({\n type: 'brush',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n eventParam.isEnd && this.api.dispatchAction({\n type: 'brushEnd',\n brushId: modelId,\n areas: zrUtil.clone(areas),\n $from: modelId\n });\n };\n\n BrushView.type = 'brush';\n return BrushView;\n}(ComponentView);\n\nexport default BrushView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport Model from '../../model/Model.js';\nimport ComponentModel from '../../model/Component.js';\nvar DEFAULT_OUT_OF_BRUSH_COLOR = '#ddd';\n\nvar BrushModel =\n/** @class */\nfunction (_super) {\n __extends(BrushModel, _super);\n\n function BrushModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = BrushModel.type;\n /**\r\n * @readOnly\r\n */\n\n _this.areas = [];\n /**\r\n * Current brush painting area settings.\r\n * @readOnly\r\n */\n\n _this.brushOption = {};\n return _this;\n }\n\n BrushModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, ['inBrush', 'outOfBrush']);\n var inBrush = thisOption.inBrush = thisOption.inBrush || {}; // Always give default visual, consider setOption at the second time.\n\n thisOption.outOfBrush = thisOption.outOfBrush || {\n color: DEFAULT_OUT_OF_BRUSH_COLOR\n };\n\n if (!inBrush.hasOwnProperty('liftZ')) {\n // Bigger than the highlight z lift, otherwise it will\n // be effected by the highlight z when brush.\n inBrush.liftZ = 5;\n }\n };\n /**\r\n * If `areas` is null/undefined, range state remain.\r\n */\n\n\n BrushModel.prototype.setAreas = function (areas) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(zrUtil.isArray(areas));\n zrUtil.each(areas, function (area) {\n zrUtil.assert(area.brushType, 'Illegal areas');\n });\n } // If areas is null/undefined, range state remain.\n // This helps user to dispatchAction({type: 'brush'}) with no areas\n // set but just want to get the current brush select info from a `brush` event.\n\n\n if (!areas) {\n return;\n }\n\n this.areas = zrUtil.map(areas, function (area) {\n return generateBrushOption(this.option, area);\n }, this);\n };\n /**\r\n * Set the current painting brush option.\r\n */\n\n\n BrushModel.prototype.setBrushOption = function (brushOption) {\n this.brushOption = generateBrushOption(this.option, brushOption);\n this.brushType = this.brushOption.brushType;\n };\n\n BrushModel.type = 'brush';\n BrushModel.dependencies = ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'];\n BrushModel.defaultOption = {\n seriesIndex: 'all',\n brushType: 'rect',\n brushMode: 'single',\n transformable: true,\n brushStyle: {\n borderWidth: 1,\n color: 'rgba(210,219,238,0.3)',\n borderColor: '#D2DBEE'\n },\n throttleType: 'fixRate',\n throttleDelay: 0,\n removeOnClick: true,\n z: 10000\n };\n return BrushModel;\n}(ComponentModel);\n\nfunction generateBrushOption(option, brushOption) {\n return zrUtil.merge({\n brushType: option.brushType,\n brushMode: option.brushMode,\n transformable: option.transformable,\n brushStyle: new Model(option.brushStyle).getItemStyle(),\n removeOnClick: option.removeOnClick,\n z: option.z\n }, brushOption, true);\n}\n\nexport default BrushModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { ToolboxFeature } from '../featureManager.js';\nvar ICON_TYPES = ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'];\n\nvar BrushFeature =\n/** @class */\nfunction (_super) {\n __extends(BrushFeature, _super);\n\n function BrushFeature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n BrushFeature.prototype.render = function (featureModel, ecModel, api) {\n var brushType;\n var brushMode;\n var isBrushed;\n ecModel.eachComponent({\n mainType: 'brush'\n }, function (brushModel) {\n brushType = brushModel.brushType;\n brushMode = brushModel.brushOption.brushMode || 'single';\n isBrushed = isBrushed || !!brushModel.areas.length;\n });\n this._brushType = brushType;\n this._brushMode = brushMode;\n zrUtil.each(featureModel.get('type', true), function (type) {\n featureModel.setIconStatus(type, (type === 'keep' ? brushMode === 'multiple' : type === 'clear' ? isBrushed : type === brushType) ? 'emphasis' : 'normal');\n });\n };\n\n BrushFeature.prototype.updateView = function (featureModel, ecModel, api) {\n this.render(featureModel, ecModel, api);\n };\n\n BrushFeature.prototype.getIcons = function () {\n var model = this.model;\n var availableIcons = model.get('icon', true);\n var icons = {};\n zrUtil.each(model.get('type', true), function (type) {\n if (availableIcons[type]) {\n icons[type] = availableIcons[type];\n }\n });\n return icons;\n };\n\n ;\n\n BrushFeature.prototype.onclick = function (ecModel, api, type) {\n var brushType = this._brushType;\n var brushMode = this._brushMode;\n\n if (type === 'clear') {\n // Trigger parallel action firstly\n api.dispatchAction({\n type: 'axisAreaSelect',\n intervals: []\n });\n api.dispatchAction({\n type: 'brush',\n command: 'clear',\n // Clear all areas of all brush components.\n areas: []\n });\n } else {\n api.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'brush',\n brushOption: {\n brushType: type === 'keep' ? brushType : brushType === type ? false : type,\n brushMode: type === 'keep' ? brushMode === 'multiple' ? 'single' : 'multiple' : brushMode\n }\n });\n }\n };\n\n ;\n\n BrushFeature.getDefaultOption = function (ecModel) {\n var defaultOption = {\n show: true,\n type: ICON_TYPES.slice(),\n icon: {\n /* eslint-disable */\n 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',\n 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',\n 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',\n 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',\n 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',\n 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\n\n /* eslint-enable */\n\n },\n // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`\n title: ecModel.getLocaleModel().get(['toolbox', 'brush', 'title'])\n };\n return defaultOption;\n };\n\n return BrushFeature;\n}(ToolboxFeature);\n\nexport default BrushFeature;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport brushPreprocessor from './preprocessor.js';\nimport BrushView from './BrushView.js';\nimport BrushModel from './BrushModel.js';\nimport brushVisual from './visualEncoding.js'; // TODO\n\nimport BrushFeature from '../toolbox/feature/Brush.js';\nimport { registerFeature } from '../toolbox/featureManager.js';\nimport { noop } from 'zrender/lib/core/util.js';\nexport function install(registers) {\n registers.registerComponentView(BrushView);\n registers.registerComponentModel(BrushModel);\n registers.registerPreprocessor(brushPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);\n registers.registerAction({\n type: 'brush',\n event: 'brush',\n update: 'updateVisual'\n }, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'brush',\n query: payload\n }, function (brushModel) {\n brushModel.setAreas(payload.areas);\n });\n });\n /**\r\n * payload: {\r\n * brushComponents: [\r\n * {\r\n * brushId,\r\n * brushIndex,\r\n * brushName,\r\n * series: [\r\n * {\r\n * seriesId,\r\n * seriesIndex,\r\n * seriesName,\r\n * rawIndices: [21, 34, ...]\r\n * },\r\n * ...\r\n * ]\r\n * },\r\n * ...\r\n * ]\r\n * }\r\n */\n\n registers.registerAction({\n type: 'brushSelect',\n event: 'brushSelected',\n update: 'none'\n }, noop);\n registers.registerAction({\n type: 'brushEnd',\n event: 'brushEnd',\n update: 'none'\n }, noop);\n registerFeature('brush', BrushFeature);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { getLayoutRect } from '../../util/layout.js';\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { windowOpen } from '../../util/format.js';\n\nvar TitleModel =\n/** @class */\nfunction (_super) {\n __extends(TitleModel, _super);\n\n function TitleModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleModel.type;\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n return _this;\n }\n\n TitleModel.type = 'title';\n TitleModel.defaultOption = {\n // zlevel: 0,\n z: 6,\n show: true,\n text: '',\n target: 'blank',\n subtext: '',\n subtarget: 'blank',\n left: 0,\n top: 0,\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n textStyle: {\n fontSize: 18,\n fontWeight: 'bold',\n color: '#464646'\n },\n subtextStyle: {\n fontSize: 12,\n color: '#6E7079'\n }\n };\n return TitleModel;\n}(ComponentModel); // View\n\n\nvar TitleView =\n/** @class */\nfunction (_super) {\n __extends(TitleView, _super);\n\n function TitleView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TitleView.type;\n return _this;\n }\n\n TitleView.prototype.render = function (titleModel, ecModel, api) {\n this.group.removeAll();\n\n if (!titleModel.get('show')) {\n return;\n }\n\n var group = this.group;\n var textStyleModel = titleModel.getModel('textStyle');\n var subtextStyleModel = titleModel.getModel('subtextStyle');\n var textAlign = titleModel.get('textAlign');\n var textVerticalAlign = zrUtil.retrieve2(titleModel.get('textBaseline'), titleModel.get('textVerticalAlign'));\n var textEl = new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: titleModel.get('text'),\n fill: textStyleModel.getTextColor()\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var textRect = textEl.getBoundingRect();\n var subText = titleModel.get('subtext');\n var subTextEl = new graphic.Text({\n style: createTextStyle(subtextStyleModel, {\n text: subText,\n fill: subtextStyleModel.getTextColor(),\n y: textRect.height + titleModel.get('itemGap'),\n verticalAlign: 'top'\n }, {\n disableBox: true\n }),\n z2: 10\n });\n var link = titleModel.get('link');\n var sublink = titleModel.get('sublink');\n var triggerEvent = titleModel.get('triggerEvent', true);\n textEl.silent = !link && !triggerEvent;\n subTextEl.silent = !sublink && !triggerEvent;\n\n if (link) {\n textEl.on('click', function () {\n windowOpen(link, '_' + titleModel.get('target'));\n });\n }\n\n if (sublink) {\n subTextEl.on('click', function () {\n windowOpen(sublink, '_' + titleModel.get('subtarget'));\n });\n }\n\n getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent ? {\n componentType: 'title',\n componentIndex: titleModel.componentIndex\n } : null;\n group.add(textEl);\n subText && group.add(subTextEl); // If no subText, but add subTextEl, there will be an empty line.\n\n var groupRect = group.getBoundingRect();\n var layoutOption = titleModel.getBoxLayoutParams();\n layoutOption.width = groupRect.width;\n layoutOption.height = groupRect.height;\n var layoutRect = getLayoutRect(layoutOption, {\n width: api.getWidth(),\n height: api.getHeight()\n }, titleModel.get('padding')); // Adjust text align based on position\n\n if (!textAlign) {\n // Align left if title is on the left. center and right is same\n textAlign = titleModel.get('left') || titleModel.get('right'); // @ts-ignore\n\n if (textAlign === 'middle') {\n textAlign = 'center';\n } // Adjust layout by text align\n\n\n if (textAlign === 'right') {\n layoutRect.x += layoutRect.width;\n } else if (textAlign === 'center') {\n layoutRect.x += layoutRect.width / 2;\n }\n }\n\n if (!textVerticalAlign) {\n textVerticalAlign = titleModel.get('top') || titleModel.get('bottom'); // @ts-ignore\n\n if (textVerticalAlign === 'center') {\n textVerticalAlign = 'middle';\n }\n\n if (textVerticalAlign === 'bottom') {\n layoutRect.y += layoutRect.height;\n } else if (textVerticalAlign === 'middle') {\n layoutRect.y += layoutRect.height / 2;\n }\n\n textVerticalAlign = textVerticalAlign || 'top';\n }\n\n group.x = layoutRect.x;\n group.y = layoutRect.y;\n group.markRedraw();\n var alignStyle = {\n align: textAlign,\n verticalAlign: textVerticalAlign\n };\n textEl.setStyle(alignStyle);\n subTextEl.setStyle(alignStyle); // Render background\n // Get groupRect again because textAlign has been changed\n\n groupRect = group.getBoundingRect();\n var padding = layoutRect.margin;\n var style = titleModel.getItemStyle(['color', 'opacity']);\n style.fill = titleModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: groupRect.x - padding[3],\n y: groupRect.y - padding[0],\n width: groupRect.width + padding[1] + padding[3],\n height: groupRect.height + padding[0] + padding[2],\n r: titleModel.get('borderRadius')\n },\n style: style,\n subPixelOptimize: true,\n silent: true\n });\n group.add(rect);\n };\n\n TitleView.type = 'title';\n return TitleView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(TitleModel);\n registers.registerComponentView(TitleView);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport { each, isObject, clone } from 'zrender/lib/core/util.js';\nimport { convertOptionIdName, getDataItemValue } from '../../util/model.js';\n\nvar TimelineModel =\n/** @class */\nfunction (_super) {\n __extends(TimelineModel, _super);\n\n function TimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineModel.type;\n _this.layoutMode = 'box';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._initData();\n };\n /**\r\n * @override\r\n */\n\n\n TimelineModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n this._initData();\n };\n\n TimelineModel.prototype.setCurrentIndex = function (currentIndex) {\n if (currentIndex == null) {\n currentIndex = this.option.currentIndex;\n }\n\n var count = this._data.count();\n\n if (this.option.loop) {\n currentIndex = (currentIndex % count + count) % count;\n } else {\n currentIndex >= count && (currentIndex = count - 1);\n currentIndex < 0 && (currentIndex = 0);\n }\n\n this.option.currentIndex = currentIndex;\n };\n /**\r\n * @return {number} currentIndex\r\n */\n\n\n TimelineModel.prototype.getCurrentIndex = function () {\n return this.option.currentIndex;\n };\n /**\r\n * @return {boolean}\r\n */\n\n\n TimelineModel.prototype.isIndexMax = function () {\n return this.getCurrentIndex() >= this._data.count() - 1;\n };\n /**\r\n * @param {boolean} state true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.setPlayState = function (state) {\n this.option.autoPlay = !!state;\n };\n /**\r\n * @return {boolean} true: play, false: stop\r\n */\n\n\n TimelineModel.prototype.getPlayState = function () {\n return !!this.option.autoPlay;\n };\n /**\r\n * @private\r\n */\n\n\n TimelineModel.prototype._initData = function () {\n var thisOption = this.option;\n var dataArr = thisOption.data || [];\n var axisType = thisOption.axisType;\n var names = this._names = [];\n var processedDataArr;\n\n if (axisType === 'category') {\n processedDataArr = [];\n each(dataArr, function (item, index) {\n var value = convertOptionIdName(getDataItemValue(item), '');\n var newItem;\n\n if (isObject(item)) {\n newItem = clone(item);\n newItem.value = index;\n } else {\n newItem = index;\n }\n\n processedDataArr.push(newItem);\n names.push(value);\n });\n } else {\n processedDataArr = dataArr;\n }\n\n var dimType = {\n category: 'ordinal',\n time: 'time',\n value: 'number'\n }[axisType] || 'number';\n var data = this._data = new SeriesData([{\n name: 'value',\n type: dimType\n }], this);\n data.initData(processedDataArr, names);\n };\n\n TimelineModel.prototype.getData = function () {\n return this._data;\n };\n /**\r\n * @public\r\n * @return {Array.} categoreis\r\n */\n\n\n TimelineModel.prototype.getCategories = function () {\n if (this.get('axisType') === 'category') {\n return this._names.slice();\n }\n };\n\n TimelineModel.type = 'timeline';\n /**\r\n * @protected\r\n */\n\n TimelineModel.defaultOption = {\n // zlevel: 0, // 一级层叠\n z: 4,\n show: true,\n axisType: 'time',\n realtime: true,\n left: '20%',\n top: null,\n right: '20%',\n bottom: 0,\n width: null,\n height: 40,\n padding: 5,\n controlPosition: 'left',\n autoPlay: false,\n rewind: false,\n loop: true,\n playInterval: 2000,\n currentIndex: 0,\n itemStyle: {},\n label: {\n color: '#000'\n },\n data: []\n };\n return TimelineModel;\n}(ComponentModel);\n\nexport default TimelineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport TimelineModel from './TimelineModel.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport { mixin } from 'zrender/lib/core/util.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar SliderTimelineModel =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineModel, _super);\n\n function SliderTimelineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineModel.type;\n return _this;\n }\n\n SliderTimelineModel.type = 'timeline.slider';\n /**\r\n * @protected\r\n */\n\n SliderTimelineModel.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderWidth: 0,\n orient: 'horizontal',\n inverse: false,\n tooltip: {\n trigger: 'item' // data item may also have tootip attr.\n\n },\n symbol: 'circle',\n symbolSize: 12,\n lineStyle: {\n show: true,\n width: 2,\n color: '#DAE1F5'\n },\n label: {\n position: 'auto',\n // When using number, label position is not\n // restricted by viewRect.\n // positive: right/bottom, negative: left/top\n show: true,\n interval: 'auto',\n rotate: 0,\n // formatter: null,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#A4B1D7'\n },\n itemStyle: {\n color: '#A4B1D7',\n borderWidth: 1\n },\n checkpointStyle: {\n symbol: 'circle',\n symbolSize: 15,\n color: '#316bf3',\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0, 0, 0, 0.3)',\n // borderColor: 'rgba(194,53,49, 0.5)',\n animation: true,\n animationDuration: 300,\n animationEasing: 'quinticInOut'\n },\n controlStyle: {\n show: true,\n showPlayBtn: true,\n showPrevBtn: true,\n showNextBtn: true,\n itemSize: 24,\n itemGap: 12,\n position: 'left',\n 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',\n 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',\n // eslint-disable-next-line max-len\n nextIcon: 'M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z',\n // eslint-disable-next-line max-len\n prevIcon: 'M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z',\n prevBtnSize: 18,\n nextBtnSize: 18,\n color: '#A4B1D7',\n borderColor: '#A4B1D7',\n borderWidth: 1\n },\n emphasis: {\n label: {\n show: true,\n // 其余属性默认使用全局文本样式,详见TEXTSTYLE\n color: '#6f778d'\n },\n itemStyle: {\n color: '#316BF3'\n },\n controlStyle: {\n color: '#316BF3',\n borderColor: '#316BF3',\n borderWidth: 2\n }\n },\n progress: {\n lineStyle: {\n color: '#316BF3'\n },\n itemStyle: {\n color: '#316BF3'\n },\n label: {\n color: '#6f778d'\n }\n },\n data: []\n });\n return SliderTimelineModel;\n}(TimelineModel);\n\nmixin(SliderTimelineModel, DataFormatMixin.prototype);\nexport default SliderTimelineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\n\nvar TimelineView =\n/** @class */\nfunction (_super) {\n __extends(TimelineView, _super);\n\n function TimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = TimelineView.type;\n return _this;\n }\n\n TimelineView.type = 'timeline';\n return TimelineView;\n}(ComponentView);\n\nexport default TimelineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../../coord/Axis.js';\n/**\r\n * Extend axis 2d\r\n */\n\nvar TimelineAxis =\n/** @class */\nfunction (_super) {\n __extends(TimelineAxis, _super);\n\n function TimelineAxis(dim, scale, coordExtent, axisType) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n TimelineAxis.prototype.getLabelModel = function () {\n // Force override\n return this.model.getModel('label');\n };\n /**\r\n * @override\r\n */\n\n\n TimelineAxis.prototype.isHorizontal = function () {\n return this.model.get('orient') === 'horizontal';\n };\n\n return TimelineAxis;\n}(Axis);\n\nexport default TimelineAxis;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect.js';\nimport * as matrix from 'zrender/lib/core/matrix.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport * as layout from '../../util/layout.js';\nimport TimelineView from './TimelineView.js';\nimport TimelineAxis from './TimelineAxis.js';\nimport { createSymbol, normalizeSymbolOffset, normalizeSymbolSize } from '../../util/symbol.js';\nimport * as numberUtil from '../../util/number.js';\nimport { merge, each, extend, isString, bind, defaults, retrieve2 } from 'zrender/lib/core/util.js';\nimport OrdinalScale from '../../scale/Ordinal.js';\nimport TimeScale from '../../scale/Time.js';\nimport IntervalScale from '../../scale/Interval.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { makeInner } from '../../util/model.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\nvar PI = Math.PI;\nvar labelDataIndexStore = makeInner();\n\nvar SliderTimelineView =\n/** @class */\nfunction (_super) {\n __extends(SliderTimelineView, _super);\n\n function SliderTimelineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderTimelineView.type;\n return _this;\n }\n\n SliderTimelineView.prototype.init = function (ecModel, api) {\n this.api = api;\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.render = function (timelineModel, ecModel, api) {\n this.model = timelineModel;\n this.api = api;\n this.ecModel = ecModel;\n this.group.removeAll();\n\n if (timelineModel.get('show', true)) {\n var layoutInfo_1 = this._layout(timelineModel, api);\n\n var mainGroup_1 = this._createGroup('_mainGroup');\n\n var labelGroup = this._createGroup('_labelGroup');\n\n var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);\n\n timelineModel.formatTooltip = function (dataIndex) {\n var name = axis_1.scale.getLabel({\n value: dataIndex\n });\n return createTooltipMarkup('nameValue', {\n noName: true,\n value: name\n });\n };\n\n each(['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'], function (name) {\n this['_render' + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);\n }, this);\n\n this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);\n\n this._position(layoutInfo_1, timelineModel);\n }\n\n this._doPlayStop();\n\n this._updateTicksStatus();\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.remove = function () {\n this._clearTimer();\n\n this.group.removeAll();\n };\n /**\r\n * @override\r\n */\n\n\n SliderTimelineView.prototype.dispose = function () {\n this._clearTimer();\n };\n\n SliderTimelineView.prototype._layout = function (timelineModel, api) {\n var labelPosOpt = timelineModel.get(['label', 'position']);\n var orient = timelineModel.get('orient');\n var viewRect = getViewRect(timelineModel, api);\n var parsedLabelPos; // Auto label offset.\n\n if (labelPosOpt == null || labelPosOpt === 'auto') {\n parsedLabelPos = orient === 'horizontal' ? viewRect.y + viewRect.height / 2 < api.getHeight() / 2 ? '-' : '+' : viewRect.x + viewRect.width / 2 < api.getWidth() / 2 ? '+' : '-';\n } else if (isString(labelPosOpt)) {\n parsedLabelPos = {\n horizontal: {\n top: '-',\n bottom: '+'\n },\n vertical: {\n left: '-',\n right: '+'\n }\n }[orient][labelPosOpt];\n } else {\n // is number\n parsedLabelPos = labelPosOpt;\n }\n\n var labelAlignMap = {\n horizontal: 'center',\n vertical: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'left' : 'right'\n };\n var labelBaselineMap = {\n horizontal: parsedLabelPos >= 0 || parsedLabelPos === '+' ? 'top' : 'bottom',\n vertical: 'middle'\n };\n var rotationMap = {\n horizontal: 0,\n vertical: PI / 2\n }; // Position\n\n var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;\n var controlModel = timelineModel.getModel('controlStyle');\n var showControl = controlModel.get('show', true);\n var controlSize = showControl ? controlModel.get('itemSize') : 0;\n var controlGap = showControl ? controlModel.get('itemGap') : 0;\n var sizePlusGap = controlSize + controlGap; // Special label rotate.\n\n var labelRotation = timelineModel.get(['label', 'rotate']) || 0;\n labelRotation = labelRotation * PI / 180; // To radian.\n\n var playPosition;\n var prevBtnPosition;\n var nextBtnPosition;\n var controlPosition = controlModel.get('position', true);\n var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);\n var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);\n var showNextBtn = showControl && controlModel.get('showNextBtn', true);\n var xLeft = 0;\n var xRight = mainLength; // position[0] means left, position[1] means middle.\n\n if (controlPosition === 'left' || controlPosition === 'bottom') {\n showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);\n showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n } else {\n // 'top' 'right'\n showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);\n showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);\n }\n\n var axisExtent = [xLeft, xRight];\n\n if (timelineModel.get('inverse')) {\n axisExtent.reverse();\n }\n\n return {\n viewRect: viewRect,\n mainLength: mainLength,\n orient: orient,\n rotation: rotationMap[orient],\n labelRotation: labelRotation,\n labelPosOpt: parsedLabelPos,\n labelAlign: timelineModel.get(['label', 'align']) || labelAlignMap[orient],\n labelBaseline: timelineModel.get(['label', 'verticalAlign']) || timelineModel.get(['label', 'baseline']) || labelBaselineMap[orient],\n // Based on mainGroup.\n playPosition: playPosition,\n prevBtnPosition: prevBtnPosition,\n nextBtnPosition: nextBtnPosition,\n axisExtent: axisExtent,\n controlSize: controlSize,\n controlGap: controlGap\n };\n };\n\n SliderTimelineView.prototype._position = function (layoutInfo, timelineModel) {\n // Position is be called finally, because bounding rect is needed for\n // adapt content to fill viewRect (auto adapt offset).\n // Timeline may be not all in the viewRect when 'offset' is specified\n // as a number, because it is more appropriate that label aligns at\n // 'offset' but not the other edge defined by viewRect.\n var mainGroup = this._mainGroup;\n var labelGroup = this._labelGroup;\n var viewRect = layoutInfo.viewRect;\n\n if (layoutInfo.orient === 'vertical') {\n // transform to horizontal, inverse rotate by left-top point.\n var m = matrix.create();\n var rotateOriginX = viewRect.x;\n var rotateOriginY = viewRect.y + viewRect.height;\n matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);\n matrix.rotate(m, m, -PI / 2);\n matrix.translate(m, m, [rotateOriginX, rotateOriginY]);\n viewRect = viewRect.clone();\n viewRect.applyTransform(m);\n }\n\n var viewBound = getBound(viewRect);\n var mainBound = getBound(mainGroup.getBoundingRect());\n var labelBound = getBound(labelGroup.getBoundingRect());\n var mainPosition = [mainGroup.x, mainGroup.y];\n var labelsPosition = [labelGroup.x, labelGroup.y];\n labelsPosition[0] = mainPosition[0] = viewBound[0][0];\n var labelPosOpt = layoutInfo.labelPosOpt;\n\n if (labelPosOpt == null || isString(labelPosOpt)) {\n // '+' or '-'\n var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);\n } else {\n var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;\n toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);\n labelsPosition[1] = mainPosition[1] + labelPosOpt;\n }\n\n mainGroup.setPosition(mainPosition);\n labelGroup.setPosition(labelsPosition);\n mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;\n setOrigin(mainGroup);\n setOrigin(labelGroup);\n\n function setOrigin(targetGroup) {\n targetGroup.originX = viewBound[0][0] - targetGroup.x;\n targetGroup.originY = viewBound[1][0] - targetGroup.y;\n }\n\n function getBound(rect) {\n // [[xmin, xmax], [ymin, ymax]]\n return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];\n }\n\n function toBound(fromPos, from, to, dimIdx, boundIdx) {\n fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];\n }\n };\n\n SliderTimelineView.prototype._createAxis = function (layoutInfo, timelineModel) {\n var data = timelineModel.getData();\n var axisType = timelineModel.get('axisType');\n var scale = createScaleByModel(timelineModel, axisType); // Customize scale. The `tickValue` is `dataIndex`.\n\n scale.getTicks = function () {\n return data.mapArray(['value'], function (value) {\n return {\n value: value\n };\n });\n };\n\n var dataExtent = data.getDataExtent('value');\n scale.setExtent(dataExtent[0], dataExtent[1]);\n scale.calcNiceTicks();\n var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);\n axis.model = timelineModel;\n return axis;\n };\n\n SliderTimelineView.prototype._createGroup = function (key) {\n var newGroup = this[key] = new graphic.Group();\n this.group.add(newGroup);\n return newGroup;\n };\n\n SliderTimelineView.prototype._renderAxisLine = function (layoutInfo, group, axis, timelineModel) {\n var axisExtent = axis.getExtent();\n\n if (!timelineModel.get(['lineStyle', 'show'])) {\n return;\n }\n\n var line = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n y1: 0,\n x2: axisExtent[1],\n y2: 0\n },\n style: extend({\n lineCap: 'round'\n }, timelineModel.getModel('lineStyle').getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(line);\n var progressLine = this._progressLine = new graphic.Line({\n shape: {\n x1: axisExtent[0],\n x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],\n y1: 0,\n y2: 0\n },\n style: defaults({\n lineCap: 'round',\n lineWidth: line.style.lineWidth\n }, timelineModel.getModel(['progress', 'lineStyle']).getLineStyle()),\n silent: true,\n z2: 1\n });\n group.add(progressLine);\n };\n\n SliderTimelineView.prototype._renderAxisTick = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var data = timelineModel.getData(); // Show all ticks, despite ignoring strategy.\n\n var ticks = axis.scale.getTicks();\n this._tickSymbols = []; // The value is dataIndex, see the customized scale.\n\n each(ticks, function (tick) {\n var tickCoord = axis.dataToCoord(tick.value);\n var itemModel = data.getItemModel(tick.value);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var hoverStyleModel = itemModel.getModel(['emphasis', 'itemStyle']);\n var progressStyleModel = itemModel.getModel(['progress', 'itemStyle']);\n var symbolOpt = {\n x: tickCoord,\n y: 0,\n onclick: bind(_this._changeTimeline, _this, tick.value)\n };\n var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);\n el.ensureState('emphasis').style = hoverStyleModel.getItemStyle();\n el.ensureState('progress').style = progressStyleModel.getItemStyle();\n enableHoverEmphasis(el);\n var ecData = getECData(el);\n\n if (itemModel.get('tooltip')) {\n ecData.dataIndex = tick.value;\n ecData.dataModel = timelineModel;\n } else {\n ecData.dataIndex = ecData.dataModel = null;\n }\n\n _this._tickSymbols.push(el);\n });\n };\n\n SliderTimelineView.prototype._renderAxisLabel = function (layoutInfo, group, axis, timelineModel) {\n var _this = this;\n\n var labelModel = axis.getLabelModel();\n\n if (!labelModel.get('show')) {\n return;\n }\n\n var data = timelineModel.getData();\n var labels = axis.getViewLabels();\n this._tickLabels = [];\n each(labels, function (labelItem) {\n // The tickValue is dataIndex, see the customized scale.\n var dataIndex = labelItem.tickValue;\n var itemModel = data.getItemModel(dataIndex);\n var normalLabelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel(['emphasis', 'label']);\n var progressLabelModel = itemModel.getModel(['progress', 'label']);\n var tickCoord = axis.dataToCoord(labelItem.tickValue);\n var textEl = new graphic.Text({\n x: tickCoord,\n y: 0,\n rotation: layoutInfo.labelRotation - layoutInfo.rotation,\n onclick: bind(_this._changeTimeline, _this, dataIndex),\n silent: false,\n style: createTextStyle(normalLabelModel, {\n text: labelItem.formattedLabel,\n align: layoutInfo.labelAlign,\n verticalAlign: layoutInfo.labelBaseline\n })\n });\n textEl.ensureState('emphasis').style = createTextStyle(hoverLabelModel);\n textEl.ensureState('progress').style = createTextStyle(progressLabelModel);\n group.add(textEl);\n enableHoverEmphasis(textEl);\n labelDataIndexStore(textEl).dataIndex = dataIndex;\n\n _this._tickLabels.push(textEl);\n });\n };\n\n SliderTimelineView.prototype._renderControl = function (layoutInfo, group, axis, timelineModel) {\n var controlSize = layoutInfo.controlSize;\n var rotation = layoutInfo.rotation;\n var itemStyle = timelineModel.getModel('controlStyle').getItemStyle();\n var hoverStyle = timelineModel.getModel(['emphasis', 'controlStyle']).getItemStyle();\n var playState = timelineModel.getPlayState();\n var inverse = timelineModel.get('inverse', true);\n makeBtn(layoutInfo.nextBtnPosition, 'next', bind(this._changeTimeline, this, inverse ? '-' : '+'));\n makeBtn(layoutInfo.prevBtnPosition, 'prev', bind(this._changeTimeline, this, inverse ? '+' : '-'));\n makeBtn(layoutInfo.playPosition, playState ? 'stop' : 'play', bind(this._handlePlayClick, this, !playState), true);\n\n function makeBtn(position, iconName, onclick, willRotate) {\n if (!position) {\n return;\n }\n\n var iconSize = parsePercent(retrieve2(timelineModel.get(['controlStyle', iconName + 'BtnSize']), controlSize), controlSize);\n var rect = [0, -iconSize / 2, iconSize, iconSize];\n var btn = makeControlIcon(timelineModel, iconName + 'Icon', rect, {\n x: position[0],\n y: position[1],\n originX: controlSize / 2,\n originY: 0,\n rotation: willRotate ? -rotation : 0,\n rectHover: true,\n style: itemStyle,\n onclick: onclick\n });\n btn.ensureState('emphasis').style = hoverStyle;\n group.add(btn);\n enableHoverEmphasis(btn);\n }\n };\n\n SliderTimelineView.prototype._renderCurrentPointer = function (layoutInfo, group, axis, timelineModel) {\n var data = timelineModel.getData();\n var currentIndex = timelineModel.getCurrentIndex();\n var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');\n var me = this;\n var callback = {\n onCreate: function (pointer) {\n pointer.draggable = true;\n pointer.drift = bind(me._handlePointerDrag, me);\n pointer.ondragend = bind(me._handlePointerDragend, me);\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel, true);\n },\n onUpdate: function (pointer) {\n pointerMoveTo(pointer, me._progressLine, currentIndex, axis, timelineModel);\n }\n }; // Reuse when exists, for animation and drag.\n\n this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);\n };\n\n SliderTimelineView.prototype._handlePlayClick = function (nextState) {\n this._clearTimer();\n\n this.api.dispatchAction({\n type: 'timelinePlayChange',\n playState: nextState,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._handlePointerDrag = function (dx, dy, e) {\n this._clearTimer();\n\n this._pointerChangeTimeline([e.offsetX, e.offsetY]);\n };\n\n SliderTimelineView.prototype._handlePointerDragend = function (e) {\n this._pointerChangeTimeline([e.offsetX, e.offsetY], true);\n };\n\n SliderTimelineView.prototype._pointerChangeTimeline = function (mousePos, trigger) {\n var toCoord = this._toAxisCoord(mousePos)[0];\n\n var axis = this._axis;\n var axisExtent = numberUtil.asc(axis.getExtent().slice());\n toCoord > axisExtent[1] && (toCoord = axisExtent[1]);\n toCoord < axisExtent[0] && (toCoord = axisExtent[0]);\n this._currentPointer.x = toCoord;\n\n this._currentPointer.markRedraw();\n\n var progressLine = this._progressLine;\n\n if (progressLine) {\n progressLine.shape.x2 = toCoord;\n progressLine.dirty();\n }\n\n var targetDataIndex = this._findNearestTick(toCoord);\n\n var timelineModel = this.model;\n\n if (trigger || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get('realtime')) {\n this._changeTimeline(targetDataIndex);\n }\n };\n\n SliderTimelineView.prototype._doPlayStop = function () {\n var _this = this;\n\n this._clearTimer();\n\n if (this.model.getPlayState()) {\n this._timer = setTimeout(function () {\n // Do not cache\n var timelineModel = _this.model;\n\n _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get('rewind', true) ? -1 : 1));\n }, this.model.get('playInterval'));\n }\n };\n\n SliderTimelineView.prototype._toAxisCoord = function (vertex) {\n var trans = this._mainGroup.getLocalTransform();\n\n return graphic.applyTransform(vertex, trans, true);\n };\n\n SliderTimelineView.prototype._findNearestTick = function (axisCoord) {\n var data = this.model.getData();\n var dist = Infinity;\n var targetDataIndex;\n var axis = this._axis;\n data.each(['value'], function (value, dataIndex) {\n var coord = axis.dataToCoord(value);\n var d = Math.abs(coord - axisCoord);\n\n if (d < dist) {\n dist = d;\n targetDataIndex = dataIndex;\n }\n });\n return targetDataIndex;\n };\n\n SliderTimelineView.prototype._clearTimer = function () {\n if (this._timer) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n };\n\n SliderTimelineView.prototype._changeTimeline = function (nextIndex) {\n var currentIndex = this.model.getCurrentIndex();\n\n if (nextIndex === '+') {\n nextIndex = currentIndex + 1;\n } else if (nextIndex === '-') {\n nextIndex = currentIndex - 1;\n }\n\n this.api.dispatchAction({\n type: 'timelineChange',\n currentIndex: nextIndex,\n from: this.uid\n });\n };\n\n SliderTimelineView.prototype._updateTicksStatus = function () {\n var currentIndex = this.model.getCurrentIndex();\n var tickSymbols = this._tickSymbols;\n var tickLabels = this._tickLabels;\n\n if (tickSymbols) {\n for (var i = 0; i < tickSymbols.length; i++) {\n tickSymbols && tickSymbols[i] && tickSymbols[i].toggleState('progress', i < currentIndex);\n }\n }\n\n if (tickLabels) {\n for (var i = 0; i < tickLabels.length; i++) {\n tickLabels && tickLabels[i] && tickLabels[i].toggleState('progress', labelDataIndexStore(tickLabels[i]).dataIndex <= currentIndex);\n }\n }\n };\n\n SliderTimelineView.type = 'timeline.slider';\n return SliderTimelineView;\n}(TimelineView);\n\nfunction createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // default to be value\n return new IntervalScale();\n }\n }\n}\n\nfunction getViewRect(model, api) {\n return layout.getLayoutRect(model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n }, model.get('padding'));\n}\n\nfunction makeControlIcon(timelineModel, objPath, rect, opts) {\n var style = opts.style;\n var icon = graphic.createIcon(timelineModel.get(['controlStyle', objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3])); // TODO createIcon won't use style in opt.\n\n if (style) {\n icon.setStyle(style);\n }\n\n return icon;\n}\n/**\r\n * Create symbol or update symbol\r\n * opt: basic position and event handlers\r\n */\n\n\nfunction giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {\n var color = itemStyleModel.get('color');\n\n if (!symbol) {\n var symbolType = hostModel.get('symbol');\n symbol = createSymbol(symbolType, -1, -1, 2, 2, color);\n symbol.setStyle('strokeNoScale', true);\n group.add(symbol);\n callback && callback.onCreate(symbol);\n } else {\n symbol.setColor(color);\n group.add(symbol); // Group may be new, also need to add.\n\n callback && callback.onUpdate(symbol);\n } // Style\n\n\n var itemStyle = itemStyleModel.getItemStyle(['color']);\n symbol.setStyle(itemStyle); // Transform and events.\n\n opt = merge({\n rectHover: true,\n z2: 100\n }, opt, true);\n var symbolSize = normalizeSymbolSize(hostModel.get('symbolSize'));\n opt.scaleX = symbolSize[0] / 2;\n opt.scaleY = symbolSize[1] / 2;\n var symbolOffset = normalizeSymbolOffset(hostModel.get('symbolOffset'), symbolSize);\n\n if (symbolOffset) {\n opt.x = (opt.x || 0) + symbolOffset[0];\n opt.y = (opt.y || 0) + symbolOffset[1];\n }\n\n var symbolRotate = hostModel.get('symbolRotate');\n opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;\n symbol.attr(opt); // FIXME\n // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed,\n // getBoundingRect will return wrong result.\n // (This is supposed to be resolved in zrender, but it is a little difficult to\n // leverage performance and auto updateTransform)\n // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol.\n\n symbol.updateTransform();\n return symbol;\n}\n\nfunction pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {\n if (pointer.dragging) {\n return;\n }\n\n var pointerModel = timelineModel.getModel('checkpointStyle');\n var toCoord = axis.dataToCoord(timelineModel.getData().get('value', dataIndex));\n\n if (noAnimation || !pointerModel.get('animation', true)) {\n pointer.attr({\n x: toCoord,\n y: 0\n });\n progressLine && progressLine.attr({\n shape: {\n x2: toCoord\n }\n });\n } else {\n var animationCfg = {\n duration: pointerModel.get('animationDuration', true),\n easing: pointerModel.get('animationEasing', true)\n };\n pointer.stopAnimation(null, true);\n pointer.animateTo({\n x: toCoord,\n y: 0\n }, animationCfg);\n progressLine && progressLine.animateTo({\n shape: {\n x2: toCoord\n }\n }, animationCfg);\n }\n}\n\nexport default SliderTimelineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { defaults } from 'zrender/lib/core/util.js';\nexport function installTimelineAction(registers) {\n registers.registerAction({\n type: 'timelineChange',\n event: 'timelineChanged',\n update: 'prepareAndUpdate'\n }, function (payload, ecModel, api) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.currentIndex != null) {\n timelineModel.setCurrentIndex(payload.currentIndex);\n\n if (!timelineModel.get('loop', true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {\n timelineModel.setPlayState(false); // The timeline has played to the end, trigger event\n\n api.dispatchAction({\n type: 'timelinePlayChange',\n playState: false,\n from: payload.from\n });\n }\n } // Set normalized currentIndex to payload.\n\n\n ecModel.resetOption('timeline', {\n replaceMerge: timelineModel.get('replaceMerge', true)\n });\n return defaults({\n currentIndex: timelineModel.option.currentIndex\n }, payload);\n });\n registers.registerAction({\n type: 'timelinePlayChange',\n event: 'timelinePlayChanged',\n update: 'update'\n }, function (payload, ecModel) {\n var timelineModel = ecModel.getComponent('timeline');\n\n if (timelineModel && payload.playState != null) {\n timelineModel.setPlayState(payload.playState);\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function timelinePreprocessor(option) {\n var timelineOpt = option && option.timeline;\n\n if (!zrUtil.isArray(timelineOpt)) {\n timelineOpt = timelineOpt ? [timelineOpt] : [];\n }\n\n zrUtil.each(timelineOpt, function (opt) {\n if (!opt) {\n return;\n }\n\n compatibleEC2(opt);\n });\n}\n\nfunction compatibleEC2(opt) {\n var type = opt.type;\n var ec2Types = {\n 'number': 'value',\n 'time': 'time'\n }; // Compatible with ec2\n\n if (ec2Types[type]) {\n opt.axisType = ec2Types[type];\n delete opt.type;\n }\n\n transferItem(opt);\n\n if (has(opt, 'controlPosition')) {\n var controlStyle = opt.controlStyle || (opt.controlStyle = {});\n\n if (!has(controlStyle, 'position')) {\n controlStyle.position = opt.controlPosition;\n }\n\n if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {\n controlStyle.show = false;\n delete controlStyle.position;\n }\n\n delete opt.controlPosition;\n }\n\n zrUtil.each(opt.data || [], function (dataItem) {\n if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {\n if (!has(dataItem, 'value') && has(dataItem, 'name')) {\n // In ec2, using name as value.\n dataItem.value = dataItem.name;\n }\n\n transferItem(dataItem);\n }\n });\n}\n\nfunction transferItem(opt) {\n var itemStyle = opt.itemStyle || (opt.itemStyle = {});\n var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {}); // Transfer label out\n\n var label = opt.label || opt.label || {};\n var labelNormal = label.normal || (label.normal = {});\n var excludeLabelAttr = {\n normal: 1,\n emphasis: 1\n };\n zrUtil.each(label, function (value, name) {\n if (!excludeLabelAttr[name] && !has(labelNormal, name)) {\n labelNormal[name] = value;\n }\n });\n\n if (itemStyleEmphasis.label && !has(label, 'emphasis')) {\n label.emphasis = itemStyleEmphasis.label;\n delete itemStyleEmphasis.label;\n }\n}\n\nfunction has(obj, attr) {\n return obj.hasOwnProperty(attr);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport SliderTimelineModel from './SliderTimelineModel.js';\nimport SliderTimelineView from './SliderTimelineView.js';\nimport { installTimelineAction } from './timelineAction.js';\nimport preprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderTimelineModel);\n registers.registerComponentView(SliderTimelineView);\n registers.registerSubTypeDefaulter('timeline', function () {\n // Only slider now.\n return 'slider';\n });\n installTimelineAction(registers);\n registers.registerPreprocessor(preprocessor);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { isArray } from 'zrender/lib/core/util.js';\nexport default function checkMarkerInSeries(seriesOpts, markerType) {\n if (!seriesOpts) {\n return false;\n }\n\n var seriesOptArr = isArray(seriesOpts) ? seriesOpts : [seriesOpts];\n\n for (var idx = 0; idx < seriesOptArr.length; idx++) {\n if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {\n return true;\n }\n }\n\n return false;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport env from 'zrender/lib/core/env.js';\nimport { DataFormatMixin } from '../../model/mixin/dataFormat.js';\nimport ComponentModel from '../../model/Component.js';\nimport { makeInner, defaultEmphasis } from '../../util/model.js';\nimport { createTooltipMarkup } from '../tooltip/tooltipMarkup.js';\n\nfunction fillLabel(opt) {\n defaultEmphasis(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }\n\n\nvar inner = makeInner();\n\nvar MarkerModel =\n/** @class */\nfunction (_super) {\n __extends(MarkerModel, _super);\n\n function MarkerModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerModel.type;\n /**\r\n * If marker model is created by self from series\r\n */\n\n _this.createdBySelf = false;\n return _this;\n }\n /**\r\n * @overrite\r\n */\n\n\n MarkerModel.prototype.init = function (option, parentModel, ecModel) {\n if (process.env.NODE_ENV !== 'production') {\n if (this.type === 'marker') {\n throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.');\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel);\n\n this._mergeOption(option, ecModel, false, true);\n };\n\n MarkerModel.prototype.isAnimationEnabled = function () {\n if (env.node) {\n return false;\n }\n\n var hostSeries = this.__hostSeries;\n return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled();\n };\n /**\r\n * @overrite\r\n */\n\n\n MarkerModel.prototype.mergeOption = function (newOpt, ecModel) {\n this._mergeOption(newOpt, ecModel, false, false);\n };\n\n MarkerModel.prototype._mergeOption = function (newOpt, ecModel, createdBySelf, isInit) {\n var componentType = this.mainType;\n\n if (!createdBySelf) {\n ecModel.eachSeries(function (seriesModel) {\n // mainType can be markPoint, markLine, markArea\n var markerOpt = seriesModel.get(this.mainType, true);\n var markerModel = inner(seriesModel)[componentType];\n\n if (!markerOpt || !markerOpt.data) {\n inner(seriesModel)[componentType] = null;\n return;\n }\n\n if (!markerModel) {\n if (isInit) {\n // Default label emphasis `position` and `show`\n fillLabel(markerOpt);\n }\n\n zrUtil.each(markerOpt.data, function (item) {\n // FIXME Overwrite fillLabel method ?\n if (item instanceof Array) {\n fillLabel(item[0]);\n fillLabel(item[1]);\n } else {\n fillLabel(item);\n }\n });\n markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel); // markerModel = new ImplementedMarkerModel(\n // markerOpt, this, ecModel\n // );\n\n zrUtil.extend(markerModel, {\n mainType: this.mainType,\n // Use the same series index and name\n seriesIndex: seriesModel.seriesIndex,\n name: seriesModel.name,\n createdBySelf: true\n });\n markerModel.__hostSeries = seriesModel;\n } else {\n markerModel._mergeOption(markerOpt, ecModel, true);\n }\n\n inner(seriesModel)[componentType] = markerModel;\n }, this);\n }\n };\n\n MarkerModel.prototype.formatTooltip = function (dataIndex, multipleSeries, dataType) {\n var data = this.getData();\n var value = this.getRawValue(dataIndex);\n var itemName = data.getName(dataIndex);\n return createTooltipMarkup('section', {\n header: this.name,\n blocks: [createTooltipMarkup('nameValue', {\n name: itemName,\n value: value,\n noName: !itemName,\n noValue: value == null\n })]\n });\n };\n\n MarkerModel.prototype.getData = function () {\n return this._data;\n };\n\n MarkerModel.prototype.setData = function (data) {\n this._data = data;\n };\n\n MarkerModel.getMarkerModelFromSeries = function (seriesModel, // Support three types of markers. Strict check.\n componentType) {\n return inner(seriesModel)[componentType];\n };\n\n MarkerModel.type = 'marker';\n MarkerModel.dependencies = ['series', 'grid', 'polar', 'geo'];\n return MarkerModel;\n}(ComponentModel);\n\nzrUtil.mixin(MarkerModel, DataFormatMixin.prototype);\nexport default MarkerModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkPointModel =\n/** @class */\nfunction (_super) {\n __extends(MarkPointModel, _super);\n\n function MarkPointModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointModel.type;\n return _this;\n }\n\n MarkPointModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkPointModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkPointModel.type = 'markPoint';\n MarkPointModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: 'pin',\n symbolSize: 50,\n // symbolRotate: 0,\n // symbolOffset: [0, 0]\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'inside'\n },\n itemStyle: {\n borderWidth: 2\n },\n emphasis: {\n label: {\n show: true\n }\n }\n };\n return MarkPointModel;\n}(MarkerModel);\n\nexport default MarkPointModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as numberUtil from '../../util/number.js';\nimport { isDimensionStacked } from '../../data/helper/dataStackHelper.js';\nimport { indexOf, curry, clone, isArray } from 'zrender/lib/core/util.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\n\nfunction hasXOrY(item) {\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}\n\nfunction hasXAndY(item) {\n return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));\n}\n\nfunction markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {\n var coordArr = [];\n var stacked = isDimensionStacked(data, targetDataDim\n /* , otherDataDim */\n );\n var calcDataDim = stacked ? data.getCalculationInfo('stackResultDimension') : targetDataDim;\n var value = numCalculate(data, calcDataDim, markerType);\n var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];\n coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);\n coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);\n var coordArrValue = data.get(targetDataDim, dataIndex); // Make it simple, do not visit all stacked value to count precision.\n\n var precision = numberUtil.getPrecision(data.get(targetDataDim, dataIndex));\n precision = Math.min(precision, 20);\n\n if (precision >= 0) {\n coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);\n }\n\n return [coordArr, coordArrValue];\n} // TODO Specified percent\n\n\nvar markerTypeCalculator = {\n min: curry(markerTypeCalculatorWithExtent, 'min'),\n max: curry(markerTypeCalculatorWithExtent, 'max'),\n average: curry(markerTypeCalculatorWithExtent, 'average'),\n median: curry(markerTypeCalculatorWithExtent, 'median')\n};\n/**\r\n * Transform markPoint data item to format used in List by do the following\r\n * 1. Calculate statistic like `max`, `min`, `average`\r\n * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array\r\n */\n\nexport function dataTransform(seriesModel, item) {\n if (!item) {\n return;\n }\n\n var data = seriesModel.getData();\n var coordSys = seriesModel.coordinateSystem;\n var dims = coordSys && coordSys.dimensions; // 1. If not specify the position with pixel directly\n // 2. If `coord` is not a data array. Which uses `xAxis`,\n // `yAxis` to specify the coord on each dimension\n // parseFloat first because item.x and item.y can be percent string like '20%'\n\n if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) {\n var axisInfo = getAxisInfo(item, data, coordSys, seriesModel); // Clone the option\n // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value\n\n item = clone(item);\n\n if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {\n var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);\n var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);\n var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);\n item.coord = coordInfo[0]; // Force to use the value of calculated value.\n // let item use the value without stack.\n\n item.value = coordInfo[1];\n } else {\n // FIXME Only has one of xAxis and yAxis.\n item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];\n }\n } // x y is provided\n\n\n if (item.coord == null || !isArray(dims)) {\n item.coord = [];\n } else {\n // Each coord support max, min, average\n var coord = item.coord;\n\n for (var i = 0; i < 2; i++) {\n if (markerTypeCalculator[coord[i]]) {\n coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]);\n }\n }\n }\n\n return item;\n}\nexport function getAxisInfo(item, data, coordSys, seriesModel) {\n var ret = {};\n\n if (item.valueIndex != null || item.valueDim != null) {\n ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;\n ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));\n ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n } else {\n ret.baseAxis = seriesModel.getBaseAxis();\n ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);\n ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);\n ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);\n }\n\n return ret;\n}\n\nfunction dataDimToCoordDim(seriesModel, dataDim) {\n var dimItem = seriesModel.getData().getDimensionInfo(dataDim);\n return dimItem && dimItem.coordDim;\n}\n/**\r\n * Filter data which is out of coordinateSystem range\r\n * [dataFilter description]\r\n */\n\n\nexport function dataFilter( // Currently only polar and cartesian has containData.\ncoordSys, item) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;\n}\nexport function zoneFilter( // Currently only polar and cartesian has containData.\ncoordSys, item1, item2) {\n // Always return true if there is no coordSys\n return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;\n}\nexport function createMarkerDimValueGetter(inCoordSys, dims) {\n return inCoordSys ? function (item, dimName, dataIndex, dimIndex) {\n var rawVal = dimIndex < 2 // x, y, radius, angle\n ? item.coord && item.coord[dimIndex] : item.value;\n return parseDataValue(rawVal, dims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dims[dimIndex]);\n };\n}\nexport function numCalculate(data, valueDataDim, type) {\n if (type === 'average') {\n var sum_1 = 0;\n var count_1 = 0;\n data.each(valueDataDim, function (val, idx) {\n if (!isNaN(val)) {\n sum_1 += val;\n count_1++;\n }\n });\n return sum_1 / count_1;\n } else if (type === 'median') {\n return data.getMedian(valueDataDim);\n } else {\n // max & min\n return data.getDataExtent(valueDataDim)[type === 'max' ? 1 : 0];\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport ComponentView from '../../view/Component.js';\nimport { createHashMap, each } from 'zrender/lib/core/util.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { enterBlur, leaveBlur } from '../../util/states.js';\nvar inner = makeInner();\n\nvar MarkerView =\n/** @class */\nfunction (_super) {\n __extends(MarkerView, _super);\n\n function MarkerView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkerView.type;\n return _this;\n }\n\n MarkerView.prototype.init = function () {\n this.markerGroupMap = createHashMap();\n };\n\n MarkerView.prototype.render = function (markerModel, ecModel, api) {\n var _this = this;\n\n var markerGroupMap = this.markerGroupMap;\n markerGroupMap.each(function (item) {\n inner(item).keep = false;\n });\n ecModel.eachSeries(function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n markerModel && _this.renderSeries(seriesModel, markerModel, ecModel, api);\n });\n markerGroupMap.each(function (item) {\n !inner(item).keep && _this.group.remove(item.group);\n });\n };\n\n MarkerView.prototype.markKeep = function (drawGroup) {\n inner(drawGroup).keep = true;\n };\n\n MarkerView.prototype.toggleBlurSeries = function (seriesModelList, isBlur) {\n var _this = this;\n\n each(seriesModelList, function (seriesModel) {\n var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);\n\n if (markerModel) {\n var data = markerModel.getData();\n data.eachItemGraphicEl(function (el) {\n if (el) {\n isBlur ? enterBlur(el) : leaveBlur(el);\n }\n });\n }\n });\n };\n\n MarkerView.type = 'marker';\n return MarkerView;\n}(ComponentView);\n\nexport default MarkerView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SymbolDraw from '../../chart/helper/SymbolDraw.js';\nimport * as numberUtil from '../../util/number.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isFunction, map, filter, curry, extend } from 'zrender/lib/core/util.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { getVisualFromData } from '../../visual/helper.js';\n\nfunction updateMarkerLayout(mpData, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } // Chart like bar may have there own marker positioning logic\n else if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));\n } else if (coordSys) {\n var x = mpData.get(coordSys.dimensions[0], idx);\n var y = mpData.get(coordSys.dimensions[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n\n mpData.setItemLayout(idx, point);\n });\n}\n\nvar MarkPointView =\n/** @class */\nfunction (_super) {\n __extends(MarkPointView, _super);\n\n function MarkPointView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkPointView.type;\n return _this;\n }\n\n MarkPointView.prototype.updateTransform = function (markPointModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markPoint');\n\n if (mpModel) {\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkPointView.prototype.renderSeries = function (seriesModel, mpModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var symbolDrawMap = this.markerGroupMap;\n var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());\n var mpData = createData(coordSys, seriesModel, mpModel); // FIXME\n\n mpModel.setData(mpData);\n updateMarkerLayout(mpModel.getData(), seriesModel, api);\n mpData.each(function (idx) {\n var itemModel = mpData.getItemModel(idx);\n var symbol = itemModel.getShallow('symbol');\n var symbolSize = itemModel.getShallow('symbolSize');\n var symbolRotate = itemModel.getShallow('symbolRotate');\n var symbolOffset = itemModel.getShallow('symbolOffset');\n var symbolKeepAspect = itemModel.getShallow('symbolKeepAspect'); // TODO: refactor needed: single data item should not support callback function\n\n if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {\n var rawIdx = mpModel.getRawValue(idx);\n var dataParams = mpModel.getDataParams(idx);\n\n if (isFunction(symbol)) {\n symbol = symbol(rawIdx, dataParams);\n }\n\n if (isFunction(symbolSize)) {\n // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?\n symbolSize = symbolSize(rawIdx, dataParams);\n }\n\n if (isFunction(symbolRotate)) {\n symbolRotate = symbolRotate(rawIdx, dataParams);\n }\n\n if (isFunction(symbolOffset)) {\n symbolOffset = symbolOffset(rawIdx, dataParams);\n }\n }\n\n var style = itemModel.getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n }\n\n mpData.setItemVisual(idx, {\n symbol: symbol,\n symbolSize: symbolSize,\n symbolRotate: symbolRotate,\n symbolOffset: symbolOffset,\n symbolKeepAspect: symbolKeepAspect,\n style: style\n });\n }); // TODO Text are wrong\n\n symbolDraw.updateData(mpData);\n this.group.add(symbolDraw.group); // Set host model for tooltip\n // FIXME\n\n mpData.eachItemGraphicEl(function (el) {\n el.traverse(function (child) {\n getECData(child).dataModel = mpModel;\n });\n });\n this.markKeep(symbolDraw);\n symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkPointView.type = 'markPoint';\n return MarkPointView;\n}(MarkerView);\n\nfunction createData(coordSys, seriesModel, mpModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n 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\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var mpData = new SeriesData(coordDimsInfos, mpModel);\n var dataOpt = map(mpModel.get('data'), curry(markerHelper.dataTransform, seriesModel));\n\n if (coordSys) {\n dataOpt = filter(dataOpt, curry(markerHelper.dataFilter, coordSys));\n }\n\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n mpData.initData(dataOpt, null, dimValueGetter);\n return mpData;\n}\n\nexport default MarkPointView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkPointModel from './MarkPointModel.js';\nimport MarkPointView from './MarkPointView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkPointModel);\n registers.registerComponentView(MarkPointView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markPoint')) {\n // Make sure markPoint component is enabled\n opt.markPoint = opt.markPoint || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkLineModel =\n/** @class */\nfunction (_super) {\n __extends(MarkLineModel, _super);\n\n function MarkLineModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineModel.type;\n return _this;\n }\n\n MarkLineModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkLineModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkLineModel.type = 'markLine';\n MarkLineModel.defaultOption = {\n // zlevel: 0,\n z: 5,\n symbol: ['circle', 'arrow'],\n symbolSize: [8, 16],\n // symbolRotate: 0,\n symbolOffset: 0,\n precision: 2,\n tooltip: {\n trigger: 'item'\n },\n label: {\n show: true,\n position: 'end',\n distance: 5\n },\n lineStyle: {\n type: 'dashed'\n },\n emphasis: {\n label: {\n show: true\n },\n lineStyle: {\n width: 3\n }\n },\n animationEasing: 'linear'\n };\n return MarkLineModel;\n}(MarkerModel);\n\nexport default MarkLineModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as markerHelper from './markerHelper.js';\nimport LineDraw from '../../chart/helper/LineDraw.js';\nimport MarkerView from './MarkerView.js';\nimport { getStackedDimension } from '../../data/helper/dataStackHelper.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport { getECData } from '../../util/innerStore.js';\nimport MarkerModel from './MarkerModel.js';\nimport { isArray, retrieve, retrieve2, clone, extend, logError, merge, map, curry, filter, isNumber } from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nvar inner = makeInner();\n\nvar markLineTransform = function (seriesModel, coordSys, mlModel, item) {\n var data = seriesModel.getData();\n var itemArray;\n\n if (!isArray(item)) {\n // Special type markLine like 'min', 'max', 'average', 'median'\n var mlType = item.type;\n\n if (mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' // In case\n // data: [{\n // yAxis: 10\n // }]\n || item.xAxis != null || item.yAxis != null) {\n var valueAxis = void 0;\n var value = void 0;\n\n if (item.yAxis != null || item.xAxis != null) {\n valueAxis = coordSys.getAxis(item.yAxis != null ? 'y' : 'x');\n value = retrieve(item.yAxis, item.xAxis);\n } else {\n var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);\n valueAxis = axisInfo.valueAxis;\n var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);\n value = markerHelper.numCalculate(data, valueDataDim, mlType);\n }\n\n var valueIndex = valueAxis.dim === 'x' ? 0 : 1;\n var baseIndex = 1 - valueIndex; // Normized to 2d data with start and end point\n\n var mlFrom = clone(item);\n var mlTo = {\n coord: []\n };\n mlFrom.type = null;\n mlFrom.coord = [];\n mlFrom.coord[baseIndex] = -Infinity;\n mlTo.coord[baseIndex] = Infinity;\n var precision = mlModel.get('precision');\n\n if (precision >= 0 && isNumber(value)) {\n value = +value.toFixed(Math.min(precision, 20));\n }\n\n mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;\n itemArray = [mlFrom, mlTo, {\n type: mlType,\n valueIndex: item.valueIndex,\n // Force to use the value of calculated value.\n value: value\n }];\n } else {\n // Invalid data\n if (process.env.NODE_ENV !== 'production') {\n logError('Invalid markLine data.');\n }\n\n itemArray = [];\n }\n } else {\n itemArray = item;\n }\n\n var normalizedItem = [markerHelper.dataTransform(seriesModel, itemArray[0]), markerHelper.dataTransform(seriesModel, itemArray[1]), extend({}, itemArray[2])]; // Avoid line data type is extended by from(to) data type\n\n normalizedItem[2].type = normalizedItem[2].type || null; // Merge from option and to option into line option\n\n merge(normalizedItem[2], normalizedItem[0]);\n merge(normalizedItem[2], normalizedItem[1]);\n return normalizedItem;\n};\n\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markLine has one dim\n\n\nfunction ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n var dimName = coordSys.dimensions[dimIndex];\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);\n}\n\nfunction markLineFilter(coordSys, item) {\n if (coordSys.type === 'cartesian2d') {\n var fromCoord = item[0].coord;\n var toCoord = item[1].coord; // In case\n // {\n // markLine: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n\n if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n }\n }\n\n return markerHelper.dataFilter(coordSys, item[0]) && markerHelper.dataFilter(coordSys, item[1]);\n}\n\nfunction updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Use the getMarkerPosition\n point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));\n } else {\n var dims = coordSys.dimensions;\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n point = coordSys.dataToPoint([x, y]);\n } // Expand line to the edge of grid if value on one axis is Inifnity\n // In case\n // markLine: {\n // data: [{\n // yAxis: 2\n // // or\n // type: 'average'\n // }]\n // }\n\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var dims = coordSys.dimensions;\n\n if (isInfinity(data.get(dims[0], idx))) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);\n } else if (isInfinity(data.get(dims[1], idx))) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n data.setItemLayout(idx, point);\n}\n\nvar MarkLineView =\n/** @class */\nfunction (_super) {\n __extends(MarkLineView, _super);\n\n function MarkLineView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkLineView.type;\n return _this;\n }\n\n MarkLineView.prototype.updateTransform = function (markLineModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markLine');\n\n if (mlModel) {\n var mlData_1 = mlModel.getData();\n var fromData_1 = inner(mlModel).from;\n var toData_1 = inner(mlModel).to; // Update visual and layout of from symbol and to symbol\n\n fromData_1.each(function (idx) {\n updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api);\n updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api);\n }); // Update layout of line\n\n mlData_1.each(function (idx) {\n mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);\n });\n this.markerGroupMap.get(seriesModel.id).updateLayout();\n }\n }, this);\n };\n\n MarkLineView.prototype.renderSeries = function (seriesModel, mlModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var lineDrawMap = this.markerGroupMap;\n var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());\n this.group.add(lineDraw.group);\n var mlData = createList(coordSys, seriesModel, mlModel);\n var fromData = mlData.from;\n var toData = mlData.to;\n var lineData = mlData.line;\n inner(mlModel).from = fromData;\n inner(mlModel).to = toData; // Line data for tooltip and formatter\n\n mlModel.setData(lineData); // TODO\n // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.\n // But the related logic and type definition are not finished yet.\n // Finish it if required\n\n var symbolType = mlModel.get('symbol');\n var symbolSize = mlModel.get('symbolSize');\n var symbolRotate = mlModel.get('symbolRotate');\n var symbolOffset = mlModel.get('symbolOffset'); // TODO: support callback function like markPoint\n\n if (!isArray(symbolType)) {\n symbolType = [symbolType, symbolType];\n }\n\n if (!isArray(symbolSize)) {\n symbolSize = [symbolSize, symbolSize];\n }\n\n if (!isArray(symbolRotate)) {\n symbolRotate = [symbolRotate, symbolRotate];\n }\n\n if (!isArray(symbolOffset)) {\n symbolOffset = [symbolOffset, symbolOffset];\n } // Update visual and layout of from symbol and to symbol\n\n\n mlData.from.each(function (idx) {\n updateDataVisualAndLayout(fromData, idx, true);\n updateDataVisualAndLayout(toData, idx, false);\n }); // Update visual and layout of line\n\n lineData.each(function (idx) {\n var lineStyle = lineData.getItemModel(idx).getModel('lineStyle').getLineStyle(); // lineData.setItemVisual(idx, {\n // color: lineColor || fromData.getItemVisual(idx, 'color')\n // });\n\n lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);\n\n if (lineStyle.stroke == null) {\n lineStyle.stroke = fromData.getItemVisual(idx, 'style').fill;\n }\n\n lineData.setItemVisual(idx, {\n fromSymbolKeepAspect: fromData.getItemVisual(idx, 'symbolKeepAspect'),\n fromSymbolOffset: fromData.getItemVisual(idx, 'symbolOffset'),\n fromSymbolRotate: fromData.getItemVisual(idx, 'symbolRotate'),\n fromSymbolSize: fromData.getItemVisual(idx, 'symbolSize'),\n fromSymbol: fromData.getItemVisual(idx, 'symbol'),\n toSymbolKeepAspect: toData.getItemVisual(idx, 'symbolKeepAspect'),\n toSymbolOffset: toData.getItemVisual(idx, 'symbolOffset'),\n toSymbolRotate: toData.getItemVisual(idx, 'symbolRotate'),\n toSymbolSize: toData.getItemVisual(idx, 'symbolSize'),\n toSymbol: toData.getItemVisual(idx, 'symbol'),\n style: lineStyle\n });\n });\n lineDraw.updateData(lineData); // Set host model for tooltip\n // FIXME\n\n mlData.line.eachItemGraphicEl(function (el) {\n getECData(el).dataModel = mlModel;\n el.traverse(function (child) {\n getECData(child).dataModel = mlModel;\n });\n });\n\n function updateDataVisualAndLayout(data, idx, isFrom) {\n var itemModel = data.getItemModel(idx);\n updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api);\n var style = itemModel.getModel('itemStyle').getItemStyle();\n\n if (style.fill == null) {\n style.fill = getVisualFromData(seriesData, 'color');\n }\n\n data.setItemVisual(idx, {\n symbolKeepAspect: itemModel.get('symbolKeepAspect'),\n // `0` should be considered as a valid value, so use `retrieve2` instead of `||`\n symbolOffset: retrieve2(itemModel.get('symbolOffset', true), symbolOffset[isFrom ? 0 : 1]),\n symbolRotate: retrieve2(itemModel.get('symbolRotate', true), symbolRotate[isFrom ? 0 : 1]),\n // TODO: when 2d array is supported, it should ignore parent\n symbolSize: retrieve2(itemModel.get('symbolSize'), symbolSize[isFrom ? 0 : 1]),\n symbol: retrieve2(itemModel.get('symbol', true), symbolType[isFrom ? 0 : 1]),\n style: style\n });\n }\n\n this.markKeep(lineDraw);\n lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkLineView.type = 'markLine';\n return MarkLineView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, mlModel) {\n var coordDimsInfos;\n\n if (coordSys) {\n coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) {\n 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\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n } else {\n coordDimsInfos = [{\n name: 'value',\n type: 'float'\n }];\n }\n\n var fromData = new SeriesData(coordDimsInfos, mlModel);\n var toData = new SeriesData(coordDimsInfos, mlModel); // No dimensions\n\n var lineData = new SeriesData([], mlModel);\n var optData = map(mlModel.get('data'), curry(markLineTransform, seriesModel, coordSys, mlModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markLineFilter, coordSys));\n }\n\n var dimValueGetter = markerHelper.createMarkerDimValueGetter(!!coordSys, coordDimsInfos);\n fromData.initData(map(optData, function (item) {\n return item[0];\n }), null, dimValueGetter);\n toData.initData(map(optData, function (item) {\n return item[1];\n }), null, dimValueGetter);\n lineData.initData(map(optData, function (item) {\n return item[2];\n }));\n lineData.hasItemOption = true;\n return {\n from: fromData,\n to: toData,\n line: lineData\n };\n}\n\nexport default MarkLineView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkLineModel from './MarkLineModel.js';\nimport MarkLineView from './MarkLineView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkLineModel);\n registers.registerComponentView(MarkLineView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markLine')) {\n // Make sure markLine component is enabled\n opt.markLine = opt.markLine || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport MarkerModel from './MarkerModel.js';\n\nvar MarkAreaModel =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaModel, _super);\n\n function MarkAreaModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaModel.type;\n return _this;\n }\n\n MarkAreaModel.prototype.createMarkerModelFromSeries = function (markerOpt, masterMarkerModel, ecModel) {\n return new MarkAreaModel(markerOpt, masterMarkerModel, ecModel);\n };\n\n MarkAreaModel.type = 'markArea';\n MarkAreaModel.defaultOption = {\n // zlevel: 0,\n // PENDING\n z: 1,\n tooltip: {\n trigger: 'item'\n },\n // markArea should fixed on the coordinate system\n animation: false,\n label: {\n show: true,\n position: 'top'\n },\n itemStyle: {\n // color and borderColor default to use color from series\n // color: 'auto'\n // borderColor: 'auto'\n borderWidth: 0\n },\n emphasis: {\n label: {\n show: true,\n position: 'top'\n }\n }\n };\n return MarkAreaModel;\n}(MarkerModel);\n\nexport default MarkAreaModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\"; // TODO Optimize on polar\n\nimport * as colorUtil from 'zrender/lib/tool/color.js';\nimport SeriesData from '../../data/SeriesData.js';\nimport * as numberUtil from '../../util/number.js';\nimport * as graphic from '../../util/graphic.js';\nimport { toggleHoverEmphasis, setStatesStylesFromModel } from '../../util/states.js';\nimport * as markerHelper from './markerHelper.js';\nimport MarkerView from './MarkerView.js';\nimport { retrieve, mergeAll, map, curry, filter, extend, isString } from 'zrender/lib/core/util.js';\nimport { isCoordinateSystemType } from '../../coord/CoordinateSystem.js';\nimport MarkerModel from './MarkerModel.js';\nimport { makeInner } from '../../util/model.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nimport { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { parseDataValue } from '../../data/helper/dataValueHelper.js';\nvar inner = makeInner();\n\nvar markAreaTransform = function (seriesModel, coordSys, maModel, item) {\n // item may be null\n var item0 = item[0];\n var item1 = item[1];\n\n if (!item0 || !item1) {\n return;\n }\n\n var lt = markerHelper.dataTransform(seriesModel, item0);\n var rb = markerHelper.dataTransform(seriesModel, item1); // FIXME make sure lt is less than rb\n\n var ltCoord = lt.coord;\n var rbCoord = rb.coord;\n ltCoord[0] = retrieve(ltCoord[0], -Infinity);\n ltCoord[1] = retrieve(ltCoord[1], -Infinity);\n rbCoord[0] = retrieve(rbCoord[0], Infinity);\n rbCoord[1] = retrieve(rbCoord[1], Infinity); // Merge option into one\n\n var result = mergeAll([{}, lt, rb]);\n result.coord = [lt.coord, rb.coord];\n result.x0 = lt.x;\n result.y0 = lt.y;\n result.x1 = rb.x;\n result.y1 = rb.y;\n return result;\n};\n\nfunction isInfinity(val) {\n return !isNaN(val) && !isFinite(val);\n} // If a markArea has one dim\n\n\nfunction ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {\n var otherDimIndex = 1 - dimIndex;\n return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);\n}\n\nfunction markAreaFilter(coordSys, item) {\n var fromCoord = item.coord[0];\n var toCoord = item.coord[1];\n var item0 = {\n coord: fromCoord,\n x: item.x0,\n y: item.y0\n };\n var item1 = {\n coord: toCoord,\n x: item.x1,\n y: item.y1\n };\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // In case\n // {\n // markArea: {\n // data: [{ yAxis: 2 }]\n // }\n // }\n if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord, coordSys))) {\n return true;\n } // Directly returning true may also do the work,\n // because markArea will not be shown automatically\n // when it's not included in coordinate system.\n // But filtering ahead can avoid keeping rendering markArea\n // when there are too many of them.\n\n\n return markerHelper.zoneFilter(coordSys, item0, item1);\n }\n\n return markerHelper.dataFilter(coordSys, item0) || markerHelper.dataFilter(coordSys, item1);\n} // dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0']\n\n\nfunction getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var itemModel = data.getItemModel(idx);\n var point;\n var xPx = numberUtil.parsePercent(itemModel.get(dims[0]), api.getWidth());\n var yPx = numberUtil.parsePercent(itemModel.get(dims[1]), api.getHeight());\n\n if (!isNaN(xPx) && !isNaN(yPx)) {\n point = [xPx, yPx];\n } else {\n // Chart like bar may have there own marker positioning logic\n if (seriesModel.getMarkerPosition) {\n // Consider the case that user input the right-bottom point first\n // Pick the larger x and y as 'x1' and 'y1'\n var pointValue0 = data.getValues(['x0', 'y0'], idx);\n var pointValue1 = data.getValues(['x1', 'y1'], idx);\n var clampPointValue0 = coordSys.clampData(pointValue0);\n var clampPointValue1 = coordSys.clampData(pointValue1);\n var pointValue = [];\n\n if (dims[0] === 'x0') {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0];\n } else {\n pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0];\n }\n\n if (dims[1] === 'y0') {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1];\n } else {\n pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1];\n } // Use the getMarkerPosition\n\n\n point = seriesModel.getMarkerPosition(pointValue, dims, true);\n } else {\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n var pt = [x, y];\n coordSys.clampData && coordSys.clampData(pt, pt);\n point = coordSys.dataToPoint(pt, true);\n }\n\n if (isCoordinateSystemType(coordSys, 'cartesian2d')) {\n // TODO: TYPE ts@4.1 may still infer it as Axis instead of Axis2D. Not sure if it's a bug\n var xAxis = coordSys.getAxis('x');\n var yAxis = coordSys.getAxis('y');\n var x = data.get(dims[0], idx);\n var y = data.get(dims[1], idx);\n\n if (isInfinity(x)) {\n point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]);\n } else if (isInfinity(y)) {\n point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]);\n }\n } // Use x, y if has any\n\n\n if (!isNaN(xPx)) {\n point[0] = xPx;\n }\n\n if (!isNaN(yPx)) {\n point[1] = yPx;\n }\n }\n\n return point;\n}\n\nexport var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']];\n\nvar MarkAreaView =\n/** @class */\nfunction (_super) {\n __extends(MarkAreaView, _super);\n\n function MarkAreaView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = MarkAreaView.type;\n return _this;\n }\n\n MarkAreaView.prototype.updateTransform = function (markAreaModel, ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, 'markArea');\n\n if (maModel) {\n var areaData_1 = maModel.getData();\n areaData_1.each(function (idx) {\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api);\n }); // Layout\n\n areaData_1.setItemLayout(idx, points);\n var el = areaData_1.getItemGraphicEl(idx);\n el.setShape('points', points);\n });\n }\n }, this);\n };\n\n MarkAreaView.prototype.renderSeries = function (seriesModel, maModel, ecModel, api) {\n var coordSys = seriesModel.coordinateSystem;\n var seriesId = seriesModel.id;\n var seriesData = seriesModel.getData();\n var areaGroupMap = this.markerGroupMap;\n var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {\n group: new graphic.Group()\n });\n this.group.add(polygonGroup.group);\n this.markKeep(polygonGroup);\n var areaData = createList(coordSys, seriesModel, maModel); // Line data for tooltip and formatter\n\n maModel.setData(areaData); // Update visual and layout of line\n\n areaData.each(function (idx) {\n // Layout\n var points = map(dimPermutations, function (dim) {\n return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);\n });\n var xAxisScale = coordSys.getAxis('x').scale;\n var yAxisScale = coordSys.getAxis('y').scale;\n var xAxisExtent = xAxisScale.getExtent();\n var yAxisExtent = yAxisScale.getExtent();\n var xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];\n var yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];\n numberUtil.asc(xPointExtent);\n numberUtil.asc(yPointExtent);\n var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]); // If none of the area is inside coordSys, allClipped is set to be true\n // in layout so that label will not be displayed. See #12591\n\n var allClipped = !overlapped;\n areaData.setItemLayout(idx, {\n points: points,\n allClipped: allClipped\n });\n var style = areaData.getItemModel(idx).getModel('itemStyle').getItemStyle();\n var color = getVisualFromData(seriesData, 'color');\n\n if (!style.fill) {\n style.fill = color;\n\n if (isString(style.fill)) {\n style.fill = colorUtil.modifyAlpha(style.fill, 0.4);\n }\n }\n\n if (!style.stroke) {\n style.stroke = color;\n } // Visual\n\n\n areaData.setItemVisual(idx, 'style', style);\n });\n areaData.diff(inner(polygonGroup).data).add(function (idx) {\n var layout = areaData.getItemLayout(idx);\n\n if (!layout.allClipped) {\n var polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n areaData.setItemGraphicEl(idx, polygon);\n polygonGroup.group.add(polygon);\n }\n }).update(function (newIdx, oldIdx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(oldIdx);\n var layout = areaData.getItemLayout(newIdx);\n\n if (!layout.allClipped) {\n if (polygon) {\n graphic.updateProps(polygon, {\n shape: {\n points: layout.points\n }\n }, maModel, newIdx);\n } else {\n polygon = new graphic.Polygon({\n shape: {\n points: layout.points\n }\n });\n }\n\n areaData.setItemGraphicEl(newIdx, polygon);\n polygonGroup.group.add(polygon);\n } else if (polygon) {\n polygonGroup.group.remove(polygon);\n }\n }).remove(function (idx) {\n var polygon = inner(polygonGroup).data.getItemGraphicEl(idx);\n polygonGroup.group.remove(polygon);\n }).execute();\n areaData.eachItemGraphicEl(function (polygon, idx) {\n var itemModel = areaData.getItemModel(idx);\n var style = areaData.getItemVisual(idx, 'style');\n polygon.useStyle(areaData.getItemVisual(idx, 'style'));\n setLabelStyle(polygon, getLabelStatesModels(itemModel), {\n labelFetcher: maModel,\n labelDataIndex: idx,\n defaultText: areaData.getName(idx) || '',\n inheritColor: isString(style.fill) ? colorUtil.modifyAlpha(style.fill, 1) : '#000'\n });\n setStatesStylesFromModel(polygon, itemModel);\n toggleHoverEmphasis(polygon, null, null, itemModel.get(['emphasis', 'disabled']));\n getECData(polygon).dataModel = maModel;\n });\n inner(polygonGroup).data = areaData;\n polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent');\n };\n\n MarkAreaView.type = 'markArea';\n return MarkAreaView;\n}(MarkerView);\n\nfunction createList(coordSys, seriesModel, maModel) {\n var areaData;\n var dataDims;\n var dims = ['x0', 'y0', 'x1', 'y1'];\n\n if (coordSys) {\n var coordDimsInfos_1 = map(coordSys && coordSys.dimensions, function (coordDim) {\n var data = seriesModel.getData();\n var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys\n\n return extend(extend({}, info), {\n name: coordDim,\n // DON'T use ordinalMeta to parse and collect ordinal.\n ordinalMeta: null\n });\n });\n dataDims = map(dims, function (dim, idx) {\n return {\n name: dim,\n type: coordDimsInfos_1[idx % 2].type\n };\n });\n areaData = new SeriesData(dataDims, maModel);\n } else {\n dataDims = [{\n name: 'value',\n type: 'float'\n }];\n areaData = new SeriesData(dataDims, maModel);\n }\n\n var optData = map(maModel.get('data'), curry(markAreaTransform, seriesModel, coordSys, maModel));\n\n if (coordSys) {\n optData = filter(optData, curry(markAreaFilter, coordSys));\n }\n\n var dimValueGetter = coordSys ? function (item, dimName, dataIndex, dimIndex) {\n // TODO should convert to ParsedValue?\n var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];\n return parseDataValue(rawVal, dataDims[dimIndex]);\n } : function (item, dimName, dataIndex, dimIndex) {\n return parseDataValue(item.value, dataDims[dimIndex]);\n };\n areaData.initData(optData, null, dimValueGetter);\n areaData.hasItemOption = true;\n return areaData;\n}\n\nexport default MarkAreaView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport checkMarkerInSeries from './checkMarkerInSeries.js';\nimport MarkAreaModel from './MarkAreaModel.js';\nimport MarkAreaView from './MarkAreaView.js';\nexport function install(registers) {\n registers.registerComponentModel(MarkAreaModel);\n registers.registerComponentView(MarkAreaView);\n registers.registerPreprocessor(function (opt) {\n if (checkMarkerInSeries(opt.series, 'markArea')) {\n // Make sure markArea component is enabled\n opt.markArea = opt.markArea || {};\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport Model from '../../model/Model.js';\nimport { isNameSpecified } from '../../util/model.js';\nimport ComponentModel from '../../model/Component.js';\n\nvar getDefaultSelectorOptions = function (ecModel, type) {\n if (type === 'all') {\n return {\n type: 'all',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'all'])\n };\n } else if (type === 'inverse') {\n return {\n type: 'inverse',\n title: ecModel.getLocaleModel().get(['legend', 'selector', 'inverse'])\n };\n }\n};\n\nvar LegendModel =\n/** @class */\nfunction (_super) {\n __extends(LegendModel, _super);\n\n function LegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendModel.type;\n _this.layoutMode = {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas real width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n };\n return _this;\n }\n\n LegendModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n this._updateSelector(option);\n };\n\n LegendModel.prototype._updateSelector = function (option) {\n var selector = option.selector;\n var ecModel = this.ecModel;\n\n if (selector === true) {\n selector = option.selector = ['all', 'inverse'];\n }\n\n if (zrUtil.isArray(selector)) {\n zrUtil.each(selector, function (item, index) {\n zrUtil.isString(item) && (item = {\n type: item\n });\n selector[index] = zrUtil.merge(item, getDefaultSelectorOptions(ecModel, item.type));\n });\n }\n };\n\n LegendModel.prototype.optionUpdated = function () {\n this._updateData(this.ecModel);\n\n var legendData = this._data; // If selectedMode is single, try to select one\n\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false; // If has any selected in option.selected\n\n for (var i = 0; i < legendData.length; i++) {\n var name_1 = legendData[i].get('name');\n\n if (this.isSelected(name_1)) {\n // Force to unselect others\n this.select(name_1);\n hasSelected = true;\n break;\n }\n } // Try select the first if selectedMode is single\n\n\n !hasSelected && this.select(legendData[0].get('name'));\n }\n };\n\n LegendModel.prototype._updateData = function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n var names = provider.getAllNames();\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\r\n * @type {Array.}\r\n * @private\r\n */\n\n this._availableNames = availableNames; // If legend.data is not specified in option, use availableNames as data,\n // which is convenient for user preparing option.\n\n var rawData = this.get('data') || potentialData;\n var legendNameMap = zrUtil.createHashMap();\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (zrUtil.isString(dataItem) || zrUtil.isNumber(dataItem)) {\n dataItem = {\n name: dataItem\n };\n }\n\n if (legendNameMap.get(dataItem.name)) {\n // remove legend name duplicate\n return null;\n }\n\n legendNameMap.set(dataItem.name, true);\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\r\n * @type {Array.}\r\n * @private\r\n */\n\n this._data = zrUtil.filter(legendData, function (item) {\n return !!item;\n });\n };\n\n LegendModel.prototype.getData = function () {\n return this._data;\n };\n\n LegendModel.prototype.select = function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n\n selected[name] = true;\n };\n\n LegendModel.prototype.unSelect = function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n };\n\n LegendModel.prototype.toggleSelected = function (name) {\n var selected = this.option.selected; // Default is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n this[selected[name] ? 'unSelect' : 'select'](name);\n };\n\n LegendModel.prototype.allSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name', true)] = true;\n });\n };\n\n LegendModel.prototype.inverseSelect = function () {\n var data = this._data;\n var selected = this.option.selected;\n zrUtil.each(data, function (dataItem) {\n var name = dataItem.get('name', true); // Initially, default value is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n selected[name] = !selected[name];\n });\n };\n\n LegendModel.prototype.isSelected = function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n };\n\n LegendModel.prototype.getOrient = function () {\n return this.get('orient') === 'vertical' ? {\n index: 1,\n name: 'vertical'\n } : {\n index: 0,\n name: 'horizontal'\n };\n };\n\n LegendModel.type = 'legend.plain';\n LegendModel.dependencies = ['series'];\n LegendModel.defaultOption = {\n // zlevel: 0,\n z: 4,\n show: true,\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n borderRadius: 0,\n borderWidth: 0,\n padding: 5,\n itemGap: 10,\n itemWidth: 25,\n itemHeight: 14,\n symbolRotate: 'inherit',\n symbolKeepAspect: true,\n inactiveColor: '#ccc',\n inactiveBorderColor: '#ccc',\n inactiveBorderWidth: 'auto',\n itemStyle: {\n color: 'inherit',\n opacity: 'inherit',\n borderColor: 'inherit',\n borderWidth: 'auto',\n borderCap: 'inherit',\n borderJoin: 'inherit',\n borderDashOffset: 'inherit',\n borderMiterLimit: 'inherit'\n },\n lineStyle: {\n width: 'auto',\n color: 'inherit',\n inactiveColor: '#ccc',\n inactiveWidth: 2,\n opacity: 'inherit',\n type: 'inherit',\n cap: 'inherit',\n join: 'inherit',\n dashOffset: 'inherit',\n miterLimit: 'inherit'\n },\n textStyle: {\n color: '#333'\n },\n selectedMode: true,\n selector: false,\n selectorLabel: {\n show: true,\n borderRadius: 10,\n padding: [3, 5, 3, 5],\n fontSize: 12,\n fontFamily: 'sans-serif',\n color: '#666',\n borderWidth: 1,\n borderColor: '#666'\n },\n emphasis: {\n selectorLabel: {\n show: true,\n color: '#eee',\n backgroundColor: '#666'\n }\n },\n selectorPosition: 'auto',\n selectorItemGap: 7,\n selectorButtonGap: 10,\n tooltip: {\n show: false\n }\n };\n return LegendModel;\n}(ComponentModel);\n\nexport default LegendModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { parse, stringify } from 'zrender/lib/tool/color.js';\nimport * as graphic from '../../util/graphic.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { setLabelStyle, createTextStyle } from '../../label/labelStyle.js';\nimport { makeBackground } from '../helper/listComponent.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport ComponentView from '../../view/Component.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport { createOrUpdatePatternFromDecal } from '../../util/decal.js';\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar LegendView =\n/** @class */\nfunction (_super) {\n __extends(LegendView, _super);\n\n function LegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = LegendView.type;\n _this.newlineDisabled = false;\n return _this;\n }\n\n LegendView.prototype.init = function () {\n this.group.add(this._contentGroup = new Group());\n this.group.add(this._selectorGroup = new Group());\n this._isFirstRender = true;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getContentGroup = function () {\n return this._contentGroup;\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.getSelectorGroup = function () {\n return this._selectorGroup;\n };\n /**\r\n * @override\r\n */\n\n\n LegendView.prototype.render = function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n var orient = legendModel.get('orient');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && orient === 'vertical' ? 'right' : 'left';\n } // selector has been normalized to an array in model\n\n\n var selector = legendModel.get('selector', true);\n var selectorPosition = legendModel.get('selectorPosition', true);\n\n if (selector && (!selectorPosition || selectorPosition === 'auto')) {\n selectorPosition = orient === 'horizontal' ? 'end' : 'start';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.x = layoutRect.x - mainRect.x;\n this.group.y = layoutRect.y - mainRect.y;\n this.group.markRedraw(); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n };\n\n LegendView.prototype.resetInner = function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n this.getSelectorGroup().removeAll();\n };\n\n LegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (legendItemModel, dataIndex) {\n var name = legendItemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n var g = new Group(); // @ts-ignore\n\n g.newline = true;\n contentGroup.add(g);\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawn\n return;\n } // Legend to control series.\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var lineVisualStyle = data.getVisual('legendLineStyle') || {};\n var legendIcon = data.getVisual('legendIcon');\n /**\r\n * `data.getVisual('style')` may be the color from the register\r\n * in series. For example, for line series,\r\n */\n\n var style = data.getVisual('style');\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, null, api, excludeSeriesId)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Legend to control data. In pie and funnel.\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendVisualProvider) {\n var provider = seriesModel.legendVisualProvider;\n\n if (!provider.containName(name)) {\n return;\n }\n\n var idx = provider.indexOfName(name);\n var style = provider.getItemVisual(idx, 'style');\n var legendIcon = provider.getItemVisual(idx, 'legendIcon');\n var colorArr = parse(style.fill); // Color may be set to transparent in visualMap when data is out of range.\n // Do not show nothing.\n\n if (colorArr && colorArr[3] === 0) {\n colorArr[3] = 0.2; // TODO color is set to 0, 0, 0, 0. Should show correct RGBA\n\n style = zrUtil.extend(zrUtil.extend({}, style), {\n fill: stringify(colorArr, 'rgba')\n });\n }\n\n var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style, legendIcon, selectMode, api); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, null, name, api, excludeSeriesId)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!legendDrawnMap.get(name)) {\n console.warn(name + ' series not exists. Legend data should be same with series name or data name.');\n }\n }\n }, this);\n\n if (selector) {\n this._createSelector(selector, legendModel, api, orient, selectorPosition);\n }\n };\n\n LegendView.prototype._createSelector = function (selector, legendModel, api, orient, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n each(selector, function createSelectorButton(selectorItem) {\n var type = selectorItem.type;\n var labelText = new graphic.Text({\n style: {\n x: 0,\n y: 0,\n align: 'center',\n verticalAlign: 'middle'\n },\n onclick: function () {\n api.dispatchAction({\n type: type === 'all' ? 'legendAllSelect' : 'legendInverseSelect'\n });\n }\n });\n selectorGroup.add(labelText);\n var labelModel = legendModel.getModel('selectorLabel');\n var emphasisLabelModel = legendModel.getModel(['emphasis', 'selectorLabel']);\n setLabelStyle(labelText, {\n normal: labelModel,\n emphasis: emphasisLabelModel\n }, {\n defaultText: selectorItem.title\n });\n enableHoverEmphasis(labelText);\n });\n };\n\n LegendView.prototype._createItem = function (seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api) {\n var drawType = seriesModel.visualDrawType;\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var isSelected = legendModel.isSelected(name);\n var iconRotate = legendItemModel.get('symbolRotate');\n var symbolKeepAspect = legendItemModel.get('symbolKeepAspect');\n var legendIconType = legendItemModel.get('icon');\n legendIcon = legendIconType || legendIcon || 'roundRect';\n var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api);\n var itemGroup = new Group();\n var textStyleModel = legendItemModel.getModel('textStyle');\n\n if (zrUtil.isFunction(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === 'inherit')) {\n // Series has specific way to define legend icon\n itemGroup.add(seriesModel.getLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: iconRotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n } else {\n // Use default legend icon policy for most series\n var rotate = legendIconType === 'inherit' && seriesModel.getData().getVisual('symbol') ? iconRotate === 'inherit' ? seriesModel.getData().getVisual('symbolRotate') : iconRotate : 0; // No rotation for no icon\n\n itemGroup.add(getDefaultLegendIcon({\n itemWidth: itemWidth,\n itemHeight: itemHeight,\n icon: legendIcon,\n iconRotate: rotate,\n itemStyle: style.itemStyle,\n lineStyle: style.lineStyle,\n symbolKeepAspect: symbolKeepAspect\n }));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (zrUtil.isString(formatter) && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (zrUtil.isFunction(formatter)) {\n content = formatter(name);\n }\n\n var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get('inactiveColor');\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n fill: textColor,\n align: textAlign,\n verticalAlign: 'middle'\n }, {\n inheritColor: textColor\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true\n });\n var tooltipModel = legendItemModel.getModel('tooltip');\n\n if (tooltipModel.get('show')) {\n graphic.setTooltipConfig({\n el: hitRect,\n componentModel: legendModel,\n itemName: name,\n itemTooltipOption: tooltipModel.option\n });\n }\n\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n enableHoverEmphasis(itemGroup); // @ts-ignore\n\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n };\n\n LegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var contentGroup = this.getContentGroup();\n var selectorGroup = this.getSelectorGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n var contentPos = [-contentRect.x, -contentRect.y];\n selectorGroup.markRedraw();\n contentGroup.markRedraw();\n\n if (selector) {\n // Place buttons in selectorGroup\n layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var orientIdx = legendModel.getOrient().index;\n var wh = orientIdx === 0 ? 'width' : 'height';\n var hw = orientIdx === 0 ? 'height' : 'width';\n var yx = orientIdx === 0 ? 'y' : 'x';\n\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;\n } else {\n contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;\n } // Always align selector to content as 'middle'\n\n\n selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n var mainRect = {\n x: 0,\n y: 0\n };\n mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);\n return mainRect;\n } else {\n contentGroup.x = contentPos[0];\n contentGroup.y = contentPos[1];\n return this.group.getBoundingRect();\n }\n };\n /**\r\n * @protected\r\n */\n\n\n LegendView.prototype.remove = function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n };\n\n LegendView.type = 'legend.plain';\n return LegendView;\n}(ComponentView);\n\nfunction getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api) {\n /**\r\n * Use series style if is inherit;\r\n * elsewise, use legend style\r\n */\n function handleCommonProps(style, visualStyle) {\n // If lineStyle.width is 'auto', it is set to be 2 if series has border\n if (style.lineWidth === 'auto') {\n style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;\n }\n\n each(style, function (propVal, propName) {\n style[propName] === 'inherit' && (style[propName] = visualStyle[propName]);\n });\n } // itemStyle\n\n\n var itemStyleModel = legendItemModel.getModel('itemStyle');\n var itemStyle = itemStyleModel.getItemStyle();\n var iconBrushType = iconType.lastIndexOf('empty', 0) === 0 ? 'fill' : 'stroke';\n var decalStyle = itemStyleModel.getShallow('decal');\n itemStyle.decal = !decalStyle || decalStyle === 'inherit' ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api);\n\n if (itemStyle.fill === 'inherit') {\n /**\r\n * Series with visualDrawType as 'stroke' should have\r\n * series stroke as legend fill\r\n */\n itemStyle.fill = itemVisualStyle[drawType];\n }\n\n if (itemStyle.stroke === 'inherit') {\n /**\r\n * icon type with \"emptyXXX\" should use fill color\r\n * in visual style\r\n */\n itemStyle.stroke = itemVisualStyle[iconBrushType];\n }\n\n if (itemStyle.opacity === 'inherit') {\n /**\r\n * Use lineStyle.opacity if drawType is stroke\r\n */\n itemStyle.opacity = (drawType === 'fill' ? itemVisualStyle : lineVisualStyle).opacity;\n }\n\n handleCommonProps(itemStyle, itemVisualStyle); // lineStyle\n\n var legendLineModel = legendItemModel.getModel('lineStyle');\n var lineStyle = legendLineModel.getLineStyle();\n handleCommonProps(lineStyle, lineVisualStyle); // Fix auto color to real color\n\n itemStyle.fill === 'auto' && (itemStyle.fill = itemVisualStyle.fill);\n itemStyle.stroke === 'auto' && (itemStyle.stroke = itemVisualStyle.fill);\n lineStyle.stroke === 'auto' && (lineStyle.stroke = itemVisualStyle.fill);\n\n if (!isSelected) {\n var borderWidth = legendItemModel.get('inactiveBorderWidth');\n /**\r\n * Since stroke is set to be inactiveBorderColor, it may occur that\r\n * there is no border in series but border in legend, so we need to\r\n * use border only when series has border if is set to be auto\r\n */\n\n var visualHasBorder = itemStyle[iconBrushType];\n itemStyle.lineWidth = borderWidth === 'auto' ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;\n itemStyle.fill = legendItemModel.get('inactiveColor');\n itemStyle.stroke = legendItemModel.get('inactiveBorderColor');\n lineStyle.stroke = legendLineModel.get('inactiveColor');\n lineStyle.lineWidth = legendLineModel.get('inactiveWidth');\n }\n\n return {\n itemStyle: itemStyle,\n lineStyle: lineStyle\n };\n}\n\nfunction getDefaultLegendIcon(opt) {\n var symboType = opt.icon || 'roundRect';\n var icon = createSymbol(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);\n icon.setStyle(opt.itemStyle);\n icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;\n icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);\n\n if (symboType.indexOf('empty') > -1) {\n icon.style.stroke = icon.style.fill;\n icon.style.fill = '#fff';\n icon.style.lineWidth = 2;\n }\n\n return icon;\n}\n\nfunction dispatchSelectAction(seriesName, dataName, api, excludeSeriesId) {\n // downplay before unselect\n dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId);\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: seriesName != null ? seriesName : dataName\n }); // highlight after select\n // TODO highlight immediately may cause animation loss.\n\n dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId);\n}\n\nfunction isUseHoverLayer(api) {\n var list = api.getZr().storage.getDisplayList();\n var emphasisState;\n var i = 0;\n var len = list.length;\n\n while (i < len && !(emphasisState = list[i].states.emphasis)) {\n i++;\n }\n\n return emphasisState && emphasisState.hoverLayer;\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n if (!isUseHoverLayer(api)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nexport default LegendView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function legendFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (legendModels && legendModels.length) {\n ecModel.filterSeries(function (series) {\n // If in any legend component the status is not selected.\n // Because in legend series is assumed selected when it is not in the legend data.\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(series.name)) {\n return false;\n }\n }\n\n return true;\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport { curry, each } from 'zrender/lib/core/util.js';\n\nfunction legendSelectActionHandler(methodName, payload, ecModel) {\n var selectedMap = {};\n var isToggleSelect = methodName === 'toggleSelected';\n var isSelected; // Update all legend components\n\n ecModel.eachComponent('legend', function (legendModel) {\n if (isToggleSelect && isSelected != null) {\n // Force other legend has same selected status\n // Or the first is toggled to true and other are toggled to false\n // In the case one legend has some item unSelected in option. And if other legend\n // doesn't has the item, they will assume it is selected.\n legendModel[isSelected ? 'select' : 'unSelect'](payload.name);\n } else if (methodName === 'allSelect' || methodName === 'inverseSelect') {\n legendModel[methodName]();\n } else {\n legendModel[methodName](payload.name);\n isSelected = legendModel.isSelected(payload.name);\n }\n\n var legendData = legendModel.getData();\n each(legendData, function (model) {\n var name = model.get('name'); // Wrap element\n\n if (name === '\\n' || name === '') {\n return;\n }\n\n var isItemSelected = legendModel.isSelected(name);\n\n if (selectedMap.hasOwnProperty(name)) {\n // Unselected if any legend is unselected\n selectedMap[name] = selectedMap[name] && isItemSelected;\n } else {\n selectedMap[name] = isItemSelected;\n }\n });\n }); // Return the event explicitly\n\n return methodName === 'allSelect' || methodName === 'inverseSelect' ? {\n selected: selectedMap\n } : {\n name: payload.name,\n selected: selectedMap\n };\n}\n\nexport function installLegendAction(registers) {\n /**\r\n * @event legendToggleSelect\r\n * @type {Object}\r\n * @property {string} type 'legendToggleSelect'\r\n * @property {string} [from]\r\n * @property {string} name Series name or data item name\r\n */\n registers.registerAction('legendToggleSelect', 'legendselectchanged', curry(legendSelectActionHandler, 'toggleSelected'));\n registers.registerAction('legendAllSelect', 'legendselectall', curry(legendSelectActionHandler, 'allSelect'));\n registers.registerAction('legendInverseSelect', 'legendinverseselect', curry(legendSelectActionHandler, 'inverseSelect'));\n /**\r\n * @event legendSelect\r\n * @type {Object}\r\n * @property {string} type 'legendSelect'\r\n * @property {string} name Series name or data item name\r\n */\n\n registers.registerAction('legendSelect', 'legendselected', curry(legendSelectActionHandler, 'select'));\n /**\r\n * @event legendUnSelect\r\n * @type {Object}\r\n * @property {string} type 'legendUnSelect'\r\n * @property {string} name Series name or data item name\r\n */\n\n registers.registerAction('legendUnSelect', 'legendunselected', curry(legendSelectActionHandler, 'unSelect'));\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport LegendModel from './LegendModel.js';\nimport LegendView from './LegendView.js';\nimport legendFilter from './legendFilter.js';\nimport { installLegendAction } from './legendAction.js';\nexport function install(registers) {\n registers.registerComponentModel(LegendModel);\n registers.registerComponentView(LegendView);\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);\n registers.registerSubTypeDefaulter('legend', function () {\n return 'plain';\n });\n installLegendAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport LegendModel from './LegendModel.js';\nimport { mergeLayoutParam, getLayoutParams } from '../../util/layout.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar ScrollableLegendModel =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendModel, _super);\n\n function ScrollableLegendModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendModel.type;\n return _this;\n }\n /**\r\n * @param {number} scrollDataIndex\r\n */\n\n\n ScrollableLegendModel.prototype.setScrollDataIndex = function (scrollDataIndex) {\n this.option.scrollDataIndex = scrollDataIndex;\n };\n\n ScrollableLegendModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n mergeAndNormalizeLayoutParams(this, option, inputPositionParams);\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendModel.prototype.mergeOption = function (option, ecModel) {\n _super.prototype.mergeOption.call(this, option, ecModel);\n\n mergeAndNormalizeLayoutParams(this, this.option, option);\n };\n\n ScrollableLegendModel.type = 'legend.scroll';\n ScrollableLegendModel.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {\n scrollDataIndex: 0,\n pageButtonItemGap: 5,\n pageButtonGap: null,\n pageButtonPosition: 'end',\n pageFormatter: '{current}/{total}',\n pageIcons: {\n horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'],\n vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z']\n },\n pageIconColor: '#2f4554',\n pageIconInactiveColor: '#aaa',\n pageIconSize: 15,\n pageTextStyle: {\n color: '#333'\n },\n animationDurationUpdate: 800\n });\n return ScrollableLegendModel;\n}(LegendModel);\n\n; // Do not `ignoreSize` to enable setting {left: 10, right: 10}.\n\nfunction mergeAndNormalizeLayoutParams(legendModel, target, raw) {\n var orient = legendModel.getOrient();\n var ignoreSize = [1, 1];\n ignoreSize[orient.index] = 0;\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: !!ignoreSize\n });\n}\n\nexport default ScrollableLegendModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * Separate legend and scrollable legend to reduce package size.\r\n */\n\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as layoutUtil from '../../util/layout.js';\nimport LegendView from './LegendView.js';\nvar Group = graphic.Group;\nvar WH = ['width', 'height'];\nvar XY = ['x', 'y'];\n\nvar ScrollableLegendView =\n/** @class */\nfunction (_super) {\n __extends(ScrollableLegendView, _super);\n\n function ScrollableLegendView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ScrollableLegendView.type;\n _this.newlineDisabled = true;\n _this._currentIndex = 0;\n return _this;\n }\n\n ScrollableLegendView.prototype.init = function () {\n _super.prototype.init.call(this);\n\n this.group.add(this._containerGroup = new Group());\n\n this._containerGroup.add(this.getContentGroup());\n\n this.group.add(this._controllerGroup = new Group());\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.resetInner = function () {\n _super.prototype.resetInner.call(this);\n\n this._controllerGroup.removeAll();\n\n this._containerGroup.removeClipPath();\n\n this._containerGroup.__rectSize = null;\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.renderInner = function (itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition) {\n var self = this; // Render content items.\n\n _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api, selector, orient, selectorPosition);\n\n var controllerGroup = this._controllerGroup; // FIXME: support be 'auto' adapt to size number text length,\n // e.g., '3/12345' should not overlap with the control arrow button.\n\n var pageIconSize = legendModel.get('pageIconSize', true);\n var pageIconSizeArr = zrUtil.isArray(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];\n createPageButton('pagePrev', 0);\n var pageTextStyleModel = legendModel.getModel('pageTextStyle');\n controllerGroup.add(new graphic.Text({\n name: 'pageText',\n style: {\n // Placeholder to calculate a proper layout.\n text: 'xx/xx',\n fill: pageTextStyleModel.getTextColor(),\n font: pageTextStyleModel.getFont(),\n verticalAlign: 'middle',\n align: 'center'\n },\n silent: true\n }));\n createPageButton('pageNext', 1);\n\n function createPageButton(name, iconIdx) {\n var pageDataIndexName = name + 'DataIndex';\n var icon = graphic.createIcon(legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], {\n // Buttons will be created in each render, so we do not need\n // to worry about avoiding using legendModel kept in scope.\n onclick: zrUtil.bind(self._pageGo, self, pageDataIndexName, legendModel, api)\n }, {\n x: -pageIconSizeArr[0] / 2,\n y: -pageIconSizeArr[1] / 2,\n width: pageIconSizeArr[0],\n height: pageIconSizeArr[1]\n });\n icon.name = name;\n controllerGroup.add(icon);\n }\n };\n /**\r\n * @override\r\n */\n\n\n ScrollableLegendView.prototype.layoutInner = function (legendModel, itemAlign, maxSize, isFirstRender, selector, selectorPosition) {\n var selectorGroup = this.getSelectorGroup();\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n var hw = WH[1 - orientIdx];\n var yx = XY[1 - orientIdx];\n selector && layoutUtil.box( // Buttons in selectorGroup always layout horizontally\n 'horizontal', selectorGroup, legendModel.get('selectorItemGap', true));\n var selectorButtonGap = legendModel.get('selectorButtonGap', true);\n var selectorRect = selectorGroup.getBoundingRect();\n var selectorPos = [-selectorRect.x, -selectorRect.y];\n var processMaxSize = zrUtil.clone(maxSize);\n selector && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);\n\n var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);\n\n if (selector) {\n if (selectorPosition === 'end') {\n selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;\n } else {\n var offset = selectorRect[wh] + selectorButtonGap;\n selectorPos[orientIdx] -= offset;\n mainRect[xy] -= offset;\n }\n\n mainRect[wh] += selectorRect[wh] + selectorButtonGap;\n selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;\n mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);\n mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);\n selectorGroup.x = selectorPos[0];\n selectorGroup.y = selectorPos[1];\n selectorGroup.markRedraw();\n }\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._layoutContentAndController = function (legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {\n var contentGroup = this.getContentGroup();\n var containerGroup = this._containerGroup;\n var controllerGroup = this._controllerGroup; // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);\n layoutUtil.box( // Buttons in controller are layout always horizontally.\n 'horizontal', controllerGroup, legendModel.get('pageButtonItemGap', true));\n var contentRect = contentGroup.getBoundingRect();\n var controllerRect = controllerGroup.getBoundingRect();\n var showController = this._showController = contentRect[wh] > maxSize[wh]; // In case that the inner elements of contentGroup layout do not based on [0, 0]\n\n var contentPos = [-contentRect.x, -contentRect.y]; // Remain contentPos when scroll animation perfroming.\n // If first rendering, `contentGroup.position` is [0, 0], which\n // does not make sense and may cause unexepcted animation if adopted.\n\n if (!isFirstRender) {\n contentPos[orientIdx] = contentGroup[xy];\n } // Layout container group based on 0.\n\n\n var containerPos = [0, 0];\n var controllerPos = [-controllerRect.x, -controllerRect.y];\n var pageButtonGap = zrUtil.retrieve2(legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true)); // Place containerGroup and controllerGroup and contentGroup.\n\n if (showController) {\n var pageButtonPosition = legendModel.get('pageButtonPosition', true); // controller is on the right / bottom.\n\n if (pageButtonPosition === 'end') {\n controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];\n } // controller is on the left / top.\n else {\n containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;\n }\n } // Always align controller to content as 'middle'.\n\n\n controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;\n contentGroup.setPosition(contentPos);\n containerGroup.setPosition(containerPos);\n controllerGroup.setPosition(controllerPos); // Calculate `mainRect` and set `clipPath`.\n // mainRect should not be calculated by `this.group.getBoundingRect()`\n // for sake of the overflow.\n\n var mainRect = {\n x: 0,\n y: 0\n }; // Consider content may be overflow (should be clipped).\n\n mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];\n mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); // `containerRect[yx] + containerPos[1 - orientIdx]` is 0.\n\n mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);\n containerGroup.__rectSize = maxSize[wh];\n\n if (showController) {\n var clipShape = {\n x: 0,\n y: 0\n };\n clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);\n clipShape[hw] = mainRect[hw];\n containerGroup.setClipPath(new graphic.Rect({\n shape: clipShape\n })); // Consider content may be larger than container, container rect\n // can not be obtained from `containerGroup.getBoundingRect()`.\n\n containerGroup.__rectSize = clipShape[wh];\n } else {\n // Do not remove or ignore controller. Keep them set as placeholders.\n controllerGroup.eachChild(function (child) {\n child.attr({\n invisible: true,\n silent: true\n });\n });\n } // Content translate animation.\n\n\n var pageInfo = this._getPageInfo(legendModel);\n\n pageInfo.pageIndex != null && graphic.updateProps(contentGroup, {\n x: pageInfo.contentPosition[0],\n y: pageInfo.contentPosition[1]\n }, // When switch from \"show controller\" to \"not show controller\", view should be\n // updated immediately without animation, otherwise causes weird effect.\n showController ? legendModel : null);\n\n this._updatePageInfoView(legendModel, pageInfo);\n\n return mainRect;\n };\n\n ScrollableLegendView.prototype._pageGo = function (to, legendModel, api) {\n var scrollDataIndex = this._getPageInfo(legendModel)[to];\n\n scrollDataIndex != null && api.dispatchAction({\n type: 'legendScroll',\n scrollDataIndex: scrollDataIndex,\n legendId: legendModel.id\n });\n };\n\n ScrollableLegendView.prototype._updatePageInfoView = function (legendModel, pageInfo) {\n var controllerGroup = this._controllerGroup;\n zrUtil.each(['pagePrev', 'pageNext'], function (name) {\n var key = name + 'DataIndex';\n var canJump = pageInfo[key] != null;\n var icon = controllerGroup.childOfName(name);\n\n if (icon) {\n icon.setStyle('fill', canJump ? legendModel.get('pageIconColor', true) : legendModel.get('pageIconInactiveColor', true));\n icon.cursor = canJump ? 'pointer' : 'default';\n }\n });\n var pageText = controllerGroup.childOfName('pageText');\n var pageFormatter = legendModel.get('pageFormatter');\n var pageIndex = pageInfo.pageIndex;\n var current = pageIndex != null ? pageIndex + 1 : 0;\n var total = pageInfo.pageCount;\n pageText && pageFormatter && pageText.setStyle('text', zrUtil.isString(pageFormatter) ? pageFormatter.replace('{current}', current == null ? '' : current + '').replace('{total}', total == null ? '' : total + '') : pageFormatter({\n current: current,\n total: total\n }));\n };\n /**\r\n * contentPosition: Array., null when data item not found.\r\n * pageIndex: number, null when data item not found.\r\n * pageCount: number, always be a number, can be 0.\r\n * pagePrevDataIndex: number, null when no previous page.\r\n * pageNextDataIndex: number, null when no next page.\r\n * }\r\n */\n\n\n ScrollableLegendView.prototype._getPageInfo = function (legendModel) {\n var scrollDataIndex = legendModel.get('scrollDataIndex', true);\n var contentGroup = this.getContentGroup();\n var containerRectSize = this._containerGroup.__rectSize;\n var orientIdx = legendModel.getOrient().index;\n var wh = WH[orientIdx];\n var xy = XY[orientIdx];\n\n var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);\n\n var children = contentGroup.children();\n var targetItem = children[targetItemIndex];\n var itemCount = children.length;\n var pCount = !itemCount ? 0 : 1;\n var result = {\n contentPosition: [contentGroup.x, contentGroup.y],\n pageCount: pCount,\n pageIndex: pCount - 1,\n pagePrevDataIndex: null,\n pageNextDataIndex: null\n };\n\n if (!targetItem) {\n return result;\n }\n\n var targetItemInfo = getItemInfo(targetItem);\n result.contentPosition[orientIdx] = -targetItemInfo.s; // Strategy:\n // (1) Always align based on the left/top most item.\n // (2) It is user-friendly that the last item shown in the\n // current window is shown at the begining of next window.\n // Otherwise if half of the last item is cut by the window,\n // it will have no chance to display entirely.\n // (3) Consider that item size probably be different, we\n // have calculate pageIndex by size rather than item index,\n // and we can not get page index directly by division.\n // (4) The window is to narrow to contain more than\n // one item, we should make sure that the page can be fliped.\n\n for (var i = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i <= itemCount; ++i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // Half of the last item is out of the window.\n !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || // If the current item does not intersect with the window, the new page\n // can be started at the current item or the last item.\n currItemInfo && !intersect(currItemInfo, winStartItemInfo.s)) {\n if (winEndItemInfo.i > winStartItemInfo.i) {\n winStartItemInfo = winEndItemInfo;\n } else {\n // e.g., when page size is smaller than item size.\n winStartItemInfo = currItemInfo;\n }\n\n if (winStartItemInfo) {\n if (result.pageNextDataIndex == null) {\n result.pageNextDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n }\n }\n\n winEndItemInfo = currItemInfo;\n }\n\n for (var i = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i >= -1; --i) {\n currItemInfo = getItemInfo(children[i]);\n\n if ( // If the the end item does not intersect with the window started\n // from the current item, a page can be settled.\n (!currItemInfo || !intersect(winEndItemInfo, currItemInfo.s)) && // e.g., when page size is smaller than item size.\n winStartItemInfo.i < winEndItemInfo.i) {\n winEndItemInfo = winStartItemInfo;\n\n if (result.pagePrevDataIndex == null) {\n result.pagePrevDataIndex = winStartItemInfo.i;\n }\n\n ++result.pageCount;\n ++result.pageIndex;\n }\n\n winStartItemInfo = currItemInfo;\n }\n\n return result;\n\n function getItemInfo(el) {\n if (el) {\n var itemRect = el.getBoundingRect();\n var start = itemRect[xy] + el[xy];\n return {\n s: start,\n e: start + itemRect[wh],\n i: el.__legendDataIndex\n };\n }\n }\n\n function intersect(itemInfo, winStart) {\n return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;\n }\n };\n\n ScrollableLegendView.prototype._findTargetItemIndex = function (targetDataIndex) {\n if (!this._showController) {\n return 0;\n }\n\n var index;\n var contentGroup = this.getContentGroup();\n var defaultIndex;\n contentGroup.eachChild(function (child, idx) {\n var legendDataIdx = child.__legendDataIndex; // FIXME\n // If the given targetDataIndex (from model) is illegal,\n // we use defaultIndex. But the index on the legend model and\n // action payload is still illegal. That case will not be\n // changed until some scenario requires.\n\n if (defaultIndex == null && legendDataIdx != null) {\n defaultIndex = idx;\n }\n\n if (legendDataIdx === targetDataIndex) {\n index = idx;\n }\n });\n return index != null ? index : defaultIndex;\n };\n\n ScrollableLegendView.type = 'legend.scroll';\n return ScrollableLegendView;\n}(LegendView);\n\nexport default ScrollableLegendView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport default function installScrollableLegendAction(registers) {\n /**\r\n * @event legendScroll\r\n * @type {Object}\r\n * @property {string} type 'legendScroll'\r\n * @property {string} scrollDataIndex\r\n */\n registers.registerAction('legendScroll', 'legendscroll', function (payload, ecModel) {\n var scrollDataIndex = payload.scrollDataIndex;\n scrollDataIndex != null && ecModel.eachComponent({\n mainType: 'legend',\n subType: 'scroll',\n query: payload\n }, function (legendModel) {\n legendModel.setScrollDataIndex(scrollDataIndex);\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport ScrollableLegendModel from './ScrollableLegendModel.js';\nimport ScrollableLegendView from './ScrollableLegendView.js';\nimport installScrollableLegendAction from './scrollableLegendAction.js';\nexport function install(registers) {\n use(installLegendPlain);\n registers.registerComponentModel(ScrollableLegendModel);\n registers.registerComponentView(ScrollableLegendView);\n installScrollableLegendAction(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installLegendPlain } from './installLegendPlain.js';\nimport { install as installLegendScroll } from './installLegendScroll.js';\nexport function install(registers) {\n use(installLegendPlain);\n use(installLegendScroll);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar InsideZoomModel =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomModel, _super);\n\n function InsideZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = InsideZoomModel.type;\n return _this;\n }\n\n InsideZoomModel.type = 'dataZoom.inside';\n InsideZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n disabled: false,\n zoomLock: false,\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: false,\n preventDefaultMouseMove: true\n });\n return InsideZoomModel;\n}(DataZoomModel);\n\nexport default InsideZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Only create one roam controller for each coordinate system.\n// one roam controller might be refered by two inside data zoom\n// components (for example, one for x and one for y). When user\n// pan or zoom, only dispatch one action for those data zoom\n// components.\nimport RoamController from '../../component/helper/RoamController.js';\nimport * as throttleUtil from '../../util/throttle.js';\nimport { makeInner } from '../../util/model.js';\nimport { each, curry, createHashMap } from 'zrender/lib/core/util.js';\nimport { collectReferCoordSysModelInfo } from './helper.js';\nvar inner = makeInner();\nexport function setViewInfoToCoordSysRecord(api, dataZoomModel, getRange) {\n inner(api).coordSysRecordMap.each(function (coordSysRecord) {\n var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);\n\n if (dzInfo) {\n dzInfo.getRange = getRange;\n }\n });\n}\nexport function disposeCoordSysRecordIfNeeded(api, dataZoomModel) {\n var coordSysRecordMap = inner(api).coordSysRecordMap;\n var coordSysKeyArr = coordSysRecordMap.keys();\n\n for (var i = 0; i < coordSysKeyArr.length; i++) {\n var coordSysKey = coordSysKeyArr[i];\n var coordSysRecord = coordSysRecordMap.get(coordSysKey);\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var dzUid = dataZoomModel.uid;\n var dzInfo = dataZoomInfoMap.get(dzUid);\n\n if (dzInfo) {\n dataZoomInfoMap.removeKey(dzUid);\n\n if (!dataZoomInfoMap.keys().length) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n }\n }\n }\n }\n}\n\nfunction disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {\n if (coordSysRecord) {\n coordSysRecordMap.removeKey(coordSysRecord.model.uid);\n var controller = coordSysRecord.controller;\n controller && controller.dispose();\n }\n}\n\nfunction createCoordSysRecord(api, coordSysModel) {\n // These init props will never change after record created.\n var coordSysRecord = {\n model: coordSysModel,\n containsPoint: curry(containsPoint, coordSysModel),\n dispatchAction: curry(dispatchAction, api),\n dataZoomInfoMap: null,\n controller: null\n }; // Must not do anything depends on coordSysRecord outside the event handler here,\n // because coordSysRecord not completed yet.\n\n var controller = coordSysRecord.controller = new RoamController(api.getZr());\n each(['pan', 'zoom', 'scrollMove'], function (eventName) {\n controller.on(eventName, function (event) {\n var batch = [];\n coordSysRecord.dataZoomInfoMap.each(function (dzInfo) {\n // Check whether the behaviors (zoomOnMouseWheel, moveOnMouseMove,\n // moveOnMouseWheel, ...) enabled.\n if (!event.isAvailableBehavior(dzInfo.model.option)) {\n return;\n }\n\n var method = (dzInfo.getRange || {})[eventName];\n var range = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);\n !dzInfo.model.get('disabled', true) && range && batch.push({\n dataZoomId: dzInfo.model.id,\n start: range[0],\n end: range[1]\n });\n });\n batch.length && coordSysRecord.dispatchAction(batch);\n });\n });\n return coordSysRecord;\n}\n/**\r\n * This action will be throttled.\r\n */\n\n\nfunction dispatchAction(api, batch) {\n if (!api.isDisposed()) {\n api.dispatchAction({\n type: 'dataZoom',\n animation: {\n easing: 'cubicOut',\n duration: 100\n },\n batch: batch\n });\n }\n}\n\nfunction containsPoint(coordSysModel, e, x, y) {\n return coordSysModel.coordinateSystem.containPoint([x, y]);\n}\n/**\r\n * Merge roamController settings when multiple dataZooms share one roamController.\r\n */\n\n\nfunction mergeControllerParams(dataZoomInfoMap) {\n var controlType; // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated\n // as string, it is probably revert to reserved word by compress tool. See #7411.\n\n var prefix = 'type_';\n var typePriority = {\n 'type_true': 2,\n 'type_move': 1,\n 'type_false': 0,\n 'type_undefined': -1\n };\n var preventDefaultMouseMove = true;\n dataZoomInfoMap.each(function (dataZoomInfo) {\n var dataZoomModel = dataZoomInfo.model;\n var oneType = dataZoomModel.get('disabled', true) ? false : dataZoomModel.get('zoomLock', true) ? 'move' : true;\n\n if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {\n controlType = oneType;\n } // Prevent default move event by default. If one false, do not prevent. Otherwise\n // users may be confused why it does not work when multiple insideZooms exist.\n\n\n preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', true);\n });\n return {\n controlType: controlType,\n opt: {\n // RoamController will enable all of these functionalities,\n // and the final behavior is determined by its event listener\n // provided by each inside zoom.\n zoomOnMouseWheel: true,\n moveOnMouseMove: true,\n moveOnMouseWheel: true,\n preventDefaultMouseMove: !!preventDefaultMouseMove\n }\n };\n}\n\nexport function installDataZoomRoamProcessor(registers) {\n registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function (ecModel, api) {\n var apiInner = inner(api);\n var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());\n coordSysRecordMap.each(function (coordSysRecord) {\n // `coordSysRecordMap` always exists (because it holds the `roam controller`, which should\n // better not re-create each time), but clear `dataZoomInfoMap` each round of the workflow.\n coordSysRecord.dataZoomInfoMap = null;\n });\n ecModel.eachComponent({\n mainType: 'dataZoom',\n subType: 'inside'\n }, function (dataZoomModel) {\n var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);\n each(dzReferCoordSysWrap.infoList, function (dzCoordSysInfo) {\n var coordSysUid = dzCoordSysInfo.model.uid;\n var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api, dzCoordSysInfo.model));\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap()); // Notice these props might be changed each time for a single dataZoomModel.\n\n dataZoomInfoMap.set(dataZoomModel.uid, {\n dzReferCoordSysInfo: dzCoordSysInfo,\n model: dataZoomModel,\n getRange: null\n });\n });\n }); // (1) Merge dataZoom settings for each coord sys and set to the roam controller.\n // (2) Clear coord sys if not refered by any dataZoom.\n\n coordSysRecordMap.each(function (coordSysRecord) {\n var controller = coordSysRecord.controller;\n var firstDzInfo;\n var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;\n\n if (dataZoomInfoMap) {\n var firstDzKey = dataZoomInfoMap.keys()[0];\n\n if (firstDzKey != null) {\n firstDzInfo = dataZoomInfoMap.get(firstDzKey);\n }\n }\n\n if (!firstDzInfo) {\n disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);\n return;\n }\n\n var controllerParams = mergeControllerParams(dataZoomInfoMap);\n controller.enable(controllerParams.controlType, controllerParams.opt);\n controller.setPointerChecker(coordSysRecord.containsPoint);\n throttleUtil.createOrUpdate(coordSysRecord, 'dispatchAction', firstDzInfo.model.get('throttle', true), 'fixRate');\n });\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomView from './DataZoomView.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as roams from './roams.js';\nimport { bind } from 'zrender/lib/core/util.js';\n\nvar InsideZoomView =\n/** @class */\nfunction (_super) {\n __extends(InsideZoomView, _super);\n\n function InsideZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataZoom.inside';\n return _this;\n }\n\n InsideZoomView.prototype.render = function (dataZoomModel, ecModel, api) {\n _super.prototype.render.apply(this, arguments);\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n return;\n } // Hence the `throttle` util ensures to preserve command order,\n // here simply updating range all the time will not cause missing\n // any of the the roam change.\n\n\n this.range = dataZoomModel.getPercentRange(); // Reset controllers.\n\n roams.setViewInfoToCoordSysRecord(api, dataZoomModel, {\n pan: bind(getRangeHandlers.pan, this),\n zoom: bind(getRangeHandlers.zoom, this),\n scrollMove: bind(getRangeHandlers.scrollMove, this)\n });\n };\n\n InsideZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n InsideZoomView.prototype._clear = function () {\n roams.disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);\n this.range = null;\n };\n\n InsideZoomView.type = 'dataZoom.inside';\n return InsideZoomView;\n}(DataZoomView);\n\nvar getRangeHandlers = {\n zoom: function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var directionInfo = getDirectionInfo[coordSysMainType](null, [e.originX, e.originY], axisModel, controller, coordSysInfo);\n var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range[1] - range[0]) + range[0];\n var scale = Math.max(1 / e.scale, 0);\n range[0] = (range[0] - percentPoint) * scale + percentPoint;\n range[1] = (range[1] - percentPoint) * scale + percentPoint; // Restrict range.\n\n var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n },\n pan: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * directionInfo.pixel / directionInfo.pixelLength;\n }),\n scrollMove: makeMover(function (range, axisModel, coordSysInfo, coordSysMainType, controller, e) {\n var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e.scrollDelta, e.scrollDelta], axisModel, controller, coordSysInfo);\n return directionInfo.signal * (range[1] - range[0]) * e.scrollDelta;\n })\n};\n\nfunction makeMover(getPercentDelta) {\n return function (coordSysInfo, coordSysMainType, controller, e) {\n var lastRange = this.range;\n var range = lastRange.slice(); // Calculate transform by the first axis.\n\n var axisModel = coordSysInfo.axisModels[0];\n\n if (!axisModel) {\n return;\n }\n\n var percentDelta = getPercentDelta(range, axisModel, coordSysInfo, coordSysMainType, controller, e);\n sliderMove(percentDelta, range, [0, 100], 'all');\n this.range = range;\n\n if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) {\n return range;\n }\n };\n}\n\nvar getDirectionInfo = {\n grid: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n oldPoint = oldPoint || [0, 0];\n\n if (axis.dim === 'x') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // axis.dim === 'y'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n polar: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var ret = {};\n var polar = coordSysInfo.model.coordinateSystem;\n var radiusExtent = polar.getRadiusAxis().getExtent();\n var angleExtent = polar.getAngleAxis().getExtent();\n oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];\n newPoint = polar.pointToCoord(newPoint);\n\n if (axisModel.mainType === 'radiusAxis') {\n ret.pixel = newPoint[0] - oldPoint[0]; // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]);\n // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]);\n\n ret.pixelLength = radiusExtent[1] - radiusExtent[0];\n ret.pixelStart = radiusExtent[0];\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'angleAxis'\n ret.pixel = newPoint[1] - oldPoint[1]; // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]);\n // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]);\n\n ret.pixelLength = angleExtent[1] - angleExtent[0];\n ret.pixelStart = angleExtent[0];\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n },\n singleAxis: function (oldPoint, newPoint, axisModel, controller, coordSysInfo) {\n var axis = axisModel.axis;\n var rect = coordSysInfo.model.coordinateSystem.getRect();\n var ret = {};\n oldPoint = oldPoint || [0, 0];\n\n if (axis.orient === 'horizontal') {\n ret.pixel = newPoint[0] - oldPoint[0];\n ret.pixelLength = rect.width;\n ret.pixelStart = rect.x;\n ret.signal = axis.inverse ? 1 : -1;\n } else {\n // 'vertical'\n ret.pixel = newPoint[1] - oldPoint[1];\n ret.pixelLength = rect.height;\n ret.pixelStart = rect.y;\n ret.signal = axis.inverse ? -1 : 1;\n }\n\n return ret;\n }\n};\nexport default InsideZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport InsideZoomModel from './InsideZoomModel.js';\nimport InsideZoomView from './InsideZoomView.js';\nimport { installDataZoomRoamProcessor } from './roams.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n installCommon(registers);\n registers.registerComponentModel(InsideZoomModel);\n registers.registerComponentView(InsideZoomView);\n installDataZoomRoamProcessor(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport DataZoomModel from './DataZoomModel.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar SliderZoomModel =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomModel, _super);\n\n function SliderZoomModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomModel.type;\n return _this;\n }\n\n SliderZoomModel.type = 'dataZoom.slider';\n SliderZoomModel.layoutMode = 'box';\n SliderZoomModel.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {\n show: true,\n // deault value can only be drived in view stage.\n right: 'ph',\n top: 'ph',\n width: 'ph',\n height: 'ph',\n left: null,\n bottom: null,\n borderColor: '#d2dbee',\n borderRadius: 3,\n backgroundColor: 'rgba(47,69,84,0)',\n // dataBackgroundColor: '#ddd',\n dataBackground: {\n lineStyle: {\n color: '#d2dbee',\n width: 0.5\n },\n areaStyle: {\n color: '#d2dbee',\n opacity: 0.2\n }\n },\n selectedDataBackground: {\n lineStyle: {\n color: '#8fb0f7',\n width: 0.5\n },\n areaStyle: {\n color: '#8fb0f7',\n opacity: 0.2\n }\n },\n // Color of selected window.\n fillerColor: 'rgba(135,175,274,0.2)',\n handleIcon: 'path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z',\n // Percent of the slider height\n handleSize: '100%',\n handleStyle: {\n color: '#fff',\n borderColor: '#ACB8D1'\n },\n moveHandleSize: 7,\n moveHandleIcon: 'path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z',\n moveHandleStyle: {\n color: '#D2DBEE',\n opacity: 0.7\n },\n showDetail: true,\n showDataShadow: 'auto',\n realtime: true,\n zoomLock: false,\n textStyle: {\n color: '#6E7079'\n },\n brushSelect: true,\n brushStyle: {\n color: 'rgba(135,175,274,0.15)'\n },\n emphasis: {\n handleStyle: {\n borderColor: '#8FB0F7'\n },\n moveHandleStyle: {\n color: '#8FB0F7'\n }\n }\n });\n return SliderZoomModel;\n}(DataZoomModel);\n\nexport default SliderZoomModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport { bind, each, isFunction, isString, indexOf } from 'zrender/lib/core/util.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as throttle from '../../util/throttle.js';\nimport DataZoomView from './DataZoomView.js';\nimport { linearMap, asc, parsePercent } from '../../util/number.js';\nimport * as layout from '../../util/layout.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport { getAxisMainType, collectReferCoordSysModelInfo } from './helper.js';\nimport { enableHoverEmphasis } from '../../util/states.js';\nimport { createSymbol, symbolBuildProxies } from '../../util/symbol.js';\nimport { deprecateLog } from '../../util/log.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nvar Rect = graphic.Rect; // Constants\n\nvar DEFAULT_LOCATION_EDGE_GAP = 7;\nvar DEFAULT_FRAME_BORDER_WIDTH = 1;\nvar DEFAULT_FILLER_SIZE = 30;\nvar DEFAULT_MOVE_HANDLE_SIZE = 7;\nvar HORIZONTAL = 'horizontal';\nvar VERTICAL = 'vertical';\nvar LABEL_GAP = 5;\nvar SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];\nvar REALTIME_ANIMATION_CONFIG = {\n easing: 'cubicOut',\n duration: 100,\n delay: 0\n};\n\nvar SliderZoomView =\n/** @class */\nfunction (_super) {\n __extends(SliderZoomView, _super);\n\n function SliderZoomView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SliderZoomView.type;\n _this._displayables = {};\n return _this;\n }\n\n SliderZoomView.prototype.init = function (ecModel, api) {\n this.api = api; // A unique handler for each dataZoom component\n\n this._onBrush = bind(this._onBrush, this);\n this._onBrushEnd = bind(this._onBrushEnd, this);\n };\n\n SliderZoomView.prototype.render = function (dataZoomModel, ecModel, api, payload) {\n _super.prototype.render.apply(this, arguments);\n\n throttle.createOrUpdate(this, '_dispatchZoomAction', dataZoomModel.get('throttle'), 'fixRate');\n this._orient = dataZoomModel.getOrient();\n\n if (dataZoomModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n if (dataZoomModel.noTarget()) {\n this._clear();\n\n this.group.removeAll();\n return;\n } // Notice: this._resetInterval() should not be executed when payload.type\n // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'\n // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,\n\n\n if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {\n this._buildView();\n }\n\n this._updateView();\n };\n\n SliderZoomView.prototype.dispose = function () {\n this._clear();\n\n _super.prototype.dispose.apply(this, arguments);\n };\n\n SliderZoomView.prototype._clear = function () {\n throttle.clear(this, '_dispatchZoomAction');\n var zr = this.api.getZr();\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n };\n\n SliderZoomView.prototype._buildView = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n this._brushing = false;\n this._displayables.brushRect = null;\n\n this._resetLocation();\n\n this._resetInterval();\n\n var barGroup = this._displayables.sliderGroup = new graphic.Group();\n\n this._renderBackground();\n\n this._renderHandle();\n\n this._renderDataShadow();\n\n thisGroup.add(barGroup);\n\n this._positionGroup();\n };\n\n SliderZoomView.prototype._resetLocation = function () {\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var showMoveHandle = dataZoomModel.get('brushSelect');\n var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0; // If some of x/y/width/height are not specified,\n // auto-adapt according to target grid.\n\n var coordRect = this._findCoordRect();\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n }; // Default align by coordinate system rect.\n\n var positionInfo = this._orient === HORIZONTAL ? {\n // Why using 'right', because right should be used in vertical,\n // and it is better to be consistent for dealing with position param merge.\n right: ecSize.width - coordRect.x - coordRect.width,\n top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,\n width: coordRect.width,\n height: DEFAULT_FILLER_SIZE\n } : {\n right: DEFAULT_LOCATION_EDGE_GAP,\n top: coordRect.y,\n width: DEFAULT_FILLER_SIZE,\n height: coordRect.height\n }; // Do not write back to option and replace value 'ph', because\n // the 'ph' value should be recalculated when resize.\n\n var layoutParams = layout.getLayoutParams(dataZoomModel.option); // Replace the placeholder value.\n\n each(['right', 'top', 'width', 'height'], function (name) {\n if (layoutParams[name] === 'ph') {\n layoutParams[name] = positionInfo[name];\n }\n });\n var layoutRect = layout.getLayoutRect(layoutParams, ecSize);\n this._location = {\n x: layoutRect.x,\n y: layoutRect.y\n };\n this._size = [layoutRect.width, layoutRect.height];\n this._orient === VERTICAL && this._size.reverse();\n };\n\n SliderZoomView.prototype._positionGroup = function () {\n var thisGroup = this.group;\n var location = this._location;\n var orient = this._orient; // Just use the first axis to determine mapping.\n\n var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();\n var inverse = targetAxisModel && targetAxisModel.get('inverse');\n var sliderGroup = this._displayables.sliderGroup;\n var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse; // Transform barGroup.\n\n sliderGroup.attr(orient === HORIZONTAL && !inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: 1\n } : orient === HORIZONTAL && inverse ? {\n scaleY: otherAxisInverse ? 1 : -1,\n scaleX: -1\n } : orient === VERTICAL && !inverse ? {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: 1,\n rotation: Math.PI / 2\n } // Don't use Math.PI, considering shadow direction.\n : {\n scaleY: otherAxisInverse ? -1 : 1,\n scaleX: -1,\n rotation: Math.PI / 2\n }); // Position barGroup\n\n var rect = thisGroup.getBoundingRect([sliderGroup]);\n thisGroup.x = location.x - rect.x;\n thisGroup.y = location.y - rect.y;\n thisGroup.markRedraw();\n };\n\n SliderZoomView.prototype._getViewExtent = function () {\n return [0, this._size[0]];\n };\n\n SliderZoomView.prototype._renderBackground = function () {\n var dataZoomModel = this.dataZoomModel;\n var size = this._size;\n var barGroup = this._displayables.sliderGroup;\n var brushSelect = dataZoomModel.get('brushSelect');\n barGroup.add(new Rect({\n silent: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: dataZoomModel.get('backgroundColor')\n },\n z2: -40\n })); // Click panel, over shadow, below handles.\n\n var clickPanel = new Rect({\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1]\n },\n style: {\n fill: 'transparent'\n },\n z2: 0,\n onclick: bind(this._onClickPanel, this)\n });\n var zr = this.api.getZr();\n\n if (brushSelect) {\n clickPanel.on('mousedown', this._onBrushStart, this);\n clickPanel.cursor = 'crosshair';\n zr.on('mousemove', this._onBrush);\n zr.on('mouseup', this._onBrushEnd);\n } else {\n zr.off('mousemove', this._onBrush);\n zr.off('mouseup', this._onBrushEnd);\n }\n\n barGroup.add(clickPanel);\n };\n\n SliderZoomView.prototype._renderDataShadow = function () {\n var info = this._dataShadowInfo = this._prepareDataShadowInfo();\n\n this._displayables.dataShadowSegs = [];\n\n if (!info) {\n return;\n }\n\n var size = this._size;\n var oldSize = this._shadowSize || [];\n var seriesModel = info.series;\n var data = seriesModel.getRawData();\n var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();\n var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() // @see candlestick\n : info.otherDim;\n\n if (otherDim == null) {\n return;\n }\n\n var polygonPts = this._shadowPolygonPts;\n var polylinePts = this._shadowPolylinePts; // Not re-render if data doesn't change.\n\n if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n var otherDataExtent_1 = data.getDataExtent(otherDim); // Nice extent.\n\n var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;\n otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];\n var otherShadowExtent_1 = [0, size[1]];\n var thisShadowExtent = [0, size[0]];\n var areaPoints_1 = [[size[0], 0], [0, 0]];\n var linePoints_1 = [];\n var step_1 = thisShadowExtent[1] / (data.count() - 1);\n var thisCoord_1 = 0; // Optimize for large data shadow\n\n var stride_1 = Math.round(data.count() / size[0]);\n var lastIsEmpty_1;\n data.each([otherDim], function (value, index) {\n if (stride_1 > 0 && index % stride_1) {\n thisCoord_1 += step_1;\n return;\n } // FIXME\n // Should consider axis.min/axis.max when drawing dataShadow.\n // FIXME\n // 应该使用统一的空判断?还是在list里进行空判断?\n\n\n var isEmpty = value == null || isNaN(value) || value === ''; // See #4235.\n\n var otherCoord = isEmpty ? 0 : linearMap(value, otherDataExtent_1, otherShadowExtent_1, true); // Attempt to draw data shadow precisely when there are empty value.\n\n if (isEmpty && !lastIsEmpty_1 && index) {\n areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);\n linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);\n } else if (!isEmpty && lastIsEmpty_1) {\n areaPoints_1.push([thisCoord_1, 0]);\n linePoints_1.push([thisCoord_1, 0]);\n }\n\n areaPoints_1.push([thisCoord_1, otherCoord]);\n linePoints_1.push([thisCoord_1, otherCoord]);\n thisCoord_1 += step_1;\n lastIsEmpty_1 = isEmpty;\n });\n polygonPts = this._shadowPolygonPts = areaPoints_1;\n polylinePts = this._shadowPolylinePts = linePoints_1;\n }\n\n this._shadowData = data;\n this._shadowDim = otherDim;\n this._shadowSize = [size[0], size[1]];\n var dataZoomModel = this.dataZoomModel;\n\n function createDataShadowGroup(isSelectedArea) {\n var model = dataZoomModel.getModel(isSelectedArea ? 'selectedDataBackground' : 'dataBackground');\n var group = new graphic.Group();\n var polygon = new graphic.Polygon({\n shape: {\n points: polygonPts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('areaStyle').getAreaStyle(),\n silent: true,\n z2: -20\n });\n var polyline = new graphic.Polyline({\n shape: {\n points: polylinePts\n },\n segmentIgnoreThreshold: 1,\n style: model.getModel('lineStyle').getLineStyle(),\n silent: true,\n z2: -19\n });\n group.add(polygon);\n group.add(polyline);\n return group;\n } // let dataBackgroundModel = dataZoomModel.getModel('dataBackground');\n\n\n for (var i = 0; i < 3; i++) {\n var group = createDataShadowGroup(i === 1);\n\n this._displayables.sliderGroup.add(group);\n\n this._displayables.dataShadowSegs.push(group);\n }\n };\n\n SliderZoomView.prototype._prepareDataShadowInfo = function () {\n var dataZoomModel = this.dataZoomModel;\n var showDataShadow = dataZoomModel.get('showDataShadow');\n\n if (showDataShadow === false) {\n return;\n } // Find a representative series.\n\n\n var result;\n var ecModel = this.ecModel;\n dataZoomModel.eachTargetAxis(function (axisDim, axisIndex) {\n var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();\n each(seriesModels, function (seriesModel) {\n if (result) {\n return;\n }\n\n if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')) < 0) {\n return;\n }\n\n var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;\n var otherDim = getOtherDim(axisDim);\n var otherAxisInverse;\n var coordSys = seriesModel.coordinateSystem;\n\n if (otherDim != null && coordSys.getOtherAxis) {\n otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;\n }\n\n otherDim = seriesModel.getData().mapDimension(otherDim);\n result = {\n thisAxis: thisAxis,\n series: seriesModel,\n thisDim: axisDim,\n otherDim: otherDim,\n otherAxisInverse: otherAxisInverse\n };\n }, this);\n }, this);\n return result;\n };\n\n SliderZoomView.prototype._renderHandle = function () {\n var thisGroup = this.group;\n var displayables = this._displayables;\n var handles = displayables.handles = [null, null];\n var handleLabels = displayables.handleLabels = [null, null];\n var sliderGroup = this._displayables.sliderGroup;\n var size = this._size;\n var dataZoomModel = this.dataZoomModel;\n var api = this.api;\n var borderRadius = dataZoomModel.get('borderRadius') || 0;\n var brushSelect = dataZoomModel.get('brushSelect');\n var filler = displayables.filler = new Rect({\n silent: brushSelect,\n style: {\n fill: dataZoomModel.get('fillerColor')\n },\n textConfig: {\n position: 'inside'\n }\n });\n sliderGroup.add(filler); // Frame border.\n\n sliderGroup.add(new Rect({\n silent: true,\n subPixelOptimize: true,\n shape: {\n x: 0,\n y: 0,\n width: size[0],\n height: size[1],\n r: borderRadius\n },\n style: {\n // deprecated option\n stroke: dataZoomModel.get('dataBackgroundColor') || dataZoomModel.get('borderColor'),\n lineWidth: DEFAULT_FRAME_BORDER_WIDTH,\n fill: 'rgba(0,0,0,0)'\n }\n })); // Left and right handle to resize\n\n each([0, 1], function (handleIndex) {\n var iconStr = dataZoomModel.get('handleIcon');\n\n if (!symbolBuildProxies[iconStr] && iconStr.indexOf('path://') < 0 && iconStr.indexOf('image://') < 0) {\n // Compatitable with the old icon parsers. Which can use a path string without path://\n iconStr = 'path://' + iconStr;\n\n if (process.env.NODE_ENV !== 'production') {\n deprecateLog('handleIcon now needs \\'path://\\' prefix when using a path string');\n }\n }\n\n var path = createSymbol(iconStr, -1, 0, 2, 2, null, true);\n path.attr({\n cursor: getCursor(this._orient),\n draggable: true,\n drift: bind(this._onDragMove, this, handleIndex),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false),\n z2: 5\n });\n var bRect = path.getBoundingRect();\n var handleSize = dataZoomModel.get('handleSize');\n this._handleHeight = parsePercent(handleSize, this._size[1]);\n this._handleWidth = bRect.width / bRect.height * this._handleHeight;\n path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle());\n path.style.strokeNoScale = true;\n path.rectHover = true;\n path.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n enableHoverEmphasis(path);\n var handleColor = dataZoomModel.get('handleColor'); // deprecated option\n // Compatitable with previous version\n\n if (handleColor != null) {\n path.style.fill = handleColor;\n }\n\n sliderGroup.add(handles[handleIndex] = path);\n var textStyleModel = dataZoomModel.getModel('textStyle');\n thisGroup.add(handleLabels[handleIndex] = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: '',\n verticalAlign: 'middle',\n align: 'center',\n fill: textStyleModel.getTextColor(),\n font: textStyleModel.getFont()\n }),\n z2: 10\n }));\n }, this); // Handle to move. Only visible when brushSelect is set true.\n\n var actualMoveZone = filler;\n\n if (brushSelect) {\n var moveHandleHeight = parsePercent(dataZoomModel.get('moveHandleSize'), size[1]);\n var moveHandle_1 = displayables.moveHandle = new graphic.Rect({\n style: dataZoomModel.getModel('moveHandleStyle').getItemStyle(),\n silent: true,\n shape: {\n r: [0, 0, 2, 2],\n y: size[1] - 0.5,\n height: moveHandleHeight\n }\n });\n var iconSize = moveHandleHeight * 0.8;\n var moveHandleIcon = displayables.moveHandleIcon = createSymbol(dataZoomModel.get('moveHandleIcon'), -iconSize / 2, -iconSize / 2, iconSize, iconSize, '#fff', true);\n moveHandleIcon.silent = true;\n moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;\n moveHandle_1.ensureState('emphasis').style = dataZoomModel.getModel(['emphasis', 'moveHandleStyle']).getItemStyle();\n var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));\n actualMoveZone = displayables.moveZone = new graphic.Rect({\n invisible: true,\n shape: {\n y: size[1] - moveZoneExpandSize,\n height: moveHandleHeight + moveZoneExpandSize\n }\n });\n actualMoveZone.on('mouseover', function () {\n api.enterEmphasis(moveHandle_1);\n }).on('mouseout', function () {\n api.leaveEmphasis(moveHandle_1);\n });\n sliderGroup.add(moveHandle_1);\n sliderGroup.add(moveHandleIcon);\n sliderGroup.add(actualMoveZone);\n }\n\n actualMoveZone.attr({\n draggable: true,\n cursor: getCursor(this._orient),\n drift: bind(this._onDragMove, this, 'all'),\n ondragstart: bind(this._showDataInfo, this, true),\n ondragend: bind(this._onDragEnd, this),\n onmouseover: bind(this._showDataInfo, this, true),\n onmouseout: bind(this._showDataInfo, this, false)\n });\n };\n\n SliderZoomView.prototype._resetInterval = function () {\n var range = this._range = this.dataZoomModel.getPercentRange();\n\n var viewExtent = this._getViewExtent();\n\n this._handleEnds = [linearMap(range[0], [0, 100], viewExtent, true), linearMap(range[1], [0, 100], viewExtent, true)];\n };\n\n SliderZoomView.prototype._updateInterval = function (handleIndex, delta) {\n var dataZoomModel = this.dataZoomModel;\n var handleEnds = this._handleEnds;\n\n var viewExtend = this._getViewExtent();\n\n var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();\n var percentExtent = [0, 100];\n sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get('zoomLock') ? 'all' : handleIndex, minMaxSpan.minSpan != null ? linearMap(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);\n var lastRange = this._range;\n var range = this._range = asc([linearMap(handleEnds[0], viewExtend, percentExtent, true), linearMap(handleEnds[1], viewExtend, percentExtent, true)]);\n return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1];\n };\n\n SliderZoomView.prototype._updateView = function (nonRealtime) {\n var displaybles = this._displayables;\n var handleEnds = this._handleEnds;\n var handleInterval = asc(handleEnds.slice());\n var size = this._size;\n each([0, 1], function (handleIndex) {\n // Handles\n var handle = displaybles.handles[handleIndex];\n var handleHeight = this._handleHeight;\n handle.attr({\n scaleX: handleHeight / 2,\n scaleY: handleHeight / 2,\n // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.\n // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.\n x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),\n y: size[1] / 2 - handleHeight / 2\n });\n }, this); // Filler\n\n displaybles.filler.setShape({\n x: handleInterval[0],\n y: 0,\n width: handleInterval[1] - handleInterval[0],\n height: size[1]\n });\n var viewExtent = {\n x: handleInterval[0],\n width: handleInterval[1] - handleInterval[0]\n }; // Move handle\n\n if (displaybles.moveHandle) {\n displaybles.moveHandle.setShape(viewExtent);\n displaybles.moveZone.setShape(viewExtent); // Force update path on the invisible object\n\n displaybles.moveZone.getBoundingRect();\n displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr('x', viewExtent.x + viewExtent.width / 2);\n } // update clip path of shadow.\n\n\n var dataShadowSegs = displaybles.dataShadowSegs;\n var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];\n\n for (var i = 0; i < dataShadowSegs.length; i++) {\n var segGroup = dataShadowSegs[i];\n var clipPath = segGroup.getClipPath();\n\n if (!clipPath) {\n clipPath = new graphic.Rect();\n segGroup.setClipPath(clipPath);\n }\n\n clipPath.setShape({\n x: segIntervals[i],\n y: 0,\n width: segIntervals[i + 1] - segIntervals[i],\n height: size[1]\n });\n }\n\n this._updateDataInfo(nonRealtime);\n };\n\n SliderZoomView.prototype._updateDataInfo = function (nonRealtime) {\n var dataZoomModel = this.dataZoomModel;\n var displaybles = this._displayables;\n var handleLabels = displaybles.handleLabels;\n var orient = this._orient;\n var labelTexts = ['', '']; // FIXME\n // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)\n\n if (dataZoomModel.get('showDetail')) {\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n\n if (axisProxy) {\n var axis = axisProxy.getAxisModel().axis;\n var range = this._range;\n var dataInterval = nonRealtime // See #4434, data and axis are not processed and reset yet in non-realtime mode.\n ? axisProxy.calculateDataWindow({\n start: range[0],\n end: range[1]\n }).valueWindow : axisProxy.getDataValueWindow();\n labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];\n }\n }\n\n var orderedHandleEnds = asc(this._handleEnds.slice());\n setLabel.call(this, 0);\n setLabel.call(this, 1);\n\n function setLabel(handleIndex) {\n // Label\n // Text should not transform by barGroup.\n // Ignore handlers transform\n var barTransform = graphic.getTransform(displaybles.handles[handleIndex].parent, this.group);\n var direction = graphic.transformDirection(handleIndex === 0 ? 'right' : 'left', barTransform);\n var offset = this._handleWidth / 2 + LABEL_GAP;\n var textPoint = graphic.applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset), this._size[1] / 2], barTransform);\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n verticalAlign: orient === HORIZONTAL ? 'middle' : direction,\n align: orient === HORIZONTAL ? direction : 'center',\n text: labelTexts[handleIndex]\n });\n }\n };\n\n SliderZoomView.prototype._formatLabel = function (value, axis) {\n var dataZoomModel = this.dataZoomModel;\n var labelFormatter = dataZoomModel.get('labelFormatter');\n var labelPrecision = dataZoomModel.get('labelPrecision');\n\n if (labelPrecision == null || labelPrecision === 'auto') {\n labelPrecision = axis.getPixelPrecision();\n }\n\n var valueStr = value == null || isNaN(value) ? '' // FIXME Glue code\n : axis.type === 'category' || axis.type === 'time' ? axis.scale.getLabel({\n value: Math.round(value)\n }) // param of toFixed should less then 20.\n : value.toFixed(Math.min(labelPrecision, 20));\n return isFunction(labelFormatter) ? labelFormatter(value, valueStr) : isString(labelFormatter) ? labelFormatter.replace('{value}', valueStr) : valueStr;\n };\n /**\r\n * @param showOrHide true: show, false: hide\r\n */\n\n\n SliderZoomView.prototype._showDataInfo = function (showOrHide) {\n // Always show when drgging.\n showOrHide = this._dragging || showOrHide;\n var displayables = this._displayables;\n var handleLabels = displayables.handleLabels;\n handleLabels[0].attr('invisible', !showOrHide);\n handleLabels[1].attr('invisible', !showOrHide); // Highlight move handle\n\n displayables.moveHandle && this.api[showOrHide ? 'enterEmphasis' : 'leaveEmphasis'](displayables.moveHandle, 1);\n };\n\n SliderZoomView.prototype._onDragMove = function (handleIndex, dx, dy, event) {\n this._dragging = true; // For mobile device, prevent screen slider on the button.\n\n eventTool.stop(event.event); // Transform dx, dy to bar coordination.\n\n var barTransform = this._displayables.sliderGroup.getLocalTransform();\n\n var vertex = graphic.applyTransform([dx, dy], barTransform, true);\n\n var changed = this._updateInterval(handleIndex, vertex[0]);\n\n var realtime = this.dataZoomModel.get('realtime');\n\n this._updateView(!realtime); // Avoid dispatch dataZoom repeatly but range not changed,\n // which cause bad visual effect when progressive enabled.\n\n\n changed && realtime && this._dispatchZoomAction(true);\n };\n\n SliderZoomView.prototype._onDragEnd = function () {\n this._dragging = false;\n\n this._showDataInfo(false); // While in realtime mode and stream mode, dispatch action when\n // drag end will cause the whole view rerender, which is unnecessary.\n\n\n var realtime = this.dataZoomModel.get('realtime');\n !realtime && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onClickPanel = function (e) {\n var size = this._size;\n\n var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e.offsetX, e.offsetY);\n\n if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {\n return;\n }\n\n var handleEnds = this._handleEnds;\n var center = (handleEnds[0] + handleEnds[1]) / 2;\n\n var changed = this._updateInterval('all', localPoint[0] - center);\n\n this._updateView();\n\n changed && this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrushStart = function (e) {\n var x = e.offsetX;\n var y = e.offsetY;\n this._brushStart = new graphic.Point(x, y);\n this._brushing = true;\n this._brushStartTime = +new Date(); // this._updateBrushRect(x, y);\n };\n\n SliderZoomView.prototype._onBrushEnd = function (e) {\n if (!this._brushing) {\n return;\n }\n\n var brushRect = this._displayables.brushRect;\n this._brushing = false;\n\n if (!brushRect) {\n return;\n }\n\n brushRect.attr('ignore', true);\n var brushShape = brushRect.shape;\n var brushEndTime = +new Date(); // console.log(brushEndTime - this._brushStartTime);\n\n if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {\n // Will treat it as a click\n return;\n }\n\n var viewExtend = this._getViewExtent();\n\n var percentExtent = [0, 100];\n this._range = asc([linearMap(brushShape.x, viewExtend, percentExtent, true), linearMap(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);\n this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];\n\n this._updateView();\n\n this._dispatchZoomAction(false);\n };\n\n SliderZoomView.prototype._onBrush = function (e) {\n if (this._brushing) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n\n this._updateBrushRect(e.offsetX, e.offsetY);\n }\n };\n\n SliderZoomView.prototype._updateBrushRect = function (mouseX, mouseY) {\n var displayables = this._displayables;\n var dataZoomModel = this.dataZoomModel;\n var brushRect = displayables.brushRect;\n\n if (!brushRect) {\n brushRect = displayables.brushRect = new Rect({\n silent: true,\n style: dataZoomModel.getModel('brushStyle').getItemStyle()\n });\n displayables.sliderGroup.add(brushRect);\n }\n\n brushRect.attr('ignore', false);\n var brushStart = this._brushStart;\n var sliderGroup = this._displayables.sliderGroup;\n var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);\n var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);\n var size = this._size;\n endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);\n brushRect.setShape({\n x: startPoint[0],\n y: 0,\n width: endPoint[0] - startPoint[0],\n height: size[1]\n });\n };\n /**\r\n * This action will be throttled.\r\n */\n\n\n SliderZoomView.prototype._dispatchZoomAction = function (realtime) {\n var range = this._range;\n this.api.dispatchAction({\n type: 'dataZoom',\n from: this.uid,\n dataZoomId: this.dataZoomModel.id,\n animation: realtime ? REALTIME_ANIMATION_CONFIG : null,\n start: range[0],\n end: range[1]\n });\n };\n\n SliderZoomView.prototype._findCoordRect = function () {\n // Find the grid corresponding to the first axis referred by dataZoom.\n var rect;\n var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;\n\n if (!rect && coordSysInfoList.length) {\n var coordSys = coordSysInfoList[0].model.coordinateSystem;\n rect = coordSys.getRect && coordSys.getRect();\n }\n\n if (!rect) {\n var width = this.api.getWidth();\n var height = this.api.getHeight();\n rect = {\n x: width * 0.2,\n y: height * 0.2,\n width: width * 0.6,\n height: height * 0.6\n };\n }\n\n return rect;\n };\n\n SliderZoomView.type = 'dataZoom.slider';\n return SliderZoomView;\n}(DataZoomView);\n\nfunction getOtherDim(thisDim) {\n // FIXME\n // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好\n var map = {\n x: 'y',\n y: 'x',\n radius: 'angle',\n angle: 'radius'\n };\n return map[thisDim];\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default SliderZoomView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport SliderZoomModel from './SliderZoomModel.js';\nimport SliderZoomView from './SliderZoomView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(SliderZoomModel);\n registers.registerComponentView(SliderZoomView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installDataZoomInside } from './installDataZoomInside.js';\nimport { install as installDataZoomSlider } from './installDataZoomSlider.js';\nexport function install(registers) {\n use(installDataZoomInside);\n use(installDataZoomSlider); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * @file Visual mapping.\r\n */\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar visualDefault = {\n /**\r\n * @public\r\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nexport default visualDefault;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport * as modelUtil from '../../util/model.js';\nimport * as numberUtil from '../../util/number.js';\nimport ComponentModel from '../../model/Component.js';\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\n\nvar VisualMapModel =\n/** @class */\nfunction (_super) {\n __extends(VisualMapModel, _super);\n\n function VisualMapModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapModel.type;\n _this.stateList = ['inRange', 'outOfRange'];\n _this.replacableOptionKeys = ['inRange', 'outOfRange', 'target', 'controller', 'color'];\n _this.layoutMode = {\n type: 'box',\n ignoreSize: true\n };\n /**\r\n * [lowerBound, upperBound]\r\n */\n\n _this.dataBound = [-Infinity, Infinity];\n _this.targetVisuals = {};\n _this.controllerVisuals = {};\n return _this;\n }\n\n VisualMapModel.prototype.init = function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.optionUpdated = function (newOption, isInit) {\n var thisOption = this.option;\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.resetVisual = function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n };\n /**\r\n * @public\r\n */\n\n\n VisualMapModel.prototype.getItemSymbol = function () {\n return null;\n };\n /**\r\n * @protected\r\n * @return {Array.} An array of series indices.\r\n */\n\n\n VisualMapModel.prototype.getTargetSeriesIndices = function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n\n return seriesIndices;\n };\n /**\r\n * @public\r\n */\n\n\n VisualMapModel.prototype.eachTargetSeries = function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);\n\n if (seriesModel) {\n callback.call(context, seriesModel);\n }\n }, this);\n };\n /**\r\n * @pubilc\r\n */\n\n\n VisualMapModel.prototype.isTargetSeries = function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n };\n /**\r\n * @example\r\n * this.formatValueText(someVal); // format single numeric value to text.\r\n * this.formatValueText(someVal, true); // format single category value to text.\r\n * this.formatValueText([min, max]); // format numeric min-max to text.\r\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\r\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\r\n *\r\n * @param value Real value, or this.dataBound[0 or 1].\r\n * @param isCategory Only available when value is number.\r\n * @param edgeSymbols Open-close symbol when value is interval.\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.formatValueText = function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n edgeSymbols = edgeSymbols || ['<', '>'];\n\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n var textValue = isCategory ? value // Value is string when isCategory\n : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapModel.prototype.resetExtent = function () {\n var thisOption = this.option; // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n };\n /**\r\n * PENDING:\r\n * delete this method if no outer usage.\r\n *\r\n * Return Concrete dimension. If null/undefined is returned, no dimension is used.\r\n */\n // getDataDimension(data: SeriesData) {\n // const optDim = this.option.dimension;\n // if (optDim != null) {\n // return data.getDimension(optDim);\n // }\n // const dimNames = data.dimensions;\n // for (let i = dimNames.length - 1; i >= 0; i--) {\n // const dimName = dimNames[i];\n // const dimInfo = data.getDimensionInfo(dimName);\n // if (!dimInfo.isCalculationCoord) {\n // return dimName;\n // }\n // }\n // }\n\n\n VisualMapModel.prototype.getDataDimensionIndex = function (data) {\n var optDim = this.option.dimension;\n\n if (optDim != null) {\n return data.getDimensionIndex(optDim);\n }\n\n var dimNames = data.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = data.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimInfo.storeDimIndex;\n }\n }\n };\n\n VisualMapModel.prototype.getExtent = function () {\n return this._dataExtent.slice();\n };\n\n VisualMapModel.prototype.completeVisualOption = function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n } // Compatible with previous logic, always give a default color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the default color, set inRange: {color: null}.\n\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n };\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n var itemSymbol = this.getItemSymbol();\n var defaultSymbol = itemSymbol || 'roundRect';\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? defaultSymbol : [defaultSymbol]);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter none\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' ? defaultSymbol : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max_1 = -Infinity; // symbolSize can be object when categories defined.\n\n eachVisual(symbolSize, function (value) {\n value > max_1 && (max_1 = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max_1], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n };\n\n VisualMapModel.prototype.resetItemSize = function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n };\n\n VisualMapModel.prototype.isCategory = function () {\n return !!this.option.categories;\n };\n /**\r\n * @public\r\n * @abstract\r\n */\n\n\n VisualMapModel.prototype.setSelected = function (selected) {};\n\n VisualMapModel.prototype.getSelected = function () {\n return null;\n };\n /**\r\n * @public\r\n * @abstract\r\n */\n\n\n VisualMapModel.prototype.getValueState = function (value) {\n return null;\n };\n /**\r\n * FIXME\r\n * Do not publish to thirt-part-dev temporarily\r\n * util the interface is stable. (Should it return\r\n * a function but not visual meta?)\r\n *\r\n * @pubilc\r\n * @abstract\r\n * @param getColorVisual\r\n * params: value, valueState\r\n * return: color\r\n * @return {Object} visualMeta\r\n * should includes {stops, outerColors}\r\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\r\n */\n\n\n VisualMapModel.prototype.getVisualMeta = function (getColorVisual) {\n return null;\n };\n\n VisualMapModel.type = 'visualMap';\n VisualMapModel.dependencies = ['series'];\n VisualMapModel.defaultOption = {\n show: true,\n // zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n min: 0,\n max: 200,\n left: 0,\n right: null,\n top: null,\n bottom: 0,\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n padding: 5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n precision: 0,\n textStyle: {\n color: '#333' // 值域文字颜色\n\n }\n };\n return VisualMapModel;\n}(ComponentModel);\n\nexport default VisualMapModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport * as numberUtil from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js'; // Constant\n\nvar DEFAULT_BAR_BOUND = [20, 140];\n\nvar ContinuousModel =\n/** @class */\nfunction (_super) {\n __extends(ContinuousModel, _super);\n\n function ContinuousModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousModel.type;\n return _this;\n }\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n this.resetVisual(function (mappingOption) {\n mappingOption.mappingMethod = 'linear';\n mappingOption.dataExtent = this.getExtent();\n });\n\n this._resetRange();\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.resetItemSize = function () {\n _super.prototype.resetItemSize.apply(this, arguments);\n\n var itemSize = this.itemSize;\n (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);\n (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);\n };\n /**\r\n * @private\r\n */\n\n\n ContinuousModel.prototype._resetRange = function () {\n var dataExtent = this.getExtent();\n var range = this.option.range;\n\n if (!range || range.auto) {\n // `range` should always be array (so we don't use other\n // value like 'auto') for user-friend. (consider getOption).\n dataExtent.auto = 1;\n this.option.range = dataExtent;\n } else if (zrUtil.isArray(range)) {\n if (range[0] > range[1]) {\n range.reverse();\n }\n\n range[0] = Math.max(range[0], dataExtent[0]);\n range[1] = Math.min(range[1], dataExtent[1]);\n }\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.completeVisualOption = function () {\n _super.prototype.completeVisualOption.apply(this, arguments);\n\n zrUtil.each(this.stateList, function (state) {\n var symbolSize = this.option.controller[state].symbolSize;\n\n if (symbolSize && symbolSize[0] !== symbolSize[1]) {\n symbolSize[0] = symbolSize[1] / 3; // For good looking.\n }\n }, this);\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.setSelected = function (selected) {\n this.option.range = selected.slice();\n\n this._resetRange();\n };\n /**\r\n * @public\r\n */\n\n\n ContinuousModel.prototype.getSelected = function () {\n var dataExtent = this.getExtent();\n var dataInterval = numberUtil.asc((this.get('range') || []).slice()); // Clamp\n\n dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);\n dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);\n dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);\n dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);\n return dataInterval;\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousModel.prototype.getValueState = function (value) {\n var range = this.option.range;\n var dataExtent = this.getExtent(); // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.\n // range[1] is processed likewise.\n\n return (range[0] <= dataExtent[0] || range[0] <= value) && (range[1] >= dataExtent[1] || value <= range[1]) ? 'inRange' : 'outOfRange';\n };\n\n ContinuousModel.prototype.findTargetDataIndices = function (range) {\n var result = [];\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n range[0] <= value && value <= range[1] && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\r\n * @implement\r\n */\n\n\n ContinuousModel.prototype.getVisualMeta = function (getColorVisual) {\n var oVals = getColorStopValues(this, 'outOfRange', this.getExtent());\n var iVals = getColorStopValues(this, 'inRange', this.option.range.slice());\n var stops = [];\n\n function setStop(value, valueState) {\n stops.push({\n value: value,\n color: getColorVisual(value, valueState)\n });\n } // Format to: outOfRange -- inRange -- outOfRange.\n\n\n var iIdx = 0;\n var oIdx = 0;\n var iLen = iVals.length;\n var oLen = oVals.length;\n\n for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {\n // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored.\n if (oVals[oIdx] < iVals[iIdx]) {\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n for (var first = 1; iIdx < iLen; iIdx++, first = 0) {\n // If range is full, value beyond min, max will be clamped.\n // make a singularity\n first && stops.length && setStop(iVals[iIdx], 'outOfRange');\n setStop(iVals[iIdx], 'inRange');\n }\n\n for (var first = 1; oIdx < oLen; oIdx++) {\n if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {\n // make a singularity\n if (first) {\n stops.length && setStop(stops[stops.length - 1].value, 'outOfRange');\n first = 0;\n }\n\n setStop(oVals[oIdx], 'outOfRange');\n }\n }\n\n var stopsLen = stops.length;\n return {\n stops: stops,\n outerColors: [stopsLen ? stops[0].color : 'transparent', stopsLen ? stops[stopsLen - 1].color : 'transparent']\n };\n };\n\n ContinuousModel.type = 'visualMap.continuous';\n ContinuousModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n align: 'auto',\n calculable: false,\n hoverLink: true,\n realtime: true,\n handleIcon: 'path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z',\n handleSize: '120%',\n handleStyle: {\n borderColor: '#fff',\n borderWidth: 1\n },\n indicatorIcon: 'circle',\n indicatorSize: '50%',\n indicatorStyle: {\n borderColor: '#fff',\n borderWidth: 2,\n shadowBlur: 2,\n shadowOffsetX: 1,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.2)'\n } // emphasis: {\n // handleStyle: {\n // shadowBlur: 3,\n // shadowOffsetX: 1,\n // shadowOffsetY: 1,\n // shadowColor: 'rgba(0,0,0,0.2)'\n // }\n // }\n\n });\n return ContinuousModel;\n}(VisualMapModel);\n\nfunction getColorStopValues(visualMapModel, valueState, dataExtent) {\n if (dataExtent[0] === dataExtent[1]) {\n return dataExtent.slice();\n } // When using colorHue mapping, it is not linear color any more.\n // Moreover, canvas gradient seems not to be accurate linear.\n // FIXME\n // Should be arbitrary value 100? or based on pixel size?\n\n\n var count = 200;\n var step = (dataExtent[1] - dataExtent[0]) / count;\n var value = dataExtent[0];\n var stopValues = [];\n\n for (var i = 0; i <= count && value < dataExtent[1]; i++) {\n stopValues.push(value);\n value += step;\n }\n\n stopValues.push(dataExtent[1]);\n return stopValues;\n}\n\nexport default ContinuousModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { Rect } from '../../util/graphic.js';\nimport * as formatUtil from '../../util/format.js';\nimport * as layout from '../../util/layout.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport ComponentView from '../../view/Component.js';\n\nvar VisualMapView =\n/** @class */\nfunction (_super) {\n __extends(VisualMapView, _super);\n\n function VisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = VisualMapView.type;\n _this.autoPositionValues = {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n };\n return _this;\n }\n\n VisualMapView.prototype.init = function (ecModel, api) {\n this.ecModel = ecModel;\n this.api = api;\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapView.prototype.render = function (visualMapModel, ecModel, api, payload // TODO: TYPE\n ) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender(visualMapModel, ecModel, api, payload);\n };\n /**\r\n * @protected\r\n */\n\n\n VisualMapView.prototype.renderBackground = function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new Rect({\n z2: -1,\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n };\n /**\r\n * @protected\r\n * @param targetValue can be Infinity or -Infinity\r\n * @param visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\r\n * @param opts\r\n * @param opts.forceState Specify state, instead of using getValueState method.\r\n * @param opts.convertOpacityToAlpha For color gradient in controller widget.\r\n * @return {*} Visual value.\r\n */\n\n\n VisualMapView.prototype.getControllerVisual = function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {}; // Default values.\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\n\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n };\n\n VisualMapView.prototype.positionGroup = function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n };\n\n VisualMapView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {};\n\n VisualMapView.type = 'visualMap';\n return VisualMapView;\n}(ComponentView);\n\nexport default VisualMapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { getLayoutRect } from '../../util/layout.js';\nvar paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n/**\r\n * @param visualMapModel\r\n * @param api\r\n * @param itemSize always [short, long]\r\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\r\n */\n\nexport function getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n } // Auto decision align.\n\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\r\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\r\n * dataIndexInside means filtered index.\r\n */\n// TODO: TYPE more specified payload types.\n\nexport function makeHighDownBatch(batch, visualMapModel) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batchItem.dataIndex != null) {\n batchItem.dataIndexInside = batchItem.dataIndex;\n batchItem.dataIndex = null;\n }\n\n batchItem.highlightKey = 'visualMap' + (visualMapModel ? visualMapModel.componentIndex : '');\n });\n return batch;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport LinearGradient from 'zrender/lib/graphic/LinearGradient.js';\nimport * as eventTool from 'zrender/lib/core/event.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport * as numberUtil from '../../util/number.js';\nimport sliderMove from '../helper/sliderMove.js';\nimport * as helper from './helper.js';\nimport * as modelUtil from '../../util/model.js';\nimport { parsePercent } from 'zrender/lib/contain/text.js';\nimport { setAsHighDownDispatcher } from '../../util/states.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport ZRImage from 'zrender/lib/graphic/Image.js';\nimport { getECData } from '../../util/innerStore.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\nimport { findEventDispatcher } from '../../util/event.js';\nvar linearMap = numberUtil.linearMap;\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max; // Arbitrary value\n\nvar HOVER_LINK_SIZE = 12;\nvar HOVER_LINK_OUT = 6; // Notice:\n// Any \"interval\" should be by the order of [low, high].\n// \"handle0\" (handleIndex === 0) maps to\n// low data value: this._dataInterval[0] and has low coord.\n// \"handle1\" (handleIndex === 1) maps to\n// high data value: this._dataInterval[1] and has high coord.\n// The logic of transform is implemented in this._createBarGroup.\n\nvar ContinuousView =\n/** @class */\nfunction (_super) {\n __extends(ContinuousView, _super);\n\n function ContinuousView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ContinuousView.type;\n _this._shapes = {};\n _this._dataInterval = [];\n _this._handleEnds = [];\n _this._hoverLinkDataIndices = [];\n return _this;\n }\n\n ContinuousView.prototype.doRender = function (visualMapModel, ecModel, api, payload) {\n this._api = api;\n\n if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {\n this._buildView();\n }\n };\n\n ContinuousView.prototype._buildView = function () {\n this.group.removeAll();\n var visualMapModel = this.visualMapModel;\n var thisGroup = this.group;\n this._orient = visualMapModel.get('orient');\n this._useHandle = visualMapModel.get('calculable');\n\n this._resetInterval();\n\n this._renderBar(thisGroup);\n\n var dataRangeText = visualMapModel.get('text');\n\n this._renderEndsText(thisGroup, dataRangeText, 0);\n\n this._renderEndsText(thisGroup, dataRangeText, 1); // Do this for background size calculation.\n\n\n this._updateView(true); // After updating view, inner shapes is built completely,\n // and then background can be rendered.\n\n\n this.renderBackground(thisGroup); // Real update view\n\n this._updateView();\n\n this._enableHoverLinkToSeries();\n\n this._enableHoverLinkFromSeries();\n\n this.positionGroup(thisGroup);\n };\n\n ContinuousView.prototype._renderEndsText = function (group, dataRangeText, endsIndex) {\n if (!dataRangeText) {\n return;\n } // Compatible with ec2, text[0] map to high value, text[1] map low value.\n\n\n var text = dataRangeText[1 - endsIndex];\n text = text != null ? text + '' : '';\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var itemSize = visualMapModel.itemSize;\n var barGroup = this._shapes.mainGroup;\n\n var position = this._applyTransform([itemSize[0] / 2, endsIndex === 0 ? -textGap : itemSize[1] + textGap], barGroup);\n\n var align = this._applyTransform(endsIndex === 0 ? 'bottom' : 'top', barGroup);\n\n var orient = this._orient;\n var textStyleModel = this.visualMapModel.textStyleModel;\n this.group.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: position[0],\n y: position[1],\n verticalAlign: orient === 'horizontal' ? 'middle' : align,\n align: orient === 'horizontal' ? align : 'center',\n text: text\n })\n }));\n };\n\n ContinuousView.prototype._renderBar = function (targetGroup) {\n var visualMapModel = this.visualMapModel;\n var shapes = this._shapes;\n var itemSize = visualMapModel.itemSize;\n var orient = this._orient;\n var useHandle = this._useHandle;\n var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);\n\n var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);\n\n var gradientBarGroup = new graphic.Group();\n mainGroup.add(gradientBarGroup); // Bar\n\n gradientBarGroup.add(shapes.outOfRange = createPolygon());\n gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, zrUtil.bind(this._dragHandle, this, 'all', false), zrUtil.bind(this._dragHandle, this, 'all', true))); // A border radius clip.\n\n gradientBarGroup.setClipPath(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: itemSize[0],\n height: itemSize[1],\n r: 3\n }\n }));\n var textRect = visualMapModel.textStyleModel.getTextRect('国');\n var textSize = mathMax(textRect.width, textRect.height); // Handle\n\n if (useHandle) {\n shapes.handleThumbs = [];\n shapes.handleLabels = [];\n shapes.handleLabelPoints = [];\n\n this._createHandle(visualMapModel, mainGroup, 0, itemSize, textSize, orient);\n\n this._createHandle(visualMapModel, mainGroup, 1, itemSize, textSize, orient);\n }\n\n this._createIndicator(visualMapModel, mainGroup, itemSize, textSize, orient);\n\n targetGroup.add(mainGroup);\n };\n\n ContinuousView.prototype._createHandle = function (visualMapModel, mainGroup, handleIndex, itemSize, textSize, orient) {\n var onDrift = zrUtil.bind(this._dragHandle, this, handleIndex, false);\n var onDragEnd = zrUtil.bind(this._dragHandle, this, handleIndex, true);\n var handleSize = parsePercent(visualMapModel.get('handleSize'), itemSize[0]);\n var handleThumb = createSymbol(visualMapModel.get('handleIcon'), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);\n var cursor = getCursor(this._orient);\n handleThumb.attr({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n ondragend: onDragEnd,\n onmousemove: function (e) {\n eventTool.stop(e.event);\n }\n });\n handleThumb.x = itemSize[0] / 2;\n handleThumb.useStyle(visualMapModel.getModel('handleStyle').getItemStyle());\n handleThumb.setStyle({\n strokeNoScale: true,\n strokeFirst: true\n });\n handleThumb.style.lineWidth *= 2;\n handleThumb.ensureState('emphasis').style = visualMapModel.getModel(['emphasis', 'handleStyle']).getItemStyle();\n setAsHighDownDispatcher(handleThumb, true);\n mainGroup.add(handleThumb); // Text is always horizontal layout but should not be effected by\n // transform (orient/inverse). So label is built separately but not\n // use zrender/graphic/helper/RectText, and is located based on view\n // group (according to handleLabelPoint) but not barGroup.\n\n var textStyleModel = this.visualMapModel.textStyleModel;\n var handleLabel = new graphic.Text({\n cursor: cursor,\n draggable: true,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n handleLabel.ensureState('blur').style = {\n opacity: 0.1\n };\n handleLabel.stateTransition = {\n duration: 200\n };\n this.group.add(handleLabel);\n var handleLabelPoint = [handleSize, 0];\n var shapes = this._shapes;\n shapes.handleThumbs[handleIndex] = handleThumb;\n shapes.handleLabelPoints[handleIndex] = handleLabelPoint;\n shapes.handleLabels[handleIndex] = handleLabel;\n };\n\n ContinuousView.prototype._createIndicator = function (visualMapModel, mainGroup, itemSize, textSize, orient) {\n var scale = parsePercent(visualMapModel.get('indicatorSize'), itemSize[0]);\n var indicator = createSymbol(visualMapModel.get('indicatorIcon'), -scale / 2, -scale / 2, scale, scale, null, true);\n indicator.attr({\n cursor: 'move',\n invisible: true,\n silent: true,\n x: itemSize[0] / 2\n });\n var indicatorStyle = visualMapModel.getModel('indicatorStyle').getItemStyle();\n\n if (indicator instanceof ZRImage) {\n var pathStyle = indicator.style;\n indicator.useStyle(zrUtil.extend({\n // TODO other properties like x, y ?\n image: pathStyle.image,\n x: pathStyle.x,\n y: pathStyle.y,\n width: pathStyle.width,\n height: pathStyle.height\n }, indicatorStyle));\n } else {\n indicator.useStyle(indicatorStyle);\n }\n\n mainGroup.add(indicator);\n var textStyleModel = this.visualMapModel.textStyleModel;\n var indicatorLabel = new graphic.Text({\n silent: true,\n invisible: true,\n style: createTextStyle(textStyleModel, {\n x: 0,\n y: 0,\n text: ''\n })\n });\n this.group.add(indicatorLabel);\n var indicatorLabelPoint = [(orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT) + itemSize[0] / 2, 0];\n var shapes = this._shapes;\n shapes.indicator = indicator;\n shapes.indicatorLabel = indicatorLabel;\n shapes.indicatorLabelPoint = indicatorLabelPoint;\n this._firstShowIndicator = true;\n };\n\n ContinuousView.prototype._dragHandle = function (handleIndex, isEnd, // dx is event from ondragend if isEnd is true. It's not used\n dx, dy) {\n if (!this._useHandle) {\n return;\n }\n\n this._dragging = !isEnd;\n\n if (!isEnd) {\n // Transform dx, dy to bar coordination.\n var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);\n\n this._updateInterval(handleIndex, vertex[1]);\n\n this._hideIndicator(); // Considering realtime, update view should be executed\n // before dispatch action.\n\n\n this._updateView();\n } // dragEnd do not dispatch action when realtime.\n\n\n if (isEnd === !this.visualMapModel.get('realtime')) {\n // jshint ignore:line\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: this._dataInterval.slice()\n });\n }\n\n if (isEnd) {\n !this._hovering && this._clearHoverLinkToSeries();\n } else if (useHoverLinkOnHandle(this.visualMapModel)) {\n this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);\n }\n };\n\n ContinuousView.prototype._resetInterval = function () {\n var visualMapModel = this.visualMapModel;\n var dataInterval = this._dataInterval = visualMapModel.getSelected();\n var dataExtent = visualMapModel.getExtent();\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];\n };\n /**\r\n * @private\r\n * @param {(number|string)} handleIndex 0 or 1 or 'all'\r\n * @param {number} dx\r\n * @param {number} dy\r\n */\n\n\n ContinuousView.prototype._updateInterval = function (handleIndex, delta) {\n delta = delta || 0;\n var visualMapModel = this.visualMapModel;\n var handleEnds = this._handleEnds;\n var sizeExtent = [0, visualMapModel.itemSize[1]];\n sliderMove(delta, handleEnds, sizeExtent, handleIndex, // cross is forbidden\n 0);\n var dataExtent = visualMapModel.getExtent(); // Update data interval.\n\n this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];\n };\n\n ContinuousView.prototype._updateView = function (forSketch) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var shapes = this._shapes;\n var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];\n var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;\n\n var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange');\n\n var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange');\n\n shapes.inRange.setStyle({\n fill: visualInRange.barColor // opacity: visualInRange.opacity\n\n }).setShape('points', visualInRange.barPoints);\n shapes.outOfRange.setStyle({\n fill: visualOutOfRange.barColor // opacity: visualOutOfRange.opacity\n\n }).setShape('points', visualOutOfRange.barPoints);\n\n this._updateHandle(inRangeHandleEnds, visualInRange);\n };\n\n ContinuousView.prototype._createBarVisual = function (dataInterval, dataExtent, handleEnds, forceState) {\n var opts = {\n forceState: forceState,\n convertOpacityToAlpha: true\n };\n\n var colorStops = this._makeColorGradient(dataInterval, opts);\n\n var symbolSizes = [this.getControllerVisual(dataInterval[0], 'symbolSize', opts), this.getControllerVisual(dataInterval[1], 'symbolSize', opts)];\n\n var barPoints = this._createBarPoints(handleEnds, symbolSizes);\n\n return {\n barColor: new LinearGradient(0, 0, 0, 1, colorStops),\n barPoints: barPoints,\n handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]\n };\n };\n\n ContinuousView.prototype._makeColorGradient = function (dataInterval, opts) {\n // Considering colorHue, which is not linear, so we have to sample\n // to calculate gradient color stops, but not only calculate head\n // and tail.\n var sampleNumber = 100; // Arbitrary value.\n\n var colorStops = [];\n var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;\n colorStops.push({\n color: this.getControllerVisual(dataInterval[0], 'color', opts),\n offset: 0\n });\n\n for (var i = 1; i < sampleNumber; i++) {\n var currValue = dataInterval[0] + step * i;\n\n if (currValue > dataInterval[1]) {\n break;\n }\n\n colorStops.push({\n color: this.getControllerVisual(currValue, 'color', opts),\n offset: i / sampleNumber\n });\n }\n\n colorStops.push({\n color: this.getControllerVisual(dataInterval[1], 'color', opts),\n offset: 1\n });\n return colorStops;\n };\n\n ContinuousView.prototype._createBarPoints = function (handleEnds, symbolSizes) {\n var itemSize = this.visualMapModel.itemSize;\n return [[itemSize[0] - symbolSizes[0], handleEnds[0]], [itemSize[0], handleEnds[0]], [itemSize[0], handleEnds[1]], [itemSize[0] - symbolSizes[1], handleEnds[1]]];\n };\n\n ContinuousView.prototype._createBarGroup = function (itemAlign) {\n var orient = this._orient;\n var inverse = this.visualMapModel.get('inverse');\n return new graphic.Group(orient === 'horizontal' && !inverse ? {\n scaleX: itemAlign === 'bottom' ? 1 : -1,\n rotation: Math.PI / 2\n } : orient === 'horizontal' && inverse ? {\n scaleX: itemAlign === 'bottom' ? -1 : 1,\n rotation: -Math.PI / 2\n } : orient === 'vertical' && !inverse ? {\n scaleX: itemAlign === 'left' ? 1 : -1,\n scaleY: -1\n } : {\n scaleX: itemAlign === 'left' ? 1 : -1\n });\n };\n\n ContinuousView.prototype._updateHandle = function (handleEnds, visualInRange) {\n if (!this._useHandle) {\n return;\n }\n\n var shapes = this._shapes;\n var visualMapModel = this.visualMapModel;\n var handleThumbs = shapes.handleThumbs;\n var handleLabels = shapes.handleLabels;\n var itemSize = visualMapModel.itemSize;\n var dataExtent = visualMapModel.getExtent();\n each([0, 1], function (handleIndex) {\n var handleThumb = handleThumbs[handleIndex];\n handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]);\n handleThumb.y = handleEnds[handleIndex];\n var val = linearMap(handleEnds[handleIndex], [0, itemSize[1]], dataExtent, true);\n var symbolSize = this.getControllerVisual(val, 'symbolSize');\n handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize[0];\n handleThumb.x = itemSize[0] - symbolSize / 2; // Update handle label position.\n\n var textPoint = graphic.applyTransform(shapes.handleLabelPoints[handleIndex], graphic.getTransform(handleThumb, this.group));\n handleLabels[handleIndex].setStyle({\n x: textPoint[0],\n y: textPoint[1],\n text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),\n verticalAlign: 'middle',\n align: this._orient === 'vertical' ? this._applyTransform('left', shapes.mainGroup) : 'center'\n });\n }, this);\n };\n\n ContinuousView.prototype._showIndicator = function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {\n var visualMapModel = this.visualMapModel;\n var dataExtent = visualMapModel.getExtent();\n var itemSize = visualMapModel.itemSize;\n var sizeExtent = [0, itemSize[1]];\n var shapes = this._shapes;\n var indicator = shapes.indicator;\n\n if (!indicator) {\n return;\n }\n\n indicator.attr('invisible', false);\n var opts = {\n convertOpacityToAlpha: true\n };\n var color = this.getControllerVisual(cursorValue, 'color', opts);\n var symbolSize = this.getControllerVisual(cursorValue, 'symbolSize');\n var y = linearMap(cursorValue, dataExtent, sizeExtent, true);\n var x = itemSize[0] - symbolSize / 2;\n var oldIndicatorPos = {\n x: indicator.x,\n y: indicator.y\n }; // Update handle label position.\n\n indicator.y = y;\n indicator.x = x;\n var textPoint = graphic.applyTransform(shapes.indicatorLabelPoint, graphic.getTransform(indicator, this.group));\n var indicatorLabel = shapes.indicatorLabel;\n indicatorLabel.attr('invisible', false);\n\n var align = this._applyTransform('left', shapes.mainGroup);\n\n var orient = this._orient;\n var isHorizontal = orient === 'horizontal';\n indicatorLabel.setStyle({\n text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue),\n verticalAlign: isHorizontal ? align : 'middle',\n align: isHorizontal ? 'center' : align\n });\n var indicatorNewProps = {\n x: x,\n y: y,\n style: {\n fill: color\n }\n };\n var labelNewProps = {\n style: {\n x: textPoint[0],\n y: textPoint[1]\n }\n };\n\n if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {\n var animationCfg = {\n duration: 100,\n easing: 'cubicInOut',\n additive: true\n };\n indicator.x = oldIndicatorPos.x;\n indicator.y = oldIndicatorPos.y;\n indicator.animateTo(indicatorNewProps, animationCfg);\n indicatorLabel.animateTo(labelNewProps, animationCfg);\n } else {\n indicator.attr(indicatorNewProps);\n indicatorLabel.attr(labelNewProps);\n }\n\n this._firstShowIndicator = false;\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.enterBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._enableHoverLinkToSeries = function () {\n var self = this;\n\n this._shapes.mainGroup.on('mousemove', function (e) {\n self._hovering = true;\n\n if (!self._dragging) {\n var itemSize = self.visualMapModel.itemSize;\n\n var pos = self._applyTransform([e.offsetX, e.offsetY], self._shapes.mainGroup, true, true); // For hover link show when hover handle, which might be\n // below or upper than sizeExtent.\n\n\n pos[1] = mathMin(mathMax(0, pos[1]), itemSize[1]);\n\n self._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize[0]);\n }\n }).on('mouseout', function () {\n // When mouse is out of handle, hoverLink still need\n // to be displayed when realtime is set as false.\n self._hovering = false;\n !self._dragging && self._clearHoverLinkToSeries();\n });\n };\n\n ContinuousView.prototype._enableHoverLinkFromSeries = function () {\n var zr = this.api.getZr();\n\n if (this.visualMapModel.option.hoverLink) {\n zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this);\n zr.on('mouseout', this._hideIndicator, this);\n } else {\n this._clearHoverLinkFromSeries();\n }\n };\n\n ContinuousView.prototype._doHoverLinkToSeries = function (cursorPos, hoverOnBar) {\n var visualMapModel = this.visualMapModel;\n var itemSize = visualMapModel.itemSize;\n\n if (!visualMapModel.option.hoverLink) {\n return;\n }\n\n var sizeExtent = [0, itemSize[1]];\n var dataExtent = visualMapModel.getExtent(); // For hover link show when hover handle, which might be below or upper than sizeExtent.\n\n cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);\n var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);\n var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];\n var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);\n var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)]; // Consider data range is out of visualMap range, see test/visualMap-continuous.html,\n // where china and india has very large population.\n\n hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);\n hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); // Do not show indicator when mouse is over handle,\n // otherwise labels overlap, especially when dragging.\n\n if (hoverOnBar) {\n if (valueRange[0] === -Infinity) {\n this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize);\n } else if (valueRange[1] === Infinity) {\n this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize);\n } else {\n this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize);\n }\n } // When realtime is set as false, handles, which are in barGroup,\n // also trigger hoverLink, which help user to realize where they\n // focus on when dragging. (see test/heatmap-large.html)\n // When realtime is set as true, highlight will not show when hover\n // handle, because the label on handle, which displays a exact value\n // but not range, might mislead users.\n\n\n var oldBatch = this._hoverLinkDataIndices;\n var newBatch = [];\n\n if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {\n newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);\n }\n\n var resultBatches = modelUtil.compressBatches(oldBatch, newBatch);\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(resultBatches[0], visualMapModel));\n\n this._dispatchHighDown('highlight', helper.makeHighDownBatch(resultBatches[1], visualMapModel));\n };\n\n ContinuousView.prototype._hoverLinkFromSeriesMouseOver = function (e) {\n var ecData;\n findEventDispatcher(e.target, function (target) {\n var currECData = getECData(target);\n\n if (currECData.dataIndex != null) {\n ecData = currECData;\n return true;\n }\n }, true);\n\n if (!ecData) {\n return;\n }\n\n var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);\n var visualMapModel = this.visualMapModel;\n\n if (!visualMapModel.isTargetSeries(dataModel)) {\n return;\n }\n\n var data = dataModel.getData(ecData.dataType);\n var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);\n\n if (!isNaN(value)) {\n this._showIndicator(value, value);\n }\n };\n\n ContinuousView.prototype._hideIndicator = function () {\n var shapes = this._shapes;\n shapes.indicator && shapes.indicator.attr('invisible', true);\n shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true);\n var handleLabels = this._shapes.handleLabels;\n\n if (handleLabels) {\n for (var i = 0; i < handleLabels.length; i++) {\n // Fade out handle labels.\n // NOTE: Must use api enter/leave on emphasis/blur/select state. Or the global states manager will change it.\n this._api.leaveBlur(handleLabels[i]);\n }\n }\n };\n\n ContinuousView.prototype._clearHoverLinkToSeries = function () {\n this._hideIndicator();\n\n var indices = this._hoverLinkDataIndices;\n\n this._dispatchHighDown('downplay', helper.makeHighDownBatch(indices, this.visualMapModel));\n\n indices.length = 0;\n };\n\n ContinuousView.prototype._clearHoverLinkFromSeries = function () {\n this._hideIndicator();\n\n var zr = this.api.getZr();\n zr.off('mouseover', this._hoverLinkFromSeriesMouseOver);\n zr.off('mouseout', this._hideIndicator);\n };\n\n ContinuousView.prototype._applyTransform = function (vertex, element, inverse, global) {\n var transform = graphic.getTransform(element, global ? null : this.group);\n return zrUtil.isArray(vertex) ? graphic.applyTransform(vertex, transform, inverse) : graphic.transformDirection(vertex, transform, inverse);\n }; // TODO: TYPE more specified payload types.\n\n\n ContinuousView.prototype._dispatchHighDown = function (type, batch) {\n batch && batch.length && this.api.dispatchAction({\n type: type,\n batch: batch\n });\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousView.prototype.dispose = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n /**\r\n * @override\r\n */\n\n\n ContinuousView.prototype.remove = function () {\n this._clearHoverLinkFromSeries();\n\n this._clearHoverLinkToSeries();\n };\n\n ContinuousView.type = 'visualMap.continuous';\n return ContinuousView;\n}(VisualMapView);\n\nfunction createPolygon(points, cursor, onDrift, onDragEnd) {\n return new graphic.Polygon({\n shape: {\n points: points\n },\n draggable: !!onDrift,\n cursor: cursor,\n drift: onDrift,\n onmousemove: function (e) {\n // For mobile device, prevent screen slider on the button.\n eventTool.stop(e.event);\n },\n ondragend: onDragEnd\n });\n}\n\nfunction getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {\n var halfHoverLinkSize = HOVER_LINK_SIZE / 2;\n var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize');\n\n if (hoverLinkDataSize) {\n halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;\n }\n\n return halfHoverLinkSize;\n}\n\nfunction useHoverLinkOnHandle(visualMapModel) {\n var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle');\n return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle);\n}\n\nfunction getCursor(orient) {\n return orient === 'vertical' ? 'ns-resize' : 'ew-resize';\n}\n\nexport default ContinuousView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nexport var visualMapActionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\nexport var visualMapActionHander = function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport * as visualSolution from '../../visual/visualSolution.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport { getVisualFromData } from '../../visual/helper.js';\nexport var visualMapEncodingHandlers = [{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));\n });\n return resetDefines;\n }\n}, // Only support color.\n{\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var dimIdx = visualMapModel.getDataDimensionIndex(data);\n\n if (dimIdx >= 0) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimIdx;\n visualMetaList.push(visualMeta);\n }\n }\n }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}]; // FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\n\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: getVisualFromData(seriesModel.getData(), 'color') // default color.\n\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n\n return resultVisual.color;\n\n function getVisual(key) {\n return resultVisual[key];\n }\n\n function setVisual(key, value) {\n resultVisual[key] = value;\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// @ts-nocheck\nimport * as zrUtil from 'zrender/lib/core/util.js';\nvar each = zrUtil.each;\nexport default function visualMapPreprocessor(option) {\n var visualMap = option && option.visualMap;\n\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n } // rename splitList to pieces\n\n\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n\n var pieces = opt.pieces;\n\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\n\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { visualMapActionInfo, visualMapActionHander } from './visualMapAction.js';\nimport { visualMapEncodingHandlers } from './visualEncoding.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport preprocessor from './preprocessor.js';\nvar installed = false;\nexport default function installCommon(registers) {\n if (installed) {\n return;\n }\n\n installed = true;\n registers.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n });\n registers.registerAction(visualMapActionInfo, visualMapActionHander);\n each(visualMapEncodingHandlers, function (handler) {\n registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);\n });\n registers.registerPreprocessor(preprocessor);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ContinuousModel from './ContinuousModel.js';\nimport ContinuousView from './ContinuousView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(ContinuousModel);\n registers.registerComponentView(ContinuousView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapModel from './VisualMapModel.js';\nimport VisualMapping from '../../visual/VisualMapping.js';\nimport visualDefault from '../../visual/visualDefault.js';\nimport { reformIntervals } from '../../util/number.js';\nimport { inheritDefaultOption } from '../../util/component.js';\n\nvar PiecewiseModel =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseModel, _super);\n\n function PiecewiseModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseModel.type;\n /**\r\n * The order is always [low, ..., high].\r\n * [{text: string, interval: Array.}, ...]\r\n */\n\n _this._pieceList = [];\n return _this;\n }\n\n PiecewiseModel.prototype.optionUpdated = function (newOption, isInit) {\n _super.prototype.optionUpdated.apply(this, arguments);\n\n this.resetExtent();\n\n var mode = this._mode = this._determineMode();\n\n this._pieceList = [];\n\n resetMethods[this._mode].call(this, this._pieceList);\n\n this._resetSelected(newOption, isInit);\n\n var categories = this.option.categories;\n this.resetVisual(function (mappingOption, state) {\n if (mode === 'categories') {\n mappingOption.mappingMethod = 'category';\n mappingOption.categories = zrUtil.clone(categories);\n } else {\n mappingOption.dataExtent = this.getExtent();\n mappingOption.mappingMethod = 'piecewise';\n mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {\n piece = zrUtil.clone(piece);\n\n if (state !== 'inRange') {\n // FIXME\n // outOfRange do not support special visual in pieces.\n piece.visual = null;\n }\n\n return piece;\n });\n }\n });\n };\n /**\r\n * @protected\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.completeVisualOption = function () {\n // Consider this case:\n // visualMap: {\n // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}]\n // }\n // where no inRange/outOfRange set but only pieces. So we should make\n // default inRange/outOfRange for this case, otherwise visuals that only\n // appear in `pieces` will not be taken into account in visual encoding.\n var option = this.option;\n var visualTypesInPieces = {};\n var visualTypes = VisualMapping.listVisualTypes();\n var isCategory = this.isCategory();\n zrUtil.each(option.pieces, function (piece) {\n zrUtil.each(visualTypes, function (visualType) {\n if (piece.hasOwnProperty(visualType)) {\n visualTypesInPieces[visualType] = 1;\n }\n });\n });\n zrUtil.each(visualTypesInPieces, function (v, visualType) {\n var exists = false;\n zrUtil.each(this.stateList, function (state) {\n exists = exists || has(option, state, visualType) || has(option.target, state, visualType);\n }, this);\n !exists && zrUtil.each(this.stateList, function (state) {\n (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === 'inRange' ? 'active' : 'inactive', isCategory);\n });\n }, this);\n\n function has(obj, state, visualType) {\n return obj && obj[state] && obj[state].hasOwnProperty(visualType);\n }\n\n _super.prototype.completeVisualOption.apply(this, arguments);\n };\n\n PiecewiseModel.prototype._resetSelected = function (newOption, isInit) {\n var thisOption = this.option;\n var pieceList = this._pieceList; // Selected do not merge but all override.\n\n var selected = (isInit ? thisOption : newOption).selected || {};\n thisOption.selected = selected; // Consider 'not specified' means true.\n\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (!selected.hasOwnProperty(key)) {\n selected[key] = true;\n }\n }, this);\n\n if (thisOption.selectedMode === 'single') {\n // Ensure there is only one selected.\n var hasSel_1 = false;\n zrUtil.each(pieceList, function (piece, index) {\n var key = this.getSelectedMapKey(piece);\n\n if (selected[key]) {\n hasSel_1 ? selected[key] = false : hasSel_1 = true;\n }\n }, this);\n } // thisOption.selectedMode === 'multiple', default: all selected.\n\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getItemSymbol = function () {\n return this.get('itemSymbol');\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getSelectedMapKey = function (piece) {\n return this._mode === 'categories' ? piece.value + '' : piece.index + '';\n };\n /**\r\n * @public\r\n */\n\n\n PiecewiseModel.prototype.getPieceList = function () {\n return this._pieceList;\n };\n /**\r\n * @return {string}\r\n */\n\n\n PiecewiseModel.prototype._determineMode = function () {\n var option = this.option;\n return option.pieces && option.pieces.length > 0 ? 'pieces' : this.option.categories ? 'categories' : 'splitNumber';\n };\n /**\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.setSelected = function (selected) {\n this.option.selected = zrUtil.clone(selected);\n };\n /**\r\n * @override\r\n */\n\n\n PiecewiseModel.prototype.getValueState = function (value) {\n var index = VisualMapping.findPieceIndex(value, this._pieceList);\n return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? 'inRange' : 'outOfRange' : 'outOfRange';\n };\n /**\r\n * @public\r\n * @param pieceIndex piece index in visualMapModel.getPieceList()\r\n */\n\n\n PiecewiseModel.prototype.findTargetDataIndices = function (pieceIndex) {\n var result = [];\n var pieceList = this._pieceList;\n this.eachTargetSeries(function (seriesModel) {\n var dataIndices = [];\n var data = seriesModel.getData();\n data.each(this.getDataDimensionIndex(data), function (value, dataIndex) {\n // Should always base on model pieceList, because it is order sensitive.\n var pIdx = VisualMapping.findPieceIndex(value, pieceList);\n pIdx === pieceIndex && dataIndices.push(dataIndex);\n }, this);\n result.push({\n seriesId: seriesModel.id,\n dataIndex: dataIndices\n });\n }, this);\n return result;\n };\n /**\r\n * @private\r\n * @param piece piece.value or piece.interval is required.\r\n * @return Can be Infinity or -Infinity\r\n */\n\n\n PiecewiseModel.prototype.getRepresentValue = function (piece) {\n var representValue;\n\n if (this.isCategory()) {\n representValue = piece.value;\n } else {\n if (piece.value != null) {\n representValue = piece.value;\n } else {\n var pieceInterval = piece.interval || [];\n representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;\n }\n }\n\n return representValue;\n };\n\n PiecewiseModel.prototype.getVisualMeta = function (getColorVisual) {\n // Do not support category. (category axis is ordinal, numerical)\n if (this.isCategory()) {\n return;\n }\n\n var stops = [];\n var outerColors = ['', ''];\n var visualMapModel = this;\n\n function setStop(interval, valueState) {\n var representValue = visualMapModel.getRepresentValue({\n interval: interval\n }); // Not category\n\n if (!valueState) {\n valueState = visualMapModel.getValueState(representValue);\n }\n\n var color = getColorVisual(representValue, valueState);\n\n if (interval[0] === -Infinity) {\n outerColors[0] = color;\n } else if (interval[1] === Infinity) {\n outerColors[1] = color;\n } else {\n stops.push({\n value: interval[0],\n color: color\n }, {\n value: interval[1],\n color: color\n });\n }\n } // Suplement\n\n\n var pieceList = this._pieceList.slice();\n\n if (!pieceList.length) {\n pieceList.push({\n interval: [-Infinity, Infinity]\n });\n } else {\n var edge = pieceList[0].interval[0];\n edge !== -Infinity && pieceList.unshift({\n interval: [-Infinity, edge]\n });\n edge = pieceList[pieceList.length - 1].interval[1];\n edge !== Infinity && pieceList.push({\n interval: [edge, Infinity]\n });\n }\n\n var curr = -Infinity;\n zrUtil.each(pieceList, function (piece) {\n var interval = piece.interval;\n\n if (interval) {\n // Fulfill gap.\n interval[0] > curr && setStop([curr, interval[0]], 'outOfRange');\n setStop(interval.slice());\n curr = interval[1];\n }\n }, this);\n return {\n stops: stops,\n outerColors: outerColors\n };\n };\n\n PiecewiseModel.type = 'visualMap.piecewise';\n PiecewiseModel.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {\n selected: null,\n minOpen: false,\n maxOpen: false,\n align: 'auto',\n itemWidth: 20,\n itemHeight: 14,\n itemSymbol: 'roundRect',\n pieces: null,\n categories: null,\n splitNumber: 5,\n selectedMode: 'multiple',\n itemGap: 10,\n hoverLink: true // Enable hover highlight.\n\n });\n return PiecewiseModel;\n}(VisualMapModel);\n\n;\n/**\r\n * Key is this._mode\r\n * @type {Object}\r\n * @this {module:echarts/component/viusalMap/PiecewiseMode}\r\n */\n\nvar resetMethods = {\n splitNumber: function (outPieceList) {\n var thisOption = this.option;\n var precision = Math.min(thisOption.precision, 20);\n var dataExtent = this.getExtent();\n var splitNumber = thisOption.splitNumber;\n splitNumber = Math.max(parseInt(splitNumber, 10), 1);\n thisOption.splitNumber = splitNumber;\n var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber; // Precision auto-adaption\n\n while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {\n precision++;\n }\n\n thisOption.precision = precision;\n splitStep = +splitStep.toFixed(precision);\n\n if (thisOption.minOpen) {\n outPieceList.push({\n interval: [-Infinity, dataExtent[0]],\n close: [0, 0]\n });\n }\n\n for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {\n var max = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;\n outPieceList.push({\n interval: [curr, max],\n close: [1, 1]\n });\n }\n\n if (thisOption.maxOpen) {\n outPieceList.push({\n interval: [dataExtent[1], Infinity],\n close: [0, 0]\n });\n }\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece, index) {\n piece.index = index;\n piece.text = this.formatValueText(piece.interval);\n }, this);\n },\n categories: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.categories, function (cate) {\n // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。\n // 是否改一致。\n outPieceList.push({\n text: this.formatValueText(cate, true),\n value: cate\n });\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList);\n },\n pieces: function (outPieceList) {\n var thisOption = this.option;\n zrUtil.each(thisOption.pieces, function (pieceListItem, index) {\n if (!zrUtil.isObject(pieceListItem)) {\n pieceListItem = {\n value: pieceListItem\n };\n }\n\n var item = {\n text: '',\n index: index\n };\n\n if (pieceListItem.label != null) {\n item.text = pieceListItem.label;\n }\n\n if (pieceListItem.hasOwnProperty('value')) {\n var value = item.value = pieceListItem.value;\n item.interval = [value, value];\n item.close = [1, 1];\n } else {\n // `min` `max` is legacy option.\n // `lt` `gt` `lte` `gte` is recommended.\n var interval = item.interval = [];\n var close_1 = item.close = [0, 0];\n var closeList = [1, 0, 1];\n var infinityList = [-Infinity, Infinity];\n var useMinMax = [];\n\n for (var lg = 0; lg < 2; lg++) {\n var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg];\n\n for (var i = 0; i < 3 && interval[lg] == null; i++) {\n interval[lg] = pieceListItem[names[i]];\n close_1[lg] = closeList[i];\n useMinMax[lg] = i === 2;\n }\n\n interval[lg] == null && (interval[lg] = infinityList[lg]);\n }\n\n useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);\n useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);\n\n if (process.env.NODE_ENV !== 'production') {\n if (interval[0] > interval[1]) {\n console.warn('Piece ' + index + 'is illegal: ' + interval + ' lower bound should not greater then uppper bound.');\n }\n }\n\n if (interval[0] === interval[1] && close_1[0] && close_1[1]) {\n // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],\n // we use value to lift the priority when min === max\n item.value = interval[0];\n }\n }\n\n item.visual = VisualMapping.retrieveVisuals(pieceListItem);\n outPieceList.push(item);\n }, this); // See \"Order Rule\".\n\n normalizeReverse(thisOption, outPieceList); // Only pieces\n\n reformIntervals(outPieceList);\n zrUtil.each(outPieceList, function (piece) {\n var close = piece.close;\n var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]];\n piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);\n }, this);\n }\n};\n\nfunction normalizeReverse(thisOption, pieceList) {\n var inverse = thisOption.inverse;\n\n if (thisOption.orient === 'vertical' ? !inverse : inverse) {\n pieceList.reverse();\n }\n}\n\nexport default PiecewiseModel;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport VisualMapView from './VisualMapView.js';\nimport * as graphic from '../../util/graphic.js';\nimport { createSymbol } from '../../util/symbol.js';\nimport * as layout from '../../util/layout.js';\nimport * as helper from './helper.js';\nimport { createTextStyle } from '../../label/labelStyle.js';\n\nvar PiecewiseVisualMapView =\n/** @class */\nfunction (_super) {\n __extends(PiecewiseVisualMapView, _super);\n\n function PiecewiseVisualMapView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PiecewiseVisualMapView.type;\n return _this;\n }\n\n PiecewiseVisualMapView.prototype.doRender = function () {\n var thisGroup = this.group;\n thisGroup.removeAll();\n var visualMapModel = this.visualMapModel;\n var textGap = visualMapModel.get('textGap');\n var textStyleModel = visualMapModel.textStyleModel;\n var textFont = textStyleModel.getFont();\n var textFill = textStyleModel.getTextColor();\n\n var itemAlign = this._getItemAlign();\n\n var itemSize = visualMapModel.itemSize;\n\n var viewData = this._getViewData();\n\n var endsText = viewData.endsText;\n var showLabel = zrUtil.retrieve(visualMapModel.get('showLabel', true), !endsText);\n endsText && this._renderEndsText(thisGroup, endsText[0], itemSize, showLabel, itemAlign);\n zrUtil.each(viewData.viewPieceList, function (item) {\n var piece = item.piece;\n var itemGroup = new graphic.Group();\n itemGroup.onclick = zrUtil.bind(this._onItemClick, this, piece);\n\n this._enableHoverLink(itemGroup, item.indexInModelPieceList); // TODO Category\n\n\n var representValue = visualMapModel.getRepresentValue(piece);\n\n this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]]);\n\n if (showLabel) {\n var visualState = this.visualMapModel.getValueState(representValue);\n itemGroup.add(new graphic.Text({\n style: {\n x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,\n y: itemSize[1] / 2,\n text: piece.text,\n verticalAlign: 'middle',\n align: itemAlign,\n font: textFont,\n fill: textFill,\n opacity: visualState === 'outOfRange' ? 0.5 : 1\n }\n }));\n }\n\n thisGroup.add(itemGroup);\n }, this);\n endsText && this._renderEndsText(thisGroup, endsText[1], itemSize, showLabel, itemAlign);\n layout.box(visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap'));\n this.renderBackground(thisGroup);\n this.positionGroup(thisGroup);\n };\n\n PiecewiseVisualMapView.prototype._enableHoverLink = function (itemGroup, pieceIndex) {\n var _this = this;\n\n itemGroup.on('mouseover', function () {\n return onHoverLink('highlight');\n }).on('mouseout', function () {\n return onHoverLink('downplay');\n });\n\n var onHoverLink = function (method) {\n var visualMapModel = _this.visualMapModel; // TODO: TYPE More detailed action types\n\n visualMapModel.option.hoverLink && _this.api.dispatchAction({\n type: method,\n batch: helper.makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)\n });\n };\n };\n\n PiecewiseVisualMapView.prototype._getItemAlign = function () {\n var visualMapModel = this.visualMapModel;\n var modelOption = visualMapModel.option;\n\n if (modelOption.orient === 'vertical') {\n return helper.getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);\n } else {\n // horizontal, most case left unless specifying right.\n var align = modelOption.align;\n\n if (!align || align === 'auto') {\n align = 'left';\n }\n\n return align;\n }\n };\n\n PiecewiseVisualMapView.prototype._renderEndsText = function (group, text, itemSize, showLabel, itemAlign) {\n if (!text) {\n return;\n }\n\n var itemGroup = new graphic.Group();\n var textStyleModel = this.visualMapModel.textStyleModel;\n itemGroup.add(new graphic.Text({\n style: createTextStyle(textStyleModel, {\n x: showLabel ? itemAlign === 'right' ? itemSize[0] : 0 : itemSize[0] / 2,\n y: itemSize[1] / 2,\n verticalAlign: 'middle',\n align: showLabel ? itemAlign : 'center',\n text: text\n })\n }));\n group.add(itemGroup);\n };\n /**\r\n * @private\r\n * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.\r\n */\n\n\n PiecewiseVisualMapView.prototype._getViewData = function () {\n var visualMapModel = this.visualMapModel;\n var viewPieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {\n return {\n piece: piece,\n indexInModelPieceList: index\n };\n });\n var endsText = visualMapModel.get('text'); // Consider orient and inverse.\n\n var orient = visualMapModel.get('orient');\n var inverse = visualMapModel.get('inverse'); // Order of model pieceList is always [low, ..., high]\n\n if (orient === 'horizontal' ? inverse : !inverse) {\n viewPieceList.reverse();\n } // Origin order of endsText is [high, low]\n else if (endsText) {\n endsText = endsText.slice().reverse();\n }\n\n return {\n viewPieceList: viewPieceList,\n endsText: endsText\n };\n };\n\n PiecewiseVisualMapView.prototype._createItemSymbol = function (group, representValue, shapeParam) {\n group.add(createSymbol( // symbol will be string\n this.getControllerVisual(representValue, 'symbol'), shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], // color will be string\n this.getControllerVisual(representValue, 'color')));\n };\n\n PiecewiseVisualMapView.prototype._onItemClick = function (piece) {\n var visualMapModel = this.visualMapModel;\n var option = visualMapModel.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n var selected = zrUtil.clone(option.selected);\n var newKey = visualMapModel.getSelectedMapKey(piece);\n\n if (selectedMode === 'single' || selectedMode === true) {\n selected[newKey] = true;\n zrUtil.each(selected, function (o, key) {\n selected[key] = key === newKey;\n });\n } else {\n selected[newKey] = !selected[newKey];\n }\n\n this.api.dispatchAction({\n type: 'selectDataRange',\n from: this.uid,\n visualMapId: this.visualMapModel.id,\n selected: selected\n });\n };\n\n PiecewiseVisualMapView.type = 'visualMap.piecewise';\n return PiecewiseVisualMapView;\n}(VisualMapView);\n\nexport default PiecewiseVisualMapView;","\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport PiecewiseModel from './PiecewiseModel.js';\nimport PiecewiseView from './PiecewiseView.js';\nimport installCommon from './installCommon.js';\nexport function install(registers) {\n registers.registerComponentModel(PiecewiseModel);\n registers.registerComponentView(PiecewiseView);\n installCommon(registers);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from '../../extension.js';\nimport { install as installVisualMapContinuous } from './installVisualMapContinuous.js';\nimport { install as installVisualMapPiecewise } from './installVisualMapPiecewise.js';\nexport function install(registers) {\n use(installVisualMapContinuous);\n use(installVisualMapPiecewise); // Do not install './dataZoomSelect',\n // since it only work for toolbox dataZoom.\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../util/model.js';\nimport { getDecalFromPalette } from '../model/mixin/palette.js';\nvar DEFAULT_OPTION = {\n label: {\n enabled: true\n },\n decal: {\n show: false\n }\n};\nvar inner = makeInner();\nvar decalPaletteScope = {};\nexport default function ariaVisual(ecModel, api) {\n var ariaModel = ecModel.getModel('aria'); // See \"area enabled\" detection code in `GlobalModel.ts`.\n\n if (!ariaModel.get('enabled')) {\n return;\n }\n\n var defaultOption = zrUtil.clone(DEFAULT_OPTION);\n zrUtil.merge(defaultOption.label, ecModel.getLocaleModel().get('aria'), false);\n zrUtil.merge(ariaModel.option, defaultOption, false);\n setDecal();\n setLabel();\n\n function setDecal() {\n var decalModel = ariaModel.getModel('decal');\n var useDecal = decalModel.get('show');\n\n if (useDecal) {\n // Each type of series use one scope.\n // Pie and funnel are using different scopes.\n var paletteScopeGroupByType_1 = zrUtil.createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.isColorBySeries()) {\n return;\n }\n\n var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);\n\n if (!decalScope) {\n decalScope = {};\n paletteScopeGroupByType_1.set(seriesModel.type, decalScope);\n }\n\n inner(seriesModel).scope = decalScope;\n });\n ecModel.eachRawSeries(function (seriesModel) {\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n if (zrUtil.isFunction(seriesModel.enableAriaDecal)) {\n // Let series define how to use decal palette on data\n seriesModel.enableAriaDecal();\n return;\n }\n\n var data = seriesModel.getData();\n\n if (!seriesModel.isColorBySeries()) {\n var dataAll_1 = seriesModel.getRawData();\n var idxMap_1 = {};\n var decalScope_1 = inner(seriesModel).scope;\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap_1[rawIdx] = idx;\n });\n var dataCount_1 = dataAll_1.count();\n dataAll_1.each(function (rawIdx) {\n var idx = idxMap_1[rawIdx];\n var name = dataAll_1.getName(rawIdx) || rawIdx + '';\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);\n var specifiedDecal = data.getItemVisual(idx, 'decal');\n data.setItemVisual(idx, 'decal', mergeDecal(specifiedDecal, paletteDecal));\n });\n } else {\n var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());\n var specifiedDecal = data.getVisual('decal');\n data.setVisual('decal', mergeDecal(specifiedDecal, paletteDecal));\n }\n\n function mergeDecal(specifiedDecal, paletteDecal) {\n // Merge decal from palette to decal from itemStyle.\n // User do not need to specify all of the decal props.\n var resultDecal = specifiedDecal ? zrUtil.extend(zrUtil.extend({}, paletteDecal), specifiedDecal) : paletteDecal;\n resultDecal.dirty = true;\n return resultDecal;\n }\n });\n }\n }\n\n function setLabel() {\n var labelLocale = ecModel.getLocaleModel().get('aria');\n var labelModel = ariaModel.getModel('label');\n labelModel.option = zrUtil.defaults(labelModel.option, labelLocale);\n\n if (!labelModel.get('enabled')) {\n return;\n }\n\n var dom = api.getZr().dom;\n\n if (labelModel.get('description')) {\n dom.setAttribute('aria-label', labelModel.get('description'));\n return;\n }\n\n var seriesCnt = ecModel.getSeriesCount();\n var maxDataCnt = labelModel.get(['data', 'maxCount']) || 10;\n var maxSeriesCnt = labelModel.get(['series', 'maxCount']) || 10;\n var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);\n var ariaLabel;\n\n if (seriesCnt < 1) {\n // No series, no aria label\n return;\n } else {\n var title = getTitle();\n\n if (title) {\n var withTitle = labelModel.get(['general', 'withTitle']);\n ariaLabel = replace(withTitle, {\n title: title\n });\n } else {\n ariaLabel = labelModel.get(['general', 'withoutTitle']);\n }\n\n var seriesLabels_1 = [];\n var prefix = seriesCnt > 1 ? labelModel.get(['series', 'multiple', 'prefix']) : labelModel.get(['series', 'single', 'prefix']);\n ariaLabel += replace(prefix, {\n seriesCount: seriesCnt\n });\n ecModel.eachSeries(function (seriesModel, idx) {\n if (idx < displaySeriesCnt) {\n var seriesLabel = void 0;\n var seriesName = seriesModel.get('name');\n var withName = seriesName ? 'withName' : 'withoutName';\n seriesLabel = seriesCnt > 1 ? labelModel.get(['series', 'multiple', withName]) : labelModel.get(['series', 'single', withName]);\n seriesLabel = replace(seriesLabel, {\n seriesId: seriesModel.seriesIndex,\n seriesName: seriesModel.get('name'),\n seriesType: getSeriesTypeName(seriesModel.subType)\n });\n var data = seriesModel.getData();\n\n if (data.count() > maxDataCnt) {\n // Show part of data\n var partialLabel = labelModel.get(['data', 'partialData']);\n seriesLabel += replace(partialLabel, {\n displayCnt: maxDataCnt\n });\n } else {\n seriesLabel += labelModel.get(['data', 'allData']);\n }\n\n var middleSeparator_1 = labelModel.get(['data', 'separator', 'middle']);\n var endSeparator_1 = labelModel.get(['data', 'separator', 'end']);\n var dataLabels = [];\n\n for (var i = 0; i < data.count(); i++) {\n if (i < maxDataCnt) {\n var name_1 = data.getName(i);\n var value = data.getValues(i);\n var dataLabel = labelModel.get(['data', name_1 ? 'withName' : 'withoutName']);\n dataLabels.push(replace(dataLabel, {\n name: name_1,\n value: value.join(middleSeparator_1)\n }));\n }\n }\n\n seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;\n seriesLabels_1.push(seriesLabel);\n }\n });\n var separatorModel = labelModel.getModel(['series', 'multiple', 'separator']);\n var middleSeparator = separatorModel.get('middle');\n var endSeparator = separatorModel.get('end');\n ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;\n dom.setAttribute('aria-label', ariaLabel);\n }\n }\n\n function replace(str, keyValues) {\n if (!zrUtil.isString(str)) {\n return str;\n }\n\n var result = str;\n zrUtil.each(keyValues, function (value, key) {\n result = result.replace(new RegExp('\\\\{\\\\s*' + key + '\\\\s*\\\\}', 'g'), value);\n });\n return result;\n }\n\n function getTitle() {\n var title = ecModel.get('title');\n\n if (title && title.length) {\n title = title[0];\n }\n\n return title && title.text;\n }\n\n function getSeriesTypeName(type) {\n return ecModel.getLocaleModel().get(['series', 'typeNames'])[type] || '自定义图';\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nexport default function ariaPreprocessor(option) {\n if (!option || !option.aria) {\n return;\n }\n\n var aria = option.aria; // aria.show is deprecated and should use aria.enabled instead\n\n if (aria.show != null) {\n aria.enabled = aria.show;\n }\n\n aria.label = aria.label || {}; // move description, general, series, data to be under aria.label\n\n zrUtil.each(['description', 'general', 'series', 'data'], function (name) {\n if (aria[name] != null) {\n aria.label[name] = aria[name];\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport ariaVisual from '../../visual/aria.js';\nimport ariaPreprocessor from './preprocessor.js';\nexport function install(registers) {\n registers.registerPreprocessor(ariaPreprocessor);\n registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { keys, isArray, map, isObject, isString, isRegExp, isArrayLike, hasOwn, isNumber } from 'zrender/lib/core/util.js';\nimport { throwError, makePrintable } from './log.js';\nimport { getRawValueParser, createFilterComparator } from '../data/helper/dataValueHelper.js';\n;\nvar RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {\n value: 'eq',\n // PENDING: not good for literal semantic?\n '<': 'lt',\n '<=': 'lte',\n '>': 'gt',\n '>=': 'gte',\n '=': 'eq',\n '!=': 'ne',\n '<>': 'ne' // Might be misleading for sake of the difference between '==' and '===',\n // so don't support them.\n // '==': 'eq',\n // '===': 'seq',\n // '!==': 'sne'\n // PENDING: Whether support some common alias \"ge\", \"le\", \"neq\"?\n // ge: 'gte',\n // le: 'lte',\n // neq: 'ne',\n\n}; // type RelationalExpressionOpEvaluate = (tarVal: unknown, condVal: unknown) => boolean;\n\nvar RegExpEvaluator =\n/** @class */\nfunction () {\n function RegExpEvaluator(rVal) {\n // Support condVal: RegExp | string\n var condValue = this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null;\n\n if (condValue == null) {\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal regexp', rVal, 'in');\n }\n\n throwError(errMsg);\n }\n }\n\n RegExpEvaluator.prototype.evaluate = function (lVal) {\n var type = typeof lVal;\n return isString(type) ? this._condVal.test(lVal) : isNumber(type) ? this._condVal.test(lVal + '') : false;\n };\n\n return RegExpEvaluator;\n}();\n\nvar ConstConditionInternal =\n/** @class */\nfunction () {\n function ConstConditionInternal() {}\n\n ConstConditionInternal.prototype.evaluate = function () {\n return this.value;\n };\n\n return ConstConditionInternal;\n}();\n\nvar AndConditionInternal =\n/** @class */\nfunction () {\n function AndConditionInternal() {}\n\n AndConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (!children[i].evaluate()) {\n return false;\n }\n }\n\n return true;\n };\n\n return AndConditionInternal;\n}();\n\nvar OrConditionInternal =\n/** @class */\nfunction () {\n function OrConditionInternal() {}\n\n OrConditionInternal.prototype.evaluate = function () {\n var children = this.children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].evaluate()) {\n return true;\n }\n }\n\n return false;\n };\n\n return OrConditionInternal;\n}();\n\nvar NotConditionInternal =\n/** @class */\nfunction () {\n function NotConditionInternal() {}\n\n NotConditionInternal.prototype.evaluate = function () {\n return !this.child.evaluate();\n };\n\n return NotConditionInternal;\n}();\n\nvar RelationalConditionInternal =\n/** @class */\nfunction () {\n function RelationalConditionInternal() {}\n\n RelationalConditionInternal.prototype.evaluate = function () {\n var needParse = !!this.valueParser; // Call getValue with no `this`.\n\n var getValue = this.getValue;\n var tarValRaw = getValue(this.valueGetterParam);\n var tarValParsed = needParse ? this.valueParser(tarValRaw) : null; // Relational cond follow \"and\" logic internally.\n\n for (var i = 0; i < this.subCondList.length; i++) {\n if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {\n return false;\n }\n }\n\n return true;\n };\n\n return RelationalConditionInternal;\n}();\n\nfunction parseOption(exprOption, getters) {\n if (exprOption === true || exprOption === false) {\n var cond = new ConstConditionInternal();\n cond.value = exprOption;\n return cond;\n }\n\n var errMsg = '';\n\n if (!isObjectNotArray(exprOption)) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal config. Expect a plain object but actually', exprOption);\n }\n\n throwError(errMsg);\n }\n\n if (exprOption.and) {\n return parseAndOrOption('and', exprOption, getters);\n } else if (exprOption.or) {\n return parseAndOrOption('or', exprOption, getters);\n } else if (exprOption.not) {\n return parseNotOption(exprOption, getters);\n }\n\n return parseRelationalOption(exprOption, getters);\n}\n\nfunction parseAndOrOption(op, exprOption, getters) {\n var subOptionArr = exprOption[op];\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"and\"/\"or\" condition should only be `' + op + ': [...]` and must not be empty array.', 'Illegal condition:', exprOption);\n }\n\n if (!isArray(subOptionArr)) {\n throwError(errMsg);\n }\n\n if (!subOptionArr.length) {\n throwError(errMsg);\n }\n\n var cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal();\n cond.children = map(subOptionArr, function (subOption) {\n return parseOption(subOption, getters);\n });\n\n if (!cond.children.length) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseNotOption(exprOption, getters) {\n var subOption = exprOption.not;\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('\"not\" condition should only be `not: {}`.', 'Illegal condition:', exprOption);\n }\n\n if (!isObjectNotArray(subOption)) {\n throwError(errMsg);\n }\n\n var cond = new NotConditionInternal();\n cond.child = parseOption(subOption, getters);\n\n if (!cond.child) {\n throwError(errMsg);\n }\n\n return cond;\n}\n\nfunction parseRelationalOption(exprOption, getters) {\n var errMsg = '';\n var valueGetterParam = getters.prepareGetValue(exprOption);\n var subCondList = [];\n var exprKeys = keys(exprOption);\n var parserName = exprOption.parser;\n var valueParser = parserName ? getRawValueParser(parserName) : null;\n\n for (var i = 0; i < exprKeys.length; i++) {\n var keyRaw = exprKeys[i];\n\n if (keyRaw === 'parser' || getters.valueGetterAttrMap.get(keyRaw)) {\n continue;\n }\n\n var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;\n var condValueRaw = exprOption[keyRaw];\n var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;\n var evaluator = createFilterComparator(op, condValueParsed) || op === 'reg' && new RegExpEvaluator(condValueParsed);\n\n if (!evaluator) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Illegal relational operation: \"' + keyRaw + '\" in condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n subCondList.push(evaluator);\n }\n\n if (!subCondList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relational condition must have at least one operator.', 'Illegal condition:', exprOption);\n } // No relational operator always disabled in case of dangers result.\n\n\n throwError(errMsg);\n }\n\n var cond = new RelationalConditionInternal();\n cond.valueGetterParam = valueGetterParam;\n cond.valueParser = valueParser;\n cond.getValue = getters.getValue;\n cond.subCondList = subCondList;\n return cond;\n}\n\nfunction isObjectNotArray(val) {\n return isObject(val) && !isArrayLike(val);\n}\n\nvar ConditionalExpressionParsed =\n/** @class */\nfunction () {\n function ConditionalExpressionParsed(exprOption, getters) {\n this._cond = parseOption(exprOption, getters);\n }\n\n ConditionalExpressionParsed.prototype.evaluate = function () {\n return this._cond.evaluate();\n };\n\n return ConditionalExpressionParsed;\n}();\n\n;\nexport function parseConditionalExpression(exprOption, getters) {\n return new ConditionalExpressionParsed(exprOption, getters);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { parseConditionalExpression } from '../../util/conditionalExpression.js';\nimport { hasOwn, createHashMap } from 'zrender/lib/core/util.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nexport var filterTransform = {\n type: 'echarts:filter',\n // PENDING: enhance to filter by index rather than create new data\n transform: function (params) {\n // [Caveat] Fail-Fast:\n // Do not return the whole dataset unless user config indicates it explicitly.\n // For example, if no condition is specified by mistake, returning an empty result\n // is better than returning the entire raw source for the user to find the mistake.\n var upstream = params.upstream;\n var rawItem;\n var condition = parseConditionalExpression(params.config, {\n valueGetterAttrMap: createHashMap({\n dimension: true\n }),\n prepareGetValue: function (exprOption) {\n var errMsg = '';\n var dimLoose = exprOption.dimension;\n\n if (!hasOwn(exprOption, 'dimension')) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Relation condition must has prop \"dimension\" specified.', 'Illegal condition:', exprOption);\n }\n\n throwError(errMsg);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal condition:', exprOption, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n return {\n dimIdx: dimInfo.index\n };\n },\n getValue: function (param) {\n return upstream.retrieveValueFromItem(rawItem, param.dimIdx);\n }\n });\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n rawItem = upstream.getRawDataItem(i);\n\n if (condition.evaluate()) {\n resultData.push(rawItem);\n }\n }\n\n return {\n data: resultData\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS } from '../../util/types.js';\nimport { makePrintable, throwError } from '../../util/log.js';\nimport { each } from 'zrender/lib/core/util.js';\nimport { normalizeToArray } from '../../util/model.js';\nimport { getRawValueParser, SortOrderComparator } from '../../data/helper/dataValueHelper.js';\nvar sampleLog = '';\n\nif (process.env.NODE_ENV !== 'production') {\n sampleLog = ['Valid config is like:', '{ dimension: \"age\", order: \"asc\" }', 'or [{ dimension: \"age\", order: \"asc\"], { dimension: \"date\", order: \"desc\" }]'].join(' ');\n}\n\nexport var sortTransform = {\n type: 'echarts:sort',\n transform: function (params) {\n var upstream = params.upstream;\n var config = params.config;\n var errMsg = ''; // Normalize\n // const orderExprList: OrderExpression[] = isArray(config[0])\n // ? config as OrderExpression[]\n // : [config as OrderExpression];\n\n var orderExprList = normalizeToArray(config);\n\n if (!orderExprList.length) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Empty `config` in sort transform.';\n }\n\n throwError(errMsg);\n }\n\n var orderDefList = [];\n each(orderExprList, function (orderExpr) {\n var dimLoose = orderExpr.dimension;\n var order = orderExpr.order;\n var parserName = orderExpr.parser;\n var incomparable = orderExpr.incomparable;\n\n if (dimLoose == null) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"dimension\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'Sort transform config must has \"order\" specified.' + sampleLog;\n }\n\n throwError(errMsg);\n }\n\n if (incomparable && incomparable !== 'min' && incomparable !== 'max') {\n var errMsg_1 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_1 = 'incomparable must be \"min\" or \"max\" rather than \"' + incomparable + '\".';\n }\n\n throwError(errMsg_1);\n }\n\n if (order !== 'asc' && order !== 'desc') {\n var errMsg_2 = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg_2 = 'order must be \"asc\" or \"desc\" rather than \"' + order + '\".';\n }\n\n throwError(errMsg_2);\n }\n\n var dimInfo = upstream.getDimensionInfo(dimLoose);\n\n if (!dimInfo) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Can not find dimension info via: ' + dimLoose + '.\\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n var parser = parserName ? getRawValueParser(parserName) : null;\n\n if (parserName && !parser) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = makePrintable('Invalid parser name ' + parserName + '.\\n', 'Illegal config:', orderExpr, '.\\n');\n }\n\n throwError(errMsg);\n }\n\n orderDefList.push({\n dimIdx: dimInfo.index,\n parser: parser,\n comparator: new SortOrderComparator(order, incomparable)\n });\n }); // TODO: support it?\n\n var sourceFormat = upstream.sourceFormat;\n\n if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {\n if (process.env.NODE_ENV !== 'production') {\n errMsg = 'sourceFormat \"' + sourceFormat + '\" is not supported yet';\n }\n\n throwError(errMsg);\n } // Other upstream format are all array.\n\n\n var resultData = [];\n\n for (var i = 0, len = upstream.count(); i < len; i++) {\n resultData.push(upstream.getRawDataItem(i));\n }\n\n resultData.sort(function (item0, item1) {\n for (var i = 0; i < orderDefList.length; i++) {\n var orderDef = orderDefList[i];\n var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);\n var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);\n\n if (orderDef.parser) {\n val0 = orderDef.parser(val0);\n val1 = orderDef.parser(val1);\n }\n\n var result = orderDef.comparator.evaluate(val0, val1);\n\n if (result !== 0) {\n return result;\n }\n }\n\n return 0;\n });\n return {\n data: resultData\n };\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { filterTransform } from './filterTransform.js';\nimport { sortTransform } from './sortTransform.js';\nexport function install(registers) {\n registers.registerTransform(filterTransform);\n registers.registerTransform(sortTransform);\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { __extends } from \"tslib\";\n/**\r\n * This module is imported by echarts directly.\r\n *\r\n * Notice:\r\n * Always keep this file exists for backward compatibility.\r\n * Because before 4.1.0, dataset is an optional component,\r\n * some users may import this module manually.\r\n */\n\nimport ComponentModel from '../../model/Component.js';\nimport ComponentView from '../../view/Component.js';\nimport { SERIES_LAYOUT_BY_COLUMN } from '../../util/types.js';\nimport { disableTransformOptionMerge, SourceManager } from '../../data/helper/sourceManager.js';\n\nvar DatasetModel =\n/** @class */\nfunction (_super) {\n __extends(DatasetModel, _super);\n\n function DatasetModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetModel.prototype.init = function (option, parentModel, ecModel) {\n _super.prototype.init.call(this, option, parentModel, ecModel);\n\n this._sourceManager = new SourceManager(this);\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.mergeOption = function (newOption, ecModel) {\n _super.prototype.mergeOption.call(this, newOption, ecModel);\n\n disableTransformOptionMerge(this);\n };\n\n DatasetModel.prototype.optionUpdated = function () {\n this._sourceManager.dirty();\n };\n\n DatasetModel.prototype.getSourceManager = function () {\n return this._sourceManager;\n };\n\n DatasetModel.type = 'dataset';\n DatasetModel.defaultOption = {\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN\n };\n return DatasetModel;\n}(ComponentModel);\n\nexport { DatasetModel };\n\nvar DatasetView =\n/** @class */\nfunction (_super) {\n __extends(DatasetView, _super);\n\n function DatasetView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'dataset';\n return _this;\n }\n\n DatasetView.type = 'dataset';\n return DatasetView;\n}(ComponentView);\n\nexport function install(registers) {\n registers.registerComponentModel(DatasetModel);\n registers.registerComponentView(DatasetView);\n}","import { cubicSubdivide } from '../core/curve.js';\nimport PathProxy from '../core/PathProxy.js';\nvar CMD = PathProxy.CMD;\nfunction aroundEqual(a, b) {\n return Math.abs(a - b) < 1e-5;\n}\nexport function pathToBezierCurves(path) {\n var data = path.data;\n var len = path.len();\n var bezierArrayGroups = [];\n var currentSubpath;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n function createNewSubpath(x, y) {\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n currentSubpath = [x, y];\n }\n function addLine(x0, y0, x1, y1) {\n if (!(aroundEqual(x0, x1) && aroundEqual(y0, y1))) {\n currentSubpath.push(x0, y0, x1, y1, x1, y1);\n }\n }\n function addArc(startAngle, endAngle, cx, cy, rx, ry) {\n var delta = Math.abs(endAngle - startAngle);\n var len = Math.tan(delta / 4) * 4 / 3;\n var dir = endAngle < startAngle ? -1 : 1;\n var c1 = Math.cos(startAngle);\n var s1 = Math.sin(startAngle);\n var c2 = Math.cos(endAngle);\n var s2 = Math.sin(endAngle);\n var x1 = c1 * rx + cx;\n var y1 = s1 * ry + cy;\n var x4 = c2 * rx + cx;\n var y4 = s2 * ry + cy;\n var hx = rx * len * dir;\n var hy = ry * len * dir;\n currentSubpath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);\n }\n var x1;\n var y1;\n var x2;\n var y2;\n for (var i = 0; i < len;) {\n var cmd = data[i++];\n var isFirst = i === 1;\n if (isFirst) {\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {\n currentSubpath = [x0, y0];\n }\n }\n switch (cmd) {\n case CMD.M:\n xi = x0 = data[i++];\n yi = y0 = data[i++];\n createNewSubpath(x0, y0);\n break;\n case CMD.L:\n x1 = data[i++];\n y1 = data[i++];\n addLine(xi, yi, x1, y1);\n xi = x1;\n yi = y1;\n break;\n case CMD.C:\n currentSubpath.push(data[i++], data[i++], data[i++], data[i++], xi = data[i++], yi = data[i++]);\n break;\n case CMD.Q:\n x1 = data[i++];\n y1 = data[i++];\n x2 = data[i++];\n y2 = data[i++];\n currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);\n xi = x2;\n yi = y2;\n break;\n case CMD.A:\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;\n i += 1;\n var anticlockwise = !data[i++];\n x1 = Math.cos(startAngle) * rx + cx;\n y1 = Math.sin(startAngle) * ry + cy;\n if (isFirst) {\n x0 = x1;\n y0 = y1;\n createNewSubpath(x0, y0);\n }\n else {\n addLine(xi, yi, x1, y1);\n }\n xi = Math.cos(endAngle) * rx + cx;\n yi = Math.sin(endAngle) * ry + cy;\n var step = (anticlockwise ? -1 : 1) * Math.PI / 2;\n for (var angle = startAngle; anticlockwise ? angle > endAngle : angle < endAngle; angle += step) {\n var nextAngle = anticlockwise ? Math.max(angle + step, endAngle)\n : Math.min(angle + step, endAngle);\n addArc(angle, nextAngle, cx, cy, rx, ry);\n }\n break;\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n x1 = x0 + data[i++];\n y1 = y0 + data[i++];\n createNewSubpath(x1, y0);\n addLine(x1, y0, x1, y1);\n addLine(x1, y1, x0, y1);\n addLine(x0, y1, x0, y0);\n addLine(x0, y0, x1, y0);\n break;\n case CMD.Z:\n currentSubpath && addLine(xi, yi, x0, y0);\n xi = x0;\n yi = y0;\n break;\n }\n }\n if (currentSubpath && currentSubpath.length > 2) {\n bezierArrayGroups.push(currentSubpath);\n }\n return bezierArrayGroups;\n}\nfunction adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out, scale) {\n if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {\n out.push(x3, y3);\n return;\n }\n var PIXEL_DISTANCE = 2 / scale;\n var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;\n var dx = x3 - x0;\n var dy = y3 - y0;\n var d = Math.sqrt(dx * dx + dy * dy);\n dx /= d;\n dy /= d;\n var dx1 = x1 - x0;\n var dy1 = y1 - y0;\n var dx2 = x2 - x3;\n var dy2 = y2 - y3;\n var cp1LenSqr = dx1 * dx1 + dy1 * dy1;\n var cp2LenSqr = dx2 * dx2 + dy2 * dy2;\n if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {\n out.push(x3, y3);\n return;\n }\n var projLen1 = dx * dx1 + dy * dy1;\n var projLen2 = -dx * dx2 - dy * dy2;\n var d1Sqr = cp1LenSqr - projLen1 * projLen1;\n var d2Sqr = cp2LenSqr - projLen2 * projLen2;\n if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0\n && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) {\n out.push(x3, y3);\n return;\n }\n var tmpSegX = [];\n var tmpSegY = [];\n cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);\n adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out, scale);\n adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out, scale);\n}\nexport function pathToPolygons(path, scale) {\n var bezierArrayGroups = pathToBezierCurves(path);\n var polygons = [];\n scale = scale || 1;\n for (var i = 0; i < bezierArrayGroups.length; i++) {\n var beziers = bezierArrayGroups[i];\n var polygon = [];\n var x0 = beziers[0];\n var y0 = beziers[1];\n polygon.push(x0, y0);\n for (var k = 2; k < beziers.length;) {\n var x1 = beziers[k++];\n var y1 = beziers[k++];\n var x2 = beziers[k++];\n var y2 = beziers[k++];\n var x3 = beziers[k++];\n var y3 = beziers[k++];\n adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale);\n x0 = x3;\n y0 = y3;\n }\n polygons.push(polygon);\n }\n return polygons;\n}\n","import { fromPoints } from '../core/bbox.js';\nimport BoundingRect from '../core/BoundingRect.js';\nimport Point from '../core/Point.js';\nimport { map } from '../core/util.js';\nimport Polygon from '../graphic/shape/Polygon.js';\nimport Rect from '../graphic/shape/Rect.js';\nimport Sector from '../graphic/shape/Sector.js';\nimport { pathToPolygons } from './convertPath.js';\nimport { clonePath } from './path.js';\nfunction getDividingGrids(dimSize, rowDim, count) {\n var rowSize = dimSize[rowDim];\n var columnSize = dimSize[1 - rowDim];\n var ratio = Math.abs(rowSize / columnSize);\n var rowCount = Math.ceil(Math.sqrt(ratio * count));\n var columnCount = Math.floor(count / rowCount);\n if (columnCount === 0) {\n columnCount = 1;\n rowCount = count;\n }\n var grids = [];\n for (var i = 0; i < rowCount; i++) {\n grids.push(columnCount);\n }\n var currentCount = rowCount * columnCount;\n var remained = count - currentCount;\n if (remained > 0) {\n for (var i = 0; i < remained; i++) {\n grids[i % rowCount] += 1;\n }\n }\n return grids;\n}\nfunction divideSector(sectorShape, count, outShapes) {\n var r0 = sectorShape.r0;\n var r = sectorShape.r;\n var startAngle = sectorShape.startAngle;\n var endAngle = sectorShape.endAngle;\n var angle = Math.abs(endAngle - startAngle);\n var arcLen = angle * r;\n var deltaR = r - r0;\n var isAngleRow = arcLen > Math.abs(deltaR);\n var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count);\n var rowSize = (isAngleRow ? angle : deltaR) / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = (isAngleRow ? deltaR : angle) / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n if (isAngleRow) {\n newShape.startAngle = startAngle + rowSize * row;\n newShape.endAngle = startAngle + rowSize * (row + 1);\n newShape.r0 = r0 + columnSize * column;\n newShape.r = r0 + columnSize * (column + 1);\n }\n else {\n newShape.startAngle = startAngle + columnSize * column;\n newShape.endAngle = startAngle + columnSize * (column + 1);\n newShape.r0 = r0 + rowSize * row;\n newShape.r = r0 + rowSize * (row + 1);\n }\n newShape.clockwise = sectorShape.clockwise;\n newShape.cx = sectorShape.cx;\n newShape.cy = sectorShape.cy;\n outShapes.push(newShape);\n }\n }\n}\nfunction divideRect(rectShape, count, outShapes) {\n var width = rectShape.width;\n var height = rectShape.height;\n var isHorizontalRow = width > height;\n var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count);\n var rowSizeDim = isHorizontalRow ? 'width' : 'height';\n var columnSizeDim = isHorizontalRow ? 'height' : 'width';\n var rowDim = isHorizontalRow ? 'x' : 'y';\n var columnDim = isHorizontalRow ? 'y' : 'x';\n var rowSize = rectShape[rowSizeDim] / grids.length;\n for (var row = 0; row < grids.length; row++) {\n var columnSize = rectShape[columnSizeDim] / grids[row];\n for (var column = 0; column < grids[row]; column++) {\n var newShape = {};\n newShape[rowDim] = row * rowSize;\n newShape[columnDim] = column * columnSize;\n newShape[rowSizeDim] = rowSize;\n newShape[columnSizeDim] = columnSize;\n newShape.x += rectShape.x;\n newShape.y += rectShape.y;\n outShapes.push(newShape);\n }\n }\n}\nfunction crossProduct2d(x1, y1, x2, y2) {\n return x1 * y2 - x2 * y1;\n}\nfunction lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {\n var mx = a2x - a1x;\n var my = a2y - a1y;\n var nx = b2x - b1x;\n var ny = b2y - b1y;\n var nmCrossProduct = crossProduct2d(nx, ny, mx, my);\n if (Math.abs(nmCrossProduct) < 1e-6) {\n return null;\n }\n var b1a1x = a1x - b1x;\n var b1a1y = a1y - b1y;\n var p = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;\n if (p < 0 || p > 1) {\n return null;\n }\n return new Point(p * mx + a1x, p * my + a1y);\n}\nfunction projPtOnLine(pt, lineA, lineB) {\n var dir = new Point();\n Point.sub(dir, lineB, lineA);\n dir.normalize();\n var dir2 = new Point();\n Point.sub(dir2, pt, lineA);\n var len = dir2.dot(dir);\n return len;\n}\nfunction addToPoly(poly, pt) {\n var last = poly[poly.length - 1];\n if (last && last[0] === pt[0] && last[1] === pt[1]) {\n return;\n }\n poly.push(pt);\n}\nfunction splitPolygonByLine(points, lineA, lineB) {\n var len = points.length;\n var intersections = [];\n for (var i = 0; i < len; i++) {\n var p0 = points[i];\n var p1 = points[(i + 1) % len];\n var intersectionPt = lineLineIntersect(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y);\n if (intersectionPt) {\n intersections.push({\n projPt: projPtOnLine(intersectionPt, lineA, lineB),\n pt: intersectionPt,\n idx: i\n });\n }\n }\n if (intersections.length < 2) {\n return [{ points: points }, { points: points }];\n }\n intersections.sort(function (a, b) {\n return a.projPt - b.projPt;\n });\n var splitPt0 = intersections[0];\n var splitPt1 = intersections[intersections.length - 1];\n if (splitPt1.idx < splitPt0.idx) {\n var tmp = splitPt0;\n splitPt0 = splitPt1;\n splitPt1 = tmp;\n }\n var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];\n var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];\n var newPolyA = [splitPt0Arr];\n var newPolyB = [splitPt1Arr];\n for (var i = splitPt0.idx + 1; i <= splitPt1.idx; i++) {\n addToPoly(newPolyA, points[i].slice());\n }\n addToPoly(newPolyA, splitPt1Arr);\n addToPoly(newPolyA, splitPt0Arr);\n for (var i = splitPt1.idx + 1; i <= splitPt0.idx + len; i++) {\n addToPoly(newPolyB, points[i % len].slice());\n }\n addToPoly(newPolyB, splitPt0Arr);\n addToPoly(newPolyB, splitPt1Arr);\n return [{\n points: newPolyA\n }, {\n points: newPolyB\n }];\n}\nfunction binaryDividePolygon(polygonShape) {\n var points = polygonShape.points;\n var min = [];\n var max = [];\n fromPoints(points, min, max);\n var boundingRect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n var width = boundingRect.width;\n var height = boundingRect.height;\n var x = boundingRect.x;\n var y = boundingRect.y;\n var pt0 = new Point();\n var pt1 = new Point();\n if (width > height) {\n pt0.x = pt1.x = x + width / 2;\n pt0.y = y;\n pt1.y = y + height;\n }\n else {\n pt0.y = pt1.y = y + height / 2;\n pt0.x = x;\n pt1.x = x + width;\n }\n return splitPolygonByLine(points, pt0, pt1);\n}\nfunction binaryDivideRecursive(divider, shape, count, out) {\n if (count === 1) {\n out.push(shape);\n }\n else {\n var mid = Math.floor(count / 2);\n var sub = divider(shape);\n binaryDivideRecursive(divider, sub[0], mid, out);\n binaryDivideRecursive(divider, sub[1], count - mid, out);\n }\n return out;\n}\nexport function clone(path, count) {\n var paths = [];\n for (var i = 0; i < count; i++) {\n paths.push(clonePath(path));\n }\n return paths;\n}\nfunction copyPathProps(source, target) {\n target.setStyle(source.style);\n target.z = source.z;\n target.z2 = source.z2;\n target.zlevel = source.zlevel;\n}\nfunction polygonConvert(points) {\n var out = [];\n for (var i = 0; i < points.length;) {\n out.push([points[i++], points[i++]]);\n }\n return out;\n}\nexport function split(path, count) {\n var outShapes = [];\n var shape = path.shape;\n var OutShapeCtor;\n switch (path.type) {\n case 'rect':\n divideRect(shape, count, outShapes);\n OutShapeCtor = Rect;\n break;\n case 'sector':\n divideSector(shape, count, outShapes);\n OutShapeCtor = Sector;\n break;\n case 'circle':\n divideSector({\n r0: 0, r: shape.r, startAngle: 0, endAngle: Math.PI * 2,\n cx: shape.cx, cy: shape.cy\n }, count, outShapes);\n OutShapeCtor = Sector;\n break;\n default:\n var m = path.getComputedTransform();\n var scale = m ? Math.sqrt(Math.max(m[0] * m[0] + m[1] * m[1], m[2] * m[2] + m[3] * m[3])) : 1;\n var polygons = map(pathToPolygons(path.getUpdatedPathProxy(), scale), function (poly) { return polygonConvert(poly); });\n var polygonCount = polygons.length;\n if (polygonCount === 0) {\n binaryDivideRecursive(binaryDividePolygon, {\n points: polygons[0]\n }, count, outShapes);\n }\n else if (polygonCount === count) {\n for (var i = 0; i < polygonCount; i++) {\n outShapes.push({\n points: polygons[i]\n });\n }\n }\n else {\n var totalArea_1 = 0;\n var items = map(polygons, function (poly) {\n var min = [];\n var max = [];\n fromPoints(poly, min, max);\n var area = (max[1] - min[1]) * (max[0] - min[0]);\n totalArea_1 += area;\n return { poly: poly, area: area };\n });\n items.sort(function (a, b) { return b.area - a.area; });\n var left = count;\n for (var i = 0; i < polygonCount; i++) {\n var item = items[i];\n if (left <= 0) {\n break;\n }\n var selfCount = i === polygonCount - 1\n ? left\n : Math.ceil(item.area / totalArea_1 * count);\n if (selfCount < 0) {\n continue;\n }\n binaryDivideRecursive(binaryDividePolygon, {\n points: item.poly\n }, selfCount, outShapes);\n left -= selfCount;\n }\n ;\n }\n OutShapeCtor = Polygon;\n break;\n }\n if (!OutShapeCtor) {\n return clone(path, count);\n }\n var out = [];\n for (var i = 0; i < outShapes.length; i++) {\n var subPath = new OutShapeCtor();\n subPath.setShape(outShapes[i]);\n copyPathProps(path, subPath);\n out.push(subPath);\n }\n return out;\n}\n","import { cubicSubdivide } from '../core/curve.js';\nimport Path from '../graphic/Path.js';\nimport { defaults, map } from '../core/util.js';\nimport { lerp } from '../core/vector.js';\nimport { clonePath } from './path.js';\nimport Transformable from '../core/Transformable.js';\nimport { split } from './dividePath.js';\nimport { pathToBezierCurves } from './convertPath.js';\nfunction alignSubpath(subpath1, subpath2) {\n var len1 = subpath1.length;\n var len2 = subpath2.length;\n if (len1 === len2) {\n return [subpath1, subpath2];\n }\n var tmpSegX = [];\n var tmpSegY = [];\n var shorterPath = len1 < len2 ? subpath1 : subpath2;\n var shorterLen = Math.min(len1, len2);\n var diff = Math.abs(len2 - len1) / 6;\n var shorterBezierCount = (shorterLen - 2) / 6;\n var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;\n var newSubpath = [shorterPath[0], shorterPath[1]];\n var remained = diff;\n for (var i = 2; i < shorterLen;) {\n var x0 = shorterPath[i - 2];\n var y0 = shorterPath[i - 1];\n var x1 = shorterPath[i++];\n var y1 = shorterPath[i++];\n var x2 = shorterPath[i++];\n var y2 = shorterPath[i++];\n var x3 = shorterPath[i++];\n var y3 = shorterPath[i++];\n if (remained <= 0) {\n newSubpath.push(x1, y1, x2, y2, x3, y3);\n continue;\n }\n var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;\n for (var k = 1; k <= actualSubDivCount; k++) {\n var p = k / actualSubDivCount;\n cubicSubdivide(x0, x1, x2, x3, p, tmpSegX);\n cubicSubdivide(y0, y1, y2, y3, p, tmpSegY);\n x0 = tmpSegX[3];\n y0 = tmpSegY[3];\n newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);\n x1 = tmpSegX[5];\n y1 = tmpSegY[5];\n x2 = tmpSegX[6];\n y2 = tmpSegY[6];\n }\n remained -= actualSubDivCount - 1;\n }\n return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];\n}\nfunction createSubpath(lastSubpathSubpath, otherSubpath) {\n var len = lastSubpathSubpath.length;\n var lastX = lastSubpathSubpath[len - 2];\n var lastY = lastSubpathSubpath[len - 1];\n var newSubpath = [];\n for (var i = 0; i < otherSubpath.length;) {\n newSubpath[i++] = lastX;\n newSubpath[i++] = lastY;\n }\n return newSubpath;\n}\nexport function alignBezierCurves(array1, array2) {\n var _a;\n var lastSubpath1;\n var lastSubpath2;\n var newArray1 = [];\n var newArray2 = [];\n for (var i = 0; i < Math.max(array1.length, array2.length); i++) {\n var subpath1 = array1[i];\n var subpath2 = array2[i];\n var newSubpath1 = void 0;\n var newSubpath2 = void 0;\n if (!subpath1) {\n newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);\n newSubpath2 = subpath2;\n }\n else if (!subpath2) {\n newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);\n newSubpath1 = subpath1;\n }\n else {\n _a = alignSubpath(subpath1, subpath2), newSubpath1 = _a[0], newSubpath2 = _a[1];\n lastSubpath1 = newSubpath1;\n lastSubpath2 = newSubpath2;\n }\n newArray1.push(newSubpath1);\n newArray2.push(newSubpath2);\n }\n return [newArray1, newArray2];\n}\nexport function centroid(array) {\n var signedArea = 0;\n var cx = 0;\n var cy = 0;\n var len = array.length;\n for (var i = 0, j = len - 2; i < len; j = i, i += 2) {\n var x0 = array[j];\n var y0 = array[j + 1];\n var x1 = array[i];\n var y1 = array[i + 1];\n var a = x0 * y1 - x1 * y0;\n signedArea += a;\n cx += (x0 + x1) * a;\n cy += (y0 + y1) * a;\n }\n if (signedArea === 0) {\n return [array[0] || 0, array[1] || 0];\n }\n return [cx / signedArea / 3, cy / signedArea / 3, signedArea];\n}\nfunction findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {\n var bezierCount = (fromSubBeziers.length - 2) / 6;\n var bestScore = Infinity;\n var bestOffset = 0;\n var len = fromSubBeziers.length;\n var len2 = len - 2;\n for (var offset = 0; offset < bezierCount; offset++) {\n var cursorOffset = offset * 6;\n var score = 0;\n for (var k = 0; k < len; k += 2) {\n var idx = k === 0 ? cursorOffset : ((cursorOffset + k - 2) % len2 + 2);\n var x0 = fromSubBeziers[idx] - fromCp[0];\n var y0 = fromSubBeziers[idx + 1] - fromCp[1];\n var x1 = toSubBeziers[k] - toCp[0];\n var y1 = toSubBeziers[k + 1] - toCp[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestOffset = offset;\n }\n }\n return bestOffset;\n}\nfunction reverse(array) {\n var newArr = [];\n var len = array.length;\n for (var i = 0; i < len; i += 2) {\n newArr[i] = array[len - i - 2];\n newArr[i + 1] = array[len - i - 1];\n }\n return newArr;\n}\nfunction findBestMorphingRotation(fromArr, toArr, searchAngleIteration, searchAngleRange) {\n var result = [];\n var fromNeedsReverse;\n for (var i = 0; i < fromArr.length; i++) {\n var fromSubpathBezier = fromArr[i];\n var toSubpathBezier = toArr[i];\n var fromCp = centroid(fromSubpathBezier);\n var toCp = centroid(toSubpathBezier);\n if (fromNeedsReverse == null) {\n fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;\n }\n var newFromSubpathBezier = [];\n var newToSubpathBezier = [];\n var bestAngle = 0;\n var bestScore = Infinity;\n var tmpArr = [];\n var len = fromSubpathBezier.length;\n if (fromNeedsReverse) {\n fromSubpathBezier = reverse(fromSubpathBezier);\n }\n var offset = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;\n var len2 = len - 2;\n for (var k = 0; k < len2; k += 2) {\n var idx = (offset + k) % len2 + 2;\n newFromSubpathBezier[k + 2] = fromSubpathBezier[idx] - fromCp[0];\n newFromSubpathBezier[k + 3] = fromSubpathBezier[idx + 1] - fromCp[1];\n }\n newFromSubpathBezier[0] = fromSubpathBezier[offset] - fromCp[0];\n newFromSubpathBezier[1] = fromSubpathBezier[offset + 1] - fromCp[1];\n if (searchAngleIteration > 0) {\n var step = searchAngleRange / searchAngleIteration;\n for (var angle = -searchAngleRange / 2; angle <= searchAngleRange / 2; angle += step) {\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n var score = 0;\n for (var k = 0; k < fromSubpathBezier.length; k += 2) {\n var x0 = newFromSubpathBezier[k];\n var y0 = newFromSubpathBezier[k + 1];\n var x1 = toSubpathBezier[k] - toCp[0];\n var y1 = toSubpathBezier[k + 1] - toCp[1];\n var newX1 = x1 * ca - y1 * sa;\n var newY1 = x1 * sa + y1 * ca;\n tmpArr[k] = newX1;\n tmpArr[k + 1] = newY1;\n var dx = newX1 - x0;\n var dy = newY1 - y0;\n score += dx * dx + dy * dy;\n }\n if (score < bestScore) {\n bestScore = score;\n bestAngle = angle;\n for (var m = 0; m < tmpArr.length; m++) {\n newToSubpathBezier[m] = tmpArr[m];\n }\n }\n }\n }\n else {\n for (var i_1 = 0; i_1 < len; i_1 += 2) {\n newToSubpathBezier[i_1] = toSubpathBezier[i_1] - toCp[0];\n newToSubpathBezier[i_1 + 1] = toSubpathBezier[i_1 + 1] - toCp[1];\n }\n }\n result.push({\n from: newFromSubpathBezier,\n to: newToSubpathBezier,\n fromCp: fromCp,\n toCp: toCp,\n rotation: -bestAngle\n });\n }\n return result;\n}\nexport function isCombineMorphing(path) {\n return path.__isCombineMorphing;\n}\nexport function isMorphing(el) {\n return el.__morphT >= 0;\n}\nvar SAVED_METHOD_PREFIX = '__mOriginal_';\nfunction saveAndModifyMethod(obj, methodName, modifiers) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n var originalMethod = obj[savedMethodName] || obj[methodName];\n if (!obj[savedMethodName]) {\n obj[savedMethodName] = obj[methodName];\n }\n var replace = modifiers.replace;\n var after = modifiers.after;\n var before = modifiers.before;\n obj[methodName] = function () {\n var args = arguments;\n var res;\n before && before.apply(this, args);\n if (replace) {\n res = replace.apply(this, args);\n }\n else {\n res = originalMethod.apply(this, args);\n }\n after && after.apply(this, args);\n return res;\n };\n}\nfunction restoreMethod(obj, methodName) {\n var savedMethodName = SAVED_METHOD_PREFIX + methodName;\n if (obj[savedMethodName]) {\n obj[methodName] = obj[savedMethodName];\n obj[savedMethodName] = null;\n }\n}\nfunction applyTransformOnBeziers(bezierCurves, mm) {\n for (var i = 0; i < bezierCurves.length; i++) {\n var subBeziers = bezierCurves[i];\n for (var k = 0; k < subBeziers.length;) {\n var x = subBeziers[k];\n var y = subBeziers[k + 1];\n subBeziers[k++] = mm[0] * x + mm[2] * y + mm[4];\n subBeziers[k++] = mm[1] * x + mm[3] * y + mm[5];\n }\n }\n}\nfunction prepareMorphPath(fromPath, toPath) {\n var fromPathProxy = fromPath.getUpdatedPathProxy();\n var toPathProxy = toPath.getUpdatedPathProxy();\n var _a = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a[0], toBezierCurves = _a[1];\n var fromPathTransform = fromPath.getComputedTransform();\n var toPathTransform = toPath.getComputedTransform();\n function updateIdentityTransform() {\n this.transform = null;\n }\n fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);\n toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);\n saveAndModifyMethod(toPath, 'updateTransform', { replace: updateIdentityTransform });\n toPath.transform = null;\n var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);\n var tmpArr = [];\n saveAndModifyMethod(toPath, 'buildPath', { replace: function (path) {\n var t = toPath.__morphT;\n var onet = 1 - t;\n var newCp = [];\n for (var i = 0; i < morphingData.length; i++) {\n var item = morphingData[i];\n var from = item.from;\n var to = item.to;\n var angle = item.rotation * t;\n var fromCp = item.fromCp;\n var toCp = item.toCp;\n var sa = Math.sin(angle);\n var ca = Math.cos(angle);\n lerp(newCp, fromCp, toCp, t);\n for (var m = 0; m < from.length; m += 2) {\n var x0_1 = from[m];\n var y0_1 = from[m + 1];\n var x1 = to[m];\n var y1 = to[m + 1];\n var x = x0_1 * onet + x1 * t;\n var y = y0_1 * onet + y1 * t;\n tmpArr[m] = (x * ca - y * sa) + newCp[0];\n tmpArr[m + 1] = (x * sa + y * ca) + newCp[1];\n }\n var x0 = tmpArr[0];\n var y0 = tmpArr[1];\n path.moveTo(x0, y0);\n for (var m = 2; m < from.length;) {\n var x1 = tmpArr[m++];\n var y1 = tmpArr[m++];\n var x2 = tmpArr[m++];\n var y2 = tmpArr[m++];\n var x3 = tmpArr[m++];\n var y3 = tmpArr[m++];\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n }\n else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n } });\n}\nexport function morphPath(fromPath, toPath, animationOpts) {\n if (!fromPath || !toPath) {\n return toPath;\n }\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n prepareMorphPath(fromPath, toPath);\n toPath.__morphT = 0;\n function restoreToPath() {\n restoreMethod(toPath, 'buildPath');\n restoreMethod(toPath, 'updateTransform');\n toPath.__morphT = -1;\n toPath.createPathProxy();\n toPath.dirtyShape();\n }\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n toPath.dirtyShape();\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n oldDone && oldDone();\n }\n }, animationOpts));\n return toPath;\n}\nfunction hilbert(x, y, minX, minY, maxX, maxY) {\n var bits = 16;\n x = (maxX === minX) ? 0 : Math.round(32767 * (x - minX) / (maxX - minX));\n y = (maxY === minY) ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));\n var d = 0;\n var tmp;\n for (var s = (1 << bits) / 2; s > 0; s /= 2) {\n var rx = 0;\n var ry = 0;\n if ((x & s) > 0) {\n rx = 1;\n }\n if ((y & s) > 0) {\n ry = 1;\n }\n d += s * s * ((3 * rx) ^ ry);\n if (ry === 0) {\n if (rx === 1) {\n x = s - 1 - x;\n y = s - 1 - y;\n }\n tmp = x;\n x = y;\n y = tmp;\n }\n }\n return d;\n}\nfunction sortPaths(pathList) {\n var xMin = Infinity;\n var yMin = Infinity;\n var xMax = -Infinity;\n var yMax = -Infinity;\n var cps = map(pathList, function (path) {\n var rect = path.getBoundingRect();\n var m = path.getComputedTransform();\n var x = rect.x + rect.width / 2 + (m ? m[4] : 0);\n var y = rect.y + rect.height / 2 + (m ? m[5] : 0);\n xMin = Math.min(x, xMin);\n yMin = Math.min(y, yMin);\n xMax = Math.max(x, xMax);\n yMax = Math.max(y, yMax);\n return [x, y];\n });\n var items = map(cps, function (cp, idx) {\n return {\n cp: cp,\n z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),\n path: pathList[idx]\n };\n });\n return items.sort(function (a, b) { return a.z - b.z; }).map(function (item) { return item.path; });\n}\n;\nfunction defaultDividePath(param) {\n return split(param.path, param.count);\n}\nfunction createEmptyReturn() {\n return {\n fromIndividuals: [],\n toIndividuals: [],\n count: 0\n };\n}\nexport function combineMorph(fromList, toPath, animationOpts) {\n var fromPathList = [];\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n addFromPath(fromList);\n var separateCount = fromPathList.length;\n if (!separateCount) {\n return createEmptyReturn();\n }\n var dividePath = animationOpts.dividePath || defaultDividePath;\n var toSubPathList = dividePath({\n path: toPath, count: separateCount\n });\n if (toSubPathList.length !== separateCount) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n fromPathList = sortPaths(fromPathList);\n toSubPathList = sortPaths(toSubPathList);\n var oldDone = animationOpts.done;\n var oldDuring = animationOpts.during;\n var individualDelay = animationOpts.individualDelay;\n var identityTransform = new Transformable();\n for (var i = 0; i < separateCount; i++) {\n var from = fromPathList[i];\n var to = toSubPathList[i];\n to.parent = toPath;\n to.copyTransform(identityTransform);\n if (!individualDelay) {\n prepareMorphPath(from, to);\n }\n }\n toPath.__isCombineMorphing = true;\n toPath.childrenRef = function () {\n return toSubPathList;\n };\n function addToSubPathListToZr(zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].addSelfToZr(zr);\n }\n }\n saveAndModifyMethod(toPath, 'addSelfToZr', {\n after: function (zr) {\n addToSubPathListToZr(zr);\n }\n });\n saveAndModifyMethod(toPath, 'removeSelfFromZr', {\n after: function (zr) {\n for (var i = 0; i < toSubPathList.length; i++) {\n toSubPathList[i].removeSelfFromZr(zr);\n }\n }\n });\n function restoreToPath() {\n toPath.__isCombineMorphing = false;\n toPath.__morphT = -1;\n toPath.childrenRef = null;\n restoreMethod(toPath, 'addSelfToZr');\n restoreMethod(toPath, 'removeSelfFromZr');\n }\n var toLen = toSubPathList.length;\n if (individualDelay) {\n var animating_1 = toLen;\n var eachDone = function () {\n animating_1--;\n if (animating_1 === 0) {\n restoreToPath();\n oldDone && oldDone();\n }\n };\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toSubPathList[i]),\n done: eachDone\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toSubPathList[i], indivdualAnimationOpts);\n }\n }\n else {\n toPath.__morphT = 0;\n toPath.animateTo({\n __morphT: 1\n }, defaults({\n during: function (p) {\n for (var i = 0; i < toLen; i++) {\n var child = toSubPathList[i];\n child.__morphT = toPath.__morphT;\n child.dirtyShape();\n }\n oldDuring && oldDuring(p);\n },\n done: function () {\n restoreToPath();\n for (var i = 0; i < fromList.length; i++) {\n restoreMethod(fromList[i], 'updateTransform');\n }\n oldDone && oldDone();\n }\n }, animationOpts));\n }\n if (toPath.__zr) {\n addToSubPathListToZr(toPath.__zr);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toSubPathList,\n count: toLen\n };\n}\nexport function separateMorph(fromPath, toPathList, animationOpts) {\n var toLen = toPathList.length;\n var fromPathList = [];\n var dividePath = animationOpts.dividePath || defaultDividePath;\n function addFromPath(fromList) {\n for (var i = 0; i < fromList.length; i++) {\n var from = fromList[i];\n if (isCombineMorphing(from)) {\n addFromPath(from.childrenRef());\n }\n else if (from instanceof Path) {\n fromPathList.push(from);\n }\n }\n }\n if (isCombineMorphing(fromPath)) {\n addFromPath(fromPath.childrenRef());\n var fromLen = fromPathList.length;\n if (fromLen < toLen) {\n var k = 0;\n for (var i = fromLen; i < toLen; i++) {\n fromPathList.push(clonePath(fromPathList[k++ % fromLen]));\n }\n }\n fromPathList.length = toLen;\n }\n else {\n fromPathList = dividePath({ path: fromPath, count: toLen });\n var fromPathTransform = fromPath.getComputedTransform();\n for (var i = 0; i < fromPathList.length; i++) {\n fromPathList[i].setLocalTransform(fromPathTransform);\n }\n if (fromPathList.length !== toLen) {\n console.error('Invalid morphing: unmatched splitted path');\n return createEmptyReturn();\n }\n }\n fromPathList = sortPaths(fromPathList);\n toPathList = sortPaths(toPathList);\n var individualDelay = animationOpts.individualDelay;\n for (var i = 0; i < toLen; i++) {\n var indivdualAnimationOpts = individualDelay ? defaults({\n delay: (animationOpts.delay || 0) + individualDelay(i, toLen, fromPathList[i], toPathList[i])\n }, animationOpts) : animationOpts;\n morphPath(fromPathList[i], toPathList[i], indivdualAnimationOpts);\n }\n return {\n fromIndividuals: fromPathList,\n toIndividuals: toPathList,\n count: toPathList.length\n };\n}\nexport { split as defaultDividePath };\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { separateMorph, combineMorph, morphPath, isCombineMorphing } from 'zrender/lib/tool/morphPath.js';\nimport { Path } from '../util/graphic.js';\nimport { defaults, isArray } from 'zrender/lib/core/util.js';\nimport { getAnimationConfig } from './basicTransition.js';\nimport { clonePath } from 'zrender/lib/tool/path.js';\n\nfunction isMultiple(elements) {\n return isArray(elements[0]);\n}\n\nfunction prepareMorphBatches(one, many) {\n var batches = [];\n var batchCount = one.length;\n\n for (var i = 0; i < batchCount; i++) {\n batches.push({\n one: one[i],\n many: []\n });\n }\n\n for (var i = 0; i < many.length; i++) {\n var len = many[i].length;\n var k = void 0;\n\n for (k = 0; k < len; k++) {\n batches[k % batchCount].many.push(many[i][k]);\n }\n }\n\n var off = 0; // If one has more paths than each one of many. average them.\n\n for (var i = batchCount - 1; i >= 0; i--) {\n if (!batches[i].many.length) {\n var moveFrom = batches[off].many;\n\n if (moveFrom.length <= 1) {\n // Not enough\n // Start from the first one.\n if (off) {\n off = 0;\n } else {\n return batches;\n }\n }\n\n var len = moveFrom.length;\n var mid = Math.ceil(len / 2);\n batches[i].many = moveFrom.slice(mid, len);\n batches[off].many = moveFrom.slice(0, mid);\n off++;\n }\n }\n\n return batches;\n}\n\nvar pathDividers = {\n clone: function (params) {\n var ret = []; // Fitting the alpha\n\n var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);\n\n for (var i = 0; i < params.count; i++) {\n var cloned = clonePath(params.path);\n cloned.setStyle('opacity', approxOpacity);\n ret.push(cloned);\n }\n\n return ret;\n },\n // Use the default divider\n split: null\n};\nexport function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {\n if (!from.length || !to.length) {\n return;\n }\n\n var updateAnimationCfg = getAnimationConfig('update', seriesModel, dataIndex);\n\n if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {\n return;\n }\n\n var animationDelay = seriesModel.getModel('universalTransition').get('delay');\n var animationCfg = Object.assign({\n // Need to setToFinal so the further calculation based on the style can be correct.\n // Like emphasis color.\n setToFinal: true\n }, updateAnimationCfg);\n var many;\n var one;\n\n if (isMultiple(from)) {\n // manyToOne\n many = from;\n one = to;\n }\n\n if (isMultiple(to)) {\n // oneToMany\n many = to;\n one = from;\n }\n\n function morphOneBatch(batch, fromIsMany, animateIndex, animateCount, forceManyOne) {\n var batchMany = batch.many;\n var batchOne = batch.one;\n\n if (batchMany.length === 1 && !forceManyOne) {\n // Is one to one\n var batchFrom = fromIsMany ? batchMany[0] : batchOne;\n var batchTo = fromIsMany ? batchOne : batchMany[0];\n\n if (isCombineMorphing(batchFrom)) {\n // Keep doing combine animation.\n morphOneBatch({\n many: [batchFrom],\n one: batchTo\n }, true, animateIndex, animateCount, true);\n } else {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(animateIndex, animateCount)\n }, animationCfg) : animationCfg;\n morphPath(batchFrom, batchTo, individualAnimationCfg);\n animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);\n }\n } else {\n var separateAnimationCfg = defaults({\n dividePath: pathDividers[divideShape],\n individualDelay: animationDelay && function (idx, count, fromPath, toPath) {\n return animationDelay(idx + animateIndex, animateCount);\n }\n }, animationCfg);\n\n var _a = fromIsMany ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg),\n fromIndividuals = _a.fromIndividuals,\n toIndividuals = _a.toIndividuals;\n\n var count = fromIndividuals.length;\n\n for (var k = 0; k < count; k++) {\n var individualAnimationCfg = animationDelay ? defaults({\n delay: animationDelay(k, count)\n }, animationCfg) : animationCfg;\n animateOtherProps(fromIndividuals[k], toIndividuals[k], fromIsMany ? batchMany[k] : batch.one, fromIsMany ? batch.one : batchMany[k], individualAnimationCfg);\n }\n }\n }\n\n var fromIsMany = many ? many === from // Is one to one. If the path number not match. also needs do merge and separate morphing.\n : from.length > to.length;\n var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);\n var animateCount = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n animateCount += morphBatches[i].many.length;\n }\n\n var animateIndex = 0;\n\n for (var i = 0; i < morphBatches.length; i++) {\n morphOneBatch(morphBatches[i], fromIsMany, animateIndex, animateCount);\n animateIndex += morphBatches[i].many.length;\n }\n}\nexport function getPathList(elements) {\n if (!elements) {\n return [];\n }\n\n if (isArray(elements)) {\n var pathList_1 = [];\n\n for (var i = 0; i < elements.length; i++) {\n pathList_1.push(getPathList(elements[i]));\n }\n\n return pathList_1;\n }\n\n var pathList = [];\n elements.traverse(function (el) {\n if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {\n pathList.push(el);\n }\n });\n return pathList;\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/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n// Universal transitions that can animate between any shapes(series) and any properties in any amounts.\nimport { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series.js';\nimport { createHashMap, each, map, filter, isArray, extend } from 'zrender/lib/core/util.js';\nimport { applyMorphAnimation, getPathList } from './morphTransitionHelper.js';\nimport Path from 'zrender/lib/graphic/Path.js';\nimport { initProps } from '../util/graphic.js';\nimport DataDiffer from '../data/DataDiffer.js';\nimport { makeInner, normalizeToArray } from '../util/model.js';\nimport { warn } from '../util/log.js';\nimport { getAnimationConfig, getOldStyle } from './basicTransition.js';\nimport Displayable from 'zrender/lib/graphic/Displayable.js';\nvar DATA_COUNT_THRESHOLD = 1e4;\n;\nvar getUniversalTransitionGlobalStore = makeInner();\n\nfunction getGroupIdDimension(data) {\n var dimensions = data.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = data.getDimensionInfo(dimensions[i]);\n\n if (dimInfo && dimInfo.otherDims.itemGroupId === 0) {\n return dimensions[i];\n }\n }\n}\n\nfunction flattenDataDiffItems(list) {\n var items = [];\n each(list, function (seriesInfo) {\n var data = seriesInfo.data;\n\n if (data.count() > DATA_COUNT_THRESHOLD) {\n if (process.env.NODE_ENV !== 'production') {\n warn('Universal transition is disabled on large data > 10k.');\n }\n\n return;\n }\n\n var indices = data.getIndices();\n var groupDim = getGroupIdDimension(data);\n\n for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {\n items.push({\n dataGroupId: seriesInfo.dataGroupId,\n data: data,\n dim: seriesInfo.dim || groupDim,\n divide: seriesInfo.divide,\n dataIndex: dataIndex\n });\n }\n });\n return items;\n}\n\nfunction fadeInElement(newEl, newSeries, newIndex) {\n newEl.traverse(function (el) {\n if (el instanceof Path) {\n // TODO use fade in animation for target element.\n initProps(el, {\n style: {\n opacity: 0\n }\n }, newSeries, {\n dataIndex: newIndex,\n isFrom: true\n });\n }\n });\n}\n\nfunction removeEl(el) {\n if (el.parent) {\n // Bake parent transform to element.\n // So it can still have proper transform to transition after it's removed.\n var computedTransform = el.getComputedTransform();\n el.setLocalTransform(computedTransform);\n el.parent.remove(el);\n }\n}\n\nfunction stopAnimation(el) {\n el.stopAnimation();\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.stopAnimation();\n });\n }\n}\n\nfunction animateElementStyles(el, dataIndex, seriesModel) {\n var animationConfig = getAnimationConfig('update', seriesModel, dataIndex);\n animationConfig && el.traverse(function (child) {\n if (child instanceof Displayable) {\n var oldStyle = getOldStyle(child);\n\n if (oldStyle) {\n child.animateFrom({\n style: oldStyle\n }, animationConfig);\n }\n }\n });\n}\n\nfunction isAllIdSame(oldDiffItems, newDiffItems) {\n var len = oldDiffItems.length;\n\n if (len !== newDiffItems.length) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n var oldItem = oldDiffItems[i];\n var newItem = newDiffItems[i];\n\n if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction transitionBetween(oldList, newList, api) {\n var oldDiffItems = flattenDataDiffItems(oldList);\n var newDiffItems = flattenDataDiffItems(newList);\n\n function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {\n if (rawFrom || from) {\n to.animateFrom({\n style: rawFrom && rawFrom !== from ? // dividingMethod like clone may override the style(opacity)\n // So extend it to raw style.\n extend(extend({}, rawFrom.style), from.style) : from.style\n }, animationCfg);\n }\n }\n\n function findKeyDim(items) {\n for (var i = 0; i < items.length; i++) {\n if (items[i].dim) {\n return items[i].dim;\n }\n }\n }\n\n var oldKeyDim = findKeyDim(oldDiffItems);\n var newKeyDim = findKeyDim(newDiffItems);\n var hasMorphAnimation = false;\n\n function createKeyGetter(isOld, onlyGetId) {\n return function (diffItem) {\n var data = diffItem.data;\n var dataIndex = diffItem.dataIndex; // TODO if specified dim\n\n if (onlyGetId) {\n return data.getId(dataIndex);\n } // Use group id as transition key by default.\n // So we can achieve multiple to multiple animation like drilldown / up naturally.\n // If group id not exits. Use id instead. If so, only one to one transition will be applied.\n\n\n var dataGroupId = diffItem.dataGroupId; // If specified key dimension(itemGroupId by default). Use this same dimension from other data.\n // PENDING: If only use key dimension of newData.\n\n var keyDim = isOld ? oldKeyDim || newKeyDim : newKeyDim || oldKeyDim;\n var dimInfo = keyDim && data.getDimensionInfo(keyDim);\n var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;\n\n if (dimInfo) {\n // Get from encode.itemGroupId.\n var key = data.get(dimInfo.name, dataIndex);\n\n if (dimOrdinalMeta) {\n return dimOrdinalMeta.categories[key] || key + '';\n }\n\n return key + '';\n } // Get groupId from raw item. { groupId: '' }\n\n\n var itemVal = data.getRawDataItem(dataIndex);\n\n if (itemVal && itemVal.groupId) {\n return itemVal.groupId + '';\n }\n\n return dataGroupId || data.getId(dataIndex);\n };\n } // Use id if it's very likely to be an one to one animation\n // It's more robust than groupId\n // TODO Check if key dimension is specified.\n\n\n var useId = isAllIdSame(oldDiffItems, newDiffItems);\n var isElementStillInChart = {};\n\n if (!useId) {\n // We may have different diff strategy with basicTransition if we use other dimension as key.\n // If so, we can't simply check if oldEl is same with newEl. We need a map to check if oldEl is still being used in the new chart.\n // We can't use the elements that already being morphed. Let it keep it's original basic transition.\n for (var i = 0; i < newDiffItems.length; i++) {\n var newItem = newDiffItems[i];\n var el = newItem.data.getItemGraphicEl(newItem.dataIndex);\n\n if (el) {\n isElementStillInChart[el.id] = true;\n }\n }\n }\n\n function updateOneToOne(newIndex, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var newItem = newDiffItems[newIndex];\n var newSeries = newItem.data.hostModel; // TODO Mark this elements is morphed and don't morph them anymore\n\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);\n var newEl = newItem.data.getItemGraphicEl(newItem.dataIndex); // Can't handle same elements.\n\n if (oldEl === newEl) {\n newEl && animateElementStyles(newEl, newItem.dataIndex, newSeries);\n return;\n }\n\n if ( // We can't use the elements that already being morphed\n oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n\n if (newEl) {\n // TODO: If keep animating the group in case\n // some of the elements don't want to be morphed.\n // TODO Label?\n stopAnimation(newEl);\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newIndex);\n }\n } // else keep oldEl leaving animation.\n\n }\n\n new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId), createKeyGetter(false, useId), null, 'multiple').update(updateOneToOne).updateManyToOne(function (newIndex, oldIndices) {\n var newItem = newDiffItems[newIndex];\n var newData = newItem.data;\n var newSeries = newData.hostModel;\n var newEl = newData.getItemGraphicEl(newItem.dataIndex);\n var oldElsList = filter(map(oldIndices, function (idx) {\n return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);\n }), function (oldEl) {\n return oldEl && oldEl !== newEl && !isElementStillInChart[oldEl.id];\n });\n\n if (newEl) {\n stopAnimation(newEl);\n\n if (oldElsList.length) {\n // If old element is doing leaving animation. stop it and remove it immediately.\n each(oldElsList, function (oldEl) {\n stopAnimation(oldEl);\n removeEl(oldEl);\n });\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldElsList), getPathList(newEl), newItem.divide, newSeries, newIndex, updateMorphingPathProps);\n } else {\n fadeInElement(newEl, newSeries, newItem.dataIndex);\n }\n } // else keep oldEl leaving animation.\n\n }).updateOneToMany(function (newIndices, oldIndex) {\n var oldItem = oldDiffItems[oldIndex];\n var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex); // We can't use the elements that already being morphed\n\n if (oldEl && isElementStillInChart[oldEl.id]) {\n return;\n }\n\n var newElsList = filter(map(newIndices, function (idx) {\n return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);\n }), function (el) {\n return el && el !== oldEl;\n });\n var newSeris = newDiffItems[newIndices[0]].data.hostModel;\n\n if (newElsList.length) {\n each(newElsList, function (newEl) {\n return stopAnimation(newEl);\n });\n\n if (oldEl) {\n stopAnimation(oldEl); // If old element is doing leaving animation. stop it and remove it immediately.\n\n removeEl(oldEl);\n hasMorphAnimation = true;\n applyMorphAnimation(getPathList(oldEl), getPathList(newElsList), oldItem.divide, // Use divide on old.\n newSeris, newIndices[0], updateMorphingPathProps);\n } else {\n each(newElsList, function (newEl) {\n return fadeInElement(newEl, newSeris, newIndices[0]);\n });\n }\n } // else keep oldEl leaving animation.\n\n }).updateManyToMany(function (newIndices, oldIndices) {\n // If two data are same and both have groupId.\n // Normally they should be diff by id.\n new DataDiffer(oldIndices, newIndices, function (rawIdx) {\n return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);\n }, function (rawIdx) {\n return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);\n }).update(function (newIndex, oldIndex) {\n // Use the original index\n updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);\n }).execute();\n }).execute();\n\n if (hasMorphAnimation) {\n each(newList, function (_a) {\n var data = _a.data;\n var seriesModel = data.hostModel;\n var view = seriesModel && api.getViewOfSeriesModel(seriesModel);\n var animationCfg = getAnimationConfig('update', seriesModel, 0); // use 0 index.\n\n if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {\n view.group.traverse(function (el) {\n if (el instanceof Path && !el.animators.length) {\n // We can't accept there still exists element that has no animation\n // if universalTransition is enabled\n el.animateFrom({\n style: {\n opacity: 0\n }\n }, animationCfg);\n }\n });\n }\n });\n }\n}\n\nfunction getSeriesTransitionKey(series) {\n var seriesKey = series.getModel('universalTransition').get('seriesKey');\n\n if (!seriesKey) {\n // Use series id by default.\n return series.id;\n }\n\n return seriesKey;\n}\n\nfunction convertArraySeriesKeyToString(seriesKey) {\n if (isArray(seriesKey)) {\n // Order independent.\n return seriesKey.sort().join(',');\n }\n\n return seriesKey;\n}\n\nfunction getDivideShapeFromData(data) {\n if (data.hostModel) {\n return data.hostModel.getModel('universalTransition').get('divideShape');\n }\n}\n\nfunction findTransitionSeriesBatches(globalStore, params) {\n var updateBatches = createHashMap();\n var oldDataMap = createHashMap(); // Map that only store key in array seriesKey.\n // Which is used to query the old data when transition from one to multiple series.\n\n var oldDataMapForSplit = createHashMap();\n each(globalStore.oldSeries, function (series, idx) {\n var oldDataGroupId = globalStore.oldDataGroupIds[idx];\n var oldData = globalStore.oldData[idx];\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);\n oldDataMap.set(transitionKeyStr, {\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n\n if (isArray(transitionKey)) {\n // Same key can't in different array seriesKey.\n each(transitionKey, function (key) {\n oldDataMapForSplit.set(key, {\n key: transitionKeyStr,\n dataGroupId: oldDataGroupId,\n data: oldData\n });\n });\n }\n });\n\n function checkTransitionSeriesKeyDuplicated(transitionKeyStr) {\n if (updateBatches.get(transitionKeyStr)) {\n warn(\"Duplicated seriesKey in universalTransition \" + transitionKeyStr);\n }\n }\n\n each(params.updatedSeries, function (series) {\n if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {\n var newDataGroupId = series.get('dataGroupId');\n var newData = series.getData();\n var transitionKey = getSeriesTransitionKey(series);\n var transitionKeyStr = convertArraySeriesKeyToString(transitionKey); // Only transition between series with same id.\n\n var oldData = oldDataMap.get(transitionKeyStr); // string transition key is the best match.\n\n if (oldData) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n } // TODO check if data is same?\n\n\n updateBatches.set(transitionKeyStr, {\n oldSeries: [{\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n }],\n newSeries: [{\n dataGroupId: newDataGroupId,\n divide: getDivideShapeFromData(newData),\n data: newData\n }]\n });\n } else {\n // Transition from multiple series.\n if (isArray(transitionKey)) {\n if (process.env.NODE_ENV !== 'production') {\n checkTransitionSeriesKeyDuplicated(transitionKeyStr);\n }\n\n var oldSeries_1 = [];\n each(transitionKey, function (key) {\n var oldData = oldDataMap.get(key);\n\n if (oldData.data) {\n oldSeries_1.push({\n dataGroupId: oldData.dataGroupId,\n divide: getDivideShapeFromData(oldData.data),\n data: oldData.data\n });\n }\n });\n\n if (oldSeries_1.length) {\n updateBatches.set(transitionKeyStr, {\n oldSeries: oldSeries_1,\n newSeries: [{\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n }]\n });\n }\n } else {\n // Try transition to multiple series.\n var oldData_1 = oldDataMapForSplit.get(transitionKey);\n\n if (oldData_1) {\n var batch = updateBatches.get(oldData_1.key);\n\n if (!batch) {\n batch = {\n oldSeries: [{\n dataGroupId: oldData_1.dataGroupId,\n data: oldData_1.data,\n divide: getDivideShapeFromData(oldData_1.data)\n }],\n newSeries: []\n };\n updateBatches.set(oldData_1.key, batch);\n }\n\n batch.newSeries.push({\n dataGroupId: newDataGroupId,\n data: newData,\n divide: getDivideShapeFromData(newData)\n });\n }\n }\n }\n }\n });\n return updateBatches;\n}\n\nfunction querySeries(series, finder) {\n for (var i = 0; i < series.length; i++) {\n var found = finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id;\n\n if (found) {\n return i;\n }\n }\n}\n\nfunction transitionSeriesFromOpt(transitionOpt, globalStore, params, api) {\n var from = [];\n var to = [];\n each(normalizeToArray(transitionOpt.from), function (finder) {\n var idx = querySeries(globalStore.oldSeries, finder);\n\n if (idx >= 0) {\n from.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: globalStore.oldData[idx],\n // TODO can specify divideShape in transition.\n divide: getDivideShapeFromData(globalStore.oldData[idx]),\n dim: finder.dimension\n });\n }\n });\n each(normalizeToArray(transitionOpt.to), function (finder) {\n var idx = querySeries(params.updatedSeries, finder);\n\n if (idx >= 0) {\n var data = params.updatedSeries[idx].getData();\n to.push({\n dataGroupId: globalStore.oldDataGroupIds[idx],\n data: data,\n divide: getDivideShapeFromData(data),\n dim: finder.dimension\n });\n }\n });\n\n if (from.length > 0 && to.length > 0) {\n transitionBetween(from, to, api);\n }\n}\n\nexport function installUniversalTransition(registers) {\n registers.registerUpdateLifecycle('series:beforeupdate', function (ecMOdel, api, params) {\n each(normalizeToArray(params.seriesTransition), function (transOpt) {\n each(normalizeToArray(transOpt.to), function (finder) {\n var series = params.updatedSeries;\n\n for (var i = 0; i < series.length; i++) {\n if (finder.seriesIndex != null && finder.seriesIndex === series[i].seriesIndex || finder.seriesId != null && finder.seriesId === series[i].id) {\n series[i][SERIES_UNIVERSAL_TRANSITION_PROP] = true;\n }\n }\n });\n });\n });\n registers.registerUpdateLifecycle('series:transition', function (ecModel, api, params) {\n // TODO api provide an namespace that can save stuff per instance\n var globalStore = getUniversalTransitionGlobalStore(api); // TODO multiple to multiple series.\n\n if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {\n // Use give transition config if its' give;\n var transitionOpt = params.seriesTransition;\n\n if (transitionOpt) {\n each(normalizeToArray(transitionOpt), function (opt) {\n transitionSeriesFromOpt(opt, globalStore, params, api);\n });\n } else {\n // Else guess from series based on transition series key.\n var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);\n each(updateBatches_1.keys(), function (key) {\n var batch = updateBatches_1.get(key);\n transitionBetween(batch.oldSeries, batch.newSeries, api);\n });\n } // Reset\n\n\n each(params.updatedSeries, function (series) {\n // Reset;\n if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {\n series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;\n }\n });\n } // Save all series of current update. Not only the updated one.\n\n\n var allSeries = ecModel.getSeries();\n var savedSeries = globalStore.oldSeries = [];\n var savedDataGroupIds = globalStore.oldDataGroupIds = [];\n var savedData = globalStore.oldData = [];\n\n for (var i = 0; i < allSeries.length; i++) {\n var data = allSeries[i].getData(); // Only save the data that can have transition.\n // Avoid large data costing too much extra memory\n\n if (data.count() < DATA_COUNT_THRESHOLD) {\n savedSeries.push(allSeries[i]);\n savedDataGroupIds.push(allSeries[i].get('dataGroupId'));\n savedData.push(data);\n }\n }\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\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport { use } from './lib/extension.js';\nexport * from './lib/export/core.js'; // ----------------------------------------------\n// All of the modules that are allowed to be\n// imported are listed below.\n//\n// Users MUST NOT import other modules that are\n// not included in this list.\n// ----------------------------------------------\n\nimport { SVGRenderer, CanvasRenderer } from './lib/export/renderers.js';\nimport { LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart } from './lib/export/charts.js';\nimport { GridComponent, PolarComponent, GeoComponent, SingleAxisComponent, ParallelComponent, CalendarComponent, GraphicComponent, ToolboxComponent, TooltipComponent, AxisPointerComponent, BrushComponent, TitleComponent, TimelineComponent, MarkPointComponent, MarkLineComponent, MarkAreaComponent, LegendComponent, DataZoomComponent, DataZoomInsideComponent, DataZoomSliderComponent, VisualMapComponent, VisualMapContinuousComponent, VisualMapPiecewiseComponent, AriaComponent, DatasetComponent, TransformComponent } from './lib/export/components.js';\nimport { UniversalTransition, LabelLayout } from './lib/export/features.js'; // -----------------\n// Render engines\n// -----------------\n// Render via Canvas.\n// echarts.init(dom, null, { renderer: 'canvas' })\n\nuse([CanvasRenderer]); // Render via SVG.\n// echarts.init(dom, null, { renderer: 'svg' })\n\nuse([SVGRenderer]); // ----------------\n// Charts (series)\n// ----------------\n// All of the series types, for example:\n// chart.setOption({\n// series: [{\n// type: 'line' // or 'bar', 'pie', ...\n// }]\n// });\n\nuse([LineChart, BarChart, PieChart, ScatterChart, RadarChart, MapChart, TreeChart, TreemapChart, GraphChart, GaugeChart, FunnelChart, ParallelChart, SankeyChart, BoxplotChart, CandlestickChart, EffectScatterChart, LinesChart, HeatmapChart, PictorialBarChart, ThemeRiverChart, SunburstChart, CustomChart]); // -------------------\n// Coordinate systems\n// -------------------\n// All of the axis modules have been included in the\n// coordinate system module below, do not need to\n// make extra import.\n// `cartesian` coordinate system. For some historical\n// reasons, it is named as grid, for example:\n// chart.setOption({\n// grid: {...},\n// xAxis: {...},\n// yAxis: {...},\n// series: [{...}]\n// });\n\nuse(GridComponent); // `polar` coordinate system, for example:\n// chart.setOption({\n// polar: {...},\n// radiusAxis: {...},\n// angleAxis: {...},\n// series: [{\n// coordinateSystem: 'polar'\n// }]\n// });\n\nuse(PolarComponent); // `geo` coordinate system, for example:\n// chart.setOption({\n// geo: {...},\n// series: [{\n// coordinateSystem: 'geo'\n// }]\n// });\n\nuse(GeoComponent); // `singleAxis` coordinate system (notice, it is a coordinate system\n// with only one axis, work for chart like theme river), for example:\n// chart.setOption({\n// singleAxis: {...}\n// series: [{type: 'themeRiver', ...}]\n// });\n\nuse(SingleAxisComponent); // `parallel` coordinate system, only work for parallel series, for example:\n// chart.setOption({\n// parallel: {...},\n// parallelAxis: [{...}, ...],\n// series: [{\n// type: 'parallel'\n// }]\n// });\n\nuse(ParallelComponent); // `calendar` coordinate system. for example,\n// chart.setOption({\n// calendar: {...},\n// series: [{\n// coordinateSystem: 'calendar'\n// }]\n// );\n\nuse(CalendarComponent); // ------------------\n// Other components\n// ------------------\n// `graphic` component, for example:\n// chart.setOption({\n// graphic: {...}\n// });\n\nuse(GraphicComponent); // `toolbox` component, for example:\n// chart.setOption({\n// toolbox: {...}\n// });\n\nuse(ToolboxComponent); // `tooltip` component, for example:\n// chart.setOption({\n// tooltip: {...}\n// });\n\nuse(TooltipComponent); // `axisPointer` component, for example:\n// chart.setOption({\n// tooltip: {axisPointer: {...}, ...}\n// });\n// Or\n// chart.setOption({\n// axisPointer: {...}\n// });\n\nuse(AxisPointerComponent); // `brush` component, for example:\n// chart.setOption({\n// brush: {...}\n// });\n// Or\n// chart.setOption({\n// tooltip: {feature: {brush: {...}}\n// })\n\nuse(BrushComponent); // `title` component, for example:\n// chart.setOption({\n// title: {...}\n// });\n\nuse(TitleComponent); // `timeline` component, for example:\n// chart.setOption({\n// timeline: {...}\n// });\n\nuse(TimelineComponent); // `markPoint` component, for example:\n// chart.setOption({\n// series: [{markPoint: {...}}]\n// });\n\nuse(MarkPointComponent); // `markLine` component, for example:\n// chart.setOption({\n// series: [{markLine: {...}}]\n// });\n\nuse(MarkLineComponent); // `markArea` component, for example:\n// chart.setOption({\n// series: [{markArea: {...}}]\n// });\n\nuse(MarkAreaComponent); // `legend` component not scrollable. for example:\n// chart.setOption({\n// legend: {...}\n// });\n\nuse(LegendComponent); // `dataZoom` component including both `dataZoomInside` and `dataZoomSlider`.\n\nuse(DataZoomComponent); // `dataZoom` component providing drag, pinch, wheel behaviors\n// inside coordinate system, for example:\n// chart.setOption({\n// dataZoom: {type: 'inside'}\n// });\n\nuse(DataZoomInsideComponent); // `dataZoom` component providing a slider bar, for example:\n// chart.setOption({\n// dataZoom: {type: 'slider'}\n// });\n\nuse(DataZoomSliderComponent); // `visualMap` component including both `visualMapContinuous` and `visualMapPiecewise`.\n\nuse(VisualMapComponent); // `visualMap` component providing continuous bar, for example:\n// chart.setOption({\n// visualMap: {type: 'continuous'}\n// });\n\nuse(VisualMapContinuousComponent); // `visualMap` component providing pieces bar, for example:\n// chart.setOption({\n// visualMap: {type: 'piecewise'}\n// });\n\nuse(VisualMapPiecewiseComponent); // `aria` component providing aria, for example:\n// chart.setOption({\n// aria: {...}\n// });\n\nuse(AriaComponent); // dataset transform\n// chart.setOption({\n// dataset: {\n// transform: []\n// }\n// });\n\nuse(TransformComponent);\nuse(DatasetComponent); // universal transition\n// chart.setOption({\n// series: {\n// universalTransition: { enabled: true }\n// }\n// })\n\nuse(UniversalTransition); // label layout\n// chart.setOption({\n// series: {\n// labelLayout: { hideOverlap: true }\n// }\n// })\n\nuse(LabelLayout);","import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createBlock as _createBlock, unref as _unref, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\";\nconst _withScopeId = n => (_pushScopeId(\"data-v-609a8e64\"), n = n(), _popScopeId(), n);\nconst _hoisted_1 = {\n class: \"content-box\"\n};\nconst _hoisted_2 = {\n class: \"info\"\n};\nconst _hoisted_3 = {\n class: \"info-content\"\n};\nconst _hoisted_4 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode(\"h1\", null, [/*#__PURE__*/_createTextVNode(\"Organism: \"), /*#__PURE__*/_createElementVNode(\"span\", null, \"Homo sapiens\")], -1));\nconst _hoisted_5 = {\n class: \"button-tag\"\n};\nconst _hoisted_6 = {\n class: \"history\"\n};\nconst _hoisted_7 = {\n class: \"card\"\n};\nimport { getProteins, getCellLineProteins } from '@/api/search';\nimport { inflate } from 'pako';\nimport * as echarts from 'echarts';\nimport { useRouter, onBeforeRouteUpdate } from \"vue-router\";\nimport { ref, onMounted, nextTick } from 'vue';\nexport default {\n __name: 'index',\n emits: ['changeLoading'],\n setup(__props, {\n emit: __emit\n }) {\n const router = useRouter();\n const drawer = ref(false);\n const emit = __emit;\n // image height\n let imgH = 500;\n // database\n let proteinTable = [];\n const showBar = ref(false);\n const showLabel = ref(false);\n // component show\n const showImg = ref(false);\n // data history \n const dataHistory = ref([]);\n // current router name\n const routerName = ref('');\n // query protein\n const protein = ref([]);\n // sorted tags \n const sortTags = ref([]);\n // tags\n const proteinTags = ref([]);\n // tags color\n const tagsColor = [\"#8DD3C7\", \"#EDBC63\", \"#BEBADA\", \"#FB8072\", \"#80B1D3\"];\n // map html\n const chart = ref();\n // history\n const imgs = ref([]);\n // image object\n let myChart;\n // tagstotal\n const tagsTotal = [\"heart\", \"stomach\",\n //\"skin\",\n \"blood plasma\", \"brain\", \"kidney\", \"liver\", \"lung\", \"pancreas\", \"spleen\", \"adrenal gland\", \"testis\", \"ovary\",\n //\"uterus\",\n \"prostate\", \"colon\", \"esophagus\", \"placenta\"];\n // \n const boxTooltips = {\n trigger: 'item',\n axisPointer: {\n type: 'shadow'\n },\n textStyle: {},\n formatter: function (param) {\n return [\"

\" + param.data[0] + '

', '
', \"Max:\" + parseFloat(param.data[5]).toFixed(2) + '
', \"Q3:\" + parseFloat(param.data[4]).toFixed(2) + '
', \"Median:\" + parseFloat(param.data[3]).toFixed(2) + '
', \"Q1:\" + parseFloat(param.data[2]).toFixed(2) + '
', \"Min:\" + parseFloat(param.data[1]).toFixed(2) + '
'].join('');\n }\n };\n protein.value = Array.isArray(router.currentRoute.value.query.protein) ? router.currentRoute.value.query.protein : [router.currentRoute.value.query.protein];\n routerName.value = router.currentRoute.value.name;\n // get proteins\n const getProteinTable = async () => {\n emit('changeLoading');\n const res = routerName.value === 'tissues' ? await getProteins() : await getCellLineProteins();\n const byteArray = new Uint8Array(res.data);\n const data = inflate(byteArray, {\n to: 'string'\n });\n proteinTable = JSON.parse(data);\n emit('changeLoading');\n queryProtein(protein);\n };\n // delete tag\n const handleClose = tag => {\n dataHistory.value.splice(proteinTags.value.indexOf(tag), 1);\n proteinTags.value.splice(proteinTags.value.indexOf(tag), 1);\n routerName.value === 'tissues' ? router.push({\n path: \"/ae/tissues\",\n query: {\n protein: proteinTags.value\n }\n }) : router.push({\n path: \"/ae/cellline\",\n query: {\n protein: proteinTags.value\n }\n });\n };\n // qeury\n const queryProtein = input => {\n if (typeof input.value[0] === \"undefined\") {\n // init()\n showImg.value = false;\n myChart ? myChart.dispose() : myChart;\n return;\n }\n let proteins = proteinTable;\n input.value.map(protein => {\n const output = proteins.find(item => {\n return item.name === protein.trim();\n });\n if (!output) {\n alert('Please enter a legal protein name');\n return;\n }\n if (!proteinTags.value.includes(protein.trim())) {\n if (proteinTags.value.length === 5) {\n proteinTags.value.shift();\n proteinTags.value.push(protein.trim());\n dataHistory.value.shift();\n dataHistory.value.push(output);\n } else {\n proteinTags.value.push(protein.trim());\n dataHistory.value.push(output);\n }\n }\n });\n if (proteinTags.value.length != input.value.length) {\n routerName.value === 'tissues' ? router.push({\n path: \"/ae/tissues\",\n query: {\n protein: proteinTags.value\n }\n }) : router.push({\n path: \"/ae/cellline\",\n query: {\n protein: proteinTags.value\n }\n });\n //router.push({ path: \"/ae/tissues\", query: { protein: proteinTags.value } })\n } else {\n showImg.value = true;\n imgH = dataHistory.value.length > 1 ? dataHistory.value.length * 400 : 500;\n nextTick(() => {\n init();\n });\n }\n };\n // watch route\n onBeforeRouteUpdate(to => {\n protein.value = to.query.protein;\n queryProtein(protein);\n });\n\n // load update\n onMounted(() => {\n getProteinTable();\n });\n\n // init data\n const initData = data => {\n if (routerName.value === 'tissues') {\n if (data.tags.length < 18) {\n tagsTotal.map(item => {\n if (!data.tags.includes(item)) {\n data.tags.push(item);\n data.data.push([]);\n }\n });\n }\n }\n let dataSort = [];\n for (let i = 0; i < data.tags.length; i++) {\n let obj = {};\n obj['name'] = data.tags[i];\n obj['data'] = data.data[i].filter(value => value >= 1);\n dataSort.push(obj);\n }\n if (routerName.value !== 'tissues') {\n dataSort.sort((obja, objb) => {\n const lena = obja.data.length;\n const lenb = objb.data.length;\n return lenb - lena;\n });\n dataSort = dataSort.slice(0, 20);\n }\n // sort data\n dataSort.sort((obja, objb) => {\n /* \n objb.data.sort((a, b) => { return a - b })\n const lena = obja.data.length\n const lenb = objb.data.length\n const mida = obja.data[Math.floor(lena / 2)]\n const midb = objb.data[Math.floor(lenb / 2)] \n */\n const mida = obja.data.length > 0 ? obja.data.reduce((a, b) => a + b) / obja.data.length : 0;\n const midb = obja.data.length > 0 ? objb.data.reduce((a, b) => a + b) / objb.data.length : 0;\n return mida - midb;\n });\n // get sort column\n let neatData = [];\n let tags = [];\n dataSort.map(item => {\n neatData.push(item.data);\n tags.push(item.name);\n });\n return {\n neatData,\n tags\n };\n };\n // option\n const options = {\n // backgroundColor: '#f4f5f2',\n title: [],\n dataset: [],\n tooltip: {},\n // color: tagsColor,\n legend: {\n show: true,\n orient: 'vertical',\n right: 10,\n top: 60,\n data: []\n // bottom: 20,\n },\n grid: {\n left: '10%',\n right: '10%',\n bottom: 60\n },\n yAxis: {\n type: 'category',\n boundaryGap: true,\n nameGap: 30,\n splitArea: {\n show: false\n },\n splitLine: {\n show: false\n }\n },\n xAxis: {\n type: 'value',\n name: 'iBAQLog',\n nameLocation: 'center',\n nameGap: 40,\n splitArea: {\n show: false\n },\n splitLine: {\n show: false\n },\n min: 1\n //max: 10\n },\n toolbox: {\n feature: {\n saveAsImage: {\n type: 'png',\n title: 'save as .png',\n pixelRatio: 10\n }\n }\n },\n series: []\n };\n // init image\n const init = () => {\n if (dataHistory.value.length === 1) {\n options.dataset = [];\n options.series = [];\n options.title = [];\n options.legend.show = false;\n let {\n neatData,\n tags\n } = initData(dataHistory.value[0]);\n sortTags.value = tags;\n options.title.push({\n text: dataHistory.value[0].title,\n left: 'center'\n });\n let {\n samples,\n data\n } = countSingleValue(neatData, 2);\n if (showBar.value) {\n options.series.push({\n name: proteinTags.value[0],\n type: 'bar',\n data: data,\n itemStyle: {\n color: tagsColor[0],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n },\n label: {\n show: showLabel.value,\n position: 'right',\n formatter: function () {\n return `samples: ${samples.shift()}`;\n }\n }\n });\n options.tooltip = {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n };\n options.yAxis.data = sortTags.value;\n } else {\n options.dataset.push({\n source: neatData\n });\n options.dataset.push({\n fromDatasetIndex: 0,\n transform: {\n type: 'boxplot',\n config: {\n itemNameFormatter: function (params) {\n return tags[params.value];\n }\n }\n }\n });\n options.series.push({\n name: 'category0',\n type: 'boxplot',\n datasetIndex: 1,\n itemStyle: {\n color: tagsColor[0],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n }\n });\n options.tooltip = boxTooltips;\n }\n } else {\n if (routerName.value === 'tissues') {\n sortTags.value = sortTags.value.length === 0 ? initData(dataHistory.value[0]).tags : sortTags.value;\n } else {\n sortTags.value = sortTags.value.length === 0 ? initData(dataHistory.value[0]).tags : sortTags.value;\n }\n dataHistory.value.length === 0 ? options.title = [] : options.title.splice(0, 1, {\n text: `Comparison of protein expression in different ${routerName.value}`,\n left: 'center'\n });\n dataHistory.value.length === 0 ? options.legend.show = false : options.legend.show = true;\n let datas = [];\n dataHistory.value.map(item => {\n let data = [];\n sortTags.value.forEach(tissue => {\n if (!item.tags.includes(tissue)) {\n data.push([]);\n } else {\n let index = item.tags.indexOf(tissue);\n let rowArr = item.data[index].filter(v => v >= 1);\n data.push(rowArr);\n }\n });\n datas.push(data);\n });\n let {\n samples,\n data\n } = countSingleValue(datas, 3);\n if (showBar.value) {\n datas = data;\n options.dataset = [];\n options.series = [];\n options.legend.data = [];\n datas.forEach((item, index) => {\n options.series.push({\n name: proteinTags.value[index],\n type: 'bar',\n data: item,\n itemStyle: {\n color: tagsColor[index],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n },\n label: {\n show: showLabel.value,\n position: 'right',\n formatter: function () {\n return `samples: ${samples[index].shift()}`;\n }\n }\n });\n options.legend.data.push({\n name: proteinTags.value[index],\n itemStyle: {\n color: tagsColor[index],\n borderColor: tagsColor[index]\n }\n });\n });\n options.tooltip = {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n };\n options.yAxis.data = sortTags.value;\n } else {\n options.dataset = [];\n options.series = [];\n options.legend.data = [];\n datas.forEach((item, index) => {\n options.dataset.push({\n source: item\n });\n options.series.push({\n name: proteinTags.value[index],\n type: 'boxplot',\n datasetIndex: datas.length + index,\n itemStyle: {\n color: tagsColor[index],\n color0: '#FA0000',\n borderColor: '#030609',\n borderColor0: '#030609'\n }\n });\n options.legend.data.push({\n name: proteinTags.value[index],\n itemStyle: {\n color: tagsColor[index],\n borderColor: tagsColor[index]\n }\n });\n });\n datas.forEach((item, index) => {\n options.dataset.push({\n fromDatasetIndex: index,\n transform: {\n type: 'boxplot',\n config: {\n itemNameFormatter: function (params) {\n return sortTags.value[params.value];\n }\n }\n }\n });\n });\n options.tooltip = boxTooltips;\n }\n }\n if (myChart != null && myChart !== '' && myChart !== undefined) {\n myChart.dispose(); // discard\n }\n myChart = echarts.init(chart.value, 'macarons');\n myChart.clear();\n myChart.resize({\n height: imgH\n });\n myChart.setOption(options);\n setTimeout(() => {\n if (protein.value.length !== 0) {\n let imgDataUrl = myChart.getDataURL({\n type: 'svg',\n pixelRatio: 2,\n backgroundColor: '#fff',\n excludeComponents: ['toolbox']\n });\n let urlFile = {\n proteinName: protein.value,\n url: imgDataUrl\n };\n imgs.value.unshift(urlFile);\n }\n }, 2000);\n };\n // count single value\n const countSingleValue = (data, dimension) => {\n if (dimension === 2) {\n /*\n let singleNum = data.filter((arr) => arr.length == 1).length\n if (singleNum >= 10) {\n data = data.map((arr) => Number((arr.reduce((a, b)=>a+b)/arr.length).toFixed(2)))\n }\n return { singleNum, data } \n */\n let samples = data.map(arr => arr.length);\n data = data.map(arr => arr.length > 0 ? Number((arr.reduce((a, b) => a + b) / arr.length).toFixed(2)) : 0);\n return {\n samples,\n data\n };\n } else {\n /*\n let singleNum = data[0].filter((arr) => arr.length == 1).length\n if (singleNum >= 10) {\n data = data.map((res) => res.map((arr) => arr.length > 0 ? Number((arr.reduce((a, b)=>a+b)/arr.length).toFixed(2)) : 0))\n }\n return { singleNum, data } \n */\n let samples = data.map(res => res.map(arr => arr.length));\n data = data.map(res => res.map(arr => arr.length > 0 ? Number((arr.reduce((a, b) => a + b) / arr.length).toFixed(2)) : 0));\n return {\n samples,\n data\n };\n }\n };\n\n //\n const changeShowBar = () => {\n init();\n };\n const changeShowLabel = () => {\n init();\n };\n return (_ctx, _cache) => {\n const _component_el_switch = _resolveComponent(\"el-switch\");\n const _component_el_tag = _resolveComponent(\"el-tag\");\n const _component_el_text = _resolveComponent(\"el-text\");\n const _component_el_image = _resolveComponent(\"el-image\");\n const _component_el_tabs = _resolveComponent(\"el-tabs\");\n const _component_el_drawer = _resolveComponent(\"el-drawer\");\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createElementVNode(\"div\", _hoisted_2, [_createElementVNode(\"div\", _hoisted_3, [_hoisted_4, _createVNode(_component_el_switch, {\n modelValue: showBar.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => showBar.value = $event),\n class: \"ml-2\",\n \"inline-prompt\": \"\",\n style: {\n \"--el-switch-on-color\": \"#13ce66\",\n \"--el-switch-off-color\": \"#ff4949\",\n \"position\": \"absolute\"\n },\n \"active-text\": \"Bar\",\n \"inactive-text\": \"Box\",\n onChange: changeShowBar\n }, null, 8, [\"modelValue\"]), _withDirectives(_createVNode(_component_el_switch, {\n modelValue: showLabel.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => showLabel.value = $event),\n class: \"ml-2\",\n \"inline-prompt\": \"\",\n style: {\n \"--el-switch-on-color\": \"#13ce66\",\n \"--el-switch-off-color\": \"#ff4949\",\n \"position\": \"absolute\",\n \"left\": \"5.5rem\"\n },\n \"active-text\": \"Show label\",\n \"inactive-text\": \"Off label\",\n onChange: changeShowLabel\n }, null, 8, [\"modelValue\"]), [[_vShow, showBar.value]])]), _createElementVNode(\"div\", _hoisted_5, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(proteinTags.value, (item, index) => {\n return _openBlock(), _createBlock(_component_el_tag, {\n key: index,\n round: \"\",\n closable: \"\",\n color: tagsColor[index],\n onClose: $event => handleClose(item)\n }, {\n default: _withCtx(() => [_createTextVNode(_toDisplayString(item), 1)]),\n _: 2\n }, 1032, [\"color\", \"onClose\"]);\n }), 128))]), _createElementVNode(\"div\", _hoisted_6, [_createVNode(_component_el_text, {\n style: {\n \"margin-right\": \"16px\"\n },\n class: \"history-info\",\n type: \"info\",\n onClick: _cache[2] || (_cache[2] = $event => drawer.value = true)\n }, {\n default: _withCtx(() => [_createTextVNode(\" history \")]),\n _: 1\n }), _createVNode(_component_el_drawer, {\n modelValue: drawer.value,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => drawer.value = $event),\n title: \"I am the title\",\n \"with-header\": false\n }, {\n default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(imgs.value, (item, index) => {\n return _openBlock(), _createBlock(_component_el_tabs, {\n \"tab-position\": \"right\",\n style: {\n \"height\": \"300px\"\n },\n class: \"demo-tabs\",\n key: index\n }, {\n default: _withCtx(() => [_createElementVNode(\"h5\", null, _toDisplayString(item.proteinName.join()), 1), _createVNode(_component_el_image, {\n style: {\n \"width\": \"100%\"\n },\n src: item.url,\n fit: \"fill\",\n \"preview-src-list\": [item.url]\n }, null, 8, [\"src\", \"preview-src-list\"])]),\n _: 2\n }, 1024);\n }), 128))]),\n _: 1\n }, 8, [\"modelValue\"])])]), _createElementVNode(\"div\", _hoisted_7, [_createElementVNode(\"div\", {\n ref_key: \"chart\",\n ref: chart,\n style: _normalizeStyle({\n width: 100 + '%',\n height: _unref(imgH) + 'px'\n })\n }, null, 4)])], 512)), [[_vShow, showImg.value]]);\n };\n }\n};","/* unplugin-vue-components disabled */import script from \"./index.vue?vue&type=script&setup=true&lang=js\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=js\"\n\nimport \"./index.vue?vue&type=style&index=0&id=609a8e64&scoped=true&lang=css\"\n\nimport exportComponent from \"../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-609a8e64\"]])\n\nexport default __exports__","const configProviderContextKey = Symbol();\n\nexport { configProviderContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import { ref, getCurrentInstance, inject, computed, unref, provide } from 'vue';\nimport '../../../../utils/index.mjs';\nimport '../../../../hooks/index.mjs';\nimport { configProviderContextKey } from '../constants.mjs';\nimport { useNamespace, defaultNamespace, namespaceContextKey } from '../../../../hooks/use-namespace/index.mjs';\nimport { useLocale, localeContextKey } from '../../../../hooks/use-locale/index.mjs';\nimport { useZIndex, defaultInitialZIndex, zIndexContextKey } from '../../../../hooks/use-z-index/index.mjs';\nimport { debugWarn } from '../../../../utils/error.mjs';\nimport { SIZE_INJECTION_KEY } from '../../../../hooks/use-size/index.mjs';\nimport { keysOf } from '../../../../utils/objects.mjs';\n\nconst globalConfig = ref();\nfunction useGlobalConfig(key, defaultValue = void 0) {\n const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;\n if (key) {\n return computed(() => {\n var _a, _b;\n return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;\n });\n } else {\n return config;\n }\n}\nfunction useGlobalComponentSettings(block, sizeFallback) {\n const config = useGlobalConfig();\n const ns = useNamespace(block, computed(() => {\n var _a;\n return ((_a = config.value) == null ? void 0 : _a.namespace) || defaultNamespace;\n }));\n const locale = useLocale(computed(() => {\n var _a;\n return (_a = config.value) == null ? void 0 : _a.locale;\n }));\n const zIndex = useZIndex(computed(() => {\n var _a;\n return ((_a = config.value) == null ? void 0 : _a.zIndex) || defaultInitialZIndex;\n }));\n const size = computed(() => {\n var _a;\n return unref(sizeFallback) || ((_a = config.value) == null ? void 0 : _a.size) || \"\";\n });\n provideGlobalConfig(computed(() => unref(config) || {}));\n return {\n ns,\n locale,\n zIndex,\n size\n };\n}\nconst provideGlobalConfig = (config, app, global = false) => {\n var _a;\n const inSetup = !!getCurrentInstance();\n const oldConfig = inSetup ? useGlobalConfig() : void 0;\n const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? provide : void 0;\n if (!provideFn) {\n debugWarn(\"provideGlobalConfig\", \"provideGlobalConfig() can only be used inside setup().\");\n return;\n }\n const context = computed(() => {\n const cfg = unref(config);\n if (!(oldConfig == null ? void 0 : oldConfig.value))\n return cfg;\n return mergeConfig(oldConfig.value, cfg);\n });\n provideFn(configProviderContextKey, context);\n provideFn(localeContextKey, computed(() => context.value.locale));\n provideFn(namespaceContextKey, computed(() => context.value.namespace));\n provideFn(zIndexContextKey, computed(() => context.value.zIndex));\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || \"\")\n });\n if (global || !globalConfig.value) {\n globalConfig.value = context.value;\n }\n return context;\n};\nconst mergeConfig = (a, b) => {\n var _a;\n const keys = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];\n const obj = {};\n for (const key of keys) {\n obj[key] = (_a = b[key]) != null ? _a : a[key];\n }\n return obj;\n};\n\nexport { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig };\n//# sourceMappingURL=use-global-config.mjs.map\n","const formContextKey = Symbol(\"formContextKey\");\nconst formItemContextKey = Symbol(\"formItemContextKey\");\n\nexport { formContextKey, formItemContextKey };\n//# sourceMappingURL=constants.mjs.map\n","import { getCurrentInstance, computed } from 'vue';\n\nconst useProp = (name) => {\n const vm = getCurrentInstance();\n return computed(() => {\n var _a, _b;\n return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];\n });\n};\n\nexport { useProp };\n//# sourceMappingURL=index.mjs.map\n","import { ref, inject, computed, unref } from 'vue';\nimport '../../../../hooks/index.mjs';\nimport { formContextKey, formItemContextKey } from '../constants.mjs';\nimport { useProp } from '../../../../hooks/use-prop/index.mjs';\nimport { useGlobalSize } from '../../../../hooks/use-size/index.mjs';\n\nconst useFormSize = (fallback, ignore = {}) => {\n const emptyRef = ref(void 0);\n const size = ignore.prop ? emptyRef : useProp(\"size\");\n const globalConfig = ignore.global ? emptyRef : useGlobalSize();\n const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);\n const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);\n return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || \"\");\n};\nconst useFormDisabled = (fallback) => {\n const disabled = useProp(\"disabled\");\n const form = inject(formContextKey, void 0);\n return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);\n};\nconst useSize = useFormSize;\nconst useDisabled = useFormDisabled;\n\nexport { useDisabled, useFormDisabled, useFormSize, useSize };\n//# sourceMappingURL=use-form-common-props.mjs.map\n","import { inject, ref, computed, onMounted, watch, toRef, onUnmounted } from 'vue';\nimport '../../../../hooks/index.mjs';\nimport { formContextKey, formItemContextKey } from '../constants.mjs';\nimport { useId } from '../../../../hooks/use-id/index.mjs';\n\nconst useFormItem = () => {\n const form = inject(formContextKey, void 0);\n const formItem = inject(formItemContextKey, void 0);\n return {\n form,\n formItem\n };\n};\nconst useFormItemInputId = (props, {\n formItemContext,\n disableIdGeneration,\n disableIdManagement\n}) => {\n if (!disableIdGeneration) {\n disableIdGeneration = ref(false);\n }\n if (!disableIdManagement) {\n disableIdManagement = ref(false);\n }\n const inputId = ref();\n let idUnwatch = void 0;\n const isLabeledByFormItem = computed(() => {\n var _a;\n return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);\n });\n onMounted(() => {\n idUnwatch = watch([toRef(props, \"id\"), disableIdGeneration], ([id, disableIdGeneration2]) => {\n const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;\n if (newId !== inputId.value) {\n if (formItemContext == null ? void 0 : formItemContext.removeInputId) {\n inputId.value && formItemContext.removeInputId(inputId.value);\n if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {\n formItemContext.addInputId(newId);\n }\n }\n inputId.value = newId;\n }\n }, { immediate: true });\n });\n onUnmounted(() => {\n idUnwatch && idUnwatch();\n if (formItemContext == null ? void 0 : formItemContext.removeInputId) {\n inputId.value && formItemContext.removeInputId(inputId.value);\n }\n });\n return {\n isLabeledByFormItem,\n inputId\n };\n};\n\nexport { useFormItem, useFormItemInputId };\n//# sourceMappingURL=use-form-item.mjs.map\n","import '../../../utils/index.mjs';\nimport '../../../constants/index.mjs';\nimport { buildProps } from '../../../utils/vue/props/runtime.mjs';\nimport { componentSizes } from '../../../constants/size.mjs';\n\nconst textProps = buildProps({\n type: {\n type: String,\n values: [\"primary\", \"success\", \"info\", \"warning\", \"danger\", \"\"],\n default: \"\"\n },\n size: {\n type: String,\n values: componentSizes,\n default: \"\"\n },\n truncated: {\n type: Boolean\n },\n lineClamp: {\n type: [String, Number]\n },\n tag: {\n type: String,\n default: \"span\"\n }\n});\n\nexport { textProps };\n//# sourceMappingURL=text.mjs.map\n","import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, normalizeClass, unref, normalizeStyle, withCtx, renderSlot } from 'vue';\nimport '../../../hooks/index.mjs';\nimport '../../form/index.mjs';\nimport '../../../utils/index.mjs';\nimport { textProps } from './text.mjs';\nimport _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';\nimport { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';\nimport { useNamespace } from '../../../hooks/use-namespace/index.mjs';\nimport { isUndefined } from '../../../utils/types.mjs';\n\nconst __default__ = defineComponent({\n name: \"ElText\"\n});\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n props: textProps,\n setup(__props) {\n const props = __props;\n const textSize = useFormSize();\n const ns = useNamespace(\"text\");\n const textKls = computed(() => [\n ns.b(),\n ns.m(props.type),\n ns.m(textSize.value),\n ns.is(\"truncated\", props.truncated),\n ns.is(\"line-clamp\", !isUndefined(props.lineClamp))\n ]);\n return (_ctx, _cache) => {\n return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {\n class: normalizeClass(unref(textKls)),\n style: normalizeStyle({ \"-webkit-line-clamp\": _ctx.lineClamp })\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"default\")\n ]),\n _: 3\n }, 8, [\"class\", \"style\"]);\n };\n }\n});\nvar Text = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__file\", \"text.vue\"]]);\n\nexport { Text as default };\n//# sourceMappingURL=text2.mjs.map\n","import '../../utils/index.mjs';\nimport Text from './src/text2.mjs';\nexport { textProps } from './src/text.mjs';\nimport { withInstall } from '../../utils/vue/install.mjs';\n\nconst ElText = withInstall(Text);\n\nexport { ElText, ElText as default };\n//# sourceMappingURL=index.mjs.map\n","const UPDATE_MODEL_EVENT = \"update:modelValue\";\nconst CHANGE_EVENT = \"change\";\nconst INPUT_EVENT = \"input\";\n\nexport { CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT };\n//# sourceMappingURL=event.mjs.map\n","const componentSizes = [\"\", \"default\", \"small\", \"large\"];\nconst componentSizeMap = {\n large: 40,\n default: 32,\n small: 24\n};\n\nexport { componentSizeMap, componentSizes };\n//# sourceMappingURL=size.mjs.map\n","import { getCurrentInstance, inject, computed, unref } from 'vue';\nimport '../../utils/index.mjs';\nimport { useGetDerivedNamespace } from '../use-namespace/index.mjs';\nimport { isClient } from '@vueuse/core';\nimport { debugWarn } from '../../utils/error.mjs';\n\nconst defaultIdInjection = {\n prefix: Math.floor(Math.random() * 1e4),\n current: 0\n};\nconst ID_INJECTION_KEY = Symbol(\"elIdInjection\");\nconst useIdInjection = () => {\n return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;\n};\nconst useId = (deterministicId) => {\n const idInjection = useIdInjection();\n if (!isClient && idInjection === defaultIdInjection) {\n debugWarn(\"IdInjection\", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})`);\n }\n const namespace = useGetDerivedNamespace();\n const idRef = computed(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);\n return idRef;\n};\n\nexport { ID_INJECTION_KEY, useId, useIdInjection };\n//# sourceMappingURL=index.mjs.map\n","import { inject, computed, unref } from 'vue';\nimport '../../utils/index.mjs';\nimport '../../constants/index.mjs';\nimport { buildProp } from '../../utils/vue/props/runtime.mjs';\nimport { componentSizes } from '../../constants/size.mjs';\n\nconst useSizeProp = buildProp({\n type: String,\n values: componentSizes,\n required: false\n});\nconst useSizeProps = {\n size: useSizeProp\n};\nconst SIZE_INJECTION_KEY = Symbol(\"size\");\nconst useGlobalSize = () => {\n const injectedSize = inject(SIZE_INJECTION_KEY, {});\n return computed(() => {\n return unref(injectedSize.size) || \"\";\n });\n};\n\nexport { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nexport default isNil;\n"],"names":["useSameTarget","handleClick","onClick","onMousedown","onMouseup","mousedownTarget","mouseupTarget","e","target","currentTarget","PatchFlags","PatchFlags2","flattedChildren","children","vNodes","result","forEach","child","_a","push","component","subTree","overlayProps","mask","type","Boolean","default","customMaskEvent","overlayClass","String","Array","Object","zIndex","Number","overlayEmits","click","evt","MouseEvent","BLOCK","Overlay","name","props","emits","setup","slots","emit","ns","onMaskClick","class","b","style","STYLE","CLASS","PROPS","h","position","top","right","bottom","left","ElOverlay","dialogContentProps","center","alignCenter","closeIcon","customClass","draggable","fullscreen","showClose","title","ariaLevel","dialogProps","appendToBody","appendTo","beforeClose","Function","destroyOnClose","closeOnClickModal","closeOnPressEscape","lockScroll","modal","openDelay","closeDelay","modelValue","modalClass","width","trapFocus","headerAriaLevel","dialogEmits","open","opened","close","closed","value","openAutoFocus","closeAutoFocus","drawerProps","direction","values","size","withHeader","modalFade","drawerEmits","useLockscreen","trigger","options","hiddenCls","bm","document","body","scrollBarWidth","withoutHiddenClass","bodyWidth","cleanup","setTimeout","val","namespace","bodyHasOverflow","documentElement","clientHeight","scrollHeight","bodyOverflowY","useDialog","targetRef","instance","nextZIndex","lastPosition","titleId","bodyId","visible","rendered","openTimer","closeTimer","style2","varPrefix","overlayDialogStyle","display","afterEnter","afterLeave","beforeLeave","stop","doOpen","doClose","handleClose","hide","shouldCancel","onModalClick","onOpenAutoFocus","onCloseAutoFocus","onFocusoutPrevented","event","_a2","detail","focusReason","preventDefault","onCloseRequested","isUndefined","scrollTop","transform","_sfc_main","components","ElFocusTrap","ElIcon","Close","inheritAttrs","scope","from","replacement","version","ref","drawerRef","focusStartRef","t","isHorizontal","drawerSize","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","_component_close","_component_el_icon","_component_el_focus_trap","_component_el_overlay","to","disabled","onAfterEnter","onAfterLeave","onBeforeLeave","persisted","loop","trapped","onReleaseRequested","$attrs","role","tabindex","key","$slots","titleClass","id","args","_","footer","Drawer","ElDrawer","tabsRootContextKey","Symbol","tabBarProps","tabs","COMPONENT_NAME","__default__","__props","expose","rootTabs","barRef","barStyle","getBarStyle","offset","tabSize","sizeName","includes","tabPosition","sizeDir","every","tab","_b","$el","parent","refs","uid","active","tabStyles","window","getComputedStyle","length","parseFloat","paddingLeft","paddingRight","update","async","immediate","ref_key","is","TabBar","tabNavProps","panes","currentName","editable","stretch","tabNavEmits","tabClick","tabName","ev","Event","tabRemove","TabNav","vm","visibility","focused","navScroll$","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","navStyle","dir","scrollPrev","containerSize","currentOffset","newOffset","scrollNext","navSize","scrollToActiveTab","nav","activeTab","querySelector","navScroll","activeTabBounding","getBoundingClientRect","navScrollBounding","maxOffset","offsetWidth","offsetHeight","height","Math","max","min","prev","next","changeTab","code","up","down","EVENT_CODE","tabList","querySelectorAll","currentIndex","indexOf","nextIndex","focus","preventScroll","setFocus","removeFocus","visibility2","focused2","flush","deep","scrollBtn","ArrowLeft","ArrowRight","map","pane","index","_c","_d","closable","isClosable","btnClose","tabLabelContent","label","call","delete","backspace","getOrderedChildren","childComponentName","nodes","filter","n","uids","p","useOrderedChildren","orderedChildren","addChild","removeChild","children2","tabsProps","activeName","addable","isPaneName","tabsEmits","tabChange","edit","paneName","action","tabAdd","Tabs","registerPane","unregisterPane","setCurrentName","_b2","canLeave","handleTabClick","handleTabRemove","stopPropagation","handleTabAdd","addSlot","addIcon","newButton","enter","Plus","header","panels","m","tabPaneProps","lazy","tabsRoot","loaded","shouldBeRender","TabPane","ElTabs","switchProps","loading","validator","inlinePrompt","inactiveActionIcon","activeActionIcon","activeIcon","inactiveIcon","activeText","inactiveText","activeValue","inactiveValue","activeColor","inactiveColor","borderColor","validateEvent","beforeChange","switchEmits","_hoisted_5","formItem","switchSize","useBatchDeprecated","list","param","vnode","inputId","formItemContext","switchDisabled","isControlled","input","core","switchKls","checked","labelLeftKls","em","labelRightKls","coreStyle","actualValue","validate","catch","err","handleChange","switchValue","shouldChange","isPromiseOrBool","then","styles","cssVarBlock","onChange","onKeydown","Loading","Switch","ElSwitch","getProteins","request","method","url","responseType","getCellLineProteins","Z_FIXED$1","Z_BINARY","Z_TEXT","Z_UNKNOWN$1","zero$1","buf","len","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH$1","MAX_MATCH$1","LENGTH_CODES$1","LITERALS$1","L_CODES$1","D_CODES$1","BL_CODES$1","HEAP_SIZE$1","MAX_BITS$1","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","Uint8Array","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","static_dtree","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","this","has_stree","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","s","w","pending_buf","pending","send_bits","bi_valid","bi_buf","send_code","c","tree","bi_reverse","res","bi_flush","gen_bitlen","desc","stree","extra","base","bits","xbits","f","overflow","bl_count","heap","heap_max","opt_len","static_len","gen_codes","next_code","tr_static_init","init_block","dyn_ltree","dyn_dtree","bl_tree","sym_next","matches","bi_windup","smaller","depth","_n2","_m2","pqdownheap","k","v","j","heap_len","compress_block","ltree","dtree","lc","sx","sym_buf","build_tree","node","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","send_tree","build_bl_tree","max_blindex","l_desc","d_desc","bl_desc","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","block_mask","static_init_done","_tr_init$1","_tr_stored_block$1","stored_len","last","set","subarray","_tr_align$1","_tr_flush_block$1","opt_lenb","static_lenb","level","strm","data_type","strategy","_tr_tally$1","sym_end","_tr_init_1","_tr_stored_block_1","_tr_flush_block_1","_tr_tally_1","_tr_align_1","trees","_tr_init","_tr_stored_block","_tr_flush_block","_tr_tally","_tr_align","adler32","adler","pos","s1","s2","adler32_1","makeTable","table","crcTable","Uint32Array","crc32","crc","end","i","crc32_1","messages","constants$2","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_UNKNOWN","Z_DEFLATED","Z_NO_FLUSH$2","Z_FULL_FLUSH$1","Z_FINISH$3","Z_BLOCK$1","Z_OK$3","Z_STREAM_END$3","Z_STREAM_ERROR$2","Z_DATA_ERROR$2","Z_BUF_ERROR$1","Z_DEFAULT_COMPRESSION$1","Z_DEFAULT_STRATEGY$1","Z_DEFLATED$2","MAX_MEM_LEVEL","MAX_WBITS$1","DEF_MEM_LEVEL","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","MIN_MATCH","MAX_MATCH","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","GZIP_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","errorCode","msg","zero","slide_hash","wsize","w_size","hash_size","head","HASH_ZLIB","data","hash_shift","hash_mask","HASH","flush_pending","state","avail_out","output","pending_out","next_out","total_out","flush_block_only","block_start","strstart","put_byte","putShortMSB","read_buf","start","avail_in","next_in","wrap","total_in","longest_match","cur_match","match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","_w_size","more","str","window_size","insert","ins_h","deflate_stored","have","min_block","pending_buf_size","used","high_water","deflate_fast","hash_head","bflush","match_length","max_lazy_match","deflate_slow","max_insert","prev_match","match_available","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","lm_init","DeflateState","status","gzhead","gzindex","last_flush","w_bits","hash_bits","Uint16Array","lit_bufsize","deflateStateCheck","deflateResetKeep","deflateReset","ret","deflateSetHeader","deflateInit2","windowBits","memLevel","deflateInit","deflate$2","old_flush","level_flags","text","hcrc","comment","time","os","beg","copy","gzhead_extra","charCodeAt","bstate","deflateEnd","deflateSetDictionary","dictionary","dictLength","tmpDict","avail","deflateInit_1","deflateInit2_1","deflateReset_1","deflateResetKeep_1","deflateSetHeader_1","deflate_2$1","deflateEnd_1","deflateSetDictionary_1","deflateInfo","deflate_1$2","deflate","_has","obj","prototype","hasOwnProperty","sources","slice","arguments","source","shift","TypeError","flattenChunks","chunks","l","chunk","common","assign","STR_APPLY_UIA_OK","fromCharCode","apply","__","_utf8len","q","string2buf","TextEncoder","encode","c2","m_pos","str_len","buf_len","buf2binstring","buf2string","TextDecoder","decode","out","utf16buf","c_len","utf8border","ZStream","zstream","toString$1","toString","Z_NO_FLUSH$1","Z_FINISH$2","Z_OK$2","Z_STREAM_END$2","Z_DEFLATED$1","Deflate$1","chunkSize","opt","raw","gzip","ended","Error","dict","_dict_set","deflate$1","deflator","deflateRaw$1","gzip$1","flush_mode","_flush_mode","onData","onEnd","Deflate_1$1","deflate_2","deflateRaw_1$1","gzip_1$1","constants$1","deflate_1$1","Deflate","deflateRaw","constants","BAD$1","TYPE$1","inffast","_in","_out","dmax","whave","wnext","s_window","hold","lcode","dcode","lmask","dmask","here","op","from_source","lencode","distcode","lenbits","distbits","dolen","mode","dodist","sane","MAXBITS","ENOUGH_LENS$1","ENOUGH_DISTS$1","CODES$1","LENS$1","DISTS$1","lbase","lext","dbase","dext","inflate_table","lens","lens_index","codes","table_index","work","opts","incr","fill","low","sym","root","curr","drop","huff","offs","here_bits","here_op","here_val","inftrees","CODES","LENS","DISTS","Z_FINISH$1","Z_OK$1","Z_STREAM_END$1","Z_NEED_DICT$1","Z_STREAM_ERROR$1","Z_DATA_ERROR$1","Z_MEM_ERROR$1","HEAD","FLAGS","TIME","OS","EXLEN","EXTRA","NAME","COMMENT","HCRC","DICTID","DICT","TYPE","TYPEDO","STORED","COPY_","COPY","TABLE","LENLENS","CODELENS","LEN_","LEN","LENEXT","DIST","DISTEXT","MATCH","LIT","CHECK","LENGTH","DONE","BAD","MEM","SYNC","ENOUGH_LENS","ENOUGH_DISTS","MAX_WBITS","DEF_WBITS","zswap32","InflateState","havedict","flags","check","total","wbits","ncode","nlen","ndist","lendyn","distdyn","back","was","inflateStateCheck","inflateResetKeep","Int32Array","inflateReset","inflateReset2","inflateInit2","inflateInit","lenfix","distfix","virgin","fixedtables","updatewindow","src","inflate$2","put","last_bits","last_op","last_val","hbuf","order","inf_leave","done","xflags","extra_len","inflateEnd","inflateGetHeader","inflateSetDictionary","dictid","inflateReset_1","inflateReset2_1","inflateResetKeep_1","inflateInit_1","inflateInit2_1","inflate_2$1","inflateEnd_1","inflateGetHeader_1","inflateSetDictionary_1","inflateInfo","inflate_1$2","inflate","GZheader","gzheader","Inflate$1","inflate$1","inflator","inflateRaw$1","last_avail_out","next_out_utf8","tail","utf8str","join","Inflate_1$1","inflate_2","inflateRaw_1$1","ungzip$1","inflate_1$1","Inflate","inflateRaw","ungzip","inflate_1","extendStatics","d","setPrototypeOf","__proto__","__extends","constructor","create","Browser","firefox","ie","edge","newEdge","weChat","Env","browser","wxa","worker","svgSupported","touchEventsSupported","pointerEventsSupported","domSupported","transformSupported","transform3dSupported","hasGlobalWindow","env","detect","ua","test","split","SVGRect","WebKitCSSMatrix","wx","getSystemInfoSync","self","navigator","userAgent","DEFAULT_FONT_SIZE","DEFAULT_FONT_FAMILY","DEFAULT_FONT","OFFSET","SCALE","defaultWidthMapStr","getTextWidthMap","mapStr","JSON","char","DEFAULT_TEXT_WIDTH_MAP","createCanvas","createElement","measureText","_cachedFont","font","canvas","getContext","exec","fontSize","preCalcWidth","loadImage","onload","onerror","image","Image","BUILTIN_OBJECT","reduce","TYPED_ARRAY","objToString","arrayProto","nativeForEach","nativeFilter","nativeSlice","nativeMap","ctorFunction","protoFunction","protoKey","idStart","guid","logError","_i","console","error","clone","typeStr","isPrimitive","Ctor","isDom","merge","overwrite","targetProp","sourceProp","isBuiltInObject","mergeAll","targetAndSources","extend","overlay","keysArr","keys","array","inherits","clazz","baseClazz","clazzPrototype","F","prop","superClass","mixin","override","getOwnPropertyNames","keyList","isArrayLike","arr","cb","context","memo","find","bindPolyfill","concat","bind","isFunction","curry","isArray","isNumber","isTypedArray","nodeType","ownerDocument","isGradientObject","colorStops","isImagePatternObject","isRegExp","eqNaN","retrieve","retrieve2","value0","value1","retrieve3","value2","normalizeCssArray","assert","condition","message","trim","replace","primitiveKey","setAsPrimitive","MapPolyfill","existed","has","get","callback","isNativeMapSupported","Map","maybeNativeMap","HashMap","isArr","thisMap","visit","each","hasKey","removeKey","createHashMap","concatArray","a","newArray","createObject","proto","properties","StyleCtor","disableUserSelect","dom","domStyle","webkitUserSelect","userSelect","webkitTapHighlightColor","own","noop","RADIAN_TO_DEGREE","PI","x","y","add","v1","v2","scaleAndAdd","sub","sqrt","lenSquare","scale","normalize","distance","distanceSquare","distSquare","lerp","applyTransform","Param","topTarget","Draggable","handler","on","_dragStart","_drag","_dragEnd","draggingTarget","__hostTarget","_draggingTarget","dragging","_x","offsetX","_y","offsetY","dispatchToElement","dx","dy","drift","dropTarget","findHover","lastDropTarget","_dropTarget","Eventful","eventProcessors","_$eventProcessor","query","_$handlers","_h","eventProcessor","normalizeQuery","ctx","callAtLast","zrEventfulCallAtLast","lastIndex","lastWrap","splice","isSilent","eventName","off","eventType","newList","argLen","hItem","afterTrigger","triggerWithContext","LN2","log","determinant","rows","rowStart","rowMask","colMask","detCache","cacheKey","fullRank","colStart","round","subRowMask","subRowStart","sum","colLocalIdx","colTag","buildTransformer","dest","mA","det","vh","srcPointX","srcPointY","pk","EVENT_SAVED_PROP","_calcOut","transformLocalCoord","elFrom","elTarget","inX","inY","transformCoordWithViewport","el","inverse","isCanvasEl","saved","markers","prepareCoordMarkers","transformer","preparePointerTransformer","propLR","propTB","marker","stl","idxLR","idxTB","cssText","appendChild","transformerName","oldSrcCoords","srcCoords","destCoords","oldCoordTheSame","rect","ii","offsetLeft","offsetTop","nodeName","toUpperCase","replaceReg","replaceMap","encodeHTML","MOUSE_EVENT_REG","firefoxNotSupportOffsetXY","clientToLocal","calculate","calculateZrXY","layerX","zrX","zrY","layerY","ex","clientX","ey","clientY","box","getNativeEvent","normalizeEvent","isTouch","touch","targetTouches","changedTouches","wheelDelta","getWheelDeltaMayPolyfill","zrDelta","button","which","undefined","rawWheelDelta","deltaX","deltaY","delta","abs","sign","addEventListener","removeEventListener","cancelBubble","isMiddleOrRightButtonOnMouseUpDown","GestureMgr","_track","recognize","_doTrack","_recognize","clear","touches","trackItem","points","recognizers","gestureInfo","pointPair","pinch","tracks","trackLen","pinchEnd","pinchPre","pinchScale","isFinite","pinchCenter","pinchX","pinchY","identity","m1","m2","out0","out1","out2","out3","out4","out5","translate","rotate","rad","aa","ac","atx","ab","ad","aty","st","sin","ct","cos","vx","vy","Point","other","equal","scalar","dot","negate","toArray","fromArray","p2","p0","p1","onet","mathMin","mathMax","lt","rb","lb","rt","minTv","maxTv","BoundingRect","union","calculateTransform","sy","intersect","mtv","ax0","ax1","ay0","ay1","bx0","bx1","by0","by1","overlap","dMin","Infinity","dMax","d0","d1","d2","d3","contain","plain","isZero","tx","ty","maxX","maxY","SILENT","makeEventPacket","eveType","targetInfo","gestureEvent","zrByTouch","stopEvent","EmptyProxy","_super","_this","dispose","setCursor","HoveredResult","handlerNames","tmpRect","Handler","storage","painter","proxy","painterRoot","pointerSize","_hovered","_pointerSize","setHandlerProxy","_draggingMgr","mousemove","isOutside","isOutsideBoundary","lastHovered","lastHoveredTarget","__zr","hovered","hoveredTarget","cursor","mouseout","eventControl","zrEventControl","resize","dispatch","eventArgs","setCursorStyle","cursorStyle","silent","eventKey","eventPacket","eachOtherLayer","layer","exclude","getDisplayList","setHoverTarget","candidates","targetSizeHalf","pointerRect","ignore","ignoreCoarsePointer","getBoundingRect","rStep","thetaStep","PI2","r","theta","x1","y1","processGesture","stage","_gestureMgr","gestureMgr","isHover","displayable","rectHover","ignoreClip","clipPath","getClipPath","hostEl","hoverCheckResult","handlerInstance","getWidth","getHeight","_downEl","_downPoint","_upEl","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","minRunLength","makeAscendingRun","lo","hi","compare","runHi","reverseRun","binaryInsertionSort","mid","pivot","gallopLeft","hint","lastOffset","tmp","gallopRight","TimSort","runStart","runLength","minGallop","stackSize","pushRun","_runStart","_runLength","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","count1","count2","exit","_minGallop","customCursor","customDest","sort","remaining","ts","minRun","force","REDRAW_BIT","STYLE_CHANGED_BIT","SHAPE_CHANGED_BIT","invalidZErrorLogged","logInvalidZError","warn","shapeCompareFunc","zlevel","z","z2","Storage","_roots","_displayList","_displayListLen","displayableSortFunc","traverse","includeIgnore","displayList","updateDisplayList","roots","_updateAndAddDisplayable","clipPaths","beforeUpdate","afterUpdate","userSetClipPath","currentClipPath","parentClipPath","updateTransform","childrenRef","__dirty","disp","__clipPaths","isNaN","decalEl","getDecalElement","textGuide","getTextGuideLine","textEl","getTextContent","addRoot","delRoot","idx","delAllRoots","getRoots","requestAnimationFrame","msRequestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","easingFuncs","linear","quadraticIn","quadraticOut","quadraticInOut","cubicIn","cubicOut","cubicInOut","quarticIn","quarticOut","quarticInOut","quinticIn","quinticOut","quinticInOut","sinusoidalIn","sinusoidalOut","sinusoidalInOut","exponentialIn","pow","exponentialOut","exponentialInOut","circularIn","circularOut","circularInOut","elasticIn","asin","elasticOut","elasticInOut","backIn","backOut","backInOut","bounceIn","bounceOut","bounceInOut","mathPow","mathSqrt","EPSILON","EPSILON_NUMERIC","THREE_SQRT","ONE_THIRD","_v0","_v1","_v2","isAroundZero","isNotAroundZero","p3","cubicDerivativeAt","cubicRootAt","A","B","C","t1","disc","K","t2","discSqrt","Y1","Y2","T","acos","ASqrt","t3","extrema","cubicSubdivide","p01","p12","p23","p012","p123","p0123","cubicProjectPoint","x0","y0","x2","y2","x3","y3","interval","_t","cubicLength","iteration","px","py","step","quadraticRootAt","divider","quadraticProjectPoint","quadraticLength","regexp","createCubicEasingFunc","cubicEasingStr","cubic","a_1","b_1","c_1","d_1","roots_1","Clip","_inited","_startTime","_pausedTime","_paused","_life","life","_delay","delay","onframe","ondestroy","onrestart","easing","setEasing","globalTime","deltaTime","elapsedTime","percent","easingFunc","schedule","remainder","pause","resume","Entry","LinkedList","_len","entry","insertEntry","remove","LRU","maxSize","_list","_maxSize","_map","removed","_lastRemovedEntry","leastUsedEntry","kCSSColorTable","clampCssByte","clampCssAngle","clampCssFloat","parseCssInt","charAt","parseInt","parseCssFloat","cssHueToRgb","lerpNumber","setRgba","g","copyRgba","colorCache","lastRemovedArr","putToCache","colorStr","rgbaArr","parse","cached","toLowerCase","strLen","ep","fname","substr","params","alpha","pop","hsla2rgba","iv","hsla","rgba","rgba2hsla","H","S","R","G","vMin","vMax","L","deltaR","deltaG","deltaB","lift","color","colorArr","stringify","fastLerp","normalizedValue","colors","leftIndex","floor","rightIndex","ceil","leftColor","rightColor","dv","fullOutput","modifyHSL","modifyAlpha","arrColor","lum","backgroundLum","mathRound","normalizeColor","opacity","round3","round4","getMatrixStr","TEXT_ALIGN_TO_ANCHOR","middle","adjustTextY","lineHeight","textBaseline","hasShadow","shadowBlur","shadowOffsetX","shadowOffsetY","getShadowKey","globalScale","getGlobalScale","shadowColor","toFixed","isImagePattern","isSVGPattern","svgElement","isPattern","isLinearGradient","isRadialGradient","isGradient","getIdURL","getPathPrecision","getSRTTransformString","rotation","scaleX","scaleY","skewX","skewY","encodeBase64","btoa","unescape","encodeURIComponent","Buffer","arraySlice","interpolateNumber","interpolate1DArray","interpolate2DArray","len2","add1DArray","add2DArray","fillColorStops","val0","val1","len0","len1","shorterArr","shorterLen","fillArray","arrDim","arr0","arr1","arr0Len","arr1Len","isPreviousLarger","cloneValue","rgba2String","guessArrayDim","VALUE_TYPE_NUMBER","VALUE_TYPE_1D_ARRAY","VALUE_TYPE_2D_ARRAY","VALUE_TYPE_COLOR","VALUE_TYPE_LINEAR_GRADIENT","VALUE_TYPE_RADIAL_GRADIENT","VALUE_TYPE_UNKOWN","isGradientValueType","valType","isArrayValueType","tmpRgba","Track","propName","keyframes","discrete","_invalid","_needsSort","_lastFr","_lastFrP","isFinished","_finished","setFinished","_additiveTrack","needsAnimate","getAdditiveTrack","addKeyframe","rawValue","arrayDim","colorArray","parsedGradient","colorStop","kf","prepare","maxTime","additiveTrack","kfs","kfsLen","lastKf","isDiscrete","lastValue","startValue","additiveValue","frameIdx","frame","nextFrame","isAdditive","valueKey","kfsNum","isValueColor","lastFrame","targetArr","_additiveValue","nextVal_1","isLinearGradient_1","nextColorStop","global","_addToTarget","Animator","allowDiscreteAnimation","additiveTo","_tracks","_trackKeys","_maxTime","_started","_clip","_target","_loop","_additiveAnimators","_allowDiscrete","getMaxTime","getDelay","getLoop","getTarget","changeTarget","when","whenWithKeys","propNames","track","initialValue","_getAdditiveTrack","addtiveTrackKfs","lastFinalKf","isPaused","duration","_force","_doneCallback","_setTracksFinished","doneList","_doneCbs","_abortedCallback","animation","abortedList","_abortedCbs","removeClip","tracksKeys","trackName","additiveAnimators","getTrack","clip","stillHasAdditiveAnimator","onframeList","_onframeCbs","addClip","forwardToLast","during","aborted","getClip","getTracks","stopTracks","allAborted","saveTo","trackKeys","firstOrLast","__changeFinalValue","finalProps","getTime","Date","Animation","_running","_time","_pauseStart","_head","_tail","addAnimator","animator","removeAnimator","notTriggerFrameAndStageUpdate","nextClip","finished","_startLoop","animate","TOUCH_CLICK_DELAY","globalEventSupported","localNativeListenerNames","mouseHandlerNames","touchHandlerNames","pointerEventNameMap","pointerdown","pointerup","pointermove","pointerout","pointerHandlerNames","nm","mouse","pointer","globalNativeListenerNames","wheelEventSupported","isPointerFromTouch","pointerType","setTouchTimer","touching","touchTimer","clearTimeout","markTouch","normalizeGlobalEvent","FakeGlobalEvent","isLocalEl","elTmp","isLocal","domBelongToZr","parentNode","stopImmediatePropagation","localDOMHandlers","mousedown","__mayPointerCapture","downPoint","__togglePointerCapture","mouseup","element","toElement","relatedTarget","__pointerCapturing","wheel","mousewheel","touchstart","__lastTouchMoment","touchmove","touchend","globalDOMHandlers","pointerCaptureReleasing","mountLocalDOMEventListeners","domHandlers","nativeEventName","mountSingleDOMEventListener","mountGlobalDOMEventListeners","mount","nativeEventListener","capture","listener","mounted","listenerOpts","domTarget","unmountDOMEventListeners","DOMHandlerScope","HandlerDomProxy","_localHandlerScope","_globalHandlerScope","isPointerCapturing","globalHandlerScope","dpr","devicePixelRatio","screen","deviceXDPI","logicalXDPI","DARK_MODE_THRESHOLD","DARK_LABEL_COLOR","LIGHT_LABEL_COLOR","LIGHTER_LABEL_COLOR","mIdentity","scaleTmp","tmpTransform","originTransform","Transformable","getLocalTransform","setPosition","setScale","setSkew","setOrigin","originX","originY","needLocalTransform","parentTransform","_resolveGlobalScaleRatio","invTransform","globalScaleRatio","relX","relY","getComputedTransform","transformNode","ancestors","setLocalTransform","atan2","shearX","decomposeTransform","ox","oy","transformCoordToLocal","transformCoordToGlobal","getLineScale","copyTransform","ax","anchorX","ay","anchorY","tan","initDefaultProps","TRANSFORMABLE_PROPS","textWidthCache","cacheOfFont","innerGetBoundingRect","textAlign","getLineHeight","adjustTextX","textLines","uniondRect","verticalAlign","parsePercent","maxValue","lastIndexOf","calculateTextPosition","textPosition","halfHeight","textVerticalAlign","align","PRESERVED_NORMAL_STATE","PRIMARY_STATES_KEYS","DEFAULT_ANIMATABLE_MAP","tmpTextPosCalcRes","tmpBoundingRect","Element","animators","currentStates","states","_init","attr","markRedraw","updateInnerText","forceUpdate","_textContent","textConfig","local","innerTransformable","textStyleChanged","innerOrigin","layoutRect","textOrigin","origin","relOriginX","relOriginY","textOffset","isInside","inside","innerTextDefaultStyle","_innerTextDefaultStyle","textFill","textStroke","autoStroke","canBeInsideText","insideFill","insideStroke","getInsideTextFill","getInsideTextStroke","outsideFill","outsideStroke","getOutsideFill","getOutsideStroke","stroke","setDefaultTextStyle","dirtyStyle","isDarkMode","backgroundColor","getBackgroundColor","isDark","attrKV","setTextConfig","setTextContent","setClipPath","show","keyOrObj","saveCurrentToNormalState","toState","_innerSaveToNormal","normalState","_normalState","fromStateTransition","__fromStateTransition","targetName","_savePrimaryToNormal","primaryKeys","hasState","getState","ensureState","clearStates","noAnimation","useState","stateName","keepCurrentStates","forceUseHoverLayer","toNormalState","hasStates","animationCfg","stateTransition","stateProxy","useHoverLayer","hoverLayer","_toggleHoverLayerFlag","_applyStateObj","__inHover","textContent","_textGuide","_updateAnimationTargets","useStates","stateObjects","notChange","stateObj","lastStateObj","mergedState","_mergeStates","removeState","replaceState","oldState","newState","forceAdd","newStateExists","toggleState","enable","mergedTextConfig","transition","needsRestoreToNormal","transitionTarget","hasTransition","propNeedsTransition","_transitionState","_attachComponent","componentEl","zr","addSelfToZr","_detachComponent","removeSelfFromZr","_clipPath","removeClipPath","previousTextContent","removeTextContent","cfg","removeTextConfig","setTextGuideLine","guideLine","removeTextGuideLine","refreshHover","refresh","dirty","inHover","updateDuringAnimation","wakeUp","stopAnimation","leftAnimators","animateTo","animationProps","animateFrom","getPaintRect","elProto","isGroup","createLegacyProperty","privateKey","xKey","yKey","enhanceArray","defineProperty","animatable","reverse","animateToShallow","finishCount","doneHappened","cfgDone","cfgAborted","doneCb","abortedCb","copyArrShallow","is2DArray","copyValue","sourceArr","isValueSame","val2","is1DArraySame","topKey","animateObj","targetKeys","additive","setToFinal","animateAll","existsAnimators","animationKeys","innerKey","targetVal","keyLen","revertedSource","reversedTarget","sourceClone","Group","_children","childAt","childOfName","childCount","_doAdd","addBefore","nextSibling","oldChild","newChild","replaceAt","old","removeAll","eachChild","stopped","includeChildren","tmpMat","invisible","childRect","painterCtors","instances","delInstance","totalLum","ZRender","_sleepAfterStill","_stillFrameAccum","_needsRefresh","_needsRefreshHover","_darkMode","rendererType","renderer","useDirtyRect","ssrMode","ssr","ssrOnly","handerProxy","HandlerProxy","getViewportRoot","useCoarsePointer","usePointerSize","defaultPointerSize","_flush","configLayer","zLevel","config","setBackgroundColor","_backgroundColor","setDarkMode","darkMode","refreshImmediately","fromInside","triggerRendered","refreshHoverImmediately","setSleepAfterStill","stillFramesCount","getType","clearAnimation","eventHandler","init","registerPainter","RADIAN_EPSILON","ROUND_SUPPORTED_PRECISION_MAX","_trim","linearMap","domain","range","clamp","r0","r1","subDomain","subRange","all","NaN","precision","returnStr","asc","getPrecision","getPrecisionSafe","eIndex","exp","significandPartLen","dotIndex","decimalPartLen","getPixelPrecision","dataExtent","pixelExtent","LN10","dataQuantity","sizeQuantity","getPercentSeats","valueList","acc","digits","votesPerQuota","targetSeats","seats","votes","currentSum","NEGATIVE_INFINITY","maxId","seat","addSafe","maxPrecision","MAX_SAFE_INTEGER","remRadian","radian","pi2","isRadianAroundZero","TIME_REG","hour","UTC","substring","quantity","nice","nf","exponent","exp10","quantile","ascArr","reformIntervals","littleThan","currClose","close_1","lg","numericToNumber","valFloat","getRandomIdBase","random","getGreatestCommonDividor","getLeastCommonMultiple","DUMMY_COMPONENT_NAME_PREFIX","INTERNAL_COMPONENT_ID_PREFIX","normalizeToArray","defaultEmphasis","subOpts","emphasis","subOptName","TEXT_STYLE_OPTIONS","getDataItemValue","dataItem","isDataItemOption","mappingToExists","existings","newCmptOptions","isNormalMergeMode","isReplaceMergeMode","isReplaceAllMode","existingIdIdxMap","cmptOption","prepareResult","mappingById","mappingByName","mappingByIndex","mappingInReplaceAllMode","makeIdAndName","existing","isComponentIdInternal","newOption","keyInfo","brandNew","optionId","makeComparableKey","existingIdx","resultItem","keyExistAndEqual","nextIdx","mapResult","idMap","item","idNum","obj1","obj2","key1","convertOptionIdName","key2","idOrName","defaultValue","isNameSpecified","componentModel","makeInternalComponentId","idSuffix","setComponentTypeToKeyInfo","mappingResult","mainType","componentModelCtor","subType","determineSubType","newCmptOption","existComponent","compressBatches","batchA","batchB","mapA","mapB","makeMap","mapToArray","sourceBatch","otherMap","seriesId","dataIndices","dataIndex","otherDataIndices","lenj","isData","queryDataIndex","payload","dataIndexInside","indexOfRawIndex","indexOfName","makeInner","innerUniqueIndex","hostObj","parseFinder","ecModel","finderInput","preParseFinder","mainTypeSpecified","queryOptionMap","others","defaultMainType","queryOption","queryResult","queryReferringComponents","useDefault","enableAll","enableNone","models","finder","parsedKey","queryType","includeMainTypes","SINGLE_REFERRING","MULTIPLE_REFERRING","userOption","indexOption","idOption","nameOption","specified","firstCmpt","getComponent","queryComponents","setAttribute","getAttribute","getTooltipRenderMode","renderModeOption","groupData","getKey","buckets","interpolateRawValues","sourceValue","targetValue","isAutoPrecision","interpolated","leftArr","rightArr","length_1","info","getDimensionInfo","leftVal","rightVal","TYPE_DELIMITER","IS_CONTAINER","IS_EXTENDED_CLASS","parseClassType","componentType","main","typeArr","checkClassType","isExtendedClass","clz","enableClassExtend","rootClz","mandatoryMethods","$constructor","ExtendedClass","isESClass","class_1","superCall","superApply","fn","mountExtend","SubClz","SupperClz","classBase","enableClassCheck","classAttr","isInstance","methodName","enableClassManagement","makeContainer","componentTypeInfo","container","registerClass","componentFullType","getClass","throwWhenNotFound","getClassesByMainType","o","hasClass","getAllClassMainTypes","types","hasSubTypes","makeStyleMapper","ignoreParent","model","excludes","getShallow","AREA_STYLE_KEY_MAP","getAreaStyle","AreaStyleMixin","globalImageCache","findExistImage","newImageOrSrc","cachedImgObj","createOrUpdateImage","cbPayload","__zrImageSrc","pendingWrap","isImageReady","imageOnLoad","__cachedImgObj","STYLE_REG","truncateText","containerWidth","ellipsis","prepareTruncateOptions","truncateSingleLine","preparedOpts","maxIterations","minChar","cnCharWidth","ascCharWidth","placeholder","contentWidth","ellipsisWidth","textLine","lineWidth","subLength","estimateLength","charCode","parsePlainText","lines","padding","truncate","calculatedLineHeight","bgColorDrawn","truncateLineOverflow","lineOverflow","wrapText","contentHeight","lineCount","truncateMinChar","outerHeight","outerWidth","RichTextToken","RichTextLine","tokens","RichTextContentBlock","parseRichText","contentBlock","topWidth","topHeight","wrapInfo","accumWidth","breakAll","matchedIndex","pushTokens","pendingList","calculatedHeight","calculatedWidth","stlPadding","truncateLine","finishLine","line","outer","token","tokenStyle","styleName","rich","textPadding","paddingH","tokenHeight","innerHeight","styleTokenWidth","tokenWidthNotSpecified","percentWidth","textBackgroundColor","bgImg","remainTruncWidth","block","strLines","linesWidths","isEmptyStr","newLine","tokenPadding","tokenPaddingH","outerWidth_1","isLineHolder","tokensLen","isAlphabeticLetter","ch","breakCharMap","isWordBreakChar","isBreakAll","lastAccumWidth","currentWord","currentWordWidth","chWidth","inWord","STYLE_MAGIC_KEY","DEFAULT_COMMON_STYLE","blend","DEFAULT_COMMON_ANIMATION_PROPS","PRIMARY_STATES_KEYS_IN_HOVER_LAYER","Displayable","useStyle","beforeBrush","afterBrush","innerBeforeBrush","innerAfterBrush","shouldBePainted","viewWidth","viewHeight","considerClipPath","considerAncestors","culling","isDisplayableCulled","isZeroArea","parent_1","rectContain","coord","_paintRect","elRect","shadowSize","tolerance","dirtyRectTolerance","setPrevPaintRect","paintRect","_prevPaintRect","getPrevPaintRect","animateStyle","targetKey","setStyle","notRedraw","_rect","styleChanged","styleUpdated","createStyle","__hoverStyle","isStyleObject","_mergeStyle","targetStyle","sourceStyle","changedKeys","getAnimationStyleProps","statesKeys","mergedStyle","dispProto","incremental","viewRect","mathSin","mathCos","extremity","fromPoints","fromLine","xDim","yDim","fromCubic","cubicExtrema","cubicAt","fromQuadratic","quadraticExtremum","quadraticAt","fromArc","rx","ry","startAngle","endAngle","anticlockwise","vec2Min","vec2Max","diff","angle","CMD","M","Q","Z","tmpOutX","tmpOutY","min2","max2","mathAbs","hasTypedArray","Float32Array","tmpAngles","modPI2","normalizeArcAngles","angles","newStartAngle","newEndAngle","PathProxy","notSaveData","_xi","_yi","_x0","_y0","_saveData","increaseVersion","_version","getVersion","segmentIgnoreThreshold","_ux","_uy","setDPR","setContext","beginPath","reset","_pathSegLen","_pathLen","moveTo","_drawPendingPt","addData","lineTo","exceedUnit","_pendingPtDist","_pendingPtX","_pendingPtY","bezierCurveTo","quadraticCurveTo","arc","cx","cy","arcTo","radius","closePath","toStatic","setData","appendPath","path","appendSize","appendPathData","cmd","_expandData","newData","MAX_VALUE","xi","yi","isFirst","_calculateLength","ux","uy","pathSegLen","pathTotalLen","segCount","rebuildPath","displayedLength","pendingPtX","pendingPtY","drawPart","accumLength","pendingPtDist","psi","isEllipse","breakBuild","ellipse","newProxy","containStroke","_l","_s","normalizeRadian","windingLine","x_","isAroundEqual","swapExtrema","windingCubic","nRoots","nExtrema","y0_","y1_","unit","windingQuadratic","y_","windingArc","dTheta","tmp_1","containPath","isStroke","pathProxy","DEFAULT_PATH_STYLE","strokePercent","fillOpacity","strokeOpacity","lineDashOffset","lineCap","miterLimit","strokeNoScale","strokeFirst","DEFAULT_PATH_ANIMATION_PROPS","pathCopyParams","Path","decal","_decalEl","buildPath","shape","decalElStyle","getDefaultShape","defaultStyle","getDefaultStyle","hasFill","pathFill","fillLum","isDarkLabel","shapeCfg","inBatch","pathUpdated","getUpdatedPathProxy","createPathProxy","hasStroke","needsUpdateRect","firstInvoke","rectStroke","_rectStroke","lineScale","strokeContainThreshold","localPos","dirtyShape","animateShape","setShape","shapeChanged","targetShape","targetShapePrimaryProps","shapeKeys","mergedShape","defaultProps","Sub","pathProto","subPixelOptimize","autoBatch","DEFAULT_TSPAN_STYLE","TSpan","setBoundingRect","tspanProto","DEFAULT_IMAGE_STYLE","DEFAULT_IMAGE_ANIMATION_PROPS","sWidth","sHeight","isImageLike","ZRImage","_getSize","dim","imageSource","__image","otherDim","otherDimSize","r2","r3","r4","subPixelOptimizeLine","outputShape","inputShape","subPixelOptimizeRect","originWidth","originHeight","positiveOrNegative","doubledPosition","RectShape","subPixelOptimizeOutputShape","Rect","optimizedShape","DEFAULT_RICH_TEXT_COLOR","DEFAULT_STROKE_LINE_WIDTH","DEFAULT_TEXT_ANIMATION_PROPS","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","borderWidth","borderRadius","ZRText","_defaultStyle","_updateSubTexts","_childCursor","normalizeTextStyle","_updateRichTexts","_updatePlainTexts","defaultTextStyle","sourceRich","targetRich","_mergeRich","richNames","richName","_getOrCreateChild","textFont","getStyleText","needDrawBg","needDrawBackground","baseX","baseY","textX","textY","boxX","boxY","_renderBackground","getTextXForPadding","defaultLineWidth","useDefaultFill","getFill","getStroke","fixedBoundingRect","subElStyle","lineDash","setSeparateFont","xLeft","lineTop","xRight","tokenCount","remainedWidth","lineXLeft","lineXRight","_placeToken","parentBgColorDrawn","textWidth","textHeight","topStyle","rectEl","imgEl","textBorderWidth","textBorderColor","isImageBg","isPlainOrGradientBg","textBorderRadius","rectShape","rectStyle","imgStyle","borderDash","borderDashOffset","commonStyle","makeFont","hasSeparateFont","fontStyle","fontWeight","parseFontSize","fontFamily","VALID_TEXT_ALIGN","VALID_TEXT_VERTICAL_ALIGN","FONT_PARTS","fontProp","normalizeStyle","getECData","setCommonECData","seriesIndex","dataType","dataIdx","ecData","childECData","_highlightNextDigit","_highlightKeyMap","getSavedStates","getComponentStates","HOVER_STATE_NORMAL","HOVER_STATE_BLUR","HOVER_STATE_EMPHASIS","SPECIAL_STATES","DISPLAY_STATES","Z2_EMPHASIS_LIFT","Z2_SELECT_LIFT","HIGHLIGHT_ACTION_TYPE","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","hasFillOrStroke","fillOrStroke","liftedColorCache","liftColor","liftedColor","doChangeHoverState","hoverStateEnum","onHoverStateChange","hoverState","singleEnterEmphasis","singleLeaveEmphasis","singleEnterBlur","singleLeaveBlur","singleEnterSelect","selected","singleLeaveSelect","updateElementState","updater","commonParam","traverseUpdateState","setStatesFlag","getFromStateStyle","toStateName","fromState","createEmphasisDefaultState","targetStates","hasSelect","cloned","store","fromFill","selectFill","normalFill","fromStroke","selectStroke","normalStroke","emphasisStyle","z2EmphasisLift","createSelectDefaultState","z2SelectLift","createBlurDefaultState","hasBlur","currentOpacity","blurStyle","elementStateProxy","setDefaultStateProxy","enterEmphasisWhenMouseOver","shouldSilent","__highByOuter","leaveEmphasisWhenMouseOut","enterEmphasis","highlightDigit","leaveEmphasis","enterBlur","leaveBlur","enterSelect","leaveSelect","__highDownSilentOnTouch","allLeaveBlur","api","getModel","leaveBlurredSeries","allComponentViews","eachComponent","componentStates","isSeries","view","getViewOfSeriesModel","getViewOfComponentModel","isBlured","group","toggleBlurSeries","blurSeries","targetSeriesIndex","blurScope","leaveBlurOfIndices","itemEl","getItemGraphicEl","targetSeriesModel","getSeriesByIndex","targetCoordSys","coordinateSystem","master","blurredSeries","eachSeries","seriesModel","sameSeries","coordSys","sameCoordSys","getData","dataTypes","blurComponent","componentMainType","componentIndex","focusBlurEnabled","blurSeriesFromHighlightPayload","current","focus_1","findComponentHighDownDispatchers","focusSelf","dispatchers","findHighDownDispatchers","handleGlobalMouseOverForHighDown","dispatcher","componentHighDownName","handleGlobalMouseOutForHighDown","toggleSelectionFromPayload","isSelectChangePayload","updateSeriesElementSelection","allData","getAllData","eachItemGraphicEl","isSelected","getAllSelectedIndices","getSelectedDataIndices","enableHoverEmphasis","setAsHighDownDispatcher","enableHoverFocus","disableHoverEmphasis","toggleHoverEmphasis","isDisabled","OTHER_STATES","defaultStyleGetterMap","itemStyle","lineStyle","areaStyle","setStatesStylesFromModel","itemModel","styleType","getter","asDispatcher","disable","extendedEl","highDownSilentOnTouch","__highDownDispatcher","isHighDownDispatcher","enableComponentHighDownFeatures","getHighlightDigit","highlightKey","payloadType","isHighDownPayload","savePathStates","selectState","select","transitionStore","getAnimationConfig","animationType","animatableModel","extraOpts","extraDelayParams","animationPayload","updatePayload","getUpdatePayload","animationEnabled","isAnimationEnabled","isUpdate","animateOrSetProps","removeOpt","isFrom","isRemove","animationConfig","getAnimationDelayParams","animationDelay","animationEasing","animateConfig","updateProps","initProps","isElementRemoved","removeElement","fadeOutDisplayable","removeElementWithFadeOut","doRemove","saveOldStyle","oldStyle","getOldStyle","EMPTY_OBJ","setLabelText","labelTexts","oldStates","normal","getLabelText","stateModels","interpolatedValue","baseText","labelFetcher","labelDataIndex","labelDimIndex","normalModel","getFormattedLabel","defaultText","statesText","stateModel","setLabelStyle","targetEl","labelStatesModels","stateSpecified","isSetOnText","needsCreateText","labelStatesTexts","showNormal","normalStyle","createTextStyle","createTextConfig","stateShow","targetElEmphasisState","enableTextSetter","labelInner","getLabelStatesModels","labelName","statesModels","textStyleModel","specifiedTextStyle","isNotNormal","isAttached","textStyle","setTextStyleCommon","labelPosition","labelRotate","labelDistance","labelOffset","defaultOutsidePosition","inheritColor","richResult","globalTextStyle","option","richItemNames","getRichItemNames","name_1","richTextStyle","setTokenTextStyle","margin","richItemNameMap","richKeys","richKey","parentModel","TEXT_PROPS_WITH_GLOBAL","TEXT_PROPS_SELF","TEXT_PROPS_BOX","isBlock","inRich","fillColor","strokeColor","textBorderType","textBorderDashOffset","defaultOpacity","baseline","disableBox","borderType","getFont","gTextStyleModel","setLabelValueAnimation","getDefaultText","prevValue","normalLabelModel","valueAnimation","defaultInterpolatedText","animateLabelValue","labelInnerStore","currValue","labelText","PATH_COLOR","textStyleParams","tmpText","TextStyleMixin","getTextColor","isEmphasis","getTextRect","LINE_STYLE_KEY_MAP","getLineStyle","LineStyleMixin","ITEM_STYLE_KEY_MAP","getItemStyle","ItemStyleMixin","Model","rest","mergeOption","_doGet","parsePath","hasPath","pathFinal","resolveParentPath","isEmpty","restoreData","pathArr","getUID","enableSubTypeDefaulter","subTypeDefaulters","registerSubTypeDefaulter","defaulter","componentTypeMain","enableTopologicalTravel","entity","dependencyGetter","makeDepndencyGraph","fullNameList","graph","noEntryList","thisItem","createDependencyGraphItem","originalDeps","availableDeps","getAvailableDependencies","entryCount","dependentName","predecessor","thatItem","successor","dep","topologicalTravel","targetNameList","targetNameSet","currComponentType","currVertex","isInTargetNameSet","removeEdgeAndAdd","removeEdge","errMsg","succComponentType","inheritDefaultOption","superOption","subOption","month","monthAbbr","dayOfWeek","dayOfWeekAbbr","legend","selector","toolbox","brush","polygon","lineX","lineY","keep","dataView","lang","dataZoom","zoom","magicType","bar","stack","tiled","restore","saveAsImage","series","typeNames","pie","scatter","effectScatter","radar","treemap","boxplot","candlestick","heatmap","parallel","sankey","funnel","gauge","pictorialBar","themeRiver","sunburst","aria","general","withTitle","withoutTitle","single","prefix","withName","withoutName","multiple","separator","partialData","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","langStr","language","browserLanguage","registerLocale","locale","localeObj","createLocaleObject","getLocaleModel","getDefaultLocaleModel","langEN","langZH","ONE_SECOND","ONE_MINUTE","ONE_HOUR","ONE_DAY","ONE_YEAR","defaultLeveledFormatter","year","day","minute","second","millisecond","none","fullDayFormatter","fullLeveledFormatter","primaryTimeUnits","timeUnits","getPrimaryTimeUnit","timeUnit","isPrimaryTimeUnit","getDefaultFormatPrecisionOfInterval","format","template","isUTC","date","fullYearGetterName","monthGetterName","dateGetterName","hoursGetterName","minutesGetterName","secondsGetterName","millisecondsGetterName","localeModel","timeModel","leveledFormat","tick","formatter","defaults","mergedFormatter","inherit","getUnitFromValue","targetId","levelId","isSecond","isMinute","isHour","isDay","isMonth","isYear","getUnitValue","fullYearSetterName","monthSetterName","dateSetterName","hoursSetterName","minutesSetterName","secondsSetterName","millisecondsSetterName","addCommas","parts","toCamelCase","upperCaseFirst","group1","makeValueReadable","valueType","useUTC","USER_READABLE_DEFUALT_TIME_PATTERN","stringToUserReadable","isNumberUserReadable","num","isTypeTime","isValueDate","numericResult","TPL_VAR_ALIAS","wrapVar","varName","seriesIdx","formatTpl","tpl","paramsList","seriesLen","$vars","alias","formatTplSimple","getTooltipMarker","inOpt","extraCssText","renderMode","markerId","content","convertToColorString","defaultColor","windowOpen","link","blank","opener","location","href","LOCATION_PARAMS","HV_NAMES","boxLayout","orient","gap","maxWidth","maxHeight","currentLineMaxSize","nextX","nextY","nextChild","nextChildRect","moveX","newline","moveY","getAvailableSize","positionInfo","containerRect","containerHeight","getLayoutRect","verticalMargin","horizontalMargin","aspect","positionElement","hv","boundingMode","sizeCalculable","hvIdx","fetchLayoutMode","ins","layoutMode","mergeLayoutParam","targetOption","ignoreSize","hResult","vResult","names","newParams","newValueCount","merged","mergedValueCount","enoughParamNumber","hasProp","hasValue","getLayoutParams","copyLayoutParams","inner","ComponentModel","mergeDefaultAndTheme","inputPositionParams","themeModel","getTheme","getDefaultOption","optionUpdated","newCptOption","isInit","ctor","defaultOption","fields","optList","getReferringComponents","indexKey","idKey","getBoxLayoutParams","boxLayoutModel","getZLevelKey","setZLevel","protoInitialize","getDependencies","deps","dependencies","unshift","platform","decalColor","colorBy","gradientColor","decals","dashArrayX","dashArrayY","symbolSize","symbol","blendMode","stateAnimation","animationDuration","animationDurationUpdate","animationEasingUpdate","animationThreshold","progressiveThreshold","progressive","hoverLayerThreshold","VISUAL_DIMENSIONS","SOURCE_FORMAT_ARRAY_ROWS","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_TYPED_ARRAY","SOURCE_FORMAT_UNKNOWN","SERIES_LAYOUT_BY_COLUMN","SERIES_LAYOUT_BY_ROW","BE_ORDINAL","Must","Might","Not","innerGlobalModel","resetSourceDefaulter","datasetMap","makeSeriesEncodeForAxisCoordSys","coordDimensions","datasetModel","querySeriesUpstreamDatasetModel","baseCategoryDimIndex","categoryWayValueDimStart","encodeItemName","encodeSeriesName","seriesLayoutBy","coordDimInfoLoose","coordDimIdx","coordDimInfo","getDataDimCountOnCoordDim","datasetRecord","categoryWayDim","valueWayDim","pushDim","dimIdxArr","idxFrom","idxCount","dimsDef","coordDimName","itemName","seriesName","makeSeriesEncodeForNameBased","dimCount","potentialNameDimIndex","sourceFormat","dimensionsDefine","idxResult","idxRes0","idxRes1","guessRecords","guessResult","doGuessOrdinal","startIndex","isPureNumber","fulfilled","nameDimIndex","thisData","queryDatasetUpstreamDatasetModels","guessOrdinal","dimIndex","dimName","dimType","maxLoop","dimDefItem","dataArrayRows","sample","detectValue","row","dataObjectRows","dataKeyedColumns","dataOriginal","beStr","internalOptionCreatorMap","registerInternalOptionCreator","creator","concatInternalOptions","newCmptOptionList","internalOptionCreator","internalOptions","reCreateSeriesIndices","assertSeriesInitialized","initBase","innerColor","innerDecal","PaletteMixin","getColorFromPalette","requestNum","defaultPalette","layeredPalette","getFromPalette","clearColorPalette","clearPalette","getDecalFromPalette","defaultDecals","getNearestPalette","palettes","requestColorNum","paletteNum","that","scopeFields","paletteIdx","paletteNameMap","palette","pickedPaletteItem","OPTION_INNER_KEY","OPTION_INNER_VALUE","GlobalModel","theme","optionManager","_theme","_locale","_optionManager","setOption","optionPreprocessorFuncs","innerOpt","normalizeSetOptionInput","_resetOption","resetOption","optionChanged","baseOption","mountOption","_mergeOption","timelineOption","getTimelineOption","mediaOptions","getMediaOption","mediaOption","componentsMap","_componentsMap","componentsCount","_componentsCount","newCmptTypes","newCmptTypeMap","replaceMergeMainTypeMap","visitComponent","oldCmptList","mergeMode","Component","tooltipExists","optionsByMainType","cmptsByMainType","cmptsCountByMainType","isSeriesType","ComponentModelClass","extraOpt","__requireNewView","componentOption","mainTypeInReplaceMerge","_seriesIndices","getOption","optInMainType","realLen","metNonInner","setUpdatePayload","_payload","cmpt","cmpts","queryByIdOrName","filterBySubType","findComponents","queryCond","getQueryCond","doFilter","indexAttr","idAttr","nameAttr","ctxForAll_1","cbForAll_1","getSeriesByName","nameStr","oneSeries","getSeriesByType","getSeries","getSeriesCount","rawSeriesIndex","eachRawSeries","eachSeriesByType","eachRawSeriesByType","isSeriesFiltered","_seriesIndicesMap","getCurrentSeriesIndices","filterSeries","newSeriesIndices","seriesRawIdx","componentTypes","isNotTargetSeries","internalField","seriesIndices","airaOption","enabled","mergeTheme","globalDefault","notMergeColorLayer","colorLayer","themeItem","keyMap_1","idOrNameItem","idName","idName_1","replaceMerge","availableMethods","ExtensionAPI","ecInstance","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","coordinateSystems","getCoordinateSystems","register","QUERY_REG","OptionManager","_timelineOptions","_mediaList","_currentMediaIndices","_api","rawOption","dataset","optionBackup","_optionBackup","newParsedOption","parseRawOption","_newBaseOption","timelineOptions","mediaList","mediaDefault","isRecreate","_mediaDefault","timelineModel","getCurrentIndex","ecWidth","ecHeight","indices","applyMediaQuery","indicesEquals","isNew","declaredBaseOption","timelineOnRoot","timeline","timelineOptionsOnRoot","mediaOnRoot","media","hasMedia","hasTimeline","doPreprocess","preProcess","singleMedia","realMap","aspectratio","applicable","matched","operator","realAttr","real","expect","indices1","indices2","POSSIBLE_STYLES","compatEC2ItemStyle","itemStyleOpt","normalItemStyleOpt","emphasisItemStyleOpt","convertNormalEmphasis","optType","useExtend","normalOpt","emphasisOpt","removeEC3NormalStatus","compatTextStyle","labelOptSingle","textPropName","compatEC3CommonStyles","processSeries","seriesOpt","markPoint","markLine","markArea","edgeData","links","edges","categories","mpData","mlData","breadcrumb","levels","leaves","toArr","toObj","globalCompatStyle","isTheme","axes","axisName","axisOpt","axisPointer","parallelOpt","parallelAxisDefault","calendar","calendarOpt","radarOpt","nameGap","axisNameGap","geo","geoOpt","regions","regionObj","timelineOpt","toolboxOpt","feature","featureOpt","tooltip","compatLayoutProperties","LAYOUT_PROPERTIES","COMPATITABLE_COMPONENTS","BAR_ITEM_STYLE_MAP","compatBarItemStyle","oldName","newName","compatPieLabel","alignTo","edgeDistance","compatSunburstState","downplay","blur","compatGraphFocus","focusNodeAdjacency","traverseTree","globalBackwardCompat","seriesType","clipOverflow","clockWise","clockwise","hoverOffset","scaleSize","pointerColor","backgroundStyle","highlightPolicy","mapType","mapLocation","hoverAnimation","dataRange","visualMap","componentName","dataStack","stackInfoMap","stackInfoList","stackInfo","stackResultDimension","getCalculationInfo","stackedOverDimension","stackedDimension","stackedByDimension","isStackedByIndex","setCalculationInfo","calculateStack","targetStackInfo","idxInStack","resultVal","resultNaN","dims","targetData","stackStrategy","modify","v0","byValue","stackedDataRawIndex","getRawIndex","stackedOver","rawIndexOf","getByRawIndex","providerMethods","mountMethods","SourceImpl","dimensionsDetectedCount","metaRawOption","isSourceInstance","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","determineSourceDimensions","sourceHeader","dimensions","createSourceFromSeriesDataOption","cloneSourceShallow","normalizeDimensionsOption","arrayRowsTravelFirst","objectRowsCollectDimensions","colArr","firstIndex","nameMap","rawItem","displayName","exist","shouldRetrieveDataByName","DefaultDataProvider","sourceParam","dimSize","_source","_data","_offset","_dimSize","getSource","getItem","appendData","clean","pure","persistent","provider","methods","getMethodMapKey","getItemForTypedArray","countForTypedArray","fillStorage","fillStorageForTypedArray","rawItemGetter","getRawSourceItemGetter","rawCounter","getRawSourceDataCounter","extent","dimExtent","appendDataSimply","newCol","oldCol","getItemSimply","rawData","rawSourceItemGetterMap","col","countSimply","rawSourceDataCounterMap","getRawValueSimply","property","rawSourceValueGetterMap","getRawSourceValueGetter","retrieveRawValue","getRawDataItem","getStore","getDimensionIndex","getDimensionProperty","DIMENSION_LABEL_REG","DataFormatMixin","getDataParams","getRawValue","rawDataIndex","getName","itemOpt","getItemVisual","userOutput","componentSubType","dimensionNames","fullDimensions","extendParams","getItemModel","dimensionIndex","dimStr","dimLoose","formatTooltip","multipleSeries","normalizeTooltipFormatResult","markupText","markupFragment","frag","createTask","define","Task","_reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","planResult","upTask","_upstream","skip","outputData","__pipeline","currentTask","forceFirstProgress","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","_doReset","_dueEnd","_outputDueEnd","_progress","_dueIndex","progress","_doProgress","outputDueEnd","_settedOutputEnd","unfinished","iterator","_callingProgress","downstream","_downstream","pipe","downTask","_disposed","getUpstream","getDownstream","setOutputEnd","winCount","it","sStep","sCount","modNext","sequentialNext","deprecateLog","throwError","parseDataValue","valueParserMap","getRawValueParser","ORDER_COMPARISON_OP_MAP","lval","rval","lte","gt","gte","FilterOrderComparator","_opFn","_rvalFloat","evaluate","SortOrderComparator","incomparable","isDesc","_resultLT","_incomparable","lvalFloat","rvalFloat","lvalNotNumeric","rvalNotNumeric","lvalIsStr","rvalIsStr","FilterEqualityComparator","isEq","_rval","_isEQ","_rvalTypeof","eqResult","lvalTypeof","createFilterComparator","ExternalSource","getRawData","cloneRawData","cloneAllDimensionInfo","retrieveValue","retrieveValueFromItem","convertValue","rawVal","dimInfo","createExternalSource","internalSource","externalTransform","extSource","sourceHeaderCount","dimsByName","dimDef","dimDefExt","errMsg_1","__isBuiltIn","rawValueGetter","upstream","isSupportedSourceFormat","externalTransformMap","registerExternalTransform","typeParsed","isBuiltIn","applyDataTransform","rawTransOption","sourceList","infoForPrint","pipedTransOption","pipeLen","transOption","applySingleDataTransform","upSourceList","pipeIndex","transType","extUpSourceList","upSource","resultList","upstreamList","resultIndex","resultMetaRawOption","firstUpSource","defaultDimValueGetters","UNDEFINED","CtorUint32Array","CtorUint16Array","CtorInt32Array","CtorFloat64Array","Float64Array","dataCtors","getIndicesCtor","rawCount","getInitialExtent","cloneChunk","originalChunk","prepareStore","dimIdx","append","DataCtor","oldStore","oldLen","newStore","DataStore","_chunks","_rawExtent","_extent","_rawCount","_calcDimNameToIdx","initData","inputDimensions","dimValueGetter","_provider","_indices","_getRawIdxIdentity","defaultGetter","defaultDimValueGetter","_dimValueGetter","_dimensions","_initDataFromProvider","getProvider","ensureCalculationDimension","calcDimNameToIdx","calcDimIdx","collectOrdinalMeta","ordinalMeta","rawExtents","ordinalOffset","dimRawExtent","parseAndCollect","getOrdinalMeta","appendValues","minFillLen","dimLen","rawExtent","emptyDataItem","sourceIdx","arrayRows","dimNames","dimStorage","dimStore","getValues","dimArr","rawIdx","getSum","dimData","getMedian","dimDataArray","sortedDimDataArray","rawIndex","indicesOfNearest","maxDistance","nearestIndices","minDist","minDiff","nearestIndicesLen","getIndices","newIndices","thisCount","buffer","dim0","_updateGetRawIdx","selectRange","originalCount","storeArr","quickFinished","dimStorage2","dimk","_updateDims","targetChunks","tmpRetValue","dataCount","retValue","rawExtentOnDim","lttbDownSample","valueDimension","rate","maxArea","area","nextRawIndex","targetStorage","sampledIndex","frameSize","currentRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","firstNaNIndex","countNaN","_getRawIdx","downSample","dimension","sampleValue","sampleIndex","frameValues","sampleFrameIdx","getDataExtent","initialExtent","currEnd","useRaw","clonedDims","ignoreIndices","clonedDimsMap","_copyCommonProps","_cloneIndices","getDimValueSimply","objectRows","keyedColumns","original","typedArray","SourceManager","sourceHost","_sourceList","_storeList","_upstreamSignList","_versionSignBase","_sourceHost","_setLocalSource","upstreamSignList","_getVersionSign","prepareSource","_isDirty","_createSource","resultSourceList","upSourceMgrList","_getUpstreamSourceManagers","hasUpstream","upSourceMgr","newMetaRawOption","_getSourceMetaRawOption","upMetaRawOption","needsCreateSource","_applyTransform","upMgrList","transformOption","fromTransformResult","doThrow","upMgr","datasetIndex","upSrcMgr","sourceIndex","getSharedDataStore","seriesDimRequest","schema","makeStoreSchema","_innerGetDataStore","hash","storeDims","seriesSource","sourceReadKey","storeList","cachedStoreMap","cachedStore","getSourceManager","disableTransformOptionMerge","TOOLTIP_LINE_HEIGHT_CSS","getTooltipTextStyle","nameFontColor","nameFontSize","nameFontWeight","valueFontColor","valueFontSize","valueFontWeight","nameStyle","valueStyle","HTML_GAPS","RICH_TEXT_GAPS","createTooltipMarkup","isSectionFragment","getBuilder","buildSection","buildNameValue","getBlockGapLevel","gapLevel_1","subBlockLen","blocks","hasInnerGap_1","noHeader","subBlock","subGapLevel","fragment","topMarginForOuterGap","toolTipTextStyle","gaps","getGap","subMarkupTextList","subBlocks","orderMode","sortBlocks","orderMap","valueAsc","valueDesc","comparator_1","sortParam","valueFormatter","subMarkupText","html","richText","wrapBlockHTML","displayableHeader","wrapInlineNameRichText","noName","noValue","noMarker","markerType","valueTypeOption","markerStr","markupStyleCreator","makeTooltipMarker","markerColor","readableName","readableValueList","valueAlignRight","valueCloseToMarker","wrapInlineValueRichText","wrapInlineNameHTML","wrapInlineValueHTML","buildTooltipMarkup","builder","gapLevel","encodedContent","topGap","clearfix","marginCSS","leftHasMarker","marginCss","alignRight","paddingStr","alignCSS","wrapRichTextStyle","retrieveVisualColorForTooltipMarker","visualDrawType","getPaddingFromTooltipModel","TooltipMarkupStyleCreator","richTextStyles","_nextStyleNameId","_generateStyleName","finalStl","defaultSeriesFormatTooltip","inlineValue","inlineValueType","tooltipDims","mapDimensionsAll","tooltipDimLen","isValueArr","formatArrResult","formatTooltipArrayValue","inlineValues","inlineValueTypes","seriesNameSpecified","inlineName","isValueMultipleLine","dimItem","setEachItem","otherDims","getSelectionKey","getId","SERIES_UNIVERSAL_TRANSITION_PROP","SeriesModel","_selectedDataIndicesMap","dataTask","dataTaskCount","dataTaskReset","sourceManager","getInitialData","wrapData","dataBeforeProcessed","autoSeriesName","_initSelectedMapFromData","themeSubType","fillDataTextStyle","newSeriesOption","task","getCurrentTask","getLinkedData","mainData","getLinkedDataAll","getEncode","getColorBy","isColorBySeries","getBaseAxis","coordDimToDataDim","coordDim","getProgressive","getProgressiveThreshold","innerDataIndices","_innerSelect","unselect","selectedMap","selectedMode","nameOrId","toggleSelect","tmpArr","selectedDataIndicesMap","nameOrIds","isUniversalTransitionEnabled","universalTransitionOpt","universalTransition","lastDataIndex","hasItemOption","ignoreStyleOnData","hasSymbolVisual","defaultSymbol","visualStyleAccessPath","getSeriesAutoName","dataDims","nameArr","dataDim","cloneShallow","dataTaskProgress","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","wrapMethod","onDataChange","scheduler","pipeline","getPipeline","agentStubMap","ComponentView","render","updateView","updateLayout","updateVisual","seriesModels","isBlur","eachRendered","createRenderPlanner","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","mathAtan2","transformPath","nPoint","p_1","vMag","vRatio","u","vAngle","processArc","fa","fs","psiDeg","xp","yp","lambda","cxp","cyp","commandReg","numberReg","createPathProxyFromString","prevCmd","cpx","cpy","subpathX","subpathY","cmdList","cmdText","cmdStr","pLen","ctlPtx","ctlPty","pathData","SVGPath","isPathProxy","createPathOptions","innerOpts","createFromString","extendFromString","defaultOpts","mergePath","pathEls","pathList","pathEl","pathBundle","clonePath","sourcePath","bakeTransform","toLocal","CircleShape","Circle","EllipseShape","Ellipse","mathACos","mathATan2","dx10","dy10","dx32","dy32","computeCornerTangents","cr","x01","y01","x11","y11","x10","y10","x00","y00","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","normalizeCornerRadius","innerRadius","hasRadius","hasInnerRadius","mod","icrStart","icrEnd","ocrStart","ocrEnd","ocrs","ocre","icrs","icre","ocrMax","icrMax","limitedOcrMax","limitedIcrMax","xre","yre","xirs","yirs","xrs","yrs","xire","yire","hasArc","cornerRadius","halfRd","it_1","crStart","crEnd","ct0","ct1","SectorShape","Sector","RingShape","Ring","smoothBezier","smooth","isLoop","constraint","prevPoint","nextPoint","cps","point","cp0","cp1","controlPoints","smoothConstraint","cp2","PolygonShape","Polygon","PolylineShape","Polyline","LineShape","Line","pointAt","BezierCurveShape","cpx1","cpy1","someVectorAt","isTangent","cpx2","cpy2","BezierCurve","tangentAt","ArcShape","Arc","unitX","unitY","CompoundPath","_updatePathDirty","paths","dirtyPath","Gradient","addColorStop","LinearGradient","globalCoord","RadialGradient","extent2","OrientedBoundingRect","_corners","_axes","_origin","fromBoundingRect","corners","overlapped","noMtv","_intersectCheckOneSide","axis","_getProjMinMaxOnAxis","dist0","dist1","proj","proj_1","IncrementalDisplayable","notClear","_displayables","_temporaryDisplayables","_cursor","getCursor","clearDisplaybles","clearTemporalDisplayables","addDisplayable","notPersistent","addDisplayables","displayables","getDisplayables","getTemporalDisplayables","eachPendingDisplayable","_customShapeMap","extendShape","extendPathFromString","extendPath","registerShape","ShapeClass","getShapeClass","makePath","layout","centerGraphic","resizePath","makeImage","imageUrl","zrImg","img","boundingRect","pathRect","getTransform","ancestor","mat","invert","transformDirection","hBase","vBase","vertex","isNotGroup","isPath","groupTransition","g1","g2","elMap1","getElMap","anid","oldEl","newProp","getAnimatableProps","elMap","clipPointsByRect","clipRectByRect","targetRect","createIcon","iconStr","linePolygonIntersect","a1x","a1y","a2x","a2y","lineLineIntersect","b1x","b1y","b2x","b2y","mx","my","nx","ny","nmCrossProduct","crossProduct2d","nearZero","b1a1x","b1a1y","setTooltipConfig","itemTooltipOption","itemTooltipOptionObj","formatterParams","formatterParamsExtra","tooltipConfig","traverseElement","traverseElements","els","renderPlanner","ChartView","renderTask","renderTaskPlan","renderTaskReset","highlight","toggleHighlight","markUpdateMethod","updateMethod","elSetState","progressMethodMap","incrementalPrepareRender","incrementalRender","ORIGIN_METHOD","RATE","THROTTLE_TYPE","throttle","debounce","currCall","debounceNextCall","lastCall","lastExec","timer","cbArgs","thisDelay","thisDebounce","debounceDelay","createOrUpdate","fnAttr","throttleType","originFn","lastThrottleType","lastRate","defaultStyleMappers","defaultColorKey","getStyleMapper","stylePath","styleMapper","visualStyleMapper","getDefaultColorKey","colorKey","seriesStyleTask","createOnAllSeries","performRawSeries","styleModel","getStyle","globalStyle","decalOption","setVisual","colorCallback","hasAutoColor","colorPalette","dataEach","dataParams","setItemVisual","sharedModel","dataStyleTask","getVisual","existsStyle","ensureUniqueItemVisual","dataColorPaletteTask","overallReset","paletteScopeGroupByType","colorScope","dataAll","idxMap","fromPalette","defaultLoading","textColor","maskColor","showSpinner","spinnerRadius","labelRect","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","taskRecord","overallTask","getPerformArgs","_pipelineMap","pCtx","progressiveEnabled","__idxInPipeline","blockIndex","pipelineId","updateStreamModes","dataLen","threshold","restorePipelines","pipelineMap","preventIncremental","_pipe","prepareStageTasks","stageTaskMap","record","_createSeriesStageTask","_createOverallStageTask","prepareView","__block","performDataProcessorTasks","_performStageTasks","performVisualTasks","stageHandlers","needSetDirty","setDirty","dirtyMap","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","stub","performArgs_1","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","wrapStageHandler","detectSeriseType","stubProgress","clearAllVisual","resetDefines","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","legacyFunc","ecModelMock","apiMock","mockMethods","Clz","Global","cond","colorAll","contrastColor","axisCommon","axisLine","splitLine","splitArea","minorSplitLine","crossStyle","subtextStyle","iconStyle","brushStyle","handleStyle","moveHandleStyle","fillerColor","dataBackground","selectedDataBackground","controlStyle","dayLabel","monthLabel","yearLabel","timeAxis","logAxis","valueAxis","categoryAxis","axisLabel","color0","borderColor0","ECEventProcessor","cptQuery","dataQuery","otherQuery","condCptType","suffixes_1","dataKeys_1","reserved","propSuffix","suffixPos","eventInfo","packedEvent","filterForExposedEvent","host","propOnHost","SYMBOL_PROPS_WITH_CB","SYMBOL_PROPS","seriesSymbolTask","legendIcon","symbolOptions","symbolOptionsCb","hasCallback","symbolPropName","symbolKeepAspect","symbolPropsCb","dataSymbolTask","getItemVisualFromData","getVisualFromData","setItemVisualFromData","createLegacyDataSelectAction","ecRegisterAction","getSeriesIndices","eventsMap","dispatchAction","handleSeriesLegacySelectEvents","eventPostfix","ecIns","legacyEventName","fromActionPayload","handleLegacySelectEvents","messageCenter","isFromClick","fromAction","findEventDispatcher","returnFirstMatch","found","wmUniqueIndex","supportDefineProperty","WeakMap","_id","_guard","enumerable","configurable","Triangle","Diamond","Pin","tanX","tanY","cpLen","cpLen2","Arrow","symbolCtors","roundRect","square","circle","diamond","pin","arrow","triangle","symbolShapeMakers","symbolBuildProxies","SymbolClz","symbolType","inBundle","proxySymbol","symbolPathSetColor","symbolStyle","__isEmptyBrush","keepAspect","symbolPath","setColor","normalizeSymbolSize","normalizeSymbolOffset","symbolOffset","isSafeNum","createLinearGradient","canvasGradient","createRadialGradient","getCanvasGradient","isClipPathChanged","prevClipPaths","parseInt10","getSize","whIdx","wh","cwh","plt","prb","defaultView","normalizeLineDash","lineType","getLineDash","lineScale_1","pathProxyForDraw","styleHasStroke","isValidStrokeFillStyle","strokeOrFill","styleHasFill","doFillPath","originalGlobalAlpha","globalAlpha","doStrokePath","createCanvasPattern","pattern","canvasPattern","createPattern","repeat","DOMMatrix","setTransform","matrix","translateSelf","rotateSelf","scaleSelf","brushPath","strokePart","firstDraw","dirtyFlag","hasFillGradient","hasStrokeGradient","hasFillPattern","hasStrokePattern","fillGradient","strokeGradient","fillPattern","strokePattern","__canvasFillGradient","__canvasStrokeGradient","__canvasFillPattern","__canvasStrokePattern","fillStyle","strokeStyle","setLineDash","needsRebuild","brushImage","drawImage","brushText","strokeText","fillText","SHADOW_NUMBER_PROPS","STROKE_PROPS","bindCommonProps","prevStyle","forceSetAll","flushPathDrawn","globalCompositeOperation","bindPathAndTextCommonStyle","prevEl","newLineWidth","bindImageStyle","setContextTransform","updateClipStatus","allClipped","isTransformChanged","m0","DRAW_TYPE_PATH","DRAW_TYPE_IMAGE","DRAW_TYPE_TEXT","DRAW_TYPE_INCREMENTAL","canPathBatch","batchFill","batchStroke","brushSingle","isLast","__isRendered","prevElClipPaths","forceSetTransform","forceSetStyle","save","canBatchPath","lastDrawType","brushIncremental","temporalDisplayables","innerScope","i_1","len_1","decalMap","decalCache","decalKeys","createOrUpdatePatternFromDecal","decalObject","getDevicePixelRatio","getZr","isSVG","oldPattern","decalOpt","maxTileWidth","maxTileHeight","setPatternnSource","isValidKey","cache","normalizeDashArrayX","normalizeDashArrayY","symbolArray","normalizeSymbolArray","lineBlockLengthsX","getLineBlockLengthX","lineBlockLengthY","getLineBlockLengthY","svgRoot","tag","attrs","pSize","getPatternSize","xlen","symbolRepeats","brushDecal","clearRect","fillRect","ySum","yId","yIdTotal","xId0","symbolYId","xId1","xId1Total","xSum","top_1","symbolXId","brushSymbol","symbolVNode","renderOneToVNode","svgWidth","svgHeight","isAllString","dash","dashValue","isAllNumber","dashValue_1","blockLength","decalVisual","hasItemVisual","lifecycle","implsStore","registerImpl","impl","TEST_FRAME_REMAIN_TIME","PRIORITY_PROCESSOR_SERIES_FILTER","PRIORITY_PROCESSOR_DATASTACK","PRIORITY_PROCESSOR_FILTER","PRIORITY_PROCESSOR_DEFAULT","PRIORITY_PROCESSOR_STATISTIC","PRIORITY_VISUAL_LAYOUT","PRIORITY_VISUAL_PROGRESSIVE_LAYOUT","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART","PRIORITY_VISUAL_COMPONENT","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY_VISUAL_POST_CHART_LAYOUT","PRIORITY_VISUAL_BRUSH","PRIORITY_VISUAL_ARIA","PRIORITY_VISUAL_DECAL","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","IN_MAIN_PROCESS_KEY","PENDING_UPDATE","STATUS_NEEDS_UPDATE_KEY","ACTION_REG","CONNECT_STATUS_KEY","CONNECT_STATUS_PENDING","CONNECT_STATUS_UPDATING","CONNECT_STATUS_UPDATED","createRegisterEventWithLowercaseECharts","isDisposed","toLowercaseNameAndCallEventful","disposedWarning","createRegisterEventWithLowercaseMessageCenter","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","renderComponents","renderSeries","createExtensionAPI","enableConnect","markStatusToUpdate","applyChangedStates","MessageCenter","messageCenterProto","ECharts","_chartsViews","_chartsMap","_componentsViews","_pendingActions","themeStorage","_dom","defaultRenderer","defaultCoarsePointer","defaultUseDirtyRect","_zr","_ssr","_throttledZrFlush","_coordSysMgr","CoordinateSystem","prioritySortFunc","__prio","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_initEvents","_onframe","updateParams","remainTime","_model","startTime","getDom","isSSR","notMerge","lazyUpdate","transitionOpt","seriesTransition","setTheme","getRenderedCanvas","renderToCanvas","pixelRatio","renderToSVGString","renderToString","useViewBox","getSvgDataURL","toDataURL","getDataURL","excludeComponents","excludesComponentViews","__viewId","getConnectedDataURL","isSvg","groupId","MAX_NUMBER","connectedGroups","left_1","right_1","bottom_1","canvasList_1","dpr_1","chart","getSvgDom","innerHTML","targetCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","convertToPixel","convertFromPixel","containPixel","findResult","containPoint","parsedFinder","MOUSE_EVENT_NAMES","eveName","isGlobalOut","dataModel","eventData","eventActionMap","actionType","DOM_ATTRIBUTE_KEY","_loadingFX","needPrepare","showLoading","hideLoading","loadingEffects","makeActionFromEvent","eventObj","actions","updateLabelLayout","updatedSeries","allocateZlevels","componentZLevels","seriesZLevels","hasSeperateZLevel","zlevelKey","lastSeriesZLevel_1","lastSeriesKey_1","zLevels","applyElementStates","newStates","updateHoverLayerStatus","elCount","preventUsingHoverLayer","chartView","__alive","updateBlend","updateZ","preventAutoZ","doUpdateZ","maxZ2","labelLine","textGuideLineConfig","showAbove","prevStates","updateStates","stateAnimationModel","enableAnimation","isComponent","viewList","viewMap","doPrepare","requireNewView","viewId","classType","Clazz","Chart","__id","__model","__ecComponentInfo","excludeSeriesIdMap","excludeSeriesId","modelId","isExcluded","Series","notBlur","callView","prepareAndUpdate","coordSysMgr","componentDirtyList","componentView","seriesDirtyMap","coordSysList","chartsMap","escapeConnect","actionWrap","actionInfo","cptTypeTmp","cptType","payloads","batched","batch","eventObjBatch","isSelectChange","isHighDown","batchItem","newObj","pendingActions","dirtyList","getComponentByElement","modelInfo","updateConnectedChartsStatus","charts","otherChart","action_1","otherCharts_1","echartsProto","one","wrapped","args2","idBase","isClient","existInstance","getInstanceByDom","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","priority","processor","normalizeRegister","registerPostInit","postInitFunc","registerUpdateLifecycle","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","registerLayout","layoutTask","registerVisual","visualTask","registeredTasks","targetList","defaultPriority","__raw","registerLoading","loadingFx","registerMap","mapName","geoJson","specialAreas","registerTransform","light","dark","extensions","extensionRegisters","registerComponentModel","registerComponentView","ComponentViewClass","registerSeriesModel","SeriesModelClass","registerChartView","ChartViewClass","painterType","PainterCtor","use","ext","singleExt","install","DEFAULT_SEARCH_SPACE","getCandidateAnchor","outPt","outDir","projectPointToArc","projectPointToLine","limitToEnds","lineLen","projectedLen","projectPointToRect","tmpPt","nearestPointOnRect","pt","nearestPointOnPath","pt0","pt1","pt2","dir2","updateLabelLinePoints","labelLineModel","labelGuideConfig","searchSpace","anchorPoint","anchor","targetTransform","targetInversedTransform","candidate","limitTurnAngle","tmpProjPoint","linePoints","minTurnAngle","angleCos","minTurnAngleCos","limitSurfaceAngle","surfaceNormal","maxSurfaceAngle","maxSurfaceAngleCos","HALF_PI","angle2","newAngle","setLabelLineState","isNormal","styleObj","buildLabelLinePath","moveLen","midPoint0","midPoint2","midPoint1","setLabelLineStyle","labelIgnoreNormal","isLabelIgnored","labelLineConfig","getLabelLineStatesModels","labelLineName","prepareLayoutList","defaultAttr","localRect","isAxisAligned","minMargin","globalRect","obb","layoutOption","computedLayoutOption","axisAligned","shiftLayout","xyDim","sizeDim","minBound","maxBound","balanceShift","lastPos","adjusted","shifts","totalShifts","shiftList","minGap","maxGap","first","updateMinMaxGap","squeezeGaps","takeBoundsGap","squeezeWhenBailout","gapThisBound","gapOtherBound","moveDir","moveFromMaxGap","remained","maxSqeezePercent","totalGaps","prevItemRect","squeezePercent","movement","moveForEachLabel","shiftLayoutOnX","leftBound","rightBound","shiftLayoutOnY","topBound","bottomBound","hideOverlap","labelList","displayedLabels","hideEl","emphasisState","labelItem","existsTextCfg","labelGuideIgnore","cloneArr","newPoints","prepareLayoutCallbackParams","hostRect","labelLinePoints","LABEL_OPTION_TO_STYLE_KEYS","dummyTransformable","labelLayoutInnerStore","labelLineAnimationStore","extendWithKeys","LABEL_LAYOUT_PROPS","LabelManager","_labelList","_chartViewList","clearLabels","_addLabel","labelStyle","labelTransform","labelGuide","attachedPos","attachedRot","addLabelsOfSeries","disableLabelLayout","updateLayoutConfig","createDragHandler","defaultLabelAttr","degreeToRadian","needsUpdateLabelLine","labelLayoutStore","hostModel","labelsNeedsAdjustOnX","moveOverlap","labelsNeedsAdjustOnY","labelsNeedsHideOverlap","processLabelsOverall","ignoreLabelLineUpdate","forceLabelAnimation","_updateLabelLine","_animateLabels","visualStyle","disableLabelAnimation","layoutStore","oldLayout","newProps","oldLayoutSelect","oldLayoutEmphasis","oldOpacity","layoutSelect","layoutEmphasis","newLayout","getLabelManager","installLabelLayout","registers","labelManager","createDom","newDom","newDomStyle","Layer","motionBlur","lastFrameAlpha","virtual","maxRepaintRectCount","__firstTimePaint","__used","__drawIndex","__startIndex","__endIndex","__prevStartIndex","__prevEndIndex","onselectstart","getElementCount","initContext","setUnpainted","createBackBuffer","domBack","ctxBack","createRepaintRects","prevList","hasIntersections","mergedRepaintRects","full","pendingRect","addRectToMergePool","isMerged","minDeltaArea","bestRectToMergeIdx","mergedRect","pendingRect_1","aArea","bArea","pendingArea","deltaArea","shouldPaint","prevRect","curRect","_paintRects","debugGetPaintRects","clearAll","clearColor","repaintRects","haveMotionBLur","doClear","clearColorGradientOrPattern","shouldCache","__width","__height","__canvasGradient","__painter","HOVER_LAYER_ZLEVEL","CANVAS_ZLEVEL","EL_AFTER_INCREMENTAL_INC","INCREMENTAL_INC","isLayerValid","__builtin__","createRoot","domRoot","CanvasPainter","_zlevelList","_prevDisplayList","_layers","_layerConfig","_needsManuallyCompositing","singleCanvas","_opts","_singleCanvas","rootStyle","zlevelList","layers","rootCanvas","_width","_height","mainLayer","_domRoot","isSingleCanvas","getViewportRootOffset","viewportRoot","paintAll","_redrawId","_paintList","_paintHoverList","_hoverlayer","getLayer","getHoverLayer","paintOne","redrawId","_updateLayerStatus","_doPaintList","needsRefreshHover","_compositeManually","eachLayer","self_1","eachBuiltinLayer","layerList","zi","_loop_1","this_1","useTimer","now","firstEl","repaint","repaintRect","_doPaintEl","dTime","draw","currentLayer","insertLayer","layersMap","prevLayer","prevDom","insertBefore","firstChild","getLayers","updatePrevLayer","prevZlevel","incrementalLayerCount","_clearLayer","layerConfig","_zlevel","delLayer","clearLayer","imageLayer","width_1","height_1","degree","SVGPathRebuilder","_start","_str","_p","_add","dThetaPositive","isCircle","unifiedTheta","xRot","dTheta_1","vals","generateStr","getStr","NONE","pathHasFill","pathHasStroke","strokeProps","svgStrokeProps","mapStyleToAttrs","updateAttr","strokeScale","strokeWidth","SVGNS","XLINKNS","XMLNS","XML_NAMESPACE","createElementNS","createVNode","createElementOpen","attrsStr","part","createElementClose","vNodeToString","convertElToString","getCssString","selectorNodes","animationNodes","bracketBegin","bracketEnd","selectors","className","attrName","animations","animationName","createBrushScope","zrId","shadowCache","patternCache","gradientCache","clipPathCache","defs","cssNodes","cssAnims","cssClassIdx","cssAnimIdx","shadowIdx","gradientIdx","patternIdx","clipPathIdx","createSVGVNode","EASING_MAP","transformOriginKey","buildPathString","kfShape","svgPathBuilder","setTransformOrigin","ANIMATE_STYLE_MAP","addAnimation","cssAnim","createCompoundPathCSSAnimation","cssAnimationCfg","cssAnimationName","composedAnim","subScope","createCSSAnimation","animNames","lastAnim","getEasingFunc","onlyShape","cssAnimations","groupAnimators","cfgArr","createSingleCSSAnimation","groupAnimator","transformKfs","shapeKfs","finalKfs","animationTimingFunctionAttrName","saveAnimatorTrackToCssKfs","cssKfs","toCssAttrName","kfEasing","timingFunction","canAnimateShape","newLen","transformOrigin","percents","allTransformOriginSame","isCanvasLike","setStyleAttrs","isFillStroke","setGradient","setPattern","setShadow","noRotateScale","noTranslate","compress","mul","convertPolyShape","strArr","validatePolyShape","createAttrsConvert","normalizedDesc","builtinShapesDef","polyline","hasShapeAnimation","brushSVGPath","builtinShpDef","svgElType","willUpdate","needBuildPath","pathVersion","elExt","__svgPathBuilder","__svgPathVersion","__svgPathStrokePercent","brushSVGImage","dw","dh","brushSVGTSpan","separatedFontStr","shadowKey","shadowId","blur_1","stdDx","stdDy","stdDeviation","gradientTag","gradientAttrs","stopColor","stopsAttrs","gradientVNode","gradientKey","gradientId","patternAttrs","noRepeat","repeatX","repeatY","imageWidth_1","imageWidth","imageHeight_1","imageHeight","imageSrc","patternImage","setSizeToVNode_1","vNode","svgEl","elm","createdImage","patternVNode","patternWidth","patternHeight","patternUnits","patternTransform","patternKey","patternId","clipPathId","clipPathAttrs","createTextNode","newNode","referenceNode","colonChar","xChar","emptyNode","isUndef","isDef","createKeyToOldIdx","beginIdx","endIdx","sameVnode","vnode1","vnode2","isSameKey","isSameTag","createElm","updateAttrs","addVnodes","parentElm","before","vnodes","startIdx","removeVnodes","oldVnode","oldAttrs","cur","removeAttribute","setAttributeNS","updateChildren","oldCh","newCh","oldKeyToIdx","idxInOld","elmToMove","oldStartIdx","newStartIdx","oldEndIdx","oldStartVnode","oldEndVnode","newEndIdx","newStartVnode","newEndVnode","patchVnode","patch","parent_2","svgId","SVGPainter","createMethodNotSupport","_oldVNode","viewport","_viewport","svgDom","_svgDom","renderToVNode","bgVNode","_bgVNode","createBackgroundVNode","mainVNode","_mainVNode","animationCssStr","styleNode","cssAnimation","currentClipPathGroup","listLen","clipPathsGroupsStack","clipPathsGroupsStackDepth","clipGroupNodeIdx","prevLen","lca","i_2","groupAttrs","viewportStyle","bgEl","base64","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","updateManyToMany","_updateManyToMany","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","newKey","idxMapValLen","keyArr","keyGetterName","cbModeMultiple","idxMapVal","DimensionUserOuput","dimRequest","_encode","_schema","_getFullDimensionNames","_cachedDimNames","makeOutputDimensionNames","summarizeDimensions","summary","notExtraCoordDimMap","defaultedLabel","defaultedTooltip","userOutputEncode","coordDimIndex","getOrCreateEncodeArr","isExtraCoord","mayLabelDimType","defaultTooltip","encodeArr","dataDimsOnCoord","encodeFirstDimNotExtra","dataDimIndicesOnCoord","storeDimIndex","encodeLabel","encodeTooltip","getDimensionTypeByAxis","axisType","SeriesDimensionDefine","dimTypeShort","float","int","ordinal","number","SeriesDataSchema","_dimOmitted","dimensionOmitted","_fullDimCount","fullDimensionCount","_updateDimOmitted","isDimensionOmitted","_dimNameMap","ensureSourceDimNameMap","getSourceDimensionIndex","getSourceDimension","willRetrieveDataByName","makeHashStrict","shouldOmitUnusedDimensions","dimHash","fullDimIdx","seriesDimIdx","seriesDimDef","sourceDimDef","isCalculationCoord","appendCalculationDimension","isSeriesDataSchema","createDimNameMap","dataDimNameMap","dimDefItemRaw","userDimName","innerSource","dimNameMap","prepareInvertedIndex","getIdNameFromStore","normalizeDimensions","transferProperties","cloneListForMapAndSample","makeIdFromName","ID_PREFIX","INDEX_NOT_FOUND","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","SeriesData","dimensionsInput","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_approximateExtent","_calculationInfo","TRANSFERABLE_METHODS","assignStoreDimIdx","dimensionInfos","invertedIndicesMap","needsHasOwn","emptyObj","dimInfoInput","dimensionInfo","dimensionName","createInvertedIndices","_nameDimIdx","itemId","_idDimIdx","_dimInfos","_initGetDimensionInfo","_invertedIndicesMap","dimIdxToName_1","_dimIdxToName","getDimension","_recognizeDimIndex","_getDimInfo","_getStoreDimIndex","getDimensionsOnCoord","_dimSummary","mapDimension","dimensionsSummary","_store","nameList","_nameRepeatCount","_doInit","shouldMakeIdFromName","_shouldMakeIdFromName","_updateOrdinalMeta","idList","isFormatOriginal","sharedDataItem","getApproximateExtent","setApproximateExtent","_getCategory","invertedIndices","fCtx","dimIndices","filterSelf","innerRange","mapArray","ctxCompat","otherList","thisList","visual","kvObj","itemVisual","itemVisuals","setLayout","getLayout","getItemLayout","setItemLayout","clearItemLayouts","setItemGraphicEl","injectFunction","originalMethod","__wrappedMethods","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","prepareSeriesDataSchema","sysDims","coordDimNameMap","getDimCount","dimensionsCount","omitUnusedDimensions","canOmitUnusedDimensions","isUsingSourceDimensionsDef","encodeDef","encodeDefine","encodeDefaulter","encodeDefMap","indicesMap","getResultItem","dataDimsRaw","validDataDims","resultDimIdxOrName","resultDimIdx","applyDim","availDimIdx","sysDimItemRaw","sysDimItemDimsDef","sysDimItemOtherDims","sysDimItem","sysDimItemDimsDefItem","generateCoord","generateCoordCount","fromZero","ifNoNameFillWithCoordName","item0","item1","genCoordDimName","removeDuplication","duplicationMap","dimOriginalName","optDimCount","CoordSysInfo","coordSysName","coordSysDims","axisMap","categoryAxisMap","getCoordSysInfoBySeries","fetch","fetchers","cartesian2d","xAxisModel","yAxisModel","isCategory","firstCategoryDimIndex","singleAxis","singleAxisModel","polar","polarModel","radiusAxisModel","findAxisModel","angleAxisModel","parallelModel","parallelAxisIndex","axisIndex","axisModel","axisDim","enableDataStack","dimensionDefineList","byIndex","stackedCoordDimension","isLegacyDimensionsInput","stackedByDimInfo","stackedDimInfo","mayStack","stackedDimCoordDim_1","stackedDimType","stackedDimCoordIndex_1","stackedOverDimensionDefine","stackResultDimensionDefine","isDimensionStacked","stackedDim","getStackedDimension","targetDim","getCoordSysDimDefs","coordSysInfo","coordSysDimDefs","registeredCoordSys","getDimensionsInfo","injectOrdinalMeta","dimInfoList","hasNameEncode","categoryAxisModel","createSeriesData","sourceRaw","isOriginalSource","useEncodeDefaulter","createDimensionOptions","stackCalculationInfo","isNeedCompleteOrdinalData","sampleItem","firstDataNotNull","LineSeriesModel","getLegendIcon","itemHeight","itemWidth","visualRotate","symbolRotate","iconRotate","legendHoverLink","endLabel","smoothMonotone","showSymbol","showAllSymbol","connectNulls","sampling","divideShape","triggerLineEvent","getDefaultLabel","labelDims","getDefaultInterpolatedLabel","seriesScope","updateData","_createSymbol","driftSymbol","_symbolType","stopSymbolAnimation","toLastFrame","getSymbolType","getSymbolPath","setZ","setDraggable","hasCursorOption","getSymbolSize","disableAnimation","_updateCommon","_sizeX","_sizeY","emphasisItemStyle","blurItemStyle","selectItemStyle","emphasisDisabled","hoverScale","emphasisModel","visualColor","pathStyle","symbolInnerColor","liftZ","z2Origin","_z2","useNameLabel","getLabelDefaultText","scaleRatio","setSymbolScale","fadeOut","animationOpt","fadeLabel","symbolNeedsDraw","isIgnore","clipShape","normalizeUpdateOpt","makeSeriesScope","SymbolDraw","SymbolCtor","_SymbolCtor","_progressiveEls","oldData","symbolUpdateOpt","getSymbolPoint","symbolEl","oldIdx","newSymbolType","oldSymbolType","_getSymbolPoint","incrementalPrepareUpdate","_seriesScope","incrementalUpdate","taskParams","updateIncrementalAndHover","prepareDataCoordInfo","valueOrigin","baseAxis","getOtherAxis","valueStart","getValueStart","baseAxisDim","valueAxisDim","valueDim","baseDim","baseDataOffset","stacked","stackResultDim","dataDimsForPoint","getExtent","getStackedOnPoint","dataCoordInfo","stackedData","dataToPoint","supportFloat32Array","Float32ArrayCtor","createFloat32Array","arg","diffData","diffResult","idx1","lineAnimationDiff","oldStackedOnPoints","newStackedOnPoints","oldCoordSys","newCoordSys","oldValueOrigin","newValueOrigin","currPoints","nextPoints","currStackedPoints","nextStackedPoints","sortedIndices","rawIndices","newDataOldCoordInfo","oldPoints","diffItem","pointAdded","oldIdx2","newIdx2","currentX","currentY","newDataDimsForPoint","oldPt","stackedOnPoint","sortedCurrPoints","sortedNextPoints","sortedCurrStackedPoints","sortedNextStackedPoints","sortedStatus","i2","idx2","stackedOnCurrent","stackedOnNext","isPointNull","drawSegment","segLen","allLen","prevX","prevY","cpx0","cpy0","tmpK","ratioNextSeg","nextCpx0","nextCpy0","lenPrevSeg","lenNextSeg","dir_1","dir_2","ECPolylineShape","ECPolyline","getPointOn","xOrY","isDimX","nRoot","t_1","ECPolygonShape","ECPolygon","stackedOnPoints","stackedOnSmooth","createGridClipPath","cartesian","hasAnimation","getArea","isAxisInversed","duringCb","createPolarClipPath","sectorArea","isRadial","createClipPath","isCoordinateSystemType","isPointsSame","points1","points2","bboxFromPoints","minX","minY","getBoundingDiff","min1","max1","getSmooth","getStackedOnPoints","turnPointsIntoStep","stepTurnAt","baseIndex","stepPoints","stepPt","nextPt","filteredPoints","stepPt2","clipColorStops","prevOutOfRangeColorStop","prevInRangeColorStop","newColorStops","lerpStop","stop0","stop1","clippedCoord","coord0","stop_1","getVisualGradient","visualMetaList","visualMeta","getAxis","stops","toGlobalCoord","dataToCoord","stopLen","outerColors","colorStopsInRange","inRangeStopLen","tinyExtent","minCoord","maxCoord","coordSpan","gradient","getIsIgnoreFunc","isAuto","getAxesByScale","canShowAllSymbolForCategory","categoryDataDim","labelMap","getViewLabels","ordinalNumber","getRawOrdinalNumber","tickValue","axisExtent","availSize","getLastIndexNotNull","getPointAtIndex","getIndexRange","prevIndex","anyStateShowEndLabel","createLineClipPath","lineView","endLabelModel_1","valueAnimation_1","data_1","labelAnimationRecord_1","lastFrameIndex","clipRect","_endLabelOnDuring","_endLabel","originalX","originalY","expandSize","getEndLabelStateSpecified","endLabelModel","isBaseInversed","LineView","lineGroup","symbolDraw","_symbolDraw","_lineGroup","lineStyleModel","areaStyleModel","isCoordSysPolar","prevCoordSys","_coordSys","_polyline","_polygon","isAreaChart","isIgnoreFunc","__temp","clipShapeForSymbol","_clipShapeForSymbol","_step","_newPolygon","_initOrUpdateEndLabel","oldClipPath","newClipPath","_stackedOnPoints","_points","_doUpdateAnimation","_initSymbolLabelAnimation","_newPolyline","lineJoin","emphasisLineStyle","stackedOnSeries","changePolyState","_changePolyState","_valueOrigin","packEventData","symbolLabel","isHorizontalOrRadial","isAxisInverse","seriesDuration","seriesDelay","seriesDelayValue","polarClip","pointToCoord","gridClip","ratio","data_2","animationRecord","distanceX","distanceY","dataIndexRange","endValue","__points","updatedDataInfo","diffStatus","ptIdx","pointsLayout","forceStoreInTypedArray","useTypedArray","dimIdx0","dimIdx1","tmpIn","tmpOut","samplers","average","nearest","indexSampler","dataSample","sampler","LineSeries","STACK_PREFIX","getSeriesStackId","getAxisKey","getLayoutOnAxis","axisKey","bandWidth","getBandWidth","stackId","widthAndOffsets","doCalBarWidthAndOffset","offsetCenter","prepareLayoutBarSeries","isOnCartesian","getValueAxesMinGaps","barSeries","axisValues","cnt","axisMinGaps","valuesInAxis","makeColumnLayout","seriesInfoList","extentSpan","scaleSpan","barWidth","barMaxWidth","barMinWidth","isInLargeMode","barGap","barCategoryGap","columnsMap","seriesInfo","columnsOnAxis","autoWidthCount","categoryGap","stacks","minWidth","categoryGapPercent","columnCount","barGapPercent","autoWidth","column","finalWidth","lastColumn","widthSum","retrieveColumnLayout","barWidthAndOffset","columnLayoutInfo","columnOffset","columnWidth","createProgressiveLayout","valueDimIdx","baseDimIdx","drawBackground","isValueAxisH","valueAxisStart","getValueAxisStart","isLarge","barMinHeight","stackedDimIdx","largePoints","largeBackgroundPoints","largeDataIndices","coordLayout","getRect","bgSize","idxOffset","baseValue","baseCoord","startCoord","valueAxisHorizontal","BaseBarSeriesModel","getMarkerPosition","startingAtTick","clampData","clampData_1","pt_1","getAxes","tickCoords","getTicksCoords","targetTickId","isEnd","leftCoord","stepTickValue","tickCoord","offsetIndex","barMinAngle","largeThreshold","progressiveChunkMode","BarSeriesModel","brushSelector","BaseBarSeries","roundCap","showBackground","realtimeSort","SausageShape","SausagePath","dr","rCenter","lessThanCircle","unitStartX","unitStartY","unitEndX","unitEndY","createSectorCalculateTextPosition","positionMapping","isRoundCap","mappedSectorPosition","sector","middleR","middleAngle","extraDist","adjustAngleDistanceX","adjustAngleDistanceY","setSectorTextRotation","rotateType","anchorAngle","getSectorCornerRadius","zeroIfNull","getClipArea","coordSysClipArea","onBand","expandWidth","BarView","_isFirstFrame","_removeOnRenderedListener","_updateDrawMode","coordinateSystemType","_isLargeDraw","_renderLarge","_renderNormal","_clear","_updateLargeClip","_incrementalRenderLarge","isLargeDraw","animationModel","realtimeSortCfg","shouldRealtimeSort","_enableRealtimeSort","needsClip","backgroundModel","barBorderRadius","bgEls","oldBgEls","_backgroundEls","isInitSort","isChangeOrder","createBackground","bgLayout","createBackgroundEl","isValidLayout","isClipped","elementCreator","updateStyle","updateRealtimeAnimation","newIndex","oldIndex","createBackgroundShape","bgGroup","_backgroundGroup","createLarge","_removeBackground","_dispatchInitSort","orderMapping_1","_onRendered","_updateSortWithinSameData","_dataSort","orderMapping","mappedValue","ordinalNumbers","_isOrderChangedWithinSameData","ordinalDataDim","tickNum","MIN_VALUE","_isOrderDifferentInView","orderInfo","tickMax","sortInfo","axisId","sortResult","otherAxis","coordSysBoundingRect","signWidth","signHeight","coordSysX2","coordSysY2","xClipped","yClipped","signR","clipped","__dataIndex","animateProperty","positionMap","createPolarPositionMapping","sectorShape","animateTarget","realtimeSortOption","seriesAnimationModel","seriesTarget","axisTarget","axisAnimationModel","checkPropertiesNotValid","rectPropties","polarPropties","fixedLineWidth","getLineWidth","signX","signY","isZeroOnPolar","arcOrAngle","isPolar","labelPositionOutside","rawLayout","LagePathShape","LargePath","startPoint","progressiveEls","bgPoints","largePathUpdateDataIndex","largePath","largePathFindDataIndex","ElementClz","BarSeries","setCategorySortInfo","RADIAN","getViewRect","getBasicPieLayout","pieLayout","minAngle","validDataCount","unitRadian","roseType","stillShowZeroSum","restAngle","valueSumLargerThanMinAngle","currentAngle","angle_1","layout_1","layout_2","dataFilter","legendModels","adjustSingleSide","viewLeft","viewTop","farthestX","labelAlignTo","recalculateX","recalculateXOnSemiToAlignOnEllipseCurve","semi","rB","rB2","rA","rA2","newX","newTargetWidth","targetTextWidth","constrainTextWidth","items","topSemi","bottomSemi","avoidOverlap","labelLayoutList","leftList","rightList","leftmostX","rightmostX","isPositionCenter","labelStyleWidth","bleedMargin","isAlignToEdge","extraPaddingH","realTextWidth","availableWidth","forceRecalculate","textRect","bgColor","oldOuterWidth","oldHeight","innerRect","availableInnerWidth","newWidth","unconstrainedWidth","newRect","pieLabelLayout","hasLabelRotate","minShowLabelRadian","setNotShow","isLabelShown","labelModel","labelLineLen","labelLineLen2","midAngle","isLabelInside","radialAngle","isDown","notShowLabel","PiePiece","firstCreate","_updateLabel","visualOpacity","PieView","_emptyCircleSector","piePiece","itemLayout","createSeriesDataSimply","LegendVisualProvider","getDataWithEncodedVisual","_getDataWithEncodedVisual","_getRawData","getAllNames","containName","dataWithEncodedVisual","innerData","PieSeriesModel","legendVisualProvider","_defaultLabelLine","dataInner","valueList_1","labelLineNormalOpt","labelLineEmphasisOpt","minShowLabelAngle","selectedOffset","percentPrecision","distanceToLabelLine","borderJoin","showEmptyCircle","emptyCircleStyle","labelLayout","avoidLabelOverlap","animationTypeUpdate","negativeDataFilter","curValue","PieSeries","ScatterSeriesModel","BOOST_SIZE_THRESHOLD","LargeSymbolPathShape","LargeSymbolPath","_off","hoverDataIdx","symbolProxy","symbolProxyShape","canBoost","softClipShape","findDataIndex","LargeSymbolDraw","_create","_setCommon","endIndex","byteOffset","lastAdded","_newAdded","extrudeShadow","ScatterView","_updateSymbolDraw","_getClipShape","clipArea","GridModel","containLabel","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","nameLocation","nameRotate","nameTruncate","nameTextStyle","triggerEvent","onZero","onZeroAxisIndex","axisTick","showMinLabel","showMaxLabel","boundaryGap","deduplication","alignWithLabel","splitNumber","minorTick","primary","logBase","category","uidBase","OrdinalMeta","_needCollect","needCollect","_deduplication","createByAxisModel","dedplication","getOrdinal","_getOrCreateMap","AXIS_TYPES","axisModelCreator","BaseAxisModelClass","extraDefaultOption","axisDefault","AxisModel","getAxisType","thisOption","__ordinalMeta","getCategories","Scale","setting","_setting","getSetting","unionExtent","unionExtentFromData","setExtent","thisExtent","isInExtentRange","isBlank","_isBlank","setBlank","isIntervalOrLogScale","intervalScaleNiceTicks","minInterval","maxInterval","span","intervalPrecision","getIntervalPrecision","niceTickExtent","fixExtent","increaseInterval","OrdinalScale","_ordinalMeta","_getTickNumber","getTicks","ticks","getMinorTicks","setSortInfo","infoOrdinalNumbers","ordinalsByTick","_ordinalNumbersByTick","ticksByOrdinal","_ticksByOrdinalNumber","allCategoryLen","unusedOrdinal","ticksByOrdinalNumber","tickNumber","ordinalNumbersByTick","getLabel","cateogry","calcNiceTicks","calcNiceExtent","roundNumber","IntervalScale","_interval","_intervalPrecision","getInterval","setInterval","_niceExtent","expandToNicedExtent","safeLimit","lastNiceTick","minorTicks","nextTick","prevTick","minorTicksGroup","minorInterval","dataNum","fixMax","fixMin","setNiceExtent","bisect","TimeScale","settings","_minLevelUnit","labelFormatter","innerTicks","getIntervalTicks","_approxInterval","getFullYear","getMonth","getDate","approxTickNum","scaleIntervalsLen","scaleIntervals","Interval","isUnitValueSame","valueA","valueB","dateA","dateB","isSame","isSameYear","isSameMonth","isSameDay","isSameHour","isSameMinute","isSameSecond","isSameMilliSecond","getDateInterval","approxInterval","daysInMonth","getMonthInterval","APPROX_ONE_MONTH","getHourInterval","getMinutesAndSecondsInterval","isMinutes","getMillisecondsInterval","getFirstTimestampOfUnit","unitName","outDate","bottomUnitName","unitNames","iter","addTicksInSpan","minTimestamp","maxTimestamp","getMethodName","setMethodName","isDate","dateTime","notAdd","addLevelTicks","lastLevelTicks","levelTicks","newAddedTicks","isFirstLevel","startTick","endTick","getterName","setterName","levelsTicks","currentLevelTicks","tickCount","lastLevelTickCount","primaryTimeUnit","nextPrimaryTimeUnit","levelTicksRemoveDuplicated","targetTickNum","levelsTicksInExtent","maxLevel","scaleProto","intervalScaleProto","roundingErrorFix","mathFloor","mathCeil","mathLog","LogScale","_originalScale","originalScale","originalExtent","powVal","_fixMin","fixRoundingError","_fixMax","niceExtent","originalVal","ScaleRawExtentInfo","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","dataMin","dataMax","axisDataLen","boundaryGapInner","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","frozen","ensureScaleRawExtentInfo","rawExtentInfo","minMax","getScaleExtent","scaleType","rawExtentResult","barSeriesModels","isBaseAxisAndHasBarSeries_1","adjustedScale","adjustScaleForOverflow","axisLength","barsOnCurrentAxis","minOverflow","maxOverflow","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","inModel","extentInfo","Log","isIntervalOrTime","createScaleByModel","Ordinal","Time","ifAxisCrossZero","makeLabelFormatter","getLabelModel","categoryTickStart","getAxisRawValue","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","unrotatedSingleRect","singleRect","rotateTextRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","unionAxisExtentFromData","seriesExtent","Cartesian","_dimList","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","axisX","axisY","toLocalCoord","containData","containZone","data1","data2","zoneDiag1","zoneDiag2","zone","xVal","yVal","xAxis","yAxis","xScale","yScale","xAxisExtent","yAxisExtent","pointToData","coordToData","xExtent","getGlobalExtent","yExtent","createAxisLabels","makeCategoryLabels","makeRealNumberLabels","createAxisTicks","tickModel","makeCategoryTicks","makeCategoryLabelsActually","labels","labelCategoryInterval","numericLabelInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","tickCategoryInterval","ticksCache","optionTickInterval","labelsResult","formattedLabel","rawLabel","autoInterval","calculateCategoryInterval","fetchAutoCategoryIntervalCalculationParams","axisRotate","ordinalScale","ordinalExtent","unitSpan","unitW","unitH","maxW","maxH","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","getRotate","categoryInterval","onlyTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","fixExtentWithBands","getTickModel","ticksCoords","tickVal","fixOnBandTicksCoords","getMinorTicksCoords","minorTickModel","minorTicksCoords","nTick","ticksLen","diffSize","crossLen","shift_1","ticksItem","Axis2D","coordExtent","categorySortInfo","gridModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","axisPosition","rectBound","axisOffset","posBound","onZeroCoord","dirMap","labelDirection","tickDirection","nameDirection","labelInside","isCartesian2DSeries","findAxisModels","axisModelMap","alignScaleTicks","alignToScale","alignToTicks","alignToNicedTicks","alignToSplitNumber","alignToInterval","scaleExtent","isMinFixed","isMaxFixed","nicedSplitNumber","t0","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","updateAxisTicks","axesIndices","axisNeedsAlign","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","gridRect","axesList","adjustAxes","updateAxisTransform","labelUnionRect","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","getCartesians","_findConvertTarget","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","axesModelMap","getTooltipAxes","baseAxes","otherAxes","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","coordBase","axisExtentSum","AxisBuilder","handleAutoShown","transformGroup","_transformGroup","hasBuilder","builders","getGroup","innerTextLayout","axisRotation","textRotation","rotationDiff","makeAxisEventDataBase","isLabelSilent","tooltipOpt","shown","arrows","arrowSize","arrowOffset","symbolWidth_1","symbolHeight_1","axisTickLabel","ticksEls","buildAxisMajorTicks","labelEls","buildAxisLabel","fixMinMaxLabelShow","buildAxisMinorTicks","axisNameAvailableWidth","gapSignal","isNameLocationCenter","nameRotation","endTextLayout","truncateOpt","nameTruncateMaxWidth","__fullText","targetType","textRotate","onLeft","tickEls","firstLabel","nextLabel","lastLabel","prevLabel","firstTick","lastTick","ignoreEl","isTwoLabelOverlapped","firstRect","nextRect","mRotationBack","createTicks","tickTransform","tickEndCoord","tickLineStyle","anidPrefix","tickEl","minorTickLineStyle","minorTicksEls","axisLabelShow","labelMargin","labelRotation","rawCategoryData","itemLabelModel","rawCategoryItem","tickIndex","collect","axesInfo","seriesInvolved","coordSysAxesInfo","coordSysMap","collectAxesInfo","collectSeriesInfo","globalTooltipModel","globalAxisPointerModel","linksOption","linkGroups","coordSysKey","makeKey","axesInfoInCoordSys","coordSysModel","baseTooltipModel","saveTooltipAxisInfo","triggerAxis","cross","tooltipAxes","fromTooltip","triggerTooltip","axisPointerModel","axisPointerShow","isHandleTrigger","makeAxisPointerModel","snap","triggerEmphasis","involveSeries","axisInfo","useHandle","linkGroup","groupIndex","getLinkGroupIndex","mapper","tooltipAxisPointerModel","volatileOption","field","labelOption","tooltipAxisPointerLabelShow","seriesTooltipTrigger","seriesTooltipShow","seriesDataCount","linkOption","checkPropInLink","linkPropValue","axisPropValue","fixValue","getAxisInfo","getAxisPointerModel","axisPointerClazz","AxisView","axisPointerClass","_doUpdateAxisPointerClass","updateAxisPointer","_axisPointer","_disposeAxisPointer","forceRender","getAxisPointerClass","registerAxisPointerClass","rectCoordAxisBuildSplitArea","axisView","axisGroup","splitAreaModel","areaColors","areaColorsLen","lastSplitAreaColors","splitAreaColors","newSplitAreaColors","colorIndex","cIndex","rectCoordAxisHandleRemove","axisBuilderAttrs","selfBuilderAttrs","CartesianAxisView","oldAxisGroup","_axisGroup","axisBuilder","elementType","cartesians","axisElementBuilders","isInitialSortFromBarRacing","splitLineModel","lineColors","minorSplitLineModel","CartesianXAxisView","CartesianYAxisView","GridView","extraOption","ScatterSeries","radarLayout","getIndicatorAxes","isValidPoint","getValueMissingPoint","firstPoint","radarBackwardCompat","polarOptArr","polarNotRadar_1","polarOpt","indicator","polarIndex","radarIndex","RadarView","createSymbol","updateSymbols","symbolGroup","__dimIdx","getInitialPoints","itemGroup","polygonIgnore","stateIgnore","itemHoverStyle","pathEmphasisState","RadarSeriesModel","indicatorAxes","nameToDisplay","getTooltipPosition","coordToPoint","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","indName","_indicatorModels","getIndicatorModels","radarModel","_buildAxes","_buildSplitLineAndArea","axisBuilders","indicatorAxis","showSplitLine","showSplitArea","splitLineColors","splitLineColorsArr","splitAreaColorsArr","splitLines","splitAreas","ticksRadius","getColorIndex","realSplitNumber_1","axesTicksPoints","prevPoints","areaOrLine","areaOrLineColorList","IndicatorAxis","radiusExtent","Radar","_indicatorAxes","indicatorModel","indicatorIndex","closestAxis","minRadianDiff","closestAxisIdx","viewSize","radarSeries","dummyScale","pixel","radarList","RadarSeries","ATTR","take","resourceKey","userKey","release","uKey","isTaken","RoamController","mousedownHandler","_mousedownHandler","mousemoveHandler","_mousemoveHandler","mouseupHandler","_mouseupHandler","mousewheelHandler","_mousewheelHandler","pinchHandler","_pinchHandler","controlType","_opt","zoomOnMouseWheel","moveOnMouseMove","moveOnMouseWheel","preventDefaultMouseMove","isDragging","_dragging","isPinching","_pinching","setPointerChecker","pointerChecker","isAvailableBehavior","oldX","oldY","newY","shouldZoom","shouldMove","absWheelDeltaDelta","factor","checkPointerAndTrigger","absDelta","scrollDelta","controller","behaviorToCheck","contollerEvent","updateViewOnPan","controllerHost","updateViewOnZoom","zoomDelta","zoomX","zoomY","zoomLimit","newZoom","zoomMin","zoomMax","zoomScale","nodeParsers","IRRELEVANT_EXCLUDES","onIrrelevantElement","targetCoordSysModel","parseXML","svg","parser","DOMParser","parseFromString","svgNode","INHERITABLE_STYLE_ATTRIBUTES_MAP","INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS","SELF_STYLE_ATTRIBUTES_MAP","SELF_STYLE_ATTRIBUTES_MAP_KEYS","SVGParser","_defs","_root","xml","_defsUsePending","named","viewBox","parseAttributes","viewBoxRect","viewBoxTransform","_parseNode","applyDefs","viewBoxArr","splitNumberSequence","makeViewBoxTransform","ignoreViewBox","elRoot","ignoreRootClip","xmlNode","parentGroup","namedFrom","isInDefs","isInText","namedFromForSub","parser_1","newNamed","svgNodeTagLower","paintServerParsers","def","_parseText","_textX","_textY","inheritStyle","applyTextAlignment","pointsArr","pointsStr","parsePoints","parsePaintServerUnit","parseGradientColorStops","gradientUnits","toLocaleLowerCase","offsetStr","styleVals","parseInlineStyle","__inheritedStyle","pointsString","defsUsePending","onlyInlineStyle","isTextGroup","inheritedStyle","selfStyle","parseTransformAttribute","parseAttributeStyle","getFillStrokeStyle","__selfStyle","parentSelfStyle","zrTextBaseline","parentInheritedStyle","zrTextAlign","urlRegex","urlMatch","rawStr","transformRegex","DEGREE_TO_ANGLE","transformOps_1","mt","valueArr","styleRegex","inheritableStyleResult","selfStyleResult","styleRegResult","svgStlAttr","zrInheritableStlAttr","zrSelfStlAttr","svgAttrName","attrValue","parseSVG","TMP_TRANSFORM","transformPoints","updateBBoxFromPoints","projection","project","centroid","signedArea","Region","setCenter","_center","getCenter","calcCenter","GeoJSONPolygonGeometry","exterior","interiors","GeoJSONLineStringGeometry","GeoJSONRegion","geometries","cp","largestGeo","largestGeoSize","loopGeo","transformTo","interior","newRegion","GeoSVGRegion","elOnlyForCalculate","_elOnlyForCalculate","isGeoSVGGraphicRoot","REGION_AVAILABLE_SVG_TAG_MAP","GeoSVGResource","_usedGraphicMap","_freedGraphics","_mapName","_parsedXML","load","firstGraphic","_firstGraphic","_buildGraphic","_boundingRect","createRegions","regionsMap","_regions","_regionsMap","svgXML","rootFromParse","bRectX","bRectY","bRectWidth","bRectHeight","calculatedBoundingRect","namedItem","setSilent","useGraphic","hostKey","usedRootMap","svgGraphic","freeGraphic","region","json","UTF8Encoding","jsonCompressed","encodeScale","UTF8Scale","features","geometry","encodeOffsets","coordinates","decodeRing","decodeRings","rings","coordinate","parseGeoJSON","nameProperty","featureObj","geoCoord","nanhaiName","fixNanhai","coordsOffsetMap","fixTextCoords","coordFix","fixDiaoyuIsland","DEFAULT_NAME_PROPERTY","GeoJSONResource","geoJSON","_parsedMap","_specialAreas","_geoJSON","parseInput","parsed","rawRegions","_parseToRegions","calculateBoundingRect","finalRegions","regionName","specialArea","getMapForUser","regionRect","rawDef","rawSpecialAreas","resource","getGeoResource","OPTION_STYLE_ENABLED_TAGS","OPTION_STYLE_ENABLED_TAG_MAP","STATE_TRIGGER_TAG_MAP","LABEL_HOST_MAP","mapLabelRaw","getFixedItemStyle","areaColor","fixLineStyle","styleHost","MapDraw","_controller","_controllerHost","_regionsGroup","_svgGroup","mapOrGeoModel","fromView","isGeo","mapSeries","getHostGeoModel","regionsGroup","transformInfo","getTransformInfo","transformInfoRaw","transformInfoRoam","roam","isFirstDraw","isVisualEncodedByVisualMap","viewBuildCtx","resourceType","_buildGeoJSON","_buildSVG","_updateController","_updateMapSelectHandler","regionsGroupByName","_regionsGroupByName","regionsInfoByName","projectionStream","stream","transformPoint","transformPolygonPoints","inPoints","outPoints","newPt","getPolyShape","regionGroup","regionModel","getRegionModel","polygonSubpaths","polylineSubpaths","polys","projectPolys","poly","centerPt","createCompoundPath","subpaths","isLine","compoundPath","applyOptionStyleForRegion","resetLabelForRegion","resetEventTriggerForRegion","resetTooltipForRegion","resetStateTriggerForRegion","_svgResourceChanged","_freeSVG","_useSVG","svgDispatcherMap","_svgDispatcherMap","_svgGraphicRecord","_enableBlurEntireSVG","opacity_1","geoModel","_svgMapName","geoSourceManager","getZoom","makeActionBase","_mouseDownFlag","resetForLabelLayout","mapDraw","normalStyleModel","emphasisStyleModel","blurStyleModel","selectStyleModel","selectStyle","labelXY","isDataNaN","showLabel","specifiedTextOpt","eventTrigger","geoIndex","createStream","curPoly","polygons","startPolygon","endPolygon","polygonStart","polygonEnd","lineStart","lineEnd","sphere","ring","MapView","mapModel","_mapDraw","needsDrawMap","_renderSymbols","originalData","originalDataIndex","fullData","mainSeries","fullIndex_1","MapSeries","seriesGroup","getRegion","dataNameMap","toAppendNames","name_2","geoSource","getMapType","seriesNames","otherIndex","setZoom","iconType","icon","aspectScale","showLegendSymbol","boundingCoords","scaleLimit","dataStatistics","datas","statisticType","mapKey","mapDataStatistic","seriesGroups","hostGeoModel","seriesList","mapSymbolLayout","processedMapType","mapSymbolOffsets","subMapSeries","v2ApplyTransform","View","_roamTransformable","_rawTransformable","setViewRect","_transformTo","_viewRect","rawTransform","rawParent","_updateTransform","centerCoord","_updateCenterAndZoom","_zoom","getDefaultCenter","rawRect","getRoamTransform","rawTransformMatrix","roamTransform","defaultCenter","roamTransformable","rawTransformable","_rawTransform","getViewRectAfterRoam","noRoam","getCoordSys","GEO_DEFAULT_PARAMS","invertLongitute","geo2DDimensions","Geo","_nameCoordMap","defaultParams","_invertLongitute","getRegionByCoord","addGeoCoord","getGeoCoord","projectedToPoint","unproject","pointToProjected","projected","resizeGeo","leftTop_1","rightBottom_1","projection_1","xMin","yMin","xMax","yMax","sampleLine","centerOption","sizeOption","useCenterAndSize","boxLayoutOption","setGeoCoords","GeoCreator","geoList","getCommonGeoProperties","mapModelGroupBySeries","nameMapList","singleMapSeries","getFilledRegions","originRegionArr","regionsArr","geoCreator","GeoModel","_optionModelMap","optionModelMap","regionOpt","unSelect","toggleSelected","getCenterCoord","updateCenterAndZoom","previousZoom","fixX","fixY","GeoView","_handleRegionClick","updateSelectStatus","geoId","makeAction","allSelected","inRoot","hierNode","defaultAncestor","prelim","modifier","change","thread","isExpand","firstWalk","separation","siblings","subtreeW","executeShifts","midPoint","apportion","secondWalk","nodeX","defaultSeparation","radialCoordinate","subtreeV","nodeOutRight","nodeInRight","nodeOutLeft","nodeInLeft","sumOutRight","sumInRight","sumOutLeft","sumInLeft","nextRight","nextLeft","moveSubtree","nextAncestor","wl","wr","node1","node2","TreeEdgeShape","parentPoint","childPoints","TreePath","childLen","firstChildPos","lastChildPos","forkDim","forkPosition","tmpPoint","TreeView","_mainGroup","layoutInfo","_updateViewCoordSys","updateNode","removeNode","_nodeScaleRatio","_updateNodeAndLinkScale","oldMin","_min","oldMax","_max","viewCoordSys","nodeScale","_getNodeGlobalScale","nodeScaleRatio","groupZoom","roamZoom","getNodeByDataIndex","virtualRoot","sourceSymbolEl","sourceLayout","sourceOldLayout","__oldX","__oldY","rawX","__radialOldRawX","rawY","__radialOldRawY","targetLayout","__radialRawX","__radialRawY","realRoot","rootLayout","isLeft","labelRotateRadian","focusDataIndices","getAncestorsIndices","getDescendantIndices","drawEdge","__edge","parentEl","edgeShape","getOrient","curvature","edgeForkPosition","getEdgeShape","childLayout","removeNodeEdge","removeAnimationOpt","getSourceNode","sourceEdge","layoutOpt","childNode","radialCoor1","radialCoor2","radialCoor3","radialCoor4","linkSeriesData","datasAttr","linkAll","transferInjection","cloneShallowInjection","changeInjection","isMainData","linkSingle","struct","structAttr","TreeNode","hostTree","viewChildren","isRemoved","eachNode","suppressVisitSub","updateDepthAndHeight","getNodeById","contains","getAncestors","includeSelf","currNode","getValue","getLevelModel","levelModels","getChildIndex","isAncestorOf","isDescendantOf","Tree","_nodes","clearLayouts","createTree","dataRoot","beforeLink","listData","dimMax","buildHierarchy","dataNode","retrieveTargetInfo","validPayloadTypes","targetNode","targetNodeId","getPathToRoot","aboveViewRoot","viewRoot","viewPath","wrapTreePathInfo","treePathInfo","nodeDataIndex","TreeSeriesModel","leavesModel","nodeData","treeDepth","expandAndCollapse","expandTreeDepth","initialTreeDepth","collapsed","treeAncestors","curveness","eachAfter","eachBefore","treeLayout","commonLayout","tx_1","kx_1","ky_1","coorX_1","coorY_1","finalCoor","orient_1","treeVisual","installTreeAction","TreeSeries","actionTypes","installTreemapAction","handleRootToNode","originViewRoot","getViewRoot","resetViewRoot","enableAriaDecalForTree","decalPaletteScope","TreemapSeriesModel","completeTreeValue","designatedVisualItemStyle","designatedVisualModel","setDefault","levelDefine","levelModel","setLayoutInfo","mapIdToIndex","idIndexMap","_idIndexMap","_idIndexMapCount","_viewRoot","enableAriaDecal","clipWindow","squareRatio","leafDepth","drillDownIcon","zoomToNodeRatio","nodeClick","emptyItemWidth","upperLabel","colorAlpha","colorSaturation","gapWidth","borderColorSaturation","visualDimension","visualMin","visualMax","colorMappingBy","visibleMin","childrenVisibleMin","childValue","thisValue","globalColorList","globalDecalList","hasColorDefine","hasDecalDefine","modelColor","modelDecal","level0","TEXT_PADDING","ITEM_GAP","ARRAY_LENGTH","Breadcrumb","containerGroup","onSelect","thisGroup","emphasisTextStyleModel","layoutParam","totalWidth","renderList","_prepare","_renderContent","lastX","availableSize","itemNode","makeItemPoints","onclick","selfType","AnimationWrap","_storage","_elExistsMap","_finishedCallback","checkTerminate","createWrap","DRAG_THRESHOLD","PATH_LABEL_NOAMAL","PATH_UPPERLABEL_NORMAL","Z2_BASE","Z2_BG","Z2_CONTENT","getStateItemStyle","getItemStyleNormal","TreemapView","_state","createStorage","_oldTree","thisStorage","reRoot","rootNodeGroup","nodeGroup","_giveContainerGroup","renderResult","_doRender","renderFinally","_doAnimation","_resetController","_renderBreadcrumb","_containerGroup","thisTree","oldTree","lastsForAnimation","oldStorage","willInvisibleEls","doRenderNode","thisNode","oldNode","renderNode","dualTravel","willDeleteEls","clearStorage","thisViewChildren","oldViewChildren","sameTree","processNode","storageName","delEls","willDelete","durationOption","easingOption","animationWrap","innerStore","nodeWidth","nodeHeight","targetX","targetY","oldShape","fadein","_onPan","_onZoom","_clearController","rootRect","mouseX","mouseY","findTarget","isLeafRoot","_rootToNode","_zoomToNode","linkTarget","_breadcrumb","background","thisLayout","nodeModel","isInView","thisWidth","thisHeight","thisInvisible","thisRawIndex","oldRawIndex","upperHeight","isParent","itemStyleNormalModel","itemStyleEmphasisModel","itemStyleBlurModel","itemStyleSelectModel","giveGraphic","isAboveViewRoot","bg","renderBackground","upperLabelHeight","focusOrIndices","renderContent","disableMorphing","useUpperLabel","processInvisible","visualBorderColor","upperLabelWidth","prepareText","nodeStyle","upperLabelRect","isShow","addDrillDownIcon","textEmphasisState","iconChar","lasts","prepareAnimationWhenHasOld","calculateZ2","prepareAnimationWhenNoOld","lastCfg","parentOldX","parentOldY","parentOldBg","z2InLevel","CATEGORY_DEFAULT_VISUAL_INDEX","VisualMapping","mappingMethod","_normalizeData","normalizers","visualHandler","applyVisual","getColorMapper","_normalizedToVisual","normalizeVisualRange","preprocessForPiecewise","preprocessForSpecifiedCategory","mapValueToVisual","normalized","getNormalizer","listVisualTypes","isValidType","eachVisual","mapVisual","isPrimary","newVisual","newVal","retrieveVisuals","hasVisual","prepareVisualTypes","visualTypes","types_1","type1","type2","dependsOn","visualType1","visualType2","findPieceIndex","pieceList","findClosestWhenOutside","possibleI","pieceValue","updatePossible","piece","newAbs","makeApplyVisual","isNormalized","doMapCategory","returnRGBArray","parsedVisual","piecewise","getSpecifiedVisual","fixed","doMapFixed","colorHue","makePartialColorVisualHandler","colorLightness","createNormalizedToNumericVisual","setter","symbolCfg","doMapToArray","hasSpecialVisual","originIndex","categoryMap","cate","visualArr_1","setVisualToOption","visualArr","doNotNeedPair","applyValue","colorChannel","sourceExtent","pieceIndex","ITEM_STYLE_NORMAL","travelTree","designatedVisual","viewRootAncestors","nodeLayout","thisNodeColor","nodeItemStyleModel","visuals","buildVisuals","calculateColor","calculateBorderColor","mapping_1","buildVisualMapping","childVisual","visualName","getValueVisualDefine","rangeVisual","getRangeVisual","mapping","drColorMappingBy","childVisuals","mappingType","PATH_BORDER_WIDTH","PATH_GAP_WIDTH","PATH_UPPER_LABEL_SHOW","PATH_UPPER_LABEL_HEIGHT","seriesOption","viewAbovePath","rootSize","estimateRootSize","sort_1","viewRootLayout_1","squarify","treeRoot","calculateRootPosition","prunning","hideChildren","halfGapWidth","getUpperLabelHeight","layoutOffset","layoutOffsetUpper","totalArea","initChildren","rowFixedLength","best","score","worst","orderBy","overLeafDepth","statistic","filterByThreshold","deletePoint","areaMax","areaMin","squareArea","idx0WhenH","idx1WhenH","xy","rowOtherLength","rowLen","wh1","remain","modWH","wh0","defaultSize","viewArea","currNodeValue","defaultPosition","targetCenter","nodeInViewAbovePath","childClipRect","TreemapSeries","treemapVisual","treemapLayout","categoryFilter","graphSeries","categoriesData","getCategoriesData","getGraph","categoryNames","categoryVisual","paletteScope","categoryNameIdxMap","symbolVisualList","symbolVisual","categoryIdx","categoryStyle","visualList","graphEdgeVisual","getEdgeData","getEdgeByIndex","KEY_DELIMITER","getAutoCurvenessParams","createCurveness","appendLength","autoCurvenessParmas","curvenessList","__curvenessList","getKeyOfEdges","n1","n2","getOppositeKey","getEdgeFromMap","__edgeMap","getTotalLengthBetweenNodes","getEdgeMapLengthWithKey","lenV","edgeMap","initCurvenessList","createEdgeMapForCurveness","oppositeEdges","isForward","getCurvenessForEdge","needReverse","autoCurvenessParams","isArrayParam","edgeArray","edgeIndex","totalLen","curKey","parityCorrection","oppositeKey","resValue","simpleLayout","simpleLayoutEdge","eachEdge","graphSimpleLayout","dimensions_1","getNodeGlobalScale","_symbolRadiansHalf","circularLayout","basedOn","draggingNode","tempX","tempY","circularRotateLabel","rotateNodeLabel","_layoutNodesBasedOn","x12","y12","unitAngle","radianHalf","sumRadian","symbolRadianHalf","halfRemainRadian","getGraphicEl","graphCircularLayout","forceLayout","inNodes","inEdges","gravity","pp","beforeStepCallback","afterStepCallback","initialFriction","friction","warmUp","setFixed","setUnfixed","beforeStep","afterStep","v12","nLen","ignoreForceLayout","repFact","rep","graphForceLayout","preservedPoints_1","preservedPoints","graph_1","nodeData_1","forceModel","initLayout","nodeDataExtent_1","edgeDataExtent_1","repulsion","edgeLength","repulsionArr_1","edgeLengthArr_1","nodes_1","edgeModel","forceInstance","getNodeByIndex","createViewCoordSys","coordSysType","positions","bbWidth","bbHeight","straightLineProto","bezierCurveProto","StraightLineShape","CurveShape","isStraightLine","ECLinePath","SYMBOL_CATEGORIES","makeSymbolTypeKey","symbolCategory","makeSymbolTypeValue","lineData","symbolSizeArr","symbolOffsetArr","__specifiedRotation","createLine","setLinePoints","_createLine","_updateCommonStl","getLinePath","blurLineStyle","selectLineStyle","lineState","lineStateStyle","stateStyle","labelNormalModel","__align","__verticalAlign","__position","__labelDistance","linePath","symbolFrom","symbolTo","invScale","fromPos","toPos","setSymbolRotation","halfPercent","tangent","specifiedRotation","LineDraw","LineCtor","_LineCtor","lineDraw","oldLineData","_lineData","_doUpdate","isEffectObject","lineNeedsDraw","newLineData","isPointNaN","pts","v3","v2DistSquare","intersectCurveCircle","curvePoints","radiusSquare","nextDiff","adjustEdge","tmp0","quadraticSubdivide","pts2","fromSymbol","toSymbol","__original","originalPoints","isViewCoordSys","GraphView","_lineDraw","_firstRender","groupNewProp","_layoutTimeout","layoutAnimation","_startForceLayoutIteration","_layouting","getAdjacentDataIndices","generateNodeKey","Graph","directed","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","addEdge","edgesMap","GraphEdge","outEdges","getEdge","breadthFirstTraverse","startNode","edgeType","__visited","queue","currentNode","otherNode","inDegree","outDegree","adjacentEdge","getTrajectoryDataIndices","connectedEdgesMap","connectedNodesMap","sourceNodesQueue","targetNodesQueue","nodeIteratorIndex","sourceNode","sourceNodes","targetNodes","createGraphDataProxyMixin","hostName","dataName","createGraphFromNodeEdge","linkNameList","validEdges","linkCount","coordSysCtor","GraphSeriesModel","_categoriesData","_updateCategoriesData","categoriesModels","_categoriesModels","categoryModel","oldGetModel","newGetModel","newPathArr","sourceName","nodeMarkup","circular","rotateLabel","edgeSymbol","edgeSymbolSize","edgeLabel","GraphSeries","PointerShape","PointerPath","parsePosition","formatLabel","GaugeView","colorList","posInfo","_renderMain","axisLineModel","MainPath","showAxis","axisLineWidth","angleRangeSpan","prevEndAngle","sectors","getColor","_renderTicks","_renderTitleAndDetail","_renderAnchor","_renderPointer","minVal","maxVal","subSplitNumber","splitLineLen","tickLen","subStep","splitLineStyle","splitLineDistance","autoColor","textStyleX","textStyleY","tickLine","oldProgressData","_progressEls","progressList","showPointer","progressModel","showProgress","valueExtent","angleExtent","createPointer","pointerModel","pointerWidth","pointerLength","pointerStr","pointerOffset","pointerOffsetX","pointerOffsetY","pointerKeepAspect","createProgress","ProgressPath","isOverlap","progressWidth","isClip","previousPointer","previousRotate","previousProgress","previousEndAngle","anchorModel","showAnchor","anchorSize","anchorType","anchorKeepAspect","contentGroup","newTitleEls","newDetailEls","showPointerAbove","_titleEls","_detailEls","itemTitleModel","titleOffsetCenter","titleX","titleY","labelEl","itemDetailModel","detailOffsetCenter","detailX","detailY","detailColor","formatter_1","fmt","GaugeSeriesModel","GaugeSeries","opacityAccessPath","FunnelPiece","FunnelView","funnelPiece","FunnelSeriesModel","minSize","funnelAlign","getSortedIndices","isAscending","funnelLayout","sizeExtent","itemSize","getLinePoints","val_1","FunnelSeries","DEFAULT_SMOOTH","ParallelView","_dataGroup","_initialized","dataGroup","newDataIndex","addEl","updateElCommon","oldDataIndex","createLinePoints","createGridClipShape","isEmptyValue","ParallelSeriesModel","makeDefaultEncode","getRawIndicesByActiveState","activeState","eachActiveState","theActiveState","parallelIndex","inactiveOpacity","activeOpacity","dataDimIndex","convertDimNameToNumber","parallelVisual","opacityMap","inactive","itemOpacity","parallelPreprocessor","createParallelIfNeeded","mergeAxisOptionFromParallel","hasParallelSeries","parallelAxis","axisOption","parallelOption","CLICK_THRESHOLD","_handlers","handlers","_throttledDispatchExpand","_dispatchExpand","checkTrigger","_mouseDownPoint","mouseDownPoint","getSlidedAxisExpandWindow","behavior","axisExpandWindow","triggerOn","ParallelModel","_initDimensions","setAxisExpand","axisModels","axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","ParallelAxis","sliderMove","handleEnds","handleIndex","minSpan","maxSpan","restrict","handleSpan","originalDistSign","getSpanSign","currDistSign","extentMinSpan","realExtent","Parallel","_axesLayout","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","layoutLength","_layoutAxes","winSize","layoutExtent","axisCount","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","layoutAxisWithExpand","layoutAxisWithoutExpand","positionTable","horizontal","vertical","rotationTable","axisCoordToPoint","dataDimensions","hasActiveSet","hasAxisBrushed","getActiveState","axisLayout","getAxisLayout","pointCoord","triggerArea","useJump","winSize2","createParallelCoordSys","parallelCoordSysCreator","ParallelAxisModel","activeIntervals","getAreaSelectStyle","setActiveIntervals","intervals","BRUSH_PANEL_GLOBAL","COVER_Z","UNSELECT_THRESHOLD","MIN_RESIZE_LINE_WIDTH","MUTEX_RESOURCE_KEY","DIRECTION_MAP","CURSOR_MAP","ne","sw","nw","se","DEFAULT_BRUSH_OPT","transformable","brushMode","removeOnClick","baseUID","BrushController","_covers","_uid","pointerHandlers","enableBrush","brushOption","_brushType","_doDisableBrush","brushType","_doEnableBrush","_enableGlobalPan","_brushOption","setPanels","panelOpts","panels_1","_panels","panelId","enableGlobalPan","updateCovers","coverConfigList","coverConfig","tmpIdPrefix","oldCovers","newCovers","creatingCover","_creatingCover","oldGetKey","addOrUpdate","cover","__brushOption","newBrushInternal","endCreating","createCover","updateCoverAfterCreation","unmount","clearCovers","coverRenderers","coverRenderer","getCoverRenderer","updateCoverShape","updateCommon","getPanelByPoint","localCursorPoint","panel","pn","isTargetByCursor","getPanelByCover","covers","originalLength","areas","shouldShowCover","getTrackEnds","createBaseRectCover","rectRangeConverter","edgeNameSequences","makeStyle","driftRect","ondragend","nameSequence","updateBaseRect","localRange","handleSize","xa","ya","x2a","y2a","widtha","heighta","updateRectShape","mainEl","globalDir","getGlobalDirection1","getGlobalDirection2","pointsToRect","clipByPanel","formatRectRange","localDirName","inverseMap","localDirNameSeq","dirNameSequence","rectRange","toRectRange","localDelta","toLocalDelta","dirName","ind","fromRectRange","driftPolygon","localD","localZero","xmin","ymin","xmax","ymax","resetCursor","isOutsideZrArea","currPanel","rawE","mainShapeContain","updateCoverByMouse","eventParams","_creatingPanel","thisBrushOption","determineBrushType","coverBrushOption","getCreatingRange","defaultBrushType","handleDragEnd","getLineRenderer","returnInput","localTrack","ends","xyIndex","otherExtent","getLinearBrushOtherExtent","makeRectPanelClipPath","normalizeRect","localPoints","makeLinearBrushOtherExtent","specifiedXYIndex","brushWidth","makeRectIsTargetByCursor","targetModel","elementList","ParallelAxisView","_brushController","_onBrush","fromAxisAreaSelect","areaSelectStyle","areaWidth","builderOpt","_refreshBrushController","extentLen","getCoverInfoList","eventParam","coverInfoList","coverInfo","realtime","parallelAxisId","installParallelActions","parallelAxisModel","defaultAxisOption","ParallelSeries","SankeyPathShape","SankeyPath","SankeyView","_focusAdjacencyDisabled","sankeyView","curve","n1Layout","node1Model","dragX1","dragY1","n2Layout","node2Model","dragX2","dragY2","edgeLayout","applyCurveStyle","defaultEdgeLabelText","edgeLabelStateModels","dragX","dragY","localX","localY","curveProps","sourceColor","targetColor","SankeySeriesModel","nodeDepth","setNodePosition","localPosition","rawDataOpt","edgeValue","edgeName","nodeValue","nodeGap","layoutIterations","nodeAlign","sankeyLayout","computeNodeValues","filteredNodes","iterations","layoutSankey","computeNodeBreadths","computeNodeDepths","computeEdgeDepths","getEdgeValue","nodeRawValue","remainEdges","indegreeArr","zeroIndegrees","nextTargetNode","maxNodeDepth","isItemDepth","edgeIdx","indexEdge","nodeIndex","maxDepth","adjustNodeWithNodeAlign","kx","scaleNodeBreadths","isNodeDepth","nextSourceNode","remainNodes","skNodeHeight","moveSinksRight","nodesByBreadth","prepareNodesByBreadth","initializeNodeDepth","resolveCollisions","relaxRightToLeft","relaxLeftToRight","keyAttr","groupResult","minKy","ky","nodeDy","edgeDy","nodeDyAttr","weightedTarget","centerTarget","nodeY","weightedSource","centerSource","sankeyVisual","minValue_1","maxValue_1","mapValueToColor","customColor","edgeStyle","SankeySeries","WhiskerBoxCommonMixin","addOrdinal","xAxisType","yAxisType","coordDims","baseAxisDimIndex","_baseAxisDim","baseAxisType","otherAxisType","newOptionData_1","newItem","defaultValueDimensions","BoxplotSeriesModel","boxWidth","BoxplotView","constDim","createNormalBox","updateNormalBoxData","BoxPathShape","BoxPath","transInit","initBaseline","boxplotLayout","groupSeriesByAxis","groupItem","calculateBase","layoutSingleSeries","boxOffsetList","boxWidthList","axisList","seriesCount","boundList","maxDataCount_1","boxWidthBound","boxGap","halfWidth","cDimIdx","vDimIdx","cDim","vDims","axisDimVal","median","getPoint","end1","end2","end4","end5","addBodyEnd","layEndLine","point1","point2","endCenter","prepareBoxplotData","boxData","outliers","boundIQR","useExtreme","ascList","Q1","Q2","Q3","bound","high","itemNameFormatter","outlier","boxplotTransform","BoxplotSeries","SKIP_PROPS","CandlestickView","_incrementalRenderNormal","isSimpleBox","isNormalBoxClipped","setBoxCommon","NormalBoxPathShape","NormalBoxPath","__simpleBox","LargeBoxPathShape","LargeBoxPath","__sign","elP","elN","elDoji","setLargeStyle","CandlestickSeriesModel","getShadowDim","brushRect","borderColorDoji","candlestickPreprocessor","seriesItem","positiveBorderColorQuery","negativeBorderColorQuery","dojiBorderColorQuery","positiveColorQuery","negativeColorQuery","candlestickVisual","getBorderColor","isLargeRender","candlestickLayout","candleWidth","calculateCandleWidth","cDimI","vDimsI","openDimI","closeDimI","lowestDimI","highestDimI","largeProgress","normalProgress","openVal","closeVal","lowestVal","highestVal","ocLow","ocHigh","ocLowPoint","ocHighPoint","lowestPoint","highestPoint","subPixelOptimizePoint","hasDojiColor","getSign","makeBrushRect","pmin","pmax","CandlestickSeries","updateRipplePath","rippleGroup","effectCfg","rippleEffectColor","ripplePath","EffectSymbol","stopEffectAnimation","startEffectAnimation","rippleNumber","period","effectOffset","rippleScale","updateEffectAnimation","oldEffectCfg","_effectCfg","DIFFICULT_PROPS","showEffectOn","EffectScatterView","effectSymbolDraw","_updateGroupTransform","EffectScatterSeriesModel","effectType","rippleEffect","EffectScatterSeries","EffectLine","_updateEffectSymbol","effectModel","_symbolScale","_updateEffectAnimation","roundTrip","constantSpeed","delayExpr","_updateAnimationPoints","_getLineLength","_period","_roundTrip","delayNum","__t","_animateSymbol","_updateSymbolPosition","__p1","__cp1","__p2","quadraticDerivativeAt","__lastT","_createPolyline","lineEmphasisState","EffectPolyline","_lastFrame","_lastFramePercent","accLenArr","_offsets","_length","offsets","LargeLinesPathShape","segs","LargeLinesPath","LargeLineDraw","lineEl","oldSegs","newSegs","isIncremental","linesLayout","isPolyline","lineCoords","totalCoordsCount","getLineCoordsCount","getLineCoords","LinesView","_updateLineDraw","trailLength","_lastZlevel","_showEffect","hasEffect","_hasEffet","_isPolyline","Uint32Arr","Float64Arr","compatEc2","coords","fromName","toName","LinesSeriesModel","_processFlatCoordsArray","_flatCoords","flatCoords","_flatCoordsOffset","flatCoordsOffset","_getCoordsFromItemModel","startOffset","coordsOffsetAndLenStorage","coordsStorage","coordsCursor","offsetCursor","effect","linesVisual","LinesSeries","GRADIENT_LEVELS","HeatmapLayer","blurSize","pointSize","maxOpacity","minOpacity","_gradientPixels","inRange","outOfRange","colorFunc","isInRange","_getBrush","gradientInRange","_getGradient","gradientOutOfRange","imageData","getImageData","pixels","pixelLen","diffOpacity","gradientOffset","putImageData","brushCanvas","_brushCanvas","gradientPixels","pixelsSingleState","Uint8ClampedArray","getIsInPiecewiseRange","dataSpan","getIsInContinuousRange","isGeoCoordSys","HeatmapView","visualMapOfThisSeries","eachTargetSeries","targetSeries","_renderOnCartesianAndCalendar","_renderOnGeo","isCartesian2d","dataDimX","dataDimY","dataToRect","contentShape","emphasisModel_1","visualMapModel","inRangeVisuals","targetVisuals","outOfRangeVisuals","hmLayer","_hmLayer","lng","lat","getPieceList","HeatmapSeriesModel","HeatmapSeries","BAR_BORDER_WIDTH_QUERY","LAYOUT_ATTRS","posDesc","pathForLineWidth","PictorialBarView","coordSysRect","ecSize","coordSysExtent","categoryDim","symbolMeta","getSymbolMeta","createBar","pictorialShapeStr","getShapeStr","__pictorialShapeStr","updateBar","__pictorialSymbolMeta","removeBar","symbolRepeat","symbolClip","symbolPosition","symbolPatternSize","symbolRepeatDirection","prepareBarLength","prepareSymbolSize","boundingLength","pxSign","prepareLineWidth","symbolScale","prepareLayoutInfo","valueLineWidth","repeatCutLength","outputSymbolMeta","symbolBoundingData","zeroPx","pxSignIdx","symbolBoundingExtent","convertToCoordOnAxis","parsedSymbolSize","categorySize","unitLength","pathLen","absBoundingLength","symbolMargin","hasEndGap","symbolMarginNumeric","uLenWithMargin","endFix","repeatSpecified","repeatTimes","toIntTimes","mDiff","sizeFix","pathPosition","bundlePosition","barRectShape","createPath","createOrUpdateRepeatSymbols","bundle","__pictorialBundle","eachPath","__pictorialAnimationIndex","__pictorialRepeatTimes","makeTarget","createOrUpdateSingleSymbol","mainPath","__pictorialMainPath","createOrUpdateBarRect","barRect","__pictorialBarRect","createOrUpdateClip","__pictorialClipPath","immediateAttrs","animationAttrs","barPositionOutside","times","roundedTimes","PictorialBarSeriesModel","PictorialBarSeries","ThemeRiverView","layersSeries","getLayerSeries","keyGetter","dataDiffer","_layersSeries","newLayersGroups","process","oldLayersGroups","points0","textLayout","layerGroup","DATA_NAME_INDEX","ThemeRiverSeriesModel","fixData","rawDataLength","timeValueKeys","layerData","dataList","layerNum","timeValue","filterData","lenCount","indexArr","timeDim","layerSeries","index1","index2","getAxisTooltipData","nestestValue","nearestIdx","pointNum","theValue","singleAxisIndex","themeRiverLayout","doThemeRiverLayout","baseY0","layerPoints","singleLayer","computeBaseline","baseLine","layerIndex","sums","temp","ThemeRiverSeries","DEFAULT_SECTOR_Z","DEFAULT_TEXT_Z","SunburstPiece","_seriesModel","_ecModel","itemStyleModel","labelMinAngle","isNormalShown","getLabelAttr","stateAttr","labelStateModel","isShown","sectorState","labelColor","labelPadding","ROOT_TO_NODE_ACTION","HIGHLIGHT_ACTION","UNHIGHLIGHT_ACTION","installSunburstAction","handleHighlight","SunburstView","newRoot","renderLabelForZeroData","newChildren","oldChildren","_oldChildren","renderRollUp","virtualPiece","targetFound","SunburstSeriesModel","_levelModels","sunburstLayout","rootDepth","renderRollupNode","rPerLevel","rStart","rEnd","r0_1","r_1","radius_1","siblingAngle_1","sortOrder","sortTargets","isAsc_1","sunburstVisual","pickColor","treeHeight","SunburstSeries","STYLE_VISUAL_TYPE","NON_STYLE_VISUAL_PROPS","customInnerStore","CustomSeriesModel","currentZLevel","currentZ","dataToCoordSize","dataSize","halfSize","cartesianPrepareCustom","geoPrepareCustom","singlePrepareCustom","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","dataToRadius","dataToAngle","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","isEC4CompatibleStyle","elType","hasOwnTextContentOption","hasOwnTextConfig","legacy","convertFromEC4CompatibleStyle","hostStyle","textContentStyle","srcStyle","hasOwnPos","textDistance","convertEC4CompatibleRichItem","richItem","textStrokeWidth","textLineHeight","textBoxShadowColor","textBoxShadowBlur","textBoxShadowOffsetX","textBoxShadowOffsetY","convertToEC4StyleForCustomSerise","itemStl","txStl","txCfg","hostFill","convertToEC4RichItem","textFillNotSet","LEGACY_TRANSFORM_PROPS_MAP","LEGACY_TRANSFORM_PROPS","ELEMENT_ANIMATABLE_PROPS","transitionInnerStore","getElementAnimationConfig","elOption","animationProp","userDuring","duringCall","applyUpdateTransition","clearStyle","styleOpt","transFromProps","propsToSet","prepareTransformAllPropsFinal","prepareShapeOrExtraAllPropsFinal","prepareTransformTransitionFrom","prepareShapeOrExtraTransitionFrom","prepareStyleTransitionFrom","applyPropsDirectly","applyMiscProps","enterFromProps_1","enterFrom","applyPropsTransition","updateLeaveTo","leaveToProps","leaveTo","applyLeaveTransition","onRemove","isTransitionAll","allPropsFinal","tmpDuringScope","transitionDuringAPI","getShape","setExtra","getExtra","latestUserDuring","scopeUserDuring","mainAttr","fromEl","attrOpt","transFromPropsInAttr","elPropsInAttr","attrTransition","transitionKeys","elVal","elPropsInAttrKeys","isNonStyleTransitionEnabled","allProps","allPropsInAttr","keysInAttr","legacyName","xyName","legacyArr","transFromStyleProps","fromElStyle","styleTransition","elTransition","animationStyleProps","styleKeys","optVal","getStateToRestore","KEYFRAME_EXCLUDE_KEYS","stopPreviousKeyframeAnimationAndRestore","applyKeyframeAnimation","animationOpts","singleAnimationOpts","stateToRestore","targetPropName","kfValues","propKeys","savedTarget","EMPHASIS","NORMAL","BLUR","SELECT","STATES","PATH_ITEM_STYLE","PATH_LABEL","DEFAULT_TRANSITION","GROUP_DIFF_PREFIX","attachedTxInfoTmp","prepareCustoms","isDisplayable","copyElement","sourceEl","CustomChartView","customSeries","renderItem","makeRenderItem","createOrUpdateItem","setIncrementalAndHoverLayer","elementName","createEl","graphicType","getPathData","customPathData","customImagePath","customGraphicType","updateElNormal","attachedTxInfo","txCfgOpt","textOptionStyle","decalPattern","decalObj","__decalPattern","keyframeAnimation","updateElOnState","elStateOpt","elDisplayable","existingEmphasisState","optZ2","updateZForEachState","retrieveStateOption","currDataIndexInside","currItemModel","userAPI","ordinalRawValue","styleEmphasis","barLayout","currentSeriesIndices","userParams","dataInsideLength","wrapEncodeDef","currItemStyleModels","currLabelModels","seriesItemStyleModels","seriesLabelModels","getItemStyleModel","userProps","preFetchFromExtra","applyUserPropsAfter","style_1","existsEl","doCreateOrUpdateEl","toBeReplacedIdx","doesElNeedRecreate","morph","conOpt","isLegacy","doCreateOrUpdateAttachedTx","doCreateOrUpdateClipPath","otherStateOpt","otherStyleOpt","retrieveStyleOptionOnState","mergeChildren","elInner","elOptionType","elOptionShape","elOptionStyle","hasOwnPathData","clipPathOpt","processTxInfo","txConOptNormal","txConOptEmphasis","txConOptBlur","txConOptSelect","txConStlOptNormal","txConOptOtherState","stateOpt","txConOpt","convertResult","txConOptNormal_1","stateOptionNormal","stateOption","$mergeChildren","byName","diffChildrenByName","diffGroupChildren","removeChildFromGroup","processAddUpdate","processRemove","childOption","CustomSeries","BaseAxisPointer","_axisModel","_axisPointerModel","_lastValue","_lastStatus","_group","handle","_handle","makeElOption","graphicKey","_lastGraphicKey","moveAnimation","_moveAnimation","determineAnimation","doUpdateProps","updatePointerEl","updateLabelEl","createPointerEl","createLabelEl","updateMandatoryProps","_renderHandle","isCategoryAxis","useSnap","pointerOption","pointerEl","updateLabelShowHide","updateHandleTransform","handleModel","onmousemove","onmousedown","_onHandleDragMove","_onHandleDragEnd","_moveHandleToValue","getHandleTransProps","getHandleTransform","trans","_payloadInfo","lastProp","_doDispatchAxisPointer","payloadInfo","cursorPoint","tooltipOption","buildLabel","xDimIndex","propsEqual","lastProps","equals_1","buildElStyle","axisPointerType","buildLabelElOption","labelPos","getValueLabel","paddings","confineInContainer","seriesDataIndices","params_1","axisDimension","seriesData","idxItem","getTransformedPosition","buildCartesianSingleLabelElOption","makeLineShape","makeRectShape","makeSectorShape","CartesianAxisPointer","pixelValue","elStyle","pointerShapeBuilder","currPosition","cursorOtherValue","tooltipOptions","getAxisDimIndex","shadow","AxisPointerModel","shadowStyle","records","initGlobalListeners","useHandler","dis","makeDispatchAction","dispatchTooltipFinally","pendings","initialized","doEnter","onLeave","actuallyPayload","showLen","showTip","hideLen","hideTip","currTrigger","unregister","AxisPointerView","findPointFromSeries","isStacked","axisTrigger","illegalPoint","isIllegalPoint","inputAxesInfo","shouldHide","outputPayload","showValueMap","dataByCoordSys","updaters","showTooltip","coordSysContainsPoint","inputAxisInfo","findInputAxisInfo","processOnAxis","linkTriggers","tarAxisInfo","tarKey","srcAxisInfo","srcKey","srcValItem","makeMapperParam","updateModelActually","dispatchTooltipActually","dispatchHighDownActually","newValue","noSnap","outputFinder","buildPayloadsBySeries","payloadBatch","snapToValue","seriesNestestValue","coordSysItem","coordSysId","coordSysIndex","coordSysMainType","dataByAxis","valueLabelOpt","outputAxesInfo","valItem","highDownKey","lastHighlights","newHighlights","toHighlight","toDownplay","PolarAxisPointer","coordValue","getLabelPosition","axisAngle","PolarModel","foundAxisModel","PolarAxisModel","AngleAxisModel","RadiusAxisModel","RadiusAxis","radiusToData","AngleAxis","angleToData","polarDimensions","Polar","_radiusAxis","_angleAxis","maxAngle","resizePolar","parsedRadius","updatePolarScale","isAngleAxisModel","setAxis","polarCreator","polarList","getAxisLineShape","rExtent","getRadiusIdx","fixAngleOverlap","firstItem","lastItem","AngleAxisView","ticksAngles","minorTickAngles","angelAxisElementsBuilders","rId","r0Id","tickAngleItem","tickAngles","commonLabelModel","labelTextAlign","labelTextVerticalAlign","prevAngle","RadiusAxisView","newAxisGroup","layoutAxis","prevRadius","barLayoutPolar","lastStackCoords","calRadialBar","clampLayout","radiusSpan","angleSpan","angleAxisExtraOption","radiusAxisExtraOption","PolarView","directionMap","SingleAxisView","SingleAxisModel","SingleAxis","singleDimensions","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","singleModel","singles","singleCreator","XY","WH","SingleAxisPointer","getPointDimIndex","SingleView","CalendarModel","mergeAndNormalizeLayoutParams","getCellSize","cellSize","firstDay","cellSizeArr","CalendarView","calendarModel","rangeData","_renderDayRect","_renderLines","_renderYearText","_renderMonthText","_renderWeekText","itemRectStyleModel","sh","getNextNDay","tl","_tlpoints","_blpoints","_firstDayOfMonth","_firstDayPoints","addPoints","formatedDate","getDateInfo","setMonth","_getLinePointsOfOneWeek","_drawSplitline","_getEdgesPoints","rs","poyline","parsedDate","tmpD","_formatterLabel","_yearTextPositionControl","aligns","xc","yc","posPoints","yearText","_monthTextPositionControl","isCenter","vAlign","termPoints","firstDayPoints","yyyy","yy","MM","monthText","_weekTextPositionControl","isStart","firstDayOfWeek","getFirstDayOfWeek","dayOfWeekShort","lweek","fweek","weekText","PROXIMATE_ONE_DAY","Calendar","_rangeInfo","_sw","_sh","_orient","_firstDayOfWeek","mStr","dStr","getDay","setDate","_lineWidth","_getRangeInfo","_initRangeOption","whNames","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","normalizedRange","rangeStr","reversed","parsedRange","startDateNum","endDateNum","dateNum","nthDay","calendarList","calendarSeries","setKeyInfoToNewElOption","newElOption","existElOption","parentId","newElParentOption","parentOption","isSetLoc","isSet","mergeNewElOptionToExist","existList","newElOptCopy","$action","copyTransitionInfo","TRANSITION_PROPS_TO_COPY","ROOT_TRANSITION_PROPS_TO_COPY","setLayoutInfoToExist","existItem","existingGroupOpt","newGroupOpt","GraphicComponentModel","elements","flattenedList","_flatten","elOptionsToUpdate","_elOptionsToUpdate","optionList","useElOptionsToUpdate","nonShapeGraphicElements","GraphicComponentView","_elMap","graphicModel","_lastGraphicModel","_updateElements","_relocate","rootGroup","globalZ","globalZLevel","elExisting","targetElParent","textContentOption","elOptionCleaned","getCleanedElOption","isMerge","isReplace","el_1","updateCommonAttrs","removeEl","el_2","textContentExisting","clipPathOption","clipPathType","newEl","setEventData","elOptions","apiWidth","apiHeight","isParentRoot","parentElInner","containerInfo","layoutPos","layouted","bounding","animatePos","existElParent","defaultZ","defaultZlevel","graphicOption","graphic","DATA_ZOOM_AXIS_DIMENSIONS","SERIES_COORDS","isCoordSupported","coordType","getAxisMainType","findEffectedDataZooms","foundNewLink","axisRecords","effectedModels","effectedModelMap","dataZoomModel","addToEffected","processSingle","isLinked","markAxisControlled","isLink","eachTargetAxis","axisIdxArr","collectReferCoordSysModelInfo","coordSysInfoWrap","infoList","infoMap","coordSysUid","DataZoomAxisInfo","indexList","indexMap","axisCmptIdx","DataZoomModel","_autoThrottle","_noTarget","_rangePropMode","inputRawOption","retrieveRawOption","settledOption","_setDefaultThrottle","_updateRangeUse","_resetTarget","optionOrient","targetAxisIndexMap","_targetAxisInfoMap","hasAxisSpecified","_fillSpecifiedTargetAxis","_makeAutoOrientByTargetAxis","_fillAutoTargetAxisByOrient","refering","needAuto","setParallelAxis","gridModel_1","axModel","globalOption","rangePropMode","rangeModeInOption","percentSpecified","valueSpecified","noTarget","getFirstTargetAxisModel","firstAxisModel","getAxisProxy","getAxisModel","__dzAxisProxy","setRawRange","setCalculatedRange","getPercentRange","axisProxy","findRepresentativeAxisProxy","getDataPercentWindow","getValueRange","getDataValueWindow","firstProxy","axisDimList","hostedBy","getRangePropMode","filterMode","SelectDataZoomModel","DataZoomView","SelectDataZoomView","AxisProxy","_dimName","_axisIndex","_dataZoomModel","_valueWindow","_percentWindow","getTargetSeriesModels","axisMainType","getMinMaxSpan","_minMaxSpan","calculateDataWindow","hasPropModeValue","_dataExtent","percentExtent","percentWindow","valueWindow","boundPercent","boundValue","spans","restrictSet","fromWindow","toWindow","fromExtent","toExtent","toValue","suffix","calculateDataExtent","_updateMinMaxSpan","dataWindow","_setAxisModel","store_1","dataDimIndices_1","leftOut","rightOut","thisHasValue","thisLeftOut","thisRightOut","isInWindow","minMaxSpan","percentSpan","valueSpan","dataZoomProcessor","eachAxisModel","proxyList","seriesModelMap","percentRange","valueRange","installDataZoomAction","installed","installCommon","SelectZoomModel","SelectZoomView","ToolboxFeature","registerFeature","getFeature","ToolboxModel","featureName","Feature","itemGap","showTitle","viewportSize","makeBackground","ToolboxView","toolboxModel","isVertical","featureOpts","_features","featureNames","_featureNames","processFeature","titleText","__title","emphasisTextConfig","emphasisTextState","emphasisTextStyle","needPutOnTop","topOffset","featureModel","newTitle","isUserFeatureName","isToolboxFeature","unusable","createIconPaths","setIconStatus","iconName","iconPaths","iconStatus","iconsMap","titlesMap","iconStyleModel","iconStyleEmphasisModel","icons","getIcons","titles","hoverStyle","defaultTextPosition","SaveAsImage","$a","download","bubbles","cancelable","dispatchEvent","msSaveOrOpenBlob","base64Encoded","bstr","decodeURIComponent","atob","filename","u8arr","blob","Blob","cw","contentWindow","doc","write","execCommand","INNER_STACK_KEYWORD","radioTypes","MagicType","availableIcons","seriesOptGenreator","generateNewSeriesTypes","newSeriesOpt","radio","currentType","isStack","BLOCK_SPLITER","ITEM_SPLITER","groupSeries","seriesGroupByCategoryAxis","otherSeries","meta","assembleSeriesWithCategoryAxis","groups","tables","headers","columns","assembleOtherSeries","getContentFromModel","isTSVFormat","firstLine","itemSplitRegex","RegExp","parseTSVContents","tsv","tsvLines","parseListContents","hasName","parseContents","blockMetaList","blockMeta","DataView","viewMain","textarea","optionToContent","contentToOption","htmlOrDom","readOnly","buttonContainer","buttonStyle","closeButton","refreshButton","textareaColor","textareaBorderColor","buttonColor","buttonTextColor","tryMergeDataOption","newValIsObject","shouldDeleteName","newSeriesOptList","newSnapshot","storedSnapshots","getStoreSnapshots","dataZoomId","snapshot","snapshots","RestoreOption","INCLUDE_FINDER_MAIN_TYPES","BrushTargetManager","_targetInfoList","foundCpts","targetInfoBuilders","include","setOutputRanges","matchOutputRanges","coordRange","coordRanges","coordConvert","__rangeOffset","diffProcessor","xyMinMax","findTargetInfo","coordSyses","setInputRanges","rangeOffset","getScales","makePanelOpts","getDefaultBrushType","getPanelRect","controlSeries","targetInfoList","areaPanelId","targetInfoMatchers","formatMinMax","xAxisModels","yAxisModels","gridModels","gridModelMap","xAxesHas","yAxesHas","panelRectBuilders","xAxisDeclared","yAxisDeclared","geoModels","axisConvert","rangeOrCoordRange","xminymin","xmaxymax","axisNameIndex","axisDiffProcessor","refer","scales","xyMinMaxCurr","xyMinMaxOrigin","sizeCurr","sizeOrigin","DATA_ZOOM_ID_BASE","DataZoomFeature","updateZoomBtnStatus","updateBackBtnStatus","brushTargetManager","makeAxisFinder","setBatch","_dispatchZoomAction","findDataZoom","minValueSpan","maxValueSpan","dzModel","nextActive","_isZoomActive","dataZoomSelectActive","dzFeatureModel","xAxisId","yAxisId","zoomActive","featureDataZoomPath","dzOptions","finderResult","buildInternalOptions","axisIndexPropName","newOpt","$fromToolbox","DataZoom","Restore","TooltipModel","showContent","alwaysShowContent","displayMode","confine","showDelay","hideDelay","transitionDuration","enterable","shouldTooltipConfine","tooltipModel","confineOption","testStyle","styleProps","TRANSFORM_VENDOR","TRANSITION_VENDOR","toCSSVendorPrefix","styleVendor","styleProp","currentStyle","CSS_TRANSITION_VENDOR","CSS_TRANSFORM_VENDOR","gCssText","mirrorPos","assembleArrow","arrowPosition","rotateDeg","arrowPos","positionStyle","transformStyle","rotateRadian","arrowWH","rotatedWH","SQRT2","borderStyle","styleCss","assembleTransition","onlyFade","transitionCurve","transitionOption","transitionText","assembleTransform","is3d","assembleFont","assembleCssText","enableTransition","boxShadow","borderName","camelCase","makeStyleCoord","zrPainter","zrViewportRoot","viewportRootOffset","TooltipHTMLContent","_show","_styleCoord","_enterable","_alwaysShowContent","_firstShow","_longHide","_appendToBody","_container","onmouseenter","_hideTimeout","_inContent","onmouseleave","hideLater","_hideDelay","_moveIfResized","nearPointColor","_longHideTimeout","styleCoord","setContent","childNodes","arrowEl","setEnterable","transforms","ratioX","ratioY","willChange","TooltipRichContent","shadowOuterSize","calcShadowOuterSize","mathMaxWith0","proxyRect","TooltipView","_renderMode","_tooltipContent","_tooltipModel","tooltipContent","_initGlobalListener","_keepShow","_tryShow","_hide","_lastX","_lastY","_refreshUpdateTimeout","manuallyShowTip","_lastDataByCoordSys","_ticket","cmptRef","findComponentReference","positionDefault","_manuallyAxisShowTip","pointInfo","manuallyHideTip","tooltipCascadedModel","buildTooltipModel","_showAxisTooltip","seriesDispatcher_1","cmptDispatcher_1","_showSeriesItemTooltip","_showComponentItemTooltip","_showOrMove","_showTimout","singleTooltipModel","cbParamsList","articleMarkup","markupTextArrLegacy","itemCoordSys","axisItem","axisValue","axisValueLabel","axisSectionMarkup","cbParams","seriesTooltipResult","positionExpr","builtMarkupText","blockBreak","allMarkupText","_updateContentNotChangedOnAxis","_updatePosition","_showTooltipContent","tooltipTrigger","asyncTicket","tooltipModelCascade","subTooltipModel","defaultHtml","nearPoint","_getNearestPoint","params0","isTimeAxis","cbTicket","tooltipDataParams","contentSize","boxLayoutPosition","calcTooltipPosition","refixTooltipPosition","isCenterAlign","confineTooltipPosition","lastCoordSys","lastCbParamsList","_cbParamsList","contentNotChanged","lastItemCoordSys","indexCoordSys","lastDataByAxis","thisItemCoordSys","thisDataByAxis","indexAxis","lastIndices","lastIdxItem","newIdxItem","lastCbParams","modelCascade","defaultTooltipOption","resultModel","gapH","gapV","domWidth","domHeight","rectWidth","rectHeight","subEl","DEFAULT_TOOLBOX_BTNS","brushPreprocessor","brushComponents","brushComponentSpecifiedBtns","brushOpt","tbs","toolboxFeature","toolboxBrush","brushTypes","removeDuplicate","flag","hasKeys","createVisualMappings","stateList","supplementVisualOption","visualMappings","mappings","createMappings","visualData","mappingOption","__hidden","__alphaForOpacity","Creater","replaceVisualOption","getValueState","visualTypesMap","eachItem","valueOrIndex","rawDataItem","valueState","incrementalApplyVisual","makeBrushCommonSelectorForSeries","getLineSelectors","inLineRange","layoutRange","STATE_LIST","DISPATCH_METHOD","DISPATCH_FLAG","layoutCovers","brushModel","brushVisual","throttleDelay","brushSelected","setBrushOption","brushIndex","thisBrushSelected","brushId","brushName","brushLink","linkedSeriesMap","selectedDataIndexForLink","rangeInfoBySeries","hasBrushExists","boundingRectBuilders","selectableArea","linkOthers","brushed","rangeInfoList","stepAParallel","stepAOthers","brushModelNotControll","checkInRange","seriesBrushSelected","doDispatch","getBoundingRectFromMinMax","rg","BrushView","$from","DEFAULT_OUT_OF_BRUSH_COLOR","BrushModel","inBrush","outOfBrush","setAreas","generateBrushOption","BrushFeature","isBrushed","_brushMode","command","Brush","TitleModel","subtext","subtarget","TitleView","titleModel","subtextStyleModel","subText","subTextEl","sublink","groupRect","alignStyle","TimelineModel","_initData","setCurrentIndex","isIndexMax","setPlayState","autoPlay","getPlayState","processedDataArr","dataArr","_names","controlPosition","rewind","playInterval","SliderTimelineModel","checkpointStyle","showPlayBtn","showPrevBtn","showNextBtn","playIcon","stopIcon","nextIcon","prevIcon","prevBtnSize","nextBtnSize","TimelineView","TimelineAxis","labelDataIndexStore","SliderTimelineView","layoutInfo_1","mainGroup_1","_createGroup","labelGroup","axis_1","_createAxis","_renderAxisLabel","_position","_doPlayStop","_updateTicksStatus","_clearTimer","parsedLabelPos","labelPosOpt","playPosition","prevBtnPosition","nextBtnPosition","labelAlignMap","labelBaselineMap","rotationMap","mainLength","controlModel","showControl","controlSize","controlGap","sizePlusGap","labelAlign","labelBaseline","mainGroup","_labelGroup","rotateOriginX","rotateOriginY","viewBound","getBound","mainBound","labelBound","mainPosition","labelsPosition","mainBoundIdx","toBound","targetGroup","boundIdx","newGroup","_renderAxisLine","progressLine","_progressLine","_currentPointer","_renderAxisTick","_tickSymbols","hoverStyleModel","progressStyleModel","symbolOpt","_changeTimeline","giveSymbol","_tickLabels","hoverLabelModel","progressLabelModel","_renderControl","playState","makeBtn","willRotate","iconSize","btn","makeControlIcon","_handlePlayClick","_renderCurrentPointer","me","onCreate","_handlePointerDrag","_handlePointerDragend","pointerMoveTo","onUpdate","nextState","_pointerChangeTimeline","mousePos","toCoord","_toAxisCoord","targetDataIndex","_findNearestTick","_timer","axisCoord","tickSymbols","tickLabels","objPath","installTimelineAction","timelinePreprocessor","compatibleEC2","ec2Types","transferItem","itemStyleEmphasis","labelNormal","excludeLabelAttr","checkMarkerInSeries","seriesOpts","seriesOptArr","fillLabel","MarkerModel","createdBySelf","hostSeries","__hostSeries","markerOpt","markerModel","createMarkerModelFromSeries","getMarkerModelFromSeries","MarkPointModel","masterMarkerModel","hasXOrY","hasXAndY","markerTypeCalculatorWithExtent","otherDataDim","targetDataDim","otherCoordIndex","targetCoordIndex","coordArr","calcDataDim","numCalculate","coordArrValue","markerTypeCalculator","dataTransform","coordInfo","baseDataDim","valueDataDim","valueIndex","dataDimToCoordDim","zoneFilter","item2","createMarkerDimValueGetter","inCoordSys","sum_1","count_1","MarkerView","markerGroupMap","markKeep","drawGroup","seriesModelList","updateMarkerLayout","xPx","yPx","MarkPointView","markPointModel","mpModel","symbolDrawMap","createData","coordDimsInfos","dataOpt","MarkLineModel","markLineTransform","mlModel","itemArray","mlType","mlFrom","mlTo","normalizedItem","isInfinity","ifMarkLineHasOnlyDim","fromCoord","otherDimIndex","markLineFilter","updateSingleMarkerEndLayout","MarkLineView","markLineModel","mlData_1","fromData_1","toData_1","lineDrawMap","createList","fromData","toData","updateDataVisualAndLayout","fromSymbolKeepAspect","fromSymbolOffset","fromSymbolRotate","fromSymbolSize","toSymbolKeepAspect","toSymbolOffset","toSymbolRotate","toSymbolSize","optData","MarkAreaModel","markAreaTransform","maModel","ltCoord","rbCoord","ifMarkAreaHasOnlyDim","markAreaFilter","getSingleMarkerEndPoint","pointValue0","pointValue1","clampPointValue0","clampPointValue1","pointValue","dimPermutations","MarkAreaView","markAreaModel","areaData_1","areaGroupMap","polygonGroup","areaData","xPointExtent","yPointExtent","coordDimsInfos_1","getDefaultSelectorOptions","LegendModel","_updateSelector","_updateData","legendData","hasSelected","potentialData","availableNames","isPotential","_availableNames","legendNameMap","allSelect","inverseSelect","inactiveBorderColor","inactiveBorderWidth","borderCap","borderMiterLimit","inactiveWidth","cap","dashOffset","selectorLabel","selectorPosition","selectorItemGap","selectorButtonGap","LegendView","newlineDisabled","_contentGroup","_selectorGroup","_isFirstRender","getContentGroup","getSelectorGroup","legendModel","isFirstRender","resetInner","itemAlign","renderInner","mainRect","layoutInner","_backgroundEl","legendDrawnMap","selectMode","legendItemModel","lineVisualStyle","_createItem","dispatchSelectAction","dispatchHighlightAction","dispatchDownplayAction","_createSelector","selectorGroup","selectorItem","emphasisLabelModel","itemVisualStyle","drawType","legendIconType","getLegendStyle","getDefaultLegendIcon","hitRect","__legendDataIndex","contentRect","contentPos","selectorRect","selectorPos","orientIdx","hw","yx","handleCommonProps","propVal","iconBrushType","decalStyle","legendLineModel","visualHasBorder","symboType","isUseHoverLayer","legendFilter","legendSelectActionHandler","isToggleSelect","isItemSelected","installLegendAction","ScrollableLegendModel","setScrollDataIndex","scrollDataIndex","pageButtonItemGap","pageButtonGap","pageButtonPosition","pageFormatter","pageIcons","pageIconColor","pageIconInactiveColor","pageIconSize","pageTextStyle","ScrollableLegendView","_currentIndex","_controllerGroup","__rectSize","controllerGroup","pageIconSizeArr","createPageButton","pageTextStyleModel","iconIdx","pageDataIndexName","_pageGo","processMaxSize","_layoutContentAndController","controllerRect","showController","_showController","containerPos","controllerPos","pageInfo","_getPageInfo","pageIndex","contentPosition","_updatePageInfoView","legendId","canJump","pageText","pageCount","containerRectSize","targetItemIndex","_findTargetItemIndex","targetItem","itemCount","pCount","pagePrevDataIndex","pageNextDataIndex","targetItemInfo","getItemInfo","winStartItemInfo","winEndItemInfo","currItemInfo","itemRect","itemInfo","winStart","defaultIndex","legendDataIdx","installScrollableLegendAction","InsideZoomModel","zoomLock","setViewInfoToCoordSysRecord","getRange","coordSysRecordMap","coordSysRecord","dzInfo","dataZoomInfoMap","disposeCoordSysRecordIfNeeded","coordSysKeyArr","dzUid","disposeCoordSysRecord","createCoordSysRecord","containsPoint","dzReferCoordSysInfo","mergeControllerParams","typePriority","dataZoomInfo","oneType","installDataZoomRoamProcessor","apiInner","dzReferCoordSysWrap","dzCoordSysInfo","firstDzInfo","firstDzKey","controllerParams","InsideZoomView","pan","getRangeHandlers","scrollMove","lastRange","directionInfo","getDirectionInfo","percentPoint","signal","pixelStart","pixelLength","makeMover","getPercentDelta","percentDelta","oldPoint","newPoint","SliderZoomModel","handleIcon","moveHandleSize","moveHandleIcon","showDetail","showDataShadow","brushSelect","DEFAULT_LOCATION_EDGE_GAP","DEFAULT_FRAME_BORDER_WIDTH","DEFAULT_FILLER_SIZE","DEFAULT_MOVE_HANDLE_SIZE","HORIZONTAL","VERTICAL","LABEL_GAP","SHOW_DATA_SHADOW_SERIES_TYPE","REALTIME_ANIMATION_CONFIG","SliderZoomView","_onBrushEnd","_buildView","_updateView","_brushing","_resetLocation","_resetInterval","barGroup","sliderGroup","_renderDataShadow","_positionGroup","showMoveHandle","coordRect","_findCoordRect","_location","_size","targetAxisModel","otherAxisInverse","_dataShadowInfo","_getViewExtent","clickPanel","_onClickPanel","_onBrushStart","_prepareDataShadowInfo","dataShadowSegs","oldSize","_shadowSize","candlestickDim","polygonPts","_shadowPolygonPts","polylinePts","_shadowPolylinePts","_shadowData","_shadowDim","otherDataExtent_1","otherOffset","lastIsEmpty_1","otherShadowExtent_1","thisShadowExtent","areaPoints_1","linePoints_1","step_1","thisCoord_1","stride_1","otherCoord","createDataShadowGroup","isSelectedArea","thisAxis","getOtherDim","thisDim","handles","handleLabels","filler","_onDragMove","_onDragEnd","onmouseover","_showDataInfo","onmouseout","bRect","_handleHeight","_handleWidth","handleColor","actualMoveZone","moveHandleHeight","moveHandle_1","moveHandle","moveZoneExpandSize","moveZone","ondragstart","_range","viewExtent","_handleEnds","_updateInterval","viewExtend","nonRealtime","displaybles","handleInterval","handleHeight","segIntervals","segGroup","_updateDataInfo","dataInterval","_formatLabel","orderedHandleEnds","setLabel","barTransform","textPoint","labelPrecision","valueStr","showOrHide","changed","localPoint","_brushStart","_brushStartTime","brushShape","brushEndTime","_updateBrushRect","brushStart","endPoint","coordSysInfoList","visualDefault","VisualMapModel","replacableOptionKeys","dataBound","controllerVisuals","resetItemSize","completeVisualOption","resetVisual","getItemSymbol","getTargetSeriesIndices","optionSeriesIndex","isTargetSeries","formatValueText","edgeSymbols","isMinMax","textValue","resetExtent","getDataDimensionIndex","optDim","completeSingle","completeInactive","stateExist","stateAbsent","optExist","optAbsent","defa","completeController","symbolExists","symbolSizeExists","itemSymbol","max_1","setSelected","getSelected","getVisualMeta","getColorVisual","contentColor","textGap","DEFAULT_BAR_BOUND","ContinuousModel","_resetRange","auto","findTargetDataIndices","oVals","getColorStopValues","iVals","setStop","iIdx","oIdx","iLen","oLen","stopsLen","calculable","hoverLink","indicatorIcon","indicatorSize","indicatorStyle","stopValues","VisualMapView","autoPositionValues","doRender","getControllerVisual","visualCluster","forceState","visualObj","visualMapping","convertOpacityToAlpha","positionGroup","paramsSet","getItemAlign","modelOption","realIndex","reals","fakeValue","layoutInput","rParam","makeHighDownBatch","HOVER_LINK_SIZE","HOVER_LINK_OUT","ContinuousView","_shapes","_dataInterval","_hoverLinkDataIndices","_useHandle","_renderBar","dataRangeText","_renderEndsText","_enableHoverLinkToSeries","_enableHoverLinkFromSeries","endsIndex","shapes","_createBarGroup","gradientBarGroup","createPolygon","_dragHandle","textSize","handleThumbs","handleLabelPoints","_createHandle","_createIndicator","onDrift","onDragEnd","handleThumb","handleLabel","handleLabelPoint","indicatorLabel","indicatorLabelPoint","_firstShowIndicator","_hideIndicator","visualMapId","_hovering","_clearHoverLinkToSeries","useHoverLinkOnHandle","_doHoverLinkToSeries","forSketch","outOfRangeHandleEnds","inRangeHandleEnds","visualInRange","_createBarVisual","visualOutOfRange","barColor","barPoints","_updateHandle","_makeColorGradient","symbolSizes","_createBarPoints","handlesColor","sampleNumber","_showIndicator","cursorValue","rangeSymbol","halfHoverLinkSize","oldIndicatorPos","indicatorNewProps","labelNewProps","_hoverLinkFromSeriesMouseOver","_clearHoverLinkFromSeries","cursorPos","hoverOnBar","getHalfHoverLinkSize","hoverRange","oldBatch","newBatch","resultBatches","_dispatchHighDown","currECData","hoverLinkDataSize","hoverLinkOnHandle","visualMapActionInfo","visualMapActionHander","visualMapEncodingHandlers","resultVisual","visualMapPreprocessor","pieces","splitList","PiecewiseModel","_pieceList","_mode","_determineMode","resetMethods","_resetSelected","visualTypesInPieces","exists","getSelectedMapKey","hasSel_1","pIdx","getRepresentValue","representValue","pieceInterval","minOpen","maxOpen","outPieceList","splitStep","normalizeReverse","pieceListItem","closeList","infinityList","useMinMax","PiecewiseVisualMapView","_getItemAlign","viewData","_getViewData","endsText","viewPieceList","_onItemClick","_enableHoverLink","indexInModelPieceList","_createItemSymbol","visualState","onHoverLink","shapeParam","PiecewiseView","DEFAULT_OPTION","ariaVisual","ariaModel","setDecal","decalModel","useDecal","paletteScopeGroupByType_1","decalScope","paletteDecal","specifiedDecal","mergeDecal","dataAll_1","idxMap_1","decalScope_1","dataCount_1","resultDecal","labelLocale","ariaLabel","seriesCnt","maxDataCnt","maxSeriesCnt","displaySeriesCnt","getTitle","seriesLabels_1","seriesLabel","getSeriesTypeName","partialLabel","displayCnt","middleSeparator_1","endSeparator_1","dataLabels","dataLabel","separatorModel","middleSeparator","endSeparator","keyValues","ariaPreprocessor","RELATIONAL_EXPRESSION_OP_ALIAS_MAP","RegExpEvaluator","rVal","condValue","_condVal","lVal","ConstConditionInternal","AndConditionInternal","OrConditionInternal","NotConditionInternal","RelationalConditionInternal","needParse","valueParser","tarValRaw","valueGetterParam","tarValParsed","subCondList","parseOption","exprOption","getters","isObjectNotArray","and","parseAndOrOption","or","not","parseNotOption","parseRelationalOption","subOptionArr","prepareGetValue","exprKeys","parserName","keyRaw","valueGetterAttrMap","condValueRaw","condValueParsed","evaluator","ConditionalExpressionParsed","_cond","parseConditionalExpression","filterTransform","resultData","sortTransform","orderExprList","orderDefList","orderExpr","errMsg_2","comparator","orderDef","DatasetModel","_sourceManager","DatasetView","aroundEqual","pathToBezierCurves","currentSubpath","bezierArrayGroups","createNewSubpath","addLine","addArc","c1","x4","y4","hx","hy","nextAngle","adpativeBezier","PIXEL_DISTANCE","PIXEL_DISTANCE_SQR","dx2","dy2","cp1LenSqr","cp2LenSqr","projLen1","projLen2","d1Sqr","d2Sqr","tmpSegX","tmpSegY","pathToPolygons","beziers","getDividingGrids","rowDim","rowSize","columnSize","rowCount","currentCount","divideSector","outShapes","arcLen","isAngleRow","newShape","divideRect","isHorizontalRow","rowSizeDim","columnSizeDim","columnDim","projPtOnLine","lineA","lineB","addToPoly","splitPolygonByLine","intersections","intersectionPt","projPt","splitPt0","splitPt1","splitPt0Arr","splitPt1Arr","newPolyA","newPolyB","binaryDividePolygon","polygonShape","binaryDivideRecursive","copyPathProps","polygonConvert","OutShapeCtor","polygonCount","totalArea_1","selfCount","subPath","alignSubpath","subpath1","subpath2","shorterPath","shorterBezierCount","eachCurveSubDivCount","newSubpath","actualSubDivCount","createSubpath","lastSubpathSubpath","otherSubpath","lastY","alignBezierCurves","array1","array2","lastSubpath1","lastSubpath2","newArray1","newArray2","newSubpath1","newSubpath2","findBestRingOffset","fromSubBeziers","toSubBeziers","fromCp","toCp","bezierCount","bestScore","bestOffset","cursorOffset","findBestMorphingRotation","fromArr","searchAngleIteration","searchAngleRange","fromNeedsReverse","fromSubpathBezier","toSubpathBezier","newFromSubpathBezier","newToSubpathBezier","bestAngle","sa","ca","newX1","newY1","isCombineMorphing","__isCombineMorphing","SAVED_METHOD_PREFIX","saveAndModifyMethod","modifiers","savedMethodName","after","restoreMethod","applyTransformOnBeziers","bezierCurves","mm","subBeziers","prepareMorphPath","fromPath","toPath","fromPathProxy","toPathProxy","fromBezierCurves","toBezierCurves","fromPathTransform","toPathTransform","updateIdentityTransform","morphingData","__morphT","newCp","x0_1","y0_1","morphPath","oldDone","oldDuring","restoreToPath","hilbert","sortPaths","defaultDividePath","createEmptyReturn","fromIndividuals","toIndividuals","combineMorph","fromList","fromPathList","addFromPath","separateCount","dividePath","toSubPathList","individualDelay","identityTransform","addToSubPathListToZr","toLen","animating_1","eachDone","indivdualAnimationOpts","separateMorph","toPathList","fromLen","isMultiple","prepareMorphBatches","many","batches","batchCount","moveFrom","pathDividers","approxOpacity","applyMorphAnimation","animateOtherProps","updateAnimationCfg","fromIsMany","morphBatches","animateCount","animateIndex","morphOneBatch","forceManyOne","batchMany","batchOne","separateAnimationCfg","individualAnimationCfg","batchFrom","batchTo","getPathList","pathList_1","DATA_COUNT_THRESHOLD","getUniversalTransitionGlobalStore","getGroupIdDimension","itemGroupId","flattenDataDiffItems","groupDim","dataGroupId","divide","fadeInElement","newSeries","computedTransform","animateElementStyles","isAllIdSame","oldDiffItems","newDiffItems","oldItem","transitionBetween","oldList","updateMorphingPathProps","rawFrom","rawTo","findKeyDim","oldKeyDim","newKeyDim","hasMorphAnimation","createKeyGetter","isOld","onlyGetId","keyDim","dimOrdinalMeta","itemVal","useId","isElementStillInChart","updateOneToOne","oldIndices","oldElsList","newElsList","newSeris","getSeriesTransitionKey","seriesKey","convertArraySeriesKeyToString","getDivideShapeFromData","findTransitionSeriesBatches","globalStore","updateBatches","oldDataMap","oldDataMapForSplit","oldSeries","oldDataGroupId","oldDataGroupIds","transitionKey","transitionKeyStr","newDataGroupId","oldSeries_1","oldData_1","querySeries","transitionSeriesFromOpt","installUniversalTransition","ecMOdel","transOpt","updateBatches_1","allSeries","savedSeries","savedDataGroupIds","savedData","_withScopeId","_hoisted_6","_hoisted_7","__name","__emit","router","drawer","imgH","proteinTable","showBar","showImg","dataHistory","routerName","protein","sortTags","proteinTags","tagsColor","imgs","myChart","tagsTotal","boxTooltips","currentRoute","getProteinTable","byteArray","queryProtein","proteins","alert","tags","dataSort","obja","objb","lena","lenb","mida","midb","neatData","samples","countSingleValue","fromDatasetIndex","tissue","rowArr","imgDataUrl","urlFile","proteinName","changeShowBar","changeShowLabel","_component_el_switch","_component_el_tag","_component_el_text","_component_el_image","_component_el_tabs","_component_el_drawer","$event","onClose","fit","__exports__","configProviderContextKey","globalConfig","useGlobalConfig","useGlobalComponentSettings","sizeFallback","provideGlobalConfig","app","inSetup","oldConfig","provideFn","provide","mergeConfig","Set","formContextKey","formItemContextKey","useProp","useFormSize","fallback","emptyRef","form","useFormDisabled","useFormItem","useFormItemInputId","disableIdGeneration","disableIdManagement","idUnwatch","isLabeledByFormItem","inputIds","disableIdGeneration2","newId","removeInputId","addInputId","textProps","truncated","lineClamp","textKls","Text","ElText","UPDATE_MODEL_EVENT","CHANGE_EVENT","INPUT_EVENT","componentSizes","componentSizeMap","small","defaultIdInjection","ID_INJECTION_KEY","useIdInjection","deterministicId","idInjection","idRef","useSizeProp","required","SIZE_INJECTION_KEY","useGlobalSize","injectedSize","isNil"],"sourceRoot":""} \ No newline at end of file diff --git a/js/app.80e10092.js b/js/app.17c3c801.js similarity index 79% rename from js/app.80e10092.js rename to js/app.17c3c801.js index 14d6992..6d6d975 100644 --- a/js/app.80e10092.js +++ b/js/app.17c3c801.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e={1566:(e,t,r)=>{var n=r(9963),o=r(6252);function a(e,t){const r=(0,o.up)("router-view");return(0,o.wg)(),(0,o.j4)(r)}var i=r(3744);const s={},l=(0,i.Z)(s,[["render",a]]),d=l;var u=r(2201);const c=[{path:"/",name:"index",redirect:"/home",component:()=>Promise.all([r.e(584),r.e(838),r.e(558),r.e(443)]).then(r.bind(r,876)),children:[{path:"/datasets",name:"information",component:()=>Promise.all([r.e(584),r.e(838),r.e(757),r.e(887),r.e(518),r.e(63),r.e(985)]).then(r.bind(r,3985))},{path:"/ae",name:"overview",component:()=>Promise.all([r.e(584),r.e(838),r.e(757),r.e(887),r.e(518),r.e(355)]).then(r.bind(r,355)),children:[{path:"/ae/tissues",name:"tissues",component:()=>Promise.all([r.e(584),r.e(838),r.e(887),r.e(63),r.e(558),r.e(874)]).then(r.bind(r,7848))},{path:"/ae/cellline",name:"cellline",component:()=>Promise.all([r.e(584),r.e(838),r.e(887),r.e(63),r.e(558),r.e(874)]).then(r.bind(r,7848))}]},{path:"/home",name:"home",component:()=>Promise.all([r.e(584),r.e(757),r.e(516)]).then(r.bind(r,8226))}]}],f=(0,u.p7)({history:(0,u.PO)(),routes:c}),m=f;var p=r(3907);const h=(0,p.MT)({state:{proteinTable:[]},getters:{},mutations:{GETPROTEINS(e,t){e.proteinTable.push(...t)}},actions:{getProteins(e,t){this.commit("GETPROTEINS",t)}},modules:{}});var b=r(5781);const v=(0,n.ri)(d);m.afterEach((()=>{window.scrollTo(0,0)}));for(const g in b)v.component(g,b[g]);v.use(h).use(m).mount("#app")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[]))})(),(()=>{r.u=e=>"js/"+(443===e?"about":e)+"."+{63:"6fdd6acf",355:"ce10f859",443:"8bbff4d2",516:"ba9b126b",518:"3fe32b6d",558:"a6076914",584:"1212d975",757:"f788254e",838:"b8cbf5e6",874:"d34650df",887:"c3023593",985:"ccb555ae"}[e]+".js"})(),(()=>{r.miniCssF=e=>"css/"+(443===e?"about":e)+"."+{355:"aa7094da",443:"ed3ea2bb",516:"40bbdb8e",518:"b6714956",757:"7094cb09",874:"227f6936",985:"a8eb7918"}[e]+".css"})(),(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="quantms.org:";r.l=(n,o,a,i)=>{if(e[n])e[n].push(o);else{var s,l;if(void 0!==a)for(var d=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(m);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},m=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),(()=>{r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.p="/"})(),(()=>{if("undefined"!==typeof document){var e=(e,t,r,n,o)=>{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css";var i=r=>{if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}};return a.onerror=a.onload=i,a.href=t,r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a),a},t=(e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;nnew Promise(((o,a)=>{var i=r.miniCssF(n),s=r.p+i;if(t(i,s))return o();e(n,s,null,o,a)})),o={143:0};r.f.miniCss=(e,t)=>{var r={355:1,443:1,516:1,518:1,757:1,874:1,985:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=n(e).then((()=>{o[e]=0}),(t=>{throw delete o[e],t})))}}})(),(()=>{var e={143:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=a);var i=r.p+r.u(t),s=new Error,l=n=>{if(r.o(e,t)&&(o=e[t],0!==o&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}};r.l(i,l,"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,s,l]=n,d=0;if(i.some((t=>0!==e[t]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(l)var u=l(r)}for(t&&t(n);dr(1566)));n=r.O(n)})(); -//# sourceMappingURL=app.80e10092.js.map \ No newline at end of file +(()=>{"use strict";var e={1566:(e,t,r)=>{var n=r(9963),o=r(6252);function a(e,t){const r=(0,o.up)("router-view");return(0,o.wg)(),(0,o.j4)(r)}var i=r(3744);const s={},l=(0,i.Z)(s,[["render",a]]),d=l;var u=r(2201);const c=[{path:"/",name:"index",redirect:"/home",component:()=>Promise.all([r.e(584),r.e(838),r.e(558),r.e(443)]).then(r.bind(r,876)),children:[{path:"/datasets",name:"information",component:()=>Promise.all([r.e(584),r.e(838),r.e(757),r.e(887),r.e(518),r.e(63),r.e(985)]).then(r.bind(r,3985))},{path:"/ae",name:"overview",component:()=>Promise.all([r.e(584),r.e(838),r.e(757),r.e(887),r.e(518),r.e(355)]).then(r.bind(r,355)),children:[{path:"/ae/tissues",name:"tissues",component:()=>Promise.all([r.e(584),r.e(838),r.e(887),r.e(63),r.e(558),r.e(145)]).then(r.bind(r,5228))},{path:"/ae/cellline",name:"cellline",component:()=>Promise.all([r.e(584),r.e(838),r.e(887),r.e(63),r.e(558),r.e(145)]).then(r.bind(r,5228))}]},{path:"/home",name:"home",component:()=>Promise.all([r.e(584),r.e(757),r.e(516)]).then(r.bind(r,8226))}]}],m=(0,u.p7)({history:(0,u.PO)(),routes:c}),p=m;var f=r(3907);const h=(0,f.MT)({state:{proteinTable:[]},getters:{},mutations:{GETPROTEINS(e,t){e.proteinTable.push(...t)}},actions:{getProteins(e,t){this.commit("GETPROTEINS",t)}},modules:{}});var b=r(5781);const v=(0,n.ri)(d);p.afterEach((()=>{window.scrollTo(0,0)}));for(const g in b)v.component(g,b[g]);v.use(h).use(p).mount("#app")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(u=0;u=a)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[]))})(),(()=>{r.u=e=>"js/"+(443===e?"about":e)+"."+{63:"6fdd6acf",145:"354ab71d",355:"ce10f859",443:"8bbff4d2",516:"ba9b126b",518:"3fe32b6d",558:"a6076914",584:"1212d975",757:"f788254e",838:"b8cbf5e6",887:"c3023593",985:"ccb555ae"}[e]+".js"})(),(()=>{r.miniCssF=e=>"css/"+(443===e?"about":e)+"."+{145:"a97369a0",355:"aa7094da",443:"ed3ea2bb",516:"40bbdb8e",518:"b6714956",757:"7094cb09",985:"a8eb7918"}[e]+".css"})(),(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="quantms.org:";r.l=(n,o,a,i)=>{if(e[n])e[n].push(o);else{var s,l;if(void 0!==a)for(var d=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),(()=>{r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.p="/"})(),(()=>{if("undefined"!==typeof document){var e=(e,t,r,n,o)=>{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css";var i=r=>{if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=s,a.parentNode&&a.parentNode.removeChild(a),o(l)}};return a.onerror=a.onload=i,a.href=t,r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a),a},t=(e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;nnew Promise(((o,a)=>{var i=r.miniCssF(n),s=r.p+i;if(t(i,s))return o();e(n,s,null,o,a)})),o={143:0};r.f.miniCss=(e,t)=>{var r={145:1,355:1,443:1,516:1,518:1,757:1,985:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=n(e).then((()=>{o[e]=0}),(t=>{throw delete o[e],t})))}}})(),(()=>{var e={143:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=a);var i=r.p+r.u(t),s=new Error,l=n=>{if(r.o(e,t)&&(o=e[t],0!==o&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",s.name="ChunkLoadError",s.type=a,s.request=i,o[1](s)}};r.l(i,l,"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,s,l]=n,d=0;if(i.some((t=>0!==e[t]))){for(o in s)r.o(s,o)&&(r.m[o]=s[o]);if(l)var u=l(r)}for(t&&t(n);dr(1566)));n=r.O(n)})(); +//# sourceMappingURL=app.17c3c801.js.map \ No newline at end of file diff --git a/js/app.80e10092.js.map b/js/app.17c3c801.js.map similarity index 97% rename from js/app.80e10092.js.map rename to js/app.17c3c801.js.map index be4eda2..9df9bd6 100644 --- a/js/app.80e10092.js.map +++ b/js/app.17c3c801.js.map @@ -1 +1 @@ -{"version":3,"file":"js/app.80e10092.js","mappings":"iEACO,SAASA,EAAOC,EAAMC,GAC3B,MAAMC,GAAyB,QAAkB,eACjD,OAAO,WAAc,QAAaA,EACpC,C,cCHA,MAAMC,EAAS,CAAC,EAKVC,GAA2B,OAAgBD,EAAQ,CAAC,CAAC,SAASJ,KAEpE,I,cCNA,MAAMM,EAAS,CACb,CACEC,KAAM,IACNC,KAAM,QACNC,SAAU,QAIVC,UAAWA,IAAM,uEACjBC,SAAU,CACR,CACEJ,KAAM,YACNC,KAAM,cACNE,UAAWA,IAAM,mGAEnB,CACEH,KAAM,MACNC,KAAM,WACNE,UAAWA,IAAM,yFACjBC,SAAU,CACR,CACEJ,KAAM,cACNC,KAAM,UACNE,UAAWA,IAAM,0FAEnB,CACEH,KAAM,eACNC,KAAM,WACNE,UAAWA,IAAM,4FAIvB,CACEH,KAAM,QACNC,KAAM,OACNE,UAAWA,IAA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IACrE+E,EAAgB/E,GAAS,KAE1B+E,EAAgB/E,GAAW,EAE5B,OAAOlC,EAAoBS,EAAEC,EAAO,EAGjCqH,EAAqBC,KAAK,2BAA6BA,KAAK,4BAA8B,GAC9FD,EAAmBpD,QAAQ6C,EAAqB3C,KAAK,KAAM,IAC3DkD,EAAmBlJ,KAAO2I,EAAqB3C,KAAK,KAAMkD,EAAmBlJ,KAAKgG,KAAKkD,G,KClFvF,IAAIE,EAAsBjI,EAAoBS,OAAEN,EAAW,CAAC,MAAM,IAAOH,EAAoB,QAC7FiI,EAAsBjI,EAAoBS,EAAEwH,E","sources":["webpack://quantms.org/./src/App.vue","webpack://quantms.org/./src/App.vue?a135","webpack://quantms.org/./src/router/index.js","webpack://quantms.org/./src/store/index.js","webpack://quantms.org/./src/main.js","webpack://quantms.org/webpack/bootstrap","webpack://quantms.org/webpack/runtime/chunk loaded","webpack://quantms.org/webpack/runtime/define property getters","webpack://quantms.org/webpack/runtime/ensure chunk","webpack://quantms.org/webpack/runtime/get javascript chunk filename","webpack://quantms.org/webpack/runtime/get mini-css chunk filename","webpack://quantms.org/webpack/runtime/global","webpack://quantms.org/webpack/runtime/hasOwnProperty shorthand","webpack://quantms.org/webpack/runtime/load script","webpack://quantms.org/webpack/runtime/make namespace object","webpack://quantms.org/webpack/runtime/publicPath","webpack://quantms.org/webpack/runtime/css loading","webpack://quantms.org/webpack/runtime/jsonp chunk loading","webpack://quantms.org/webpack/startup"],"sourcesContent":["import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \"vue\";\nexport function render(_ctx, _cache) {\n const _component_router_view = _resolveComponent(\"router-view\");\n return _openBlock(), _createBlock(_component_router_view);\n}","/* unplugin-vue-components disabled */import { render } from \"./App.vue?vue&type=template&id=60de00f9\"\nconst script = {}\n\nimport \"./App.vue?vue&type=style&index=0&id=60de00f9&lang=scss\"\n\nimport exportComponent from \"../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createRouter,createWebHistory} from 'vue-router'\n\nconst routes = [\n {\n path: '/',\n name: 'index',\n redirect: '/home',\n // route level code-splitting\n // this generates a separate chunk (about.[hash].js) for this route\n // which is lazy-loaded when the route is visited.\n component: () => import(/* webpackChunkName: \"about\" */ '../layout'),\n children: [\n {\n path: '/datasets',\n name: 'information',\n component: () => import('@/views/information')\n },\n {\n path: '/ae',\n name: 'overview',\n component: () => import('@/views/overview'),\n children: [\n {\n path: '/ae/tissues',\n name: 'tissues',\n component: () => import('@/components/AeShow')\n },\n {\n path: '/ae/cellline',\n name: 'cellline',\n component: () => import('@/components/AeShow')\n }\n ]\n },\n {\n path: '/home',\n name: 'home',\n component: () => import('@/views/home')\n }\n ]\n }\n]\n\nconst router = createRouter({\n history: createWebHistory(),\n routes\n})\n\nexport default router\n","import { createStore } from 'vuex'\n\nexport default createStore({\n state: {\n proteinTable: []\n },\n getters: {\n },\n mutations: {\n GETPROTEINS(state, val) {\n state.proteinTable.push(...val)\n }\n },\n actions: {\n getProteins(context, val) {\n this.commit('GETPROTEINS',val)\n }\n },\n modules: {\n \n }\n})\n","import { createApp } from 'vue'\nimport App from './App.vue'\nimport router from './router'\nimport store from './store'\nimport * as ELIcons from '@element-plus/icons-vue'\n\nconst app = createApp(App)\nrouter.afterEach(() => {\n window.scrollTo(0, 0)\n})\nfor (const iconName in ELIcons) {\n app.component(iconName, ELIcons[iconName])\n}\napp.use(store).use(router).mount('#app')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"js/\" + (chunkId === 443 ? \"about\" : chunkId) + \".\" + {\"63\":\"6fdd6acf\",\"355\":\"ce10f859\",\"443\":\"8bbff4d2\",\"516\":\"ba9b126b\",\"518\":\"3fe32b6d\",\"558\":\"a6076914\",\"584\":\"1212d975\",\"757\":\"f788254e\",\"838\":\"b8cbf5e6\",\"874\":\"d34650df\",\"887\":\"c3023593\",\"985\":\"ccb555ae\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"css/\" + (chunkId === 443 ? \"about\" : chunkId) + \".\" + {\"355\":\"aa7094da\",\"443\":\"ed3ea2bb\",\"516\":\"40bbdb8e\",\"518\":\"b6714956\",\"757\":\"7094cb09\",\"874\":\"227f6936\",\"985\":\"a8eb7918\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"quantms.org:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","if (typeof document === \"undefined\") return;\nvar createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"355\":1,\"443\":1,\"516\":1,\"518\":1,\"757\":1,\"874\":1,\"985\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkquantms_org\"] = self[\"webpackChunkquantms_org\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], () => (__webpack_require__(1566)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["render","_ctx","_cache","_component_router_view","script","__exports__","routes","path","name","redirect","component","children","router","createRouter","history","createWebHistory","createStore","state","proteinTable","getters","mutations","GETPROTEINS","val","push","actions","getProteins","context","this","commit","modules","app","createApp","App","afterEach","window","scrollTo","iconName","ELIcons","use","store","mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","url","done","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","type","target","head","appendChild","Symbol","toStringTag","value","p","createStylesheet","fullhref","oldTag","resolve","reject","linkTag","rel","onLinkComplete","errorType","realHref","href","err","Error","code","request","insertBefore","nextSibling","findStylesheet","existingLinkTags","tag","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","error","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"js/app.17c3c801.js","mappings":"iEACO,SAASA,EAAOC,EAAMC,GAC3B,MAAMC,GAAyB,QAAkB,eACjD,OAAO,WAAc,QAAaA,EACpC,C,cCHA,MAAMC,EAAS,CAAC,EAKVC,GAA2B,OAAgBD,EAAQ,CAAC,CAAC,SAASJ,KAEpE,I,cCNA,MAAMM,EAAS,CACb,CACEC,KAAM,IACNC,KAAM,QACNC,SAAU,QAIVC,UAAWA,IAAM,uEACjBC,SAAU,CACR,CACEJ,KAAM,YACNC,KAAM,cACNE,UAAWA,IAAM,mGAEnB,CACEH,KAAM,MACNC,KAAM,WACNE,UAAWA,IAAM,yFACjBC,SAAU,CACR,CACEJ,KAAM,cACNC,KAAM,UACNE,UAAWA,IAAM,0FAEnB,CACEH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ASM,OAAQD,IACzBkB,EAAUvB,EAASK,GAChBhB,EAAoB4B,EAAEqF,EAAiB/E,IAAY+E,EAAgB/E,IACrE+E,EAAgB/E,GAAS,KAE1B+E,EAAgB/E,GAAW,EAE5B,OAAOlC,EAAoBS,EAAEC,EAAO,EAGjCqH,EAAqBC,KAAK,2BAA6BA,KAAK,4BAA8B,GAC9FD,EAAmBpD,QAAQ6C,EAAqB3C,KAAK,KAAM,IAC3DkD,EAAmBlJ,KAAO2I,EAAqB3C,KAAK,KAAMkD,EAAmBlJ,KAAKgG,KAAKkD,G,KClFvF,IAAIE,EAAsBjI,EAAoBS,OAAEN,EAAW,CAAC,MAAM,IAAOH,EAAoB,QAC7FiI,EAAsBjI,EAAoBS,EAAEwH,E","sources":["webpack://quantms.org/./src/App.vue","webpack://quantms.org/./src/App.vue?a135","webpack://quantms.org/./src/router/index.js","webpack://quantms.org/./src/store/index.js","webpack://quantms.org/./src/main.js","webpack://quantms.org/webpack/bootstrap","webpack://quantms.org/webpack/runtime/chunk loaded","webpack://quantms.org/webpack/runtime/define property getters","webpack://quantms.org/webpack/runtime/ensure chunk","webpack://quantms.org/webpack/runtime/get javascript chunk filename","webpack://quantms.org/webpack/runtime/get mini-css chunk filename","webpack://quantms.org/webpack/runtime/global","webpack://quantms.org/webpack/runtime/hasOwnProperty shorthand","webpack://quantms.org/webpack/runtime/load script","webpack://quantms.org/webpack/runtime/make namespace object","webpack://quantms.org/webpack/runtime/publicPath","webpack://quantms.org/webpack/runtime/css loading","webpack://quantms.org/webpack/runtime/jsonp chunk loading","webpack://quantms.org/webpack/startup"],"sourcesContent":["import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from \"vue\";\nexport function render(_ctx, _cache) {\n const _component_router_view = _resolveComponent(\"router-view\");\n return _openBlock(), _createBlock(_component_router_view);\n}","/* unplugin-vue-components disabled */import { render } from \"./App.vue?vue&type=template&id=60de00f9\"\nconst script = {}\n\nimport \"./App.vue?vue&type=style&index=0&id=60de00f9&lang=scss\"\n\nimport exportComponent from \"../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createRouter,createWebHistory} from 'vue-router'\n\nconst routes = [\n {\n path: '/',\n name: 'index',\n redirect: '/home',\n // route level code-splitting\n // this generates a separate chunk (about.[hash].js) for this route\n // which is lazy-loaded when the route is visited.\n component: () => import(/* webpackChunkName: \"about\" */ '../layout'),\n children: [\n {\n path: '/datasets',\n name: 'information',\n component: () => import('@/views/information')\n },\n {\n path: '/ae',\n name: 'overview',\n component: () => import('@/views/overview'),\n children: [\n {\n path: '/ae/tissues',\n name: 'tissues',\n component: () => import('@/components/AeShow')\n },\n {\n path: '/ae/cellline',\n name: 'cellline',\n component: () => import('@/components/AeShow')\n }\n ]\n },\n {\n path: '/home',\n name: 'home',\n component: () => import('@/views/home')\n }\n ]\n }\n]\n\nconst router = createRouter({\n history: createWebHistory(),\n routes\n})\n\nexport default router\n","import { createStore } from 'vuex'\n\nexport default createStore({\n state: {\n proteinTable: []\n },\n getters: {\n },\n mutations: {\n GETPROTEINS(state, val) {\n state.proteinTable.push(...val)\n }\n },\n actions: {\n getProteins(context, val) {\n this.commit('GETPROTEINS',val)\n }\n },\n modules: {\n \n }\n})\n","import { createApp } from 'vue'\nimport App from './App.vue'\nimport router from './router'\nimport store from './store'\nimport * as ELIcons from '@element-plus/icons-vue'\n\nconst app = createApp(App)\nrouter.afterEach(() => {\n window.scrollTo(0, 0)\n})\nfor (const iconName in ELIcons) {\n app.component(iconName, ELIcons[iconName])\n}\napp.use(store).use(router).mount('#app')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"js/\" + (chunkId === 443 ? \"about\" : chunkId) + \".\" + {\"63\":\"6fdd6acf\",\"145\":\"354ab71d\",\"355\":\"ce10f859\",\"443\":\"8bbff4d2\",\"516\":\"ba9b126b\",\"518\":\"3fe32b6d\",\"558\":\"a6076914\",\"584\":\"1212d975\",\"757\":\"f788254e\",\"838\":\"b8cbf5e6\",\"887\":\"c3023593\",\"985\":\"ccb555ae\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"css/\" + (chunkId === 443 ? \"about\" : chunkId) + \".\" + {\"145\":\"a97369a0\",\"355\":\"aa7094da\",\"443\":\"ed3ea2bb\",\"516\":\"40bbdb8e\",\"518\":\"b6714956\",\"757\":\"7094cb09\",\"985\":\"a8eb7918\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"quantms.org:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","if (typeof document === \"undefined\") return;\nvar createStylesheet = (chunkId, fullhref, oldTag, resolve, reject) => {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = (event) => {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = (href, fullhref) => {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = (chunkId) => {\n\treturn new Promise((resolve, reject) => {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = (chunkId, promises) => {\n\tvar cssChunks = {\"145\":1,\"355\":1,\"443\":1,\"516\":1,\"518\":1,\"757\":1,\"985\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(() => {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, (e) => {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkquantms_org\"] = self[\"webpackChunkquantms_org\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], () => (__webpack_require__(1566)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["render","_ctx","_cache","_component_router_view","script","__exports__","routes","path","name","redirect","component","children","router","createRouter","history","createWebHistory","createStore","state","proteinTable","getters","mutations","GETPROTEINS","val","push","actions","getProteins","context","this","commit","modules","app","createApp","App","afterEach","window","scrollTo","iconName","ELIcons","use","store","mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","url","done","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","type","target","head","appendChild","Symbol","toStringTag","value","p","createStylesheet","fullhref","oldTag","resolve","reject","linkTag","rel","onLinkComplete","errorType","realHref","href","err","Error","code","request","insertBefore","nextSibling","findStylesheet","existingLinkTags","tag","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","error","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","id","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file